Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for adding x86-64 legacy prefixes (0x66, 0x67) in Ronin::ASM::X86_64::Encoder #174

Open
postmodern opened this issue Mar 8, 2025 · 0 comments
Labels
edgecase Edge Case encoder Assembly Encoder x86-64 x86-64 architecture

Comments

@postmodern
Copy link
Member

postmodern commented Mar 8, 2025

Certain x86-64 instructions assume an operand or memory address size of 64bits, however sometimes a 32bit value is permitted for backwards compatibility. Thus a 0x66 or 0x67 byte is added before the REX prefix or opcode to indicate a 32bit value is used instead of the default 64bit value.

Examples

	mov	10(%ebx), %eax
  401027:	67 8b 43 0a          	mov    0xa(%ebx),%eax
	jmp	*10(%eip)
  401020:	67 ff 25 0a 00 00 00 	jmp    *0xa(%eip)        # 401031 <_start+0x31>

References

@postmodern postmodern added edgecase Edge Case encoder Assembly Encoder x86-64 x86-64 architecture labels Mar 8, 2025
@postmodern postmodern changed the title Add support for adding legacy prefixes (0x66, 0x67) in Ronin::ASM::X86_64::Encoder Add support for adding x86-64 legacy prefixes (0x66, 0x67) in Ronin::ASM::X86_64::Encoder Mar 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
edgecase Edge Case encoder Assembly Encoder x86-64 x86-64 architecture
Projects
None yet
Development

No branches or pull requests

1 participant