Skip to content

x86: fix XSAVE and PTWRITE decoding in 16-bit mode - #3183

Open
ricardojrdez wants to merge 1 commit into
capstone-engine:nextfrom
reverseame:x86-16bit-xsave-ptwrite
Open

ricardojrdez wants to merge 1 commit into
capstone-engine:nextfrom
reverseame:x86-16bit-xsave-ptwrite

Conversation

@ricardojrdez

Copy link
Copy Markdown
Contributor

Your checklist for this pull request

  • I've documented or updated the documentation of every API function and struct this PR changes.
  • I've added tests that prove my fix is effective or that my feature works (if possible)

Detailed description

  • 66 0f ae 20 (16): XSAVE has no 66-prefixed form, so this encoding is
    now rejected as invalid.
  • f3 0f ae 20 (16): PTWRITE was rejected in 16-bit mode. It now decodes
    with a dword memory operand.

Test plan

Added 3 regression tests in tests/issues/x86-mandatory-prefixes.yaml to cover the fix. They fail before the change.

@codecov

codecov Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (next@ccd25ab). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             next    #3183   +/-   ##
=======================================
  Coverage        ?   61.87%           
=======================================
  Files           ?      243           
  Lines           ?    56924           
  Branches        ?    10126           
=======================================
  Hits            ?    35222           
  Misses          ?    16500           
  Partials        ?     5202           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

- 66 0f ae 20 (16): XSAVE has no 66-prefixed form, so this encoding is
  now rejected as invalid.
- f3 0f ae 20 (16): PTWRITE was rejected in 16-bit mode. It now decodes
  with a dword memory operand.
@ricardojrdez
ricardojrdez force-pushed the x86-16bit-xsave-ptwrite branch from f216597 to adf23bf Compare November 25, 2026 14:58

This branch has not been deployed

No deployments
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.

2 participants