From 34a05729483f16d8030373ca920c6498f5832d39 Mon Sep 17 00:00:00 2001 From: flobernd Date: Wed, 5 Jul 2017 13:33:59 +0200 Subject: [PATCH] Refactorings --- include/Zydis/DecoderTypes.h | 2 +- include/Zydis/Mnemonic.h | 6 ++-- src/Decoder.c | 32 ++++++++--------- ...tionClassMap.inc => PhysicalEncodings.inc} | 36 +++++++++---------- src/InstructionTable.c | 10 +++--- src/InstructionTable.h | 29 ++++++++------- src/Mnemonic.c | 2 +- 7 files changed, 59 insertions(+), 58 deletions(-) rename src/Generated/{InstructionClassMap.inc => PhysicalEncodings.inc} (54%) diff --git a/include/Zydis/DecoderTypes.h b/include/Zydis/DecoderTypes.h index 790fac6..fe7c4d3 100644 --- a/include/Zydis/DecoderTypes.h +++ b/include/Zydis/DecoderTypes.h @@ -885,7 +885,7 @@ typedef struct ZydisDecodedInstruction_ /** * @brief The instruction-mnemonic. */ - ZydisInstructionMnemonic mnemonic; + ZydisMnemonic mnemonic; /** * @brief The length of the decoded instruction. */ diff --git a/include/Zydis/Mnemonic.h b/include/Zydis/Mnemonic.h index 1250efd..80799a5 100644 --- a/include/Zydis/Mnemonic.h +++ b/include/Zydis/Mnemonic.h @@ -39,9 +39,9 @@ extern "C" { /* ============================================================================================== */ /** - * @brief Defines the @c ZydisInstructionMnemonic datatype. + * @brief Defines the @c ZydisMnemonic datatype. */ -typedef uint16_t ZydisInstructionMnemonic; +typedef uint16_t ZydisMnemonic; #include @@ -56,7 +56,7 @@ typedef uint16_t ZydisInstructionMnemonic; * * @return The instruction mnemonic string or @c NULL, if an invalid mnemonic was passed. */ -ZYDIS_EXPORT const char* ZydisMnemonicGetString(ZydisInstructionMnemonic mnemonic); +ZYDIS_EXPORT const char* ZydisMnemonicGetString(ZydisMnemonic mnemonic); /* ============================================================================================== */ diff --git a/src/Decoder.c b/src/Decoder.c index 6c23c8b..ae84d8d 100644 --- a/src/Decoder.c +++ b/src/Decoder.c @@ -3143,13 +3143,13 @@ static ZydisStatus ZydisCollectOptionalPrefixes(ZydisDecoderContext* context, * @return A zydis status code. */ static ZydisStatus ZydisDecodeInstructionPhysical(ZydisDecoderContext* context, - ZydisDecodedInstruction* instruction, const ZydisInstructionParts* optionalParts) + ZydisDecodedInstruction* instruction, const ZydisPhysicalInstructionInfo* info) { ZYDIS_ASSERT(context); ZYDIS_ASSERT(instruction); - ZYDIS_ASSERT(optionalParts); + ZYDIS_ASSERT(info); - if (optionalParts->flags & ZYDIS_INSTRPART_FLAG_HAS_MODRM) + if (info->flags & ZYDIS_PHYSINSTR_FLAG_HAS_MODRM) { if (!instruction->raw.modrm.isDecoded) { @@ -3159,7 +3159,7 @@ static ZydisStatus ZydisDecodeInstructionPhysical(ZydisDecoderContext* context, } uint8_t hasSIB = 0; uint8_t displacementSize = 0; - if (!(optionalParts->flags & ZYDIS_INSTRPART_FLAG_FORCE_REG_FORM)) + if (!(info->flags & ZYDIS_PHYSINSTR_FLAG_FORCE_REG_FORM)) { switch (instruction->addressWidth) { @@ -3231,29 +3231,27 @@ static ZydisStatus ZydisDecodeInstructionPhysical(ZydisDecoderContext* context, } } - if (optionalParts->flags & ZYDIS_INSTRPART_FLAG_HAS_DISP) + if (info->flags & ZYDIS_PHYSINSTR_FLAG_HAS_DISP) { ZYDIS_CHECK(ZydisReadDisplacement( - context, instruction, optionalParts->disp.size[context->easzIndex])); + context, instruction, info->disp.size[context->easzIndex])); } - if (optionalParts->flags & ZYDIS_INSTRPART_FLAG_HAS_IMM0) + if (info->flags & ZYDIS_PHYSINSTR_FLAG_HAS_IMM0) { - if (optionalParts->imm[0].isRelative) + if (info->imm[0].isRelative) { instruction->attributes |= ZYDIS_ATTRIB_IS_RELATIVE; } ZYDIS_CHECK(ZydisReadImmediate(context, instruction, 0, - optionalParts->imm[0].size[context->eoszIndex], - optionalParts->imm[0].isSigned, optionalParts->imm[0].isRelative)); + info->imm[0].size[context->eoszIndex], info->imm[0].isSigned, info->imm[0].isRelative)); } - if (optionalParts->flags & ZYDIS_INSTRPART_FLAG_HAS_IMM1) + if (info->flags & ZYDIS_PHYSINSTR_FLAG_HAS_IMM1) { - ZYDIS_ASSERT(!(optionalParts->flags & ZYDIS_INSTRPART_FLAG_HAS_DISP)); + ZYDIS_ASSERT(!(info->flags & ZYDIS_PHYSINSTR_FLAG_HAS_DISP)); ZYDIS_CHECK(ZydisReadImmediate(context, instruction, 1, - optionalParts->imm[1].size[context->eoszIndex], - optionalParts->imm[1].isSigned, optionalParts->imm[1].isRelative)); + info->imm[1].size[context->eoszIndex], info->imm[1].isSigned, info->imm[1].isRelative)); } return ZYDIS_STATUS_SUCCESS; @@ -4266,9 +4264,9 @@ static ZydisStatus ZydisDecodeInstruction(ZydisDecoderContext* context, ZydisSetEffectiveOperandSize(context, instruction, definition); ZydisSetEffectiveAddressWidth(context, instruction); - const ZydisInstructionParts* optionalParts; - ZydisGetOptionalInstructionParts(node, &optionalParts); - ZYDIS_CHECK(ZydisDecodeInstructionPhysical(context, instruction, optionalParts)); + const ZydisPhysicalInstructionInfo* info; + ZydisGetPhysicalInstructionInfo(node, &info); + ZYDIS_CHECK(ZydisDecodeInstructionPhysical(context, instruction, info)); if (instruction->encoding == ZYDIS_INSTRUCTION_ENCODING_3DNOW) { diff --git a/src/Generated/InstructionClassMap.inc b/src/Generated/PhysicalEncodings.inc similarity index 54% rename from src/Generated/InstructionClassMap.inc rename to src/Generated/PhysicalEncodings.inc index f114a5a..fd621ca 100644 --- a/src/Generated/InstructionClassMap.inc +++ b/src/Generated/PhysicalEncodings.inc @@ -1,21 +1,21 @@ -static const ZydisInstructionParts instructionClassMap[] = +static const ZydisPhysicalInstructionInfo physicalEncodings[] = { /*00*/ { 0, { { 0, 0, 0 } }, { { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } }, - /*01*/ { 0 | ZYDIS_INSTRPART_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 8, 8, 8 }, ZYDIS_TRUE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } }, - /*02*/ { 0 | ZYDIS_INSTRPART_FLAG_HAS_MODRM, { { 0, 0, 0 } }, { { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } }, - /*03*/ { 0 | ZYDIS_INSTRPART_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 16, 32, 32 }, ZYDIS_TRUE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } }, - /*04*/ { 0 | ZYDIS_INSTRPART_FLAG_HAS_MODRM | ZYDIS_INSTRPART_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 8, 8, 8 }, ZYDIS_TRUE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } }, - /*05*/ { 0 | ZYDIS_INSTRPART_FLAG_HAS_MODRM | ZYDIS_INSTRPART_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 16, 32, 32 }, ZYDIS_TRUE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } }, - /*06*/ { 0 | ZYDIS_INSTRPART_FLAG_HAS_MODRM | ZYDIS_INSTRPART_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 8, 8, 8 }, ZYDIS_FALSE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } }, - /*07*/ { 0 | ZYDIS_INSTRPART_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 16, 32, 32 }, ZYDIS_TRUE, ZYDIS_TRUE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } }, - /*08*/ { 0 | ZYDIS_INSTRPART_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 32, 32, 32 }, ZYDIS_TRUE, ZYDIS_TRUE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } }, - /*09*/ { 0 | ZYDIS_INSTRPART_FLAG_HAS_IMM0 | ZYDIS_INSTRPART_FLAG_HAS_IMM1, { { 0, 0, 0 } }, { { { 16, 32, 32 }, ZYDIS_TRUE, ZYDIS_TRUE }, { { 16, 16, 16 }, ZYDIS_FALSE, ZYDIS_FALSE } } }, - /*0A*/ { 0 | ZYDIS_INSTRPART_FLAG_HAS_IMM0 | ZYDIS_INSTRPART_FLAG_HAS_IMM1, { { 0, 0, 0 } }, { { { 16, 16, 16 }, ZYDIS_FALSE, ZYDIS_FALSE }, { { 8, 8, 8 }, ZYDIS_FALSE, ZYDIS_FALSE } } }, - /*0B*/ { 0 | ZYDIS_INSTRPART_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 8, 8, 8 }, ZYDIS_FALSE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } }, - /*0C*/ { 0 | ZYDIS_INSTRPART_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 8, 8, 8 }, ZYDIS_TRUE, ZYDIS_TRUE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } }, - /*0D*/ { 0 | ZYDIS_INSTRPART_FLAG_HAS_DISP, { { 16, 32, 64 } }, { { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } }, - /*0E*/ { 0 | ZYDIS_INSTRPART_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 16, 32, 64 }, ZYDIS_FALSE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } }, - /*0F*/ { 0 | ZYDIS_INSTRPART_FLAG_HAS_MODRM | ZYDIS_INSTRPART_FLAG_FORCE_REG_FORM, { { 0, 0, 0 } }, { { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } }, - /*10*/ { 0 | ZYDIS_INSTRPART_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 16, 16, 16 }, ZYDIS_FALSE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } }, - /*11*/ { 0 | ZYDIS_INSTRPART_FLAG_HAS_MODRM | ZYDIS_INSTRPART_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 32, 32, 32 }, ZYDIS_FALSE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } } + /*01*/ { 0 | ZYDIS_PHYSINSTR_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 8, 8, 8 }, ZYDIS_TRUE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } }, + /*02*/ { 0 | ZYDIS_PHYSINSTR_FLAG_HAS_MODRM, { { 0, 0, 0 } }, { { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } }, + /*03*/ { 0 | ZYDIS_PHYSINSTR_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 16, 32, 32 }, ZYDIS_TRUE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } }, + /*04*/ { 0 | ZYDIS_PHYSINSTR_FLAG_HAS_MODRM | ZYDIS_PHYSINSTR_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 8, 8, 8 }, ZYDIS_TRUE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } }, + /*05*/ { 0 | ZYDIS_PHYSINSTR_FLAG_HAS_MODRM | ZYDIS_PHYSINSTR_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 16, 32, 32 }, ZYDIS_TRUE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } }, + /*06*/ { 0 | ZYDIS_PHYSINSTR_FLAG_HAS_MODRM | ZYDIS_PHYSINSTR_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 8, 8, 8 }, ZYDIS_FALSE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } }, + /*07*/ { 0 | ZYDIS_PHYSINSTR_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 16, 32, 32 }, ZYDIS_TRUE, ZYDIS_TRUE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } }, + /*08*/ { 0 | ZYDIS_PHYSINSTR_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 32, 32, 32 }, ZYDIS_TRUE, ZYDIS_TRUE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } }, + /*09*/ { 0 | ZYDIS_PHYSINSTR_FLAG_HAS_IMM0 | ZYDIS_PHYSINSTR_FLAG_HAS_IMM1, { { 0, 0, 0 } }, { { { 16, 32, 32 }, ZYDIS_TRUE, ZYDIS_TRUE }, { { 16, 16, 16 }, ZYDIS_FALSE, ZYDIS_FALSE } } }, + /*0A*/ { 0 | ZYDIS_PHYSINSTR_FLAG_HAS_IMM0 | ZYDIS_PHYSINSTR_FLAG_HAS_IMM1, { { 0, 0, 0 } }, { { { 16, 16, 16 }, ZYDIS_FALSE, ZYDIS_FALSE }, { { 8, 8, 8 }, ZYDIS_FALSE, ZYDIS_FALSE } } }, + /*0B*/ { 0 | ZYDIS_PHYSINSTR_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 8, 8, 8 }, ZYDIS_FALSE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } }, + /*0C*/ { 0 | ZYDIS_PHYSINSTR_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 8, 8, 8 }, ZYDIS_TRUE, ZYDIS_TRUE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } }, + /*0D*/ { 0 | ZYDIS_PHYSINSTR_FLAG_HAS_DISP, { { 16, 32, 64 } }, { { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } }, + /*0E*/ { 0 | ZYDIS_PHYSINSTR_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 16, 32, 64 }, ZYDIS_FALSE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } }, + /*0F*/ { 0 | ZYDIS_PHYSINSTR_FLAG_HAS_MODRM | ZYDIS_PHYSINSTR_FLAG_FORCE_REG_FORM, { { 0, 0, 0 } }, { { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } }, + /*10*/ { 0 | ZYDIS_PHYSINSTR_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 16, 16, 16 }, ZYDIS_FALSE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } }, + /*11*/ { 0 | ZYDIS_PHYSINSTR_FLAG_HAS_MODRM | ZYDIS_PHYSINSTR_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 32, 32, 32 }, ZYDIS_FALSE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } } }; diff --git a/src/InstructionTable.c b/src/InstructionTable.c index 438d0c9..6ce9edf 100644 --- a/src/InstructionTable.c +++ b/src/InstructionTable.c @@ -286,7 +286,7 @@ extern const ZydisInstructionDefinitionMVEX instructionDefinitionsMVEX[]; /* Physical instruction encodings */ /* ---------------------------------------------------------------------------------------------- */ -#include +#include /* ---------------------------------------------------------------------------------------------- */ /* Instruction tree */ @@ -446,13 +446,13 @@ void ZydisGetInstructionDefinition(const ZydisInstructionTreeNode* node, } } -void ZydisGetOptionalInstructionParts(const ZydisInstructionTreeNode* node, - const ZydisInstructionParts** info) +void ZydisGetPhysicalInstructionInfo(const ZydisInstructionTreeNode* node, + const ZydisPhysicalInstructionInfo** info) { ZYDIS_ASSERT(node->type & ZYDIS_NODETYPE_DEFINITION_MASK); uint8_t class = (node->type) & 0x7F; - ZYDIS_ASSERT(class < ZYDIS_ARRAY_SIZE(instructionClassMap)); - *info = &instructionClassMap[class]; + ZYDIS_ASSERT(class < ZYDIS_ARRAY_SIZE(physicalEncodings)); + *info = &physicalEncodings[class]; } /* ---------------------------------------------------------------------------------------------- */ diff --git a/src/InstructionTable.h b/src/InstructionTable.h index af09b54..0a683b9 100644 --- a/src/InstructionTable.h +++ b/src/InstructionTable.h @@ -652,7 +652,7 @@ enum ZydisMaskPolicies /* ---------------------------------------------------------------------------------------------- */ #define ZYDIS_INSTRUCTION_DEFINITION_BASE \ - ZydisInstructionMnemonic mnemonic ZYDIS_BITFIELD(11); \ + ZydisMnemonic mnemonic ZYDIS_BITFIELD(11); \ uint8_t operandCount ZYDIS_BITFIELD( 4); \ uint16_t operandReference ZYDIS_BITFIELD(15); \ uint8_t operandSizeMap ZYDIS_BITFIELD( 3) @@ -737,29 +737,29 @@ typedef struct ZydisInstructionDefinitionMVEX_ /* ---------------------------------------------------------------------------------------------- */ /** - * @brief Defines the @c ZydisInstructionPartFlags datatype. + * @brief Defines the @c ZydisPhysicalInstructionInfoFlags datatype. */ -typedef uint8_t ZydisInstructionPartFlags; +typedef uint8_t ZydisPhysicalInstructionInfoFlags; /** * @brief The instruction has an optional modrm byte. */ -#define ZYDIS_INSTRPART_FLAG_HAS_MODRM 0x01 +#define ZYDIS_PHYSINSTR_FLAG_HAS_MODRM 0x01 /** * @brief The instruction has an optional displacement value. */ -#define ZYDIS_INSTRPART_FLAG_HAS_DISP 0x02 +#define ZYDIS_PHYSINSTR_FLAG_HAS_DISP 0x02 /** * @brief The instruction has an optional immediate value. */ -#define ZYDIS_INSTRPART_FLAG_HAS_IMM0 0x04 +#define ZYDIS_PHYSINSTR_FLAG_HAS_IMM0 0x04 /** * @brief The instruction has a second optional immediate value. */ -#define ZYDIS_INSTRPART_FLAG_HAS_IMM1 0x08 +#define ZYDIS_PHYSINSTR_FLAG_HAS_IMM1 0x08 /** * @brief The instruction ignores the value of `modrm.mod` and always assumes `modrm.mod == 3` @@ -767,14 +767,17 @@ typedef uint8_t ZydisInstructionPartFlags; * * Instructions with this flag can't have a SIB byte or a displacement value. */ -#define ZYDIS_INSTRPART_FLAG_FORCE_REG_FORM 0x10 +#define ZYDIS_PHYSINSTR_FLAG_FORCE_REG_FORM 0x10 -typedef struct ZydisInstructionParts_ +/** + * @brief Defines the @c ZydisPhysicalInstructionInfo struct. + */ +typedef struct ZydisPhysicalInstructionInfo_ { /** * @brief Contains flags with information about the physical instruction-encoding. */ - ZydisInstructionPartFlags flags; + ZydisPhysicalInstructionInfoFlags flags; /** * @brief Displacement info. */ @@ -803,7 +806,7 @@ typedef struct ZydisInstructionParts_ */ ZydisBool isRelative; } imm[2]; -} ZydisInstructionParts; +} ZydisPhysicalInstructionInfo; /* ============================================================================================== */ /* Functions */ @@ -851,8 +854,8 @@ ZYDIS_NO_EXPORT void ZydisGetInstructionDefinition(const ZydisInstructionTreeNod * @param node The instruction definition node. * @param info A pointer to the @c ZydisInstructionParts struct. */ -ZYDIS_NO_EXPORT void ZydisGetOptionalInstructionParts(const ZydisInstructionTreeNode* node, - const ZydisInstructionParts** info); +ZYDIS_NO_EXPORT void ZydisGetPhysicalInstructionInfo(const ZydisInstructionTreeNode* node, + const ZydisPhysicalInstructionInfo** info); /* ---------------------------------------------------------------------------------------------- */ /* Operand definition */ diff --git a/src/Mnemonic.c b/src/Mnemonic.c index 62f391b..1d03556 100644 --- a/src/Mnemonic.c +++ b/src/Mnemonic.c @@ -36,7 +36,7 @@ /* Exported functions */ /* ============================================================================================== */ -const char* ZydisMnemonicGetString(ZydisInstructionMnemonic mnemonic) +const char* ZydisMnemonicGetString(ZydisMnemonic mnemonic) { if (mnemonic > ZYDIS_ARRAY_SIZE(mnemonicStrings) - 1) {