Making a trainer for executable files

All tutorials created in VB6 to be posted in here.
17 posts Page 1 of 2
Contributors
User avatar
Shotbot
Just Registered
Just Registered
Posts: 1
Joined: Sun May 01, 2011 8:28 pm

----------------------------------------------------------------------------------------------------------------------------------------------
>.:|Question, Have You Ever Wanted To Make A Trainer For A .EXE Game With The Customizable Options Of VB06?|:.<
----------------------------------------------------------------------------------------------------------------------------------------------
>.:|Answer, Now You Can By Following This Guide!|:.<
----------------------------------------------------------------------------------------------------------------------------------------------

Here is what you need to know.
1. The address of the "hack".
2. The value of the "hack".
3. The game that you want to make a trainer for.

Here is what you NEED.
1. Visual Basics 6 Professional/Portable (Portable's kinda buggy)
2. Basic Knowledge of Visual Basics. Here You Go
3. A Brain Here You Go

Finally, Here is how you do it.
1. Start Visual Basics 6 [ I Hope You Don't Need A Picture For This ]
2. Click Standard Exe And Hit The Open Button [ I Hope You Don't Need A Picture For This ]
3. Right Click Form 1 On The Side Move Your Mouse Up To Add Then Click Module >> Image
4. In The Box That Opens Input The Following Code
Code: Select all
Private Const PROCESS_ALL_ACCESS = &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
Private 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 Declare Function GetKeyPress Lib "user32" Alias "GetAsyncKeyState" (ByVal key As Long) As Integer
Public Declare Function GetAsyncKeyState Lib "user32.dll" (ByVal vKey As Long) As Integer
Public Declare Sub keybd_event Lib "user32.dll" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Public Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long

Public Sub WriteAInt(Address As Long, Value As Integer)
Dim hwnd As Long, pid As Long, phandle As Long
hwnd = FindWindow(vbNullString, "REPLACEMEWITHTHEWINDOWNAME")
If (hwnd <> 0) Then
GetWindowThreadProcessId hwnd, pid
phandle = OpenProcess(PROCESS_ALL_ACCESS, False, pid)
If (phandle <> 0) Then
WriteProcessMemory phandle, Address, Value, 2, 0&
End If
CloseHandle phandle
End If
End Sub
5. Input The Window Name Of The Game You Want To Hack Where It Says REPLACEMEWITH... Image
6. To Find Out The Window Name Press Alt+Ctrl+Delete To Open The Task Manager And Run The Game It Will Say The Games Name (I Will Use MineSweeper For An Example).
Image
7. Make A Button And Input The Following Code
Code: Select all
Call WriteAInt (&HADRESSHERE, &HVALUEHERE)
Adjust Accordingly KEEP THE H's!
8. You Can Add As Many Buttons As You Want
9. Customize To Fit Your Needs
10. Go Ahead And Compile Your Project [ I Will Assume You Know How ]
11. Feel Free To Share It With Us :]
12. ????
13. Profit!

Well Now That You Know How, Why Are You Not Doing It Yet?

Notes:
Code: Select all
-No, i won't give the links to VB6 as they are warez.
-To get the addresses, i recommend you use Cheat Engine
Credits to +=Marvin=+ from shotbot!
User avatar
CleverBoy
VIP - Donator
VIP - Donator
Posts: 395
Joined: Mon Dec 06, 2010 8:29 pm

Nice tutorial but it will be better if :
1-You translate that in VB.NET (Most of us use that)
2-Explain the codes.

Thanks
Code'N'Stuff
OneTeam..OneDream
Join ABSplash Team & Earn $$
ABSplash Site - Workpad - (VB) Custom Buttons 2 ways
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

If you do need this in VB.Net then it might be worth posting in the VB.Net section.

Anyway the basics of this are simple; its all in the WriteAInt function.
FindWindow will get the handle of a window, GetWindowThreadProcessId will then use this handle to retrieve the owning process's PID. Next OpenProcess will use this PID to get the handle of the process. Finally WriteProcessMemory will use the process's handle to write a value to the process's memory at the specified address.
GoodGuy17
Coding God
Coding God
Posts: 1610
Joined: Mon Sep 07, 2009 12:25 am

Looks a bit like this. Might wanna credit the right creator?
User avatar
upperdrag
Excellent Poster
Excellent Poster
Posts: 321
Joined: Fri Mar 12, 2010 12:05 pm

I thought its illegal for making trainers??
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

It is not illegal to make a program to modify memory that you are "allowed" to change.
User avatar
Bogoh67
VIP - Site Partner
VIP - Site Partner
Posts: 656
Joined: Sun Apr 18, 2010 8:20 pm

i thought it was against forums rules to post about hacking
User avatar
Axel
Coding God
Coding God
Posts: 1928
Joined: Sun Jun 27, 2010 9:15 pm

memory hacking is not the kind of hacking thats illegal
the better word for it is "Memory manipulation"
http://vagex.com/?ref=25000
User avatar
upperdrag
Excellent Poster
Excellent Poster
Posts: 321
Joined: Fri Mar 12, 2010 12:05 pm

Gahh.... I've made a trainer with it last year.. probably i'll post a tutorial
GoodGuy17
Coding God
Coding God
Posts: 1610
Joined: Mon Sep 07, 2009 12:25 am

I've never made a trainer for an executable file, but I have made one for an MMORPG before... it was a Flash game, and it was just simply editing variables for the cheats. An example would be:
Code: Select all
FlashPlayer.SetVariable("root.PlayerName", "Hank")
Of course, the variables were never that simple.

But this seems a LOT harder. Could this be used to cheat games like Halo and Call of Duty on the PC?
17 posts Page 1 of 2
Return to “VB6 Tutorials”