From 8ef597970d946d41c9747dd746cbe0a6276aa0a4 Mon Sep 17 00:00:00 2001 From: flobernd Date: Thu, 29 Jun 2017 19:44:01 +0200 Subject: [PATCH] Minor bugfixes - Fixed operand-action for MVEX instructions with mask-register - Fixed decoding of MVEX instructions without swizzle/broadcast/convert functionality --- src/Decoder.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Decoder.c b/src/Decoder.c index f9c1e5a..451e714 100644 --- a/src/Decoder.c +++ b/src/Decoder.c @@ -1933,7 +1933,8 @@ FinalizeOperand: } // Fix operand-action for EVEX instructions with merge-mask - if ((info->encoding == ZYDIS_INSTRUCTION_ENCODING_EVEX) && + if (((info->encoding == ZYDIS_INSTRUCTION_ENCODING_EVEX) || + (info->encoding == ZYDIS_INSTRUCTION_ENCODING_MVEX)) && (info->avx.maskMode == ZYDIS_MASK_MODE_MERGE) && (info->operandCount >= 3) && (info->operands[1].type == ZYDIS_OPERAND_TYPE_REGISTER) && @@ -4084,7 +4085,7 @@ static ZydisStatus ZydisDecodeInstruction(ZydisDecoderContext* context, ZydisIns static const uint8_t lookup[25][8] = { // ZYDIS_MVEX_FUNC_INVALID - { 1, 0, 0, 0, 0, 0, 0, 0 }, + { 1, 1, 1, 1, 1, 1, 1, 1 }, // ZYDIS_MVEX_FUNC_RC { 1, 1, 1, 1, 1, 1, 1, 1 }, // ZYDIS_MVEX_FUNC_SAE