View previous topic :: View next topic |
Author |
Message |
mindoff Advanced Cheater Reputation: 0
Joined: 12 Jun 2016 Posts: 96
|
Posted: Fri Nov 15, 2019 12:36 am Post subject: Is there any easy to read write double type number? |
|
|
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 |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25288 Location: The netherlands
|
Posted: Fri Nov 15, 2019 1:24 am Post subject: |
|
|
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 |
|
|
mindoff Advanced Cheater Reputation: 0
Joined: 12 Jun 2016 Posts: 96
|
Posted: Fri Nov 15, 2019 2:03 am Post subject: |
|
|
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.
Code: |
alloc(doublespace,8)
...
doublespace:
dq (double)99
...
movsd xmm0, [doublespace]
movsd [game.exe+A00],xmm0
...
dealloc(doublespace)
|
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25288 Location: The netherlands
|
Posted: Fri Nov 15, 2019 4:33 am Post subject: |
|
|
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 |
|
|
mindoff Advanced Cheater Reputation: 0
Joined: 12 Jun 2016 Posts: 96
|
Posted: Fri Nov 15, 2019 10:27 pm Post subject: |
|
|
Oh,now I get it,so it's move 4 bytes twice to make a 8 bytes double type,interesting.
|
|
Back to top |
|
|
|