View previous topic :: View next topic |
Author |
Message |
Rissorr Master Cheater Reputation: 3
Joined: 17 Sep 2013 Posts: 273 Location: Israel!
|
Posted: Mon Jul 07, 2014 5:37 am Post subject: Difference betwen MOV and MOVSS and MOVSD |
|
|
So im alrady undarstand that:
MOV = move DECIMAL
MOVSS = move SINGLE (float)
MOVSD= move DOUBLE
so for example i have this:
Code: | movss [ebx+14],xmm0 |
I want to hack it, and move into [ebx+14] the value 500, HOW DO I DO THAT?
And the secound instruction that i want to hack is:
Code: | movsd [ebx+18],xmm1 |
I need to also move 500 into the [ebx+18], so HOW?
|
|
Back to top |
|
|
DaSpamer Grandmaster Cheater Supreme Reputation: 52
Joined: 13 Sep 2011 Posts: 1578
|
Posted: Mon Jul 07, 2014 6:02 am Post subject: |
|
|
Well I'd do this.
Code: | ...
alloc(value,8)
value:
dq (double)500
script:
...
movq xmm0, value
movsd [ebx+18],xmm0
...
|
_________________
|
|
Back to top |
|
|
Rissorr Master Cheater Reputation: 3
Joined: 17 Sep 2013 Posts: 273 Location: Israel!
|
Posted: Mon Jul 07, 2014 8:28 am Post subject: |
|
|
can you explain the diffrence of
MOVQ and MOVSD
MOV and MOVSS
|
|
Back to top |
|
|
Redouane Master Cheater Reputation: 3
Joined: 05 Sep 2013 Posts: 363 Location: Algeria
|
|
Back to top |
|
|
STN I post too much Reputation: 42
Joined: 09 Nov 2005 Posts: 2672
|
Posted: Mon Jul 07, 2014 11:13 am Post subject: Re: Difference betwen MOV and MOVSS and MOVSD |
|
|
LemonMan wrote: | So im alrady undarstand that:
MOV = move DECIMAL
MOVSS = move SINGLE (float)
MOVSD= move DOUBLE
so for example i have this:
Code: | movss [ebx+14],xmm0 |
I want to hack it, and move into [ebx+14] the value 500, HOW DO I DO THAT?
And the secound instruction that i want to hack is:
Code: | movsd [ebx+18],xmm1 |
I need to also move 500 into the [ebx+18], so HOW? |
These are called SSE instructions and they may look intimidating to use at first but are actually really easy to work with, you just have to think 'big' as you are working with 64 bit.
To answer your questions, read up on movss
http://www.jaist.ac.jp/iscenter-new/mpc/altix/altixdata/opt/intel/vtune/doc/users_guide/mergedProjects/analyzer_ec/mergedProjects/reference_olh/mergedProjects/instructions/instruct32_hh/vc203.htm
and google for other instruction you want to know about.
MOVQ is Move Quadword
In the example DaSpamer posted, he allocs a dq (double-precision float) and moves it to xmm then to [ebx+18] because you can't directly move two values between memory locations just like normal (32bit) instructions.
I prefer to work with 32bit registers still as there's rarely i have to use such big values (don't see doubles often) and for what you're trying to accomplish you can do it this way
mov [ebx+14], (float)500
You can even work with doubles by doing something like
mov [ebx+14], firstpartofdoubledatatype (make sure you understand the endians to do this properly)
mov [ebx+14+4], secondpartofdoubledatatype
Of course, thats just me and someone else would suggest using the SSE instructions.
Hope this helps
_________________
|
|
Back to top |
|
|
Rissorr Master Cheater Reputation: 3
Joined: 17 Sep 2013 Posts: 273 Location: Israel!
|
Posted: Mon Jul 07, 2014 2:07 pm Post subject: |
|
|
WOW thanks! helped!
so lats say i want to move [eax+18] into [ebx+14] i do:
movss xmm0,[eax+18]
movss [ebx+14],xmm0
will it work?
|
|
Back to top |
|
|
STN I post too much Reputation: 42
Joined: 09 Nov 2005 Posts: 2672
|
Posted: Mon Jul 07, 2014 2:17 pm Post subject: |
|
|
LemonMan wrote: | WOW thanks! helped!
so lats say i want to move [eax+18] into [ebx+14] i do:
movss xmm0,[eax+18]
movss [ebx+14],xmm0
will it work? |
Correct.
It will move double data type so make sure that is what you want (to not get undesired effects/values).
_________________
|
|
Back to top |
|
|
|