NationalSecurityAgency / ghidra

Ghidra is a software reverse engineering (SRE) framework
https://www.nsa.gov/ghidra
Apache License 2.0
49.09k stars 5.65k forks source link

x86: Add missing reg_opcode constraint to lockable INC #6566

Open Sleigh-InSPECtor opened 1 month ago

Sleigh-InSPECtor commented 1 month ago

The INC encoding is FE /0 meaning that a reg_opcode=0 constraint is needed in SLEIGH. This is missing from the memory variant (in lockable.sinc), which causes undefined FE xx instructions to be decoded as INC.

(Without this constraint, the constructors technically overlap with the DEC instruction, however, since the DEC instruction has the correct constraints it ends up getting matched first).

e.g.,