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 


FPU compare for zero

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
hhhuut
Grandmaster Cheater
Reputation: 6

Joined: 08 Feb 2015
Posts: 607

PostPosted: Fri Aug 28, 2015 9:00 am    Post subject: FPU compare for zero Reply with quote

Hey guys,

I got a problem with the FPU stack, trying to compare the seventh element with zero and reacting accordingly ...

If I debug an address and open the xmm-register view, I can use the first combo box to choose between XMM and FPU.



To differ between AI and human players, I need to compare the seventh stack element with zero.



If it is zero, then it's a human player, if not, then it's an AI ...

Also important is, that only the second part of the seventh FPU element holds my required information. I think this could be solved by comparing the element as a qword, but I'm not really sure ...



Hope you guys understand my problem (if not then ask what you need to know, pls) and can come up with a solution

Greetz
hhhuut
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Fri Aug 28, 2015 1:32 pm    Post subject: Reply with quote

Wonder how much more complicated this is than it needs to be...
Code:
alloc(backup,4)
alloc(compare,4)
fstp dword ptr [backup]
fldz
fadd st(0),st(7)
fstp dword ptr [compare]
fld dword ptr [backup]
cmp dword ptr [compare],0
je return

edit: Guess I could've just done
Code:
alloc(backup,4)
fstp dword ptr [backup]
fldz
fcomip st(0),st(7)
fld dword ptr [backup]
je return

Or should these be "JZ" instead of "JE"?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine 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