|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
Turkeychopio Cheater Reputation: 0
Joined: 06 Aug 2014 Posts: 36
|
Posted: Sun May 09, 2021 11:23 am Post subject: cmp with more than 1 offset |
|
|
What's the syntax for cmp's in assembler with more than one offset?
Such as RSI offset 0 = 28, offset 1 = 4, offset 2 = 8
I've tried cmp [rsi+28+4+8] and [rsi+28]+4]+8]
|
|
Back to top |
|
|
TheyCallMeTim13 Wiki Contributor Reputation: 50
Joined: 24 Feb 2017 Posts: 976 Location: Pluto
|
Posted: Sun May 09, 2021 12:32 pm Post subject: Re: cmp with more than 1 offset |
|
|
Turkeychopio wrote: | What's the syntax for cmp's in assembler with more than one offset?
Such as RSI offset 0 = 28, offset 1 = 4, offset 2 = 8
I've tried cmp [rsi+28+4+8] and [rsi+28]+4]+8] |
You have to iterate through the pointer.
Code: |
push rax
mov rax,[rsi+28]
test rax,rax
jz @f
mov rax,[rax+4]
test rax,rax
jz @f
cmp [rax+8],0
@@:
pop rax |
_________________
|
|
Back to top |
|
|
Turkeychopio Cheater Reputation: 0
Joined: 06 Aug 2014 Posts: 36
|
Posted: Sun May 09, 2021 1:39 pm Post subject: Re: cmp with more than 1 offset |
|
|
TheyCallMeTim13 wrote: | You have to iterate through the pointer.
Code: |
push rax
mov rax,[rsi+28]
test rax,rax
jz @f
mov rax,[rax+4]
test rax,rax
jz @f
cmp [rax+8],0
@@:
pop rax |
|
Is this always the syntax I should always use?
This is my context below, I need to cmp rsi+4C+28+4
Code: |
newmem:
cmp [rsi+4C],0
jne code
movss [rsi+14],xmm2
jmp return
code:
mov [rsi+14],(float)1600
jmp return
INJECT:
jmp newmem
return:
|
So would it be like this?
Code: |
newmem:
push rax
mov rax,[rsi+4C]
test rax,rax
jz @f
mov rax, [rax+28]
test rax,rax
jz @f
cmp [rax+4],0
jne code
movss [rsi+14],xmm2
pop rax
jmp return
code:
mov [rsi+14],(float)1600
jmp return
INJECT:
jmp newmem
return:
|
|
|
Back to top |
|
|
TheyCallMeTim13 Wiki Contributor Reputation: 50
Joined: 24 Feb 2017 Posts: 976 Location: Pluto
|
Posted: Sun May 09, 2021 2:29 pm Post subject: Re: cmp with more than 1 offset |
|
|
Move the POP so it's always ran, for any PUSH you want a matching POP, which would be missing if jumping to "code".
Code: | newmem:
push rax
mov rax,[rsi+4C]
test rax,rax
jz @f
mov rax, [rax+28]
test rax,rax
jz @f
cmp [rax+4],0
pop rax
jne code
movss [rsi+14],xmm2
jmp return
code:
mov [rsi+14],(float)1600
jmp return
INJECT:
jmp newmem
return: |
_________________
|
|
Back to top |
|
|
Turkeychopio Cheater Reputation: 0
Joined: 06 Aug 2014 Posts: 36
|
Posted: Sun May 09, 2021 2:42 pm Post subject: |
|
|
Thanks a lot for help
|
|
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
|
|