Display results as :

Rechercher Advanced Search

Latest topics
» ~=?{The future is here, TastyExploit officially open to the public}?=~
Tue Mar 02, 2010 11:00 pm by Dami

» My first aa script
Tue Mar 02, 2010 7:00 am by wafflemaster

» the real story behind Maverin
Tue Mar 02, 2010 1:33 am by SoundOfDeat

» Random spam
Mon Mar 01, 2010 11:52 pm by Danny1994

» [Request] EMS v56 Exe
Mon Mar 01, 2010 12:39 am by Dami

» [Blacklist] NX-Trading Blacklist.
Mon Mar 01, 2010 12:38 am by Danny1994

» I have a question regarding the meso farmer
Sat Feb 27, 2010 10:30 pm by Dami

» What are you listening to now?
Sat Feb 27, 2010 7:57 pm by Noname111111

» Video(s) Of The Day
Sat Feb 27, 2010 7:37 pm by Noname111111

free forum

[C++]Writing A Trainer

Go down

[C++]Writing A Trainer

Post by Dami on Fri Oct 30, 2009 5:28 am

By Noz3001

So you want to write a trainer eh?

First of all, you are going to need to download Cheat Engine 5.3 and find out how to find addresses and values. Once you have mastered this, read on.

Getting a handle?

First of all you need to get a handle to the games window. You can do this by using the FindWindow API like so:

HWND hWindow=FindWindow(NULL, "Minesweeper"); /*Finds Minesweepers window */

Now we have a handle to the games window we need to open the process with OpenProcess. But to do this we need to have the PID of the game.
We can find the PID using two very simple API, CreateRemoteThread() and GetWindowThreadProcessId().

Heres an example of doing so:

unsigned long PID; // We need this now to store the PID.
    HANDLE hProcess; //We will use this for OpenProcess
    HWND hWindow=FindWindow(NULL, “Minesweeper”);
    CreateRemoteThread(hWindow, NULL, 0, 0, 0, NULL, NULL);
            GetWindowThreadProcessId(hWindow, &PID);

Now we have the PID of the process, we can open it :

hProcess=OpenProcess(PROCESS_ALL_ACCESS, TRUE, PID);

Now we have an open handle to the game and we can do whatever we like.

* Changing Values?

Now we have access to the game and its memory, its time to use another common, easy to use, API. WriteProcessMemory.
We will use it to change the value of the address which controls the timer in minesweeper.

First lets declare two variables to hold What we want to write, and the size of what we want to write. I declared and defined them like so:

    DWORD ToBeWritten[]={0x90};
    DWORD Newdatasize=sizeof(ToBeWritten);
Look at the data i’ve put into ToBeWritten. 0×90 is a nop in ASM.

Ok now that we have all the variables needed to write to the memory lets actually do it!

WriteProcessMemory(hProcess, (LPVOID)0x01002FF5, &ToBeWritten, Newdatasize, 0);

If you look at that line, hProcess is the result of OpenProcess which was the handle to Minesweeper. (LPVOID)0×01002FF5 is the address at which the timer is controlled, &ToBeWritten is the data in ToBeWritten (0×90) and newdatasize is the size of the data we are writing to the process. Oh and you can also close the handle if you wish by using:


Now if you run it while Minesweeper is running, the timer will stop .

Posts : 1414
Join date : 2009-08-10
Age : 29
Location : Finland

Back to top Go down

Re: [C++]Writing A Trainer

Post by und3rt4ker on Fri Nov 27, 2009 9:36 pm

very usefull, made a trainer with 2hax 4fun, rlly qewl, my first C++ Trainer =D

Posts : 73
Join date : 2009-09-26

Back to top Go down

Re: [C++]Writing A Trainer

Post by polopolo on Wed Dec 23, 2009 5:39 am

Yeah !! Thanks you !
I can now do my Own one

New member

Posts : 19
Join date : 2009-08-15

Back to top Go down

Re: [C++]Writing A Trainer

Post by robbe777 on Sun Jan 03, 2010 9:40 pm

ty now i make my one trainer C++ and not a CE trainer


Posts : 28
Join date : 2010-01-03

Back to top Go down

Re: [C++]Writing A Trainer

Post by iKaos on Wed Jan 13, 2010 6:38 pm

Very useful!
New member

Posts : 10
Join date : 2009-11-22

Back to top Go down

Re: [C++]Writing A Trainer

Post by Tom on Sun Jan 24, 2010 2:26 am

Thanks for this Dami, it will be a console application, am I right?
New member
New member

Posts : 63
Join date : 2009-09-17
Age : 22
Location : England, a dump.

Back to top Go down

Re: [C++]Writing A Trainer

Post by Sponsored content

Sponsored content

Back to top Go down

Back to top

- Similar topics

Permissions in this forum:
You cannot reply to topics in this forum