anath3ma Posted March 25, 2008 Posted March 25, 2008 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 Quote
yomama Posted March 25, 2008 Posted March 25, 2008 and what that trainer do? i mean what you can do with it, maybe you could explain some of those code so the people )like me) who are just getting into world of programing can undestand a little better :D Quote
anath3ma Posted March 26, 2008 Author Posted March 26, 2008 if u are using greek windows edit this line WinWnd = FindWindow(vbNullString, "Öëßðåñ-3Ä ãéá Windows - Space Cadet") with ur pinball window name very simple with this u can add some score on ur pinball &HB73B8C, &H3B9AC9FF,4 addres and value 4bytes Quote
damy3n Posted August 4, 2008 Posted August 4, 2008 there is still no answer what does this trainer do just writeing procs and reading? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.