Search site: 

| Home | PC Cheat Codes | Game Patch Updates | PC Game Trainers | PC Game Tools | Game Patch Fixes | Articles | Discussion Forums | Contact |

Trainer Tutorials

Latest Forum Discussions:

This section of the site is dedicated to Trainer Tutorials to help everyone get a better understanding of how Game Trainers are made and how they function.

Delphi 6 Trainer

You can view this tutorial in its original format here
Archea Hacking - Delphi 6 Trainer
<~~ http://www.archeahacking.com ~~>

LEGAL AT BOTTOM
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>

A knowledge of game hacking is required for this
tutorial. Check www.ArcheaHacking.com if are new.

This tutorial was made to teach the fundamentals of
creating trainers in Delphi6 (works with most other
versions too). Our trainer will check if the game is
running, and then poke our value: when the button is
clicked. All you have to do to make this trainer your
own is simply modify TForm1 and fill in the constants
according to your hex address and value to write.

There is an upside and a downside to programming
trainers in Delphi. The upside is that you can make
them look extremely cool, and it is VERY easy to use.
The downside, Delphi doesn't really make applications
smaller than 300k. I would never use Delphi other than
work because its overhead with TForm is horrid.

NOTE: In the remark statements on the code (labled with "//")
all remarks that begin with ! mean you need to change
something.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>

First we will have to state some variables and define
our constants. (i use "===" to show where the code you
will put in the program begins. Please do not put this
in your program, as neither you or Delphi will appreciate it)

===
Var
Form1: TForm1;
WindowName : integer;
ProcessId : integer;
ThreadId : integer; // defining variable's types ;
buf : PChar;
HandleWindow : Integer;
write : cardinal ;

Const
WindowTitle = 'Game Window'; //!define the game's window name ;
Address1 = $4ab3485f; //!define your address to poke ;
PokeValue1 = $90; //!define what value to write ;
NumberOfBytes1 = 1; //!define amount of bytes to write;
===

The Variables and Constants should be places just before the
Implementation command. You needn't worry about the Var area
unless you know delphi and want to do more than use a button
to poke an address. Under Const there is:

WindowTitle - make this equal to what the text on the
menubar in windows for the game is. For
delphi it says "Delphi 6," so type
'Delphi 6'.

Address1 - This is the hex address for the first
button to poke. Find your address using
a memory scanner. Look to ArcheaHacking.com
for tutorials on memory scanning. Do not
include any trailing zero's, and include the
"$" before the address.

PokeValue1 - This is what you want your value to be
equal to. Type in the hex equivalent of
what the value will be, and make sure to
include the "$"

NumberOfBytes1 - This is for how many bytes to write.
If you are writing "90" to an address
that is 1 byte. If you are writing
"9090" that is 2 bytes.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>

Now we must create a button for our trainer, so that the
user may poke the address. To create a button for your
form, double click "button" under the "Standard" components
tab. From here you can modify the text in the button under
"Caption" in your object inspector (make sure Button1 is
selected in the drop box).

To make the button do something, click the "events" tab in
the object inspector. Now double click to the right of
"OnClick" and you will be brought to your code. Here just
enter:

===
begin

WindowName := FindWindow(nil,WindowTitle);

If WindowName = 0 then // check if the game is running;
begin

MessageDlg('The game must be running. Run it now, and then try again.', mtwarning,[mbOK],0);

end;

// the following will write our value;

ThreadId := GetWindowThreadProcessId(WindowName,@ProcessId);
HandleWindow := OpenProcess(PROCESS_ALL_ACCESS,False,ProcessId);

GetMem(buf,1);
buf^ := Chr(PokeValue1);
WriteProcessMemory(HandleWindow,ptr(Address1),buf,NumberOfBytes1,write);
FreeMem(buf);
closehandle(HandleWindow);

end;
===

And there we go, we have made a Trainer in Delphi6.
Instructions are provided on adding more buttons inside the
Project file. I included both the project file, and the
pascal file, so that those without delphi6 can view the
pas file.

YOU CAN GET THE FILES HERE:

http://primal.framper.com/Downloads/delphitrn.zip

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>
LEGAL:
This tutorial was written by Andrew Zizzo, and is protected
by copyright as a literary work. You are permitted to edit
the programming files contained in the Zip File that goes
along with this tutorial, but not the tutorial itself. This
tutorial may not be posted anywhere without the WRITTEN 
will of Andrew Zizzo. All rights are reserved.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>

-=Archea47=-
Archea Hacking
www.archeahacking.com

== DO NOT EAT ==

Copyright (1998) 2004 - 2016 GamePatchPlanet.com. All Rights Reserved. Privacy Policy Disclaimer