[VB6 ] 寫植物大戰殭屍修改器

看板Visual_Basic作者 (kenny)時間16年前 (2010/02/12 11:20), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
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 Declare Function WriteProcessMemory Lib "kernel32.dll" ( _ 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 ReadProcessMemory Lib "kernel32.dll" ( _ 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 CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long Dim o1 As Long, o2 As Long, o3 As Long, GG As Long, a As Long Private Sub Command1_Click() Timer1.Enabled = True End Sub Private Sub Form_Load() Me.Caption = "修改器" '定義標題 Timer2.Enabled = False End Sub Private Sub Timer1_Timer() o1 = FindWindow(vbNullString, "Plants vs. Zombies") '遊戲名稱 最重要 If o1 <> 0 Then Label1.Caption = "成功讀取遊戲!!" Else Label1.Caption = "讀取遊戲失敗!!" End If Call GetWindowThreadProcessId(o1, o2) If o2 <> 0 Then Label2.Caption = "成功讀取PID值!!" Else Label2.Caption = "讀取PID值失敗!!" End If o3 = OpenProcess(PROCESS_ALL_ACCESS, False, o2) If o3 <> 0 Then Label3.Caption = "成功取得程式控制權!!" Else Label3.Caption = "取得程式控制權失敗!!" End If Call ReadProcessMemory(o3, ByVal &HF97DC8 + &H768, GG, 4, 0&) '第一層偏移量 Call ReadProcessMemory(o3, ByVal GG + &H160, GG, 4, 0&) Call ReadProcessMemory(o3, ByVal GG + &H4, GG, 4, 0&) Call ReadProcessMemory(o3, ByVal GG + &H5560, GG, 4, 0&) Label4.Caption = GG Dim AA As Long Call WriteProcessMemory(o3, AA, GG, 4, 0&) ' 目前我用CE找好陽光的偏移量 ' 讀取遊戲和陽光數值都沒問題 ' 用CE可以但是用VB就是無法寫入....是我語法有錯誤還是遊戲本身的問題呢?? ' 希望大家幫我看看 謝謝:D Label5.Caption = AA Call CloseHandle(o3) End Sub -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 219.81.192.13
文章代碼(AID): #1BTCZuuZ (Visual_Basic)
文章代碼(AID): #1BTCZuuZ (Visual_Basic)