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 


Floating point value (FPU)

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

Joined: 07 Nov 2010
Posts: 600

PostPosted: Sun Mar 11, 2012 11:49 am    Post subject: Floating point value (FPU) Reply with quote

I need to store a double value in to an address.

I've been suggested to:
Code:
mov [eax],first part //Write Double
mov [eax+4],second part //Write Double


It works but it's not what I'm looking for, so I've changed it in to this:
Code:
fld [double_value] //Push in TOS (FPU) value of double_value
fstp [eax] //Pop from TOS (FPU) value of double_value and store value of double_value into eax
//the result will be [eax] = first part of double_value
//[eax+4] = second part of double_value


This also works, but it doesn't store just everything, I'll make an example:
value to write (IN FPU)
4040000040400000
value stored
4040000040400000
------------------------
value to write (IN FPU)
4040ABCD4040EF12
value stored
404000004040EF12
------------------------
How can i fix that ?
What am I doing wrong ?

_________________
... Fresco
Back to top
View user's profile Send private message
Kavvman
Master Cheater
Reputation: 2

Joined: 17 Apr 2004
Posts: 316

PostPosted: Sun Mar 11, 2012 12:49 pm    Post subject: Reply with quote

fstp qword ptr [dest]
_________________
...
Back to top
View user's profile Send private message
Fresco
Grandmaster Cheater
Reputation: 4

Joined: 07 Nov 2010
Posts: 600

PostPosted: Mon Mar 12, 2012 7:33 am    Post subject: Reply with quote

thanks ... it workd
even though
Code:
fld qword ptr [label] // in order to make it work i had to put "qword ptr" prefix here too
fstp qword ptr [destination pointer]


just in case others bump into this post:
byte ptr = 1 byte
word ptr = 2 bytes
dword ptr = 4 bytes
qword ptr = 8 bytes

float = 4 bytes
double = 8 bytes

_________________
... Fresco
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