📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 4635
ClientLeft = 60
ClientTop = 450
ClientWidth = 6930
LinkTopic = "Form1"
ScaleHeight = 4635
ScaleWidth = 6930
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "检测"
Height = 495
Left = 2760
TabIndex = 2
Top = 2640
Width = 1215
End
Begin VB.Timer Timer1
Enabled = 0 'False
Interval = 100
Left = 3120
Top = 2640
End
Begin VB.Label Label6
Caption = "名"
Height = 375
Left = 120
TabIndex = 6
Top = 1080
Width = 495
End
Begin VB.Label Label5
Caption = "蓝"
Height = 375
Left = 120
TabIndex = 5
Top = 600
Width = 495
End
Begin VB.Label Label4
Caption = "血"
Height = 375
Left = 120
TabIndex = 4
Top = 120
Width = 495
End
Begin VB.Label Label3
Caption = "Label3"
Height = 375
Left = 720
TabIndex = 3
Top = 1080
Width = 1095
End
Begin VB.Label Label2
Caption = "0"
Height = 375
Left = 720
TabIndex = 1
Top = 600
Width = 1095
End
Begin VB.Label Label1
Caption = "0"
Height = 375
Left = 720
TabIndex = 0
Top = 120
Width = 975
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hWndd As Long, lpdwProcessId As Long) As Long
Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Private Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (lpDest As Any, lpSource As Any, ByVal cBytes As Long)
Const PROCESS_ALL_ACCESS = &H1F0FFF '完全模式打开进程
Dim bTmp1(4) As Byte ' 存储显示文本
Dim hWndd As Long '保存游戏窗口句柄
Dim pid As Long '保存游戏进程ID
Dim pHandle As Long '保存游戏进程句柄
Dim Hong_NUM As Long '保存生命
Dim Lan_num As Long '保存内力
Dim lVal As Long
Dim cc(20) As Byte
Public Sub Jiankong_lan_hong() '监控红蓝
hWndd = FindWindow(vbNullString, "《武易》 内测版 - 气吞山河(电信) ") ' 取得目标窗口的句柄
If (hWndd = 0) Then
MsgBox "没有找到游戏参数"
Timer1.Enabled = False
Exit Sub
End If
GetWindowThreadProcessId hWndd, pid ' 取得窗口所在程序的进程标识符
pHandle = OpenProcess(PROCESS_ALL_ACCESS, False, pid) ' 取得进程句柄
If (pHandle = 0) Then Exit Sub
n = ReadProcessMemory(pHandle, ByVal &H654E34, bTmp1(0), UBound(bTmp1) + 1, lBytesReadWrite) ' 读取内存数据,血
If n = 0 Then
MsgBox "最大血值出错,请联系清风龙凤舞世家"
Timer1.Enabled = False
Exit Sub
End If
CopyMemory lVal, bTmp1(0), 4
Hong_NUM = lVal '显示当前人物红数据
n = ReadProcessMemory(pHandle, ByVal &H654E38, bTmp1(0), UBound(bTmp1) + 1, lBytesReadWrite) ' 读取内存数据,蓝
CopyMemory lVal, bTmp1(0), 4
Lan_num = lVal
If n = 0 Then
MsgBox "最大内力值出错,请联系清风龙凤舞世家"
Timer1.Enabled = False
Exit Sub
End If
'显示当前人物蓝数据
ReadProcessMemory pHandle, ByVal &H669948, cc(0), 20, 0& ' 读取内存数据,名字
Label3.Caption = StrConv(cc, vbUnicode)
CloseHandle pHandle ' 关闭进程句柄
End Sub
Private Sub Command1_Click()
Timer1.Enabled = True
End Sub
Private Sub Form_Load()
Hong_NUM = 0
Lan_num = 0
End Sub
Private Sub Timer1_Timer()
Jiankong_lan_hong
Label1.Caption = Hong_NUM
Label2.Caption = Lan_num
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -