Hack Forums
[C] [C++] How to Read Process Memory +Address/offsets - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [C] [C++] How to Read Process Memory +Address/offsets (/showthread.php?tid=5067264)



[C++] How to Read Process Memory +Address/offsets - Walkirio - Nov 22, 2015

Hello guys.
I was interested to join in this fantastic world of "games cheat/trainer".
I know c++ but i dont know how to take the address/offsets and how to use it.
I know the funcs to RPM,but then what i have to do ?
Because when i put an Address and try to get the life or other shits i get value like "-91929449 ecc.."
If you can give me some tutorial on some simple games or other things i will appreciate.
(My english is bad so dont judge me 😁 )


* - Nymphetamin - Nov 22, 2015

Post your example of ReadProcessMemory and if you're doing it wrong, I'll tell you.


* - Walkirio - Nov 23, 2015

(Nov 22, 2015 06:44 PM)Nymphetamin Wrote:  Post your example of ReadProcessMemory and if you're doing it wrong, I'll tell you.
DWORD address = 0x100579C;
int HP = 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,&HP,sizeof(HP),0);
cout << HP << "\n";
Sleep(1000);
}
return 0;
}
THE ADDRESS is a number like -29134914,when it should be 100 or less.


* - Nymphetamin - Nov 23, 2015

First are you sure it's an int and not a byte or short? Or float? Second, why would Minesweeper have HP? What is HP? What is 100?
Are you 100% certain that 0x100579C is the correct address?