to make this trainer we need to know something about vb6 code and api
first of all we need declares
what we shall use:
[glow=red,2,300]Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long[/glow]
with this open a process to have access on it
[glow=red,2,300]Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long[/glow]
with this we take pID of the current game
[glow=red,2,300]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[/glow]
with this we write values in memory of the proc
[glow=red,2,300]Private Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Long, ByVal lpBuffer As Long, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long[/glow]
with this code read values from proc
and finaly with this
[glow=red,2,300]Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
[/glow]
test if the game run searching windows we can make a project like if findwindow=0 then unload me
thats all about declares
now lets move to code
i have make a code for a pinball trainer cos im borring to make a another one here i copy paste it
Private Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As Long, lpBaseAddress As Any, lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten 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, lpBaseAddress As Any, lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long
Public Function ReadProc(ByVal adrs As Long, buffer As Long)
Dim PiD As Long
Dim Fhwnd As Long
Dim OpPRoC As Long
Fhwnd = FindWindow(vbNullString, "Öëßðåñ-3Ä ãéá Windows - Space Cadet")
PiD = GetWindowThreadProcessId(Fhwnd, lpdwProcessId)
OpPRoC = OpenProcess(&H10FFF, False, lpdwProcessId)
Call ReadProcessMemory(OpPRoC, adrs, buffer, 4, 0&)
Form1.Label1 = PiD
End Function
Public Function FindHwnd()
Dim Fhwnd As Long
Dim ProC As String
Dim PiD
PiD = GetWindowThreadProcessId(Fhwnd, lpdwProcessId)
Fhwnd = FindWindow(vbNullString, "Öëßðåñ-3Ä ãéá Windows - Space Cadet")
If Fhwnd = 0 Then
MsgBox "No Window Found Im Running Pinbal Now!!!!", vbExclamation, "Error"
ProC = Shell("C:\Program Files\Windows NT\Pinball\PINBALL.EXE", vbNormalFocus)
Call OpenProcess(&H10FFF, False, ProC)
End If
End Function
Public Function WriteProc(ByVal addrs As Long, val As Long)
Dim PiD As Long
Dim Fhwnd As Long
Dim OpPRoC As Long
Fhwnd = FindWindow(vbNullString, "Öëßðåñ-3Ä ãéá Windows - Space Cadet")
PiD = GetWindowThreadProcessId(Fhwnd, lpdwProcessId)
OpPRoC = OpenProcess(&H10FFF, False, lpdwProcessId)
Call WriteProcessMemory(OpPRoC, addrs, val, 4, 0&)
End Function
Form Code:
Private Sub Command1_Click()
If Timer1.Enabled = True Then
Timer1.Enabled = False
ElseIf Timer1.Enabled = False Then
Timer1.Enabled = True
End If
End Sub
Private Sub Command2_Click()
Dim Qq As Long
Qq = Text1
Call WriteProc(Combo1, Qq)
End Sub
Private Sub Form_Load()
Timer1.Enabled = False
Combo1.AddItem ("&HB73B8C")
Combo1.AddItem ("&HCEAEBA")
Combo2.AddItem ("&HB73B8C")
Combo2.AddItem ("&HCEAEBA")
Call FindHwnd
End Sub
Private Sub Timer1_Timer()
Dim QqQ As Long
Call ReadProc(Combo2, QqQ)
Text2 = Hex(QqQ)
End Sub
Private Sub Timer2_Timer()
End Sub
and dont forget to add &h before adress or if u wanna change dec to hex value stil use &H cos its not gonna work without
PS:
Dont leech my code and paste it on other forums as urs dont be -beep-ing lecheers with other's work if u wanna copy that give creds