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 


how to use fmul

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Y.A.K.E
Advanced Cheater
Reputation: 0

Joined: 15 Jul 2019
Posts: 56

PostPosted: Sat Apr 22, 2023 3:47 am    Post subject: how to use fmul Reply with quote

realPlayer_X = miniMap_X * 16
realPlayer_Y = miniMap_Y * 16

how to get realPlayer_X & realPlayer_Y


Code:

label(realPlayer_X)
label(realPlayer_Y)
registersymbol(realPlayer_X)
registersymbol(realPlayer_Y)

realPlayer_X:
dd 0
realPlayer_Y:
dd 0





Code:


[64-bit]
push RAX
push RBX
xor rax,rax
xor rbx,rbx

movq rax,xmm1  // miniMap_X
movq rbx,xmm0  // miniMap_Y


.....

pop RBX
pop RAX

[/64-bit]






Code:


[32-bit]
push eax
push ebx

mov  eax,[ebp+08] //minimap_X
mov  ebx,[ebp+0C] //minimap_Y


....


pop ebx
pop eax
 
[/32-bit]

Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Sat Apr 22, 2023 4:59 am    Post subject: Reply with quote

don't use fmul, that's for the obsolete FP register set, use mulss instead (https://www.felixcloutier.com/x86/mulss )

or use ccode
Code:

alloc(realPlayer_X,4)
alloc(realPlayer_Y,4)
registersymbol(realPlayer_X,realPlayer_Y)

...

//your code where XMM0 and XMM1 are set
{$ccode miniMap_X=XMM1.0F miniMap_Y=XMM0.0F}
extern float realPlayer_X;
extern float realPlayer_Y;

realPlayer_X=miniMap_X*16;
realPlayer_Y=miniMap_Y*16;
{$asm}
//the usual code injection where you return to the original code


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