delphi3000.com - the free delphi knowledge platform
delphi3000.com - the free delphi knowledge platform
500 Users Online NOW
Have a look at your member-status

connecting people's knowledge


  - Recent ArticlesRSS feed for Recent Articles on delphi3000.com
  - List of All Articles
  - Top Viewed Articles
  - Articles (+Attachem.)
  - Articles Of Interest
  - Categories
  - Top Uploader
  - Search
  - Index

  - My Home
  - Submit an Article
  - My Articles
  - My Personal Data
  - My Bookmarks
  - Activities
  - Login/Logout

  - Sign Up
  - Why Sign Up
  - Newsletter

  - Press
  - Advertise

  - Contact
  - Feedback





Community
Borland
ClubeDelphi
Dr. Bob
UK-BUG
Delphi Meetings
Planeta Delphi



Loremo - the 1.5 liter car coming in 2009




Startblatt.de






Share this article with friendsShare this article with friends
Rate this articleRate this article - to keep the quality of delphi3000.com !
Comment this article or read through previous comments (0)


Messing with other applications memoryGo to Colin Myerscough's websiteFormat this article printer-friendly!Bookmark function is only available for registered users!
Why not build ur own trainer
Product:
Delphi 5.x (or higher)
Category:
Win API
Skill Level:
Scoring:
Last Update:
01/30/2003
Search Keys:
delphi delphi3000 article borland vcl code-snippet edit memory hack trainer cheat
Times Scored:
4
Visits:
2106
Uploader: Colin Myerscough
Company: Parcye
Reference: N/A
 
Question/Problem/Abstract:
How can I edit data of my favorite game?
Answer:




  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.





Please rate this article!
Skill level:
BeginnerExpert

Useful:
No!Very!

Overall rating:
PoorExcellent



Comments to this article
Write a new comment













 
Sign up to consume product discounts for Bronze memberships !

read more


  Visit our Sponsor

 

  Community Ad of
R. Lefter
 
   














 







     
  Copyright © 2000 - 2007 delphi3000.com - All rights reserved. Terms of use. || Privacy
delphi3000.com is a service by bluestep.com IT-Services GmbH (Vienna)