x86: 0x66 & 0x67 cannot be anywhere. this fixes CRC32 instruction
diff --git a/arch/X86/X86DisassemblerDecoder.c b/arch/X86/X86DisassemblerDecoder.c
index 22b996d..50358f4 100644
--- a/arch/X86/X86DisassemblerDecoder.c
+++ b/arch/X86/X86DisassemblerDecoder.c
@@ -365,10 +365,6 @@
uint8_t prefix,
uint64_t location)
{
- // allow 0x66 & 0x67 to be put anywhere
- if (prefix == 0x66 || prefix == 0x67)
- return insn->prefixPresent[prefix] == 1;
-
if (insn->prefixPresent[prefix] == 1 &&
insn->prefixLocations[prefix] == location)
return true;
@@ -545,6 +541,7 @@
insn->vectorExtensionType = TYPE_NO_VEX_XOP;
+
if (byte == 0x62) {
uint8_t byte1, byte2;
diff --git a/arch/X86/X86DisassemblerDecoder.h b/arch/X86/X86DisassemblerDecoder.h
index f64ebe5..02dd03e 100644
--- a/arch/X86/X86DisassemblerDecoder.h
+++ b/arch/X86/X86DisassemblerDecoder.h
@@ -568,6 +568,9 @@
/* 1 if the prefix byte, 0xf2 or 0xf3 is xacquire or xrelease */
bool xAcquireRelease;
+ /* contains the location (for use with the reader) of the prefix byte */
+ uint64_t prefixLocations[0x100];
+
/* The value of the vector extension prefix(EVEX/VEX/XOP), if present */
uint8_t vectorExtensionPrefix[4];
@@ -596,8 +599,6 @@
/* Prefix state */
- /* contains the location (for use with the reader) of the prefix byte */
- uint64_t prefixLocations[0x100];
/* The type of the vector extension prefix */
VectorExtensionType vectorExtensionType;
/* The location where a mandatory prefix would have to be (i.e., right before