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 › ReadProcessMemory

ReadProcessMemory

Posts 1–15 of 28 · Page 1 of 2
aanthonyz
aanthonyz
ReadProcessMemory
This is used to read memory in a certain program

This is made for : wolfguardiann who asked me for help, and for anyone else who may need it

This is the entire code:

Now I will explain bit by bit.

Normal Everyday Stuff:
Code:
#include <windows.h>
#include <iostream>

using namespace std;
Declarations:
Code:
DWORD address = 0x100579C; // This is the address that we want to read from
int value = 0; // This will store our value. In my case, its an integer, which is the timer
DWORD pid; //This will store our Process ID, used to read/write into the memory
HWND hwnd; //Finally a handle to our window
Find the Window
Code:
hwnd = FindWindow(NULL,L"Minesweeper"); //Finds the Window called "Minesweeper"
	if(!hwnd) //If none, display an error
	{
	cout <<"Window not found!\n";
	cin.get();
	}
GetProcess
Code:
GetWindowThreadProcessId(hwnd,&pid); //Get the process id and place it in pid
	HANDLE phandle = OpenProcess(PROCESS_VM_READ,0,pid); //Get permission to read
if(!phandle) //Once again, if it fails, tell us
		{
		cout <<"Could not get handle!\n";
		cin.get();
		}
Read
Code:
while(1)  //Forever, or until you force close the program
		{
		ReadProcessMemory(phandle,(void*)address,&value,sizeof(value),0); //Read what is in "address" and store it in "value", then what is the size of what we are going to read which is "value",and finally the number of bytes read, but I dont care about that so I put a 0, or NULL
		cout << value << "\n"; //Display it
		Sleep(1000); //I was reading the timer which increases every second, so I made my program go through that loop every second
Code:
#include <windows.h>
#include <iostream>

using namespace std;

int main()
{
	DWORD address = 0x100579C;
	int value = 0;
	DWORD pid;
	HWND hwnd;
        hwnd = FindWindow(NULL,L"Minesweeper");
	if(!hwnd)
	{
	cout <<"Window not found!\n";
	cin.get();
	}
	else
	{
	GetWindowThreadProcessId(hwnd,&pid);
	HANDLE phandle = OpenProcess(PROCESS_VM_READ,0,pid);
		if(!phandle)
		{
		cout <<"Could not get handle!\n";
		cin.get();
		}
		else
		{
		while(1)
		{
		ReadProcessMemory(phandle,(void*)address,&value,sizeof(value),0);
		cout << value << "\n";
		Sleep(1000);
		}
		return 0;
		}
	}
}
This is basically it. If you still have issues or if I explained something wrong, please tell me. If you want a tutorial on how to write into memory, let me know as well.

Press Thanks!
#1 · edited 15y ago · 15y ago
Void
Void
Nice, but I say you should have explained the last parameter of ReadProcessMemory as well, it's useful sometimes.

PS: I've already taken ReadProcessMemory to the extreme.
http://www.mpgh.net/forum/31-c-c/200...tions-iat.html
#2 · 15y ago
aanthonyz
aanthonyz
Quote Originally Posted by Void View Post
Nice, but I say you should have explained the last parameter of ReadProcessMemory as well, it's useful sometimes.

PS: I've already taken ReadProcessMemory to the extreme.
http://www.mpgh.net/forum/31-c-c/200...tions-iat.html


How long did it take you to learn everything you know right now?
#3 · 15y ago
Hell_Demon
Hell_Demon
Quote Originally Posted by aanthonyz View Post


How long did it take you to learn everything you know right now?
8 years /short
#4 · 15y ago
aanthonyz
aanthonyz
Quote Originally Posted by Hell_Demon View Post
8 years /short
Wow I am only at 1.5 years max. Minimum would be 1 year.. I dont remember
#5 · 15y ago
Hassan
Hassan
Quote Originally Posted by Hell_Demon View Post
8 years /short
So,he started coding at 3?
#6 · 15y ago
aanthonyz
aanthonyz
WDF, so your 11?
#7 · 15y ago
Void
Void
Are we talking about HD or me? o_O I haven't been programming for 8 years.
#8 · 15y ago
aanthonyz
aanthonyz
Quote Originally Posted by Void View Post
Are we talking about HD or me? o_O I haven't been programming for 8 years.
You.......
#9 · 15y ago
Void
Void
Quote Originally Posted by aanthonyz View Post
You.......
2 1/2 years about? idk.
#10 · 15y ago
wolfguardiann
wolfguardiann
Cool ,man , it worked , its showing the timer , so , if i acctualy wanna show the score, im only supposed to change

Code:
DWORD address = 0x100579C;
and here
Code:
  hwnd = FindWindow(NULL,L"Minesweeper");
so isntead of putting the adressdown there , i coudl only change it on DWORD and changing the Window name, Genious!!!

aanthonyz , TYVM for the support you gave me , i wont forget it , you will be on my respect list , everytime u need something , pm me , ill try my max to help you, tyvm for helping me till the end , Respect , peace , you are a good man , i hope some can hlep you with you Speech to Text , your a good man , someone will help you, anyways , Tyvm for helping me , you deserve much ... ill try for now on coding these things , and after , ill tryto make harder things , harder , and so on, if i have any probllems ill PM you , and if u need my help , pm me . tyvm once more!!!
#11 · 15y ago
aanthonyz
aanthonyz
Quote Originally Posted by wolfguardiann View Post
Cool ,man , it worked , its showing the timer , so , if i acctualy wanna show the score, im only supposed to change

Code:
DWORD address = 0x100579C;
and here
Code:
  hwnd = FindWindow(NULL,L"Minesweeper");
so isntead of putting the adressdown there , i coudl only change it on DWORD and changing the Window name, Genious!!!

aanthonyz , TYVM for the support you gave me , i wont forget it , you will be on my respect list , everytime u need something , pm me , ill try my max to help you, tyvm for helping me till the end , Respect , peace , you are a good man , i hope some can hlep you with you Speech to Text , your a good man , someone will help you, anyways , Tyvm for helping me , you deserve much ... ill try for now on coding these things , and after , ill tryto make harder things , harder , and so on, if i have any probllems ill PM you , and if u need my help , pm me . tyvm once more!!!
Thats it...
#12 · 15y ago
wolfguardiann
wolfguardiann
Quote Originally Posted by aanthonyz View Post
Thats it...
Nice , Thnak you very much , if you need someething else , pm me !!

also , if i have problems , you will be the first on the list!!
#13 · 15y ago
ғᴜᴋᴏᴊʀ
ғᴜᴋᴏᴊʀ
Quote Originally Posted by Hell_Demon View Post
8 years /short
So around my age? Like when I started. You're 19 right?
#14 · 15y ago
why06
why06
Quote Originally Posted by -TwEaK View Post


So around my age? Like when I started. You're 19 right?
Nah, HD is 11, and Void is 8.
#15 · 15y ago
Posts 1–15 of 28 · Page 1 of 2

Post a Reply

Similar Threads

  • Write/ReadProcessMemory errorsBy Dragonion in General Game Hacking
    0Last post 18y ago
  • C# WriteProcessMemory/ReadProcessMemoryBy Kantanomo in C# Programming
    10Last post 14y ago
  • ReadProcessMemoryBy Void in C++/C Programming
    17Last post 16y ago
  • ReadProcessMemory - Read 8 byte [solved]By pyton789 in Visual Basic Programming
    7Last post 14y ago

Tags for this Thread

None