How can I prepend a `SS:` or `ES:` using AT&T Assembly Syntax
Question
How can I prepend a SS:
or ES:
using AT&T Assembly Syntax without adding in a .byte 0x36
or .byte 0x26
?
ie. How would I be able to convert mov dword ptr ss:[esp+0x10], offset foo
from Intel syntax to AT&T without using:
.byte 0x36
movl $foo, 0x10(%esp)
I have tried movl $foo, %ss:0x10(%esp)
which assembles without warnings but, looking through the binary, still does not add in SS:
Solution
IIRC, the SS:
prefix is not required when used with the ESP
and EBP
registers, because for these, it is already the default.
This might be the reason why the assembler simply omits it to conserve space; therefore the need to manually emit the SS:
prefix as a 0x36
byte, as the assembler won't modify raw bytes.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow