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 › [Request] WriteProcessMemory Example

[Request] WriteProcessMemory Example

Posts 1–6 of 6 · Page 1 of 1
PlSlYlClHlO
PlSlYlClHlO
[Request] WriteProcessMemory Example
I've been learning C++ for about a week now.. (I've also made the switch and am now using DevC++)

Thank's to a Friend who gave me a bit of help, I now know how to get a ProcessID and use HWND correctly to detect when a window is open (Yay?)

Well.. I'm having trouble with Writing memory, and pointers.

could someone give me tips/examples on how to do these two things? I know that pointers can be found via Cheat Engine. But i have no idea how.

I'm completely lost when it comes to WriteProcessMemory. I'm trying to make a simple hack (my first) that will change the score in pinball (windows XP).

Could anyone help? give me some examples or something if you can, or write a tutorial if you can?

Thanks in advance,

Psycho.
#1 · 17y ago
radnomguywfq3
radnomguywfq3
Quote Originally Posted by PlSlYlClHlO View Post
I've been learning C++ for about a week now.. (I've also made the switch and am now using DevC++)

Thank's to a Friend who gave me a bit of help, I now know how to get a ProcessID and use HWND correctly to detect when a window is open (Yay?)

Well.. I'm having trouble with Writing memory, and pointers.

could someone give me tips/examples on how to do these two things? I know that pointers can be found via Cheat Engine. But i have no idea how.

I'm completely lost when it comes to WriteProcessMemory. I'm trying to make a simple hack (my first) that will change the score in pinball (windows XP).

Could anyone help? give me some examples or something if you can, or write a tutorial if you can?

Thanks in advance,

Psycho.
I'm not going to write an article on how a computer manages memory, or how APIs work in windows, so if you don't understand what I'm saying you have a bit more research to do before doing this.

First of all, most windows APIs are documented, and are stored in the MSDN Library. Usage of the APIs is defined there. I will explain how to the required parameters.

WriteProcessMemory(
-Handle to destination virtual address space - Can be acquired via OpenProcess(possibly other APIs if you can locate them via the MSDN Library. ) usage of OpenProcess is defined in the MSDN Library.
-address - Address to write to.
-buffer - Pointer to a buffer. A buffer can be an array of bytes, or a single integer value. It can be anything you put in it.
-size- size of buffer. Use sizeof to acquire the size.
-Bytes Written - Pointer to an unsigned long that will hold(after the function call) the number of bytes that've been written to the address. Set to null if you don't want to make use of this
);

Example :
int* iMyVar;
WriteProcessMemory(procHandle, (LPVOID*)0x123456, &iMyVar, sizeof(iMyVar), 0);
#2 · edited 17y ago · 17y ago
PlSlYlClHlO
PlSlYlClHlO
Thanks for your quick reply

this helps, but i'm still sort of confused. is "0x123456" the address i would use to write? i see the 0xAddressHere in tutorials all the time, but it doesn't explain it very well. What does the 0x do/mean?
#3 · 17y ago
radnomguywfq3
radnomguywfq3
Quote Originally Posted by PlSlYlClHlO View Post
Thanks for your quick reply

this helps, but i'm still sort of confused. is "0x123456" the address i would use to write? i see the 0xAddressHere in tutorials all the time, but it doesn't explain it very well. What does the 0x do/mean?
0x is the prefix of a hexadecimal value.
#4 · 17y ago
Toymaker
Toymaker
You could have always pressed 'search' and found my WriteProcessMemory example, or even looked at my GameHacking101 tutorial for a ready-to-compile, with Dev-C++, example. It's good you're taking it slow, by the way, and trying to make sure you understand it, it's what seperates potential hackers from wannabes. So, if you trace your score decreasing, to the last address, beings that game doesn't use DMA, you could just write the score you want to it but, write in hex i.e. if you want 10 score, write 0A to it. If you use Cheat Engine and right click on the address and select 'view what writes here,' you'll probably find the actual in-game function for handling score, instead of just the address it's using to store score temporarily. You can then use a Debugger, like OllyDBG, to learn more. Good luck...
#5 · edited 17y ago · 17y ago
PlSlYlClHlO
PlSlYlClHlO
Thank you Both.
#6 · 17y ago
Posts 1–6 of 6 · Page 1 of 1

Post a Reply

Similar Threads

  • WWII Online Battle over europe - hack requestBy Joe.. in Hack Requests
    1Last post 13y ago
  • SCCT Versus request [release]By LiLLeO in Hack Requests
    2Last post 13y ago
  • Requesting Lineage 2 BannerBy arunforce in Help & Requests
    3Last post 20y ago
  • sig question (NOT A SIG REQUEST)By kvmn8 in Art & Graphic Design
    5Last post 20y ago
  • Request sig :\By sann in Help & Requests
    1Last post 20y ago

Tags for this Thread

#request#writeprocessmemory