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 


How to convert integer to float ? [Solved]
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
_KRN_
Newbie cheater
Reputation: 0

Joined: 12 May 2016
Posts: 12
Location: Armchair

PostPosted: Sun Aug 21, 2016 7:24 am    Post subject: Reply with quote

mgr.inz.Player wrote:

fild dword ptr [esp]

f - FPU instruction
i - integer
ld - load
dword ptr - it will load 32bit signed integer (m32int)
[esp] - from the top of stack

yes i know but i dont understand that LOAD part
does it mean that it stores the value into special float stack that is different from the [esp] one?
(like push but on float stack) Question
Back to top
View user's profile Send private message
hhhuut
Grandmaster Cheater
Reputation: 6

Joined: 08 Feb 2015
Posts: 607

PostPosted: Sun Aug 21, 2016 7:31 am    Post subject: Reply with quote

Yes, it loads the value on top of the FPU stack, which is NOT the same as the stack referenced to by ebp and esp!

http://www.cs.binghamton.edu/~sgreene/cs220-2009f/topics/fpu.html
Back to top
View user's profile Send private message
_KRN_
Newbie cheater
Reputation: 0

Joined: 12 May 2016
Posts: 12
Location: Armchair

PostPosted: Sun Aug 21, 2016 7:49 am    Post subject: Reply with quote

ok thx

last question that wasnt answered yet is:
How to do null-checking?
(like cmp ecx,0)?
Back to top
View user's profile Send private message
hhhuut
Grandmaster Cheater
Reputation: 6

Joined: 08 Feb 2015
Posts: 607

PostPosted: Sun Aug 21, 2016 7:53 am    Post subject: Reply with quote

Code:
test ecx,ecx
jz originalcode   //jz = jump if zero
Back to top
View user's profile Send private message
_KRN_
Newbie cheater
Reputation: 0

Joined: 12 May 2016
Posts: 12
Location: Armchair

PostPosted: Sun Aug 21, 2016 8:08 am    Post subject: Reply with quote

and if i do
cmp eax,0
than je code
will jump if eax is zero, same as jz code
right?
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 223

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Sun Aug 21, 2016 9:51 am    Post subject: Reply with quote

JZ = JE


Those do exactly the same thing:
Code:
cmp ecx,0
jz originalcode

Code:
test ecx,ecx
je originalcode

Code:
cmp ecx,0
je originalcode

Code:
test ecx,ecx
jz originalcode




http://www.jaist.ac.jp/iscenter-new/mpc/altix/altixdata/opt/intel/vtune/doc/users_guide/mergedProjects/analyzer_ec/mergedProjects/reference_olh/mergedProjects/instructions/instruct32_hh/vc144.htm

Code:
74 cb           JE rel8         Jump short if equal (ZF=1)
74 cb           JZ rel8         Jump short if zero (ZF 1)

0F 84 cw/cd     JE rel16/32     Jump near if equal (ZF=1)
0F 84 cw/cd     JZ rel16/32     Jump near if 0 (ZF=1)

_________________
Back to top
View user's profile Send private message MSN Messenger
_KRN_
Newbie cheater
Reputation: 0

Joined: 12 May 2016
Posts: 12
Location: Armchair

PostPosted: Sun Aug 21, 2016 3:08 pm    Post subject: Solved ! Reply with quote

OK thanks everyone, this part of my script is finished and working.
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
Goto page Previous  1, 2
Page 2 of 2

 
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