 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
PsychicSymphony Newbie cheater
Reputation: 0
Joined: 17 May 2011 Posts: 13 Location: Ontario
|
Posted: Fri Jun 10, 2011 2:44 pm Post subject: [HELP]c++ ReadProcessMemory not working? |
|
|
I have this address that im trying to findout the value for by using ReadProcessMemory()
Heres how I use it:
[code]
#define base 0x00CBDBDC
#define X (LPDWORD)base + 0x3B9C
int xval = 0;
char msg[255];
sprintf(msg, "Address = %i", X);
MessageBox(0, msg, "addy", 0);
ReadProcessMemory(hProc, X, &x, sizeof(int). NULL);
char cx[255];
itoa(xval, cx, 255);
MessageBox(0, cxMob, "X", 0);
[/code]
When I run this code it returns the address as 13421132
and the value as 12C□□ I know this isnt the proper value it should return a number around 0 to 2000 am I doing something wrong? Also I think the address is wrong.
_________________
Psychic Symphony
////
// //
// //
//// |
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Fri Jun 10, 2011 4:09 pm Post subject: |
|
|
You are doing so many castings for no reason...
Firstly, don't define an address. Give it a variable.
Something such as this will suffice:
| Code: | | DWORD dwAddress = 0x00CBDBDC + 0x3B9C; // Just combine the values anyway since they are both static. |
Next keep in mind that if you use Visual Studio, sprintf is depreciated and you should use the secure function instead, sprintf_s. %i is a decimal integer, if you want to show the address as hex, use %x instead, a formatted address can use: 0x%08X
Your last message box uses itoa for no reason, you can just sprintf again like before.
And if the address is wrong, nothing we can do to help you, that's up to you to figure out while debugging/hacking the game.
_________________
- Retired. |
|
| Back to top |
|
 |
PsychicSymphony Newbie cheater
Reputation: 0
Joined: 17 May 2011 Posts: 13 Location: Ontario
|
Posted: Fri Jun 10, 2011 4:19 pm Post subject: |
|
|
thanks it works also the address was wrong because of sprintf so it works now with %x thanks so much
_________________
Psychic Symphony
////
// //
// //
//// |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|