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 


Multiplication of XMM registers not working as I expect

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
Sp4rt
How do I cheat?
Reputation: 0

Joined: 28 May 2020
Posts: 8

PostPosted: Sun Jun 07, 2020 4:10 pm    Post subject: Multiplication of XMM registers not working as I expect Reply with quote

I'm trying to do a simple damage multiplicator cheat, and so far I got this:

Code:
[ENABLE]
aobscanregion(INJECT,Enemy:DealDamageToEnemy+1eb,Enemy:DealDamageToEnemy+3eb,F2 0F 5C C1 48 8B C8)
alloc(newmem,2048,INJECT)
label(returnhere)
label(exit)
alloc(DMGMult,4)
registersymbol(DMGMult)
registersymbol(INJECT)

DMGMult:
dd (double)2.0

newmem:
  mulsd xmm1,[DMGMult] // should multiply by 2 but multiplies by 0

originalcode:
  subsd xmm0,xmm1 // xmm0 is the enemy health value

exit:
jmp returnhere

INJECT:
jmp newmem
nop
nop
returnhere:
registersymbol(INJECT)

[DISABLE]


My problem is that the mulss instruction is multiplying by 0 for some reason I still don't understand. I know it's multiplying by 0 because 1) I'm not doing any damage and 2) if I do
Code:
 mulss xmm0, [DMGMult]
the enemies die instantly. Any help will be appreciated.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4702

PostPosted: Sun Jun 07, 2020 6:06 pm    Post subject: Reply with quote

dd = define doubleword (4 bytes); dq = define quadword (8 bytes). A double takes up 8 bytes. Allocate 8 bytes for DMGMult and change dd to dq.
_________________
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
Sp4rt
How do I cheat?
Reputation: 0

Joined: 28 May 2020
Posts: 8

PostPosted: Mon Jun 08, 2020 1:36 pm    Post subject: Reply with quote

That was it. Thank you ParkourPenguin
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