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 


Code Injection: Load floating number as integer. How to ?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
Zaladine
Expert Cheater
Reputation: 3

Joined: 14 Oct 2012
Posts: 129
Location: Djokdja, Indonesia

PostPosted: Sat May 16, 2020 9:09 am    Post subject: Code Injection: Load floating number as integer. How to ? Reply with quote

So I have 2 addresses:
- Current HP (4 bytes integer) at address Player+08
- Max HP (float) at address Player+0C

I would like to make a code injection to freeze my Current HP at the same value as Max HP.

What command in ASM should I use?
I believe this is the exact opposite of FILD command.
I've tried to google it, but my English got in the way of searching the correct keyword.

Thank you very much in advance.

_________________
... to boldly go where no eagle has gone before ...
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4722

PostPosted: Sat May 16, 2020 9:54 am    Post subject: This post has 1 review(s) Reply with quote

Code:
cvtss2si eax,[rsi+C]
mov [rsi+8],eax

Backup eax with push/pop or use a different register that's not in use.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Zaladine
Expert Cheater
Reputation: 3

Joined: 14 Oct 2012
Posts: 129
Location: Djokdja, Indonesia

PostPosted: Sat May 16, 2020 11:05 am    Post subject: Reply with quote

Yes... i guess that's the one i need.

Thank you very much!.




---------------------------

EDIT:
Penguin, Sir... Thanks to you, I managed to make invincibility for my own CT of Ace Combat 7 v1.01.

Code:
[ENABLE]
alloc(newmem,2048,"Ace7Game.exe"+5C4AB7B)
label(returnhere)
label(originalcode)
label(exit)

newmem:
push eax
cvtss2si eax,[rcx+000004C4]
imul eax,#10
mov dword ptr [rcx+00000AEC],eax
pop eax

originalcode:
movd xmm0,[rcx+00000AEC]

exit:
jmp returnhere

"Ace7Game.exe"+5C4AB7B:
jmp newmem
nop
nop
nop
returnhere:


 
 
[DISABLE]
dealloc(newmem)
"Ace7Game.exe"+5C4AB7B:
movd xmm0,[rcx+00000AEC]
//Alt: db 66 0F 6E 81 EC 0A 00 00


Thanks again!. Wink Cool

_________________
... to boldly go where no eagle has gone before ...
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