|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
theashmaster How do I cheat? Reputation: 0
Joined: 15 Mar 2021 Posts: 3
|
Posted: Mon Mar 15, 2021 9:59 pm Post subject: How to access second xmm register value in Assembly |
|
|
Hey, guys!
I'm creating a hack in assembly that gets the position of the mob the player is aiming at. I'm using inline assembly to call the game function that returns the coordinates (X, Y) of the mobs.
The issue is that i'm stuck with the XMM0 register, which apparently stores both X and Y coordinates. So I'm able to get the X coordinate, but not the Y coordinate.
When I set a breakpoint at the game function, this is what CE shows in the XMM0 register:
Code: | XMM0: 69109.00 82200.00 0.00 0.00
XMM1: 0.00 0.00 0.00 0.00
XMM2: 0.00 0.00 0.00 0.00
XMM3: ... |
And this is the assembly code i'm using:
Code: | mov esi, [chrPointer]
mov ecx,[esi]
push mobID
add ecx,04
mov eax,[ecx]
call dword ptr [eax+08]
mov ecx,eax
call GetNameByVIDCall
movss x, xmm0 |
How can I get the second XMM0 value (82200 in the screenshot) and pass it to a Y variable (like movss y, xmm0)?
|
|
Back to top |
|
|
ParkourPenguin I post too much Reputation: 138
Joined: 06 Jul 2014 Posts: 4275
|
Posted: Mon Mar 15, 2021 10:54 pm Post subject: |
|
|
shufps would work. e.g. if xmm5 isn't in use:
Code: | movaps xmm5,xmm0
movss [x],xmm0
shufps xmm5,xmm5,85
movss [y],xmm5 | If xmm0 isn't read from again, it's fine to disregard xmm5 and clobber xmm0.
You could just store the entire register.
Code: | alloc(newmem,2048)
label(coords)
label(x)
label(y)
newmem:
...
movaps [coords],xmm0
...
align 10 CC
coords:
x:
dd (float)0.0
y:
dd (float)0.0
// padding:
dd 0 0
|
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
|
theashmaster How do I cheat? Reputation: 0
Joined: 15 Mar 2021 Posts: 3
|
Posted: Mon Mar 15, 2021 11:56 pm Post subject: |
|
|
ParkourPenguin wrote: | shufps would work. e.g. if xmm5 isn't in use:
Code: | movaps xmm5,xmm0
movss [x],xmm0
shufps xmm5,xmm5,85
movss [y],xmm5 | If xmm0 isn't read from again, it's fine to disregard xmm5 and clobber xmm0.
|
This worked perfectly! Thank you, man!
|
|
Back to top |
|
|
|
|
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
|
|