Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Comparing Doubles

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
Navust
How do I cheat?
Reputation: 0

Joined: 02 May 2018
Posts: 2

PostPosted: Sat Aug 31, 2019 8:22 pm    Post subject: Comparing Doubles Reply with quote

I am comparing two doubles for an injection copy using the player's X coordinate and a targeted X coordinate. I've had no luck in comparing them properly.

I've tried:
#1
cmp [rdx-60],(double)42.5 // always true even when [rdx-60] isn't 42.5
je copy

#2
cmp qword [rdx-60],(double)42.5 // always false
je copy

Is there a correct way to do this?
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 149

Joined: 25 Jan 2006
Posts: 7735
Location: 127.0.0.1

PostPosted: Sat Aug 31, 2019 9:01 pm    Post subject: Reply with quote

Look into:
- movsd
- ucomisd
- lahf (depending on how you're using the results)

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Navust
How do I cheat?
Reputation: 0

Joined: 02 May 2018
Posts: 2

PostPosted: Sat Aug 31, 2019 9:31 pm    Post subject: Reply with quote

Thanks, I'll look into them.

EDIT: I'm not too sure how to use ucomisd since it uses XMM registers... I'm still a beginner.

I've tried doing:

movsd xmm0,[rdx-60]
mov [number],(double)42.5
movsd xmm1,[number]
ucomisd xmm0,xmm1

Result never becomes true...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites