用vb查找内存地址的数值

来源:百度知道 编辑:UC知道 时间:2024/09/22 15:28:09
Private Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Long, ByRef lpBuffer As Long, ByVal nSize As Long, ByRef lpNumberOfBytesWritten As Long) As Long
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 hwnd 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 Const PROCESS_ALL_ACCESS = &H1F0FFF

Private game As Long
Private t As Long
Private y As Long
Private Sub Form_Click()
game = FindWindow("Afx:13a0000:8:10011:0:0", "游戏")
GetWindowThreadProcessId game, pid
pHandle = OpenProcess(&H1F0FFF, False, pid)
l =

你不是写了吗?
GetWindowThreadProcessId game, pid
这个为什么这么写 没看懂

你写的很不严谨
对 FindWindow返回值没有判断啊~还有后边几个函数都是的,特别是读写进程内存时很有可能因权限的问题失败,你要判断也好知道哪出问题,每个返回后判断下,如果不正常把这里的信息显示出来也好清楚你哪有问题,你调用的几个函数任一一个出问题都不正确啊