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++ Game Hacking (Memory Editing)

[Tutorial] Basic C++ Game Hacking (Memory Editing)

Posts 1–15 of 18 · Page 1 of 2
Tukjedude
Tukjedude
[Tutorial] Basic C++ Game Hacking (Memory Editing)
Basic C++ Game Hacking (Memory Editing)
Hi All

Some simple basic C++ game hacking (egg: memory editing)
Ill start with one of the most simple codes:

Code:
#include <windows.h>

int main() 
{
	HWND hWnd = FindWindow(0, "Calculator");
  	if(hWnd == 0)
	{
    		MessageBox(0, "Error cannot find window.", "Error", MB_OK|MB_ICONERROR);
  	} 
	else 
	{
    		DWORD proccess_ID;
    		GetWindowThreadProcessId(hWnd, &proccess_ID);
    		HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, proccess_ID);
    		if(!hProcess)
		{
      			MessageBox(0, "Could not open the process!", "Error!", MB_OK|MB_ICONERROR);
    		} 
		else 
		{
      			int newdata = 500;
     		 	DWORD newdatasize = sizeof(newdata);
      			if(WriteProcessMemory(hProcess, (LPVOID)0x57C2A4, &newdata, newdatasize, NULL))
			{
        				MessageBox(NULL, "WriteProcessMemory worked.", "Success", MB_OK + MB_ICONINFORMATION);
      			} 
			else 
			{
        				MessageBox(NULL, "Error cannot WriteProcessMemory!", "Error", MB_OK + MB_ICONERROR);
      			}
      			CloseHandle(hProcess);
    		}
  	}
  	return 0;
}
This will edit the following memory adress: 0x57C2A4
In the calculator window,


Code:
HWND hWnd = FindWindow(0, "Calculator");
  	if(hWnd == 0)
	{
    		MessageBox(0, "Error cannot find window.", "Error", MB_OK|MB_ICONERROR);
  	}
The lines above will search for a window (proccess) to edit.
In this case it is the calculator but if you want to edit the Cod4 Adresses it should be iw3mp!
The if statement checks if the window is opened and exists. If not you will get a message that
it can not be found.

Scroll down til you see this line:
Code:
if(WriteProcessMemory(hProcess, (LPVOID)0x57C2A4, &newdata, newdatasize, NULL))
0x57C2A4 is our adress, newdata is the value for our adressm and newdatasize is the bytes
that the adress is (Most 4)
So you could edit it to:

Code:
if(WriteProcessMemory(hProcess, (LPVOID)0x57C2A4, &567, 4, NULL))
Wich will change the value to 567 with 4 bytes.


Memory Adress freezing on request of Zyixc:

So there is not a real code to freeze (egg FreezeAdress() it just don't exsist>
But we can freeze it by using a infinite loop

So we take the code wich edits the adress value:

Code:
if(WriteProcessMemory(hProcess, (LPVOID)0x57C2A4, &newdata, newdatasize, NULL))
{
// Here should be the message box that the change has worked, but you need to remove it when using a loop otherwise you will get a infinite msgbox xD
}
and put it in a infinite loop:
Code:
while(1);
{
	if(WriteProcessMemory(hProcess, (LPVOID)0x57C2A4, &newdata, newdatasize, NULL))
	{
        				      			
	}
}
The code above will freeze youre code by using a simple loop. There is a second wat but you have maxium of numbers a signed interger can hold so it wil stop working after some time so just use the loop above.

Code:
for (int i = 0; i >= 0; i++)
{
// here the code
}

I will continue updating the topic with more info on howto start game hacking in C++.
A preview of how you can implent freezing adresses in the first code (on the top): http://pastebin.com/ATMUPjrq
#1 · edited 16y ago · 16y ago
ZY
Zyixc
thanks i was looking for this thnx\!
#2 · 16y ago
ZY
Zyixc
Howto freeze an adresss ?

ow it does automaticcaly
but if i change weapon its gone


sry for double post
#3 · edited 16y ago · 16y ago
Tukjedude
Tukjedude
First of all you can edit your post instead of double posting.
Freezing adresses is a little more complicated but i Will write a tutorial voor it.
Ill send you a message when its done.

Sorry for bad typing im on the iPhone xD

EDIT: For freeezing an adress isn't a code really. but if you put the following code:
(Wich is part of the coe in my first post)
Code:
                                            int newdata = 500;
     		 	DWORD newdatasize = sizeof(newdata);
      			if(WriteProcessMemory(hProcess, (LPVOID)0x57C2A4, &newdata, newdatasize, NULL))
			{
        				MessageBox(NULL, "WriteProcessMemory worked.", "Success", MB_OK + MB_ICONINFORMATION);
      			} 
			else 
			{
        				MessageBox(NULL, "Error cannot WriteProcessMemory!", "Error", MB_OK + MB_ICONERROR);
      			}
      			CloseHandle(hProcess);
Between:
Code:
for (int i = 0; i >= 0; i++)
{
// That code above here!
}
You get an infinite loop.. so the program will repeat the code between it.
So it basicly freezes the adress..

But i will add it to this tutorial.. be patient for a more extensive explaination..
#4 · edited 16y ago · 16y ago
Hell_Demon
Hell_Demon
Until i reaches the maximum number a signed integer can hold.

Use while(1) instead
#5 · 16y ago
Tukjedude
Tukjedude
I know, read the update on my first post
I already said that you can choose but you can use while(1);
#6 · 16y ago
MW
mwb1234
Good work, but you should remove the For statement loop, and say you must use a while(1) loop... a for loop will end eventually...
#7 · 16y ago
Tukjedude
Tukjedude
Your'e right i'm not removing it completly.. but..just take a look :P
#8 · 16y ago
MW
mwb1234
Quote Originally Posted by Tukjedude View Post
Your'e right i'm not removing it completly.. but..just take a look :P
Remove it or die...
#9 · 16y ago
Tukjedude
Tukjedude
Wtf why should i? Just shut up, and create your own tutorial if you don't like it..
If it was a joke.. then i will die
#10 · 16y ago
That0n3Guy
That0n3Guy
Code:
#include <windows.h>

int main() {
  HWND hWnd = FindWindow(0, "Calculator");
  if(hWnd == 0){
    MessageBox(0, "Error cannot find window.", "Error", MB_OK|MB_ICONERROR);
  } else {
    DWORD proccess_ID;
    GetWindowThreadProcessId(hWnd, &proccess_ID);
    HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, proccess_ID);
    if(!hProcess){
      MessageBox(0, "Could not open the process!", "Error!", MB_OK|MB_ICONERROR);
    } else {
      int newdata = 500;
      DWORD newdatasize = sizeof(newdata);
      if(WriteProcessMemory(hProcess, (LPVOID)0x57C2A4, &newdata, newdatasize, NULL)){
        MessageBox(NULL, "WriteProcessMemory worked.", "Success", MB_OK + MB_ICONINFORMATION);
      } else {
        MessageBox(NULL, "Error cannot WriteProcessMemory!", "Error", MB_OK + MB_ICONERROR);
      }
      CloseHandle(hProcess);
    }
  }
  return 0;
}
That's also taken from another website, the code was originally posted February 14, 2009. I don't know how someone can claim to be a coder if they merely take source code from someone else, put their name on it, and claim it to be written by them. But I guess that's just how some people get by in life.
#11 · 16y ago
CR
cruizrisner
this is awesome thanks, hey can anyone give me an actual hack source code? (yes i will except a non working one) cuz i just want one for study
#12 · 16y ago
That0n3Guy
That0n3Guy
Quote Originally Posted by cruizrisner View Post
this is awesome thanks, hey can anyone give me an actual hack source code? (yes i will except a non working one) cuz i just want one for study
He isn't a coder, he is a leecher.
#13 · 16y ago
LA
Lakshay
Very nice Tut Go ahead!
#14 · 16y ago
CR
cruizrisner
Quote Originally Posted by That0n3Guy View Post
He isn't a coder, he is a leecher.
my statement was addressed to everyone and i called nobody a coder
#15 · 16y ago
Posts 1–15 of 18 · Page 1 of 2

Post a Reply

Similar Threads

  • [Request]Tutorial on C++ Game HackingBy Propser in C++/C Programming
    1Last post 17y ago
  • """Basic C++ Game Hacking"""By headsup in C++/C Programming
    7Last post 17y ago
  • [Tutorial] Basic C++ Console hackBy Erinador in C++/C Programming
    12Last post 16y ago
  • """Basic C++ Game Hacking"""By headsup in Combat Arms Hacks & Cheats
    5Last post 17y 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

Tags for this Thread

None