How to make a trainer.

Does anybody on this forum know how to make a video game trainer in c++ (using visual c++ express) I would like to know how to do this. I know it is not impossible. I have searched the internet and all the examples I could find are either extremely old or they are for asm (which I do not know). I am fluent in vb and vb.net, if that matters.

If someone would be nice enough to explain the process to me, it would be great. Thank you.




Answer this question

How to make a trainer.

  • Hoop

    I already have a method for finding which addresses I need to edit.
    And, as for Google, I have tried searching. All the examples I have found have been for old c++ versions. I am looking for a way I can do it in Visual C++ express, preferably without using .net framework.



  • T-off

    The problem's that there's no 'set' procedure. It all depends on what you want to do.

    For example, to modify save games, you might only examine save game files in a hex viewer and attempt to find your way through. You might disassemble the game loading code in an attempt to understand the format better.

    In general, you'd have to do some assembly and disassembly. Unless you have the game source code, that is :)

    Can you be more specific about what kind of trainer you want for what game



  • Macktr

    Well, you can always attach a debugger to an executing process to get access to disassembly + process memory.

    EDIT: Which would work for discovering stuff. When you do want to access other process memory, do a google on "Win32 access another process memory" or something. I don't recall the exact methods unfortunately.



  • pushart

    This is a bit tricky as when I was younger I used to fool around with UFO enemy unknown and increase my cash flow. This was done in Hex. What I suspect you have to do is find out where the locations of things like money, items are and then find the correct values. You can then write a program that will open up these files and then goto the locations and "fix" the values.

    I know this isn't exactly a guide but it might be some sort of hint.

    I hope this helps.
    Take care.


  • senthilrd

    Here is a link to a site with a few tuts on trainers and stuff

    http://pc.nanobot2k.org/ action=articles

  • Hussain_Alyousif

    Thanks for the link. I only found two usable files. A template for vb.net 2003 and a template for visual c#.net.

    Does anybody know where I can get a tut for making a trainer with using visual c++ express but not .net


  • DrMicrochip

    I don't like cheating with it, im looking at making a bot by accessing memory and then using these variables to construct a map of variables. Not every one cheats with stuff, just tell him what he wants to know xD.

  • Tony Robyn

    Sorry. I don't want a saved game editor, but rather an ingame trainer that I could use to edit stuff while playing a game. I already know how to make save game editors. I just don't know which methods I would use to access the memory of a running game.


  • phatrice93

    how to make a trainer

    the answer is simple >>> DONT DO IT.

    Making a trainer is like hacking the game code, so i dont think many game developers will like that. Cheating is stupid ... if u cant play a game without cheating, dont play the game!

    ==========

    Sorry for my bad reply, but i just hate people that are cheating, specially when they are cheating in online games


  • giorgos

    Ok, I made the following code for Visual Basic 6

    Module1.bas~~~~~

    Option Explicit

    Private Const PROCESS_ALL_ACCESS = &H1F0FFF
    Public WinName As String

    Public Declare Function GetClassName Lib "user32" _
    Alias "GetClassNameA" _
    (ByVal hwnd As Long, _
    ByVal lpClassName As String, _
    ByVal nMaxCount As Long) As Long

    Public Declare Function FindWindow Lib "user32" _
    Alias "FindWindowA" _
    (ByVal classname As String, _
    ByVal WindowName As String) As Long

    Public Declare Function OpenProcess Lib "kernel32" _
    (ByVal dwDesiredAccess As Long, _
    ByVal bInheritHandle As Long, _
    ByVal dwProcessId As Long) As Long

    Public Declare Function GetWindowThreadProcessId Lib "user32" _
    (ByVal hwnd As Long, lpdwProcessId As Long) As Long

    Public Declare Function CloseHandle Lib "kernel32" _
    (ByVal hObject As Long) As Long

    Public 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

    Public Sub WriteAInt(Address As Long, Value As Long, ByteLength As Long)
    Dim hwnd As Long, classname As Long, pid As Long, phandle As Long

    hwnd = FindWindow(vbNullString, WinName)

    If (hwnd <> 0) Then
    GetWindowThreadProcessId hwnd, pid
    phandle = OpenProcess(PROCESS_ALL_ACCESS, False, pid)
    If (phandle <> 0) Then
    WriteProcessMemory phandle, Address, Value, ByteLength, 0&
    End If
    CloseHandle phandle
    End If

    End Sub

    Form1.frm~~~~~

    'Simply use Call WriteAInt(Address, Value, ByteLength) to poke an address.

    Private Sub Command1_Click()
    Call WriteAInt(&HC847BC, 99999999, 4)
    End Sub

    Private Sub Form_Load()
    'The following Variable will hold the name of the game's window.
    Module1.WinName = vbNullString
    End Sub

    End Sub

    That works perfectly for poking an address, but it only finds the game by it's window name. I know it isn't the best way to find a process. I was wondering if anybody knew how I could find a process by it's classname. I have a program that can find a procs classname by it's window name. Also, please let me know if this code is bad and how I could fix it. Thank you.




  • Sankar Reddy

    When you finish the game the next time you play the game you cheat becaus it is a diffrent way to play the game

    I have a lot of games when I finish the game i cheat the next time I play it



  • How to make a trainer.