Skip to content

Ghidra is a software reverse engineering (SRE) framework

GT-3253: Corrected register definitions for the x86 rdrand instruction (fixes #1169).

ghidorahrex6b816825511a
diff --git a/Ghidra/Processors/x86/data/languages/rdrand.sinc b/Ghidra/Processors/x86/data/languages/rdrand.sinc
index ceaf72d55d..8432b8f0fa 100644
--- a/Ghidra/Processors/x86/data/languages/rdrand.sinc
+++ b/Ghidra/Processors/x86/data/languages/rdrand.sinc
@@ -1,6 +1,6 @@
define pcodeop rdrand;
define pcodeop rdrandIsValid;
-:RDRAND r16 is vexMode=0 & opsize=0 & byte=0x0f; byte=0xC7; r16 & reg_opcode=6 { r16 = rdrand(); CF=rdrandIsValid(); }
-:RDRAND r32 is vexMode=0 & opsize=1 & byte=0x0f; byte=0xC7; r32 & reg_opcode=6 { r32 = rdrand(); CF=rdrandIsValid(); }
-:RDRAND r64 is vexMode=0 & opsize=2 & $(REX_W) & byte=0x0f; byte=0xC7; r64 & reg_opcode=6 { r64 = rdrand(); CF=rdrandIsValid(); }
+:RDRAND rm16 is vexMode=0 & opsize=0 & byte=0x0f; byte=0xC7; (rm16 & reg_opcode=6 ...) { rm16 = rdrand(); CF=rdrandIsValid(); }
+:RDRAND rm32 is vexMode=0 & opsize=1 & byte=0x0f; byte=0xC7; (rm32 & reg_opcode=6 ...) { rm32 = rdrand(); CF=rdrandIsValid(); }
+:RDRAND rm64 is vexMode=0 & opsize=2 & $(REX_W) & byte=0x0f; byte=0xC7; (rm64 & reg_opcode=6 ...) { rm64 = rdrand(); CF=rdrandIsValid(); }