Page 2 of 2

Re: Helping me to get beyond x255 multiplier with mul

Posted: Mon Apr 18, 2022 3:03 pm
by SunBeam
This topic would be so much shorter if you used SSE/SSE2...

Code: Select all

code:
  movss xmm0,[rbx+6C]
  mulss xmm0,[animamult]
  addss [rbx+6C],xmm0
  mov ecx,[rbx+70]
  jmp return

animamult:
  dd (float)2.0

Re: Helping me to get beyond x255 multiplier with mul

Posted: Mon May 02, 2022 8:59 am
by Algester
@SunBeam I tried your approach but the game doesnt like to "transform" a 4byte integer into a float value or at least what we know that esi is required down the line (I'm not sure how it works on souls games) though since this game uses anima as a stand in for souls unless in souls the value is a float?

Re: Helping me to get beyond x255 multiplier with mul

Posted: Mon May 02, 2022 10:52 am
by SunBeam
My reply is using strictly your initial code. I don't know what the value of rbx+6C is stored as. So you'll have to transform the type to float, then back to integer.

See [Link]. CVTSI2SD instruction.

You have examples on CE Wiki:
[Link]

Like so:

Code: Select all

code:
  cvtsi2sd xmm0,[rbx+6C]
  mulss xmm0,[animamult]
  cvtsd2si eax,xmm0
  add [rbx+6C],eax
  mov ecx,[rbx+70]
  jmp return

animamult:
  dd (float)2.0
Make sure to utilize a register that's not in use at that hook spot or below the hook spot, else you'll overwrite it. I used eax in the example above, so make sure to use another one if needed.

Re: Helping me to get beyond x255 multiplier with mul

Posted: Tue May 03, 2022 5:30 am
by Algester
@SunBeam yep so I lack the cvtsi2sd knowledge huh... also I found out that the base multiplier is x100 so 2000 becomes x2.0 interesting