|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
PinPoint Expert Cheater Reputation: 10
Joined: 07 Apr 2016 Posts: 223 Location: Scotland
|
Posted: Sun Jan 17, 2021 1:46 pm Post subject: Reading a register value help |
|
|
Its been a while since ive done anything with CE and think i'm a bit rusty:D
I am trying to read the value of the following instruction;
Code: | movsd [r9+r11*8+07],xmm0 |
My script seems to not like it when i try this and it doesnt execute.
it executes if I change r9 to RAX so thinking I dont understand the Rn registers.
I have globally allocated (base, and (base1,- which I also tried as with 64 a memory
and was trying the code:
Code: |
mov [base],r9
add [base],r11
mov [base1],base
add [base1],base
add [base1],base
add [base1],base
add [base1],base
add [base1],base
add [base1],base
add [base1],base |
I feel there is a simpler way than this anyway if anyone could help?
edit.
it has been a long time
I chnaged the code to this and it workd
Code: |
mov [keep], rax
pop rax
mov rax,r11
imul rax,8
add rax,r9
add rax,7
mov [base],rax
pop rax
mov rax,[keep]
movsd [r9+r11*8+07],xmm0
jmp return
|
Is there anything I should do different or a smoother way of doing this?
_________________
Will you be my friend Hitler?
Rep me then |
|
Back to top |
|
|
ParkourPenguin I post too much Reputation: 140
Joined: 06 Jul 2014 Posts: 4300
|
Posted: Sun Jan 17, 2021 6:51 pm Post subject: |
|
|
RIP-relative addressing shouldn't be affected by the REX prefix AFAIK...
Might be a bug in CE. I can't test this now, but this should assemble fine:
Code: | globalalloc(testcode,256)
label(foo)
testcode:
// assembles to: 4c 89 0d 00 00 00 00
mov [foo],r9
foo: |
If that test works, you're probably doing something weird in your script.
Post the entire script if you want more help.
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25296 Location: The netherlands
|
Posted: Sun Jan 17, 2021 7:05 pm Post subject: |
|
|
only RAX can directly address memory that's further than 2GB away
any other register has to use indirection
e.g:
Code: |
push rbx
mov rbx,foo //you can assign 64-bit values directly to registers though
mov [rbx],r9
pop rbx
|
or
Code: |
push rax
mov rax,r9
mov [foo],rax //only rax can access >2GB regions
pop rax
|
or just allocate foo nearby the code using the 3th alloc prameter
_________________
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 |
|
|
|
|
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
|
|