View previous topic :: View next topic |
Author |
Message |
mgostIH Expert Cheater
Reputation: 3
Joined: 01 Jan 2016 Posts: 159
|
Posted: Mon Apr 18, 2016 8:10 am Post subject: Multiplying a double register |
|
|
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?
_________________
|
|
Back to top |
|
 |
hhhuut Grandmaster Cheater
Reputation: 6
Joined: 08 Feb 2015 Posts: 607
|
Posted: Mon Apr 18, 2016 8:13 am Post subject: |
|
|
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 |
|
 |
mgostIH Expert Cheater
Reputation: 3
Joined: 01 Jan 2016 Posts: 159
|
Posted: Mon Apr 18, 2016 8:18 am Post subject: |
|
|
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.
_________________
|
|
Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 150
Joined: 06 Jul 2014 Posts: 4652
|
Posted: Mon Apr 18, 2016 8:52 am Post subject: |
|
|
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 |
|
 |
mgostIH Expert Cheater
Reputation: 3
Joined: 01 Jan 2016 Posts: 159
|
Posted: Mon Apr 18, 2016 9:19 am Post subject: |
|
|
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.
_________________
|
|
Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 150
Joined: 06 Jul 2014 Posts: 4652
|
|
Back to top |
|
 |
mgostIH Expert Cheater
Reputation: 3
Joined: 01 Jan 2016 Posts: 159
|
Posted: Mon Apr 18, 2016 10:32 am Post subject: |
|
|
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
_________________
|
|
Back to top |
|
 |
|