diff --git a/include/Zydis/Decoder.h b/include/Zydis/Decoder.h index 9c3f019..a5c8161 100644 --- a/include/Zydis/Decoder.h +++ b/include/Zydis/Decoder.h @@ -124,10 +124,20 @@ enum ZydisDecoderModes * This mode is enabled by default. */ ZYDIS_DECODER_MODE_TZCNT, + /** + * @brief Enables the WBNOINVD mode. + * + * The `WBINVD` instruction is interpreted as `WBNOINVD` on ICL chips, if a `F3` prefix is + * used. + * + * This mode is disabled by default. + */ + ZYDIS_DECODER_MODE_WBNOINVD, + /** * @brief Maximum value of this enum. */ - ZYDIS_DECODER_MODE_MAX_VALUE = ZYDIS_DECODER_MODE_TZCNT + ZYDIS_DECODER_MODE_MAX_VALUE = ZYDIS_DECODER_MODE_WBNOINVD }; /* ---------------------------------------------------------------------------------------------- */ diff --git a/include/Zydis/DecoderTypes.h b/include/Zydis/DecoderTypes.h index 8b93c40..c90e81a 100644 --- a/include/Zydis/DecoderTypes.h +++ b/include/Zydis/DecoderTypes.h @@ -72,8 +72,7 @@ enum ZydisMemoryOperandTypes ZYDIS_MEMOP_TYPE_AGEN, /** * @brief A memory operand using `SIB` addressing form, where the index register is not used - * in address calculation and scale is ignored. No real memory-access is - * caused. + * in address calculation and scale is ignored. No real memory-access is caused. */ ZYDIS_MEMOP_TYPE_MIB }; @@ -627,6 +626,11 @@ typedef ZydisU8 ZydisMaskMode; enum ZydisMaskModes { ZYDIS_MASK_MODE_INVALID, + + // TODO: Add `ZYDIS_MASK_MODE_DISABLED` for for `EVEX`/`MVEX` instructions with `K0` mask + // TODO: Add `ZYDIS_MASK_MODE_CONTROL` and `ZYDIS_MASK_MODE_CONTROL_ZERO` as replacement for + // the `isControlMask` field + /** * @brief The embedded mask register is used as a merge-mask. This is the default mode for * all EVEX/MVEX-instructions. diff --git a/src/Decoder.c b/src/Decoder.c index 7fc5a3a..a5332ba 100644 --- a/src/Decoder.c +++ b/src/Decoder.c @@ -1632,6 +1632,7 @@ static void ZydisDecodeOperandImplicitMemory(ZydisDecoderContext* context, }; operand->type = ZYDIS_OPERAND_TYPE_MEMORY; + operand->mem.type = ZYDIS_MEMOP_TYPE_MEM; switch (definition->op.mem.base) { @@ -4588,7 +4589,8 @@ ZydisStatus ZydisDecoderInit(ZydisDecoder* decoder, ZydisMachineMode machineMode ZYDIS_TRUE , // ZYDIS_DECODER_MODE_MPX ZYDIS_TRUE , // ZYDIS_DECODER_MODE_CET ZYDIS_TRUE , // ZYDIS_DECODER_MODE_LZCNT - ZYDIS_TRUE // ZYDIS_DECODER_MODE_TZCNT + ZYDIS_TRUE , // ZYDIS_DECODER_MODE_TZCNT + ZYDIS_FALSE // ZYDIS_DECODER_MODE_WBNOINVD }; if (!decoder || @@ -4659,8 +4661,6 @@ ZydisStatus ZydisDecoderDecodeBuffer(const ZydisDecoder* decoder, const void* bu ZYDIS_CHECK(ZydisCollectOptionalPrefixes(&context, instruction)); ZYDIS_CHECK(ZydisDecodeInstruction(&context, instruction)); - // TODO: More EVEX UD conditions (page 81) - return ZYDIS_STATUS_SUCCESS; }