Results 1 to 3 of 3

Thread: [RESOLVED] noob question about memory address value editing

  1. #1

    Thread Starter
    Lively Member deranged's Avatar
    Join Date
    Jun 2004
    Location
    TN
    Posts
    104

    [RESOLVED] noob question about memory address value editing

    Ok. i want to make a trainer for a game. I have a collection of some memory addresses i've collected. I wanna know the string of code i use to change it. I do have a module with this as code:

    VB Code:
    1. Private Const PROCESS_ALL_ACCESS = &H1F0FFF
    2. Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long
    3. Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
    4. 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
    5. Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
    6. Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal Classname As String, ByVal WindowName As String) As Long
    7. Private Declare Function ReadProcessMem Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, ByRef lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
    8. Public Declare Function GetKeyPress Lib "user32" Alias "GetAsyncKeyState" (ByVal key As Long) As Integer
    9. Public Declare Function GetAsyncKeyState Lib "user32.dll" (ByVal vKey As Long) As Integer
    10. Public Declare Sub keybd_event Lib "user32.dll" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
    11. Public Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
    12.  
    13. ---------------
    14.  
    15. Public Sub WriteAInt(Address As Long, Value As Long)
    16. Dim hwnd As Long, pid As Long, phandle As Long
    17. 'PSO for PC is the window name
    18. hwnd = FindWindow(vbNullString, "PSO for PC")
    19. If (hwnd <> 0) Then
    20. GetWindowThreadProcessId hwnd, pid
    21. phandle = OpenProcess(PROCESS_ALL_ACCESS, False, pid)
    22. If (phandle <> 0) Then
    23. WriteProcessMemory phandle, Address, Value, 4, 0&
    24. End If
    25. CloseHandle phandle
    26. End If
    27. End Sub

    And lots of declarations in the module. This module was made to create trainers for a game called Phantasy Star Online. i can easily use

    VB Code:
    1. Call WriteAInt(address, value)

    to edit a memory value for PSO.
    I want to be able to edit the memory address values for a different game. How do i convert?
    Last edited by deranged; Jun 10th, 2004 at 11:48 AM.

  2. #2
    Fanatic Member
    Join Date
    Dec 2003
    Posts
    703
    Change the string you pass to FindWindow to the one for your game
    an ending

  3. #3

    Thread Starter
    Lively Member deranged's Avatar
    Join Date
    Jun 2004
    Location
    TN
    Posts
    104
    OMG i'm so sorry for waisting your time! I tried that first off! but i forgot to add '&h" to the addresses and values. Your solution worked thanks though!
    Last edited by deranged; Jun 10th, 2004 at 11:48 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width