| View previous topic :: View next topic |
| Author |
Message |
Portujua How do I cheat?
Reputation: 0
Joined: 27 Feb 2012 Posts: 6
|
Posted: Fri Apr 05, 2013 12:04 pm Post subject: How to read memory values? |
|
|
Hi, I want to read a value that's inside an address in C++ just like Cheat Engine does... Do i need to inject a .dll into the process to get this done? Or can i do it without injecting, just, idk, getting process handle?..
| Code: | DWORD ReadPointer(DWORD bAddress)
{
return *(ULONG_PTR*)(bAddress);
} |
I'm using that function but i'm getting this error:
| Quote: | | Unhandled exception at 0x01313431 in TestCode.exe: 0xC0000005: Access violation reading location 0x00DE3EA8 |
And here's the piece of code that throws that error:
| Code: | DWORD coordXBaseAddress = 0x00DE3EA8;
int x = ReadPointer(coordXBaseAddress);
cout << x << endl; |
Thank you.
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Fri Apr 05, 2013 12:22 pm Post subject: |
|
|
Using your code above requires you to be injected. If not, it will attempt to read the memory of your own application and not the one you want.
If you want to remotely read memory of another process, you can use ReadProcessMemory instead.
_________________
- Retired. |
|
| Back to top |
|
 |
Portujua How do I cheat?
Reputation: 0
Joined: 27 Feb 2012 Posts: 6
|
Posted: Fri Apr 05, 2013 12:54 pm Post subject: |
|
|
| Done it, thanks
|
|
| Back to top |
|
 |
|