 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
Dark Byte Site Admin
Reputation: 471
Joined: 09 May 2003 Posts: 25823 Location: The netherlands
|
Posted: Sun Aug 03, 2014 9:17 am Post subject: |
|
|
Check your unneeded typecasting
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
NullBy7e Cheater
Reputation: 0
Joined: 23 Jul 2014 Posts: 47
|
Posted: Sun Aug 03, 2014 9:46 am Post subject: |
|
|
| Code: |
int addr;
ReadProcessMemory(CSettings::phandle, (LPCVOID*)(DWORD*)CSettings::base + 0x00FD1D9C, &addr, sizeof(addr), 0);
ReadProcessMemory(CSettings::phandle, (LPCVOID*)(DWORD*)addr + 0x60, &addr, sizeof(addr), 0);
ReadProcessMemory(CSettings::phandle, (LPCVOID*)(DWORD*)addr + 0xA4, &addr, sizeof(addr), 0);
byte* cname = new byte[24];
ReadProcessMemory(CSettings::phandle, (LPCVOID*)(DWORD*)addr, &cname, sizeof(cname), 0);
char* data;
hexArrayToStr(cname, sizeof(cname), &data);
cout << data;
delete cname;
delete data;
|
How about this?
I get no errors no nothing and instead of a string of 24bytes it prints an hex address.
When I enclose it in () like so, I get access violation at hexArrayToStr:
| Code: |
ReadProcessMemory(CSettings::phandle, (LPCVOID*)(DWORD*)(CSettings::base + 0x00FD1D9C), &addr, sizeof(addr), 0);
ReadProcessMemory(CSettings::phandle, (LPCVOID*)(DWORD*)(addr + 0x60), &addr, sizeof(addr), 0);
ReadProcessMemory(CSettings::phandle, (LPCVOID*)(DWORD*)(addr + 0xA4), &addr, sizeof(addr), 0);
|
|
|
| Back to top |
|
 |
NullBy7e Cheater
Reputation: 0
Joined: 23 Jul 2014 Posts: 47
|
Posted: Mon Aug 04, 2014 4:23 am Post subject: |
|
|
Why is the third address thats printed not what it should be?
Is ReadProcessMemory shifting bytes or something?
| Code: |
int addr = 0;
ReadProcessMemory(CSettings::phandle, (void*)(CSettings::base + 0x00FD1D9C), &addr, sizeof(addr), 0);
printf("Addr : 0x%08X\n\n", addr);
ReadProcessMemory(CSettings::phandle, (void*)(addr + 0x60), &addr, sizeof(addr), 0);
printf("Addr : 0x%08X\n\n", addr);
ReadProcessMemory(CSettings::phandle, (void*)(addr + 0xA4), &addr, sizeof(addr), 0);
printf("Addr : 0x%08X\n\n", addr);
|
OUTPUT:
| Code: |
Addr : 0x100A81C0
Addr : 0x15427890
Addr : 0x00610053
Press any key to continue . . .
|
| Description: |
|
| Filesize: |
4.48 KB |
| Viewed: |
6743 Time(s) |

|
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 471
Joined: 09 May 2003 Posts: 25823 Location: The netherlands
|
Posted: Mon Aug 04, 2014 4:38 am Post subject: |
|
|
0x15427890+0xa4=the address of the string
you don't need to read that as a pointer, but as a string
so instead of
| Code: |
ReadProcessMemory(CSettings::phandle, (LPCVOID*)(DWORD*)(addr + 0xA4), &addr, sizeof(addr), 0);
|
do
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
NullBy7e Cheater
Reputation: 0
Joined: 23 Jul 2014 Posts: 47
|
Posted: Mon Aug 04, 2014 4:45 am Post subject: |
|
|
i will try but I do not understand.
I have to read the value of addr + A4 to get the final address and then I read the 24 bytes from that.
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Mon Aug 04, 2014 7:04 pm Post subject: |
|
|
Addr : 0x00610053
is correct. You just need to read that last part as your string. 53 in hex is S which is what you needed.
_________________
- Retired. |
|
| 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
|
|