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

Fixed xchg aliasing (Fixes #560) #561

Merged
merged 1 commit into from
Mar 23, 2025
Merged

Conversation

mappzor
Copy link
Contributor

@mappzor mappzor commented Mar 19, 2025

Fixes #560

Currently using swappable mechanism is the best possible solution. Once we have new generator a data-only solution should be possible. It's very similar issue as with #293. Generating dangling decoder nodes just so encoder could reference them would easily solve both issues.

Relevant changes in behavior:

Requested Old New
M16:eax:eax 66 90 nop 90 nop
M32:ax:ax 66 90 nop 90 nop
M64:ax:ax 66 90 nop 90 nop
M64:eax:eax 90 nop 87 C0 xchg eax, eax
M64:rax:rax 48 90 nop 90 nop

Copy link
Member

@flobernd flobernd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you 🙂

@mappzor mappzor merged commit 120e0e7 into zyantific:master Mar 23, 2025
24 checks passed
@mappzor mappzor deleted the xchg-aliasing branch March 23, 2025 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inconsistent Re-encoding of xchg eax, eax to nop in 64-bit Mode (ZYDIS_MACHINE_MODE_LONG_64)
2 participants