capstone-engine / capstone

Capstone disassembly/disassembler framework for ARM, ARM64 (ARMv8), Alpha, BPF, Ethereum VM, HPPA, LoongArch, M68K, M680X, Mips, MOS65XX, PPC, RISC-V(rv32G/rv64G), SH, Sparc, SystemZ, TMS320C64X, TriCore, Webassembly, XCore and X86.
http://www.capstone-engine.org
7.18k stars 1.52k forks source link

Bug in x86 Disassembly: 0xdd, 0xcc not being properly decoded #2394

Open 7o8v opened 6 days ago

7o8v commented 6 days ago

Work environment

Questions Answers
OS/arch/bits MacOS x86, Windows x86
Architecture x86
Source of Capstone pip install capstone==5.0.1
Version/git commit v5.0.1

Instruction bytes giving faulty results

0xdd, 0xcc

Expected results

Output:

<CsInsn 0x1000 [ddcc]: fxch st(0), st(4)>

Steps to get the wrong result

from capstone import *

CODE = b'\xdd\xcc'
md = Cs(CS_ARCH_X86, CS_MODE_32)
md.detail = True
for ins in md.disasm(CODE, 0x1000):
    print(ins)

Actual results

NO OUTPUT