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 


Working With xmm0

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

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Sat Jun 07, 2014 1:52 am    Post subject: Working With xmm0 Reply with quote

How can I manipulate the individual values in xmm0? For example, I have an instruction that writes to coordinate values using:

Code:
movaps [rdx+00000030],xmm0


By setting a breakpoint, I can see the XMMRegisters and their corresponding values, e.g.:

Code:
xmm0: 1973.66 - 295.23 - 68.30 - 0.00


I'd like to write a script that basically performs no operation on the third coordinate (68.30) only.

Is this possible?

Thanks.
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Sat Jun 07, 2014 2:56 am    Post subject: Reply with quote

Code:
movq [rdx+30],xmm0

This will write 1973.66 into [rdx+30] and 295.23 into [rdx+34].





In case you want to skip 295.23 you can use this:

Code:
movss [rdx+30],xmm0
shufps xmm0,xmm0,4E
movss [rdx+38],xmm0
shufps xmm0,xmm0,4E

This will write 1973.66 into [rdx+30] and 68.30 into [rdx+38].

_________________
Back to top
View user's profile Send private message MSN Messenger
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Sat Jun 07, 2014 3:20 am    Post subject: Reply with quote

mgr.inz.Player, thanks.

What's the 4E?

What if I want to NOP the 68.30, but not the others? Would I write it out similarly?:

Code:
movss [rdx+30],xmm0
shufps xmm0,xmm0,4E
movss [rdx+34],xmm0
shufps xmm0,xmm0,4E


Thanks, again.
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Sat Jun 07, 2014 3:44 am    Post subject: This post has 2 review(s) Reply with quote

XMM registers have four single-precision floating-point values
Code:

 ---------------------------
|  X3  |  X2  |  X1  |  X0  |   
 ---------------------------

0.00 - 68.30 - 295.23 - 1973.66





movaps [memory],XMM0
or movups [memory],XMM0

will write X0 into [memory], X1 into [memory+4]
X2 into [memory+8] and X3 into [memory+C]

movd [memory],XMM0
or movss [memory],XMM0

will write X0 into [memory] only

movq [memory],XMM0
will write X0 into [memory], X1 into [memory+4] only



shufps xmm0,xmm0,4E will swap qwords (X0X1 and X2X3) inside XMM0

more info about shufps
http://www.jaist.ac.jp/iscenter-new/mpc/altix/altixdata/opt/intel/vtune/doc/users_guide/mergedProjects/analyzer_ec/mergedProjects/reference_olh/mergedProjects/instructions/instruct32_hh/vc293.htm


What exactly do you want? NOP = NoOp = No Operation




If you want to perform NOP on third value (X2), so no reading and no writing on that part of XMM0, just use
Code:
movq [rdx+30],xmm0


X3 isn't important, when it comes to "coordinates". Mostly.

_________________
Back to top
View user's profile Send private message MSN Messenger
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Sat Jun 07, 2014 3:54 am    Post subject: Reply with quote

Ahh...I see. Thanks for the explanation...that makes more sense. I still don't see where you get the 4E value from. Nonetheless, you have given me enough information to accomplish what I want.

Yes, I just wanted to NOP that value...just testing something out.

Thanks again...I owe you 3 +reps right now. Very Happy
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Sat Jun 07, 2014 4:36 am    Post subject: Reply with quote

++METHOS wrote:
I still don't see where you get the 4E value from.

 1     0     3     2
01   00   11    10


01001110 = 0x4E

_________________
Back to top
View user's profile Send private message MSN Messenger
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Sat Jun 07, 2014 5:29 am    Post subject: Reply with quote

Ha! Thanks.
Back to top
View user's profile Send private message
Daijobu
Master Cheater
Reputation: 13

Joined: 05 Feb 2013
Posts: 301
Location: the Netherlands

PostPosted: Sat Jun 07, 2014 7:54 am    Post subject: Reply with quote

This topic just got bookmarked. Thanks mgr.inz.Player.
_________________
Scripts/tables from scratch. Relation to other scripts is coincidental. Use of posted code is credited properly.
Euro Truck Simulator 2 Backwards Compatible Cheat
American Truck Simulator Backwards Compatible Cheat
Back to top
View user's profile Send private message
shakib187
Expert Cheater
Reputation: 0

Joined: 24 May 2007
Posts: 215

PostPosted: Sat Mar 07, 2015 5:50 pm    Post subject: Reply with quote

Is it possible for my game to crash if I use movq instead of movss? I have no idea what I'm doing wrong Shocked
Back to top
View user's profile Send private message
justa_dude
Grandmaster Cheater
Reputation: 23

Joined: 29 Jun 2010
Posts: 891

PostPosted: Sat Mar 07, 2015 6:01 pm    Post subject: Reply with quote

shakib187 wrote:
Is it possible for my game to crash if I use movq instead of movss? I have no idea what I'm doing wrong :shock:


One is moving a 4-byte float and the other is moving an 8-byte double. So, yes, it's possible that you're causing a crash.

_________________
A nagy kapu mellett, mindig van egy kis kapu.
----------------------
Come on...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking 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