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 


Is there any easy to read write double type number?

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

Joined: 12 Jun 2016
Posts: 96

PostPosted: Fri Nov 15, 2019 12:36 am    Post subject: Is there any easy to read write double type number? Reply with quote

Deal with a 32 bit game,which use double type as life left.

I usually deal with life with 4 byte or float type
for 4 byte which can write

mov [eax+20], #99
to make 99 lives

for float use
mov [eax+30], (float)99
which will work

but how to make a double type work?
I try to use
mov [eax+40], (double)99

does not seem to work.

What's wrong?Any good and easy way to do so?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Fri Nov 15, 2019 1:24 am    Post subject: Reply with quote

something like this

Code:

alloc(doublespace,8)
...
doublespace:
dq (double)99
...
push ebx
mov ebx,[doublespace]
mov [eax+40],ebx
mov ebx,[doublespace+4]
mov [eax+44],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
mindoff
Advanced Cheater
Reputation: 0

Joined: 12 Jun 2016
Posts: 96

PostPosted: Fri Nov 15, 2019 2:03 am    Post subject: Reply with quote

Hey,thanks.

mov ebx,[doublespace]

will not work.

I think it's because ebx is 4 byte register?

ebx always get 0

so I change it to movsd llike this which seems work for me now

Thanks a lot. Very Happy

Code:

alloc(doublespace,8)
...
doublespace:
dq (double)99
...
movsd xmm0, [doublespace]
movsd [game.exe+A00],xmm0
...
dealloc(doublespace)
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Fri Nov 15, 2019 4:33 am    Post subject: Reply with quote

don't forget to save XMM0 if it's used by something else

Also, you didn't see the mov ebx,[doublespace+4] part

_________________
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
mindoff
Advanced Cheater
Reputation: 0

Joined: 12 Jun 2016
Posts: 96

PostPosted: Fri Nov 15, 2019 10:27 pm    Post subject: Reply with quote

Oh,now I get it,so it's move 4 bytes twice to make a 8 bytes double type,interesting.
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