Go Back   FileForums > Games > Game Coders
Register FAQ Community Calendar Today's Posts Search

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 19-03-2007, 09:32
pikachu5501 pikachu5501 is offline
Senior Member
 
Join Date: Oct 2006
Location: canada
Posts: 101
Thanks: 0
Thanked 1 Time in 1 Post
pikachu5501 is on a distinguished road
Lightbulb A simple "poke" in c++ for you trainer.

Ok many ask how to create a trainer. I wont explain here how to search and all. I will just give my main poke function that i find on internet and make simplier. It does write in a certain place in memory in a certain process (a game for example).

It work well with the free Borland Builder but should work with mingw or cygwin also. just copy the code snipet bellow and put it in you program. Should work without any problems in console or in Windows mode.

parameter explanation:
Wname: name of the process, just look in task manager if you are not sure.

addr: adress to be writen in

newbyte: byte to be writen in a string. let say you want to write 0x90, 0x90 so you write it this way "\x90\x90"

nbyte: number of byte to be writen. Make sure it match with the number of byte you insert in newbyte.

here an example:
poke_window("Robin Hood: Defender Of The Crown", 0x00425B8A, "\x90\x90",2 )

One last thing. Make sure that there is a delay between writes (or write just once in code segment). or it will slow down you game.


Code:
//include those in order to make it work
#include <iostream.h>
#include <windows.h>

int poke_window(char wname[50], DWORD addr, BYTE newbyte[12],int nbyte)
{
HWND Wnd=0;		
LPDWORD PID;	
DWORD Proc=0;	
HANDLE Hproc;	

DWORD MWritte; 


	
Wnd = FindWindow(NULL, wname); 	// see if it exist

if ( Wnd )
{
	Proc = GetWindowThreadProcessId(Wnd,(LPDWORD) &PID); //get a PROCESS number
	if (Proc)
	{
		Hproc= OpenProcess(PROCESS_ALL_ACCESS,NULL,(DWORD)PID);
		if(Hproc)
		WriteProcessMemory (Hproc, (LPVOID)addr, newbyte, nbyte,&MWritte);
	}
}

return(0);	
}
enjoy!

Last edited by pikachu5501; 19-03-2007 at 09:35.
Reply With Quote
Sponsored Links
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Rainbow Six Vegas v1.04 Trainer Doesn't work mfw41 Game Trainers 7 30-03-2007 22:13
The best (and fun) NFS:Carbon trainer available intoksicated General Gaming 3 22-12-2006 04:55
Simple questions please answer jimmyps2dimwit PS2 Games 3 01-09-2002 11:05



All times are GMT -7. The time now is 14:53.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
FileForums @ https://fileforums.com