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 › Programming › C++/C Programming › [Tutorial] Basic C++ Console hack

[Tutorial] Basic C++ Console hack

Posts 1–13 of 13 · Page 1 of 1
Erinador
Erinador
[Tutorial] Basic C++ Console hack
Targeted program: programme test.exe (Comes with T-Searcher, also attached it)
Knowledge: Easy to medium
Needed:
- C++ Compiler
- Memory Scanning/Hacking software.
- A brain

Step 1)
Find the addresses.
I already did that for you, but you just do it yourself also.
Address One : 0x0041D090 (Numbers)
Address Two: 0x0041D094 (Stripes) (Starts at 365 not 0)
Both are static so should work for you.


Step 2)
Start a new empty "Windows Console Application" project

-------------------------------------------------
Now I'll explain pieces of the code and at the end of the tutorial you'll get the full source code.

Code:
int ValueOne=25, ValueTwo=403;
DWORD pid;
^declaring it for further use

Code:
HWND hWnd = FindWindow(NULL, "prog test");
^This searches for the window by the name of the window NOT by the name of the process!

Code:
GetWindowThreadProcessId(hWnd, &pid)
^Get the ProcessID of the window stored in hWnd and store it in pid

Code:
HANDLE phandle = OpenProcess(PROCESS_VM_OPERATION | PROCESS_VM_WRITE | PROCESS_VM_READ, 0, pid);
^ Create a handle for you process
- PROCESS_VM_OPERATION -> always needed if you want to something
- PROCESS_VM_WRITE -> needed if you want to write to the process
- PROCESS_VM_READ -> needed if you want to read from the process

Code:
WriteProcessMemory(phandle, (LPVOID)addressone, &ValueOne, sizeof(ValueOne), 0);
^
-1- phandle - needed
-2- (LPVOID)addressone - The address you want to change
-3- &ValueOne - The value you want to give it
-4- sizeof(ValueOne) - The byte size of ValueOne (in this case 4)

Code:
system("pause");	// ask the user to press a key to end the program.	
return 0; // end it
Full source code:
Code:
#include <windows.h>
#include <iostream>

// Define them so we can use them in the rest of the program
#define addressone 0x0041D090 
#define addresstwo 0x0041d094


int main()
{
	SetConsoleTitle("C++ Trainer by Erinador");															// Set your consoles title
	int ValueOne=25, ValueTwo=403;																		// Declare these so we can use them
	DWORD pid;																							// Declare this so we can use to store the ProcessID
	int i = 1;																							// Declare this for the infinite loop
	do {
   
	/*----Find the window----*/
	HWND hWnd = FindWindow(NULL, "prog test");															//find the window by name
	if (!hWnd) //then
		std::cout << "Window not found!\n";																// if it didn't find the windows name
	else
		std::cout << "Window found!\n";																	// if it found the windows name
	//end if
    
	/*----Get the processID of the window you found----*/
	if(!GetWindowThreadProcessId(hWnd, &pid)) // Then 
		std::cout << "Process ID not found!\n";															// not found
	else
		std::cout << "Process ID found!\n";																//found
	//end if
	
	/*----Create a handle----*/
	HANDLE phandle = OpenProcess(PROCESS_VM_OPERATION | PROCESS_VM_WRITE | PROCESS_VM_READ, 0, pid);	//Get the needed permissions and open the process for access
	if(phandle==INVALID_HANDLE_VALUE) //then
		std::cout << "I don't have permissions to open the process!\n";
	else
		std::cout << "I have persmissions to open the process!\n";

	/*----Write to the addresses----*/
	 WriteProcessMemory(phandle, (LPVOID)addressone, &ValueOne, sizeof(ValueOne), 0);					// Set the value of the first address
	 WriteProcessMemory(phandle, (LPVOID)addresstwo, &ValueTwo, sizeof(ValueTwo), 0);					// Set the value of the second address

	 Sleep(15);																							// We wouldn't want to lag now do we ;)
	 system("cls");																						// Clear the screen
	} while (i=1);

  system("pause");																						// ask the user to enter a key
  return 0;
}
Full source code: (by process name and not caption)
Code:
#include <windows.h>
#include <tlhelp32.h>
#include <iostream>

using namespace std;

// Define them so we can use them in the rest of the program
#define addressone 0x0041D090 
#define addresstwo 0x0041d094

void GetProcId(char* ProcName);

DWORD ProcId = 0; // THIS IS OUR GLOBAL VARIABLE FOR THE PROC ID;

int main()
{
	char* ProcName="programme test.exe";




	SetConsoleTitle("C++ Trainer by Erinador");															// Set your consoles title
	int ValueOne=25, ValueTwo=403;	
	int i = 1;
	do {
		GetProcId(ProcName); // get the proc id from the processes name
		cout << "The Process ID of " << ProcName << " is " << ProcId <<endl; // display it to the user

/*----Create a handle----*/
	HANDLE phandle = OpenProcess(PROCESS_VM_OPERATION | PROCESS_VM_WRITE | PROCESS_VM_READ, 0, ProcId);	//Get the needed permissions and open the process for access
	if(phandle==INVALID_HANDLE_VALUE) //then
		std::cout << "I don't have permissions to open the process!\n";
	else
		std::cout << "I have persmissions to open the process!\n";

/*----Write to the addresses----*/
	 WriteProcessMemory(phandle, (LPVOID)addressone, &ValueOne, sizeof(ValueOne), 0);					// Set the value of the first address
	 WriteProcessMemory(phandle, (LPVOID)addresstwo, &ValueTwo, sizeof(ValueTwo), 0);					// Set the value of the second address

	 Sleep(500);																							// We wouldn't want to lag now do we ;)
	 system("cls");																						
	}while(i=1);
  cin.get(); // to keep console open till we press a key
  return 0;
}

void GetProcId(char* ProcName)
{
    PROCESSENTRY32   pe32;
    HANDLE         hSnapshot = NULL;

    pe32.dwSize = sizeof( PROCESSENTRY32 );
    hSnapshot = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 );

    if( Process32First( hSnapshot, &pe32 ) )
    {
        do{
            if( strcmp( pe32.szExeFile, ProcName ) == 0 )
                break;
        }while( Process32Next( hSnapshot, &pe32 ) );
    }

    if( hSnapshot != INVALID_HANDLE_VALUE )
        CloseHandle( hSnapshot );

    ProcId = pe32.th32ProcessID;
}
I put checks on it
I put it in a loop
#1 · edited 16y ago · 16y ago
|-|3|_][({}PT3R12
|-|3|_][({}PT3R12
Nice tut.

Ill download it and see what i can do
#2 · 16y ago
SpaceMan
SpaceMan
Sorry, but what does it do/
#3 · 16y ago
Void
Void
Nice, you should add how to get the process id of a program using it's executable name instead of the caption. Caption names could be really long and annoying sometimes.
#4 · 16y ago
Erinador
Erinador
Quote Originally Posted by Davidm44 View Post
Nice, you should add how to get the process id of a program using it's executable name instead of the caption. Caption names could be really long and annoying sometimes.
I'll add that right now

EDIT:
Added
#5 · edited 16y ago · 16y ago
treeham
treeham
Thanks man! I learned c++ a while back and tried hacking but all the tuts were way too advanced.
#6 · 16y ago
Kuro Tenshi
Kuro Tenshi
Quote Originally Posted by treeham View Post
Thanks man! I learned c++ a while back and tried hacking but all the tuts were way too advanced.
i tried most of them but those are 2-4 years old >.< i have made some hacks but gues what found. all i do need is detouring skills bacause finding addies is peace of cake. to bad that VB isnt working that nice for editing most mmofps games values. xD
ah well youll never stop learning some new code. gona write my own maybe (just define some simple stuff makes it easier to hack i guess.)
#7 · 16y ago
hantuafiq
hantuafiq
im just a noob and i dont know anything about visual c++ coz i only learn VB.net... can u upload the source pls...i really2 need it...thx
#8 · 16y ago
XG
XGelite
Quote Originally Posted by hantuafiq View Post
im just a noob and i dont know anything about visual c++ coz i only learn VB.net... can u upload the source pls...i really2 need it...thx
haha/



Nice tutorial btw.
#9 · 16y ago
why06
why06
Quote Originally Posted by hantuafiq View Post
im just a noob and i dont know anything about visual c++ coz i only learn VB.net... can u upload the source pls...i really2 need it...thx
Don't bump old posts. And he already posted the code up at the top. Thanks Erinador, wish I had seen this earlier, somehow I keep missing these things. =/

EDIT: I added your tutorial to the C++ Tutorial List Erinador. Very nice

actually on second thought I'll let this slide... I know I missed this tutorial perhaps some others did too...
/unclosed
#10 · edited 16y ago · 16y ago
Matrix_NEO006
Matrix_NEO006
do u guys want me to make a tutorial to make hacks in a better application something like this
#11 · 16y ago
KABLE
KABLE
Is this iin cpp?
#12 · 16y ago
Matrix_NEO006
Matrix_NEO006
Quote Originally Posted by kAblE View Post
Is this iin cpp?
yes of course
#13 · 16y ago
Posts 1–13 of 13 · Page 1 of 1

Post a Reply

Similar Threads

  • [Tutorial] Basic C++ Game Hacking (Memory Editing)By Tukjedude in C++/C Programming
    17Last post 16y ago
  • [Tutorial]Make your first hack in Visual Basic 6 (and a begin in CE) (for noobs)By diamondo25 in Programming Tutorials
    28Last post 17y ago
  • [Request]Tutorial on C++ Game HackingBy Propser in C++/C Programming
    1Last post 17y ago
  • Tutorial for canadianassasin v3 hackBy sukhans in CrossFire Hacks & Cheats
    5Last post 17y ago
  • TUTORIAL FOR V4 wep hack by TYREALL101By mcjang in CrossFire Hacks & Cheats
    8Last post 17y ago

Tags for this Thread

None