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 


Modify SSE registers in lua script

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
m_miro
Newbie cheater
Reputation: 0

Joined: 31 Jul 2019
Posts: 19

PostPosted: Fri Jun 12, 2020 11:35 pm    Post subject: Modify SSE registers in lua script Reply with quote

I noticed that you can modify registers in lua like variables (EAX+=0xF,etc) when debugging , but when I attempt to use the SSE registers like XMM0 or XMM1 nothing happens. Is there a way to access and modify SSE registers with lua scripting?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 472

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

PostPosted: Sat Jun 13, 2020 12:42 am    Post subject: Reply with quote

You need to call debug_getContext(true) first

then edit the XMM registers and when done call
debug_serContext(true)

Keep in mind that the xmm registers are 16 byte bytetables and not a float or double

_________________
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
m_miro
Newbie cheater
Reputation: 0

Joined: 31 Jul 2019
Posts: 19

PostPosted: Mon Jun 15, 2020 12:18 am    Post subject: Reply with quote

Got it working, thanks Dark Byte!

Code:

debug_getContext(true)
print(type(XMM0))
print(#XMM0)
print(byteTableToFloat(XMM0))
temp = floatToByteTable(42.0)
print(byteTableToFloat(temp))
XMM0[1]=temp[1]
XMM0[2]=temp[2]
XMM0[3]=temp[3]
XMM0[4]=temp[4]
debug_setContext(true)
print(byteTableToFloat(XMM0))

The bytetable is interesting, is it like that because XMM registers can store both floats and doubles?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 472

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

PostPosted: Mon Jun 15, 2020 2:05 am    Post subject: Reply with quote

in part that they both store floats and doubles, but also that they store more than 1 float and double.

Also you could store integers or even strings if you where so inclined (though the cpu doesn't like that)

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