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 


Multiplying a double register

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
mgostIH
Expert Cheater
Reputation: 3

Joined: 01 Jan 2016
Posts: 159

PostPosted: Mon Apr 18, 2016 8:10 am    Post subject: Multiplying a double register Reply with quote

I want to make this short.

Basically, I want to multiply the xmm1 register by a constant value, without messing up any of the other registers.

This is the code I want to intercept:

Code:
movsd [esi+00000540],xmm1


I want to modify the xmm1 register before it actually stores its value in memory, how could I do that, since mulsd doesn't accept fixed values?

_________________
Do you need to ask me something? Feel free to join my discord server at: https://discord.gg/At4VZXA or ask me something in my YouTube channel: https://www.youtube.com/c/mgostIH
Back to top
View user's profile Send private message
hhhuut
Grandmaster Cheater
Reputation: 6

Joined: 08 Feb 2015
Posts: 607

PostPosted: Mon Apr 18, 2016 8:13 am    Post subject: Reply with quote

I don't think there's a way to let xmm registers and fixed values interact in any way ...

But what's the problem with taking another register to hold your multiplication value?
Back to top
View user's profile Send private message
mgostIH
Expert Cheater
Reputation: 3

Joined: 01 Jan 2016
Posts: 159

PostPosted: Mon Apr 18, 2016 8:18 am    Post subject: Reply with quote

hhhuut wrote:
I don't think there's a way to let xmm registers and fixed values interact in any way ...

But what's the problem with taking another register to hold your multiplication value?


It's not a problem to use other registers, I just want all of them to keep the same value as before the code injection.

_________________
Do you need to ask me something? Feel free to join my discord server at: https://discord.gg/At4VZXA or ask me something in my YouTube channel: https://www.youtube.com/c/mgostIH
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4289

PostPosted: Mon Apr 18, 2016 8:52 am    Post subject: Reply with quote

You can push/pop the registers if you want. But you don't even need to do that:
Code:
alloc(newmem,2048)
label(value)
newmem:
  mulsd xmm1,[value]
  movsd [esi+00000540],xmm1
value:
  dq (double)5.0

_________________
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
mgostIH
Expert Cheater
Reputation: 3

Joined: 01 Jan 2016
Posts: 159

PostPosted: Mon Apr 18, 2016 9:19 am    Post subject: Reply with quote

ParkourPenguin wrote:
You can push/pop the registers if you want. But you don't even need to do that:
Code:
alloc(newmem,2048)
label(value)
newmem:
  mulsd xmm1,[value]
  movsd [esi+00000540],xmm1
value:
  dq (double)5.0


Nice method, but is there one that can be used without needing of allocating any memory space (except for the code cave itself)?
Basically, an "only code" method.

_________________
Do you need to ask me something? Feel free to join my discord server at: https://discord.gg/At4VZXA or ask me something in my YouTube channel: https://www.youtube.com/c/mgostIH
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4289

PostPosted: Mon Apr 18, 2016 9:43 am    Post subject: This post has 1 review(s) Reply with quote

This takes up more memory than my previous example and is less dynamic, but...
Code:
alloc(newmem,2048)
newmem:
  push 40140000
  push 0
  mulsd xmm1,[esp]
  add esp,8
  movsd [esi+00000540],xmm1

_________________
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
mgostIH
Expert Cheater
Reputation: 3

Joined: 01 Jan 2016
Posts: 159

PostPosted: Mon Apr 18, 2016 10:32 am    Post subject: Reply with quote

ParkourPenguin wrote:
This takes up more memory than my previous example and is less dynamic, but...
Code:
alloc(newmem,2048)
newmem:
  push 40140000
  push 0
  mulsd xmm1,[esp]
  add esp,8
  movsd [esi+00000540],xmm1


Excellent, +1 reputation deserved

_________________
Do you need to ask me something? Feel free to join my discord server at: https://discord.gg/At4VZXA or ask me something in my YouTube channel: https://www.youtube.com/c/mgostIH
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