[help] WriteProcessMemory :S

Posts 1–4 of 4 · Page 1 of 1
[help] WriteProcessMemory :S
hi people,

umm im just wondering how i would go about writing memory into a program.

for instance, forcing sv_cheats 0 to sv_cheats 1 in CS:S.
I've got the memory codes, but i cant find a tutorial that explains it PROPERLY, and i always end up with errors.

thanks in advance.
[php]
#include <windows.h>

int main()
{
DWORD pid;

HWND hwnd = FindWindow(0,"Window Caption");

GetWindowThreadProcessId(hwnd,&pid);

HANDLE handle = OpenProcess(PROCESS_VM_OPERATION|PROCESS_VM_WRITE, false,pid);

WriteProcessMemory(handle,(LPVOID)0xAddress,Memory ToWrite,AmountToWrite,Written);
}

[/php]

The WriteProcessMemory part of that obviously isn't correct, you'd have to edit it according to what you're trying to do, but I basically wrote up a tiny template for writing memory.

Enjoy.
Quote Originally Posted by Void View Post
[php]
#include <windows.h>

int main()
{
DWORD pid;

HWND hwnd = FindWindow(0,"Window Caption");

GetWindowThreadProcessId(hwnd,&pid);

HANDLE handle = OpenProcess(PROCESS_VM_OPERATION|PROCESS_VM_WRITE, false,pid);

WriteProcessMemory(handle,(LPVOID)0xAddress,Memory ToWrite,AmountToWrite,Written);
}

[/php]

The WriteProcessMemory part of that obviously isn't correct, you'd have to edit it according to what you're trying to do, but I basically wrote up a tiny template for writing memory.

Enjoy.
much appreciated
Solved & Locked.
If you get errors with that: GTFO and learn to code.

~LOCKED~
Posts 1–4 of 4 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us