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 


store double value

 
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: Mon Feb 27, 2012 4:45 pm    Post subject: store double value Reply with quote

i have found that the address that points to health is [eax+5]
it's a double, and max value is 32
in my code i wrote this:
Code:
mov dword ptr [eax+5],32

to set health to max
but in the cheat table a get something like 32.000000000000004

how do i store 32 (double) in [eax+5] ?

_________________
... Fresco
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

Joined: 09 May 2003
Posts: 25815
Location: The netherlands

PostPosted: Mon Feb 27, 2012 5:05 pm    Post subject: Reply with quote

Are you sure it is stored as a double with value 32 and not as a float with value 3 as max? (they are built from the same last 4 bytes)

(and are you sure about that +5 thing (compilers tend to hate doing that , and certain windows versions will cause a slowdown if this is executed often)

anyhow, a double is 8 bytes long so you will need multiple instructions to set the value (if it's a float you'd just do "mov dword ptr [eax+9],(float)3" )

Code:

alloc(doublestorage,8)
doublestorage:
dq (double)32

...
push ebx
mov ebx,[doublestorage]
mov dword ptr [eax+5],ebx
mov ebx,[doublestorage+4]
mov dword ptr [eax+9],ebx
pop ebx

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Fresco
Grandmaster Cheater
Reputation: 4

Joined: 07 Nov 2010
Posts: 600

PostPosted: Tue Feb 28, 2012 8:13 am    Post subject: Reply with quote

it worked thanks
hex health value:
address: 00 00 00 00 00 00 40 40

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