문제

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:

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top