|
|

楼主 |
发表于 2006-4-24 14:44:00
|
显示全部楼层
Re:这个代码我试过很多次只对真封神有作用 对三国无效
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd 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 Sub Sleep Lib "kernel32" (ByVal dwmilliseconds As Long)
Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long
Private Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
Private Function ncnr(lpADDress As Long) As Long
Dim hwnd As Long
Dim pid As Long
Dim pHandle As Long
hwnd = FindWindow(vbNullString, "三国群英传OnLine")
hwnd = SetForegroundWindow(hwnd)
GetWindowThreadProcessId hwnd, pid
pHandle = OpenProcess(PROCESS_ALL_ACCESS, False, pid)
ReadProcessMemory pHandle, lpADDress, ByVal VarPtr(ncnr), 4, 0&
CloseHandle hProcess
End Function
Private Function xr(lpADDress As Long, Zhi As Integer) As Integer
Dim hwnd As Long
Dim pid As Long
Dim pHandle As Long
hwnd = FindWindow(vbNullString, "三国群英传OnLine")
hwnd = SetForegroundWindow(hwnd)
GetWindowThreadProcessId hwnd, pid
pHandle = OpenProcess(PROCESS_ALL_ACCESS, False, pid)
WriteProcessMemory pHandle, lpADDress, Zhi, 1, 0&
CloseHandle hProcess
End Function
以上代码是对三国群英传的 这个游戏我正在玩 |
|