Skip to content

x86: UD0 (0F FF xx) instruction disassembled incorrectly #2857

@jxors

Description

@jxors

Work environment

Questions Answers
System Capstone runs on OS/arch/bits Ubuntu 24.04 (x86 64-bit)
Capstone module affected x86
Source of Capstone git clone
Version/git commit 8872be6

Instruction bytes giving faulty results

0x0F,0xFF,0x00

Expected results

It should be:

0f ff 00                                         ud0

But is:

0f ff                                            ud0

Capstone does not decode a ModRM byte at the end of the instruction, and accepts 0F FF as the full instruction.

Steps to get the wrong result

With cstool:

cstool -d x64 0fff00

Additional Logs, screenshots, source code, configuration dump, ...

I suspect this may be caused by an incorrect entry in the automatically generated files from LLVM's TableGen.
I am happy to give fixing this a try, but I have not worked with LLVM before and I am not sure I have the necessary skills to fix this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    X86ArchbugSomething is not working as it should

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions