Page 1 of 1

AA translation of asm in 64-bit

Posted: Wed May 13, 2020 2:21 pm
by kantoboy69
I'm not sure if this is correct translation of AA into asm

AA Script

Code: Select all

  mov     dl, byte ptr [rdi+r8+4]
  mov     dh, byte ptr [rdi+r9+4]
  mov     byte ptr [rdi+r8+4], dh
  mov     byte ptr [rdi+r9+4], dl
Memory viewer

Code: Select all

FFF90489 - 42 8A 54 07 04        - mov dl,[rdi+r8+04]
FFF9048E - 42 8A 74 0F 04        - mov sil,[rdi+r9+04]
FFF90493 - 42 88 74 07 04        - mov [rdi+r8+04],sil
FFF90498 - 42 88 54 0F 04        - mov [rdi+r9+04],dl
dh is translated as sil
but the problem is, it modified rsi value

Re: AA translation of asm in 64-bit

Posted: Thu May 14, 2020 12:00 am
by SunBeam
I was going to say it might be a bug, but then again it's just you trying your own way of writing code that doesn't exist:

Image

And to respond: CE just falls back to an instruction that can be assembled, that's why:

Image

Future suggestion: try your to-be-assembled instruction in other tools too? Thanks.

BR,
Sun

Re: AA translation of asm in 64-bit

Posted: Fri May 15, 2020 2:32 am
by kantoboy69
SunBeam wrote:
Thu May 14, 2020 12:00 am
I was going to say it might be a bug, but then again it's just you trying your own way of writing code that doesn't exist:

And to respond: CE just falls back to an instruction that can be assembled, that's why:

Future suggestion: try your to-be-assembled instruction in other tools too? Thanks.

BR,
Sun
Thanks SunBeam.

That makes sense, considering it's 64-bit.
I should have done this instead

mov dl, byte ptr [rdi+r8+4]
xchg byte ptr [rdi+r9+4], dl
xchg byte ptr [rdi+r8+4], dl

I forgot xchg instruction exists