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 


[SOLVED] Modify XMM registers

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
aikoncwd
Grandmaster Cheater
Reputation: 23

Joined: 21 Dec 2012
Posts: 591
Location: Spain (Barcelona)

PostPosted: Wed Jan 07, 2015 11:54 am    Post subject: [SOLVED] Modify XMM registers Reply with quote

Hi

I have a game that uses XMM registers to handle Health. The instruction that modify enemy health is 07F54B17

Code:

07F54AFB: F3 0F 7E 87 78 01 00 00  -  movq xmm0,[edi+00000178]
07F54B03: F3 0F 7E 8D 60 FF FF FF  -  movq xmm1,[ebp-000000A0]
07F54B0B: 66 0F D6 8D D0 FE FF FF  -  movq [ebp-00000130],xmm1
07F54B13: F2 0F 5C C1              -  subsd xmm0,xmm1
// ---------- INJECTING HERE ----------
07F54B17: 66 0F D6 87 78 01 00 00  -  movq [edi+00000178],xmm0
// ---------- DONE INJECTING  ----------
07F54B1F: 8B 05 58 02 6E 0E        -  mov eax,[0E6E0258]
07F54B25: 83 EC 04                 -  sub esp,04


I want to set xmm0 = 0 before 07F54B17 is executed, I tried this:

Code:

  mov xmm0,(double)0  //can't be compiled
  movq xmm0,(double)0 //can't be compiled
  movss xmm0,(double)0 //can't be compiled
  movq [edi+00000178],xmm0


I didn't tried the 3 instructions at the same time, any of this instructions can't be compiled... how can I set values to XMM registers?

Other possible way is set xmm1 = 99999999 so this will be a "1 hit kill", but I have the same problem lol

Thanks! Razz

_________________
Hey Hitler
Test here your skill with CheatEngine, I coded a challenge for you. Try to beat it!
HERE


Last edited by aikoncwd on Wed Jan 07, 2015 12:21 pm; edited 1 time in total
Back to top
View user's profile Send private message
DDS
Expert Cheater
Reputation: 3

Joined: 10 Feb 2011
Posts: 112
Location: Bill's Planet

PostPosted: Wed Jan 07, 2015 12:12 pm    Post subject: Reply with quote

Para cambiar el registrador xmm0 a 0 trata lo siguiente.

Code:
xorps xmm0,xmm0

_________________
elDarkDragonSlayer
Back to top
View user's profile Send private message Visit poster's website
aikoncwd
Grandmaster Cheater
Reputation: 23

Joined: 21 Dec 2012
Posts: 591
Location: Spain (Barcelona)

PostPosted: Wed Jan 07, 2015 12:15 pm    Post subject: Reply with quote

elDDS wrote:
Para cambiar el registrador xmm0 a 0 trata lo siguiente.

Code:
xorps xmm0,xmm0


Thanks! (gracias!)

Anyway, I get the solution:

Code:
[ENABLE]

aobscan(DoDMG,FF F2 0F 5C C1 66 0F D6 87 78 01 00 00) // should be unique
alloc(newmem,$1000)

label(code)
label(return)
label(enemy)
globalalloc(pEnemy,4)
label(new)
label(nein)
newmem:

code:
  cmp edi,[Health]
  jne enemy
  movq xmm0,[new]
  movq [edi+00000178],xmm0
  jmp return

enemy:
  mov [pEnemy],edi
  movq xmm0,[nein]
  movq [edi+00000178],xmm0
  jmp return

new:
dq (double)500

nein:
dq (double)0

DoDMG+05:
  jmp code
  nop
  nop
  nop
return:
registersymbol(DoDMG)

[DISABLE]

DoDMG+05:
  db 66 0F D6 87 78 01 00 00

unregistersymbol(DoDMG)
dealloc(newmem)


So I need o store the value in a label and use movq for double or movss for float. Is this OK?

Razz

_________________
Hey Hitler
Test here your skill with CheatEngine, I coded a challenge for you. Try to beat it!
HERE
Back to top
View user's profile Send private message
DDS
Expert Cheater
Reputation: 3

Joined: 10 Feb 2011
Posts: 112
Location: Bill's Planet

PostPosted: Wed Jan 07, 2015 12:33 pm    Post subject: Reply with quote

Si el script se compila bien sin ningun error. Entonces si esta bien.
_________________
elDarkDragonSlayer
Back to top
View user's profile Send private message Visit poster's website
mgr.inz.Player
I post too much
Reputation: 222

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

PostPosted: Wed Jan 07, 2015 6:20 pm    Post subject: Reply with quote

AikonCWD wrote:
So I need o store the value in a label and use movq for double or movss for float.


For single-precision floating-point use movss, movd

For double-precision floating-point use movsd, movq




Of course, there are other ways:
cvtsi2ss xmm0,eax // will convert signed integer from EAX to single
cvtsi2sd xmm0,eax // will convert signed integer from EAX to double
cvtss2sd xmm0,xmm0 // will convert single to double

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