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 


Trouble With Assembly

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Sun Jan 16, 2022 7:59 pm    Post subject: Trouble With Assembly Reply with quote

I have a segment of code that used to work. For some reason, the target now crashes when this code gets executed:

Code:
sub esp,#20
movdqu [esp],xmm0
mov [esp+10],(float)0.2
movss xmm0,[esp+10]
addss xmm0,[rdi+78]
movss [rdi+78],xmm0
movss xmm0,[esp]
add esp,#20


[rdi+78] is a coordinate that I am trying to manipulate. What can I look at to try to resolve this?

Thanks.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 138

Joined: 06 Jul 2014
Posts: 4275

PostPosted: Sun Jan 16, 2022 8:47 pm    Post subject: This post has 1 review(s) Reply with quote

You're mixing 32-bit and 64-bit registers when addressing memory locations. If it's a 64-bit target, use 64-bit registers (i.e. rsp).

If it is a 64-bit target, the top of the stack should be aligned to 64 bits (8 bytes). I don't think this should cause any issues in this case.

You back up the entire 128-bit xmm0 register to the stack but only restore the first single. Use movdqu to restore the entire register.

Maybe the game updated and the offsets changed? Or the aobscan pattern is no longer unique?

_________________
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
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Mon Jan 17, 2022 5:52 am    Post subject: Reply with quote

Thank you.

Feeling pretty stupid in my old age. Revisiting these things after so long has me feeling like I am having to relearn a lot of things.

The target was always 64bit, but it never came to my mind to change the code to match...probably because it just happened to work for the older version, for whatever reason. The code was repurposed from a 32bit target.
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