View previous topic :: View next topic |
Author |
Message |
realrbn Expert Cheater
Reputation: 3
Joined: 22 Jan 2016 Posts: 112
|
Posted: Mon Feb 01, 2016 2:40 pm Post subject: Moving Value into xmm Register |
|
|
Hey, just a quick question.
I want to move a "Double" Value into a xmm Register.
How would I do that?
The Original Code is:
code:
movsd [esi+00000088],xmm0
jmp return
How can I change it to where it will set a Value of let's say 100 to "[esi+00000088]"?
|
|
Back to top |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Mon Feb 01, 2016 3:33 pm Post subject: |
|
|
Code: | label(myvar)
newmem:
code:
movsd xmm0,[myvar]
movsd [esi+00000088],xmm0
jmp return
myvar:
dq (double)100 |
|
|
Back to top |
|
 |
Daijobu Master Cheater
Reputation: 13
Joined: 05 Feb 2013 Posts: 301 Location: the Netherlands
|
Posted: Mon Feb 01, 2016 3:34 pm Post subject: |
|
|
MOVSD - Move scalar double-precision floating-point value.
Therefore it moves a 32 bits float value from xmm0 into esi+88.
You can directly move a (float) value into esi+88 in Cheat Engine using for example:
Code: | mov [esi+88],(float)100.0 |
If you want to modify an SSE register like xmm0 you have to use an intermediary register.
Edit: Zanzer posted as I was typing this. That and I need better glasses. Derp.
Edit 2: My bad, I need glasses and classes.
_________________
Last edited by Daijobu on Wed Feb 03, 2016 2:57 am; edited 1 time in total |
|
Back to top |
|
 |
mgr.inz.Player I post too much
Reputation: 222
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Tue Feb 02, 2016 4:24 am Post subject: |
|
|
If that value "double" doesn't have fractional part you can use this:
Code: | push eax
mov eax,100
cvtsi2sd xmm0,eax
pop eax |
or this (converts single to double):
Code: | push eax
mov eax,(float)123.456
movd xmm0,eax
cvtss2sd xmm0,xmm0
pop eax |
mov [esi+88],(double)100.0 - this won't work
_________________
|
|
Back to top |
|
 |
hhhuut Grandmaster Cheater
Reputation: 6
Joined: 08 Feb 2015 Posts: 607
|
Posted: Tue Feb 02, 2016 4:53 am Post subject: |
|
|
mgr.inz.Player wrote: | mov [esi+88],(double)100.0 - this won't work
|
Small addition:
This will only work on a 64bit process ...
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25791 Location: The netherlands
|
Posted: Tue Feb 02, 2016 5:47 am Post subject: |
|
|
Not in 64-bit either. Most instructions in 64-bit can still only encode 32-bit values.
what does work:
Code: |
mov rax,(double)100.0
mov [esi+88],rax
|
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
 |
realrbn Expert Cheater
Reputation: 3
Joined: 22 Jan 2016 Posts: 112
|
Posted: Tue Feb 02, 2016 6:20 am Post subject: |
|
|
Zanzer wrote: | Code: | label(myvar)
newmem:
code:
movsd xmm0,[myvar]
movsd [esi+00000088],xmm0
jmp return
myvar:
dq (double)100 |
|
Thanks Man, works!
|
|
Back to top |
|
 |
hhhuut Grandmaster Cheater
Reputation: 6
Joined: 08 Feb 2015 Posts: 607
|
Posted: Tue Feb 02, 2016 8:23 am Post subject: |
|
|
Dark Byte wrote: | Not in 64-bit either. Most instructions in 64-bit can still only encode 32-bit values. |
Hm, I've already seen something like
Code: | mov qword ptr [register+offset],1234567890 |
so I thought that can be said for 64bit in general ... Obviously wrong
|
|
Back to top |
|
 |
|