 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
Kronogenics Advanced Cheater
Reputation: 0
Joined: 01 Dec 2016 Posts: 82
|
Posted: Fri Dec 16, 2016 8:07 am Post subject: Issue with comparing doubles |
|
|
I have looked around at some other topics that have answers and put them to use, they do seem to be what I am looking for but it's not working the way I intended.
| Code: |
label(code)
label(velocityCheck)
label(newVelocity)
label(lockVelocity)
label(return)
registersymbol(INJECT)
newmem:
code:
addsd xmm0,xmm1
movsd [velocityCheck],xmm0
push rcx
mov rcx,[newVelocity]
cmp [velocityCheck],rcx
pop rcx
jge lockVelocity
movsd [ecx],xmm0
jmp return
lockVelocity:
movsd xmm0,[newVelocity]
movsd [ecx],xmm0
jmp return
velocityCheck:
dq 0
newVelocity:
dq (double)4.0
INJECT:
jmp code
db 90 90 90
return:
[DISABLE]
INJECT:
addsd xmm0,xmm1
movsd [ecx],xmm0
unregistersymbol(INJECT)
dealloc(newmem)
|
This is what I have done and it always jumps to lockVelocity even when the velocity is lower than 4.0.
|
|
| Back to top |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Fri Dec 16, 2016 8:54 am Post subject: |
|
|
| Code: | code:
addsd xmm0,xmm1
movsd xmm1,[newVelocity]
comisd xmm0,xmm1
jnb lockVelocity
movsd [ecx],xmm0
lockVelocity:
movsd [ecx],xmm1 |
|
|
| Back to top |
|
 |
Kronogenics Advanced Cheater
Reputation: 0
Joined: 01 Dec 2016 Posts: 82
|
Posted: Sat Dec 17, 2016 2:49 pm Post subject: |
|
|
| Thank you, worked like a charm.
|
|
| 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
|
|