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 › Writeprocessmemory syntax

Writeprocessmemory syntax

Posts 1–12 of 12 · Page 1 of 1
DJ
djtrickdog
Writeprocessmemory syntax
Ok hello MPGH community i am having some C++ troubs
I am making a stand alone hack (not a dll that needs to be injected) and i have a question that deals with the syntaxing of WriteProcessMemory.
Code:
WriteProcessMemory(ProcessHandle,(LPVOID*)(DWORD)address, &value , MY QUESTION,NULL);
How do i know how many bytes i just wrote? For instance, for an ammo address, (which lets just say is 0x0FAA458B) i write the value 99. What would my bytes be?

Also i have another quick question. Looking at some pointers for Combat Arms, they use something that is cshell.dll+0xHexAddress. Would i use the same kind of method for the address? i am very new to game hacking, so sorry if this is really simple
#1 · 18y ago
XE
Xealot
Quote Originally Posted by djtrickdog View Post
Ok hello MPGH community i am having some C++ troubs
I am making a stand alone hack (not a dll that needs to be injected) and i have a question that deals with the syntaxing of WriteProcessMemory.
Code:
WriteProcessMemory(ProcessHandle,(LPVOID*)(DWORD)address, &value , MY QUESTION,NULL);
How do i know how many bytes i just wrote? For instance, for an ammo address, (which lets just say is 0x0FAA458B) i write the value 99. What would my bytes be?

Also i have another quick question. Looking at some pointers for Combat Arms, they use something that is cshell.dll+0xHexAddress. Would i use the same kind of method for the address? i am very new to game hacking, so sorry if this is really simple
You should use sizeof linky
#2 · 18y ago
DJ
djtrickdog
Quote Originally Posted by Xealot View Post
You should use sizeof linky
of so if i just use sizeof(myvaluevariable) it should be found automaticly? Sweet. And what if my hex address is something like 0x0f0f0f (6 hex digits long) or 0x0f0f0f0f (8 long) does this matter about anything?
#3 · 18y ago
SH
ShabbaStoney
No it doesn't matter, just do sizeof(int) or sizeof( long ) where int and long are your variable types
#4 · edited 18y ago · 18y ago
DJ
djtrickdog
Why isnt my value being written to my address?
C++ pastebin - collaborative debugging tool
Im testing with a sonic game right now with a static ring address
#5 · 18y ago
SH
ShabbaStoney
I think it has something to do with the HANDLE being passed into WriteProcessMemory.

Try modifying this function first from:

Code:
void GetProcess(LPSTR windowname)
to

Code:
HANDLE GetProcess( LPSTR windowname )
{
// Keep everything as it is but at the end :

return processHandle;
}
Then in the function:

Code:
void ModifyAddr(int address, int value)

//  change it to 

void ModifyAddr( HANDLE handle, int address, int value )
{
WriteProcessMemory(handle,(LPVOID*)address, &value , sizeof(value) ,NULL);
}
Then when using these two modified functions you can:

Code:
HANDLE handle = GetProcess(....);

ModifyAddr( handle, ...... );
Let me know if that works. Fingers crossed :P
#6 · 18y ago
DJ
djtrickdog
ill try it thanks
Here is after fixing with your edits, my code looks like:
C++ pastebin - collaborative debugging tool

ok i get errors:
Code:
 C:Dev-Cpptester.cpp In function `void* GetProcess(CHAR*)': 
21 C:Dev-Cpptester.cpp `ProcessHandle' undeclared (first use this function) 
  (Each undeclared identifier is reported only once for each function it appears in.) 
 C:Dev-CppMakefile.win [Build Error]  [venom.o] Error 1
#7 · edited 18y ago · 18y ago
SH
ShabbaStoney
change ProcessHandle = OpenProcess(PROCESS_ALL_ACCESS,0,pid);

into

HANDLE ProcessHandle = OpenProcess(PROCESS_ALL_ACCESS,0,pid);

and change vid GetProcess(..)

into

HANDLE GetProcess(...)

The first error is because you are going to return a handle so the return TYPE is HANDLE. The second error was you weren't declaring ProcessHandle as a HANDLE it was just nothing.
#8 · 18y ago
DJ
djtrickdog
vid GetProcess(..) ? if you mean void Getprocess, i dont have that anywhere in my code
#9 · 18y ago
SH
ShabbaStoney
Sorry I meant HANDLE GetProcess(..)
#10 · 18y ago
DJ
djtrickdog
cool it works! Thanks alot! You have msn or aim?
#11 · 18y ago
SH
ShabbaStoney
I have msn but I'm not on it a lot, if ya want you can PM on here
#12 · 18y ago
Posts 1–12 of 12 · Page 1 of 1

Post a Reply

Similar Threads

  • WriteProcessMemory(); helpBy hileci555 in C++/C Programming
    2Last post 18y ago
  • [Help]I get these SYNTAX errors.Please HelpBy phoenixraider in C++/C Programming
    2Last post 17y ago
  • [C++] WriteProcessMemory WorkSpaceBy Toymaker in C++/C Programming
    1Last post 17y ago
  • writeprocessmemory functionBy qsc in C++/C Programming
    14Last post 17y ago
  • [Request] WriteProcessMemory ExampleBy PlSlYlClHlO in C++/C Programming
    5Last post 17y ago

Tags for this Thread

#syntax#writeprocessmemory