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 


[HELP]Code injection problem!

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

Joined: 11 Aug 2014
Posts: 27

PostPosted: Fri May 08, 2020 11:08 am    Post subject: [HELP]Code injection problem! Reply with quote

Hi guys!

I'm trying to create a map waypoint tp and i have a problem.
The Waypoint coordinates are saved as float values in 32-bit register (eax) and the character coordinates are saved as double values in 64-bit register (rdx) , as result my character is teleported wrong.
How to prevent this?


Code:

push rdx
mov rdx,eax       // eax = (float) 50.0  X waypoint coord
mov [rsi+000001B8],rdx   // rdx = (double) 4.99197265827594E16 -> wrong character X coord
pop rdx                           // I want to be rdx = 50.0
 


Any help would be appreciated!
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4719

PostPosted: Fri May 08, 2020 11:37 am    Post subject: This post has 1 review(s) Reply with quote

Why are you using general purpose registers for that? You should be using sse (or at least x87).
Code:
movd xmm2,eax
cvtss2sd xmm2,xmm2
movsd [rsi+1B8],xmm2

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

Joined: 11 Aug 2014
Posts: 27

PostPosted: Fri May 08, 2020 4:12 pm    Post subject: Reply with quote

Thank you very much for your help!
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