View previous topic :: View next topic |
Author |
Message |
MexKexFlex How do I cheat? Reputation: 0
Joined: 02 Mar 2015 Posts: 8
|
Posted: Mon Mar 02, 2015 8:44 am Post subject: readInteger/readPointer problem |
|
|
Here is my problem.
I have 32 bit process and an address 02023244.
I do:
Code: | local ptr = readPointer("02023244") |
I get:
It should be df9e0000, because memory view looks like this:
02023240: 00000000
02023244: df9e0000
02023248: 00101001
Then I want to read from this pointer another one:
Code: | local ptr2 = readPointer(ptr + 4) |
After I do this ptr2 equals nil. I think the problem is that
it reads signed integer and it converts it to 64bit address and when
I'm trying to pass this value to another readPointer it reads 64 bit address
instead of 32 bit, so it tries to read ffffffffdf9e0000 instead of df9e0000 (???)
How to read it properly?
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25288 Location: The netherlands
|
Posted: Mon Mar 02, 2015 8:52 am Post subject: |
|
|
weird. Looks like a bug
use bAnd(value,0xffffffff) to convert it to a 32-bit value
_________________
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 |
|
|
MexKexFlex How do I cheat? Reputation: 0
Joined: 02 Mar 2015 Posts: 8
|
Posted: Mon Mar 02, 2015 9:08 am Post subject: |
|
|
Dark Byte wrote: | weird. Looks like a bug
use bAnd(value,0xffffffff) to convert it to a 32-bit value |
Thanks. That solved the problem for me. I've tried before some C bitwise operators like "&", but I forgot it's lua, also I forgot to mention that it only
happens when cheat engine is 64 bit and target process is 32.
When I run 32 bit version of cheat engine everything
seems to be working just fine.
|
|
Back to top |
|
|
mgr.inz.Player I post too much Reputation: 218
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Mon Mar 02, 2015 10:38 am Post subject: |
|
|
Hmm, it works as expected:
_________________
|
|
Back to top |
|
|
MexKexFlex How do I cheat? Reputation: 0
Joined: 02 Mar 2015 Posts: 8
|
Posted: Mon Mar 02, 2015 10:47 am Post subject: |
|
|
mgr.inz.Player wrote: | Hmm, it works as expected: |
You read 64 bit pointer from 64 bit process - in this case everything is working. When you run 64-bit cheat engine and you will try to read integer from 32-bit process that is greater than 0x7FFFFFFF you will end up with FFFFFFFF90909090 if the value that you're trying to read is f.ex 90909090.
|
|
Back to top |
|
|
mgr.inz.Player I post too much Reputation: 218
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Mon Mar 02, 2015 11:09 am Post subject: |
|
|
Hmm, the same is with readInteger.
Anyway, readPointer is designed to read pointers. Where did you find 32bit process which can use address above 7FFFFFFF ?
ASLR mechanism ?
_________________
|
|
Back to top |
|
|
MexKexFlex How do I cheat? Reputation: 0
Joined: 02 Mar 2015 Posts: 8
|
Posted: Mon Mar 02, 2015 11:28 am Post subject: |
|
|
According to microsoft the Virtual Address Space for process can be adjusted: BCDEdit /set increaseuserva Megabytes
but, it can't be higher than 3GB.
This 32-bit process is TERA.exe - MMORPG game. I'm just reading some local player information.
Pointers like FDC85000 are for this game normal thing, which is way more than 3GB.
|
|
Back to top |
|
|
mgr.inz.Player I post too much Reputation: 218
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Mon Mar 02, 2015 12:54 pm Post subject: |
|
|
In that case, use my _readPointer function.
Code: | function _readPointer(a)
local v=readPointer(a)
if targetIs64Bit() then return v
elseif v~=nil then return v % 0x100000000
else return nil
end
end |
and _readInteger function.
Code: | function _readInteger(a)
local v=readInteger(a)
if v~=nil then return v % 0x100000000
else return nil
end
end |
_________________
|
|
Back to top |
|
|
|