⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.frm

📁 VB编的一个war3防秒退程序 内附使用说明
💻 FRM
📖 第 1 页 / 共 2 页
字号:
VERSION 5.00
Begin VB.Form Form1 
   AutoRedraw      =   -1  'True
   BackColor       =   &H00808080&
   BorderStyle     =   0  'None
   Caption         =   "Form1"
   ClientHeight    =   3960
   ClientLeft      =   3075
   ClientTop       =   4425
   ClientWidth     =   7755
   ForeColor       =   &H8000000E&
   Icon            =   "Form1.frx":0000
   KeyPreview      =   -1  'True
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3960
   ScaleWidth      =   7755
   Begin VB.Timer Timer1 
      Enabled         =   0   'False
      Interval        =   50
      Left            =   240
      Top             =   3000
   End
   Begin VB.Frame Frame1 
      BackColor       =   &H00808080&
      ForeColor       =   &H8000000E&
      Height          =   2775
      Left            =   240
      TabIndex        =   0
      Top             =   720
      Width           =   7455
      Begin VB.Frame Frame4 
         BackColor       =   &H80000012&
         Caption         =   "方式"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H8000000E&
         Height          =   1215
         Index           =   1
         Left            =   5160
         TabIndex        =   10
         Top             =   240
         Width           =   1815
         Begin VB.OptionButton Option2 
            BackColor       =   &H00000000&
            Caption         =   "倒计时为0时暂停"
            BeginProperty Font 
               Name            =   "宋体"
               Size            =   9
               Charset         =   134
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H8000000E&
            Height          =   375
            Index           =   1
            Left            =   120
            TabIndex        =   13
            Top             =   600
            Width           =   1095
         End
         Begin VB.OptionButton Option2 
            BackColor       =   &H00000000&
            Caption         =   "不倒计时"
            BeginProperty Font 
               Name            =   "宋体"
               Size            =   9
               Charset         =   134
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H8000000E&
            Height          =   375
            Index           =   0
            Left            =   120
            TabIndex        =   11
            Top             =   240
            Value           =   -1  'True
            Width           =   1575
         End
      End
      Begin VB.Frame Frame3 
         BackColor       =   &H80000012&
         ForeColor       =   &H8000000E&
         Height          =   855
         Left            =   5160
         TabIndex        =   4
         Top             =   1560
         Width           =   1815
         Begin VB.CommandButton Command2 
            Caption         =   "Off"
            BeginProperty Font 
               Name            =   "宋体"
               Size            =   9
               Charset         =   134
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   495
            Left            =   960
            TabIndex        =   12
            Top             =   240
            Width           =   615
         End
         Begin VB.CommandButton Command1 
            Caption         =   "On"
            BeginProperty Font 
               Name            =   "宋体"
               Size            =   9
               Charset         =   134
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   495
            Left            =   240
            TabIndex        =   5
            Top             =   240
            Width           =   615
         End
      End
      Begin VB.Label Label1 
         BackStyle       =   0  'Transparent
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000007&
         Height          =   360
         Index           =   1
         Left            =   360
         TabIndex        =   9
         Top             =   2400
         Width           =   4695
      End
      Begin VB.Label Label3 
         BackColor       =   &H80000012&
         BackStyle       =   0  'Transparent
         BorderStyle     =   1  'Fixed Single
         Caption         =   "Label3"
         ForeColor       =   &H8000000E&
         Height          =   2055
         Index           =   3
         Left            =   240
         TabIndex        =   8
         Top             =   240
         Width           =   4695
      End
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      BackColor       =   &H00000000&
      Caption         =   "WC-QuickStart"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   180
      Index           =   2
      Left            =   120
      TabIndex        =   7
      Top             =   120
      Width           =   1365
   End
   Begin VB.Label Label2 
      BackColor       =   &H80000012&
      Caption         =   "?"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H8000000E&
      Height          =   255
      Index           =   3
      Left            =   6720
      TabIndex        =   6
      Top             =   120
      Width           =   135
   End
   Begin VB.Line Line1 
      BorderColor     =   &H80000009&
      BorderWidth     =   2
      X1              =   0
      X2              =   7800
      Y1              =   480
      Y2              =   480
   End
   Begin VB.Label Label2 
      BackColor       =   &H80000012&
      Caption         =   " X"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H8000000E&
      Height          =   255
      Index           =   1
      Left            =   7200
      TabIndex        =   2
      Top             =   120
      Width           =   255
   End
   Begin VB.Label Label2 
      BackColor       =   &H80000012&
      Caption         =   "_____"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H8000000E&
      Height          =   255
      Index           =   0
      Left            =   6960
      TabIndex        =   1
      Top             =   120
      Visible         =   0   'False
      Width           =   135
   End
   Begin VB.Label Label2 
      BackColor       =   &H8000000D&
      Height          =   495
      Index           =   2
      Left            =   0
      TabIndex        =   3
      Top             =   0
      Width           =   7815
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'原理:从倒计时到Loading,主机War3发送2次数据:1次是“开始倒计时吧”,一次是“Loading吧”,就是说Loading由主机决定。
'找到控制倒计时的CALL在War3.Game.dll-&H6F23D200(由字符串下硬件断点然后CTRL+F9直到第一个select case出现即为控制CALL;也可从Send下断CTRL+F9找),
'发现这个select case由ECX决定执行哪段代码:点击“开始”时ECX为0,倒计时时5-3时为6,倒计时2-0时为2,Loading时为3,退出时主要为12。
'修改和增加代码控制这个select case的ECX值,当ECX=3时(即倒计时=0时)就控制了是Loaing还是退出,或者用循环来等待玩家做决定
'修改在War3.Game.dll-&H6F23D200,增加的代码在War3.Game.dll-&H6F704BB0。





'&&&&&&&&&&
'变量前带L_的是局部变量
'带G_的是全局变量
'什么都不带的变量不重要
'带ProcF_的是Call
'clsmem1是那个类的实例,大部分API在里面调用



Option Explicit

    
Private Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function Shell_NotifyIcon Lib "shell32.dll" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, lpData As NOTIFYICONDATA) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As Integer

Private Type NOTIFYICONDATA
      cbSize As Long
      hwnd As Long
      uID As Long
      uFlags As Long
      uCallbackMessage As Long
      hIcon As Long
      szTip As String * 200
End Type





'====my Struct====================================

Private Type AppMsg
    title As String
    explain As String
    explain2 As String
    formname As String
    
End Type

'=========my Var

Dim nfIconData As NOTIFYICONDATA                    '
Dim ClsMem1 As New Class1
'====end var



Private Sub Command1_Click()                        '写入代码,修改跳转等,call ProcF_WriteProcess()
If ClsMem1.FindWindowcls("Warcraft III") = 0 Then
Label1(1).Caption = "魔兽争霸没有运行 " & Time
Exit Sub
End If


If ProcF_WriteProcess() = 1 Then                      '写入
Label1(1).Caption = "On " & Time
Else
Debug.Print "写入目标失败"
End If

Frame3.Caption = "ON"
Timer1.Enabled = True
End Sub


Private Sub Command2_Click()                        '恢复,OFF
Dim l_HandleOpen As Long
Dim l_WindowName As String

l_WindowName = "WarCraft III"
l_HandleOpen = ClsMem1.OpenHandleByWin(l_WindowName, vbNullString)

If l_HandleOpen = 0 Then
Label1(1).Caption = "魔兽争霸没有运行 " & Time

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -