Could someone tell me how this shit is used,what parameters it has and give me an example plx? (I want it to create an IP changer)
Thanks.
Thanks.
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, ByRef lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Sub Form_load()
Me.Caption = ReadMemory(&H6059CC)
End Sub
Private Function tHvnd() As Long
tHvnd = FindWindow("tibiaclient", vbNullString)
End Function
Private Function ReadMemory(Address As Long) As Long
Dim ProcessID As Long, processHandle As Long
If tHvnd = 0 Then Exit Function
GetWindowThreadProcessId tHvnd, ProcessID
processHandle = OpenProcess(&H10, False, ProcessID)
If processHandle = 0 Then Exit Function
ReadProcessMemory processHandle, Address, ReadMemory, 4, 0&
CloseHandle processHandle
End Function
First try to read the memory. This is an example created by Praetox to get your hp.
Code: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, ByRef lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Sub Form_load() Me.Caption = ReadMemory(&H6059CC) End Sub Private Function tHvnd() As Long tHvnd = FindWindow("tibiaclient", vbNullString) End Function Private Function ReadMemory(Address As Long) As Long Dim ProcessID As Long, processHandle As Long If tHvnd = 0 Then Exit Function GetWindowThreadProcessId tHvnd, ProcessID processHandle = OpenProcess(&H10, False, ProcessID) If processHandle = 0 Then Exit Function ReadProcessMemory processHandle, Address, ReadMemory, 4, 0& CloseHandle processHandle End Function
Now you got an example of reading the memory. Writing is almost the same.
btw this is VB6 I don't know what version you need.
hProcess A handle to the process memory to be modified. The handle must have PROCESS_VM_WRITE and PROCESS_VM_OPERATION access to the process.
lpBaseAddress A pointer to the base address in the specified process to which data is written. Before data transfer occurs, the system verifies that all data in the base address and memory of the specified size is accessible for write access, and if it is not accessible, the function fails.
lpBuffer A pointer to the buffer that contains data to be written in the address space of the specified process.
nSize The number of bytes to be written to the specified process.
lpNumberOfBytesWritten A pointer to a variable that receives the number of bytes transferred into the specified process. This parameter is optional. If lpNumberOfBytesWritten is NULL, the parameter is ignored.
@up maby google isnt his friend ;(