我这有一段vb的程序你看看,<br>Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, ByVal lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long<br>Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, ByVal lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long<br><br><br>Function DoFirstSearch(s As String) As Integer<br><br>Dim c As Integer<br>Dim addr As Long<br>Dim buffer As String * 5000<br>Dim readlen As Long<br>Dim strHex As String<br><br>Open "c:/cheat.mem" For Output As #1: Close #1 ' kill if exists<br>Open "c:/cheat.mem" For Random As #1 Len = Len(addr)<br><br>'count of results<br>c = 0<br><br>For addr = 0 To 65535 ' loop through buffers<br><br>Call ReadProcessMemory(myHandle, addr * 5000, buffer, 5000, readlen)<br><br>If addr Mod 656 = 0 Then<br>'update status<br> frmMain.lblStatus.Caption = "Searching %" & Trim(Str(Int(addr / 400)))<br> DoEvents<br>End If<br><br>'if read successfull<br>If readlen > 0 Then<br> startpos = 1<br> 'find all search string in buffer<br> While InStr(startpos, buffer, Trim(s)) > 0<br> p = (addr) * 5000 + InStr(startpos, buffer, s) - 1 ' position of string<br> Debug.Print addr<br> Debug.Print p<br> Debug.Print buffer<br> strHex = Hex$(p)<br> Put #1, , CLng(p) ' put address in file for later searches<br> c = c + 1 ' increase counter<br> If c < 20 Then frmMain.lstResults.AddItem Format(strHex, "00000000")<br> startpos = InStr(startpos, buffer, Trim(s)) + 1 ' find next position<br> Wend<br>End If<br><br>'next buffer<br>Next addr<br><br>'Update status<br> frmMain.lblStatus.Caption = "Search Done."<br><br>'close file<br>Close #1<br><br>DoFirstSearch = c<br><br>End Function<br><br><br><br>Function InitProcessCheater(pid As Long)<br><br>pHandle = OpenProcess(&H1F0FFF, False, pid)<br><br>If (pHandle = 0) Then<br> InitProcessCheater = False<br> myHandle = 0<br>Else<br> InitProcessCheater = True<br> myHandle = pHandle<br>End If<br><br>End Function<br><br><br>我的程序中的部分代码。<br>