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 do you print the values of entire XMM register?

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

Joined: 10 Nov 2016
Posts: 58

PostPosted: Sun Jan 22, 2017 11:17 am    Post subject: How do you print the values of entire XMM register? Reply with quote

Hi. I already found http://forum.cheatengine.org/viewtopic.php?t=601527&start=0&postdays=0&postorder=asc&highlight=

xmm2:49283.99 - 49283.99 - 49283.99 - 49283.99

How do I print out all the (4) four values out of XMM2 with LUA engine?

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

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

PostPosted: Sun Jan 22, 2017 12:05 pm    Post subject: Reply with quote

v1=byteTableToFloat([XMM2[1], XMM2[2], XMM2[3], XMM2[4]])

v2=byteTableToFloat([XMM2[5], XMM2[6], XMM2[7], XMM2[8]])

v3=byteTableToFloat([XMM2[9], XMM2[10], XMM2[11], XMM2[12]])

v4=byteTableToFloat([XMM2[13], XMM2[14], XMM2[15], XMM2[16]])

_________________
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
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4695

PostPosted: Sun Jan 22, 2017 12:18 pm    Post subject: Reply with quote

Using debug_getXMMPointer:
Code:
debug_setBreakpoint(address, 1, bptExecute, function()
  local xmm2_p = debug_getXMMPointer(2)
  local float1 = readFloatLocal(xmm2_p)
  local float2 = readFloatLocal(xmm2_p+4)
  local float3 = readFloatLocal(xmm2_p+8)
  local float4 = readFloatLocal(xmm2_p+12)

  print(string.format('1: %f\r\n2: %f\r\n3: %f\r\n4: %f', float1, float2, float3, float4))

  debug_continueFromBreakpoint(co_run)
  return 0
end)

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

Joined: 10 Nov 2016
Posts: 58

PostPosted: Sun Jan 22, 2017 12:55 pm    Post subject: Reply with quote

Dark Byte wrote:
v1=byteTableToFloat([XMM2[1], XMM2[2], XMM2[3], XMM2[4]])

v2=byteTableToFloat([XMM2[5], XMM2[6], XMM2[7], XMM2[8]])

v3=byteTableToFloat([XMM2[9], XMM2[10], XMM2[11], XMM2[12]])

v4=byteTableToFloat([XMM2[13], XMM2[14], XMM2[15], XMM2[16]])


Thanks. That makes sense. A float is 4 bytes Smile If you would have named it as "byteArrayToFloat" I would probably have figured this on my own. Haha.

ParkourPenguin wrote:
Using debug_getXMMPointer:
Code:
debug_setBreakpoint(address, 1, bptExecute, function()
  local xmm2_p = debug_getXMMPointer(2)
  local float1 = readFloatLocal(xmm2_p)
  local float2 = readFloatLocal(xmm2_p+4)
  local float3 = readFloatLocal(xmm2_p+8)
  local float4 = readFloatLocal(xmm2_p+12)

  print(string.format('1: %f\r\n2: %f\r\n3: %f\r\n4: %f', float1, float2, float3, float4))

  debug_continueFromBreakpoint(co_run)
  return 0
end)


Thanks for the fast reply. This is exactly what I need in order to solve one mathematical issue.

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