Originally Posted by
Jabberwo0ck
This one is color based. Unless you have chams made to the game you can't use this.
yeah, I'm working on memory based right now.
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 WriteProcessMemory 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 CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Public Declare Function FindWindow Lib "User32" Alias "FindWindowA" (ByVal Classname As String, ByVal WindowName As String) As Long
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
Public Function WriteByte(Offset As Long, Value As Byte) As Boolean
Dim hwnd As Long
Dim ProcessID As Long
Dim ProcessHandle As Long
hwnd = FindWindow(vbNullString, "")
If hwnd = 0 Then
Exit Function
End If
GetWindowThreadProcessId hwnd, ProcessID
ProcessHandle = OpenProcess(PROCESS_ALL_ACCESS, False, ProcessID)
If ProcessHandle = 0 Then
Exit Function
End If
WriteProcessMemory ProcessHandle, Offset, Value, 1, 0&
CloseHandle ProcessHandle
End Function
Public Function ReadInteger(Offset As Long) As Integer
Dim hwnd As Long
Dim ProcessID As Long
Dim ProcessHandle As Long
Dim Value As Integer
hwnd = FindWindow(vbNullString, "")
If hwnd = 0 Then
Exit Function
End If
GetWindowThreadProcessId hwnd, ProcessID
ProcessHandle = OpenProcess(PROCESS_ALL_ACCESS, False, ProcessID)
If ProcessHandle = 0 Then
Exit Function
End If
ReadProcessMem ProcessHandle, Offset, Value, 2, 0&
ReadInteger = Value
CloseHandle ProcessHandle
End Function
Public Function WriteInteger(Offset As Long, Value As Integer) As Boolean
Dim hwnd As Long
Dim ProcessID As Long
Dim ProcessHandle As Long
hwnd = FindWindow(vbNullString, "")
If hwnd = 0 Then
Exit Function
End If
GetWindowThreadProcessId hwnd, ProcessID
ProcessHandle = OpenProcess(PROCESS_ALL_ACCESS, False, ProcessID)
If ProcessHandle = 0 Then
Exit Function
End If
WriteProcessMemory ProcessHandle, Offset, Value, 2, 0&
CloseHandle ProcessHandle
End Function