|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
thethiny Cheater Reputation: 0
Joined: 01 Apr 2012 Posts: 38 Location: earth
|
Posted: Sun May 31, 2020 2:59 pm Post subject: RAX vs other Registers difference? |
|
|
Hello all, I'm running into a bit of a problem that only RAX seems to be able to fix and I would like to understand why.
Code: |
aobscan(P1Focus,48 8B 87 F8 00 00 00 48 63 80 70) // should be unique
alloc(newmem,$1000,P1Focus)
globalalloc(player, $1000)
newmem:
push rbx
mov [player], rbx
|
This code works
Code: |
aobscan(P1Focus,48 8B 87 F8 00 00 00 48 63 80 70) // should be unique
alloc(newmem,$1000,P1Focus)
globalalloc(player, $1000)
player:
DB 1, 1, 1, 1
newmem:
push rbx
mov rbx, [player]
|
This doesn't work
Code: |
aobscan(P1Focus,48 8B 87 F8 00 00 00 48 63 80 70) // should be unique
alloc(newmem,$1000,P1Focus)
globalalloc(player, $1000)
newmem:
push rax
mov rax, [player]
|
This works.
Why is it that only rax works but nor rbx?[/code] |
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25296 Location: The netherlands
|
Posted: Sun May 31, 2020 4:08 pm Post subject: |
|
|
only rax can address a 64-bit address in the instruction itself. It's the only one that has been designated an instruction to do so, all others can only do RIP relative addressing
your alloc of player without specifying the region will likely be more than 2GB away, so RIP relative addressing can not target it (RIP relative is only 32-bit)
you can allocate player near newmem and fix it like that, or use rax, or do:
Code: |
mov rbx,player
mov rbx,[rbx]
|
_________________
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 |
|
|
thethiny Cheater Reputation: 0
Joined: 01 Apr 2012 Posts: 38 Location: earth
|
Posted: Sun May 31, 2020 11:25 pm Post subject: |
|
|
Dark Byte wrote: | only rax can address a 64-bit address in the instruction itself. It's the only one that has been designated an instruction to do so, all others can only do RIP relative addressing
your alloc of player without specifying the region will likely be more than 2GB away, so RIP relative addressing can not target it (RIP relative is only 32-bit)
you can allocate player near newmem and fix it like that, or use rax, or do:
Code: |
mov rbx,player
mov rbx,[rbx]
|
|
Thank you for your response. I tried to allocate player near newmem but RBX didn't work, so I thought that isn't the issue here, but now that you've explained it it makes sense.
Do you have a list of special functions for the registers that I can look into? Like for example you said RAX is the only one with 64bit address, are there any other things I can find out about other registers maybe? Thanks again! |
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25296 Location: The netherlands
|
|
Back to top |
|
|
thethiny Cheater Reputation: 0
Joined: 01 Apr 2012 Posts: 38 Location: earth
|
Posted: Mon Jun 01, 2020 2:18 am Post subject: |
|
|
Thank you, it has everything I'd ever need 👍🏻 |
|
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
|
|