From 886c535a6e61d8df6f84b195298c9cbe1a3eb8df Mon Sep 17 00:00:00 2001 From: naq Date: Sun, 9 Jun 2019 01:13:22 +0800 Subject: [PATCH] x86: checkPrefix() does not set prefix0 in repne case --- arch/X86/X86DisassemblerDecoder.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/X86/X86DisassemblerDecoder.c b/arch/X86/X86DisassemblerDecoder.c index a6377e0d..e0d1655c 100644 --- a/arch/X86/X86DisassemblerDecoder.c +++ b/arch/X86/X86DisassemblerDecoder.c @@ -794,20 +794,20 @@ static int readOpcode(struct InternalInstruction* insn) // mmmmmFromVEX2of3(insn->vectorExtensionPrefix[1])); return -1; case VEX_LOB_0F: - insn->twoByteEscape = 0x0f; + //insn->twoByteEscape = 0x0f; insn->opcodeType = TWOBYTE; return consumeByte(insn, &insn->opcode); case VEX_LOB_0F38: - insn->twoByteEscape = 0x0f; + //insn->twoByteEscape = 0x0f; insn->opcodeType = THREEBYTE_38; return consumeByte(insn, &insn->opcode); case VEX_LOB_0F3A: - insn->twoByteEscape = 0x0f; + //insn->twoByteEscape = 0x0f; insn->opcodeType = THREEBYTE_3A; return consumeByte(insn, &insn->opcode); } } else if (insn->vectorExtensionType == TYPE_VEX_2B) { - insn->twoByteEscape = 0x0f; + //insn->twoByteEscape = 0x0f; insn->opcodeType = TWOBYTE; return consumeByte(insn, &insn->opcode); } else if (insn->vectorExtensionType == TYPE_XOP) { @@ -2281,6 +2281,7 @@ static bool checkPrefix(struct InternalInstruction *insn) } } +#if 0 // REPNE prefix if (insn->repeatPrefix) { // 0xf2 can be a part of instruction encoding, but not really a prefix. @@ -2289,6 +2290,7 @@ static bool checkPrefix(struct InternalInstruction *insn) insn->prefix0 = 0; } } +#endif // no invalid prefixes return false;