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 


Floats and conditional jumps

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
Tom331
Cheater
Reputation: 0

Joined: 14 Jul 2007
Posts: 25

PostPosted: Sun Mar 07, 2010 9:02 am    Post subject: Floats and conditional jumps Reply with quote

I'm working on a trainer and need to compare a float value and jump if it is greater than the compare value.
Basically this is what I need, but for floats

Code:
cmp eax, -0.34
jge 543252


I know I need to use FNSTSW AX but I don't understand how to use it.

This is what I have so far
Code:
fld [esp+00000100]
fcomp [877108]
FNSTSW AX


Any help is welcome, thanks Smile
Back to top
View user's profile Send private message
dEagle
Expert Cheater
Reputation: 0

Joined: 17 Jun 2006
Posts: 225
Location: CheatEngine Forum

PostPosted: Tue Mar 16, 2010 6:34 am    Post subject: Reply with quote

I hope this helps for you.
Code:
00401029  |.  8D7D C0       LEA EDI,DWORD PTR SS:[EBP-40]
0040102C  |.  B9 10000000   MOV ECX,10
00401031  |.  B8 CCCCCCCC   MOV EAX,CCCCCCCC
00401036  |.  F3:AB         REP STOS DWORD PTR ES:[EDI]
00401038  |.  D905 306A4200 FLD DWORD PTR DS:[Value]
0040103E  |.  DC1D 38404200 FCOMP QWORD PTR DS:[__real@8@bffdae147ae>
00401044  |.  DFE0          FSTSW AX
00401046  |.  F6C4 41       TEST AH,41
00401049  |.  75 0D         JNZ SHORT Win32Tes.00401058
0040104B  |.  68 1C404200   PUSH OFFSET Win32Tes.??_C@_0BC@KMGB@Yes?>; /format = "Yes i am higher.
"
00401050  |.  E8 7B000000   CALL Win32Tes.printf                     ; \printf




which belongs to this source code
Code:
float Value =1;

void Compare()
{
if(Value > -0.34)
{
   printf("Yes i am higher.\n");
}


}
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