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: Zero upper bits of 64-bit registers for XCHG and CMPXCHG8B without REX prefix #6567

Open Sleigh-InSPECtor opened 1 month ago

Sleigh-InSPECtor commented 1 month ago

The CMPXCHG8B and XCHG mem constructors (with opsize=1) are missing check_Reg constructors to zero the upper 32-bits when the destination registers are 64-bit.

e.g.

(Note: this is already handled correctly in the XCHG reg,reg form).