Gametrainer

Sniperdennis

Mitglied
Hallo,
undzwar hab ich vor für ein Spiel ein Trainer zu machen. Ich hab bissher nur mit einem einfachen tool (Trainer Maker Kit) parr Trainer für andere Games gemacht. Doch nun bin ich an die grenzen des Tools gestoßen und komm an einer stelle nicht weiter und will zu Visual Basic greifen was mir die sache viel schwieriger macht da ich in VB6 nicht gut bin und darum bitte ich um eure Hilfe.
Mein Problem ist das ich zwischen einer Adresse(00F60000-00F6FFFF) einen Wert(30) freezen will. Da dieser Wert zwischen den Adresse hin und her schwankt kann ich es mit dem Tool nicht machen. Und noch was wichtiges zwischen den Adressen gibt es nur einen Wert mit der Zahl 30 und nicht mehrere was die Sache eigentlich um so leichter machen sollte. Ich hoffe ihr könnt mir helfen.

MfG Sniperdennis
 
Dazu gibts die ReadProcessMemory-API, mit der kannst du die Speicherstellen eines Prozesses durchsuchen. Mit der WriteProcessMemory kannst du dann die gefundene Stelle beschreiben.

Tutorial dazu hab ich jetzt keines gefunden, musst mal danach suchen.


Der Doc!
 
Jo, danke. Ich hab jetzt was gefunden nur versteh ich das nicht ganz. So wie ich das sehe ist das für eine bestimmte Adresse und nicht zwischen zwei Adressen.

Code:
Private Const PROCESS_ALL_ACCESS As Long = &H1F0FFF
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 ReadProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
Private Declare Function WriteString Lib "kernel32" Alias "WriteProcessMemory" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, ByVal lpBuffer As Any, ByVal nSize As Long, ByVal lpNumberOfBytesWritten As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
'Private Declare Function WriteValue Lib "kernel32" Alias "WriteProcessMemory" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, lpBuffer As Any, ByVal nSize As Long, ByVal lpNumberOfBytesWritten As Long) As Long

Private Sub Command1_Click()
    Dim str As String, MyString As String
    MyString = "HELLO"
    'in this case I read the memory of my own process
    MsgBox "MyString= " & MyString
   
    str = ReadMemory(Me.hWnd, StrPtr(MyString), LenB(MyString), "BYE!!")
   
    MsgBox "Now, MyString=" & MyString & vbCr & "Old Value= " & str
   
End Sub
Private Function ReadMemory(hWnd As Long, Address As Long, Bytes As Long, Optional strReplaceWith As String) As String
    'Runs For Not Unicode Strings (VB-Strings)
    On Error Resume Next
    Dim pId As Long        ' Used to hold the Process Id
    Dim pHandle As Long    ' Holds the Process Handle
    Dim bytValue As Long   'Stores the value of a byte in the memory
    Dim i As Long
    Dim Text As String
   
    ' Get the ProcId of the Window
    GetWindowThreadProcessId hWnd, pId

    ' use the pId to get a handle
    pHandle = OpenProcess(PROCESS_ALL_ACCESS, False, pId)
   
    If (pHandle = 0) Then
         'MsgBox "Unable to open process!"
         Exit Function
    End If
    If Address = 0 Then Exit Function
   
    For i = 1 To Bytes Step 2
       ' Read Byte to Byte
       ReadProcessMemory pHandle, Address + i - 1, bytValue, 1, 0&
       'value now contains the long value of the byte located in [Address + i - 1] pos.
       'ReadMemory is a string...
      
       ReadMemory = ReadMemory & Chr$(bytValue)
    Next
    'to write numeric values you can ..(Must) use WriteValue API
    If LenB(strReplaceWith) <> 0 Then
        'No Unicode!!
        WriteString pHandle, Address, StrPtr(strReplaceWith), LenB(strReplaceWith), 0&
    End If
    'Close the Handle
    CloseHandle pHandle
End Function

MfG Sniperdennis
 
Du musst in dem Fall mittels einer Schleife die Adressen auslesen und prüfen, ob dein Wert dabei ist, wenn ja dann kannst du die Adresse merken und dann freezen.


Der Doc!
 
Zurück