Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › MultiPlayer Game Hacks & Cheats › Game Hack & Cheat Development › Game Hacking Tutorials › Writing your own C++ Trainer

Writing your own C++ Trainer

Posts 1–15 of 47 · Page 1 of 4
l0ngcat
l0ngcat
Writing your own C++ Trainer
Here is a tutorial teaching your the very basics of making a trainer, namely how to find a process and write shit into it at the correct address. what it doesn't cover is making a GUI-based (graphic user interface) trainer with hotkey hooks that work when the program is in the background.

you need a C++ compiler, like MS Visual C++ or whatever, to compile the attached source code. copy it and save as OMFG_thanks_dude_for_this_tut.cpp or something.

Code:
/* --------- TUTORIAL: Making your first Trainer -------- */
/* --------- by Anonymous - posted on mpgh.net   -------- */

#include <windows.h>
#include <conio.h>
#include <dos.h>
#include <tlhelp32.h>
#include <stdio.h>


int stamina;	// will store the stamina value

bool dostamina = false;		// determines if user activated stamina freezing

LPVOID stamina_addr =	(void*) 0x007F1110;		// memory address of the stamina value in the WarRock process

void screen()	// output
{
	system("cls");	// clear the screen
	printf("Hello World! This is my first WarRock trainer!  \n\n");
	
	if(dostamina) printf("[1] - freeze stamina [ENABLED]\n");	// if user enabled stamina freeze, let him know!
	else printf("[1] - freeze stamina [disabled]\n");			// same if it's disabled
}

int main(int argc, char* argv[])
{	
	HANDLE hProcessSnap;	// will store a snapshot of all processes
	HANDLE hProcess = NULL;	// we will use this one for the WarRock process
	PROCESSENTRY32 pe32;	// stores basic info of a process, using this one to read the ProcessID from
	
	hProcessSnap = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 );	// make process snapshot

	pe32.dwSize = sizeof( PROCESSENTRY32 );		// correct size

	Process32First(hProcessSnap, &pe32);	// read info about the first process into pe32

	do	// loop to find the WarRock process
	{		
		if(strcmp(pe32.szExeFile, "WarRock.exe") == 0)	// if WarRock was found
		{
			hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pe32.th32ProcessID);	// open it, assigning to the hProcess handle
			break;	// break the loop
		}
	}
	while(Process32Next(hProcessSnap, &pe32));	// loop continued until Process32Next deliver NULL or its interrupted with the "break" above

	CloseHandle( hProcessSnap );	// close the handle (just fuckin do it)

	if(hProcess == NULL)	// self explanatory tbh
	{
		printf("WarRock not found\n\n");
		getch();	// wait for a key press. otherwise the app will just close so fast when the process is not found, you wont know wtf happened.
	}
	else
	{
		screen();	// print the display
		
		char key = ' ';	// make a key variable to store pressed keys
		
		while(key != VK_ESCAPE)	// loop until user presses Escape
		{
			
			if(kbhit())		// if a key was pressed
			{
				key = getch();	// it is saved into "key"

				switch(key)		// here the commands are handled depending on the key that was pressed
				{				// case '1': ... break;  case '2': ... break; and so on
				case '1':
					dostamina = !dostamina;		// flip the dostamina value true<->false to enable/disable it
					ReadProcessMemory(hProcess, stamina_addr, &stamina, 4, NULL);	// read the stamina value from the memory into the "stamina" variable
					break;			
				}

				screen();	// print the display after each key press

			}

			if(dostamina)	// if stamina freeze is activated
				WriteProcessMemory(hProcess, stamina_addr, &stamina, 4, NULL);	// write the stamina value that was saved before with the key press into memory
		}

		CloseHandle(hProcess);	// close the handle
		
	}

	return 0;	// THE END
}
#1 · edited 19y ago · 19y ago
scooby107
scooby107
Thanks mate, but i already started making one now.
Naeron gave me some help and i've started reading and compiling a few basci programs. Last night i managed to start writing a trainer, and in fairness it isn't as hard as i first though. So to all you guys thinking it's too hard, i'll tell you It's not as acomplicated as it looks.
#2 · 19y ago
NA
Naeron
Quote Originally Posted by scooby107 View Post
Thanks mate, but i already started making one now.
Naeron gave me some help and i've started reading and compiling a few basci programs. Last night i managed to start writing a trainer, and in fairness it isn't as hard as i first though. So to all you guys thinking it's too hard, i'll tell you It's not as acomplicated as it looks.
The code I gave you was only for static addresses. There are still some other things you can learn.
#3 · 19y ago
scooby107
scooby107
Quote Originally Posted by Naeron View Post
The code I gave you was only for static addresses. There are still some other things you can learn.
I realised that, that's why i'm reading a few eBooks (forgot to mention) at the moment. And i managed to create a little trainer last night for Sim City 4. Just something i can practise on.
#4 · 19y ago
MI
Mikeck901323
NICE!!! ty
#5 · 19y ago
BA
bagpiperdude90
ehhh... it won't compile :-(

Using MS Visual C++ 2005 Express Edition...
#6 · 19y ago
l0ngcat
l0ngcat
from the pm you sent me it seems your compiler is missing something..
you removed "#include <tlhelp32.h>" but it wont work without.
if your compiler doesn't find tlhelp32.h then this is your problem. MSVC++ should have it though :/
#7 · 19y ago
rambuki
rambuki
yo man i dont understand anithing, if u make trainers, can u put a video for make a trainer?? my email is


joni_galde@hotmail.com ^^
#8 · 19y ago
WE
webtijn
Quote Originally Posted by rambuki View Post
yo man i dont understand anithing, if u make trainers, can u put a video for make a trainer?? my email is


joni_galde@hotmail.com ^^
Omg.. trainer isn't made in 3 minutes. You need to learn C++ anyway if you want to do anything, a video tut is useless because that doesn't explain anything about the code so you won't be able to modify your trainer..
#9 · 19y ago
naomelembro14
naomelembro14
Quote Originally Posted by webtijn View Post
Omg.. trainer isn't made in 3 minutes. You need to learn C++ anyway if you want to do anything, a video tut is useless because that doesn't explain anything about the code so you won't be able to modify your trainer..
my trainers usually take less then 3 min...if i have the adresses rdy of course...
#10 · 19y ago
WE
webtijn
Quote Originally Posted by naomelembro14 View Post
my trainers usually take less then 3 min...if i have the adresses rdy of course...
=') You understand what I mean ehh
#11 · 19y ago
VU
Vulcanraven
how can i add more functions?
example:
(1) Stamina
(2) Scope
(3) Unlimited Ammo
(4) GPS

and more.... ?
#12 · 19y ago
NA
Naeron
Quote Originally Posted by Vulcanraven View Post
how can i add more functions?
example:
(1) Stamina
(2) Scope
(3) Unlimited Ammo
(4) GPS

and more.... ?
Learn C/C++ and it will be easy for you.
#13 · 19y ago
carpanthers1
carpanthers1
what features does it have? is it safe?
#14 · 19y ago
WE
webtijn
Quote Originally Posted by carpanthers1 View Post
what features does it have? is it safe?
Only unlimited stamina, and yess i think its safe. But you never know if its safe or detected. To find out you need to use it and get banned
#15 · 19y ago
Posts 1–15 of 47 · Page 1 of 4

Post a Reply

Similar Threads

  • Writing your own Visual Basics (v5 or v6) TrainerBy TheRedEye in Game Hacking Tutorials
    29Last post 12y ago
  • compile error :/ from [Writing your own C++ Trainer]By FantaBrause in C++/C Programming
    7Last post 17y ago
  • How to make your own radiostation?By nasir91 in General
    3Last post 19y ago
  • [Tutorial] Programming your own FSEK VirusBy FluffyStuff in Spammers Corner
    19Last post 19y ago
  • Make your own Warrock Cross hairs!!By llvengancell in WarRock - International Hacks
    3Last post 19y ago

Tags for this Thread

None