宣告
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString 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 Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Private Declare Function ReadProcessMemory Lib "kernel32.dll" (ByVal hProcess As Long, ByVal lpBaseAddress As Long, ByRef lpBuffer As Any, ByVal nSize As Long, ByRef lpNumberOfBytesWritten As Long) As Long
Private Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As Long, lpBaseAddress As Any, lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
以下是那出了問題?下面是兩個程式,是跳躍跟建築隱藏,基址是跟大大寫的貼上,但只有跳躍能用; 試建築完美就給彈走了YCT44B 是那裡騙錯了YCT62B 請大大們幫忙YCT41B 解釋錯在那YCT65B
Private Sub Check1_Click()
hProcess = OpenProcess(PROCESS_ALL_ACCESS, False, pid)
If Check1.Value = 1 Then
WriteProcessMemory hProcess, ByVal &H452C16, &H1, 1, 0& '開啟
Else
WriteProcessMemory hProcess, ByVal &H452C16, &HA, 1, 0& '關閉
End If
CloseHandle hProcess
End Sub
----------------------------------------------------
Private Sub Check2_Click()
hProcess = OpenProcess(PROCESS_ALL_ACCESS, False, pid)
If Check2.Value = 1 Then
WriteProcessMemory hProcess, ByVal &H422028, &H1, 1, 0& '開啟
Else
WriteProcessMemory hProcess, ByVal &H422028, &HA, 1, 0& '關閉
End If
CloseHandle hProcess
End Sub |