From fa12ccb64bb6bfc074b006eb915f75a681a94bef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joel=20Ho=CC=88ner?= Date: Fri, 1 Dec 2017 20:40:56 +0100 Subject: [PATCH 01/14] Switch to length aware string --- include/Zydis/Formatter.h | 23 ++- include/Zydis/Status.h | 6 +- include/Zydis/String.h | 45 ++++++ src/FormatHelper.c | 326 +++++++++++++------------------------- src/FormatHelper.h | 65 +++++--- src/Formatter.c | 314 ++++++++++++++++++------------------ 6 files changed, 363 insertions(+), 416 deletions(-) create mode 100644 include/Zydis/String.h diff --git a/include/Zydis/Formatter.h b/include/Zydis/Formatter.h index 3f07918..8b29588 100644 --- a/include/Zydis/Formatter.h +++ b/include/Zydis/Formatter.h @@ -35,6 +35,7 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { @@ -413,14 +414,13 @@ typedef struct ZydisFormatter_ ZydisFormatter; * @c ZYDIS_FORMATTER_HOOK_POST hook-types. */ typedef ZydisStatus (*ZydisFormatterNotifyFunc)(const ZydisFormatter* formatter, - const ZydisDecodedInstruction* instruction, void* userData); + ZydisString* buffer, const ZydisDecodedInstruction* instruction, void* userData); /** * @brief Defines the @c ZydisFormatterFormatFunc function pointer. * * @param formatter A pointer to the @c ZydisFormatter instance. - * @param buffer A pointer to the string-buffer. - * @param bufferLen The length of the string-buffer. + * @param str A pointer to the string buffer. * @param instruction A pointer to the @c ZydisDecodedInstruction struct. * @param userData A pointer to user-defined data. * @@ -434,14 +434,13 @@ typedef ZydisStatus (*ZydisFormatterNotifyFunc)(const ZydisFormatter* formatter, * @c ZYDIS_FORMATTER_HOOK_PRINT_PREFIXES and @c ZYDIS_FORMATTER_HOOK_PRINT_MNEMONIC hook-types. */ typedef ZydisStatus (*ZydisFormatterFormatFunc)(const ZydisFormatter* formatter, - char** buffer, ZydisUSize bufferLen, const ZydisDecodedInstruction* instruction, void* userData); + ZydisString* buffer, const ZydisDecodedInstruction* instruction, void* userData); /** * @brief Defines the @c ZydisFormatterFormatOperandFunc function pointer. * * @param formatter A pointer to the @c ZydisFormatter instance. - * @param buffer A pointer to the string-buffer. - * @param bufferLen The length of the string-buffer. + * @param str A pointer to the string buffer. * @param instruction A pointer to the @c ZydisDecodedInstruction struct. * @param operand A pointer to the @c ZydisDecodedOperand struct. * @param userData A pointer to user-defined data. @@ -471,15 +470,14 @@ typedef ZydisStatus (*ZydisFormatterFormatFunc)(const ZydisFormatter* formatter, * hook-types. */ typedef ZydisStatus (*ZydisFormatterFormatOperandFunc)(const ZydisFormatter* formatter, - char** buffer, ZydisUSize bufferLen, const ZydisDecodedInstruction* instruction, + ZydisString* buffer, const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, void* userData); /** * @brief Defines the @c ZydisFormatterFormatAddressFunc function pointer. * * @param formatter A pointer to the @c ZydisFormatter instance. - * @param buffer A pointer to the string-buffer. - * @param bufferLen The length of the string-buffer. + * @param str A pointer to the string buffer. * @param instruction A pointer to the @c ZydisDecodedInstruction struct. * @param operand A pointer to the @c ZydisDecodedOperand struct. * @param userData A pointer to user-defined data. @@ -494,15 +492,14 @@ typedef ZydisStatus (*ZydisFormatterFormatOperandFunc)(const ZydisFormatter* for * This function type is used for the @c ZYDIS_FORMATTER_HOOK_PRINT_ADDRESS hook-type. */ typedef ZydisStatus (*ZydisFormatterFormatAddressFunc)(const ZydisFormatter* formatter, - char** buffer, ZydisUSize bufferLen, const ZydisDecodedInstruction* instruction, + ZydisString* buffer, const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, ZydisU64 address, void* userData); /** * @brief Defines the @c ZydisFormatterFormatDecoratorFunc function pointer. * * @param formatter A pointer to the @c ZydisFormatter instance. - * @param buffer A pointer to the string-buffer. - * @param bufferLen The length of the string-buffer. + * @param str A pointer to the string buffer. * @param instruction A pointer to the @c ZydisDecodedInstruction struct. * @param operand A pointer to the @c ZydisDecodedOperand struct. * @param type The decorator type. @@ -520,7 +517,7 @@ typedef ZydisStatus (*ZydisFormatterFormatAddressFunc)(const ZydisFormatter* for * This function type is used for the @c ZYDIS_FORMATTER_HOOK_PRINT_DECORATOR hook-type. */ typedef ZydisStatus (*ZydisFormatterFormatDecoratorFunc)(const ZydisFormatter* formatter, - char** buffer, ZydisUSize bufferLen, const ZydisDecodedInstruction* instruction, + ZydisString* buffer, const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, ZydisDecoratorType type, void* userData); /* ---------------------------------------------------------------------------------------------- */ diff --git a/include/Zydis/Status.h b/include/Zydis/Status.h index 2a81f5d..aec256e 100644 --- a/include/Zydis/Status.h +++ b/include/Zydis/Status.h @@ -164,10 +164,10 @@ enum ZydisStatusCodes #define ZYDIS_CHECK(status) \ do \ { \ - ZydisStatus s = status; \ - if (!ZYDIS_SUCCESS(s)) \ + ZydisStatus status_w4587ntvmEgDG = status; \ + if (!ZYDIS_SUCCESS(status_w4587ntvmEgDG)) \ { \ - return s; \ + return status_w4587ntvmEgDG; \ } \ } while (0) diff --git a/include/Zydis/String.h b/include/Zydis/String.h new file mode 100644 index 0000000..bb18e77 --- /dev/null +++ b/include/Zydis/String.h @@ -0,0 +1,45 @@ +/*************************************************************************************************** + + Zyan Disassembler Library (Zydis) + + Original Author : Joel Höner + + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + +***************************************************************************************************/ + +#ifndef ZYDIS_STRING_H +#define ZYDIS_STRING_H + +#include + +/* ============================================================================================== */ +/* String struct */ +/* ============================================================================================== */ + +typedef struct ZydisString_ +{ + char *s; // NOT always 0-terminated! + ZydisUSize length; + ZydisUSize capacity; // always -1 for 0 byte +} ZydisString; + +/* ============================================================================================== */ + +#endif // ZYDIS_STRING_H diff --git a/src/FormatHelper.c b/src/FormatHelper.c index e54018e..b9e4250 100644 --- a/src/FormatHelper.c +++ b/src/FormatHelper.c @@ -25,7 +25,6 @@ ***************************************************************************************************/ #include -#include /* ============================================================================================== */ /* Constants */ @@ -98,127 +97,16 @@ void ZydisToUpperCase(char* buffer, ZydisUSize bufferLen) } } -#if defined(ZYDIS_X86) || defined(ZYDIS_ARM) -ZydisStatus ZydisPrintDecU32(char** buffer, ZydisUSize bufferLen, ZydisU32 value, ZydisU8 paddingLength) +ZydisStatus ZydisPrintDecU64(ZydisString* s, ZydisU64 value, ZydisU8 paddingLength) { - ZYDIS_ASSERT(buffer); - ZYDIS_ASSERT(bufferLen > 0); - - char temp[ZYDIS_MAXCHARS_DEC_32 + 1]; - char *p = &temp[ZYDIS_MAXCHARS_DEC_32]; - *p = '\0'; - while (value >= 100) - { - ZydisU32 const old = value; - p -= 2; - value /= 100; - ZydisMemoryCopy(p, &decimalLookup[(old - (value * 100)) * 2], sizeof(ZydisU16)); - } - p -= 2; - ZydisMemoryCopy(p, &decimalLookup[value * 2], sizeof(ZydisU16)); - - const ZydisUSize n = &temp[ZYDIS_MAXCHARS_DEC_32] - p; - if ((bufferLen < (ZydisUSize)(n + 1)) || (bufferLen < (ZydisUSize)(paddingLength + 1))) - { - return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE; - } - - ZydisUSize offset = 0; - if (n <= paddingLength) - { - offset = paddingLength - n + 1; - ZydisMemorySet(*buffer, '0', offset); - } - - ZydisMemoryCopy(&(*buffer)[offset], &p[value < 10], n + 1); - *buffer += n + offset - (ZydisU8)(value < 10); - - return ZYDIS_STATUS_SUCCESS; -} - -ZydisStatus ZydisPrintHexU32(char** buffer, ZydisUSize bufferLen, ZydisU32 value, ZydisU8 paddingLength, - ZydisBool uppercase, const char* prefix, const char* suffix) -{ - ZYDIS_ASSERT(buffer); - ZYDIS_ASSERT(bufferLen); - - if (prefix) - { - const char* bufEnd = *buffer + bufferLen; - ZYDIS_CHECK(ZydisPrintStr(buffer, bufferLen, prefix, ZYDIS_LETTER_CASE_DEFAULT)); - bufferLen = bufEnd - *buffer; - } - if (bufferLen < (ZydisUSize)(paddingLength + 1)) - { - return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE; - } - - if (!value) - { - const ZydisU8 n = (paddingLength ? paddingLength : 1); - - if (bufferLen < (ZydisUSize)(n + 1)) - { - return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE; - } - - ZydisMemorySet(*buffer, '0', n); - (*buffer)[n] = '\0'; - *buffer += n; - return ZYDIS_STATUS_SUCCESS; - } - - ZydisU8 n = 0; - for (ZydisI8 i = ZYDIS_MAXCHARS_HEX_32 - 1; i >= 0; --i) - { - const ZydisU8 v = (value >> i * 4) & 0x0F; - if (!n) - { - if (!v) - { - continue; - } - if (bufferLen <= (ZydisU8)(i + 1)) - { - return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE; - } - if (paddingLength > i) - { - n = paddingLength - i - 1; - ZydisMemorySet(*buffer, '0', n); - } - } - if (uppercase) - { - (*buffer)[n++] = "0123456789ABCDEF"[v]; - } else - { - (*buffer)[n++] = "0123456789abcdef"[v]; - } - } - (*buffer)[n] = '\0'; - *buffer += n; - - if (suffix) - { - ZYDIS_CHECK(ZydisPrintStr(buffer, bufferLen - n, suffix, ZYDIS_LETTER_CASE_DEFAULT)); - } - - return ZYDIS_STATUS_SUCCESS; -} -#endif - -ZydisStatus ZydisPrintDecU64(char** buffer, ZydisUSize bufferLen, ZydisU64 value, ZydisU8 paddingLength) -{ - ZYDIS_ASSERT(buffer); - ZYDIS_ASSERT(bufferLen > 0); + ZYDIS_ASSERT(s); char temp[ZYDIS_MAXCHARS_DEC_64 + 1]; char *p = &temp[ZYDIS_MAXCHARS_DEC_64]; - *p = '\0'; + while (value >= 100) { - ZydisU64 const old = value; + const ZydisU64 old = value; p -= 2; value /= 100; ZydisMemoryCopy(p, &decimalLookup[(old - (value * 100)) * 2], 2); @@ -227,7 +115,8 @@ ZydisStatus ZydisPrintDecU64(char** buffer, ZydisUSize bufferLen, ZydisU64 value ZydisMemoryCopy(p, &decimalLookup[value * 2], 2); const ZydisUSize n = &temp[ZYDIS_MAXCHARS_DEC_64] - p; - if ((bufferLen < (ZydisUSize)(n + 1)) || (bufferLen < (ZydisUSize)(paddingLength + 1))) + if ((s->capacity - s->length < (ZydisUSize)(n + 1)) || + (s->capacity - s->length < (ZydisUSize)(paddingLength + 1))) { return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE; } @@ -236,179 +125,176 @@ ZydisStatus ZydisPrintDecU64(char** buffer, ZydisUSize bufferLen, ZydisU64 value if (n <= paddingLength) { offset = paddingLength - n + 1; - ZydisMemorySet(*buffer, '0', offset); + ZydisMemorySet(s->s + s->length, '0', offset); } - ZydisMemoryCopy(&(*buffer)[offset], &p[value < 10], n + 1); - *buffer += n + offset - (ZydisU8)(value < 10); + ZydisMemoryCopy(s->s + s->length + offset, &p[value < 10], n + 1); + s->length += n + offset - (ZydisU8)(value < 10); return ZYDIS_STATUS_SUCCESS; } -ZydisStatus ZydisPrintHexU64(char** buffer, ZydisUSize bufferLen, ZydisU64 value, ZydisU8 paddingLength, - ZydisBool uppercase, const char* prefix, const char* suffix) -{ - ZYDIS_ASSERT(buffer); - ZYDIS_ASSERT(bufferLen); - - if (prefix) - { - const char* bufEnd = *buffer + bufferLen; - ZYDIS_CHECK(ZydisPrintStr(buffer, bufferLen, prefix, ZYDIS_LETTER_CASE_DEFAULT)); - bufferLen = bufEnd - *buffer; - } - if (bufferLen < (ZydisUSize)(paddingLength + 1)) - { - return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE; - } - - if (!value) - { - const ZydisU8 n = (paddingLength ? paddingLength : 1); - - if (bufferLen < (ZydisUSize)(n + 1)) - { - return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE; - } - - ZydisMemorySet(*buffer, '0', n); - (*buffer)[n] = '\0'; - *buffer += n; - return ZYDIS_STATUS_SUCCESS; - } - - ZydisU8 n = 0; - const ZydisU8 c = ((value & 0xFFFFFFFF00000000) ? ZYDIS_MAXCHARS_HEX_64 : ZYDIS_MAXCHARS_HEX_32); - for (ZydisI8 i = c - 1; i >= 0; --i) - { - const ZydisU8 v = (value >> i * 4) & 0x0F; - if (!n) - { - if (!v) - { - continue; - } - if (bufferLen <= (ZydisU8)(i + 1)) - { - return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE; - } - if (paddingLength > i) - { - n = paddingLength - i - 1; - ZydisMemorySet(*buffer, '0', n); - } - } - if (uppercase) - { - (*buffer)[n++] = "0123456789ABCDEF"[v]; - } else - { - (*buffer)[n++] = "0123456789abcdef"[v]; - } - } - (*buffer)[n] = '\0'; - *buffer += n; - - if (suffix) - { - ZYDIS_CHECK(ZydisPrintStr(buffer, bufferLen - n, suffix, ZYDIS_LETTER_CASE_DEFAULT)); - } - - return ZYDIS_STATUS_SUCCESS; +ZydisStatus ZydisPrintHexU64(ZydisString* s, ZydisU64 value, ZydisU8 paddingLength, + ZydisBool uppercase, const char* prefix, const char* suffix) +{ + ZYDIS_ASSERT(s); + + if (prefix) + { + ZYDIS_CHECK(ZydisStringAppendC(s, prefix, ZYDIS_LETTER_CASE_DEFAULT)); + } + + char* buffer = s->s + s->length; + ZydisUSize numRemainingBytes = s->capacity - s->length; + + if (numRemainingBytes < (ZydisUSize)paddingLength) + { + return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE; + } + + if (!value) + { + const ZydisU8 n = (paddingLength ? paddingLength : 1); + + if (numRemainingBytes < (ZydisUSize)n) + { + return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE; + } + + ZydisMemorySet(buffer, '0', n); + s->length += n; + return ZYDIS_STATUS_SUCCESS; + } + + ZydisU8 n = 0; + const ZydisU8 c = ((value & 0xFFFFFFFF00000000) ? ZYDIS_MAXCHARS_HEX_64 : ZYDIS_MAXCHARS_HEX_32); + for (ZydisI8 i = c - 1; i >= 0; --i) + { + const ZydisU8 v = (value >> i * 4) & 0x0F; + if (!n) + { + if (!v) + { + continue; + } + if (numRemainingBytes <= (ZydisU8)(i + 1)) + { + return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE; + } + if (paddingLength > i) + { + n = paddingLength - i - 1; + ZydisMemorySet(buffer, '0', n); + } + } + if (uppercase) + { + buffer[n++] = "0123456789ABCDEF"[v]; + } else + { + buffer[n++] = "0123456789abcdef"[v]; + } + } + s->length += n; + + if (suffix) + { + ZYDIS_CHECK(ZydisStringAppendC(s, suffix, ZYDIS_LETTER_CASE_DEFAULT)); + } + + return ZYDIS_STATUS_SUCCESS; } /* ---------------------------------------------------------------------------------------------- */ /* Public Functions */ /* ---------------------------------------------------------------------------------------------- */ -ZydisStatus ZydisPrintStr(char** buffer, ZydisUSize bufferLen, const char* text, - ZydisLetterCase letterCase) +ZydisStatus ZydisStringAppend(ZydisString* s, const ZydisString* text, ZydisLetterCase letterCase) { - ZYDIS_ASSERT(buffer); - ZYDIS_ASSERT(bufferLen > 0); + ZYDIS_ASSERT(s); + ZYDIS_ASSERT(s->capacity >= s->length); ZYDIS_ASSERT(text); + ZYDIS_ASSERT(text->capacity >= s->length); - const ZydisUSize strLen = ZydisStrLen(text); - if (strLen >= bufferLen) + if (s->length + text->length >= s->capacity) { return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE; } - ZydisMemoryCopy(*buffer, text, strLen + 1); + ZydisMemoryCopy(s->s + s->length, text->s, text->length); + switch (letterCase) { case ZYDIS_LETTER_CASE_DEFAULT: break; case ZYDIS_LETTER_CASE_LOWER: - ZydisToLowerCase(*buffer, strLen); + ZydisToLowerCase(s->s + s->length, text->length); break; case ZYDIS_LETTER_CASE_UPPER: - ZydisToUpperCase(*buffer, strLen); + ZydisToUpperCase(s->s + s->length, text->length); break; default: ZYDIS_UNREACHABLE; } - *buffer += strLen; + + s->length += text->length; return ZYDIS_STATUS_SUCCESS; } -ZydisStatus ZydisPrintDecU(char** buffer, ZydisUSize bufferLen, ZydisU64 value, ZydisU8 paddingLength) +ZydisStatus ZydisPrintDecU(ZydisString *s, ZydisU64 value, ZydisU8 paddingLength) { #if defined(ZYDIS_X64) || defined(ZYDIS_AARCH64) - return ZydisPrintDecU64(buffer, bufferLen, value, paddingLength); + return ZydisPrintDecU64(s, value, paddingLength); #else if (value & 0xFFFFFFFF00000000) { - return ZydisPrintDecU64(buffer, bufferLen, value, paddingLength); + return ZydisPrintDecU64(s, value, paddingLength); } else { - return ZydisPrintDecU32(buffer, bufferLen, (ZydisU32)value, paddingLength); + return ZydisPrintDecU32(s, (ZydisU32)value, paddingLength); } #endif } -ZydisStatus ZydisPrintDecS(char** buffer, ZydisUSize bufferLen, ZydisI64 value, ZydisU8 paddingLength) +ZydisStatus ZydisPrintDecS(ZydisString *s, ZydisI64 value, ZydisU8 paddingLength) { if (value < 0) { - ZYDIS_CHECK(ZydisPrintStr(buffer, bufferLen, "-", ZYDIS_LETTER_CASE_DEFAULT)); - return ZydisPrintDecU(buffer, bufferLen - 1, -value, paddingLength); + ZYDIS_CHECK(ZydisStringAppendC(s, "-", ZYDIS_LETTER_CASE_DEFAULT)); + return ZydisPrintDecU(s, -value, paddingLength); } - return ZydisPrintDecU(buffer, bufferLen, value, paddingLength); + return ZydisPrintDecU(s, value, paddingLength); } -ZydisStatus ZydisPrintHexU(char** buffer, ZydisUSize bufferLen, ZydisU64 value, ZydisU8 paddingLength, +ZydisStatus ZydisPrintHexU(ZydisString *s, ZydisU64 value, ZydisU8 paddingLength, ZydisBool uppercase, const char* prefix, const char* suffix) { #if defined(ZYDIS_X64) || defined(ZYDIS_AARCH64) - return ZydisPrintHexU64(buffer, bufferLen, value, paddingLength, uppercase, prefix, suffix); + return ZydisPrintHexU64(s, value, paddingLength, uppercase, prefix, suffix); #else if (value & 0xFFFFFFFF00000000) { - return ZydisPrintHexU64(buffer, bufferLen, value, paddingLength, uppercase, prefix, suffix); + return ZydisPrintHexU64(s, value, paddingLength, uppercase, prefix, suffix); } else { - return ZydisPrintHexU32(buffer, bufferLen, (ZydisU32)value, paddingLength, uppercase, - prefix, suffix); + return ZydisPrintHexU32(s, (ZydisU32)value, paddingLength, uppercase, prefix, suffix); } #endif } -ZydisStatus ZydisPrintHexS(char** buffer, ZydisUSize bufferLen, ZydisI64 value, ZydisU8 paddingLength, +ZydisStatus ZydisPrintHexS(ZydisString *s, ZydisI64 value, ZydisU8 paddingLength, ZydisBool uppercase, const char* prefix, const char* suffix) { if (value < 0) { - const char* bufEnd = *buffer + bufferLen; - ZYDIS_CHECK(ZydisPrintStr(buffer, bufferLen, "-", ZYDIS_LETTER_CASE_DEFAULT)); + ZYDIS_CHECK(ZydisStringAppendC(s, "-", ZYDIS_LETTER_CASE_DEFAULT)); if (prefix) { - ZYDIS_CHECK(ZydisPrintStr(buffer, bufEnd - *buffer, prefix, ZYDIS_LETTER_CASE_DEFAULT)); + ZYDIS_CHECK(ZydisStringAppendC(s, prefix, ZYDIS_LETTER_CASE_DEFAULT)); } - return ZydisPrintHexU(buffer, bufEnd - *buffer, -value, paddingLength, uppercase, - ZYDIS_NULL, suffix); + return ZydisPrintHexU(s, -value, paddingLength, uppercase, ZYDIS_NULL, suffix); } - return ZydisPrintHexU(buffer, bufferLen, value, paddingLength, uppercase, prefix, suffix); + return ZydisPrintHexU(s, value, paddingLength, uppercase, prefix, suffix); } /* ---------------------------------------------------------------------------------------------- */ diff --git a/src/FormatHelper.h b/src/FormatHelper.h index 5395cc8..b6133bb 100644 --- a/src/FormatHelper.h +++ b/src/FormatHelper.h @@ -29,6 +29,8 @@ #include #include +#include +#include #ifdef __cplusplus extern "C" { @@ -77,22 +79,44 @@ enum ZydisLetterCases /* ---------------------------------------------------------------------------------------------- */ /** - * @brief Appends the given @c text to the @c buffer. + * @brief Appends the @c ZydisString to another @c ZydisString. * - * @param buffer A pointer to the string-buffer. - * @param bufferLen The length of the string-buffer. + * @param buffer The string to append to. + * @param text The string to append. + * @param letterCase The desired letter-case. + * + * @return @c ZYDIS_STATUS_SUCCESS, if the function succeeded, or + * @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not + * sufficient to append the given @c text. + */ +ZYDIS_NO_EXPORT ZydisStatus ZydisStringAppend( + ZydisString* s, const ZydisString* text, ZydisLetterCase letterCase); + +/** + * @brief Appends the given C string to the @c ZydisString. + * + * @param s The string to append to. * @param text The text to append. * @param letterCase The desired letter-case. * * @return @c ZYDIS_STATUS_SUCCESS, if the function succeeded, or * @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not * sufficient to append the given @c text. - * - * The string-buffer pointer is increased by the number of chars written, if the call was - * successfull. */ -ZYDIS_NO_EXPORT ZydisStatus ZydisPrintStr(char** buffer, ZydisUSize bufferLen, const char* text, - ZydisLetterCase letterCase); +ZYDIS_INLINE ZydisStatus ZydisStringAppendC( + ZydisString* s, const char* text, ZydisLetterCase letterCase) +{ + ZYDIS_ASSERT(text); + + ZydisUSize len = ZydisStrLen(text); + ZydisString zyStr = { + .s = (char*)text, + .length = len, + .capacity = len + }; + + return ZydisStringAppend(s, &zyStr, letterCase); +} /* ---------------------------------------------------------------------------------------------- */ /* Decimal values */ @@ -100,10 +124,9 @@ ZYDIS_NO_EXPORT ZydisStatus ZydisPrintStr(char** buffer, ZydisUSize bufferLen, c /** * @brief Formats the given unsigned ordinal @c value to its decimal text-representation and - * appends it to the @c buffer. + * appends it to @c s. * - * @param buffer A pointer to the string-buffer. - * @param bufferLen The length of the string-buffer. + * @param s A pointer to the string. * @param value The value. * @param paddingLength Padds the converted value with leading zeros, if the number of chars is * less than the @c paddingLength. @@ -115,15 +138,13 @@ ZYDIS_NO_EXPORT ZydisStatus ZydisPrintStr(char** buffer, ZydisUSize bufferLen, c * The string-buffer pointer is increased by the number of chars written, if the call was * successfull. */ -ZYDIS_NO_EXPORT ZydisStatus ZydisPrintDecU(char** buffer, ZydisUSize bufferLen, ZydisU64 value, - ZydisU8 paddingLength); +ZYDIS_NO_EXPORT ZydisStatus ZydisPrintDecU(ZydisString* s, ZydisU64 value, ZydisU8 paddingLength); /** * @brief Formats the given signed ordinal @c value to its decimal text-representation and - * appends it to the @c buffer. + * appends it to @c s. * - * @param buffer A pointer to the string-buffer. - * @param bufferLen The length of the string-buffer. + * @param s A pointer to the string. * @param value The value. * @param paddingLength Padds the converted value with leading zeros, if the number of chars is * less than the @c paddingLength (the sign char is ignored). @@ -135,7 +156,7 @@ ZYDIS_NO_EXPORT ZydisStatus ZydisPrintDecU(char** buffer, ZydisUSize bufferLen, * The string-buffer pointer is increased by the number of chars written, if the call was * successfull. */ -ZYDIS_NO_EXPORT ZydisStatus ZydisPrintDecS(char** buffer, ZydisUSize bufferLen, ZydisI64 value, +ZYDIS_NO_EXPORT ZydisStatus ZydisPrintDecS(ZydisString* s, ZydisI64 value, ZydisU8 paddingLength); /* ---------------------------------------------------------------------------------------------- */ @@ -146,8 +167,7 @@ ZYDIS_NO_EXPORT ZydisStatus ZydisPrintDecS(char** buffer, ZydisUSize bufferLen, * @brief Formats the given unsigned ordinal @c value to its hexadecimal text-representation and * appends it to the @c buffer. * - * @param buffer A pointer to the string-buffer. - * @param bufferLen The length of the string-buffer. + * @param s A pointer to the string. * @param value The value. * @param paddingLength Padds the converted value with leading zeros, if the number of chars is * less than the @c paddingLength. @@ -163,15 +183,14 @@ ZYDIS_NO_EXPORT ZydisStatus ZydisPrintDecS(char** buffer, ZydisUSize bufferLen, * The string-buffer pointer is increased by the number of chars written, if the call was * successfull. */ -ZYDIS_NO_EXPORT ZydisStatus ZydisPrintHexU(char** buffer, ZydisUSize bufferLen, ZydisU64 value, +ZYDIS_NO_EXPORT ZydisStatus ZydisPrintHexU(ZydisString* s, ZydisU64 value, ZydisU8 paddingLength, ZydisBool uppercase, const char* prefix, const char* suffix); /** * @brief Formats the given signed ordinal @c value to its hexadecimal text-representation and * appends it to the @c buffer. * - * @param buffer A pointer to the string-buffer. - * @param bufferLen The length of the string-buffer. + * @param s A pointer to the string. * @param value The value. * @param paddingLength Padds the converted value with leading zeros, if the number of chars is * less than the @c paddingLength (the sign char is ignored). @@ -187,7 +206,7 @@ ZYDIS_NO_EXPORT ZydisStatus ZydisPrintHexU(char** buffer, ZydisUSize bufferLen, * The string-buffer pointer is increased by the number of chars written, if the call was * successfull. */ -ZYDIS_NO_EXPORT ZydisStatus ZydisPrintHexS(char** buffer, ZydisUSize bufferLen, ZydisI64 value, +ZYDIS_NO_EXPORT ZydisStatus ZydisPrintHexS(ZydisString* s, ZydisI64 value, ZydisU8 paddingLength, ZydisBool uppercase, const char* prefix, const char* suffix); /* ---------------------------------------------------------------------------------------------- */ diff --git a/src/Formatter.c b/src/Formatter.c index 75e9454..c719b0e 100644 --- a/src/Formatter.c +++ b/src/Formatter.c @@ -39,72 +39,70 @@ /* ---------------------------------------------------------------------------------------------- */ static ZydisStatus ZydisFormatterPrintPrefixesIntel(const ZydisFormatter* formatter, - char** buffer, ZydisUSize bufferLen, const ZydisDecodedInstruction* instruction, void* userData) + ZydisString* buffer, const ZydisDecodedInstruction* instruction, void* userData) { (void)userData; - if (!formatter || !buffer || !*buffer || (bufferLen <= 0) || !instruction) + if (!formatter || !buffer || !instruction) { return ZYDIS_STATUS_INVALID_PARAMETER; } if (instruction->attributes & ZYDIS_ATTRIB_HAS_LOCK) { - return ZydisPrintStr(buffer, bufferLen, "lock ", formatter->letterCase); + return ZydisStringAppendC(buffer, "lock ", formatter->letterCase); } if (instruction->attributes & ZYDIS_ATTRIB_HAS_REP) { - return ZydisPrintStr(buffer, bufferLen, "rep ", formatter->letterCase); + return ZydisStringAppendC(buffer, "rep ", formatter->letterCase); } if (instruction->attributes & ZYDIS_ATTRIB_HAS_REPE) { - return ZydisPrintStr(buffer, bufferLen, "repe ", formatter->letterCase); + return ZydisStringAppendC(buffer, "repe ", formatter->letterCase); } if (instruction->attributes & ZYDIS_ATTRIB_HAS_REPNE) { - return ZydisPrintStr(buffer, bufferLen, "repne ", formatter->letterCase); + return ZydisStringAppendC(buffer, "repne ", formatter->letterCase); } if (instruction->attributes & ZYDIS_ATTRIB_HAS_BOUND) { - return ZydisPrintStr(buffer, bufferLen, "bnd ", formatter->letterCase); + return ZydisStringAppendC(buffer, "bnd ", formatter->letterCase); } if (instruction->attributes & ZYDIS_ATTRIB_HAS_XACQUIRE) { - return ZydisPrintStr(buffer, bufferLen, "xacquire ", formatter->letterCase); + return ZydisStringAppendC(buffer, "xacquire ", formatter->letterCase); } if (instruction->attributes & ZYDIS_ATTRIB_HAS_XRELEASE) { - return ZydisPrintStr(buffer, bufferLen, "xrelease ", formatter->letterCase); + return ZydisStringAppendC(buffer, "xrelease ", formatter->letterCase); } return ZYDIS_STATUS_SUCCESS; } static ZydisStatus ZydisFormatterPrintMnemonicIntel(const ZydisFormatter* formatter, - char** buffer, ZydisUSize bufferLen, const ZydisDecodedInstruction* instruction, void* userData) + ZydisString* buffer, const ZydisDecodedInstruction* instruction, void* userData) { (void)userData; - if (!formatter || !buffer || !*buffer || (bufferLen <= 0) || !instruction) + if (!formatter || !buffer || !instruction) { return ZYDIS_STATUS_INVALID_PARAMETER; } - const char* bufEnd = *buffer + bufferLen; - const char* mnemonic = ZydisMnemonicGetString(instruction->mnemonic); if (!mnemonic) { mnemonic = "invalid"; } - ZYDIS_CHECK(ZydisPrintStr(buffer, bufferLen, mnemonic, formatter->letterCase)); + ZYDIS_CHECK(ZydisStringAppendC(buffer, mnemonic, formatter->letterCase)); if (instruction->attributes & ZYDIS_ATTRIB_IS_FAR_BRANCH) { - return ZydisPrintStr(buffer, bufEnd - *buffer, " far", formatter->letterCase); + return ZydisStringAppendC(buffer, " far", formatter->letterCase); } return ZYDIS_STATUS_SUCCESS; @@ -113,12 +111,12 @@ static ZydisStatus ZydisFormatterPrintMnemonicIntel(const ZydisFormatter* format /* ---------------------------------------------------------------------------------------------- */ static ZydisStatus ZydisFormatterFormatOperandRegIntel(const ZydisFormatter* formatter, - char** buffer, ZydisUSize bufferLen, const ZydisDecodedInstruction* instruction, + ZydisString* buffer, const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, void* userData) { (void)userData; - if (!formatter || !buffer || !*buffer || (bufferLen <= 0) || !instruction || !operand) + if (!formatter || !buffer || !instruction || !operand) { return ZYDIS_STATUS_INVALID_PARAMETER; } @@ -133,21 +131,20 @@ static ZydisStatus ZydisFormatterFormatOperandRegIntel(const ZydisFormatter* for { reg = "invalid"; } - return ZydisPrintStr(buffer, bufferLen, reg, formatter->letterCase); + + return ZydisStringAppendC(buffer, reg, formatter->letterCase); } static ZydisStatus ZydisFormatterFormatOperandMemIntel(const ZydisFormatter* formatter, - char** buffer, ZydisUSize bufferLen, const ZydisDecodedInstruction* instruction, + ZydisString* buffer, const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, void* userData) { - if (!formatter || !buffer || !*buffer || (bufferLen <= 0) || !instruction || !operand) + if (!formatter || !buffer || !instruction || !operand) { return ZYDIS_STATUS_INVALID_PARAMETER; } - const char* bufEnd = *buffer + bufferLen; - - ZYDIS_CHECK(ZydisPrintStr(buffer, bufEnd - *buffer, "[", ZYDIS_LETTER_CASE_DEFAULT)); + ZYDIS_CHECK(ZydisStringAppendC(buffer, "[", ZYDIS_LETTER_CASE_DEFAULT)); if (operand->mem.disp.hasDisplacement && ( (operand->mem.base == ZYDIS_REGISTER_NONE) || @@ -161,14 +158,14 @@ static ZydisStatus ZydisFormatterFormatOperandMemIntel(const ZydisFormatter* for { ZydisU64 address; ZYDIS_CHECK(ZydisCalcAbsoluteAddress(instruction, operand, &address)); - ZYDIS_CHECK(formatter->funcPrintAddress(formatter, buffer, bufEnd - *buffer, - instruction, operand, address, userData)); + ZYDIS_CHECK(formatter->funcPrintAddress(formatter, buffer, instruction, operand, + address, userData)); } else { - ZYDIS_CHECK(ZydisPrintStr(buffer, bufEnd - *buffer, - ZydisRegisterGetString(operand->mem.base), formatter->letterCase)); - ZYDIS_CHECK(formatter->funcPrintDisplacement(formatter, buffer, bufEnd - *buffer, - instruction, operand, userData)); + ZYDIS_CHECK(ZydisStringAppendC(buffer, ZydisRegisterGetString(operand->mem.base), + formatter->letterCase)); + ZYDIS_CHECK(formatter->funcPrintDisplacement(formatter, buffer, instruction, operand, + userData)); } } else { @@ -180,7 +177,7 @@ static ZydisStatus ZydisFormatterFormatOperandMemIntel(const ZydisFormatter* for { return ZYDIS_STATUS_INVALID_PARAMETER; } - ZYDIS_CHECK(ZydisPrintStr(buffer, bufEnd - *buffer, reg, formatter->letterCase)); + ZYDIS_CHECK(ZydisStringAppendC(buffer, reg, formatter->letterCase)); } if ((operand->mem.index != ZYDIS_REGISTER_NONE) && (operand->mem.type != ZYDIS_MEMOP_TYPE_MIB)) @@ -193,47 +190,46 @@ static ZydisStatus ZydisFormatterFormatOperandMemIntel(const ZydisFormatter* for if (operand->mem.base != ZYDIS_REGISTER_NONE) { ZYDIS_CHECK( - ZydisPrintStr(buffer, bufEnd - *buffer, "+", ZYDIS_LETTER_CASE_DEFAULT)); + ZydisStringAppendC(buffer, "+", ZYDIS_LETTER_CASE_DEFAULT)); } - ZYDIS_CHECK(ZydisPrintStr(buffer, bufEnd - *buffer, reg, formatter->letterCase)); + ZYDIS_CHECK(ZydisStringAppendC(buffer, reg, formatter->letterCase)); if (operand->mem.scale) { ZYDIS_CHECK( - ZydisPrintStr(buffer, bufEnd - *buffer, "*", ZYDIS_LETTER_CASE_DEFAULT)); - ZYDIS_CHECK(ZydisPrintDecU(buffer, bufEnd - *buffer, operand->mem.scale, 0)); + ZydisStringAppendC(buffer, "*", ZYDIS_LETTER_CASE_DEFAULT)); + ZYDIS_CHECK(ZydisPrintDecU(buffer, operand->mem.scale, 0)); } } - ZYDIS_CHECK(formatter->funcPrintDisplacement(formatter, buffer, bufEnd - *buffer, + ZYDIS_CHECK(formatter->funcPrintDisplacement(formatter, buffer, instruction, operand, userData)); } - return ZydisPrintStr(buffer, bufEnd - *buffer, "]", ZYDIS_LETTER_CASE_DEFAULT); + return ZydisStringAppendC(buffer, "]", ZYDIS_LETTER_CASE_DEFAULT); } static ZydisStatus ZydisFormatterFormatOperandPtrIntel(const ZydisFormatter* formatter, - char** buffer, ZydisUSize bufferLen, const ZydisDecodedInstruction* instruction, + ZydisString* buffer, const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, void* userData) { (void)userData; - if (!formatter || !buffer || !*buffer || (bufferLen <= 0) || !instruction || !operand) + if (!formatter || !buffer || !instruction || !operand) { return ZYDIS_STATUS_INVALID_PARAMETER; } - const char* bufEnd = *buffer + bufferLen; - ZYDIS_CHECK(ZydisPrintHexU(buffer, bufEnd - *buffer, operand->ptr.segment, 4, + ZYDIS_CHECK(ZydisPrintHexU(buffer, operand->ptr.segment, 4, formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix)); - ZYDIS_CHECK(ZydisPrintStr(buffer, bufEnd - *buffer, ":", ZYDIS_LETTER_CASE_DEFAULT)); - return ZydisPrintHexU(buffer, bufEnd - *buffer, operand->ptr.offset, 8, + ZYDIS_CHECK(ZydisStringAppendC(buffer, ":", ZYDIS_LETTER_CASE_DEFAULT)); + return ZydisPrintHexU(buffer, operand->ptr.offset, 8, formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); } static ZydisStatus ZydisFormatterFormatOperandImmIntel(const ZydisFormatter* formatter, - char** buffer, ZydisUSize bufferLen, const ZydisDecodedInstruction* instruction, + ZydisString* buffer, const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, void* userData) { - if (!formatter || !buffer || !*buffer || (bufferLen <= 0) || !instruction || !operand) + if (!formatter || !buffer || !instruction || !operand) { return ZYDIS_STATUS_INVALID_PARAMETER; } @@ -248,7 +244,7 @@ static ZydisStatus ZydisFormatterFormatOperandImmIntel(const ZydisFormatter* for { ZydisU64 address; ZYDIS_CHECK(ZydisCalcAbsoluteAddress(instruction, operand, &address)); - return formatter->funcPrintAddress(formatter, buffer, bufferLen, instruction, operand, + return formatter->funcPrintAddress(formatter, buffer, instruction, operand, address, userData); } case ZYDIS_ADDR_FORMAT_RELATIVE_SIGNED: @@ -262,29 +258,29 @@ static ZydisStatus ZydisFormatterFormatOperandImmIntel(const ZydisFormatter* for if (printSignedHEX) { - return ZydisPrintHexS(buffer, bufferLen, (ZydisI32)operand->imm.value.s, + return ZydisPrintHexS(buffer, (ZydisI32)operand->imm.value.s, formatter->hexPaddingAddress, formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); } - return ZydisPrintHexU(buffer, bufferLen, operand->imm.value.u, + return ZydisPrintHexU(buffer, operand->imm.value.u, formatter->hexPaddingAddress, formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); } // The immediate operand contains an actual ordinal value return formatter->funcPrintImmediate( - formatter, buffer, bufferLen, instruction, operand, userData); + formatter, buffer, instruction, operand, userData); } /* ---------------------------------------------------------------------------------------------- */ static ZydisStatus ZydisFormatterPrintAddressIntel(const ZydisFormatter* formatter, - char** buffer, ZydisUSize bufferLen, const ZydisDecodedInstruction* instruction, + ZydisString* buffer, const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, ZydisU64 address, void* userData) { (void)userData; - if (!formatter || !buffer || !*buffer || (bufferLen <= 0) || !instruction || !operand) + if (!formatter || !buffer || !instruction || !operand) { return ZYDIS_STATUS_INVALID_PARAMETER; } @@ -292,13 +288,13 @@ static ZydisStatus ZydisFormatterPrintAddressIntel(const ZydisFormatter* formatt switch (instruction->stackWidth) { case 16: - return ZydisPrintHexU(buffer, bufferLen, (ZydisU16)address, 4, + return ZydisPrintHexU(buffer, (ZydisU16)address, 4, formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); case 32: - return ZydisPrintHexU(buffer, bufferLen, (ZydisU32)address, 8, + return ZydisPrintHexU(buffer, (ZydisU32)address, 8, formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); case 64: - return ZydisPrintHexU(buffer, bufferLen, address, 16, + return ZydisPrintHexU(buffer, address, 16, formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); default: return ZYDIS_STATUS_INVALID_PARAMETER; @@ -306,12 +302,12 @@ static ZydisStatus ZydisFormatterPrintAddressIntel(const ZydisFormatter* formatt } static ZydisStatus ZydisFormatterPrintDisplacementIntel(const ZydisFormatter* formatter, - char** buffer, ZydisUSize bufferLen, const ZydisDecodedInstruction* instruction, + ZydisString* buffer, const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, void* userData) { (void)userData; - if (!formatter || !buffer || !*buffer || (bufferLen <= 0) || !instruction || !operand) + if (!formatter || !buffer || !instruction || !operand) { return ZYDIS_STATUS_INVALID_PARAMETER; } @@ -326,17 +322,16 @@ static ZydisStatus ZydisFormatterPrintDisplacementIntel(const ZydisFormatter* fo (operand->mem.base != ZYDIS_REGISTER_NONE) || (operand->mem.index != ZYDIS_REGISTER_NONE))) { - return ZydisPrintHexS(buffer, bufferLen, operand->mem.disp.value, + return ZydisPrintHexS(buffer, operand->mem.disp.value, formatter->hexPaddingDisplacement, formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); } - const char* bufEnd = *buffer + bufferLen; if ((operand->mem.base != ZYDIS_REGISTER_NONE) || (operand->mem.index != ZYDIS_REGISTER_NONE)) { - ZYDIS_CHECK(ZydisPrintStr(buffer, bufferLen, "+", ZYDIS_LETTER_CASE_DEFAULT)); + ZYDIS_CHECK(ZydisStringAppendC(buffer, "+", ZYDIS_LETTER_CASE_DEFAULT)); } - return ZydisPrintHexU(buffer, bufEnd - *buffer, (ZydisU64)operand->mem.disp.value, + return ZydisPrintHexU(buffer, (ZydisU64)operand->mem.disp.value, formatter->hexPaddingDisplacement, formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); } @@ -344,12 +339,12 @@ static ZydisStatus ZydisFormatterPrintDisplacementIntel(const ZydisFormatter* fo } static ZydisStatus ZydisFormatterPrintImmediateIntel(const ZydisFormatter* formatter, - char** buffer, ZydisUSize bufferLen, const ZydisDecodedInstruction* instruction, + ZydisString* buffer, const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, void* userData) { (void)userData; - if (!formatter || !buffer || !*buffer || (bufferLen <= 0) || !instruction || !operand) + if (!formatter || !buffer || !instruction || !operand) { return ZYDIS_STATUS_INVALID_PARAMETER; } @@ -365,19 +360,19 @@ static ZydisStatus ZydisFormatterPrintImmediateIntel(const ZydisFormatter* forma switch (operand->size) { case 8: - return ZydisPrintHexS(buffer, bufferLen, (ZydisI8)operand->imm.value.s, + return ZydisPrintHexS(buffer, (ZydisI8)operand->imm.value.s, formatter->hexPaddingImmediate, formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); case 16: - return ZydisPrintHexS(buffer, bufferLen, (ZydisI16)operand->imm.value.s, + return ZydisPrintHexS(buffer, (ZydisI16)operand->imm.value.s, formatter->hexPaddingImmediate, formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); case 32: - return ZydisPrintHexS(buffer, bufferLen, (ZydisI32)operand->imm.value.s, + return ZydisPrintHexS(buffer, (ZydisI32)operand->imm.value.s, formatter->hexPaddingImmediate, formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); case 64: - return ZydisPrintHexS(buffer, bufferLen, operand->imm.value.s, + return ZydisPrintHexS(buffer, operand->imm.value.s, formatter->hexPaddingImmediate, formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); default: @@ -387,19 +382,19 @@ static ZydisStatus ZydisFormatterPrintImmediateIntel(const ZydisFormatter* forma switch (instruction->operandWidth) { case 8: - return ZydisPrintHexU(buffer, bufferLen, (ZydisU8)operand->imm.value.u, + return ZydisPrintHexU(buffer, (ZydisU8)operand->imm.value.u, formatter->hexPaddingImmediate, formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); case 16: - return ZydisPrintHexU(buffer, bufferLen, (ZydisU16)operand->imm.value.u, + return ZydisPrintHexU(buffer, (ZydisU16)operand->imm.value.u, formatter->hexPaddingImmediate, formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); case 32: - return ZydisPrintHexU(buffer, bufferLen, (ZydisU32)operand->imm.value.u, + return ZydisPrintHexU(buffer, (ZydisU32)operand->imm.value.u, formatter->hexPaddingImmediate, formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); case 64: - return ZydisPrintHexU(buffer, bufferLen, operand->imm.value.u, + return ZydisPrintHexU(buffer, operand->imm.value.u, formatter->hexPaddingImmediate, formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); default: @@ -410,12 +405,12 @@ static ZydisStatus ZydisFormatterPrintImmediateIntel(const ZydisFormatter* forma /* ---------------------------------------------------------------------------------------------- */ static ZydisStatus ZydisFormatterPrintOperandSizeIntel(const ZydisFormatter* formatter, - char** buffer, ZydisUSize bufferLen, const ZydisDecodedInstruction* instruction, + ZydisString* buffer, const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, void* userData) { (void)userData; - if (!formatter || !buffer || !*buffer || (bufferLen <= 0) || !instruction || !operand) + if (!formatter || !buffer || !instruction || !operand) { return ZYDIS_STATUS_INVALID_PARAMETER; } @@ -510,24 +505,23 @@ static ZydisStatus ZydisFormatterPrintOperandSizeIntel(const ZydisFormatter* for if (str) { - return ZydisPrintStr(buffer, bufferLen, str, formatter->letterCase); + return ZydisStringAppendC(buffer, str, formatter->letterCase); } } return ZYDIS_STATUS_SUCCESS; } static ZydisStatus ZydisFormatterPrintSegmentIntel(const ZydisFormatter* formatter, - char** buffer, ZydisUSize bufferLen, const ZydisDecodedInstruction* instruction, + ZydisString* buffer, const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, void* userData) { (void)userData; - if (!formatter || !buffer || !*buffer || (bufferLen <= 0) || !instruction || !operand) + if (!formatter || !buffer || !instruction || !operand) { return ZYDIS_STATUS_INVALID_PARAMETER; } - const char* bufEnd = *buffer + bufferLen; switch (operand->mem.segment) { case ZYDIS_REGISTER_ES: @@ -535,17 +529,17 @@ static ZydisStatus ZydisFormatterPrintSegmentIntel(const ZydisFormatter* formatt case ZYDIS_REGISTER_FS: case ZYDIS_REGISTER_GS: ZYDIS_CHECK( - ZydisPrintStr(buffer, bufEnd - *buffer, - ZydisRegisterGetString(operand->mem.segment), formatter->letterCase)); - return ZydisPrintStr(buffer, bufEnd - *buffer, ":", ZYDIS_LETTER_CASE_DEFAULT); + ZydisStringAppendC(buffer, ZydisRegisterGetString(operand->mem.segment), + formatter->letterCase)); + return ZydisStringAppendC(buffer, ":", ZYDIS_LETTER_CASE_DEFAULT); case ZYDIS_REGISTER_SS: if ((formatter->forceSegments) || (instruction->attributes & ZYDIS_ATTRIB_HAS_SEGMENT_SS)) { ZYDIS_CHECK( - ZydisPrintStr(buffer, bufEnd - *buffer, - ZydisRegisterGetString(operand->mem.segment), formatter->letterCase)); - return ZydisPrintStr(buffer, bufEnd - *buffer, ":", ZYDIS_LETTER_CASE_DEFAULT); + ZydisStringAppendC(buffer, ZydisRegisterGetString(operand->mem.segment), + formatter->letterCase)); + return ZydisStringAppendC(buffer, ":", ZYDIS_LETTER_CASE_DEFAULT); } break; case ZYDIS_REGISTER_DS: @@ -553,9 +547,9 @@ static ZydisStatus ZydisFormatterPrintSegmentIntel(const ZydisFormatter* formatt (instruction->attributes & ZYDIS_ATTRIB_HAS_SEGMENT_DS)) { ZYDIS_CHECK( - ZydisPrintStr(buffer, bufEnd - *buffer, - ZydisRegisterGetString(operand->mem.segment), formatter->letterCase)); - return ZydisPrintStr(buffer, bufEnd - *buffer, ":", ZYDIS_LETTER_CASE_DEFAULT); + ZydisStringAppendC(buffer, ZydisRegisterGetString(operand->mem.segment), + formatter->letterCase)); + return ZydisStringAppendC(buffer, ":", ZYDIS_LETTER_CASE_DEFAULT); } break; default: @@ -565,17 +559,16 @@ static ZydisStatus ZydisFormatterPrintSegmentIntel(const ZydisFormatter* formatt } static ZydisStatus ZydisFormatterPrintDecoratorIntel(const ZydisFormatter* formatter, - char** buffer, ZydisUSize bufferLen, const ZydisDecodedInstruction* instruction, + ZydisString* buffer, const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, ZydisDecoratorType type, void* userData) { (void)userData; - if (!formatter || !buffer || !*buffer || (bufferLen <= 0) || !instruction || !operand) + if (!formatter || !buffer || !instruction || !operand) { return ZYDIS_STATUS_INVALID_PARAMETER; } - const char* bufEnd = *buffer + bufferLen; switch (type) { case ZYDIS_DECORATOR_TYPE_MASK: @@ -587,13 +580,13 @@ static ZydisStatus ZydisFormatterPrintDecoratorIntel(const ZydisFormatter* forma { return ZYDIS_STATUS_INVALID_PARAMETER; } - ZYDIS_CHECK(ZydisPrintStr(buffer, bufEnd - *buffer, " {", ZYDIS_LETTER_CASE_DEFAULT)); - ZYDIS_CHECK(ZydisPrintStr(buffer, bufEnd - *buffer, reg, formatter->letterCase)); - ZYDIS_CHECK(ZydisPrintStr(buffer, bufEnd - *buffer, "}", ZYDIS_LETTER_CASE_DEFAULT)); + ZYDIS_CHECK(ZydisStringAppendC(buffer, " {", ZYDIS_LETTER_CASE_DEFAULT)); + ZYDIS_CHECK(ZydisStringAppendC(buffer, reg, formatter->letterCase)); + ZYDIS_CHECK(ZydisStringAppendC(buffer, "}", ZYDIS_LETTER_CASE_DEFAULT)); if (instruction->avx.mask.mode == ZYDIS_MASK_MODE_ZERO) { ZYDIS_CHECK( - ZydisPrintStr(buffer, bufEnd - *buffer, " {z}", ZYDIS_LETTER_CASE_DEFAULT)); + ZydisStringAppendC(buffer, " {z}", ZYDIS_LETTER_CASE_DEFAULT)); } } break; @@ -607,27 +600,27 @@ static ZydisStatus ZydisFormatterPrintDecoratorIntel(const ZydisFormatter* forma break; case ZYDIS_BROADCAST_MODE_1_TO_2: ZYDIS_CHECK( - ZydisPrintStr(buffer, bufEnd - *buffer, " {1to2}", ZYDIS_LETTER_CASE_DEFAULT)); + ZydisStringAppendC(buffer, " {1to2}", ZYDIS_LETTER_CASE_DEFAULT)); break; case ZYDIS_BROADCAST_MODE_1_TO_4: ZYDIS_CHECK( - ZydisPrintStr(buffer, bufEnd - *buffer, " {1to4}", ZYDIS_LETTER_CASE_DEFAULT)); + ZydisStringAppendC(buffer, " {1to4}", ZYDIS_LETTER_CASE_DEFAULT)); break; case ZYDIS_BROADCAST_MODE_1_TO_8: ZYDIS_CHECK( - ZydisPrintStr(buffer, bufEnd - *buffer, " {1to8}", ZYDIS_LETTER_CASE_DEFAULT)); + ZydisStringAppendC(buffer, " {1to8}", ZYDIS_LETTER_CASE_DEFAULT)); break; case ZYDIS_BROADCAST_MODE_1_TO_16: ZYDIS_CHECK( - ZydisPrintStr(buffer, bufEnd - *buffer, " {1to16}", ZYDIS_LETTER_CASE_DEFAULT)); + ZydisStringAppendC(buffer, " {1to16}", ZYDIS_LETTER_CASE_DEFAULT)); break; case ZYDIS_BROADCAST_MODE_4_TO_8: ZYDIS_CHECK( - ZydisPrintStr(buffer, bufEnd - *buffer, " {4to8}", ZYDIS_LETTER_CASE_DEFAULT)); + ZydisStringAppendC(buffer, " {4to8}", ZYDIS_LETTER_CASE_DEFAULT)); break; case ZYDIS_BROADCAST_MODE_4_TO_16: ZYDIS_CHECK( - ZydisPrintStr(buffer, bufEnd - *buffer, " {4to16}", ZYDIS_LETTER_CASE_DEFAULT)); + ZydisStringAppendC(buffer, " {4to16}", ZYDIS_LETTER_CASE_DEFAULT)); break; default: return ZYDIS_STATUS_INVALID_PARAMETER; @@ -642,20 +635,20 @@ static ZydisStatus ZydisFormatterPrintDecoratorIntel(const ZydisFormatter* forma case ZYDIS_ROUNDING_MODE_INVALID: break; case ZYDIS_ROUNDING_MODE_RN: - ZYDIS_CHECK(ZydisPrintStr( - buffer, bufEnd - *buffer, " {rn-sae}", ZYDIS_LETTER_CASE_DEFAULT)); + ZYDIS_CHECK(ZydisStringAppendC( + buffer, " {rn-sae}", ZYDIS_LETTER_CASE_DEFAULT)); break; case ZYDIS_ROUNDING_MODE_RD: - ZYDIS_CHECK(ZydisPrintStr( - buffer, bufEnd - *buffer, " {rd-sae}", ZYDIS_LETTER_CASE_DEFAULT)); + ZYDIS_CHECK(ZydisStringAppendC( + buffer, " {rd-sae}", ZYDIS_LETTER_CASE_DEFAULT)); break; case ZYDIS_ROUNDING_MODE_RU: - ZYDIS_CHECK(ZydisPrintStr( - buffer, bufEnd - *buffer, " {ru-sae}", ZYDIS_LETTER_CASE_DEFAULT)); + ZYDIS_CHECK(ZydisStringAppendC( + buffer, " {ru-sae}", ZYDIS_LETTER_CASE_DEFAULT)); break; case ZYDIS_ROUNDING_MODE_RZ: - ZYDIS_CHECK(ZydisPrintStr( - buffer, bufEnd - *buffer, " {rz-sae}", ZYDIS_LETTER_CASE_DEFAULT)); + ZYDIS_CHECK(ZydisStringAppendC( + buffer, " {rz-sae}", ZYDIS_LETTER_CASE_DEFAULT)); break; default: return ZYDIS_STATUS_INVALID_PARAMETER; @@ -668,19 +661,19 @@ static ZydisStatus ZydisFormatterPrintDecoratorIntel(const ZydisFormatter* forma break; case ZYDIS_ROUNDING_MODE_RN: ZYDIS_CHECK( - ZydisPrintStr(buffer, bufEnd - *buffer, " {rn}", ZYDIS_LETTER_CASE_DEFAULT)); + ZydisStringAppendC(buffer, " {rn}", ZYDIS_LETTER_CASE_DEFAULT)); break; case ZYDIS_ROUNDING_MODE_RD: ZYDIS_CHECK( - ZydisPrintStr(buffer, bufEnd - *buffer, " {rd}", ZYDIS_LETTER_CASE_DEFAULT)); + ZydisStringAppendC(buffer, " {rd}", ZYDIS_LETTER_CASE_DEFAULT)); break; case ZYDIS_ROUNDING_MODE_RU: ZYDIS_CHECK( - ZydisPrintStr(buffer, bufEnd - *buffer, " {ru}", ZYDIS_LETTER_CASE_DEFAULT)); + ZydisStringAppendC(buffer, " {ru}", ZYDIS_LETTER_CASE_DEFAULT)); break; case ZYDIS_ROUNDING_MODE_RZ: ZYDIS_CHECK( - ZydisPrintStr(buffer, bufEnd - *buffer, " {rz}", ZYDIS_LETTER_CASE_DEFAULT)); + ZydisStringAppendC(buffer, " {rz}", ZYDIS_LETTER_CASE_DEFAULT)); break; default: return ZYDIS_STATUS_INVALID_PARAMETER; @@ -691,7 +684,7 @@ static ZydisStatus ZydisFormatterPrintDecoratorIntel(const ZydisFormatter* forma if (instruction->avx.hasSAE && !instruction->avx.rounding.mode) { ZYDIS_CHECK( - ZydisPrintStr(buffer, bufEnd - *buffer, " {sae}", ZYDIS_LETTER_CASE_DEFAULT)); + ZydisStringAppendC(buffer, " {sae}", ZYDIS_LETTER_CASE_DEFAULT)); } break; case ZYDIS_DECORATOR_TYPE_SWIZZLE: @@ -703,31 +696,31 @@ static ZydisStatus ZydisFormatterPrintDecoratorIntel(const ZydisFormatter* forma break; case ZYDIS_SWIZZLE_MODE_CDAB: ZYDIS_CHECK( - ZydisPrintStr(buffer, bufEnd - *buffer, " {cdab}", ZYDIS_LETTER_CASE_DEFAULT)); + ZydisStringAppendC(buffer, " {cdab}", ZYDIS_LETTER_CASE_DEFAULT)); break; case ZYDIS_SWIZZLE_MODE_BADC: ZYDIS_CHECK( - ZydisPrintStr(buffer, bufEnd - *buffer, " {badc}", ZYDIS_LETTER_CASE_DEFAULT)); + ZydisStringAppendC(buffer, " {badc}", ZYDIS_LETTER_CASE_DEFAULT)); break; case ZYDIS_SWIZZLE_MODE_DACB: ZYDIS_CHECK( - ZydisPrintStr(buffer, bufEnd - *buffer, " {dacb}", ZYDIS_LETTER_CASE_DEFAULT)); + ZydisStringAppendC(buffer, " {dacb}", ZYDIS_LETTER_CASE_DEFAULT)); break; case ZYDIS_SWIZZLE_MODE_AAAA: ZYDIS_CHECK( - ZydisPrintStr(buffer, bufEnd - *buffer, " {aaaa}", ZYDIS_LETTER_CASE_DEFAULT)); + ZydisStringAppendC(buffer, " {aaaa}", ZYDIS_LETTER_CASE_DEFAULT)); break; case ZYDIS_SWIZZLE_MODE_BBBB: ZYDIS_CHECK( - ZydisPrintStr(buffer, bufEnd - *buffer, " {bbbb}", ZYDIS_LETTER_CASE_DEFAULT)); + ZydisStringAppendC(buffer, " {bbbb}", ZYDIS_LETTER_CASE_DEFAULT)); break; case ZYDIS_SWIZZLE_MODE_CCCC: ZYDIS_CHECK( - ZydisPrintStr(buffer, bufEnd - *buffer, " {cccc}", ZYDIS_LETTER_CASE_DEFAULT)); + ZydisStringAppendC(buffer, " {cccc}", ZYDIS_LETTER_CASE_DEFAULT)); break; case ZYDIS_SWIZZLE_MODE_DDDD: ZYDIS_CHECK( - ZydisPrintStr(buffer, bufEnd - *buffer, " {dddd}", ZYDIS_LETTER_CASE_DEFAULT)); + ZydisStringAppendC(buffer, " {dddd}", ZYDIS_LETTER_CASE_DEFAULT)); break; default: return ZYDIS_STATUS_INVALID_PARAMETER; @@ -740,23 +733,23 @@ static ZydisStatus ZydisFormatterPrintDecoratorIntel(const ZydisFormatter* forma break; case ZYDIS_CONVERSION_MODE_FLOAT16: ZYDIS_CHECK( - ZydisPrintStr(buffer, bufEnd - *buffer, " {float16}", ZYDIS_LETTER_CASE_DEFAULT)); + ZydisStringAppendC(buffer, " {float16}", ZYDIS_LETTER_CASE_DEFAULT)); break; case ZYDIS_CONVERSION_MODE_SINT8: ZYDIS_CHECK( - ZydisPrintStr(buffer, bufEnd - *buffer, " {sint8}", ZYDIS_LETTER_CASE_DEFAULT)); + ZydisStringAppendC(buffer, " {sint8}", ZYDIS_LETTER_CASE_DEFAULT)); break; case ZYDIS_CONVERSION_MODE_UINT8: ZYDIS_CHECK( - ZydisPrintStr(buffer, bufEnd - *buffer, " {uint8}", ZYDIS_LETTER_CASE_DEFAULT)); + ZydisStringAppendC(buffer, " {uint8}", ZYDIS_LETTER_CASE_DEFAULT)); break; case ZYDIS_CONVERSION_MODE_SINT16: ZYDIS_CHECK( - ZydisPrintStr(buffer, bufEnd - *buffer, " {sint16}", ZYDIS_LETTER_CASE_DEFAULT)); + ZydisStringAppendC(buffer, " {sint16}", ZYDIS_LETTER_CASE_DEFAULT)); break; case ZYDIS_CONVERSION_MODE_UINT16: ZYDIS_CHECK( - ZydisPrintStr(buffer, bufEnd - *buffer, " {uint16}", ZYDIS_LETTER_CASE_DEFAULT)); + ZydisStringAppendC(buffer, " {uint16}", ZYDIS_LETTER_CASE_DEFAULT)); break; default: return ZYDIS_STATUS_INVALID_PARAMETER; @@ -766,7 +759,7 @@ static ZydisStatus ZydisFormatterPrintDecoratorIntel(const ZydisFormatter* forma if (instruction->avx.hasEvictionHint) { ZYDIS_CHECK( - ZydisPrintStr(buffer, bufEnd - *buffer, " {eh}", ZYDIS_LETTER_CASE_DEFAULT)); + ZydisStringAppendC(buffer, " {eh}", ZYDIS_LETTER_CASE_DEFAULT)); } break; default: @@ -777,20 +770,19 @@ static ZydisStatus ZydisFormatterPrintDecoratorIntel(const ZydisFormatter* forma } static ZydisStatus ZydisFormatterFormatInstrIntel(const ZydisFormatter* formatter, - char** buffer, ZydisUSize bufferLen, const ZydisDecodedInstruction* instruction, void* userData) + ZydisString* buffer, const ZydisDecodedInstruction* instruction, void* userData) { - if (!formatter || !buffer || !*buffer || (bufferLen <= 0) || !instruction) + if (!formatter || !buffer || !instruction) { return ZYDIS_STATUS_INVALID_PARAMETER; } - const char* bufEnd = *buffer + bufferLen; ZYDIS_CHECK( - formatter->funcPrintPrefixes(formatter, buffer, bufEnd - *buffer, instruction, userData)); + formatter->funcPrintPrefixes(formatter, buffer, instruction, userData)); ZYDIS_CHECK( - formatter->funcPrintMnemonic(formatter, buffer, bufEnd - *buffer, instruction, userData)); + formatter->funcPrintMnemonic(formatter, buffer, instruction, userData)); - char* bufRestore = *buffer; + ZydisUSize lenRestore = buffer->length; for (ZydisU8 i = 0; i < instruction->operandCount; ++i) { if (instruction->operands[i].visibility == ZYDIS_OPERAND_VISIBILITY_HIDDEN) @@ -800,52 +792,51 @@ static ZydisStatus ZydisFormatterFormatInstrIntel(const ZydisFormatter* formatte if (i == 0) { - ZYDIS_CHECK(ZydisPrintStr(buffer, bufEnd - *buffer, " ", ZYDIS_LETTER_CASE_DEFAULT)); + ZYDIS_CHECK(ZydisStringAppendC(buffer, " ", ZYDIS_LETTER_CASE_DEFAULT)); } else { - bufRestore = *buffer; - ZYDIS_CHECK(ZydisPrintStr(buffer, bufEnd - *buffer, ", ", ZYDIS_LETTER_CASE_DEFAULT)); + lenRestore = buffer->length; + ZYDIS_CHECK(ZydisStringAppendC(buffer, ", ", ZYDIS_LETTER_CASE_DEFAULT)); } - const char* bufPreOperand = *buffer; + ZydisUSize bufPreOperandLen = buffer->length; switch (instruction->operands[i].type) { case ZYDIS_OPERAND_TYPE_REGISTER: - ZYDIS_CHECK(formatter->funcFormatOperandReg(formatter, buffer, bufEnd - *buffer, + ZYDIS_CHECK(formatter->funcFormatOperandReg(formatter, buffer, instruction, &instruction->operands[i], userData)); break; case ZYDIS_OPERAND_TYPE_MEMORY: { - ZYDIS_CHECK(formatter->funcPrintOperandSize(formatter, buffer, bufEnd - *buffer, + ZYDIS_CHECK(formatter->funcPrintOperandSize(formatter, buffer, instruction, &instruction->operands[i], userData)); - ZYDIS_CHECK(formatter->funcPrintSegment(formatter, buffer, bufEnd - *buffer, + ZYDIS_CHECK(formatter->funcPrintSegment(formatter, buffer, instruction, &instruction->operands[i], userData)); - const char* bufTemp = *buffer; - ZYDIS_CHECK(formatter->funcFormatOperandMem(formatter, buffer, bufEnd - *buffer, + ZydisUSize lenTemp = buffer->length; + ZYDIS_CHECK(formatter->funcFormatOperandMem(formatter, buffer, instruction, &instruction->operands[i], userData)); - if (bufTemp == *buffer) + if (lenTemp == buffer->length) { - *buffer = (char*)bufPreOperand; + buffer->length = bufPreOperandLen; } break; } case ZYDIS_OPERAND_TYPE_POINTER: - ZYDIS_CHECK(formatter->funcFormatOperandPtr(formatter, buffer, bufEnd - *buffer, + ZYDIS_CHECK(formatter->funcFormatOperandPtr(formatter, buffer, instruction, &instruction->operands[i], userData)); break; case ZYDIS_OPERAND_TYPE_IMMEDIATE: - ZYDIS_CHECK(formatter->funcFormatOperandImm(formatter, buffer, bufEnd - *buffer, + ZYDIS_CHECK(formatter->funcFormatOperandImm(formatter, buffer, instruction, &instruction->operands[i], userData)); break; default: return ZYDIS_STATUS_INVALID_PARAMETER; } - if (bufPreOperand == *buffer) + if (lenRestore == buffer->length) { // Omit whole operand, if the buffer did not change during the formatting-callback - *buffer = bufRestore; - *buffer[0] = 0; + buffer->length = lenRestore; } else { if ((instruction->encoding == ZYDIS_INSTRUCTION_ENCODING_EVEX) || @@ -855,21 +846,21 @@ static ZydisStatus ZydisFormatterFormatInstrIntel(const ZydisFormatter* formatte (instruction->operands[i + 1].encoding == ZYDIS_OPERAND_ENCODING_MASK)) { ZYDIS_CHECK(formatter->funcPrintDecorator(formatter, buffer, - bufEnd - *buffer, instruction, &instruction->operands[i], + instruction, &instruction->operands[i], ZYDIS_DECORATOR_TYPE_MASK, userData)); } if (instruction->operands[i].type == ZYDIS_OPERAND_TYPE_MEMORY) { ZYDIS_CHECK(formatter->funcPrintDecorator(formatter, buffer, - bufEnd - *buffer, instruction, &instruction->operands[i], + instruction, &instruction->operands[i], ZYDIS_DECORATOR_TYPE_BROADCAST, userData)); if (instruction->encoding == ZYDIS_INSTRUCTION_ENCODING_MVEX) { ZYDIS_CHECK(formatter->funcPrintDecorator(formatter, buffer, - bufEnd - *buffer, instruction, &instruction->operands[i], + instruction, &instruction->operands[i], ZYDIS_DECORATOR_TYPE_CONVERSION, userData)); ZYDIS_CHECK(formatter->funcPrintDecorator(formatter, buffer, - bufEnd - *buffer, instruction, &instruction->operands[i], + instruction, &instruction->operands[i], ZYDIS_DECORATOR_TYPE_EVICTION_HINT, userData)); } } else @@ -880,14 +871,14 @@ static ZydisStatus ZydisFormatterFormatInstrIntel(const ZydisFormatter* formatte if (instruction->encoding == ZYDIS_INSTRUCTION_ENCODING_MVEX) { ZYDIS_CHECK(formatter->funcPrintDecorator(formatter, buffer, - bufEnd - *buffer, instruction, &instruction->operands[i], + instruction, &instruction->operands[i], ZYDIS_DECORATOR_TYPE_SWIZZLE, userData)); } ZYDIS_CHECK(formatter->funcPrintDecorator(formatter, buffer, - bufEnd - *buffer, instruction, &instruction->operands[i], + instruction, &instruction->operands[i], ZYDIS_DECORATOR_TYPE_ROUNDING_CONTROL, userData)); ZYDIS_CHECK(formatter->funcPrintDecorator(formatter, buffer, - bufEnd - *buffer, instruction, &instruction->operands[i], + instruction, &instruction->operands[i], ZYDIS_DECORATOR_TYPE_SAE, userData)); } } @@ -1156,21 +1147,30 @@ ZydisStatus ZydisFormatterFormatInstruction(const ZydisFormatter* formatter, ZydisStatus ZydisFormatterFormatInstructionEx(const ZydisFormatter* formatter, const ZydisDecodedInstruction* instruction, char* buffer, ZydisUSize bufferLen, void* userData) { - if (!formatter || !instruction || !buffer || (bufferLen == 0)) + if (!formatter || !instruction || !buffer || !bufferLen) { return ZYDIS_STATUS_INVALID_PARAMETER; } + ZydisString str = { + .s = buffer, + .length = 0, + .capacity = bufferLen - 1 + }; + if (formatter->funcPre) { - ZYDIS_CHECK(formatter->funcPre(formatter, instruction, userData)); + ZYDIS_CHECK(formatter->funcPre(formatter, &str, instruction, userData)); } - ZYDIS_CHECK( - formatter->funcFormatInstruction(formatter, &buffer, bufferLen, instruction, userData)); + + ZYDIS_CHECK(formatter->funcFormatInstruction(formatter, &str, instruction, userData)); + if (formatter->funcPost) { - return formatter->funcPost(formatter, instruction, userData); + ZYDIS_CHECK(formatter->funcPost(formatter, &str, instruction, userData)); } + + str.s[str.length] = 0; return ZYDIS_STATUS_SUCCESS; } From 02030c3b9251f608f6df8a132ff11cd01b425622 Mon Sep 17 00:00:00 2001 From: flobernd Date: Sat, 2 Dec 2017 06:36:12 +0100 Subject: [PATCH 02/14] Various changes and refactorings - Moved types and functions from `FormatHelper.h/c` to `String.h/c` - Added `ZydisMnemonicGetStringEx` function that returns the mnemonic-string as `ZydisString` struct - Added `ZYDIS_UNUSED_PARAMETER` macro - Fixed omitting of operands in custom formatter-hooks - Fixed `FormatterHooks` example - Refactored some code --- CMakeLists.txt | 13 +- examples/FormatHelper.h | 174 -- examples/FormatterHooks.c | 69 +- include/Zydis/Defines.h | 5 + include/Zydis/Formatter.h | 48 +- {src => include/Zydis/Internal}/LibC.h | 0 include/Zydis/Mnemonic.h | 12 +- include/Zydis/Status.h | 6 +- include/Zydis/String.h | 274 +- include/Zydis/Zydis.h | 1 + src/Decoder.c | 2 +- src/DecoderData.c | 2 +- src/FormatHelper.c | 302 --- src/FormatHelper.h | 220 -- src/Formatter.c | 449 ++-- src/Generated/EnumMnemonic.inc | 3152 ++++++++++++------------ src/Mnemonic.c | 44 +- src/String.c | 416 ++++ 18 files changed, 2607 insertions(+), 2582 deletions(-) delete mode 100644 examples/FormatHelper.h rename {src => include/Zydis/Internal}/LibC.h (100%) delete mode 100644 src/FormatHelper.c delete mode 100644 src/FormatHelper.h create mode 100644 src/String.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 7c35624..db6f0f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -104,15 +104,18 @@ target_sources("Zydis" "${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Mnemonic.h" "${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Register.h" "${CMAKE_CURRENT_LIST_DIR}/include/Zydis/SharedTypes.h" - "${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Status.h" + "${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Status.h" + "${CMAKE_CURRENT_LIST_DIR}/include/Zydis/String.h" "${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Utils.h" "${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Zydis.h" PRIVATE + "src/LibC.h" "src/MetaInfo.c" "src/Mnemonic.c" "src/Register.c" "src/SharedData.h" "src/SharedData.c" + "src/String.c" "src/Utils.c" "src/Zydis.c") @@ -124,11 +127,9 @@ if (ZYDIS_FEATURE_DECODER) "${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Formatter.h" PRIVATE "src/DecoderData.h" - "src/FormatHelper.h" "src/Decoder.c" "src/DecoderData.c" - "src/Formatter.c" - "src/FormatHelper.c") + "src/Formatter.c") endif () if (BUILD_SHARED_LIBS AND WIN32) @@ -148,9 +149,7 @@ install(DIRECTORY "include" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) if (ZYDIS_BUILD_EXAMPLES) if (ZYDIS_FEATURE_DECODER) - add_executable("FormatterHooks" - "examples/FormatterHooks.c" - "examples/FormatHelper.h") + add_executable("FormatterHooks" "examples/FormatterHooks.c") target_link_libraries("FormatterHooks" "Zydis") set_target_properties("FormatterHooks" PROPERTIES FOLDER "Examples/Formatter") target_compile_definitions("FormatterHooks" PRIVATE "_CRT_SECURE_NO_WARNINGS") diff --git a/examples/FormatHelper.h b/examples/FormatHelper.h deleted file mode 100644 index 481d922..0000000 --- a/examples/FormatHelper.h +++ /dev/null @@ -1,174 +0,0 @@ -/*************************************************************************************************** - - Zyan Disassembler Engine (Zydis) - - Original Author : Florian Bernd - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - -***************************************************************************************************/ - -#ifndef ZYDIS_FORMATHELPER_H -#define ZYDIS_FORMATHELPER_H - -#include -#include -#include -#include -#include -#include -#include -#include - -/* ============================================================================================== */ -/* Format helper functions */ -/* ============================================================================================== */ - -/* ---------------------------------------------------------------------------------------------- */ -/* Enums and types */ -/* ---------------------------------------------------------------------------------------------- */ - -/** - * @brief Defines the @c ZydisStringBufferAppendMode datatype. - */ -typedef uint8_t ZydisStringBufferAppendMode; - -/** - * @brief Values that represent zydis string-buffer append-modes. - */ -enum ZydisStringBufferAppendModes -{ - /** - * @brief Appends the string as it is. - */ - ZYDIS_STRBUF_APPEND_MODE_DEFAULT, - /** - * @brief Converts the string to lowercase characters. - */ - ZYDIS_STRBUF_APPEND_MODE_LOWERCASE, - /** - * @brief Converts the string to uppercase characters. - */ - ZYDIS_STRBUF_APPEND_MODE_UPPERCASE -}; - -/* ---------------------------------------------------------------------------------------------- */ - -/** - * @brief Appends the @c text to the given @c buffer and increases the string-buffer pointer by - * the number of chars written. - * - * @param buffer A pointer to the string-buffer. - * @param bufferLen The length of the string-buffer. - * @param mode The append-mode. - * @param text The text to append. - * - * @return @c ZYDIS_STATUS_SUCCESS, if the function succeeded, or - * @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not - * sufficient to append the given @c text. - */ -ZYDIS_INLINE ZydisStatus ZydisStringBufferAppend(char** buffer, size_t bufferLen, - ZydisStringBufferAppendMode mode, const char* text) -{ - ZYDIS_ASSERT(buffer); - ZYDIS_ASSERT(bufferLen != 0); - ZYDIS_ASSERT(text); - - size_t strLen = strlen(text); - if (strLen >= bufferLen) - { - return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE; - } - strncpy(*buffer, text, strLen + 1); - switch (mode) - { - case ZYDIS_STRBUF_APPEND_MODE_LOWERCASE: - for (size_t i = 0; i < strLen; ++i) - { - (*buffer[i]) = (char)tolower((*buffer)[i]); - } - break; - case ZYDIS_STRBUF_APPEND_MODE_UPPERCASE: - for (size_t i = 0; i < strLen; ++i) - { - (*buffer)[i] = (char)toupper((*buffer)[i]); - } - break; - default: - break; - } - *buffer += strLen; - return ZYDIS_STATUS_SUCCESS; -} - -/** - * @brief Appends formatted text to the given @c buffer and increases the string-buffer pointer - * by the number of chars written. - * - * @param buffer A pointer to the string-buffer. - * @param bufferLen The length of the string-buffer. - * @param mode The append-mode. - * @param format The format string. - * - * @return @c ZYDIS_STATUS_SUCCESS, if the function succeeded, or - * @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not - * sufficient to append the given text. - */ -ZYDIS_INLINE ZydisStatus ZydisStringBufferAppendFormat(char** buffer, size_t bufferLen, - ZydisStringBufferAppendMode mode, const char* format, ...) -{ - ZYDIS_ASSERT(buffer); - ZYDIS_ASSERT(bufferLen != 0); - ZYDIS_ASSERT(format); - - va_list arglist; - va_start(arglist, format); - int w = vsnprintf(*buffer, bufferLen, format, arglist); - if ((w < 0) || ((size_t)w >= bufferLen)) - { - va_end(arglist); - return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE; - } - switch (mode) - { - case ZYDIS_STRBUF_APPEND_MODE_LOWERCASE: - for (size_t i = 0; i < (size_t)w; ++i) - { - (*buffer)[i] = (char)tolower((*buffer)[i]); - } - break; - case ZYDIS_STRBUF_APPEND_MODE_UPPERCASE: - for (size_t i = 0; i < (size_t)w; ++i) - { - (*buffer)[i] = (char)toupper((*buffer)[i]); - } - break; - default: - break; - } - *buffer += (size_t)w; - va_end(arglist); - return ZYDIS_STATUS_SUCCESS; -} - -/* ---------------------------------------------------------------------------------------------- */ - -/* ============================================================================================== */ - -#endif /* ZYDIS_FORMATHELPER_H */ diff --git a/examples/FormatterHooks.c b/examples/FormatterHooks.c index 0faa231..7a3b73e 100644 --- a/examples/FormatterHooks.c +++ b/examples/FormatterHooks.c @@ -33,10 +33,46 @@ * the condition encoded in the immediate operand). */ +#include +#include #include #include #include -#include "FormatHelper.h" + +/* ============================================================================================== */ +/* Helper functions */ +/* ============================================================================================== */ + +/** + * @brief Appends formatted text to the given `string`. + * + * @param string A pointer to the string. + * @param format The format string. + * + * @return @c ZYDIS_STATUS_SUCCESS, if the function succeeded, or + * @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not + * sufficient to append the given text. + */ +ZYDIS_INLINE ZydisStatus ZydisStringAppendFormatC(ZydisString* string, const char* format, ...) +{ + if (!string || !string->buffer || !format) + { + return ZYDIS_STATUS_INVALID_PARAMETER; + } + + va_list arglist; + va_start(arglist, format); + const int w = vsnprintf(string->buffer + string->length, string->capacity - string->length, + format, arglist); + if ((w < 0) || ((size_t)w > string->capacity - string->length)) + { + va_end(arglist); + return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE; + } + string->length += w; + va_end(arglist); + return ZYDIS_STATUS_SUCCESS; +} /* ============================================================================================== */ /* Static data */ @@ -100,8 +136,7 @@ typedef struct ZydisCustomUserData_ ZydisFormatterFormatFunc defaultPrintMnemonic; static ZydisStatus ZydisFormatterPrintMnemonic(const ZydisFormatter* formatter, - char** buffer, size_t bufferLen, const ZydisDecodedInstruction* instruction, - ZydisCustomUserData* userData) + ZydisString* string, const ZydisDecodedInstruction* instruction, ZydisCustomUserData* userData) { // We use the user-data to pass data to the @c ZydisFormatterFormatOperandImm function. userData->ommitImmediate = ZYDIS_TRUE; @@ -109,40 +144,36 @@ static ZydisStatus ZydisFormatterPrintMnemonic(const ZydisFormatter* formatter, // Rewrite the instruction-mnemonic for the given instructions if (instruction->operands[instruction->operandCount - 1].type == ZYDIS_OPERAND_TYPE_IMMEDIATE) { - uint8_t conditionCode = + const uint8_t conditionCode = (uint8_t)instruction->operands[instruction->operandCount - 1].imm.value.u; switch (instruction->mnemonic) { case ZYDIS_MNEMONIC_CMPPS: if (conditionCode < 0x08) { - return ZydisStringBufferAppendFormat(buffer, bufferLen, - ZYDIS_STRBUF_APPEND_MODE_DEFAULT, "cmp%sps", - conditionCodeStrings[conditionCode]); + return ZydisStringAppendFormatC( + string, "cmp%sps", conditionCodeStrings[conditionCode]); } break; case ZYDIS_MNEMONIC_CMPPD: if (conditionCode < 0x08) { - return ZydisStringBufferAppendFormat(buffer, bufferLen, - ZYDIS_STRBUF_APPEND_MODE_DEFAULT, "cmp%spd", - conditionCodeStrings[conditionCode]); + return ZydisStringAppendFormatC( + string, "cmp%spd", conditionCodeStrings[conditionCode]); } break; case ZYDIS_MNEMONIC_VCMPPS: if (conditionCode < 0x20) { - return ZydisStringBufferAppendFormat(buffer, bufferLen, - ZYDIS_STRBUF_APPEND_MODE_DEFAULT, "vcmp%sps", - conditionCodeStrings[conditionCode]); + return ZydisStringAppendFormatC( + string, "vcmp%sps", conditionCodeStrings[conditionCode]); } break; case ZYDIS_MNEMONIC_VCMPPD: if (conditionCode < 0x20) { - return ZydisStringBufferAppendFormat(buffer, bufferLen, - ZYDIS_STRBUF_APPEND_MODE_DEFAULT, "vcmp%spd", - conditionCodeStrings[conditionCode]); + return ZydisStringAppendFormatC( + string, "vcmp%spd", conditionCodeStrings[conditionCode]); } break; default: @@ -155,7 +186,7 @@ static ZydisStatus ZydisFormatterPrintMnemonic(const ZydisFormatter* formatter, userData->ommitImmediate = ZYDIS_FALSE; // Default mnemonic printing - return defaultPrintMnemonic(formatter, buffer, bufferLen, instruction, userData); + return defaultPrintMnemonic(formatter, string, instruction, userData); } /* ---------------------------------------------------------------------------------------------- */ @@ -163,7 +194,7 @@ static ZydisStatus ZydisFormatterPrintMnemonic(const ZydisFormatter* formatter, ZydisFormatterFormatOperandFunc defaultFormatOperandImm; static ZydisStatus ZydisFormatterFormatOperandImm(const ZydisFormatter* formatter, - char** buffer, size_t bufferLen, const ZydisDecodedInstruction* instruction, + ZydisString* string, const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, ZydisCustomUserData* userData) { // The @c ZydisFormatterFormatMnemonic sinals us to omit the immediate (condition-code) @@ -176,7 +207,7 @@ static ZydisStatus ZydisFormatterFormatOperandImm(const ZydisFormatter* formatte } // Default immediate formatting - return defaultFormatOperandImm(formatter, buffer, bufferLen, instruction, operand, userData); + return defaultFormatOperandImm(formatter, string, instruction, operand, userData); } /* ---------------------------------------------------------------------------------------------- */ diff --git a/include/Zydis/Defines.h b/include/Zydis/Defines.h index 44341cd..7b92399 100644 --- a/include/Zydis/Defines.h +++ b/include/Zydis/Defines.h @@ -178,6 +178,11 @@ */ #define ZYDIS_BITFIELD(x) : x +/** + * @brief Marks the specified parameter as unused. + */ +#define ZYDIS_UNUSED_PARAMETER(x) (void)(x) + /** * @brief Calculates the size of an array. */ diff --git a/include/Zydis/Formatter.h b/include/Zydis/Formatter.h index 8b29588..dfd2dc4 100644 --- a/include/Zydis/Formatter.h +++ b/include/Zydis/Formatter.h @@ -404,6 +404,7 @@ typedef struct ZydisFormatter_ ZydisFormatter; * @brief Defines the @c ZydisFormatterNotifyFunc function pointer. * * @param formatter A pointer to the @c ZydisFormatter instance. + * @param string A pointer to the string. * @param instruction A pointer to the @c ZydisDecodedInstruction struct. * @param userData A pointer to user-defined data. * @@ -414,33 +415,30 @@ typedef struct ZydisFormatter_ ZydisFormatter; * @c ZYDIS_FORMATTER_HOOK_POST hook-types. */ typedef ZydisStatus (*ZydisFormatterNotifyFunc)(const ZydisFormatter* formatter, - ZydisString* buffer, const ZydisDecodedInstruction* instruction, void* userData); + ZydisString* string, const ZydisDecodedInstruction* instruction, void* userData); /** * @brief Defines the @c ZydisFormatterFormatFunc function pointer. * * @param formatter A pointer to the @c ZydisFormatter instance. - * @param str A pointer to the string buffer. + * @param string A pointer to the string. * @param instruction A pointer to the @c ZydisDecodedInstruction struct. * @param userData A pointer to user-defined data. * * @return Returning a status code other than @c ZYDIS_STATUS_SUCCESS will immediately cause the * formatting process to fail. - * - * After appending text to the @c buffer you MUST increase the buffer-pointer by the size of the - * number of chars written. Not increasing the buffer-pointer will cause unexpected behavior. * * This function type is used for the @c ZYDIS_FORMATTER_HOOK_FORMAT_INSTRUCTION, * @c ZYDIS_FORMATTER_HOOK_PRINT_PREFIXES and @c ZYDIS_FORMATTER_HOOK_PRINT_MNEMONIC hook-types. */ typedef ZydisStatus (*ZydisFormatterFormatFunc)(const ZydisFormatter* formatter, - ZydisString* buffer, const ZydisDecodedInstruction* instruction, void* userData); + ZydisString* string, const ZydisDecodedInstruction* instruction, void* userData); /** * @brief Defines the @c ZydisFormatterFormatOperandFunc function pointer. * * @param formatter A pointer to the @c ZydisFormatter instance. - * @param str A pointer to the string buffer. + * @param string A pointer to the string. * @param instruction A pointer to the @c ZydisDecodedInstruction struct. * @param operand A pointer to the @c ZydisDecodedOperand struct. * @param userData A pointer to user-defined data. @@ -448,19 +446,14 @@ typedef ZydisStatus (*ZydisFormatterFormatFunc)(const ZydisFormatter* formatter, * @return Returning a status code other than @c ZYDIS_STATUS_SUCCESS will immediately cause the * formatting process to fail. * - * After appending text to the @c buffer you MUST increase the buffer-pointer by the size of the - * number of chars written. - * * Returning @c ZYDIS_STATUS_SUCCESS in one of the @c ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_X hooks - * without increasing the buffer-pointer is valid and will cause the formatter to omit the current + * without writing to the string is valid and will cause the formatter to omit the current * operand. * * Returning @c ZYDIS_STATUS_SUCCESS in @c ZYDIS_FORMATTER_HOOK_PRINT_OPERANDSIZE, * @c ZYDIS_FORMATTER_HOOK_PRINT_SEGMENT or @c ZYDIS_FORMATTER_HOOK_PRINT_DECORATOR without - * increasing the buffer-pointer is valid and signals that the corresponding element should not be + * writing to the string is valid and signals that the corresponding element should not be * printed for the current operand. - * - * Not increasing the buffer-pointer for any other hook-type will cause unexpected behavior. * * This function type is used for the @c ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_REG, * @c ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_MEM, @c ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_PTR, @@ -470,36 +463,32 @@ typedef ZydisStatus (*ZydisFormatterFormatFunc)(const ZydisFormatter* formatter, * hook-types. */ typedef ZydisStatus (*ZydisFormatterFormatOperandFunc)(const ZydisFormatter* formatter, - ZydisString* buffer, const ZydisDecodedInstruction* instruction, + ZydisString* string, const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, void* userData); /** * @brief Defines the @c ZydisFormatterFormatAddressFunc function pointer. * * @param formatter A pointer to the @c ZydisFormatter instance. - * @param str A pointer to the string buffer. + * @param string A pointer to the string. * @param instruction A pointer to the @c ZydisDecodedInstruction struct. * @param operand A pointer to the @c ZydisDecodedOperand struct. * @param userData A pointer to user-defined data. * * @return Returning a status code other than @c ZYDIS_STATUS_SUCCESS will immediately cause the * formatting process to fail. - * - * After appending text to the @c buffer you MUST increase the buffer-pointer by the size of the - * number of chars written. - * Not increasing the buffer-pointer will cause unexpected behavior. * * This function type is used for the @c ZYDIS_FORMATTER_HOOK_PRINT_ADDRESS hook-type. */ typedef ZydisStatus (*ZydisFormatterFormatAddressFunc)(const ZydisFormatter* formatter, - ZydisString* buffer, const ZydisDecodedInstruction* instruction, + ZydisString* string, const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, ZydisU64 address, void* userData); /** * @brief Defines the @c ZydisFormatterFormatDecoratorFunc function pointer. * * @param formatter A pointer to the @c ZydisFormatter instance. - * @param str A pointer to the string buffer. + * @param string A pointer to the string. * @param instruction A pointer to the @c ZydisDecodedInstruction struct. * @param operand A pointer to the @c ZydisDecodedOperand struct. * @param type The decorator type. @@ -508,16 +497,13 @@ typedef ZydisStatus (*ZydisFormatterFormatAddressFunc)(const ZydisFormatter* for * @return Returning a status code other than @c ZYDIS_STATUS_SUCCESS will immediately cause the * formatting process to fail. * - * After appending text to the @c buffer you MUST increase the buffer-pointer by the size of the - * number of chars written. - * - * Returning @c ZYDIS_STATUS_SUCCESS without increasing the buffer-pointer is valid and will cause - * the formatter to omit the current decorator. + * Returning @c ZYDIS_STATUS_SUCCESS without writing to the string is valid and will cause the + * formatter to omit the current decorator. * * This function type is used for the @c ZYDIS_FORMATTER_HOOK_PRINT_DECORATOR hook-type. */ typedef ZydisStatus (*ZydisFormatterFormatDecoratorFunc)(const ZydisFormatter* formatter, - ZydisString* buffer, const ZydisDecodedInstruction* instruction, + ZydisString* string, const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, ZydisDecoratorType type, void* userData); /* ---------------------------------------------------------------------------------------------- */ @@ -536,8 +522,10 @@ struct ZydisFormatter_ ZydisU8 displacementFormat; ZydisU8 immediateFormat; ZydisBool hexUppercase; - char* hexPrefix; - char* hexSuffix; + ZydisString* hexPrefix; + ZydisString hexPrefixData; + ZydisString* hexSuffix; + ZydisString hexSuffixData; ZydisU8 hexPaddingAddress; ZydisU8 hexPaddingDisplacement; ZydisU8 hexPaddingImmediate; diff --git a/src/LibC.h b/include/Zydis/Internal/LibC.h similarity index 100% rename from src/LibC.h rename to include/Zydis/Internal/LibC.h diff --git a/include/Zydis/Mnemonic.h b/include/Zydis/Mnemonic.h index 527532e..6afcf99 100644 --- a/include/Zydis/Mnemonic.h +++ b/include/Zydis/Mnemonic.h @@ -32,8 +32,9 @@ #ifndef ZYDIS_MNEMONIC_H #define ZYDIS_MNEMONIC_H -#include #include +#include +#include #ifdef __cplusplus extern "C" { @@ -58,6 +59,15 @@ extern "C" { */ ZYDIS_EXPORT const char* ZydisMnemonicGetString(ZydisMnemonic mnemonic); +/** + * @brief Returns the specified instruction mnemonic as `ZydisString`. + * + * @param mnemonic The mnemonic. + * + * @return The instruction mnemonic string or @c NULL, if an invalid mnemonic was passed. + */ +ZYDIS_EXPORT const ZydisString* ZydisMnemonicGetStringEx(ZydisMnemonic mnemonic); + /* ============================================================================================== */ #ifdef __cplusplus diff --git a/include/Zydis/Status.h b/include/Zydis/Status.h index aec256e..fa5abb3 100644 --- a/include/Zydis/Status.h +++ b/include/Zydis/Status.h @@ -164,10 +164,10 @@ enum ZydisStatusCodes #define ZYDIS_CHECK(status) \ do \ { \ - ZydisStatus status_w4587ntvmEgDG = status; \ - if (!ZYDIS_SUCCESS(status_w4587ntvmEgDG)) \ + ZydisStatus status_038560234 = status; \ + if (!ZYDIS_SUCCESS(status_038560234)) \ { \ - return status_w4587ntvmEgDG; \ + return status_038560234; \ } \ } while (0) diff --git a/include/Zydis/String.h b/include/Zydis/String.h index bb18e77..a5855bf 100644 --- a/include/Zydis/String.h +++ b/include/Zydis/String.h @@ -2,7 +2,7 @@ Zyan Disassembler Library (Zydis) - Original Author : Joel Höner + Original Author : Florian Bernd, Joel Höner * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -28,18 +28,284 @@ #define ZYDIS_STRING_H #include +#include +#include /* ============================================================================================== */ -/* String struct */ +/* Enums and types */ /* ============================================================================================== */ +/* ---------------------------------------------------------------------------------------------- */ +/* String */ +/* ---------------------------------------------------------------------------------------------- */ + +/** + * @brief Defines the `ZydisString` struct. + */ typedef struct ZydisString_ { - char *s; // NOT always 0-terminated! + /** + * @brief The buffer that contains the actual string (0-termination is optional!). + */ + char *buffer; + /** + * @brief The length of the string (without any optional 0). + */ ZydisUSize length; - ZydisUSize capacity; // always -1 for 0 byte + /** + * @brief The total buffer capacity. + */ + ZydisUSize capacity; } ZydisString; + +/* ---------------------------------------------------------------------------------------------- */ +/* Letter Case */ +/* ---------------------------------------------------------------------------------------------- */ + +/** + * @brief Defines the `ZydisLetterCase` datatype. + */ +typedef ZydisU8 ZydisLetterCase; + +/** + * @brief Values that represent letter cases. + */ +enum ZydisLetterCases +{ + /** + * @brief Uses the given text "as it is". + */ + ZYDIS_LETTER_CASE_DEFAULT, + /** + * @brief Converts the given text to lowercase letters. + */ + ZYDIS_LETTER_CASE_LOWER, + /** + * @brief Converts the given text to uppercase letters. + */ + ZYDIS_LETTER_CASE_UPPER, + + /** + * @brief Maximum value of this enum. + */ + ZYDIS_LETTER_CASE_MAX_VALUE = ZYDIS_LETTER_CASE_UPPER +}; + +/* ---------------------------------------------------------------------------------------------- */ + +/* ============================================================================================== */ +/* Macros */ +/* ============================================================================================== */ + +/* ---------------------------------------------------------------------------------------------- */ +/* Helper Macros */ +/* ---------------------------------------------------------------------------------------------- */ + +/** + * @brief Creates a `ZydisString` struct from a constant C-string. + * + * @param string The C-string constant. + */ +#define ZYDIS_MAKE_STRING(string) \ + { (char*)string, sizeof(string) - 1, sizeof(string) - 1 } + +/* ---------------------------------------------------------------------------------------------- */ + +/* ============================================================================================== */ +/* Functions */ +/* ============================================================================================== */ + +/* ---------------------------------------------------------------------------------------------- */ +/* Basic Operations */ +/* ---------------------------------------------------------------------------------------------- */ + +/** + * @brief Initializes a `ZydisString` struct with a C-string. + * + * @param string The string to initialize. + * @param value The C-string constant. + * + * @return A zydis status code. + */ +ZYDIS_NO_EXPORT ZYDIS_INLINE ZydisStatus ZydisStringInit(ZydisString* string, char* value) +{ + if (!string || !value) + { + return ZYDIS_STATUS_INVALID_PARAMETER; + } + + string->buffer = value; + string->length = ZydisStrLen(value); + string->capacity = ZydisStrLen(value); + + return ZYDIS_STATUS_SUCCESS; +} + +/* ---------------------------------------------------------------------------------------------- */ + +/** + * @brief Appends a `ZydisString` to another `ZydisString` after converting it to the specified + * letter-case. + * + * @param string The string to append to. + * @param text The string to append. + * @param letterCase The letter case to use. + * + * @return @c ZYDIS_STATUS_SUCCESS, if the function succeeded, or + * @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not + * sufficient to append the given @c text. + */ +ZYDIS_NO_EXPORT ZydisStatus ZydisStringAppendEx(ZydisString* string, const ZydisString* text, + ZydisLetterCase letterCase); + +/** + * @brief Appends the given C-string to a `ZydisString` after converting it to the specified + * letter-case. + * + * @param string The string to append to. + * @param text The C-string to append. + * @param letterCase The letter case to use. + * + * @return @c ZYDIS_STATUS_SUCCESS, if the function succeeded, or + * @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not + * sufficient to append the given @c text. + */ +ZYDIS_NO_EXPORT ZYDIS_INLINE ZydisStatus ZydisStringAppendExC(ZydisString* string, + const char* text, ZydisLetterCase letterCase) +{ + ZydisString other; + ZYDIS_CHECK(ZydisStringInit(&other, (char*)text)); + + return ZydisStringAppendEx(string, &other, letterCase); +} + +/** + * @brief Appends a `ZydisString` to another `ZydisString`. + * + * @param string The string to append to. + * @param text The string to append. + * + * @return @c ZYDIS_STATUS_SUCCESS, if the function succeeded, or + * @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not + * sufficient to append the given @c text. + */ +ZYDIS_NO_EXPORT ZYDIS_INLINE ZydisStatus ZydisStringAppend(ZydisString* string, + const ZydisString* text) +{ + return ZydisStringAppendEx(string, text, ZYDIS_LETTER_CASE_DEFAULT); +} + +/** + * @brief Appends the given C-string to a `ZydisString`. + * + * @param string The string to append to. + * @param text The C-string to append. + * + * @return @c ZYDIS_STATUS_SUCCESS, if the function succeeded, or + * @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not + * sufficient to append the given @c text. + */ +ZYDIS_NO_EXPORT ZYDIS_INLINE ZydisStatus ZydisStringAppendC(ZydisString* string, const char* text) +{ + ZydisString other; + ZYDIS_CHECK(ZydisStringInit(&other, (char*)text)); + + return ZydisStringAppend(string, &other); +} + +/* ---------------------------------------------------------------------------------------------- */ +/* Formatting */ +/* ---------------------------------------------------------------------------------------------- */ + +/** + * @brief Formats the given unsigned ordinal @c value to its decimal text-representation and + * appends it to @c s. + * + * @param string A pointer to the string. + * @param value The value. + * @param paddingLength Padds the converted value with leading zeros, if the number of chars is + * less than the @c paddingLength. + * + * @return @c ZYDIS_STATUS_SUCCESS, if the function succeeded, or + * @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not + * sufficient to append the given @c value. + * + * The string-buffer pointer is increased by the number of chars written, if the call was + * successfull. + */ +ZYDIS_NO_EXPORT ZydisStatus ZydisPrintDecU(ZydisString* string, ZydisU64 value, + ZydisU8 paddingLength); + +/** + * @brief Formats the given signed ordinal @c value to its decimal text-representation and + * appends it to @c s. + * + * @param string A pointer to the string. + * @param value The value. + * @param paddingLength Padds the converted value with leading zeros, if the number of chars is + * less than the @c paddingLength (the sign char is ignored). + * + * @return @c ZYDIS_STATUS_SUCCESS, if the function succeeded, or + * @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not + * sufficient to append the given @c value. + * + * The string-buffer pointer is increased by the number of chars written, if the call was + * successfull. + */ +ZYDIS_NO_EXPORT ZydisStatus ZydisPrintDecS(ZydisString* string, ZydisI64 value, + ZydisU8 paddingLength); + +/** + * @brief Formats the given unsigned ordinal @c value to its hexadecimal text-representation and + * appends it to the @c buffer. + * + * @param string A pointer to the string. + * @param value The value. + * @param paddingLength Padds the converted value with leading zeros, if the number of chars is + * less than the @c paddingLength. + * @param uppercase Set @c TRUE to print the hexadecimal value in uppercase letters instead + * of lowercase ones. + * @param prefix The string to use as prefix or `NULL`, if not needed. + * @param suffix The string to use as suffix or `NULL`, if not needed. + * + * @return @c ZYDIS_STATUS_SUCCESS, if the function succeeded, or + * @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not + * sufficient to append the given @c value. + * + * The string-buffer pointer is increased by the number of chars written, if the call was + * successfull. + */ +ZYDIS_NO_EXPORT ZydisStatus ZydisPrintHexU(ZydisString* string, ZydisU64 value, + ZydisU8 paddingLength, ZydisBool uppercase, const ZydisString* prefix, + const ZydisString* suffix); + +/** + * @brief Formats the given signed ordinal @c value to its hexadecimal text-representation and + * appends it to the @c buffer. + * + * @param string A pointer to the string. + * @param value The value. + * @param paddingLength Padds the converted value with leading zeros, if the number of chars is + * less than the @c paddingLength (the sign char is ignored). + * @param uppercase Set @c TRUE to print the hexadecimal value in uppercase letters instead + * of lowercase ones. + * @param prefix The string to use as prefix or `NULL`, if not needed. + * @param suffix The string to use as suffix or `NULL`, if not needed. + * + * @return @c ZYDIS_STATUS_SUCCESS, if the function succeeded, or + * @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not + * sufficient to append the given @c value. + * + * The string-buffer pointer is increased by the number of chars written, if the call was + * successfull. + */ +ZYDIS_NO_EXPORT ZydisStatus ZydisPrintHexS(ZydisString* string, ZydisI64 value, + ZydisU8 paddingLength, ZydisBool uppercase, const ZydisString* prefix, + const ZydisString* suffix); + +/* ---------------------------------------------------------------------------------------------- */ + /* ============================================================================================== */ #endif // ZYDIS_STRING_H diff --git a/include/Zydis/Zydis.h b/include/Zydis/Zydis.h index 67d6f52..417c3cd 100644 --- a/include/Zydis/Zydis.h +++ b/include/Zydis/Zydis.h @@ -42,6 +42,7 @@ #include #include #include +#include #include #ifdef __cplusplus diff --git a/src/Decoder.c b/src/Decoder.c index 2a64174..752fbde 100644 --- a/src/Decoder.c +++ b/src/Decoder.c @@ -26,9 +26,9 @@ #include #include +#include #include #include -#include /* ============================================================================================== */ /* Internal enums and types */ diff --git a/src/DecoderData.c b/src/DecoderData.c index f65f2d4..c0d9b91 100644 --- a/src/DecoderData.c +++ b/src/DecoderData.c @@ -368,7 +368,7 @@ void ZydisGetInstructionEncodingInfo(const ZydisDecoderTreeNode* node, const ZydisInstructionEncodingInfo** info) { ZYDIS_ASSERT(node->type & ZYDIS_NODETYPE_DEFINITION_MASK); - ZydisU8 class = (node->type) & 0x7F; + const ZydisU8 class = (node->type) & 0x7F; ZYDIS_ASSERT(class < ZYDIS_ARRAY_SIZE(instructionEncodings)); *info = &instructionEncodings[class]; } diff --git a/src/FormatHelper.c b/src/FormatHelper.c deleted file mode 100644 index b9e4250..0000000 --- a/src/FormatHelper.c +++ /dev/null @@ -1,302 +0,0 @@ -/*************************************************************************************************** - - Zyan Disassembler Library (Zydis) - - Original Author : Florian Bernd, Joel Höner - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - -***************************************************************************************************/ - -#include - -/* ============================================================================================== */ -/* Constants */ -/* ============================================================================================== */ - -/* ---------------------------------------------------------------------------------------------- */ -/* Defines */ -/* ---------------------------------------------------------------------------------------------- */ - -#define ZYDIS_MAXCHARS_DEC_32 10 -#define ZYDIS_MAXCHARS_DEC_64 20 -#define ZYDIS_MAXCHARS_HEX_32 8 -#define ZYDIS_MAXCHARS_HEX_64 16 - -/* ---------------------------------------------------------------------------------------------- */ -/* Lookup Tables */ -/* ---------------------------------------------------------------------------------------------- */ - -static const char* decimalLookup = - "00010203040506070809" - "10111213141516171819" - "20212223242526272829" - "30313233343536373839" - "40414243444546474849" - "50515253545556575859" - "60616263646566676869" - "70717273747576777879" - "80818283848586878889" - "90919293949596979899"; - -/* ---------------------------------------------------------------------------------------------- */ - -/* ============================================================================================== */ -/* Functions */ -/* ============================================================================================== */ - -/* ---------------------------------------------------------------------------------------------- */ -/* Internal Functions */ -/* ---------------------------------------------------------------------------------------------- */ - -void ZydisToLowerCase(char* buffer, ZydisUSize bufferLen) -{ - ZYDIS_ASSERT(buffer); - ZYDIS_ASSERT(bufferLen); - - const signed char rebase = 'a' - 'A'; - for (ZydisUSize i = 0; i < bufferLen; ++i) - { - char* c = buffer + i; - if ((*c >= 'A') && (*c <= 'Z')) - { - *c += rebase; - } - } -} - -void ZydisToUpperCase(char* buffer, ZydisUSize bufferLen) -{ - ZYDIS_ASSERT(buffer); - ZYDIS_ASSERT(bufferLen); - - const signed char rebase = 'A' - 'a'; - for (ZydisUSize i = 0; i < bufferLen; ++i) - { - char* c = buffer + i; - if ((*c >= 'a') && (*c <= 'z')) - { - *c += rebase; - } - } -} - -ZydisStatus ZydisPrintDecU64(ZydisString* s, ZydisU64 value, ZydisU8 paddingLength) -{ - ZYDIS_ASSERT(s); - - char temp[ZYDIS_MAXCHARS_DEC_64 + 1]; - char *p = &temp[ZYDIS_MAXCHARS_DEC_64]; - - while (value >= 100) - { - const ZydisU64 old = value; - p -= 2; - value /= 100; - ZydisMemoryCopy(p, &decimalLookup[(old - (value * 100)) * 2], 2); - } - p -= 2; - ZydisMemoryCopy(p, &decimalLookup[value * 2], 2); - - const ZydisUSize n = &temp[ZYDIS_MAXCHARS_DEC_64] - p; - if ((s->capacity - s->length < (ZydisUSize)(n + 1)) || - (s->capacity - s->length < (ZydisUSize)(paddingLength + 1))) - { - return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE; - } - - ZydisUSize offset = 0; - if (n <= paddingLength) - { - offset = paddingLength - n + 1; - ZydisMemorySet(s->s + s->length, '0', offset); - } - - ZydisMemoryCopy(s->s + s->length + offset, &p[value < 10], n + 1); - s->length += n + offset - (ZydisU8)(value < 10); - - return ZYDIS_STATUS_SUCCESS; -} - -ZydisStatus ZydisPrintHexU64(ZydisString* s, ZydisU64 value, ZydisU8 paddingLength, - ZydisBool uppercase, const char* prefix, const char* suffix) -{ - ZYDIS_ASSERT(s); - - if (prefix) - { - ZYDIS_CHECK(ZydisStringAppendC(s, prefix, ZYDIS_LETTER_CASE_DEFAULT)); - } - - char* buffer = s->s + s->length; - ZydisUSize numRemainingBytes = s->capacity - s->length; - - if (numRemainingBytes < (ZydisUSize)paddingLength) - { - return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE; - } - - if (!value) - { - const ZydisU8 n = (paddingLength ? paddingLength : 1); - - if (numRemainingBytes < (ZydisUSize)n) - { - return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE; - } - - ZydisMemorySet(buffer, '0', n); - s->length += n; - return ZYDIS_STATUS_SUCCESS; - } - - ZydisU8 n = 0; - const ZydisU8 c = ((value & 0xFFFFFFFF00000000) ? ZYDIS_MAXCHARS_HEX_64 : ZYDIS_MAXCHARS_HEX_32); - for (ZydisI8 i = c - 1; i >= 0; --i) - { - const ZydisU8 v = (value >> i * 4) & 0x0F; - if (!n) - { - if (!v) - { - continue; - } - if (numRemainingBytes <= (ZydisU8)(i + 1)) - { - return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE; - } - if (paddingLength > i) - { - n = paddingLength - i - 1; - ZydisMemorySet(buffer, '0', n); - } - } - if (uppercase) - { - buffer[n++] = "0123456789ABCDEF"[v]; - } else - { - buffer[n++] = "0123456789abcdef"[v]; - } - } - s->length += n; - - if (suffix) - { - ZYDIS_CHECK(ZydisStringAppendC(s, suffix, ZYDIS_LETTER_CASE_DEFAULT)); - } - - return ZYDIS_STATUS_SUCCESS; -} - -/* ---------------------------------------------------------------------------------------------- */ -/* Public Functions */ -/* ---------------------------------------------------------------------------------------------- */ - -ZydisStatus ZydisStringAppend(ZydisString* s, const ZydisString* text, ZydisLetterCase letterCase) -{ - ZYDIS_ASSERT(s); - ZYDIS_ASSERT(s->capacity >= s->length); - ZYDIS_ASSERT(text); - ZYDIS_ASSERT(text->capacity >= s->length); - - if (s->length + text->length >= s->capacity) - { - return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE; - } - - ZydisMemoryCopy(s->s + s->length, text->s, text->length); - - switch (letterCase) - { - case ZYDIS_LETTER_CASE_DEFAULT: - break; - case ZYDIS_LETTER_CASE_LOWER: - ZydisToLowerCase(s->s + s->length, text->length); - break; - case ZYDIS_LETTER_CASE_UPPER: - ZydisToUpperCase(s->s + s->length, text->length); - break; - default: - ZYDIS_UNREACHABLE; - } - - s->length += text->length; - return ZYDIS_STATUS_SUCCESS; -} - -ZydisStatus ZydisPrintDecU(ZydisString *s, ZydisU64 value, ZydisU8 paddingLength) -{ -#if defined(ZYDIS_X64) || defined(ZYDIS_AARCH64) - return ZydisPrintDecU64(s, value, paddingLength); -#else - if (value & 0xFFFFFFFF00000000) - { - return ZydisPrintDecU64(s, value, paddingLength); - } else - { - return ZydisPrintDecU32(s, (ZydisU32)value, paddingLength); - } -#endif -} - -ZydisStatus ZydisPrintDecS(ZydisString *s, ZydisI64 value, ZydisU8 paddingLength) -{ - if (value < 0) - { - ZYDIS_CHECK(ZydisStringAppendC(s, "-", ZYDIS_LETTER_CASE_DEFAULT)); - return ZydisPrintDecU(s, -value, paddingLength); - } - return ZydisPrintDecU(s, value, paddingLength); -} - -ZydisStatus ZydisPrintHexU(ZydisString *s, ZydisU64 value, ZydisU8 paddingLength, - ZydisBool uppercase, const char* prefix, const char* suffix) -{ -#if defined(ZYDIS_X64) || defined(ZYDIS_AARCH64) - return ZydisPrintHexU64(s, value, paddingLength, uppercase, prefix, suffix); -#else - if (value & 0xFFFFFFFF00000000) - { - return ZydisPrintHexU64(s, value, paddingLength, uppercase, prefix, suffix); - } else - { - return ZydisPrintHexU32(s, (ZydisU32)value, paddingLength, uppercase, prefix, suffix); - } -#endif -} - -ZydisStatus ZydisPrintHexS(ZydisString *s, ZydisI64 value, ZydisU8 paddingLength, - ZydisBool uppercase, const char* prefix, const char* suffix) -{ - if (value < 0) - { - ZYDIS_CHECK(ZydisStringAppendC(s, "-", ZYDIS_LETTER_CASE_DEFAULT)); - if (prefix) - { - ZYDIS_CHECK(ZydisStringAppendC(s, prefix, ZYDIS_LETTER_CASE_DEFAULT)); - } - return ZydisPrintHexU(s, -value, paddingLength, uppercase, ZYDIS_NULL, suffix); - } - return ZydisPrintHexU(s, value, paddingLength, uppercase, prefix, suffix); -} - -/* ---------------------------------------------------------------------------------------------- */ - -/* ============================================================================================== */ diff --git a/src/FormatHelper.h b/src/FormatHelper.h deleted file mode 100644 index b6133bb..0000000 --- a/src/FormatHelper.h +++ /dev/null @@ -1,220 +0,0 @@ -/*************************************************************************************************** - - Zyan Disassembler Library (Zydis) - - Original Author : Florian Bernd, Joel Höner - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - -***************************************************************************************************/ - -#ifndef ZYDIS_FORMATHELPER_H -#define ZYDIS_FORMATHELPER_H - -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* ============================================================================================== */ -/* Enums and types */ -/* ============================================================================================== */ - -/* ---------------------------------------------------------------------------------------------- */ -/* Letter Case */ -/* ---------------------------------------------------------------------------------------------- */ - -/** - * @brief Defines the `ZydisLetterCase` datatype. - */ -typedef ZydisU8 ZydisLetterCase; - -/** - * @brief Values that represent letter cases. - */ -enum ZydisLetterCases -{ - /** - * @brief Prints the given text "as it is". - */ - ZYDIS_LETTER_CASE_DEFAULT, - /** - * @brief Prints the given text in lowercase letters. - */ - ZYDIS_LETTER_CASE_LOWER, - /** - * @brief Prints the given text in uppercase letters. - */ - ZYDIS_LETTER_CASE_UPPER -}; - -/* ---------------------------------------------------------------------------------------------- */ - -/* ============================================================================================== */ -/* Functions */ -/* ============================================================================================== */ - -/* ---------------------------------------------------------------------------------------------- */ -/* String */ -/* ---------------------------------------------------------------------------------------------- */ - -/** - * @brief Appends the @c ZydisString to another @c ZydisString. - * - * @param buffer The string to append to. - * @param text The string to append. - * @param letterCase The desired letter-case. - * - * @return @c ZYDIS_STATUS_SUCCESS, if the function succeeded, or - * @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not - * sufficient to append the given @c text. - */ -ZYDIS_NO_EXPORT ZydisStatus ZydisStringAppend( - ZydisString* s, const ZydisString* text, ZydisLetterCase letterCase); - -/** - * @brief Appends the given C string to the @c ZydisString. - * - * @param s The string to append to. - * @param text The text to append. - * @param letterCase The desired letter-case. - * - * @return @c ZYDIS_STATUS_SUCCESS, if the function succeeded, or - * @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not - * sufficient to append the given @c text. - */ -ZYDIS_INLINE ZydisStatus ZydisStringAppendC( - ZydisString* s, const char* text, ZydisLetterCase letterCase) -{ - ZYDIS_ASSERT(text); - - ZydisUSize len = ZydisStrLen(text); - ZydisString zyStr = { - .s = (char*)text, - .length = len, - .capacity = len - }; - - return ZydisStringAppend(s, &zyStr, letterCase); -} - -/* ---------------------------------------------------------------------------------------------- */ -/* Decimal values */ -/* ---------------------------------------------------------------------------------------------- */ - -/** - * @brief Formats the given unsigned ordinal @c value to its decimal text-representation and - * appends it to @c s. - * - * @param s A pointer to the string. - * @param value The value. - * @param paddingLength Padds the converted value with leading zeros, if the number of chars is - * less than the @c paddingLength. - * - * @return @c ZYDIS_STATUS_SUCCESS, if the function succeeded, or - * @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not - * sufficient to append the given @c value. - * - * The string-buffer pointer is increased by the number of chars written, if the call was - * successfull. - */ -ZYDIS_NO_EXPORT ZydisStatus ZydisPrintDecU(ZydisString* s, ZydisU64 value, ZydisU8 paddingLength); - -/** - * @brief Formats the given signed ordinal @c value to its decimal text-representation and - * appends it to @c s. - * - * @param s A pointer to the string. - * @param value The value. - * @param paddingLength Padds the converted value with leading zeros, if the number of chars is - * less than the @c paddingLength (the sign char is ignored). - * - * @return @c ZYDIS_STATUS_SUCCESS, if the function succeeded, or - * @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not - * sufficient to append the given @c value. - * - * The string-buffer pointer is increased by the number of chars written, if the call was - * successfull. - */ -ZYDIS_NO_EXPORT ZydisStatus ZydisPrintDecS(ZydisString* s, ZydisI64 value, - ZydisU8 paddingLength); - -/* ---------------------------------------------------------------------------------------------- */ -/* Hexadecimal values */ -/* ---------------------------------------------------------------------------------------------- */ - -/** - * @brief Formats the given unsigned ordinal @c value to its hexadecimal text-representation and - * appends it to the @c buffer. - * - * @param s A pointer to the string. - * @param value The value. - * @param paddingLength Padds the converted value with leading zeros, if the number of chars is - * less than the @c paddingLength. - * @param uppercase Set @c TRUE to print the hexadecimal value in uppercase letters instead - * of lowercase ones. - * @param prefix The string to use as prefix or `NULL`, if not needed. - * @param suffix The string to use as suffix or `NULL`, if not needed. - * - * @return @c ZYDIS_STATUS_SUCCESS, if the function succeeded, or - * @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not - * sufficient to append the given @c value. - * - * The string-buffer pointer is increased by the number of chars written, if the call was - * successfull. - */ -ZYDIS_NO_EXPORT ZydisStatus ZydisPrintHexU(ZydisString* s, ZydisU64 value, - ZydisU8 paddingLength, ZydisBool uppercase, const char* prefix, const char* suffix); - -/** - * @brief Formats the given signed ordinal @c value to its hexadecimal text-representation and - * appends it to the @c buffer. - * - * @param s A pointer to the string. - * @param value The value. - * @param paddingLength Padds the converted value with leading zeros, if the number of chars is - * less than the @c paddingLength (the sign char is ignored). - * @param uppercase Set @c TRUE to print the hexadecimal value in uppercase letters instead - * of lowercase ones. - * @param prefix The string to use as prefix or `NULL`, if not needed. - * @param suffix The string to use as suffix or `NULL`, if not needed. - * - * @return @c ZYDIS_STATUS_SUCCESS, if the function succeeded, or - * @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not - * sufficient to append the given @c value. - * - * The string-buffer pointer is increased by the number of chars written, if the call was - * successfull. - */ -ZYDIS_NO_EXPORT ZydisStatus ZydisPrintHexS(ZydisString* s, ZydisI64 value, - ZydisU8 paddingLength, ZydisBool uppercase, const char* prefix, const char* suffix); - -/* ---------------------------------------------------------------------------------------------- */ - -/* ============================================================================================== */ - -#ifdef __cplusplus -} -#endif - -#endif /* ZYDIS_FORMATHELPER_H */ diff --git a/src/Formatter.c b/src/Formatter.c index c719b0e..6fa78fb 100644 --- a/src/Formatter.c +++ b/src/Formatter.c @@ -2,7 +2,7 @@ Zyan Disassembler Library (Zydis) - Original Author : Florian Bernd + Original Author : Florian Bernd, Joel Höner * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -27,8 +27,6 @@ #include #include #include -#include -#include /* ============================================================================================== */ /* Instruction formatter */ @@ -39,70 +37,70 @@ /* ---------------------------------------------------------------------------------------------- */ static ZydisStatus ZydisFormatterPrintPrefixesIntel(const ZydisFormatter* formatter, - ZydisString* buffer, const ZydisDecodedInstruction* instruction, void* userData) + ZydisString* string, const ZydisDecodedInstruction* instruction, void* userData) { - (void)userData; + ZYDIS_UNUSED_PARAMETER(userData); - if (!formatter || !buffer || !instruction) + if (!formatter || !instruction) { return ZYDIS_STATUS_INVALID_PARAMETER; } if (instruction->attributes & ZYDIS_ATTRIB_HAS_LOCK) { - return ZydisStringAppendC(buffer, "lock ", formatter->letterCase); + return ZydisStringAppendExC(string, "lock ", formatter->letterCase); } if (instruction->attributes & ZYDIS_ATTRIB_HAS_REP) { - return ZydisStringAppendC(buffer, "rep ", formatter->letterCase); + return ZydisStringAppendExC(string, "rep ", formatter->letterCase); } if (instruction->attributes & ZYDIS_ATTRIB_HAS_REPE) { - return ZydisStringAppendC(buffer, "repe ", formatter->letterCase); + return ZydisStringAppendExC(string, "repe ", formatter->letterCase); } if (instruction->attributes & ZYDIS_ATTRIB_HAS_REPNE) { - return ZydisStringAppendC(buffer, "repne ", formatter->letterCase); + return ZydisStringAppendExC(string, "repne ", formatter->letterCase); } if (instruction->attributes & ZYDIS_ATTRIB_HAS_BOUND) { - return ZydisStringAppendC(buffer, "bnd ", formatter->letterCase); + return ZydisStringAppendExC(string, "bnd ", formatter->letterCase); } if (instruction->attributes & ZYDIS_ATTRIB_HAS_XACQUIRE) { - return ZydisStringAppendC(buffer, "xacquire ", formatter->letterCase); + return ZydisStringAppendExC(string, "xacquire ", formatter->letterCase); } if (instruction->attributes & ZYDIS_ATTRIB_HAS_XRELEASE) { - return ZydisStringAppendC(buffer, "xrelease ", formatter->letterCase); + return ZydisStringAppendExC(string, "xrelease ", formatter->letterCase); } return ZYDIS_STATUS_SUCCESS; } static ZydisStatus ZydisFormatterPrintMnemonicIntel(const ZydisFormatter* formatter, - ZydisString* buffer, const ZydisDecodedInstruction* instruction, void* userData) + ZydisString* string, const ZydisDecodedInstruction* instruction, void* userData) { - (void)userData; + ZYDIS_UNUSED_PARAMETER(userData); - if (!formatter || !buffer || !instruction) + if (!formatter || !instruction) { return ZYDIS_STATUS_INVALID_PARAMETER; } - const char* mnemonic = ZydisMnemonicGetString(instruction->mnemonic); + const ZydisString* mnemonic = ZydisMnemonicGetStringEx(instruction->mnemonic); if (!mnemonic) { - mnemonic = "invalid"; + return ZydisStringAppendExC(string, "invalid", formatter->letterCase); } - ZYDIS_CHECK(ZydisStringAppendC(buffer, mnemonic, formatter->letterCase)); + ZYDIS_CHECK(ZydisStringAppendEx(string, mnemonic, formatter->letterCase)); if (instruction->attributes & ZYDIS_ATTRIB_IS_FAR_BRANCH) { - return ZydisStringAppendC(buffer, " far", formatter->letterCase); + return ZydisStringAppendExC(string, " far", formatter->letterCase); } return ZYDIS_STATUS_SUCCESS; @@ -111,12 +109,12 @@ static ZydisStatus ZydisFormatterPrintMnemonicIntel(const ZydisFormatter* format /* ---------------------------------------------------------------------------------------------- */ static ZydisStatus ZydisFormatterFormatOperandRegIntel(const ZydisFormatter* formatter, - ZydisString* buffer, const ZydisDecodedInstruction* instruction, + ZydisString* string, const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, void* userData) { - (void)userData; + ZYDIS_UNUSED_PARAMETER(userData); - if (!formatter || !buffer || !instruction || !operand) + if (!formatter || !instruction || !operand) { return ZYDIS_STATUS_INVALID_PARAMETER; } @@ -129,22 +127,21 @@ static ZydisStatus ZydisFormatterFormatOperandRegIntel(const ZydisFormatter* for const char* reg = ZydisRegisterGetString(operand->reg.value); if (!reg) { - reg = "invalid"; + return ZydisStringAppendExC(string, "invalid", formatter->letterCase); } - - return ZydisStringAppendC(buffer, reg, formatter->letterCase); + return ZydisStringAppendExC(string, reg, formatter->letterCase); } static ZydisStatus ZydisFormatterFormatOperandMemIntel(const ZydisFormatter* formatter, - ZydisString* buffer, const ZydisDecodedInstruction* instruction, + ZydisString* string, const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, void* userData) { - if (!formatter || !buffer || !instruction || !operand) + if (!formatter || !instruction || !operand) { return ZYDIS_STATUS_INVALID_PARAMETER; } - ZYDIS_CHECK(ZydisStringAppendC(buffer, "[", ZYDIS_LETTER_CASE_DEFAULT)); + ZYDIS_CHECK(ZydisStringAppendC(string, "[")); if (operand->mem.disp.hasDisplacement && ( (operand->mem.base == ZYDIS_REGISTER_NONE) || @@ -158,13 +155,13 @@ static ZydisStatus ZydisFormatterFormatOperandMemIntel(const ZydisFormatter* for { ZydisU64 address; ZYDIS_CHECK(ZydisCalcAbsoluteAddress(instruction, operand, &address)); - ZYDIS_CHECK(formatter->funcPrintAddress(formatter, buffer, instruction, operand, + ZYDIS_CHECK(formatter->funcPrintAddress(formatter, string, instruction, operand, address, userData)); } else { - ZYDIS_CHECK(ZydisStringAppendC(buffer, ZydisRegisterGetString(operand->mem.base), + ZYDIS_CHECK(ZydisStringAppendExC(string, ZydisRegisterGetString(operand->mem.base), formatter->letterCase)); - ZYDIS_CHECK(formatter->funcPrintDisplacement(formatter, buffer, instruction, operand, + ZYDIS_CHECK(formatter->funcPrintDisplacement(formatter, string, instruction, operand, userData)); } } else @@ -177,7 +174,7 @@ static ZydisStatus ZydisFormatterFormatOperandMemIntel(const ZydisFormatter* for { return ZYDIS_STATUS_INVALID_PARAMETER; } - ZYDIS_CHECK(ZydisStringAppendC(buffer, reg, formatter->letterCase)); + ZYDIS_CHECK(ZydisStringAppendExC(string, reg, formatter->letterCase)); } if ((operand->mem.index != ZYDIS_REGISTER_NONE) && (operand->mem.type != ZYDIS_MEMOP_TYPE_MIB)) @@ -189,47 +186,45 @@ static ZydisStatus ZydisFormatterFormatOperandMemIntel(const ZydisFormatter* for } if (operand->mem.base != ZYDIS_REGISTER_NONE) { - ZYDIS_CHECK( - ZydisStringAppendC(buffer, "+", ZYDIS_LETTER_CASE_DEFAULT)); + ZYDIS_CHECK(ZydisStringAppendC(string, "+")); } - ZYDIS_CHECK(ZydisStringAppendC(buffer, reg, formatter->letterCase)); + ZYDIS_CHECK(ZydisStringAppendExC(string, reg, formatter->letterCase)); if (operand->mem.scale) { - ZYDIS_CHECK( - ZydisStringAppendC(buffer, "*", ZYDIS_LETTER_CASE_DEFAULT)); - ZYDIS_CHECK(ZydisPrintDecU(buffer, operand->mem.scale, 0)); + ZYDIS_CHECK(ZydisStringAppendC(string, "*")); + ZYDIS_CHECK(ZydisPrintDecU(string, operand->mem.scale, 0)); } } - ZYDIS_CHECK(formatter->funcPrintDisplacement(formatter, buffer, - instruction, operand, userData)); + ZYDIS_CHECK(formatter->funcPrintDisplacement(formatter, string, instruction, operand, + userData)); } - return ZydisStringAppendC(buffer, "]", ZYDIS_LETTER_CASE_DEFAULT); + return ZydisStringAppendC(string, "]"); } static ZydisStatus ZydisFormatterFormatOperandPtrIntel(const ZydisFormatter* formatter, - ZydisString* buffer, const ZydisDecodedInstruction* instruction, + ZydisString* string, const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, void* userData) { - (void)userData; + ZYDIS_UNUSED_PARAMETER(userData); - if (!formatter || !buffer || !instruction || !operand) + if (!formatter || !instruction || !operand) { return ZYDIS_STATUS_INVALID_PARAMETER; } - ZYDIS_CHECK(ZydisPrintHexU(buffer, operand->ptr.segment, 4, + ZYDIS_CHECK(ZydisPrintHexU(string, operand->ptr.segment, 4, formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix)); - ZYDIS_CHECK(ZydisStringAppendC(buffer, ":", ZYDIS_LETTER_CASE_DEFAULT)); - return ZydisPrintHexU(buffer, operand->ptr.offset, 8, + ZYDIS_CHECK(ZydisStringAppendC(string, ":")); + return ZydisPrintHexU(string, operand->ptr.offset, 8, formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); } static ZydisStatus ZydisFormatterFormatOperandImmIntel(const ZydisFormatter* formatter, - ZydisString* buffer, const ZydisDecodedInstruction* instruction, + ZydisString* string, const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, void* userData) { - if (!formatter || !buffer || !instruction || !operand) + if (!formatter || !instruction || !operand) { return ZYDIS_STATUS_INVALID_PARAMETER; } @@ -244,8 +239,8 @@ static ZydisStatus ZydisFormatterFormatOperandImmIntel(const ZydisFormatter* for { ZydisU64 address; ZYDIS_CHECK(ZydisCalcAbsoluteAddress(instruction, operand, &address)); - return formatter->funcPrintAddress(formatter, buffer, instruction, operand, - address, userData); + return formatter->funcPrintAddress(formatter, string, instruction, operand, address, + userData); } case ZYDIS_ADDR_FORMAT_RELATIVE_SIGNED: printSignedHEX = ZYDIS_TRUE; @@ -258,29 +253,28 @@ static ZydisStatus ZydisFormatterFormatOperandImmIntel(const ZydisFormatter* for if (printSignedHEX) { - return ZydisPrintHexS(buffer, (ZydisI32)operand->imm.value.s, + return ZydisPrintHexS(string, (ZydisI32)operand->imm.value.s, formatter->hexPaddingAddress, formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); } - return ZydisPrintHexU(buffer, operand->imm.value.u, + return ZydisPrintHexU(string, operand->imm.value.u, formatter->hexPaddingAddress, formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); } // The immediate operand contains an actual ordinal value - return formatter->funcPrintImmediate( - formatter, buffer, instruction, operand, userData); + return formatter->funcPrintImmediate(formatter, string, instruction, operand, userData); } /* ---------------------------------------------------------------------------------------------- */ static ZydisStatus ZydisFormatterPrintAddressIntel(const ZydisFormatter* formatter, - ZydisString* buffer, const ZydisDecodedInstruction* instruction, + ZydisString* string, const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, ZydisU64 address, void* userData) { - (void)userData; + ZYDIS_UNUSED_PARAMETER(userData); - if (!formatter || !buffer || !instruction || !operand) + if (!formatter || !instruction || !operand) { return ZYDIS_STATUS_INVALID_PARAMETER; } @@ -288,13 +282,13 @@ static ZydisStatus ZydisFormatterPrintAddressIntel(const ZydisFormatter* formatt switch (instruction->stackWidth) { case 16: - return ZydisPrintHexU(buffer, (ZydisU16)address, 4, + return ZydisPrintHexU(string, (ZydisU16)address, 4, formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); case 32: - return ZydisPrintHexU(buffer, (ZydisU32)address, 8, + return ZydisPrintHexU(string, (ZydisU32)address, 8, formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); case 64: - return ZydisPrintHexU(buffer, address, 16, + return ZydisPrintHexU(string, address, 16, formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); default: return ZYDIS_STATUS_INVALID_PARAMETER; @@ -302,12 +296,12 @@ static ZydisStatus ZydisFormatterPrintAddressIntel(const ZydisFormatter* formatt } static ZydisStatus ZydisFormatterPrintDisplacementIntel(const ZydisFormatter* formatter, - ZydisString* buffer, const ZydisDecodedInstruction* instruction, + ZydisString* string, const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, void* userData) { - (void)userData; + ZYDIS_UNUSED_PARAMETER(userData); - if (!formatter || !buffer || !instruction || !operand) + if (!formatter || !instruction || !operand) { return ZYDIS_STATUS_INVALID_PARAMETER; } @@ -322,16 +316,16 @@ static ZydisStatus ZydisFormatterPrintDisplacementIntel(const ZydisFormatter* fo (operand->mem.base != ZYDIS_REGISTER_NONE) || (operand->mem.index != ZYDIS_REGISTER_NONE))) { - return ZydisPrintHexS(buffer, operand->mem.disp.value, + return ZydisPrintHexS(string, operand->mem.disp.value, formatter->hexPaddingDisplacement, formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); } if ((operand->mem.base != ZYDIS_REGISTER_NONE) || (operand->mem.index != ZYDIS_REGISTER_NONE)) { - ZYDIS_CHECK(ZydisStringAppendC(buffer, "+", ZYDIS_LETTER_CASE_DEFAULT)); + ZYDIS_CHECK(ZydisStringAppendC(string, "+")); } - return ZydisPrintHexU(buffer, (ZydisU64)operand->mem.disp.value, + return ZydisPrintHexU(string, (ZydisU64)operand->mem.disp.value, formatter->hexPaddingDisplacement, formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); } @@ -339,12 +333,12 @@ static ZydisStatus ZydisFormatterPrintDisplacementIntel(const ZydisFormatter* fo } static ZydisStatus ZydisFormatterPrintImmediateIntel(const ZydisFormatter* formatter, - ZydisString* buffer, const ZydisDecodedInstruction* instruction, + ZydisString* string, const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, void* userData) { - (void)userData; + ZYDIS_UNUSED_PARAMETER(userData); - if (!formatter || !buffer || !instruction || !operand) + if (!formatter || !instruction || !operand) { return ZYDIS_STATUS_INVALID_PARAMETER; } @@ -360,19 +354,19 @@ static ZydisStatus ZydisFormatterPrintImmediateIntel(const ZydisFormatter* forma switch (operand->size) { case 8: - return ZydisPrintHexS(buffer, (ZydisI8)operand->imm.value.s, + return ZydisPrintHexS(string, (ZydisI8)operand->imm.value.s, formatter->hexPaddingImmediate, formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); case 16: - return ZydisPrintHexS(buffer, (ZydisI16)operand->imm.value.s, + return ZydisPrintHexS(string, (ZydisI16)operand->imm.value.s, formatter->hexPaddingImmediate, formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); case 32: - return ZydisPrintHexS(buffer, (ZydisI32)operand->imm.value.s, + return ZydisPrintHexS(string, (ZydisI32)operand->imm.value.s, formatter->hexPaddingImmediate, formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); case 64: - return ZydisPrintHexS(buffer, operand->imm.value.s, + return ZydisPrintHexS(string, operand->imm.value.s, formatter->hexPaddingImmediate, formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); default: @@ -382,19 +376,19 @@ static ZydisStatus ZydisFormatterPrintImmediateIntel(const ZydisFormatter* forma switch (instruction->operandWidth) { case 8: - return ZydisPrintHexU(buffer, (ZydisU8)operand->imm.value.u, + return ZydisPrintHexU(string, (ZydisU8)operand->imm.value.u, formatter->hexPaddingImmediate, formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); case 16: - return ZydisPrintHexU(buffer, (ZydisU16)operand->imm.value.u, + return ZydisPrintHexU(string, (ZydisU16)operand->imm.value.u, formatter->hexPaddingImmediate, formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); case 32: - return ZydisPrintHexU(buffer, (ZydisU32)operand->imm.value.u, + return ZydisPrintHexU(string, (ZydisU32)operand->imm.value.u, formatter->hexPaddingImmediate, formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); case 64: - return ZydisPrintHexU(buffer, operand->imm.value.u, + return ZydisPrintHexU(string, operand->imm.value.u, formatter->hexPaddingImmediate, formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); default: @@ -405,12 +399,12 @@ static ZydisStatus ZydisFormatterPrintImmediateIntel(const ZydisFormatter* forma /* ---------------------------------------------------------------------------------------------- */ static ZydisStatus ZydisFormatterPrintOperandSizeIntel(const ZydisFormatter* formatter, - ZydisString* buffer, const ZydisDecodedInstruction* instruction, + ZydisString* string, const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, void* userData) { - (void)userData; + ZYDIS_UNUSED_PARAMETER(userData); - if (!formatter || !buffer || !instruction || !operand) + if (!formatter || !instruction || !operand) { return ZYDIS_STATUS_INVALID_PARAMETER; } @@ -505,19 +499,20 @@ static ZydisStatus ZydisFormatterPrintOperandSizeIntel(const ZydisFormatter* for if (str) { - return ZydisStringAppendC(buffer, str, formatter->letterCase); + return ZydisStringAppendExC(string, str, formatter->letterCase); } } + return ZYDIS_STATUS_SUCCESS; } static ZydisStatus ZydisFormatterPrintSegmentIntel(const ZydisFormatter* formatter, - ZydisString* buffer, const ZydisDecodedInstruction* instruction, + ZydisString* string, const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, void* userData) { - (void)userData; + ZYDIS_UNUSED_PARAMETER(userData); - if (!formatter || !buffer || !instruction || !operand) + if (!formatter || !instruction || !operand) { return ZYDIS_STATUS_INVALID_PARAMETER; } @@ -528,43 +523,41 @@ static ZydisStatus ZydisFormatterPrintSegmentIntel(const ZydisFormatter* formatt case ZYDIS_REGISTER_CS: case ZYDIS_REGISTER_FS: case ZYDIS_REGISTER_GS: - ZYDIS_CHECK( - ZydisStringAppendC(buffer, ZydisRegisterGetString(operand->mem.segment), - formatter->letterCase)); - return ZydisStringAppendC(buffer, ":", ZYDIS_LETTER_CASE_DEFAULT); + ZYDIS_CHECK(ZydisStringAppendExC(string, + ZydisRegisterGetString(operand->mem.segment), formatter->letterCase)); + return ZydisStringAppendC(string, ":"); case ZYDIS_REGISTER_SS: if ((formatter->forceSegments) || (instruction->attributes & ZYDIS_ATTRIB_HAS_SEGMENT_SS)) { - ZYDIS_CHECK( - ZydisStringAppendC(buffer, ZydisRegisterGetString(operand->mem.segment), - formatter->letterCase)); - return ZydisStringAppendC(buffer, ":", ZYDIS_LETTER_CASE_DEFAULT); + ZYDIS_CHECK(ZydisStringAppendExC(string, + ZydisRegisterGetString(operand->mem.segment), formatter->letterCase)); + return ZydisStringAppendC(string, ":"); } break; case ZYDIS_REGISTER_DS: if ((formatter->forceSegments) || (instruction->attributes & ZYDIS_ATTRIB_HAS_SEGMENT_DS)) { - ZYDIS_CHECK( - ZydisStringAppendC(buffer, ZydisRegisterGetString(operand->mem.segment), - formatter->letterCase)); - return ZydisStringAppendC(buffer, ":", ZYDIS_LETTER_CASE_DEFAULT); + ZYDIS_CHECK(ZydisStringAppendExC(string, + ZydisRegisterGetString(operand->mem.segment), formatter->letterCase)); + return ZydisStringAppendC(string, ":"); } break; default: break; } + return ZYDIS_STATUS_SUCCESS; } static ZydisStatus ZydisFormatterPrintDecoratorIntel(const ZydisFormatter* formatter, - ZydisString* buffer, const ZydisDecodedInstruction* instruction, + ZydisString* string, const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, ZydisDecoratorType type, void* userData) { - (void)userData; + ZYDIS_UNUSED_PARAMETER(userData); - if (!formatter || !buffer || !instruction || !operand) + if (!formatter || !instruction || !operand) { return ZYDIS_STATUS_INVALID_PARAMETER; } @@ -580,13 +573,12 @@ static ZydisStatus ZydisFormatterPrintDecoratorIntel(const ZydisFormatter* forma { return ZYDIS_STATUS_INVALID_PARAMETER; } - ZYDIS_CHECK(ZydisStringAppendC(buffer, " {", ZYDIS_LETTER_CASE_DEFAULT)); - ZYDIS_CHECK(ZydisStringAppendC(buffer, reg, formatter->letterCase)); - ZYDIS_CHECK(ZydisStringAppendC(buffer, "}", ZYDIS_LETTER_CASE_DEFAULT)); + ZYDIS_CHECK(ZydisStringAppendC(string, " {")); + ZYDIS_CHECK(ZydisStringAppendExC(string, reg, formatter->letterCase)); + ZYDIS_CHECK(ZydisStringAppendC(string, "}")); if (instruction->avx.mask.mode == ZYDIS_MASK_MODE_ZERO) { - ZYDIS_CHECK( - ZydisStringAppendC(buffer, " {z}", ZYDIS_LETTER_CASE_DEFAULT)); + ZYDIS_CHECK(ZydisStringAppendC(string, " {z}")); } } break; @@ -599,28 +591,22 @@ static ZydisStatus ZydisFormatterPrintDecoratorIntel(const ZydisFormatter* forma case ZYDIS_BROADCAST_MODE_INVALID: break; case ZYDIS_BROADCAST_MODE_1_TO_2: - ZYDIS_CHECK( - ZydisStringAppendC(buffer, " {1to2}", ZYDIS_LETTER_CASE_DEFAULT)); + ZYDIS_CHECK(ZydisStringAppendC(string, " {1to2}")); break; case ZYDIS_BROADCAST_MODE_1_TO_4: - ZYDIS_CHECK( - ZydisStringAppendC(buffer, " {1to4}", ZYDIS_LETTER_CASE_DEFAULT)); + ZYDIS_CHECK(ZydisStringAppendC(string, " {1to4}")); break; case ZYDIS_BROADCAST_MODE_1_TO_8: - ZYDIS_CHECK( - ZydisStringAppendC(buffer, " {1to8}", ZYDIS_LETTER_CASE_DEFAULT)); + ZYDIS_CHECK(ZydisStringAppendC(string, " {1to8}")); break; case ZYDIS_BROADCAST_MODE_1_TO_16: - ZYDIS_CHECK( - ZydisStringAppendC(buffer, " {1to16}", ZYDIS_LETTER_CASE_DEFAULT)); + ZYDIS_CHECK(ZydisStringAppendC(string, " {1to16}")); break; case ZYDIS_BROADCAST_MODE_4_TO_8: - ZYDIS_CHECK( - ZydisStringAppendC(buffer, " {4to8}", ZYDIS_LETTER_CASE_DEFAULT)); + ZYDIS_CHECK(ZydisStringAppendC(string, " {4to8}")); break; case ZYDIS_BROADCAST_MODE_4_TO_16: - ZYDIS_CHECK( - ZydisStringAppendC(buffer, " {4to16}", ZYDIS_LETTER_CASE_DEFAULT)); + ZYDIS_CHECK(ZydisStringAppendC(string, " {4to16}")); break; default: return ZYDIS_STATUS_INVALID_PARAMETER; @@ -635,20 +621,16 @@ static ZydisStatus ZydisFormatterPrintDecoratorIntel(const ZydisFormatter* forma case ZYDIS_ROUNDING_MODE_INVALID: break; case ZYDIS_ROUNDING_MODE_RN: - ZYDIS_CHECK(ZydisStringAppendC( - buffer, " {rn-sae}", ZYDIS_LETTER_CASE_DEFAULT)); + ZYDIS_CHECK(ZydisStringAppendC(string, " {rn-sae}")); break; case ZYDIS_ROUNDING_MODE_RD: - ZYDIS_CHECK(ZydisStringAppendC( - buffer, " {rd-sae}", ZYDIS_LETTER_CASE_DEFAULT)); + ZYDIS_CHECK(ZydisStringAppendC(string, " {rd-sae}")); break; case ZYDIS_ROUNDING_MODE_RU: - ZYDIS_CHECK(ZydisStringAppendC( - buffer, " {ru-sae}", ZYDIS_LETTER_CASE_DEFAULT)); + ZYDIS_CHECK(ZydisStringAppendC(string, " {ru-sae}")); break; case ZYDIS_ROUNDING_MODE_RZ: - ZYDIS_CHECK(ZydisStringAppendC( - buffer, " {rz-sae}", ZYDIS_LETTER_CASE_DEFAULT)); + ZYDIS_CHECK(ZydisStringAppendC(string, " {rz-sae}")); break; default: return ZYDIS_STATUS_INVALID_PARAMETER; @@ -660,20 +642,16 @@ static ZydisStatus ZydisFormatterPrintDecoratorIntel(const ZydisFormatter* forma case ZYDIS_ROUNDING_MODE_INVALID: break; case ZYDIS_ROUNDING_MODE_RN: - ZYDIS_CHECK( - ZydisStringAppendC(buffer, " {rn}", ZYDIS_LETTER_CASE_DEFAULT)); + ZYDIS_CHECK(ZydisStringAppendC(string, " {rn}")); break; case ZYDIS_ROUNDING_MODE_RD: - ZYDIS_CHECK( - ZydisStringAppendC(buffer, " {rd}", ZYDIS_LETTER_CASE_DEFAULT)); + ZYDIS_CHECK(ZydisStringAppendC(string, " {rd}")); break; case ZYDIS_ROUNDING_MODE_RU: - ZYDIS_CHECK( - ZydisStringAppendC(buffer, " {ru}", ZYDIS_LETTER_CASE_DEFAULT)); + ZYDIS_CHECK(ZydisStringAppendC(string, " {ru}")); break; case ZYDIS_ROUNDING_MODE_RZ: - ZYDIS_CHECK( - ZydisStringAppendC(buffer, " {rz}", ZYDIS_LETTER_CASE_DEFAULT)); + ZYDIS_CHECK(ZydisStringAppendC(string, " {rz}")); break; default: return ZYDIS_STATUS_INVALID_PARAMETER; @@ -683,8 +661,7 @@ static ZydisStatus ZydisFormatterPrintDecoratorIntel(const ZydisFormatter* forma case ZYDIS_DECORATOR_TYPE_SAE: if (instruction->avx.hasSAE && !instruction->avx.rounding.mode) { - ZYDIS_CHECK( - ZydisStringAppendC(buffer, " {sae}", ZYDIS_LETTER_CASE_DEFAULT)); + ZYDIS_CHECK(ZydisStringAppendC(string, " {sae}")); } break; case ZYDIS_DECORATOR_TYPE_SWIZZLE: @@ -695,32 +672,25 @@ static ZydisStatus ZydisFormatterPrintDecoratorIntel(const ZydisFormatter* forma // Nothing to do here break; case ZYDIS_SWIZZLE_MODE_CDAB: - ZYDIS_CHECK( - ZydisStringAppendC(buffer, " {cdab}", ZYDIS_LETTER_CASE_DEFAULT)); + ZYDIS_CHECK(ZydisStringAppendC(string, " {cdab}")); break; case ZYDIS_SWIZZLE_MODE_BADC: - ZYDIS_CHECK( - ZydisStringAppendC(buffer, " {badc}", ZYDIS_LETTER_CASE_DEFAULT)); + ZYDIS_CHECK(ZydisStringAppendC(string, " {badc}")); break; case ZYDIS_SWIZZLE_MODE_DACB: - ZYDIS_CHECK( - ZydisStringAppendC(buffer, " {dacb}", ZYDIS_LETTER_CASE_DEFAULT)); + ZYDIS_CHECK(ZydisStringAppendC(string, " {dacb}")); break; case ZYDIS_SWIZZLE_MODE_AAAA: - ZYDIS_CHECK( - ZydisStringAppendC(buffer, " {aaaa}", ZYDIS_LETTER_CASE_DEFAULT)); + ZYDIS_CHECK(ZydisStringAppendC(string, " {aaaa}")); break; case ZYDIS_SWIZZLE_MODE_BBBB: - ZYDIS_CHECK( - ZydisStringAppendC(buffer, " {bbbb}", ZYDIS_LETTER_CASE_DEFAULT)); + ZYDIS_CHECK(ZydisStringAppendC(string, " {bbbb}")); break; case ZYDIS_SWIZZLE_MODE_CCCC: - ZYDIS_CHECK( - ZydisStringAppendC(buffer, " {cccc}", ZYDIS_LETTER_CASE_DEFAULT)); + ZYDIS_CHECK(ZydisStringAppendC(string, " {cccc}")); break; case ZYDIS_SWIZZLE_MODE_DDDD: - ZYDIS_CHECK( - ZydisStringAppendC(buffer, " {dddd}", ZYDIS_LETTER_CASE_DEFAULT)); + ZYDIS_CHECK(ZydisStringAppendC(string, " {dddd}")); break; default: return ZYDIS_STATUS_INVALID_PARAMETER; @@ -732,24 +702,19 @@ static ZydisStatus ZydisFormatterPrintDecoratorIntel(const ZydisFormatter* forma case ZYDIS_CONVERSION_MODE_INVALID: break; case ZYDIS_CONVERSION_MODE_FLOAT16: - ZYDIS_CHECK( - ZydisStringAppendC(buffer, " {float16}", ZYDIS_LETTER_CASE_DEFAULT)); + ZYDIS_CHECK(ZydisStringAppendC(string, " {float16}")); break; case ZYDIS_CONVERSION_MODE_SINT8: - ZYDIS_CHECK( - ZydisStringAppendC(buffer, " {sint8}", ZYDIS_LETTER_CASE_DEFAULT)); + ZYDIS_CHECK(ZydisStringAppendC(string, " {sint8}")); break; case ZYDIS_CONVERSION_MODE_UINT8: - ZYDIS_CHECK( - ZydisStringAppendC(buffer, " {uint8}", ZYDIS_LETTER_CASE_DEFAULT)); + ZYDIS_CHECK(ZydisStringAppendC(string, " {uint8}")); break; case ZYDIS_CONVERSION_MODE_SINT16: - ZYDIS_CHECK( - ZydisStringAppendC(buffer, " {sint16}", ZYDIS_LETTER_CASE_DEFAULT)); + ZYDIS_CHECK(ZydisStringAppendC(string, " {sint16}")); break; case ZYDIS_CONVERSION_MODE_UINT16: - ZYDIS_CHECK( - ZydisStringAppendC(buffer, " {uint16}", ZYDIS_LETTER_CASE_DEFAULT)); + ZYDIS_CHECK(ZydisStringAppendC(string, " {uint16}")); break; default: return ZYDIS_STATUS_INVALID_PARAMETER; @@ -758,8 +723,7 @@ static ZydisStatus ZydisFormatterPrintDecoratorIntel(const ZydisFormatter* forma case ZYDIS_DECORATOR_TYPE_EVICTION_HINT: if (instruction->avx.hasEvictionHint) { - ZYDIS_CHECK( - ZydisStringAppendC(buffer, " {eh}", ZYDIS_LETTER_CASE_DEFAULT)); + ZYDIS_CHECK(ZydisStringAppendC(string, " {eh}")); } break; default: @@ -770,19 +734,16 @@ static ZydisStatus ZydisFormatterPrintDecoratorIntel(const ZydisFormatter* forma } static ZydisStatus ZydisFormatterFormatInstrIntel(const ZydisFormatter* formatter, - ZydisString* buffer, const ZydisDecodedInstruction* instruction, void* userData) + ZydisString* string, const ZydisDecodedInstruction* instruction, void* userData) { - if (!formatter || !buffer || !instruction) + if (!formatter || !string || !instruction) { return ZYDIS_STATUS_INVALID_PARAMETER; } - ZYDIS_CHECK( - formatter->funcPrintPrefixes(formatter, buffer, instruction, userData)); - ZYDIS_CHECK( - formatter->funcPrintMnemonic(formatter, buffer, instruction, userData)); + ZYDIS_CHECK(formatter->funcPrintPrefixes(formatter, string, instruction, userData)); + ZYDIS_CHECK(formatter->funcPrintMnemonic(formatter, string, instruction, userData)); - ZydisUSize lenRestore = buffer->length; for (ZydisU8 i = 0; i < instruction->operandCount; ++i) { if (instruction->operands[i].visibility == ZYDIS_OPERAND_VISIBILITY_HIDDEN) @@ -790,97 +751,91 @@ static ZydisStatus ZydisFormatterFormatInstrIntel(const ZydisFormatter* formatte break; } + const ZydisUSize strLenRestore = string->length; if (i == 0) { - ZYDIS_CHECK(ZydisStringAppendC(buffer, " ", ZYDIS_LETTER_CASE_DEFAULT)); + ZYDIS_CHECK(ZydisStringAppendC(string, " ")); } else { - lenRestore = buffer->length; - ZYDIS_CHECK(ZydisStringAppendC(buffer, ", ", ZYDIS_LETTER_CASE_DEFAULT)); + ZYDIS_CHECK(ZydisStringAppendC(string, ", ")); } - ZydisUSize bufPreOperandLen = buffer->length; + const ZydisUSize strLenPreOperand = string->length; switch (instruction->operands[i].type) { case ZYDIS_OPERAND_TYPE_REGISTER: - ZYDIS_CHECK(formatter->funcFormatOperandReg(formatter, buffer, - instruction, &instruction->operands[i], userData)); + ZYDIS_CHECK(formatter->funcFormatOperandReg(formatter, string, instruction, + &instruction->operands[i], userData)); break; case ZYDIS_OPERAND_TYPE_MEMORY: { - ZYDIS_CHECK(formatter->funcPrintOperandSize(formatter, buffer, - instruction, &instruction->operands[i], userData)); - ZYDIS_CHECK(formatter->funcPrintSegment(formatter, buffer, - instruction, &instruction->operands[i], userData)); - ZydisUSize lenTemp = buffer->length; - ZYDIS_CHECK(formatter->funcFormatOperandMem(formatter, buffer, - instruction, &instruction->operands[i], userData)); - if (lenTemp == buffer->length) + ZYDIS_CHECK(formatter->funcPrintOperandSize(formatter, string, instruction, + &instruction->operands[i], userData)); + ZYDIS_CHECK(formatter->funcPrintSegment(formatter, string, instruction, + &instruction->operands[i], userData)); + const ZydisUSize strLenTemp = string->length; + ZYDIS_CHECK(formatter->funcFormatOperandMem(formatter, string, instruction, + &instruction->operands[i], userData)); + if (strLenTemp == string->length) { - buffer->length = bufPreOperandLen; + string->length = strLenPreOperand; } break; } case ZYDIS_OPERAND_TYPE_POINTER: - ZYDIS_CHECK(formatter->funcFormatOperandPtr(formatter, buffer, - instruction, &instruction->operands[i], userData)); + ZYDIS_CHECK(formatter->funcFormatOperandPtr(formatter, string, instruction, + &instruction->operands[i], userData)); break; case ZYDIS_OPERAND_TYPE_IMMEDIATE: - ZYDIS_CHECK(formatter->funcFormatOperandImm(formatter, buffer, - instruction, &instruction->operands[i], userData)); + ZYDIS_CHECK(formatter->funcFormatOperandImm(formatter, string, instruction, + &instruction->operands[i], userData)); break; default: return ZYDIS_STATUS_INVALID_PARAMETER; } - if (lenRestore == buffer->length) + if (strLenPreOperand == string->length) { - // Omit whole operand, if the buffer did not change during the formatting-callback - buffer->length = lenRestore; - } else + // Omit whole operand, if the string did not change during the formatting-callback + string->length = strLenRestore; + continue; + } + + if ((instruction->encoding == ZYDIS_INSTRUCTION_ENCODING_EVEX) || + (instruction->encoding == ZYDIS_INSTRUCTION_ENCODING_MVEX)) { - if ((instruction->encoding == ZYDIS_INSTRUCTION_ENCODING_EVEX) || - (instruction->encoding == ZYDIS_INSTRUCTION_ENCODING_MVEX)) + if ((i == 0) && + (instruction->operands[i + 1].encoding == ZYDIS_OPERAND_ENCODING_MASK)) { - if ((i == 0) && - (instruction->operands[i + 1].encoding == ZYDIS_OPERAND_ENCODING_MASK)) + ZYDIS_CHECK(formatter->funcPrintDecorator(formatter, string, instruction, + &instruction->operands[i], ZYDIS_DECORATOR_TYPE_MASK, userData)); + } + if (instruction->operands[i].type == ZYDIS_OPERAND_TYPE_MEMORY) + { + ZYDIS_CHECK(formatter->funcPrintDecorator(formatter, string, instruction, + &instruction->operands[i], ZYDIS_DECORATOR_TYPE_BROADCAST, userData)); + if (instruction->encoding == ZYDIS_INSTRUCTION_ENCODING_MVEX) { - ZYDIS_CHECK(formatter->funcPrintDecorator(formatter, buffer, - instruction, &instruction->operands[i], - ZYDIS_DECORATOR_TYPE_MASK, userData)); + ZYDIS_CHECK(formatter->funcPrintDecorator(formatter, string, instruction, + &instruction->operands[i], ZYDIS_DECORATOR_TYPE_CONVERSION, userData)); + ZYDIS_CHECK(formatter->funcPrintDecorator(formatter, string, instruction, + &instruction->operands[i], ZYDIS_DECORATOR_TYPE_EVICTION_HINT, userData)); } - if (instruction->operands[i].type == ZYDIS_OPERAND_TYPE_MEMORY) - { - ZYDIS_CHECK(formatter->funcPrintDecorator(formatter, buffer, - instruction, &instruction->operands[i], - ZYDIS_DECORATOR_TYPE_BROADCAST, userData)); + } else + { + if ((i == (instruction->operandCount - 1)) || + (instruction->operands[i + 1].type == ZYDIS_OPERAND_TYPE_IMMEDIATE)) + { if (instruction->encoding == ZYDIS_INSTRUCTION_ENCODING_MVEX) { - ZYDIS_CHECK(formatter->funcPrintDecorator(formatter, buffer, - instruction, &instruction->operands[i], - ZYDIS_DECORATOR_TYPE_CONVERSION, userData)); - ZYDIS_CHECK(formatter->funcPrintDecorator(formatter, buffer, - instruction, &instruction->operands[i], - ZYDIS_DECORATOR_TYPE_EVICTION_HINT, userData)); - } - } else - { - if ((i == (instruction->operandCount - 1)) || - (instruction->operands[i + 1].type == ZYDIS_OPERAND_TYPE_IMMEDIATE)) - { - if (instruction->encoding == ZYDIS_INSTRUCTION_ENCODING_MVEX) - { - ZYDIS_CHECK(formatter->funcPrintDecorator(formatter, buffer, - instruction, &instruction->operands[i], - ZYDIS_DECORATOR_TYPE_SWIZZLE, userData)); - } - ZYDIS_CHECK(formatter->funcPrintDecorator(formatter, buffer, - instruction, &instruction->operands[i], - ZYDIS_DECORATOR_TYPE_ROUNDING_CONTROL, userData)); - ZYDIS_CHECK(formatter->funcPrintDecorator(formatter, buffer, - instruction, &instruction->operands[i], - ZYDIS_DECORATOR_TYPE_SAE, userData)); + ZYDIS_CHECK(formatter->funcPrintDecorator(formatter, string, instruction, + &instruction->operands[i], ZYDIS_DECORATOR_TYPE_SWIZZLE, userData)); } + ZYDIS_CHECK(formatter->funcPrintDecorator(formatter, string, instruction, + &instruction->operands[i], ZYDIS_DECORATOR_TYPE_ROUNDING_CONTROL, + userData)); + ZYDIS_CHECK(formatter->funcPrintDecorator(formatter, string, instruction, + &instruction->operands[i], ZYDIS_DECORATOR_TYPE_SAE, userData)); } } } @@ -900,6 +855,8 @@ ZydisStatus ZydisFormatterInit(ZydisFormatter* formatter, ZydisFormatterStyle st return ZYDIS_STATUS_INVALID_PARAMETER; } + static ZydisString hexPrefixDefault = ZYDIS_MAKE_STRING("0x"); + ZydisMemorySet(formatter, 0, sizeof(ZydisFormatter)); formatter->letterCase = ZYDIS_LETTER_CASE_DEFAULT; formatter->forceSegments = ZYDIS_FALSE; @@ -908,7 +865,7 @@ ZydisStatus ZydisFormatterInit(ZydisFormatter* formatter, ZydisFormatterStyle st formatter->displacementFormat = ZYDIS_DISP_FORMAT_HEX_SIGNED; formatter->immediateFormat = ZYDIS_IMM_FORMAT_HEX_UNSIGNED; formatter->hexUppercase = ZYDIS_TRUE; - formatter->hexPrefix = "0x"; + formatter->hexPrefix = &hexPrefixDefault; formatter->hexSuffix = ZYDIS_NULL; formatter->hexPaddingAddress = 2; formatter->hexPaddingDisplacement = 2; @@ -982,10 +939,18 @@ ZydisStatus ZydisFormatterSetProperty(ZydisFormatter* formatter, formatter->hexUppercase = (value) ? ZYDIS_TRUE : ZYDIS_FALSE; break; case ZYDIS_FORMATTER_PROP_HEX_PREFIX: - formatter->hexPrefix = (char*)value; + formatter->hexPrefix = (value) ? &formatter->hexPrefixData : ZYDIS_NULL; + if (value) + { + return ZydisStringInit(&formatter->hexPrefixData, (char*)value); + } break; case ZYDIS_FORMATTER_PROP_HEX_SUFFIX: - formatter->hexSuffix = (char*)value; + formatter->hexSuffix = (value) ? &formatter->hexSuffixData : ZYDIS_NULL; + if (value) + { + return ZydisStringInit(&formatter->hexSuffixData, (char*)value); + } break; case ZYDIS_FORMATTER_PROP_HEX_PADDING_ADDR: if (value > 20) @@ -1147,30 +1112,28 @@ ZydisStatus ZydisFormatterFormatInstruction(const ZydisFormatter* formatter, ZydisStatus ZydisFormatterFormatInstructionEx(const ZydisFormatter* formatter, const ZydisDecodedInstruction* instruction, char* buffer, ZydisUSize bufferLen, void* userData) { - if (!formatter || !instruction || !buffer || !bufferLen) + if (!formatter || !instruction || !buffer || (bufferLen == 0)) { return ZYDIS_STATUS_INVALID_PARAMETER; } - ZydisString str = { - .s = buffer, - .length = 0, - .capacity = bufferLen - 1 - }; + ZydisString string; + string.buffer = buffer; + string.length = 0; + string.capacity = bufferLen; if (formatter->funcPre) { - ZYDIS_CHECK(formatter->funcPre(formatter, &str, instruction, userData)); + ZYDIS_CHECK(formatter->funcPre(formatter, &string, instruction, userData)); } - - ZYDIS_CHECK(formatter->funcFormatInstruction(formatter, &str, instruction, userData)); - + ZYDIS_CHECK(formatter->funcFormatInstruction(formatter, &string, instruction, userData)); if (formatter->funcPost) { - ZYDIS_CHECK(formatter->funcPost(formatter, &str, instruction, userData)); + return formatter->funcPost(formatter, &string, instruction, userData); } - str.s[str.length] = 0; + buffer[string.length] = 0; + return ZYDIS_STATUS_SUCCESS; } diff --git a/src/Generated/EnumMnemonic.inc b/src/Generated/EnumMnemonic.inc index 2220841..682b3e0 100644 --- a/src/Generated/EnumMnemonic.inc +++ b/src/Generated/EnumMnemonic.inc @@ -1,1578 +1,1578 @@ -static const char* zydisMnemonicStrings[] = +static const ZydisInternalString zydisMnemonicStrings[] = { - "invalid", - "aaa", - "aad", - "aam", - "aas", - "adc", - "adcx", - "add", - "addpd", - "addps", - "addsd", - "addss", - "addsubpd", - "addsubps", - "adox", - "aesdec", - "aesdeclast", - "aesenc", - "aesenclast", - "aesimc", - "aeskeygenassist", - "and", - "andn", - "andnpd", - "andnps", - "andpd", - "andps", - "arpl", - "bextr", - "blcfill", - "blci", - "blcic", - "blcmsk", - "blcs", - "blendpd", - "blendps", - "blendvpd", - "blendvps", - "blsfill", - "blsi", - "blsic", - "blsmsk", - "blsr", - "bndcl", - "bndcn", - "bndcu", - "bndldx", - "bndmk", - "bndmov", - "bndstx", - "bound", - "bsf", - "bsr", - "bswap", - "bt", - "btc", - "btr", - "bts", - "bzhi", - "call", - "cbw", - "cdq", - "cdqe", - "clac", - "clc", - "cld", - "clevict0", - "clevict1", - "clflush", - "clflushopt", - "clgi", - "cli", - "clrssbsy", - "clts", - "clwb", - "clzero", - "cmc", - "cmovb", - "cmovbe", - "cmovl", - "cmovle", - "cmovnb", - "cmovnbe", - "cmovnl", - "cmovnle", - "cmovno", - "cmovnp", - "cmovns", - "cmovnz", - "cmovo", - "cmovp", - "cmovs", - "cmovz", - "cmp", - "cmppd", - "cmpps", - "cmpsb", - "cmpsd", - "cmpsq", - "cmpss", - "cmpsw", - "cmpxchg", - "cmpxchg16b", - "cmpxchg8b", - "comisd", - "comiss", - "cpuid", - "cqo", - "crc32", - "cvtdq2pd", - "cvtdq2ps", - "cvtpd2dq", - "cvtpd2pi", - "cvtpd2ps", - "cvtpi2pd", - "cvtpi2ps", - "cvtps2dq", - "cvtps2pd", - "cvtps2pi", - "cvtsd2si", - "cvtsd2ss", - "cvtsi2sd", - "cvtsi2ss", - "cvtss2sd", - "cvtss2si", - "cvttpd2dq", - "cvttpd2pi", - "cvttps2dq", - "cvttps2pi", - "cvttsd2si", - "cvttss2si", - "cwd", - "cwde", - "daa", - "das", - "dec", - "delay", - "div", - "divpd", - "divps", - "divsd", - "divss", - "dppd", - "dpps", - "emms", - "encls", - "enclu", - "endbr32", - "endbr64", - "enter", - "extractps", - "f2xm1", - "fabs", - "fadd", - "faddp", - "fbld", - "fbstp", - "fchs", - "fcmovb", - "fcmovbe", - "fcmove", - "fcmovnb", - "fcmovnbe", - "fcmovne", - "fcmovnu", - "fcmovu", - "fcom", - "fcomi", - "fcomip", - "fcomp", - "fcompp", - "fcos", - "fdecstp", - "fdisi8087_nop", - "fdiv", - "fdivp", - "fdivr", - "fdivrp", - "femms", - "feni8087_nop", - "ffree", - "ffreep", - "fiadd", - "ficom", - "ficomp", - "fidiv", - "fidivr", - "fild", - "fimul", - "fincstp", - "fist", - "fistp", - "fisttp", - "fisub", - "fisubr", - "fld", - "fld1", - "fldcw", - "fldenv", - "fldl2e", - "fldl2t", - "fldlg2", - "fldln2", - "fldpi", - "fldz", - "fmul", - "fmulp", - "fnclex", - "fninit", - "fnop", - "fnsave", - "fnstcw", - "fnstenv", - "fnstsw", - "fpatan", - "fprem", - "fprem1", - "fptan", - "frndint", - "frstor", - "fscale", - "fsetpm287_nop", - "fsin", - "fsincos", - "fsqrt", - "fst", - "fstp", - "fstpnce", - "fsub", - "fsubp", - "fsubr", - "fsubrp", - "ftst", - "fucom", - "fucomi", - "fucomip", - "fucomp", - "fucompp", - "fwait", - "fxam", - "fxch", - "fxrstor", - "fxrstor64", - "fxsave", - "fxsave64", - "fxtract", - "fyl2x", - "fyl2xp1", - "getsec", - "gf2p8affineinvqb", - "gf2p8affineqb", - "gf2p8mulb", - "haddpd", - "haddps", - "hlt", - "hsubpd", - "hsubps", - "idiv", - "imul", - "in", - "inc", - "incsspd", - "incsspq", - "insb", - "insd", - "insertps", - "insw", - "int", - "int1", - "int3", - "into", - "invd", - "invept", - "invlpg", - "invlpga", - "invpcid", - "invvpid", - "iret", - "iretd", - "iretq", - "jb", - "jbe", - "jcxz", - "jecxz", - "jknzd", - "jkzd", - "jl", - "jle", - "jmp", - "jnb", - "jnbe", - "jnl", - "jnle", - "jno", - "jnp", - "jns", - "jnz", - "jo", - "jp", - "jrcxz", - "js", - "jz", - "kaddb", - "kaddd", - "kaddq", - "kaddw", - "kand", - "kandb", - "kandd", - "kandn", - "kandnb", - "kandnd", - "kandnq", - "kandnr", - "kandnw", - "kandq", - "kandw", - "kconcath", - "kconcatl", - "kextract", - "kmerge2l1h", - "kmerge2l1l", - "kmov", - "kmovb", - "kmovd", - "kmovq", - "kmovw", - "knot", - "knotb", - "knotd", - "knotq", - "knotw", - "kor", - "korb", - "kord", - "korq", - "kortest", - "kortestb", - "kortestd", - "kortestq", - "kortestw", - "korw", - "kshiftlb", - "kshiftld", - "kshiftlq", - "kshiftlw", - "kshiftrb", - "kshiftrd", - "kshiftrq", - "kshiftrw", - "ktestb", - "ktestd", - "ktestq", - "ktestw", - "kunpckbw", - "kunpckdq", - "kunpckwd", - "kxnor", - "kxnorb", - "kxnord", - "kxnorq", - "kxnorw", - "kxor", - "kxorb", - "kxord", - "kxorq", - "kxorw", - "lahf", - "lar", - "lddqu", - "ldmxcsr", - "lds", - "lea", - "leave", - "les", - "lfence", - "lfs", - "lgdt", - "lgs", - "lidt", - "lldt", - "llwpcb", - "lmsw", - "lodsb", - "lodsd", - "lodsq", - "lodsw", - "loop", - "loope", - "loopne", - "lsl", - "lss", - "ltr", - "lwpins", - "lwpval", - "lzcnt", - "maskmovdqu", - "maskmovq", - "maxpd", - "maxps", - "maxsd", - "maxss", - "mfence", - "minpd", - "minps", - "minsd", - "minss", - "monitor", - "mov", - "movapd", - "movaps", - "movbe", - "movd", - "movddup", - "movdq2q", - "movdqa", - "movdqu", - "movhlps", - "movhpd", - "movhps", - "movlhps", - "movlpd", - "movlps", - "movmskpd", - "movmskps", - "movntdq", - "movntdqa", - "movnti", - "movntpd", - "movntps", - "movntq", - "movq", - "movq2dq", - "movsb", - "movsd", - "movshdup", - "movsldup", - "movsq", - "movss", - "movsw", - "movsx", - "movsxd", - "movupd", - "movups", - "movzx", - "mpsadbw", - "mul", - "mulpd", - "mulps", - "mulsd", - "mulss", - "mulx", - "mwait", - "neg", - "nop", - "not", - "or", - "orpd", - "orps", - "out", - "outsb", - "outsd", - "outsw", - "pabsb", - "pabsd", - "pabsw", - "packssdw", - "packsswb", - "packusdw", - "packuswb", - "paddb", - "paddd", - "paddq", - "paddsb", - "paddsw", - "paddusb", - "paddusw", - "paddw", - "palignr", - "pand", - "pandn", - "pause", - "pavgb", - "pavgusb", - "pavgw", - "pblendvb", - "pblendw", - "pclmulqdq", - "pcmpeqb", - "pcmpeqd", - "pcmpeqq", - "pcmpeqw", - "pcmpestri", - "pcmpestrm", - "pcmpgtb", - "pcmpgtd", - "pcmpgtq", - "pcmpgtw", - "pcmpistri", - "pcmpistrm", - "pdep", - "pext", - "pextrb", - "pextrd", - "pextrq", - "pextrw", - "pf2id", - "pf2iw", - "pfacc", - "pfadd", - "pfcmpeq", - "pfcmpge", - "pfcmpgt", - "pfcpit1", - "pfmax", - "pfmin", - "pfmul", - "pfnacc", - "pfpnacc", - "pfrcp", - "pfrcpit2", - "pfrsqit1", - "pfsqrt", - "pfsub", - "pfsubr", - "phaddd", - "phaddsw", - "phaddw", - "phminposuw", - "phsubd", - "phsubsw", - "phsubw", - "pi2fd", - "pi2fw", - "pinsrb", - "pinsrd", - "pinsrq", - "pinsrw", - "pmaddubsw", - "pmaddwd", - "pmaxsb", - "pmaxsd", - "pmaxsw", - "pmaxub", - "pmaxud", - "pmaxuw", - "pminsb", - "pminsd", - "pminsw", - "pminub", - "pminud", - "pminuw", - "pmovmskb", - "pmovsxbd", - "pmovsxbq", - "pmovsxbw", - "pmovsxdq", - "pmovsxwd", - "pmovsxwq", - "pmovzxbd", - "pmovzxbq", - "pmovzxbw", - "pmovzxdq", - "pmovzxwd", - "pmovzxwq", - "pmuldq", - "pmulhrsw", - "pmulhrw", - "pmulhuw", - "pmulhw", - "pmulld", - "pmullw", - "pmuludq", - "pop", - "popa", - "popad", - "popcnt", - "popf", - "popfd", - "popfq", - "por", - "prefetch", - "prefetchnta", - "prefetcht0", - "prefetcht1", - "prefetcht2", - "prefetchw", - "prefetchwt1", - "psadbw", - "pshufb", - "pshufd", - "pshufhw", - "pshuflw", - "pshufw", - "psignb", - "psignd", - "psignw", - "pslld", - "pslldq", - "psllq", - "psllw", - "psrad", - "psraw", - "psrld", - "psrldq", - "psrlq", - "psrlw", - "psubb", - "psubd", - "psubq", - "psubsb", - "psubsw", - "psubusb", - "psubusw", - "psubw", - "pswapd", - "ptest", - "ptwrite", - "punpckhbw", - "punpckhdq", - "punpckhqdq", - "punpckhwd", - "punpcklbw", - "punpckldq", - "punpcklqdq", - "punpcklwd", - "push", - "pusha", - "pushad", - "pushf", - "pushfd", - "pushfq", - "pxor", - "rcl", - "rcpps", - "rcpss", - "rcr", - "rdfsbase", - "rdgsbase", - "rdmsr", - "rdpid", - "rdpkru", - "rdpmc", - "rdrand", - "rdseed", - "rdsspd", - "rdsspq", - "rdtsc", - "rdtscp", - "ret", - "rol", - "ror", - "rorx", - "roundpd", - "roundps", - "roundsd", - "roundss", - "rsm", - "rsqrtps", - "rsqrtss", - "rstorssp", - "sahf", - "salc", - "sar", - "sarx", - "savessp", - "sbb", - "scasb", - "scasd", - "scasq", - "scasw", - "setb", - "setbe", - "setl", - "setle", - "setnb", - "setnbe", - "setnl", - "setnle", - "setno", - "setnp", - "setns", - "setnz", - "seto", - "setp", - "sets", - "setssbsy", - "setz", - "sfence", - "sgdt", - "sha1msg1", - "sha1msg2", - "sha1nexte", - "sha1rnds4", - "sha256msg1", - "sha256msg2", - "sha256rnds2", - "shl", - "shld", - "shlx", - "shr", - "shrd", - "shrx", - "shufpd", - "shufps", - "sidt", - "skinit", - "sldt", - "slwpcb", - "smsw", - "spflt", - "sqrtpd", - "sqrtps", - "sqrtsd", - "sqrtss", - "stac", - "stc", - "std", - "stgi", - "sti", - "stmxcsr", - "stosb", - "stosd", - "stosq", - "stosw", - "str", - "sub", - "subpd", - "subps", - "subsd", - "subss", - "swapgs", - "syscall", - "sysenter", - "sysexit", - "sysret", - "t1mskc", - "test", - "tzcnt", - "tzcnti", - "tzmsk", - "ucomisd", - "ucomiss", - "ud0", - "ud1", - "ud2", - "unpckhpd", - "unpckhps", - "unpcklpd", - "unpcklps", - "v4fmaddps", - "v4fmaddss", - "v4fnmaddps", - "v4fnmaddss", - "vaddnpd", - "vaddnps", - "vaddpd", - "vaddps", - "vaddsd", - "vaddsetsps", - "vaddss", - "vaddsubpd", - "vaddsubps", - "vaesdec", - "vaesdeclast", - "vaesenc", - "vaesenclast", - "vaesimc", - "vaeskeygenassist", - "valignd", - "valignq", - "vandnpd", - "vandnps", - "vandpd", - "vandps", - "vblendmpd", - "vblendmps", - "vblendpd", - "vblendps", - "vblendvpd", - "vblendvps", - "vbroadcastf128", - "vbroadcastf32x2", - "vbroadcastf32x4", - "vbroadcastf32x8", - "vbroadcastf64x2", - "vbroadcastf64x4", - "vbroadcasti128", - "vbroadcasti32x2", - "vbroadcasti32x4", - "vbroadcasti32x8", - "vbroadcasti64x2", - "vbroadcasti64x4", - "vbroadcastsd", - "vbroadcastss", - "vcmppd", - "vcmpps", - "vcmpsd", - "vcmpss", - "vcomisd", - "vcomiss", - "vcompresspd", - "vcompressps", - "vcvtdq2pd", - "vcvtdq2ps", - "vcvtfxpntdq2ps", - "vcvtfxpntpd2dq", - "vcvtfxpntpd2udq", - "vcvtfxpntps2dq", - "vcvtfxpntps2udq", - "vcvtfxpntudq2ps", - "vcvtpd2dq", - "vcvtpd2ps", - "vcvtpd2qq", - "vcvtpd2udq", - "vcvtpd2uqq", - "vcvtph2ps", - "vcvtps2dq", - "vcvtps2pd", - "vcvtps2ph", - "vcvtps2qq", - "vcvtps2udq", - "vcvtps2uqq", - "vcvtqq2pd", - "vcvtqq2ps", - "vcvtsd2si", - "vcvtsd2ss", - "vcvtsd2usi", - "vcvtsi2sd", - "vcvtsi2ss", - "vcvtss2sd", - "vcvtss2si", - "vcvtss2usi", - "vcvttpd2dq", - "vcvttpd2qq", - "vcvttpd2udq", - "vcvttpd2uqq", - "vcvttps2dq", - "vcvttps2qq", - "vcvttps2udq", - "vcvttps2uqq", - "vcvttsd2si", - "vcvttsd2usi", - "vcvttss2si", - "vcvttss2usi", - "vcvtudq2pd", - "vcvtudq2ps", - "vcvtuqq2pd", - "vcvtuqq2ps", - "vcvtusi2sd", - "vcvtusi2ss", - "vdbpsadbw", - "vdivpd", - "vdivps", - "vdivsd", - "vdivss", - "vdppd", - "vdpps", - "verr", - "verw", - "vexp223ps", - "vexp2pd", - "vexp2ps", - "vexpandpd", - "vexpandps", - "vextractf128", - "vextractf32x4", - "vextractf32x8", - "vextractf64x2", - "vextractf64x4", - "vextracti128", - "vextracti32x4", - "vextracti32x8", - "vextracti64x2", - "vextracti64x4", - "vextractps", - "vfixupimmpd", - "vfixupimmps", - "vfixupimmsd", - "vfixupimmss", - "vfixupnanpd", - "vfixupnanps", - "vfmadd132pd", - "vfmadd132ps", - "vfmadd132sd", - "vfmadd132ss", - "vfmadd213pd", - "vfmadd213ps", - "vfmadd213sd", - "vfmadd213ss", - "vfmadd231pd", - "vfmadd231ps", - "vfmadd231sd", - "vfmadd231ss", - "vfmadd233ps", - "vfmaddpd", - "vfmaddps", - "vfmaddsd", - "vfmaddss", - "vfmaddsub132pd", - "vfmaddsub132ps", - "vfmaddsub213pd", - "vfmaddsub213ps", - "vfmaddsub231pd", - "vfmaddsub231ps", - "vfmaddsubpd", - "vfmaddsubps", - "vfmsub132pd", - "vfmsub132ps", - "vfmsub132sd", - "vfmsub132ss", - "vfmsub213pd", - "vfmsub213ps", - "vfmsub213sd", - "vfmsub213ss", - "vfmsub231pd", - "vfmsub231ps", - "vfmsub231sd", - "vfmsub231ss", - "vfmsubadd132pd", - "vfmsubadd132ps", - "vfmsubadd213pd", - "vfmsubadd213ps", - "vfmsubadd231pd", - "vfmsubadd231ps", - "vfmsubaddpd", - "vfmsubaddps", - "vfmsubpd", - "vfmsubps", - "vfmsubsd", - "vfmsubss", - "vfnmadd132pd", - "vfnmadd132ps", - "vfnmadd132sd", - "vfnmadd132ss", - "vfnmadd213pd", - "vfnmadd213ps", - "vfnmadd213sd", - "vfnmadd213ss", - "vfnmadd231pd", - "vfnmadd231ps", - "vfnmadd231sd", - "vfnmadd231ss", - "vfnmaddpd", - "vfnmaddps", - "vfnmaddsd", - "vfnmaddss", - "vfnmsub132pd", - "vfnmsub132ps", - "vfnmsub132sd", - "vfnmsub132ss", - "vfnmsub213pd", - "vfnmsub213ps", - "vfnmsub213sd", - "vfnmsub213ss", - "vfnmsub231pd", - "vfnmsub231ps", - "vfnmsub231sd", - "vfnmsub231ss", - "vfnmsubpd", - "vfnmsubps", - "vfnmsubsd", - "vfnmsubss", - "vfpclasspd", - "vfpclassps", - "vfpclasssd", - "vfpclassss", - "vfrczpd", - "vfrczps", - "vfrczsd", - "vfrczss", - "vgatherdpd", - "vgatherdps", - "vgatherpf0dpd", - "vgatherpf0dps", - "vgatherpf0hintdpd", - "vgatherpf0hintdps", - "vgatherpf0qpd", - "vgatherpf0qps", - "vgatherpf1dpd", - "vgatherpf1dps", - "vgatherpf1qpd", - "vgatherpf1qps", - "vgatherqpd", - "vgatherqps", - "vgetexppd", - "vgetexpps", - "vgetexpsd", - "vgetexpss", - "vgetmantpd", - "vgetmantps", - "vgetmantsd", - "vgetmantss", - "vgf2p8affineinvqb", - "vgf2p8affineqb", - "vgf2p8mulb", - "vgmaxabsps", - "vgmaxpd", - "vgmaxps", - "vgminpd", - "vgminps", - "vhaddpd", - "vhaddps", - "vhsubpd", - "vhsubps", - "vinsertf128", - "vinsertf32x4", - "vinsertf32x8", - "vinsertf64x2", - "vinsertf64x4", - "vinserti128", - "vinserti32x4", - "vinserti32x8", - "vinserti64x2", - "vinserti64x4", - "vinsertps", - "vlddqu", - "vldmxcsr", - "vloadunpackhd", - "vloadunpackhpd", - "vloadunpackhps", - "vloadunpackhq", - "vloadunpackld", - "vloadunpacklpd", - "vloadunpacklps", - "vloadunpacklq", - "vlog2ps", - "vmaskmovdqu", - "vmaskmovpd", - "vmaskmovps", - "vmaxpd", - "vmaxps", - "vmaxsd", - "vmaxss", - "vmcall", - "vmclear", - "vmfunc", - "vminpd", - "vminps", - "vminsd", - "vminss", - "vmlaunch", - "vmload", - "vmmcall", - "vmovapd", - "vmovaps", - "vmovd", - "vmovddup", - "vmovdqa", - "vmovdqa32", - "vmovdqa64", - "vmovdqu", - "vmovdqu16", - "vmovdqu32", - "vmovdqu64", - "vmovdqu8", - "vmovhlps", - "vmovhpd", - "vmovhps", - "vmovlhps", - "vmovlpd", - "vmovlps", - "vmovmskpd", - "vmovmskps", - "vmovnrapd", - "vmovnraps", - "vmovnrngoapd", - "vmovnrngoaps", - "vmovntdq", - "vmovntdqa", - "vmovntpd", - "vmovntps", - "vmovq", - "vmovsd", - "vmovshdup", - "vmovsldup", - "vmovss", - "vmovupd", - "vmovups", - "vmpsadbw", - "vmptrld", - "vmptrst", - "vmread", - "vmresume", - "vmrun", - "vmsave", - "vmulpd", - "vmulps", - "vmulsd", - "vmulss", - "vmwrite", - "vmxoff", - "vmxon", - "vorpd", - "vorps", - "vp4dpwssd", - "vp4dpwssds", - "vpabsb", - "vpabsd", - "vpabsq", - "vpabsw", - "vpackssdw", - "vpacksswb", - "vpackstorehd", - "vpackstorehpd", - "vpackstorehps", - "vpackstorehq", - "vpackstoreld", - "vpackstorelpd", - "vpackstorelps", - "vpackstorelq", - "vpackusdw", - "vpackuswb", - "vpadcd", - "vpaddb", - "vpaddd", - "vpaddq", - "vpaddsb", - "vpaddsetcd", - "vpaddsetsd", - "vpaddsw", - "vpaddusb", - "vpaddusw", - "vpaddw", - "vpalignr", - "vpand", - "vpandd", - "vpandn", - "vpandnd", - "vpandnq", - "vpandq", - "vpavgb", - "vpavgw", - "vpblendd", - "vpblendmb", - "vpblendmd", - "vpblendmq", - "vpblendmw", - "vpblendvb", - "vpblendw", - "vpbroadcastb", - "vpbroadcastd", - "vpbroadcastmb2q", - "vpbroadcastmw2d", - "vpbroadcastq", - "vpbroadcastw", - "vpclmulqdq", - "vpcmov", - "vpcmpb", - "vpcmpd", - "vpcmpeqb", - "vpcmpeqd", - "vpcmpeqq", - "vpcmpeqw", - "vpcmpestri", - "vpcmpestrm", - "vpcmpgtb", - "vpcmpgtd", - "vpcmpgtq", - "vpcmpgtw", - "vpcmpistri", - "vpcmpistrm", - "vpcmpltd", - "vpcmpq", - "vpcmpub", - "vpcmpud", - "vpcmpuq", - "vpcmpuw", - "vpcmpw", - "vpcomb", - "vpcomd", - "vpcompressb", - "vpcompressd", - "vpcompressq", - "vpcompressw", - "vpcomq", - "vpcomub", - "vpcomud", - "vpcomuq", - "vpcomuw", - "vpcomw", - "vpconflictd", - "vpconflictq", - "vpdpbusd", - "vpdpbusds", - "vpdpwssd", - "vpdpwssds", - "vperm2f128", - "vperm2i128", - "vpermb", - "vpermd", - "vpermf32x4", - "vpermi2b", - "vpermi2d", - "vpermi2pd", - "vpermi2ps", - "vpermi2q", - "vpermi2w", - "vpermil2pd", - "vpermil2ps", - "vpermilpd", - "vpermilps", - "vpermpd", - "vpermps", - "vpermq", - "vpermt2b", - "vpermt2d", - "vpermt2pd", - "vpermt2ps", - "vpermt2q", - "vpermt2w", - "vpermw", - "vpexpandb", - "vpexpandd", - "vpexpandq", - "vpexpandw", - "vpextrb", - "vpextrd", - "vpextrq", - "vpextrw", - "vpgatherdd", - "vpgatherdq", - "vpgatherqd", - "vpgatherqq", - "vphaddbd", - "vphaddbq", - "vphaddbw", - "vphaddd", - "vphadddq", - "vphaddsw", - "vphaddubd", - "vphaddubq", - "vphaddubw", - "vphaddudq", - "vphadduwd", - "vphadduwq", - "vphaddw", - "vphaddwd", - "vphaddwq", - "vphminposuw", - "vphsubbw", - "vphsubd", - "vphsubdq", - "vphsubsw", - "vphsubw", - "vphsubwd", - "vpinsrb", - "vpinsrd", - "vpinsrq", - "vpinsrw", - "vplzcntd", - "vplzcntq", - "vpmacsdd", - "vpmacsdqh", - "vpmacsdql", - "vpmacssdd", - "vpmacssdqh", - "vpmacssdql", - "vpmacsswd", - "vpmacssww", - "vpmacswd", - "vpmacsww", - "vpmadcsswd", - "vpmadcswd", - "vpmadd231d", - "vpmadd233d", - "vpmadd52huq", - "vpmadd52luq", - "vpmaddubsw", - "vpmaddwd", - "vpmaskmovd", - "vpmaskmovq", - "vpmaxsb", - "vpmaxsd", - "vpmaxsq", - "vpmaxsw", - "vpmaxub", - "vpmaxud", - "vpmaxuq", - "vpmaxuw", - "vpminsb", - "vpminsd", - "vpminsq", - "vpminsw", - "vpminub", - "vpminud", - "vpminuq", - "vpminuw", - "vpmovb2m", - "vpmovd2m", - "vpmovdb", - "vpmovdw", - "vpmovm2b", - "vpmovm2d", - "vpmovm2q", - "vpmovm2w", - "vpmovmskb", - "vpmovq2m", - "vpmovqb", - "vpmovqd", - "vpmovqw", - "vpmovsdb", - "vpmovsdw", - "vpmovsqb", - "vpmovsqd", - "vpmovsqw", - "vpmovswb", - "vpmovsxbd", - "vpmovsxbq", - "vpmovsxbw", - "vpmovsxdq", - "vpmovsxwd", - "vpmovsxwq", - "vpmovusdb", - "vpmovusdw", - "vpmovusqb", - "vpmovusqd", - "vpmovusqw", - "vpmovuswb", - "vpmovw2m", - "vpmovwb", - "vpmovzxbd", - "vpmovzxbq", - "vpmovzxbw", - "vpmovzxdq", - "vpmovzxwd", - "vpmovzxwq", - "vpmuldq", - "vpmulhd", - "vpmulhrsw", - "vpmulhud", - "vpmulhuw", - "vpmulhw", - "vpmulld", - "vpmullq", - "vpmullw", - "vpmultishiftqb", - "vpmuludq", - "vpopcntb", - "vpopcntd", - "vpopcntq", - "vpopcntw", - "vpor", - "vpord", - "vporq", - "vpperm", - "vprefetch0", - "vprefetch1", - "vprefetch2", - "vprefetche0", - "vprefetche1", - "vprefetche2", - "vprefetchenta", - "vprefetchnta", - "vprold", - "vprolq", - "vprolvd", - "vprolvq", - "vprord", - "vprorq", - "vprorvd", - "vprorvq", - "vprotb", - "vprotd", - "vprotq", - "vprotw", - "vpsadbw", - "vpsbbd", - "vpsbbrd", - "vpscatterdd", - "vpscatterdq", - "vpscatterqd", - "vpscatterqq", - "vpshab", - "vpshad", - "vpshaq", - "vpshaw", - "vpshlb", - "vpshld", - "vpshldd", - "vpshldq", - "vpshldvd", - "vpshldvq", - "vpshldvw", - "vpshldw", - "vpshlq", - "vpshlw", - "vpshrdd", - "vpshrdq", - "vpshrdvd", - "vpshrdvq", - "vpshrdvw", - "vpshrdw", - "vpshufb", - "vpshufbitqmb", - "vpshufd", - "vpshufhw", - "vpshuflw", - "vpsignb", - "vpsignd", - "vpsignw", - "vpslld", - "vpslldq", - "vpsllq", - "vpsllvd", - "vpsllvq", - "vpsllvw", - "vpsllw", - "vpsrad", - "vpsraq", - "vpsravd", - "vpsravq", - "vpsravw", - "vpsraw", - "vpsrld", - "vpsrldq", - "vpsrlq", - "vpsrlvd", - "vpsrlvq", - "vpsrlvw", - "vpsrlw", - "vpsubb", - "vpsubd", - "vpsubq", - "vpsubrd", - "vpsubrsetbd", - "vpsubsb", - "vpsubsetbd", - "vpsubsw", - "vpsubusb", - "vpsubusw", - "vpsubw", - "vpternlogd", - "vpternlogq", - "vptest", - "vptestmb", - "vptestmd", - "vptestmq", - "vptestmw", - "vptestnmb", - "vptestnmd", - "vptestnmq", - "vptestnmw", - "vpunpckhbw", - "vpunpckhdq", - "vpunpckhqdq", - "vpunpckhwd", - "vpunpcklbw", - "vpunpckldq", - "vpunpcklqdq", - "vpunpcklwd", - "vpxor", - "vpxord", - "vpxorq", - "vrangepd", - "vrangeps", - "vrangesd", - "vrangess", - "vrcp14pd", - "vrcp14ps", - "vrcp14sd", - "vrcp14ss", - "vrcp23ps", - "vrcp28pd", - "vrcp28ps", - "vrcp28sd", - "vrcp28ss", - "vrcpps", - "vrcpss", - "vreducepd", - "vreduceps", - "vreducesd", - "vreducess", - "vrndfxpntpd", - "vrndfxpntps", - "vrndscalepd", - "vrndscaleps", - "vrndscalesd", - "vrndscaless", - "vroundpd", - "vroundps", - "vroundsd", - "vroundss", - "vrsqrt14pd", - "vrsqrt14ps", - "vrsqrt14sd", - "vrsqrt14ss", - "vrsqrt23ps", - "vrsqrt28pd", - "vrsqrt28ps", - "vrsqrt28sd", - "vrsqrt28ss", - "vrsqrtps", - "vrsqrtss", - "vscalefpd", - "vscalefps", - "vscalefsd", - "vscalefss", - "vscaleps", - "vscatterdpd", - "vscatterdps", - "vscatterpf0dpd", - "vscatterpf0dps", - "vscatterpf0hintdpd", - "vscatterpf0hintdps", - "vscatterpf0qpd", - "vscatterpf0qps", - "vscatterpf1dpd", - "vscatterpf1dps", - "vscatterpf1qpd", - "vscatterpf1qps", - "vscatterqpd", - "vscatterqps", - "vshuff32x4", - "vshuff64x2", - "vshufi32x4", - "vshufi64x2", - "vshufpd", - "vshufps", - "vsqrtpd", - "vsqrtps", - "vsqrtsd", - "vsqrtss", - "vstmxcsr", - "vsubpd", - "vsubps", - "vsubrpd", - "vsubrps", - "vsubsd", - "vsubss", - "vtestpd", - "vtestps", - "vucomisd", - "vucomiss", - "vunpckhpd", - "vunpckhps", - "vunpcklpd", - "vunpcklps", - "vxorpd", - "vxorps", - "vzeroall", - "vzeroupper", - "wbinvd", - "wrfsbase", - "wrgsbase", - "wrmsr", - "wrpkru", - "wrssd", - "wrssq", - "wrussd", - "wrussq", - "xabort", - "xadd", - "xbegin", - "xchg", - "xend", - "xgetbv", - "xlat", - "xor", - "xorpd", - "xorps", - "xrstor", - "xrstor64", - "xrstors", - "xrstors64", - "xsave", - "xsave64", - "xsavec", - "xsavec64", - "xsaveopt", - "xsaveopt64", - "xsaves", - "xsaves64", - "xsetbv", - "xtest" + { "invalid", 0x07 }, + { "aaa", 0x03 }, + { "aad", 0x03 }, + { "aam", 0x03 }, + { "aas", 0x03 }, + { "adc", 0x03 }, + { "adcx", 0x04 }, + { "add", 0x03 }, + { "addpd", 0x05 }, + { "addps", 0x05 }, + { "addsd", 0x05 }, + { "addss", 0x05 }, + { "addsubpd", 0x08 }, + { "addsubps", 0x08 }, + { "adox", 0x04 }, + { "aesdec", 0x06 }, + { "aesdeclast", 0x0A }, + { "aesenc", 0x06 }, + { "aesenclast", 0x0A }, + { "aesimc", 0x06 }, + { "aeskeygenassist", 0x0F }, + { "and", 0x03 }, + { "andn", 0x04 }, + { "andnpd", 0x06 }, + { "andnps", 0x06 }, + { "andpd", 0x05 }, + { "andps", 0x05 }, + { "arpl", 0x04 }, + { "bextr", 0x05 }, + { "blcfill", 0x07 }, + { "blci", 0x04 }, + { "blcic", 0x05 }, + { "blcmsk", 0x06 }, + { "blcs", 0x04 }, + { "blendpd", 0x07 }, + { "blendps", 0x07 }, + { "blendvpd", 0x08 }, + { "blendvps", 0x08 }, + { "blsfill", 0x07 }, + { "blsi", 0x04 }, + { "blsic", 0x05 }, + { "blsmsk", 0x06 }, + { "blsr", 0x04 }, + { "bndcl", 0x05 }, + { "bndcn", 0x05 }, + { "bndcu", 0x05 }, + { "bndldx", 0x06 }, + { "bndmk", 0x05 }, + { "bndmov", 0x06 }, + { "bndstx", 0x06 }, + { "bound", 0x05 }, + { "bsf", 0x03 }, + { "bsr", 0x03 }, + { "bswap", 0x05 }, + { "bt", 0x02 }, + { "btc", 0x03 }, + { "btr", 0x03 }, + { "bts", 0x03 }, + { "bzhi", 0x04 }, + { "call", 0x04 }, + { "cbw", 0x03 }, + { "cdq", 0x03 }, + { "cdqe", 0x04 }, + { "clac", 0x04 }, + { "clc", 0x03 }, + { "cld", 0x03 }, + { "clevict0", 0x08 }, + { "clevict1", 0x08 }, + { "clflush", 0x07 }, + { "clflushopt", 0x0A }, + { "clgi", 0x04 }, + { "cli", 0x03 }, + { "clrssbsy", 0x08 }, + { "clts", 0x04 }, + { "clwb", 0x04 }, + { "clzero", 0x06 }, + { "cmc", 0x03 }, + { "cmovb", 0x05 }, + { "cmovbe", 0x06 }, + { "cmovl", 0x05 }, + { "cmovle", 0x06 }, + { "cmovnb", 0x06 }, + { "cmovnbe", 0x07 }, + { "cmovnl", 0x06 }, + { "cmovnle", 0x07 }, + { "cmovno", 0x06 }, + { "cmovnp", 0x06 }, + { "cmovns", 0x06 }, + { "cmovnz", 0x06 }, + { "cmovo", 0x05 }, + { "cmovp", 0x05 }, + { "cmovs", 0x05 }, + { "cmovz", 0x05 }, + { "cmp", 0x03 }, + { "cmppd", 0x05 }, + { "cmpps", 0x05 }, + { "cmpsb", 0x05 }, + { "cmpsd", 0x05 }, + { "cmpsq", 0x05 }, + { "cmpss", 0x05 }, + { "cmpsw", 0x05 }, + { "cmpxchg", 0x07 }, + { "cmpxchg16b", 0x0A }, + { "cmpxchg8b", 0x09 }, + { "comisd", 0x06 }, + { "comiss", 0x06 }, + { "cpuid", 0x05 }, + { "cqo", 0x03 }, + { "crc32", 0x05 }, + { "cvtdq2pd", 0x08 }, + { "cvtdq2ps", 0x08 }, + { "cvtpd2dq", 0x08 }, + { "cvtpd2pi", 0x08 }, + { "cvtpd2ps", 0x08 }, + { "cvtpi2pd", 0x08 }, + { "cvtpi2ps", 0x08 }, + { "cvtps2dq", 0x08 }, + { "cvtps2pd", 0x08 }, + { "cvtps2pi", 0x08 }, + { "cvtsd2si", 0x08 }, + { "cvtsd2ss", 0x08 }, + { "cvtsi2sd", 0x08 }, + { "cvtsi2ss", 0x08 }, + { "cvtss2sd", 0x08 }, + { "cvtss2si", 0x08 }, + { "cvttpd2dq", 0x09 }, + { "cvttpd2pi", 0x09 }, + { "cvttps2dq", 0x09 }, + { "cvttps2pi", 0x09 }, + { "cvttsd2si", 0x09 }, + { "cvttss2si", 0x09 }, + { "cwd", 0x03 }, + { "cwde", 0x04 }, + { "daa", 0x03 }, + { "das", 0x03 }, + { "dec", 0x03 }, + { "delay", 0x05 }, + { "div", 0x03 }, + { "divpd", 0x05 }, + { "divps", 0x05 }, + { "divsd", 0x05 }, + { "divss", 0x05 }, + { "dppd", 0x04 }, + { "dpps", 0x04 }, + { "emms", 0x04 }, + { "encls", 0x05 }, + { "enclu", 0x05 }, + { "endbr32", 0x07 }, + { "endbr64", 0x07 }, + { "enter", 0x05 }, + { "extractps", 0x09 }, + { "f2xm1", 0x05 }, + { "fabs", 0x04 }, + { "fadd", 0x04 }, + { "faddp", 0x05 }, + { "fbld", 0x04 }, + { "fbstp", 0x05 }, + { "fchs", 0x04 }, + { "fcmovb", 0x06 }, + { "fcmovbe", 0x07 }, + { "fcmove", 0x06 }, + { "fcmovnb", 0x07 }, + { "fcmovnbe", 0x08 }, + { "fcmovne", 0x07 }, + { "fcmovnu", 0x07 }, + { "fcmovu", 0x06 }, + { "fcom", 0x04 }, + { "fcomi", 0x05 }, + { "fcomip", 0x06 }, + { "fcomp", 0x05 }, + { "fcompp", 0x06 }, + { "fcos", 0x04 }, + { "fdecstp", 0x07 }, + { "fdisi8087_nop", 0x0D }, + { "fdiv", 0x04 }, + { "fdivp", 0x05 }, + { "fdivr", 0x05 }, + { "fdivrp", 0x06 }, + { "femms", 0x05 }, + { "feni8087_nop", 0x0C }, + { "ffree", 0x05 }, + { "ffreep", 0x06 }, + { "fiadd", 0x05 }, + { "ficom", 0x05 }, + { "ficomp", 0x06 }, + { "fidiv", 0x05 }, + { "fidivr", 0x06 }, + { "fild", 0x04 }, + { "fimul", 0x05 }, + { "fincstp", 0x07 }, + { "fist", 0x04 }, + { "fistp", 0x05 }, + { "fisttp", 0x06 }, + { "fisub", 0x05 }, + { "fisubr", 0x06 }, + { "fld", 0x03 }, + { "fld1", 0x04 }, + { "fldcw", 0x05 }, + { "fldenv", 0x06 }, + { "fldl2e", 0x06 }, + { "fldl2t", 0x06 }, + { "fldlg2", 0x06 }, + { "fldln2", 0x06 }, + { "fldpi", 0x05 }, + { "fldz", 0x04 }, + { "fmul", 0x04 }, + { "fmulp", 0x05 }, + { "fnclex", 0x06 }, + { "fninit", 0x06 }, + { "fnop", 0x04 }, + { "fnsave", 0x06 }, + { "fnstcw", 0x06 }, + { "fnstenv", 0x07 }, + { "fnstsw", 0x06 }, + { "fpatan", 0x06 }, + { "fprem", 0x05 }, + { "fprem1", 0x06 }, + { "fptan", 0x05 }, + { "frndint", 0x07 }, + { "frstor", 0x06 }, + { "fscale", 0x06 }, + { "fsetpm287_nop", 0x0D }, + { "fsin", 0x04 }, + { "fsincos", 0x07 }, + { "fsqrt", 0x05 }, + { "fst", 0x03 }, + { "fstp", 0x04 }, + { "fstpnce", 0x07 }, + { "fsub", 0x04 }, + { "fsubp", 0x05 }, + { "fsubr", 0x05 }, + { "fsubrp", 0x06 }, + { "ftst", 0x04 }, + { "fucom", 0x05 }, + { "fucomi", 0x06 }, + { "fucomip", 0x07 }, + { "fucomp", 0x06 }, + { "fucompp", 0x07 }, + { "fwait", 0x05 }, + { "fxam", 0x04 }, + { "fxch", 0x04 }, + { "fxrstor", 0x07 }, + { "fxrstor64", 0x09 }, + { "fxsave", 0x06 }, + { "fxsave64", 0x08 }, + { "fxtract", 0x07 }, + { "fyl2x", 0x05 }, + { "fyl2xp1", 0x07 }, + { "getsec", 0x06 }, + { "gf2p8affineinvqb", 0x10 }, + { "gf2p8affineqb", 0x0D }, + { "gf2p8mulb", 0x09 }, + { "haddpd", 0x06 }, + { "haddps", 0x06 }, + { "hlt", 0x03 }, + { "hsubpd", 0x06 }, + { "hsubps", 0x06 }, + { "idiv", 0x04 }, + { "imul", 0x04 }, + { "in", 0x02 }, + { "inc", 0x03 }, + { "incsspd", 0x07 }, + { "incsspq", 0x07 }, + { "insb", 0x04 }, + { "insd", 0x04 }, + { "insertps", 0x08 }, + { "insw", 0x04 }, + { "int", 0x03 }, + { "int1", 0x04 }, + { "int3", 0x04 }, + { "into", 0x04 }, + { "invd", 0x04 }, + { "invept", 0x06 }, + { "invlpg", 0x06 }, + { "invlpga", 0x07 }, + { "invpcid", 0x07 }, + { "invvpid", 0x07 }, + { "iret", 0x04 }, + { "iretd", 0x05 }, + { "iretq", 0x05 }, + { "jb", 0x02 }, + { "jbe", 0x03 }, + { "jcxz", 0x04 }, + { "jecxz", 0x05 }, + { "jknzd", 0x05 }, + { "jkzd", 0x04 }, + { "jl", 0x02 }, + { "jle", 0x03 }, + { "jmp", 0x03 }, + { "jnb", 0x03 }, + { "jnbe", 0x04 }, + { "jnl", 0x03 }, + { "jnle", 0x04 }, + { "jno", 0x03 }, + { "jnp", 0x03 }, + { "jns", 0x03 }, + { "jnz", 0x03 }, + { "jo", 0x02 }, + { "jp", 0x02 }, + { "jrcxz", 0x05 }, + { "js", 0x02 }, + { "jz", 0x02 }, + { "kaddb", 0x05 }, + { "kaddd", 0x05 }, + { "kaddq", 0x05 }, + { "kaddw", 0x05 }, + { "kand", 0x04 }, + { "kandb", 0x05 }, + { "kandd", 0x05 }, + { "kandn", 0x05 }, + { "kandnb", 0x06 }, + { "kandnd", 0x06 }, + { "kandnq", 0x06 }, + { "kandnr", 0x06 }, + { "kandnw", 0x06 }, + { "kandq", 0x05 }, + { "kandw", 0x05 }, + { "kconcath", 0x08 }, + { "kconcatl", 0x08 }, + { "kextract", 0x08 }, + { "kmerge2l1h", 0x0A }, + { "kmerge2l1l", 0x0A }, + { "kmov", 0x04 }, + { "kmovb", 0x05 }, + { "kmovd", 0x05 }, + { "kmovq", 0x05 }, + { "kmovw", 0x05 }, + { "knot", 0x04 }, + { "knotb", 0x05 }, + { "knotd", 0x05 }, + { "knotq", 0x05 }, + { "knotw", 0x05 }, + { "kor", 0x03 }, + { "korb", 0x04 }, + { "kord", 0x04 }, + { "korq", 0x04 }, + { "kortest", 0x07 }, + { "kortestb", 0x08 }, + { "kortestd", 0x08 }, + { "kortestq", 0x08 }, + { "kortestw", 0x08 }, + { "korw", 0x04 }, + { "kshiftlb", 0x08 }, + { "kshiftld", 0x08 }, + { "kshiftlq", 0x08 }, + { "kshiftlw", 0x08 }, + { "kshiftrb", 0x08 }, + { "kshiftrd", 0x08 }, + { "kshiftrq", 0x08 }, + { "kshiftrw", 0x08 }, + { "ktestb", 0x06 }, + { "ktestd", 0x06 }, + { "ktestq", 0x06 }, + { "ktestw", 0x06 }, + { "kunpckbw", 0x08 }, + { "kunpckdq", 0x08 }, + { "kunpckwd", 0x08 }, + { "kxnor", 0x05 }, + { "kxnorb", 0x06 }, + { "kxnord", 0x06 }, + { "kxnorq", 0x06 }, + { "kxnorw", 0x06 }, + { "kxor", 0x04 }, + { "kxorb", 0x05 }, + { "kxord", 0x05 }, + { "kxorq", 0x05 }, + { "kxorw", 0x05 }, + { "lahf", 0x04 }, + { "lar", 0x03 }, + { "lddqu", 0x05 }, + { "ldmxcsr", 0x07 }, + { "lds", 0x03 }, + { "lea", 0x03 }, + { "leave", 0x05 }, + { "les", 0x03 }, + { "lfence", 0x06 }, + { "lfs", 0x03 }, + { "lgdt", 0x04 }, + { "lgs", 0x03 }, + { "lidt", 0x04 }, + { "lldt", 0x04 }, + { "llwpcb", 0x06 }, + { "lmsw", 0x04 }, + { "lodsb", 0x05 }, + { "lodsd", 0x05 }, + { "lodsq", 0x05 }, + { "lodsw", 0x05 }, + { "loop", 0x04 }, + { "loope", 0x05 }, + { "loopne", 0x06 }, + { "lsl", 0x03 }, + { "lss", 0x03 }, + { "ltr", 0x03 }, + { "lwpins", 0x06 }, + { "lwpval", 0x06 }, + { "lzcnt", 0x05 }, + { "maskmovdqu", 0x0A }, + { "maskmovq", 0x08 }, + { "maxpd", 0x05 }, + { "maxps", 0x05 }, + { "maxsd", 0x05 }, + { "maxss", 0x05 }, + { "mfence", 0x06 }, + { "minpd", 0x05 }, + { "minps", 0x05 }, + { "minsd", 0x05 }, + { "minss", 0x05 }, + { "monitor", 0x07 }, + { "mov", 0x03 }, + { "movapd", 0x06 }, + { "movaps", 0x06 }, + { "movbe", 0x05 }, + { "movd", 0x04 }, + { "movddup", 0x07 }, + { "movdq2q", 0x07 }, + { "movdqa", 0x06 }, + { "movdqu", 0x06 }, + { "movhlps", 0x07 }, + { "movhpd", 0x06 }, + { "movhps", 0x06 }, + { "movlhps", 0x07 }, + { "movlpd", 0x06 }, + { "movlps", 0x06 }, + { "movmskpd", 0x08 }, + { "movmskps", 0x08 }, + { "movntdq", 0x07 }, + { "movntdqa", 0x08 }, + { "movnti", 0x06 }, + { "movntpd", 0x07 }, + { "movntps", 0x07 }, + { "movntq", 0x06 }, + { "movq", 0x04 }, + { "movq2dq", 0x07 }, + { "movsb", 0x05 }, + { "movsd", 0x05 }, + { "movshdup", 0x08 }, + { "movsldup", 0x08 }, + { "movsq", 0x05 }, + { "movss", 0x05 }, + { "movsw", 0x05 }, + { "movsx", 0x05 }, + { "movsxd", 0x06 }, + { "movupd", 0x06 }, + { "movups", 0x06 }, + { "movzx", 0x05 }, + { "mpsadbw", 0x07 }, + { "mul", 0x03 }, + { "mulpd", 0x05 }, + { "mulps", 0x05 }, + { "mulsd", 0x05 }, + { "mulss", 0x05 }, + { "mulx", 0x04 }, + { "mwait", 0x05 }, + { "neg", 0x03 }, + { "nop", 0x03 }, + { "not", 0x03 }, + { "or", 0x02 }, + { "orpd", 0x04 }, + { "orps", 0x04 }, + { "out", 0x03 }, + { "outsb", 0x05 }, + { "outsd", 0x05 }, + { "outsw", 0x05 }, + { "pabsb", 0x05 }, + { "pabsd", 0x05 }, + { "pabsw", 0x05 }, + { "packssdw", 0x08 }, + { "packsswb", 0x08 }, + { "packusdw", 0x08 }, + { "packuswb", 0x08 }, + { "paddb", 0x05 }, + { "paddd", 0x05 }, + { "paddq", 0x05 }, + { "paddsb", 0x06 }, + { "paddsw", 0x06 }, + { "paddusb", 0x07 }, + { "paddusw", 0x07 }, + { "paddw", 0x05 }, + { "palignr", 0x07 }, + { "pand", 0x04 }, + { "pandn", 0x05 }, + { "pause", 0x05 }, + { "pavgb", 0x05 }, + { "pavgusb", 0x07 }, + { "pavgw", 0x05 }, + { "pblendvb", 0x08 }, + { "pblendw", 0x07 }, + { "pclmulqdq", 0x09 }, + { "pcmpeqb", 0x07 }, + { "pcmpeqd", 0x07 }, + { "pcmpeqq", 0x07 }, + { "pcmpeqw", 0x07 }, + { "pcmpestri", 0x09 }, + { "pcmpestrm", 0x09 }, + { "pcmpgtb", 0x07 }, + { "pcmpgtd", 0x07 }, + { "pcmpgtq", 0x07 }, + { "pcmpgtw", 0x07 }, + { "pcmpistri", 0x09 }, + { "pcmpistrm", 0x09 }, + { "pdep", 0x04 }, + { "pext", 0x04 }, + { "pextrb", 0x06 }, + { "pextrd", 0x06 }, + { "pextrq", 0x06 }, + { "pextrw", 0x06 }, + { "pf2id", 0x05 }, + { "pf2iw", 0x05 }, + { "pfacc", 0x05 }, + { "pfadd", 0x05 }, + { "pfcmpeq", 0x07 }, + { "pfcmpge", 0x07 }, + { "pfcmpgt", 0x07 }, + { "pfcpit1", 0x07 }, + { "pfmax", 0x05 }, + { "pfmin", 0x05 }, + { "pfmul", 0x05 }, + { "pfnacc", 0x06 }, + { "pfpnacc", 0x07 }, + { "pfrcp", 0x05 }, + { "pfrcpit2", 0x08 }, + { "pfrsqit1", 0x08 }, + { "pfsqrt", 0x06 }, + { "pfsub", 0x05 }, + { "pfsubr", 0x06 }, + { "phaddd", 0x06 }, + { "phaddsw", 0x07 }, + { "phaddw", 0x06 }, + { "phminposuw", 0x0A }, + { "phsubd", 0x06 }, + { "phsubsw", 0x07 }, + { "phsubw", 0x06 }, + { "pi2fd", 0x05 }, + { "pi2fw", 0x05 }, + { "pinsrb", 0x06 }, + { "pinsrd", 0x06 }, + { "pinsrq", 0x06 }, + { "pinsrw", 0x06 }, + { "pmaddubsw", 0x09 }, + { "pmaddwd", 0x07 }, + { "pmaxsb", 0x06 }, + { "pmaxsd", 0x06 }, + { "pmaxsw", 0x06 }, + { "pmaxub", 0x06 }, + { "pmaxud", 0x06 }, + { "pmaxuw", 0x06 }, + { "pminsb", 0x06 }, + { "pminsd", 0x06 }, + { "pminsw", 0x06 }, + { "pminub", 0x06 }, + { "pminud", 0x06 }, + { "pminuw", 0x06 }, + { "pmovmskb", 0x08 }, + { "pmovsxbd", 0x08 }, + { "pmovsxbq", 0x08 }, + { "pmovsxbw", 0x08 }, + { "pmovsxdq", 0x08 }, + { "pmovsxwd", 0x08 }, + { "pmovsxwq", 0x08 }, + { "pmovzxbd", 0x08 }, + { "pmovzxbq", 0x08 }, + { "pmovzxbw", 0x08 }, + { "pmovzxdq", 0x08 }, + { "pmovzxwd", 0x08 }, + { "pmovzxwq", 0x08 }, + { "pmuldq", 0x06 }, + { "pmulhrsw", 0x08 }, + { "pmulhrw", 0x07 }, + { "pmulhuw", 0x07 }, + { "pmulhw", 0x06 }, + { "pmulld", 0x06 }, + { "pmullw", 0x06 }, + { "pmuludq", 0x07 }, + { "pop", 0x03 }, + { "popa", 0x04 }, + { "popad", 0x05 }, + { "popcnt", 0x06 }, + { "popf", 0x04 }, + { "popfd", 0x05 }, + { "popfq", 0x05 }, + { "por", 0x03 }, + { "prefetch", 0x08 }, + { "prefetchnta", 0x0B }, + { "prefetcht0", 0x0A }, + { "prefetcht1", 0x0A }, + { "prefetcht2", 0x0A }, + { "prefetchw", 0x09 }, + { "prefetchwt1", 0x0B }, + { "psadbw", 0x06 }, + { "pshufb", 0x06 }, + { "pshufd", 0x06 }, + { "pshufhw", 0x07 }, + { "pshuflw", 0x07 }, + { "pshufw", 0x06 }, + { "psignb", 0x06 }, + { "psignd", 0x06 }, + { "psignw", 0x06 }, + { "pslld", 0x05 }, + { "pslldq", 0x06 }, + { "psllq", 0x05 }, + { "psllw", 0x05 }, + { "psrad", 0x05 }, + { "psraw", 0x05 }, + { "psrld", 0x05 }, + { "psrldq", 0x06 }, + { "psrlq", 0x05 }, + { "psrlw", 0x05 }, + { "psubb", 0x05 }, + { "psubd", 0x05 }, + { "psubq", 0x05 }, + { "psubsb", 0x06 }, + { "psubsw", 0x06 }, + { "psubusb", 0x07 }, + { "psubusw", 0x07 }, + { "psubw", 0x05 }, + { "pswapd", 0x06 }, + { "ptest", 0x05 }, + { "ptwrite", 0x07 }, + { "punpckhbw", 0x09 }, + { "punpckhdq", 0x09 }, + { "punpckhqdq", 0x0A }, + { "punpckhwd", 0x09 }, + { "punpcklbw", 0x09 }, + { "punpckldq", 0x09 }, + { "punpcklqdq", 0x0A }, + { "punpcklwd", 0x09 }, + { "push", 0x04 }, + { "pusha", 0x05 }, + { "pushad", 0x06 }, + { "pushf", 0x05 }, + { "pushfd", 0x06 }, + { "pushfq", 0x06 }, + { "pxor", 0x04 }, + { "rcl", 0x03 }, + { "rcpps", 0x05 }, + { "rcpss", 0x05 }, + { "rcr", 0x03 }, + { "rdfsbase", 0x08 }, + { "rdgsbase", 0x08 }, + { "rdmsr", 0x05 }, + { "rdpid", 0x05 }, + { "rdpkru", 0x06 }, + { "rdpmc", 0x05 }, + { "rdrand", 0x06 }, + { "rdseed", 0x06 }, + { "rdsspd", 0x06 }, + { "rdsspq", 0x06 }, + { "rdtsc", 0x05 }, + { "rdtscp", 0x06 }, + { "ret", 0x03 }, + { "rol", 0x03 }, + { "ror", 0x03 }, + { "rorx", 0x04 }, + { "roundpd", 0x07 }, + { "roundps", 0x07 }, + { "roundsd", 0x07 }, + { "roundss", 0x07 }, + { "rsm", 0x03 }, + { "rsqrtps", 0x07 }, + { "rsqrtss", 0x07 }, + { "rstorssp", 0x08 }, + { "sahf", 0x04 }, + { "salc", 0x04 }, + { "sar", 0x03 }, + { "sarx", 0x04 }, + { "savessp", 0x07 }, + { "sbb", 0x03 }, + { "scasb", 0x05 }, + { "scasd", 0x05 }, + { "scasq", 0x05 }, + { "scasw", 0x05 }, + { "setb", 0x04 }, + { "setbe", 0x05 }, + { "setl", 0x04 }, + { "setle", 0x05 }, + { "setnb", 0x05 }, + { "setnbe", 0x06 }, + { "setnl", 0x05 }, + { "setnle", 0x06 }, + { "setno", 0x05 }, + { "setnp", 0x05 }, + { "setns", 0x05 }, + { "setnz", 0x05 }, + { "seto", 0x04 }, + { "setp", 0x04 }, + { "sets", 0x04 }, + { "setssbsy", 0x08 }, + { "setz", 0x04 }, + { "sfence", 0x06 }, + { "sgdt", 0x04 }, + { "sha1msg1", 0x08 }, + { "sha1msg2", 0x08 }, + { "sha1nexte", 0x09 }, + { "sha1rnds4", 0x09 }, + { "sha256msg1", 0x0A }, + { "sha256msg2", 0x0A }, + { "sha256rnds2", 0x0B }, + { "shl", 0x03 }, + { "shld", 0x04 }, + { "shlx", 0x04 }, + { "shr", 0x03 }, + { "shrd", 0x04 }, + { "shrx", 0x04 }, + { "shufpd", 0x06 }, + { "shufps", 0x06 }, + { "sidt", 0x04 }, + { "skinit", 0x06 }, + { "sldt", 0x04 }, + { "slwpcb", 0x06 }, + { "smsw", 0x04 }, + { "spflt", 0x05 }, + { "sqrtpd", 0x06 }, + { "sqrtps", 0x06 }, + { "sqrtsd", 0x06 }, + { "sqrtss", 0x06 }, + { "stac", 0x04 }, + { "stc", 0x03 }, + { "std", 0x03 }, + { "stgi", 0x04 }, + { "sti", 0x03 }, + { "stmxcsr", 0x07 }, + { "stosb", 0x05 }, + { "stosd", 0x05 }, + { "stosq", 0x05 }, + { "stosw", 0x05 }, + { "str", 0x03 }, + { "sub", 0x03 }, + { "subpd", 0x05 }, + { "subps", 0x05 }, + { "subsd", 0x05 }, + { "subss", 0x05 }, + { "swapgs", 0x06 }, + { "syscall", 0x07 }, + { "sysenter", 0x08 }, + { "sysexit", 0x07 }, + { "sysret", 0x06 }, + { "t1mskc", 0x06 }, + { "test", 0x04 }, + { "tzcnt", 0x05 }, + { "tzcnti", 0x06 }, + { "tzmsk", 0x05 }, + { "ucomisd", 0x07 }, + { "ucomiss", 0x07 }, + { "ud0", 0x03 }, + { "ud1", 0x03 }, + { "ud2", 0x03 }, + { "unpckhpd", 0x08 }, + { "unpckhps", 0x08 }, + { "unpcklpd", 0x08 }, + { "unpcklps", 0x08 }, + { "v4fmaddps", 0x09 }, + { "v4fmaddss", 0x09 }, + { "v4fnmaddps", 0x0A }, + { "v4fnmaddss", 0x0A }, + { "vaddnpd", 0x07 }, + { "vaddnps", 0x07 }, + { "vaddpd", 0x06 }, + { "vaddps", 0x06 }, + { "vaddsd", 0x06 }, + { "vaddsetsps", 0x0A }, + { "vaddss", 0x06 }, + { "vaddsubpd", 0x09 }, + { "vaddsubps", 0x09 }, + { "vaesdec", 0x07 }, + { "vaesdeclast", 0x0B }, + { "vaesenc", 0x07 }, + { "vaesenclast", 0x0B }, + { "vaesimc", 0x07 }, + { "vaeskeygenassist", 0x10 }, + { "valignd", 0x07 }, + { "valignq", 0x07 }, + { "vandnpd", 0x07 }, + { "vandnps", 0x07 }, + { "vandpd", 0x06 }, + { "vandps", 0x06 }, + { "vblendmpd", 0x09 }, + { "vblendmps", 0x09 }, + { "vblendpd", 0x08 }, + { "vblendps", 0x08 }, + { "vblendvpd", 0x09 }, + { "vblendvps", 0x09 }, + { "vbroadcastf128", 0x0E }, + { "vbroadcastf32x2", 0x0F }, + { "vbroadcastf32x4", 0x0F }, + { "vbroadcastf32x8", 0x0F }, + { "vbroadcastf64x2", 0x0F }, + { "vbroadcastf64x4", 0x0F }, + { "vbroadcasti128", 0x0E }, + { "vbroadcasti32x2", 0x0F }, + { "vbroadcasti32x4", 0x0F }, + { "vbroadcasti32x8", 0x0F }, + { "vbroadcasti64x2", 0x0F }, + { "vbroadcasti64x4", 0x0F }, + { "vbroadcastsd", 0x0C }, + { "vbroadcastss", 0x0C }, + { "vcmppd", 0x06 }, + { "vcmpps", 0x06 }, + { "vcmpsd", 0x06 }, + { "vcmpss", 0x06 }, + { "vcomisd", 0x07 }, + { "vcomiss", 0x07 }, + { "vcompresspd", 0x0B }, + { "vcompressps", 0x0B }, + { "vcvtdq2pd", 0x09 }, + { "vcvtdq2ps", 0x09 }, + { "vcvtfxpntdq2ps", 0x0E }, + { "vcvtfxpntpd2dq", 0x0E }, + { "vcvtfxpntpd2udq", 0x0F }, + { "vcvtfxpntps2dq", 0x0E }, + { "vcvtfxpntps2udq", 0x0F }, + { "vcvtfxpntudq2ps", 0x0F }, + { "vcvtpd2dq", 0x09 }, + { "vcvtpd2ps", 0x09 }, + { "vcvtpd2qq", 0x09 }, + { "vcvtpd2udq", 0x0A }, + { "vcvtpd2uqq", 0x0A }, + { "vcvtph2ps", 0x09 }, + { "vcvtps2dq", 0x09 }, + { "vcvtps2pd", 0x09 }, + { "vcvtps2ph", 0x09 }, + { "vcvtps2qq", 0x09 }, + { "vcvtps2udq", 0x0A }, + { "vcvtps2uqq", 0x0A }, + { "vcvtqq2pd", 0x09 }, + { "vcvtqq2ps", 0x09 }, + { "vcvtsd2si", 0x09 }, + { "vcvtsd2ss", 0x09 }, + { "vcvtsd2usi", 0x0A }, + { "vcvtsi2sd", 0x09 }, + { "vcvtsi2ss", 0x09 }, + { "vcvtss2sd", 0x09 }, + { "vcvtss2si", 0x09 }, + { "vcvtss2usi", 0x0A }, + { "vcvttpd2dq", 0x0A }, + { "vcvttpd2qq", 0x0A }, + { "vcvttpd2udq", 0x0B }, + { "vcvttpd2uqq", 0x0B }, + { "vcvttps2dq", 0x0A }, + { "vcvttps2qq", 0x0A }, + { "vcvttps2udq", 0x0B }, + { "vcvttps2uqq", 0x0B }, + { "vcvttsd2si", 0x0A }, + { "vcvttsd2usi", 0x0B }, + { "vcvttss2si", 0x0A }, + { "vcvttss2usi", 0x0B }, + { "vcvtudq2pd", 0x0A }, + { "vcvtudq2ps", 0x0A }, + { "vcvtuqq2pd", 0x0A }, + { "vcvtuqq2ps", 0x0A }, + { "vcvtusi2sd", 0x0A }, + { "vcvtusi2ss", 0x0A }, + { "vdbpsadbw", 0x09 }, + { "vdivpd", 0x06 }, + { "vdivps", 0x06 }, + { "vdivsd", 0x06 }, + { "vdivss", 0x06 }, + { "vdppd", 0x05 }, + { "vdpps", 0x05 }, + { "verr", 0x04 }, + { "verw", 0x04 }, + { "vexp223ps", 0x09 }, + { "vexp2pd", 0x07 }, + { "vexp2ps", 0x07 }, + { "vexpandpd", 0x09 }, + { "vexpandps", 0x09 }, + { "vextractf128", 0x0C }, + { "vextractf32x4", 0x0D }, + { "vextractf32x8", 0x0D }, + { "vextractf64x2", 0x0D }, + { "vextractf64x4", 0x0D }, + { "vextracti128", 0x0C }, + { "vextracti32x4", 0x0D }, + { "vextracti32x8", 0x0D }, + { "vextracti64x2", 0x0D }, + { "vextracti64x4", 0x0D }, + { "vextractps", 0x0A }, + { "vfixupimmpd", 0x0B }, + { "vfixupimmps", 0x0B }, + { "vfixupimmsd", 0x0B }, + { "vfixupimmss", 0x0B }, + { "vfixupnanpd", 0x0B }, + { "vfixupnanps", 0x0B }, + { "vfmadd132pd", 0x0B }, + { "vfmadd132ps", 0x0B }, + { "vfmadd132sd", 0x0B }, + { "vfmadd132ss", 0x0B }, + { "vfmadd213pd", 0x0B }, + { "vfmadd213ps", 0x0B }, + { "vfmadd213sd", 0x0B }, + { "vfmadd213ss", 0x0B }, + { "vfmadd231pd", 0x0B }, + { "vfmadd231ps", 0x0B }, + { "vfmadd231sd", 0x0B }, + { "vfmadd231ss", 0x0B }, + { "vfmadd233ps", 0x0B }, + { "vfmaddpd", 0x08 }, + { "vfmaddps", 0x08 }, + { "vfmaddsd", 0x08 }, + { "vfmaddss", 0x08 }, + { "vfmaddsub132pd", 0x0E }, + { "vfmaddsub132ps", 0x0E }, + { "vfmaddsub213pd", 0x0E }, + { "vfmaddsub213ps", 0x0E }, + { "vfmaddsub231pd", 0x0E }, + { "vfmaddsub231ps", 0x0E }, + { "vfmaddsubpd", 0x0B }, + { "vfmaddsubps", 0x0B }, + { "vfmsub132pd", 0x0B }, + { "vfmsub132ps", 0x0B }, + { "vfmsub132sd", 0x0B }, + { "vfmsub132ss", 0x0B }, + { "vfmsub213pd", 0x0B }, + { "vfmsub213ps", 0x0B }, + { "vfmsub213sd", 0x0B }, + { "vfmsub213ss", 0x0B }, + { "vfmsub231pd", 0x0B }, + { "vfmsub231ps", 0x0B }, + { "vfmsub231sd", 0x0B }, + { "vfmsub231ss", 0x0B }, + { "vfmsubadd132pd", 0x0E }, + { "vfmsubadd132ps", 0x0E }, + { "vfmsubadd213pd", 0x0E }, + { "vfmsubadd213ps", 0x0E }, + { "vfmsubadd231pd", 0x0E }, + { "vfmsubadd231ps", 0x0E }, + { "vfmsubaddpd", 0x0B }, + { "vfmsubaddps", 0x0B }, + { "vfmsubpd", 0x08 }, + { "vfmsubps", 0x08 }, + { "vfmsubsd", 0x08 }, + { "vfmsubss", 0x08 }, + { "vfnmadd132pd", 0x0C }, + { "vfnmadd132ps", 0x0C }, + { "vfnmadd132sd", 0x0C }, + { "vfnmadd132ss", 0x0C }, + { "vfnmadd213pd", 0x0C }, + { "vfnmadd213ps", 0x0C }, + { "vfnmadd213sd", 0x0C }, + { "vfnmadd213ss", 0x0C }, + { "vfnmadd231pd", 0x0C }, + { "vfnmadd231ps", 0x0C }, + { "vfnmadd231sd", 0x0C }, + { "vfnmadd231ss", 0x0C }, + { "vfnmaddpd", 0x09 }, + { "vfnmaddps", 0x09 }, + { "vfnmaddsd", 0x09 }, + { "vfnmaddss", 0x09 }, + { "vfnmsub132pd", 0x0C }, + { "vfnmsub132ps", 0x0C }, + { "vfnmsub132sd", 0x0C }, + { "vfnmsub132ss", 0x0C }, + { "vfnmsub213pd", 0x0C }, + { "vfnmsub213ps", 0x0C }, + { "vfnmsub213sd", 0x0C }, + { "vfnmsub213ss", 0x0C }, + { "vfnmsub231pd", 0x0C }, + { "vfnmsub231ps", 0x0C }, + { "vfnmsub231sd", 0x0C }, + { "vfnmsub231ss", 0x0C }, + { "vfnmsubpd", 0x09 }, + { "vfnmsubps", 0x09 }, + { "vfnmsubsd", 0x09 }, + { "vfnmsubss", 0x09 }, + { "vfpclasspd", 0x0A }, + { "vfpclassps", 0x0A }, + { "vfpclasssd", 0x0A }, + { "vfpclassss", 0x0A }, + { "vfrczpd", 0x07 }, + { "vfrczps", 0x07 }, + { "vfrczsd", 0x07 }, + { "vfrczss", 0x07 }, + { "vgatherdpd", 0x0A }, + { "vgatherdps", 0x0A }, + { "vgatherpf0dpd", 0x0D }, + { "vgatherpf0dps", 0x0D }, + { "vgatherpf0hintdpd", 0x11 }, + { "vgatherpf0hintdps", 0x11 }, + { "vgatherpf0qpd", 0x0D }, + { "vgatherpf0qps", 0x0D }, + { "vgatherpf1dpd", 0x0D }, + { "vgatherpf1dps", 0x0D }, + { "vgatherpf1qpd", 0x0D }, + { "vgatherpf1qps", 0x0D }, + { "vgatherqpd", 0x0A }, + { "vgatherqps", 0x0A }, + { "vgetexppd", 0x09 }, + { "vgetexpps", 0x09 }, + { "vgetexpsd", 0x09 }, + { "vgetexpss", 0x09 }, + { "vgetmantpd", 0x0A }, + { "vgetmantps", 0x0A }, + { "vgetmantsd", 0x0A }, + { "vgetmantss", 0x0A }, + { "vgf2p8affineinvqb", 0x11 }, + { "vgf2p8affineqb", 0x0E }, + { "vgf2p8mulb", 0x0A }, + { "vgmaxabsps", 0x0A }, + { "vgmaxpd", 0x07 }, + { "vgmaxps", 0x07 }, + { "vgminpd", 0x07 }, + { "vgminps", 0x07 }, + { "vhaddpd", 0x07 }, + { "vhaddps", 0x07 }, + { "vhsubpd", 0x07 }, + { "vhsubps", 0x07 }, + { "vinsertf128", 0x0B }, + { "vinsertf32x4", 0x0C }, + { "vinsertf32x8", 0x0C }, + { "vinsertf64x2", 0x0C }, + { "vinsertf64x4", 0x0C }, + { "vinserti128", 0x0B }, + { "vinserti32x4", 0x0C }, + { "vinserti32x8", 0x0C }, + { "vinserti64x2", 0x0C }, + { "vinserti64x4", 0x0C }, + { "vinsertps", 0x09 }, + { "vlddqu", 0x06 }, + { "vldmxcsr", 0x08 }, + { "vloadunpackhd", 0x0D }, + { "vloadunpackhpd", 0x0E }, + { "vloadunpackhps", 0x0E }, + { "vloadunpackhq", 0x0D }, + { "vloadunpackld", 0x0D }, + { "vloadunpacklpd", 0x0E }, + { "vloadunpacklps", 0x0E }, + { "vloadunpacklq", 0x0D }, + { "vlog2ps", 0x07 }, + { "vmaskmovdqu", 0x0B }, + { "vmaskmovpd", 0x0A }, + { "vmaskmovps", 0x0A }, + { "vmaxpd", 0x06 }, + { "vmaxps", 0x06 }, + { "vmaxsd", 0x06 }, + { "vmaxss", 0x06 }, + { "vmcall", 0x06 }, + { "vmclear", 0x07 }, + { "vmfunc", 0x06 }, + { "vminpd", 0x06 }, + { "vminps", 0x06 }, + { "vminsd", 0x06 }, + { "vminss", 0x06 }, + { "vmlaunch", 0x08 }, + { "vmload", 0x06 }, + { "vmmcall", 0x07 }, + { "vmovapd", 0x07 }, + { "vmovaps", 0x07 }, + { "vmovd", 0x05 }, + { "vmovddup", 0x08 }, + { "vmovdqa", 0x07 }, + { "vmovdqa32", 0x09 }, + { "vmovdqa64", 0x09 }, + { "vmovdqu", 0x07 }, + { "vmovdqu16", 0x09 }, + { "vmovdqu32", 0x09 }, + { "vmovdqu64", 0x09 }, + { "vmovdqu8", 0x08 }, + { "vmovhlps", 0x08 }, + { "vmovhpd", 0x07 }, + { "vmovhps", 0x07 }, + { "vmovlhps", 0x08 }, + { "vmovlpd", 0x07 }, + { "vmovlps", 0x07 }, + { "vmovmskpd", 0x09 }, + { "vmovmskps", 0x09 }, + { "vmovnrapd", 0x09 }, + { "vmovnraps", 0x09 }, + { "vmovnrngoapd", 0x0C }, + { "vmovnrngoaps", 0x0C }, + { "vmovntdq", 0x08 }, + { "vmovntdqa", 0x09 }, + { "vmovntpd", 0x08 }, + { "vmovntps", 0x08 }, + { "vmovq", 0x05 }, + { "vmovsd", 0x06 }, + { "vmovshdup", 0x09 }, + { "vmovsldup", 0x09 }, + { "vmovss", 0x06 }, + { "vmovupd", 0x07 }, + { "vmovups", 0x07 }, + { "vmpsadbw", 0x08 }, + { "vmptrld", 0x07 }, + { "vmptrst", 0x07 }, + { "vmread", 0x06 }, + { "vmresume", 0x08 }, + { "vmrun", 0x05 }, + { "vmsave", 0x06 }, + { "vmulpd", 0x06 }, + { "vmulps", 0x06 }, + { "vmulsd", 0x06 }, + { "vmulss", 0x06 }, + { "vmwrite", 0x07 }, + { "vmxoff", 0x06 }, + { "vmxon", 0x05 }, + { "vorpd", 0x05 }, + { "vorps", 0x05 }, + { "vp4dpwssd", 0x09 }, + { "vp4dpwssds", 0x0A }, + { "vpabsb", 0x06 }, + { "vpabsd", 0x06 }, + { "vpabsq", 0x06 }, + { "vpabsw", 0x06 }, + { "vpackssdw", 0x09 }, + { "vpacksswb", 0x09 }, + { "vpackstorehd", 0x0C }, + { "vpackstorehpd", 0x0D }, + { "vpackstorehps", 0x0D }, + { "vpackstorehq", 0x0C }, + { "vpackstoreld", 0x0C }, + { "vpackstorelpd", 0x0D }, + { "vpackstorelps", 0x0D }, + { "vpackstorelq", 0x0C }, + { "vpackusdw", 0x09 }, + { "vpackuswb", 0x09 }, + { "vpadcd", 0x06 }, + { "vpaddb", 0x06 }, + { "vpaddd", 0x06 }, + { "vpaddq", 0x06 }, + { "vpaddsb", 0x07 }, + { "vpaddsetcd", 0x0A }, + { "vpaddsetsd", 0x0A }, + { "vpaddsw", 0x07 }, + { "vpaddusb", 0x08 }, + { "vpaddusw", 0x08 }, + { "vpaddw", 0x06 }, + { "vpalignr", 0x08 }, + { "vpand", 0x05 }, + { "vpandd", 0x06 }, + { "vpandn", 0x06 }, + { "vpandnd", 0x07 }, + { "vpandnq", 0x07 }, + { "vpandq", 0x06 }, + { "vpavgb", 0x06 }, + { "vpavgw", 0x06 }, + { "vpblendd", 0x08 }, + { "vpblendmb", 0x09 }, + { "vpblendmd", 0x09 }, + { "vpblendmq", 0x09 }, + { "vpblendmw", 0x09 }, + { "vpblendvb", 0x09 }, + { "vpblendw", 0x08 }, + { "vpbroadcastb", 0x0C }, + { "vpbroadcastd", 0x0C }, + { "vpbroadcastmb2q", 0x0F }, + { "vpbroadcastmw2d", 0x0F }, + { "vpbroadcastq", 0x0C }, + { "vpbroadcastw", 0x0C }, + { "vpclmulqdq", 0x0A }, + { "vpcmov", 0x06 }, + { "vpcmpb", 0x06 }, + { "vpcmpd", 0x06 }, + { "vpcmpeqb", 0x08 }, + { "vpcmpeqd", 0x08 }, + { "vpcmpeqq", 0x08 }, + { "vpcmpeqw", 0x08 }, + { "vpcmpestri", 0x0A }, + { "vpcmpestrm", 0x0A }, + { "vpcmpgtb", 0x08 }, + { "vpcmpgtd", 0x08 }, + { "vpcmpgtq", 0x08 }, + { "vpcmpgtw", 0x08 }, + { "vpcmpistri", 0x0A }, + { "vpcmpistrm", 0x0A }, + { "vpcmpltd", 0x08 }, + { "vpcmpq", 0x06 }, + { "vpcmpub", 0x07 }, + { "vpcmpud", 0x07 }, + { "vpcmpuq", 0x07 }, + { "vpcmpuw", 0x07 }, + { "vpcmpw", 0x06 }, + { "vpcomb", 0x06 }, + { "vpcomd", 0x06 }, + { "vpcompressb", 0x0B }, + { "vpcompressd", 0x0B }, + { "vpcompressq", 0x0B }, + { "vpcompressw", 0x0B }, + { "vpcomq", 0x06 }, + { "vpcomub", 0x07 }, + { "vpcomud", 0x07 }, + { "vpcomuq", 0x07 }, + { "vpcomuw", 0x07 }, + { "vpcomw", 0x06 }, + { "vpconflictd", 0x0B }, + { "vpconflictq", 0x0B }, + { "vpdpbusd", 0x08 }, + { "vpdpbusds", 0x09 }, + { "vpdpwssd", 0x08 }, + { "vpdpwssds", 0x09 }, + { "vperm2f128", 0x0A }, + { "vperm2i128", 0x0A }, + { "vpermb", 0x06 }, + { "vpermd", 0x06 }, + { "vpermf32x4", 0x0A }, + { "vpermi2b", 0x08 }, + { "vpermi2d", 0x08 }, + { "vpermi2pd", 0x09 }, + { "vpermi2ps", 0x09 }, + { "vpermi2q", 0x08 }, + { "vpermi2w", 0x08 }, + { "vpermil2pd", 0x0A }, + { "vpermil2ps", 0x0A }, + { "vpermilpd", 0x09 }, + { "vpermilps", 0x09 }, + { "vpermpd", 0x07 }, + { "vpermps", 0x07 }, + { "vpermq", 0x06 }, + { "vpermt2b", 0x08 }, + { "vpermt2d", 0x08 }, + { "vpermt2pd", 0x09 }, + { "vpermt2ps", 0x09 }, + { "vpermt2q", 0x08 }, + { "vpermt2w", 0x08 }, + { "vpermw", 0x06 }, + { "vpexpandb", 0x09 }, + { "vpexpandd", 0x09 }, + { "vpexpandq", 0x09 }, + { "vpexpandw", 0x09 }, + { "vpextrb", 0x07 }, + { "vpextrd", 0x07 }, + { "vpextrq", 0x07 }, + { "vpextrw", 0x07 }, + { "vpgatherdd", 0x0A }, + { "vpgatherdq", 0x0A }, + { "vpgatherqd", 0x0A }, + { "vpgatherqq", 0x0A }, + { "vphaddbd", 0x08 }, + { "vphaddbq", 0x08 }, + { "vphaddbw", 0x08 }, + { "vphaddd", 0x07 }, + { "vphadddq", 0x08 }, + { "vphaddsw", 0x08 }, + { "vphaddubd", 0x09 }, + { "vphaddubq", 0x09 }, + { "vphaddubw", 0x09 }, + { "vphaddudq", 0x09 }, + { "vphadduwd", 0x09 }, + { "vphadduwq", 0x09 }, + { "vphaddw", 0x07 }, + { "vphaddwd", 0x08 }, + { "vphaddwq", 0x08 }, + { "vphminposuw", 0x0B }, + { "vphsubbw", 0x08 }, + { "vphsubd", 0x07 }, + { "vphsubdq", 0x08 }, + { "vphsubsw", 0x08 }, + { "vphsubw", 0x07 }, + { "vphsubwd", 0x08 }, + { "vpinsrb", 0x07 }, + { "vpinsrd", 0x07 }, + { "vpinsrq", 0x07 }, + { "vpinsrw", 0x07 }, + { "vplzcntd", 0x08 }, + { "vplzcntq", 0x08 }, + { "vpmacsdd", 0x08 }, + { "vpmacsdqh", 0x09 }, + { "vpmacsdql", 0x09 }, + { "vpmacssdd", 0x09 }, + { "vpmacssdqh", 0x0A }, + { "vpmacssdql", 0x0A }, + { "vpmacsswd", 0x09 }, + { "vpmacssww", 0x09 }, + { "vpmacswd", 0x08 }, + { "vpmacsww", 0x08 }, + { "vpmadcsswd", 0x0A }, + { "vpmadcswd", 0x09 }, + { "vpmadd231d", 0x0A }, + { "vpmadd233d", 0x0A }, + { "vpmadd52huq", 0x0B }, + { "vpmadd52luq", 0x0B }, + { "vpmaddubsw", 0x0A }, + { "vpmaddwd", 0x08 }, + { "vpmaskmovd", 0x0A }, + { "vpmaskmovq", 0x0A }, + { "vpmaxsb", 0x07 }, + { "vpmaxsd", 0x07 }, + { "vpmaxsq", 0x07 }, + { "vpmaxsw", 0x07 }, + { "vpmaxub", 0x07 }, + { "vpmaxud", 0x07 }, + { "vpmaxuq", 0x07 }, + { "vpmaxuw", 0x07 }, + { "vpminsb", 0x07 }, + { "vpminsd", 0x07 }, + { "vpminsq", 0x07 }, + { "vpminsw", 0x07 }, + { "vpminub", 0x07 }, + { "vpminud", 0x07 }, + { "vpminuq", 0x07 }, + { "vpminuw", 0x07 }, + { "vpmovb2m", 0x08 }, + { "vpmovd2m", 0x08 }, + { "vpmovdb", 0x07 }, + { "vpmovdw", 0x07 }, + { "vpmovm2b", 0x08 }, + { "vpmovm2d", 0x08 }, + { "vpmovm2q", 0x08 }, + { "vpmovm2w", 0x08 }, + { "vpmovmskb", 0x09 }, + { "vpmovq2m", 0x08 }, + { "vpmovqb", 0x07 }, + { "vpmovqd", 0x07 }, + { "vpmovqw", 0x07 }, + { "vpmovsdb", 0x08 }, + { "vpmovsdw", 0x08 }, + { "vpmovsqb", 0x08 }, + { "vpmovsqd", 0x08 }, + { "vpmovsqw", 0x08 }, + { "vpmovswb", 0x08 }, + { "vpmovsxbd", 0x09 }, + { "vpmovsxbq", 0x09 }, + { "vpmovsxbw", 0x09 }, + { "vpmovsxdq", 0x09 }, + { "vpmovsxwd", 0x09 }, + { "vpmovsxwq", 0x09 }, + { "vpmovusdb", 0x09 }, + { "vpmovusdw", 0x09 }, + { "vpmovusqb", 0x09 }, + { "vpmovusqd", 0x09 }, + { "vpmovusqw", 0x09 }, + { "vpmovuswb", 0x09 }, + { "vpmovw2m", 0x08 }, + { "vpmovwb", 0x07 }, + { "vpmovzxbd", 0x09 }, + { "vpmovzxbq", 0x09 }, + { "vpmovzxbw", 0x09 }, + { "vpmovzxdq", 0x09 }, + { "vpmovzxwd", 0x09 }, + { "vpmovzxwq", 0x09 }, + { "vpmuldq", 0x07 }, + { "vpmulhd", 0x07 }, + { "vpmulhrsw", 0x09 }, + { "vpmulhud", 0x08 }, + { "vpmulhuw", 0x08 }, + { "vpmulhw", 0x07 }, + { "vpmulld", 0x07 }, + { "vpmullq", 0x07 }, + { "vpmullw", 0x07 }, + { "vpmultishiftqb", 0x0E }, + { "vpmuludq", 0x08 }, + { "vpopcntb", 0x08 }, + { "vpopcntd", 0x08 }, + { "vpopcntq", 0x08 }, + { "vpopcntw", 0x08 }, + { "vpor", 0x04 }, + { "vpord", 0x05 }, + { "vporq", 0x05 }, + { "vpperm", 0x06 }, + { "vprefetch0", 0x0A }, + { "vprefetch1", 0x0A }, + { "vprefetch2", 0x0A }, + { "vprefetche0", 0x0B }, + { "vprefetche1", 0x0B }, + { "vprefetche2", 0x0B }, + { "vprefetchenta", 0x0D }, + { "vprefetchnta", 0x0C }, + { "vprold", 0x06 }, + { "vprolq", 0x06 }, + { "vprolvd", 0x07 }, + { "vprolvq", 0x07 }, + { "vprord", 0x06 }, + { "vprorq", 0x06 }, + { "vprorvd", 0x07 }, + { "vprorvq", 0x07 }, + { "vprotb", 0x06 }, + { "vprotd", 0x06 }, + { "vprotq", 0x06 }, + { "vprotw", 0x06 }, + { "vpsadbw", 0x07 }, + { "vpsbbd", 0x06 }, + { "vpsbbrd", 0x07 }, + { "vpscatterdd", 0x0B }, + { "vpscatterdq", 0x0B }, + { "vpscatterqd", 0x0B }, + { "vpscatterqq", 0x0B }, + { "vpshab", 0x06 }, + { "vpshad", 0x06 }, + { "vpshaq", 0x06 }, + { "vpshaw", 0x06 }, + { "vpshlb", 0x06 }, + { "vpshld", 0x06 }, + { "vpshldd", 0x07 }, + { "vpshldq", 0x07 }, + { "vpshldvd", 0x08 }, + { "vpshldvq", 0x08 }, + { "vpshldvw", 0x08 }, + { "vpshldw", 0x07 }, + { "vpshlq", 0x06 }, + { "vpshlw", 0x06 }, + { "vpshrdd", 0x07 }, + { "vpshrdq", 0x07 }, + { "vpshrdvd", 0x08 }, + { "vpshrdvq", 0x08 }, + { "vpshrdvw", 0x08 }, + { "vpshrdw", 0x07 }, + { "vpshufb", 0x07 }, + { "vpshufbitqmb", 0x0C }, + { "vpshufd", 0x07 }, + { "vpshufhw", 0x08 }, + { "vpshuflw", 0x08 }, + { "vpsignb", 0x07 }, + { "vpsignd", 0x07 }, + { "vpsignw", 0x07 }, + { "vpslld", 0x06 }, + { "vpslldq", 0x07 }, + { "vpsllq", 0x06 }, + { "vpsllvd", 0x07 }, + { "vpsllvq", 0x07 }, + { "vpsllvw", 0x07 }, + { "vpsllw", 0x06 }, + { "vpsrad", 0x06 }, + { "vpsraq", 0x06 }, + { "vpsravd", 0x07 }, + { "vpsravq", 0x07 }, + { "vpsravw", 0x07 }, + { "vpsraw", 0x06 }, + { "vpsrld", 0x06 }, + { "vpsrldq", 0x07 }, + { "vpsrlq", 0x06 }, + { "vpsrlvd", 0x07 }, + { "vpsrlvq", 0x07 }, + { "vpsrlvw", 0x07 }, + { "vpsrlw", 0x06 }, + { "vpsubb", 0x06 }, + { "vpsubd", 0x06 }, + { "vpsubq", 0x06 }, + { "vpsubrd", 0x07 }, + { "vpsubrsetbd", 0x0B }, + { "vpsubsb", 0x07 }, + { "vpsubsetbd", 0x0A }, + { "vpsubsw", 0x07 }, + { "vpsubusb", 0x08 }, + { "vpsubusw", 0x08 }, + { "vpsubw", 0x06 }, + { "vpternlogd", 0x0A }, + { "vpternlogq", 0x0A }, + { "vptest", 0x06 }, + { "vptestmb", 0x08 }, + { "vptestmd", 0x08 }, + { "vptestmq", 0x08 }, + { "vptestmw", 0x08 }, + { "vptestnmb", 0x09 }, + { "vptestnmd", 0x09 }, + { "vptestnmq", 0x09 }, + { "vptestnmw", 0x09 }, + { "vpunpckhbw", 0x0A }, + { "vpunpckhdq", 0x0A }, + { "vpunpckhqdq", 0x0B }, + { "vpunpckhwd", 0x0A }, + { "vpunpcklbw", 0x0A }, + { "vpunpckldq", 0x0A }, + { "vpunpcklqdq", 0x0B }, + { "vpunpcklwd", 0x0A }, + { "vpxor", 0x05 }, + { "vpxord", 0x06 }, + { "vpxorq", 0x06 }, + { "vrangepd", 0x08 }, + { "vrangeps", 0x08 }, + { "vrangesd", 0x08 }, + { "vrangess", 0x08 }, + { "vrcp14pd", 0x08 }, + { "vrcp14ps", 0x08 }, + { "vrcp14sd", 0x08 }, + { "vrcp14ss", 0x08 }, + { "vrcp23ps", 0x08 }, + { "vrcp28pd", 0x08 }, + { "vrcp28ps", 0x08 }, + { "vrcp28sd", 0x08 }, + { "vrcp28ss", 0x08 }, + { "vrcpps", 0x06 }, + { "vrcpss", 0x06 }, + { "vreducepd", 0x09 }, + { "vreduceps", 0x09 }, + { "vreducesd", 0x09 }, + { "vreducess", 0x09 }, + { "vrndfxpntpd", 0x0B }, + { "vrndfxpntps", 0x0B }, + { "vrndscalepd", 0x0B }, + { "vrndscaleps", 0x0B }, + { "vrndscalesd", 0x0B }, + { "vrndscaless", 0x0B }, + { "vroundpd", 0x08 }, + { "vroundps", 0x08 }, + { "vroundsd", 0x08 }, + { "vroundss", 0x08 }, + { "vrsqrt14pd", 0x0A }, + { "vrsqrt14ps", 0x0A }, + { "vrsqrt14sd", 0x0A }, + { "vrsqrt14ss", 0x0A }, + { "vrsqrt23ps", 0x0A }, + { "vrsqrt28pd", 0x0A }, + { "vrsqrt28ps", 0x0A }, + { "vrsqrt28sd", 0x0A }, + { "vrsqrt28ss", 0x0A }, + { "vrsqrtps", 0x08 }, + { "vrsqrtss", 0x08 }, + { "vscalefpd", 0x09 }, + { "vscalefps", 0x09 }, + { "vscalefsd", 0x09 }, + { "vscalefss", 0x09 }, + { "vscaleps", 0x08 }, + { "vscatterdpd", 0x0B }, + { "vscatterdps", 0x0B }, + { "vscatterpf0dpd", 0x0E }, + { "vscatterpf0dps", 0x0E }, + { "vscatterpf0hintdpd", 0x12 }, + { "vscatterpf0hintdps", 0x12 }, + { "vscatterpf0qpd", 0x0E }, + { "vscatterpf0qps", 0x0E }, + { "vscatterpf1dpd", 0x0E }, + { "vscatterpf1dps", 0x0E }, + { "vscatterpf1qpd", 0x0E }, + { "vscatterpf1qps", 0x0E }, + { "vscatterqpd", 0x0B }, + { "vscatterqps", 0x0B }, + { "vshuff32x4", 0x0A }, + { "vshuff64x2", 0x0A }, + { "vshufi32x4", 0x0A }, + { "vshufi64x2", 0x0A }, + { "vshufpd", 0x07 }, + { "vshufps", 0x07 }, + { "vsqrtpd", 0x07 }, + { "vsqrtps", 0x07 }, + { "vsqrtsd", 0x07 }, + { "vsqrtss", 0x07 }, + { "vstmxcsr", 0x08 }, + { "vsubpd", 0x06 }, + { "vsubps", 0x06 }, + { "vsubrpd", 0x07 }, + { "vsubrps", 0x07 }, + { "vsubsd", 0x06 }, + { "vsubss", 0x06 }, + { "vtestpd", 0x07 }, + { "vtestps", 0x07 }, + { "vucomisd", 0x08 }, + { "vucomiss", 0x08 }, + { "vunpckhpd", 0x09 }, + { "vunpckhps", 0x09 }, + { "vunpcklpd", 0x09 }, + { "vunpcklps", 0x09 }, + { "vxorpd", 0x06 }, + { "vxorps", 0x06 }, + { "vzeroall", 0x08 }, + { "vzeroupper", 0x0A }, + { "wbinvd", 0x06 }, + { "wrfsbase", 0x08 }, + { "wrgsbase", 0x08 }, + { "wrmsr", 0x05 }, + { "wrpkru", 0x06 }, + { "wrssd", 0x05 }, + { "wrssq", 0x05 }, + { "wrussd", 0x06 }, + { "wrussq", 0x06 }, + { "xabort", 0x06 }, + { "xadd", 0x04 }, + { "xbegin", 0x06 }, + { "xchg", 0x04 }, + { "xend", 0x04 }, + { "xgetbv", 0x06 }, + { "xlat", 0x04 }, + { "xor", 0x03 }, + { "xorpd", 0x05 }, + { "xorps", 0x05 }, + { "xrstor", 0x06 }, + { "xrstor64", 0x08 }, + { "xrstors", 0x07 }, + { "xrstors64", 0x09 }, + { "xsave", 0x05 }, + { "xsave64", 0x07 }, + { "xsavec", 0x06 }, + { "xsavec64", 0x08 }, + { "xsaveopt", 0x08 }, + { "xsaveopt64", 0x0A }, + { "xsaves", 0x06 }, + { "xsaves64", 0x08 }, + { "xsetbv", 0x06 }, + { "xtest", 0x05 } }; diff --git a/src/Mnemonic.c b/src/Mnemonic.c index 7a11f90..e659ce0 100644 --- a/src/Mnemonic.c +++ b/src/Mnemonic.c @@ -30,8 +30,35 @@ /* Mnemonic strings */ /* ============================================================================================== */ +#pragma pack(push, 1) + +/** + * @brief Defines the `ZydisInternalString` struct. + */ +typedef struct ZydisInternalString_ +{ + /** + * @brief Contains the actual string. + */ + char* buffer; + /** + * @brief The length of the string (without 0-termination). + */ + ZydisU8 length; +} ZydisInternalString; + +#pragma pack(pop) + #include +/** + * @brief Contains all strings that were accessed by `ZydisMnemonicGetStringEx`. + * + * We could store `ZydisString` structs instead of `ZydisInternalString` ones in the + * `zydisMnemonicStrings` array, but this would significantly increase the table-size. + */ +static ZydisString stringTable[ZYDIS_MNEMONIC_MAX_VALUE + 1]; + /* ============================================================================================== */ /* Exported functions */ /* ============================================================================================== */ @@ -42,7 +69,22 @@ const char* ZydisMnemonicGetString(ZydisMnemonic mnemonic) { return ZYDIS_NULL; } - return zydisMnemonicStrings[mnemonic]; + return (const char*)zydisMnemonicStrings[mnemonic].buffer; +} + +const ZydisString* ZydisMnemonicGetStringEx(ZydisMnemonic mnemonic) +{ + if (mnemonic > ZYDIS_ARRAY_SIZE(zydisMnemonicStrings) - 1) + { + return ZYDIS_NULL; + } + if (!stringTable[mnemonic].buffer) + { + stringTable[mnemonic].buffer = zydisMnemonicStrings[mnemonic].buffer; + stringTable[mnemonic].length = zydisMnemonicStrings[mnemonic].length; + stringTable[mnemonic].capacity = zydisMnemonicStrings[mnemonic].length; + } + return &stringTable[mnemonic]; } /* ============================================================================================== */ diff --git a/src/String.c b/src/String.c new file mode 100644 index 0000000..41b4bdf --- /dev/null +++ b/src/String.c @@ -0,0 +1,416 @@ +/*************************************************************************************************** + + Zyan Disassembler Library (Zydis) + + Original Author : Florian Bernd, Joel Höner + + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + +***************************************************************************************************/ + +#include + +/* ============================================================================================== */ +/* Constants */ +/* ============================================================================================== */ + +/* ---------------------------------------------------------------------------------------------- */ +/* Defines */ +/* ---------------------------------------------------------------------------------------------- */ + +#define ZYDIS_MAXCHARS_DEC_32 10 +#define ZYDIS_MAXCHARS_DEC_64 20 +#define ZYDIS_MAXCHARS_HEX_32 8 +#define ZYDIS_MAXCHARS_HEX_64 16 + +/* ---------------------------------------------------------------------------------------------- */ +/* Lookup Tables */ +/* ---------------------------------------------------------------------------------------------- */ + +static const char* decimalLookup = + "00010203040506070809" + "10111213141516171819" + "20212223242526272829" + "30313233343536373839" + "40414243444546474849" + "50515253545556575859" + "60616263646566676869" + "70717273747576777879" + "80818283848586878889" + "90919293949596979899"; + +/* ---------------------------------------------------------------------------------------------- */ + +/* ============================================================================================== */ +/* Internal Functions */ +/* ============================================================================================== */ + +/* ---------------------------------------------------------------------------------------------- */ +/* Formatting */ +/* ---------------------------------------------------------------------------------------------- */ + +#if defined(ZYDIS_X86) || defined(ZYDIS_ARM) +ZydisStatus ZydisPrintDecU32(ZydisString* string, ZydisU32 value, ZydisU8 paddingLength) +{ + ZYDIS_ASSERT(string); + ZYDIS_ASSERT(string->buffer); + + char temp[ZYDIS_MAXCHARS_DEC_32 + 1]; + char *p = &temp[ZYDIS_MAXCHARS_DEC_32]; + while (value >= 100) + { + ZydisU32 const old = value; + p -= 2; + value /= 100; + ZydisMemoryCopy(p, &decimalLookup[(old - (value * 100)) * 2], sizeof(ZydisU16)); + } + p -= 2; + ZydisMemoryCopy(p, &decimalLookup[value * 2], sizeof(ZydisU16)); + + const ZydisUSize n = &temp[ZYDIS_MAXCHARS_DEC_32] - p; + if ((string->capacity - string->length < (ZydisUSize)(n + 1)) || + (string->capacity - string->length < (ZydisUSize)(paddingLength + 1))) + { + return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE; + } + + ZydisUSize offset = 0; + if (n <= paddingLength) + { + offset = paddingLength - n + 1; + ZydisMemorySet(string->buffer + string->length, '0', offset); + } + + ZydisMemoryCopy(string->buffer + string->length + offset, &p[value < 10], n + 1); + string->length += n + offset - (ZydisU8)(value < 10); + + return ZYDIS_STATUS_SUCCESS; +} + +ZydisStatus ZydisPrintHexU32(ZydisString* string, ZydisU32 value, ZydisU8 paddingLength, + ZydisBool uppercase, const ZydisString* prefix, const ZydisString* suffix) +{ + ZYDIS_ASSERT(string); + ZYDIS_ASSERT(string->buffer); + + if (prefix) + { + ZYDIS_CHECK(ZydisStringAppend(string, prefix)); + } + + char* buffer = string->buffer + string->length; + const ZydisUSize remaining = string->capacity - string->length; + + if (remaining < (ZydisUSize)paddingLength) + { + return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE; + } + + if (!value) + { + const ZydisU8 n = (paddingLength ? paddingLength : 1); + + if (remaining < (ZydisUSize)n) + { + return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE; + } + + ZydisMemorySet(buffer, '0', n); + string->length += n; + + return ZYDIS_STATUS_SUCCESS; + } + + ZydisU8 n = 0; + for (ZydisI8 i = ZYDIS_MAXCHARS_HEX_32 - 1; i >= 0; --i) + { + const ZydisU8 v = (value >> i * 4) & 0x0F; + if (!n) + { + if (!v) + { + continue; + } + if (remaining <= (ZydisU8)(i + 1)) // TODO: +1? + { + return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE; + } + if (paddingLength > i) + { + n = paddingLength - i - 1; + ZydisMemorySet(buffer, '0', n); + } + } + if (uppercase) + { + buffer[n++] = "0123456789ABCDEF"[v]; + } else + { + buffer[n++] = "0123456789abcdef"[v]; + } + } + string->length += n; + + if (suffix) + { + ZYDIS_CHECK(ZydisStringAppend(string, suffix)); + } + + return ZYDIS_STATUS_SUCCESS; +} +#endif + +ZydisStatus ZydisPrintDecU64(ZydisString* string, ZydisU64 value, ZydisU8 paddingLength) +{ + ZYDIS_ASSERT(string); + ZYDIS_ASSERT(string->buffer); + + char temp[ZYDIS_MAXCHARS_DEC_64 + 1]; + char *p = &temp[ZYDIS_MAXCHARS_DEC_64]; + while (value >= 100) + { + ZydisU64 const old = value; + p -= 2; + value /= 100; + ZydisMemoryCopy(p, &decimalLookup[(old - (value * 100)) * 2], 2); + } + p -= 2; + ZydisMemoryCopy(p, &decimalLookup[value * 2], sizeof(ZydisU16)); + + const ZydisUSize n = &temp[ZYDIS_MAXCHARS_DEC_64] - p; + if ((string->capacity - string->length < (ZydisUSize)(n + 1)) || + (string->capacity - string->length < (ZydisUSize)(paddingLength + 1))) + { + return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE; + } + + ZydisUSize offset = 0; + if (n <= paddingLength) + { + offset = paddingLength - n + 1; + ZydisMemorySet(string->buffer + string->length, '0', offset); + } + + ZydisMemoryCopy(string->buffer + string->length + offset, &p[value < 10], n + 1); + string->length += n + offset - (ZydisU8)(value < 10); + + return ZYDIS_STATUS_SUCCESS; +} + +ZydisStatus ZydisPrintHexU64(ZydisString* string, ZydisU64 value, ZydisU8 paddingLength, + ZydisBool uppercase, const ZydisString* prefix, const ZydisString* suffix) +{ + ZYDIS_ASSERT(string); + ZYDIS_ASSERT(string->buffer); + + if (prefix) + { + ZYDIS_CHECK(ZydisStringAppend(string, prefix)); + } + + char* buffer = string->buffer + string->length; + const ZydisUSize remaining = string->capacity - string->length; + + if (remaining < (ZydisUSize)paddingLength) + { + return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE; + } + + if (!value) + { + const ZydisU8 n = (paddingLength ? paddingLength : 1); + + if (remaining < (ZydisUSize)n) + { + return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE; + } + + ZydisMemorySet(buffer, '0', n); + string->length += n; + + return ZYDIS_STATUS_SUCCESS; + } + + ZydisU8 n = 0; + const ZydisU8 c = + ((value & 0xFFFFFFFF00000000) ? ZYDIS_MAXCHARS_HEX_64 : ZYDIS_MAXCHARS_HEX_32); + for (ZydisI8 i = c - 1; i >= 0; --i) + { + const ZydisU8 v = (value >> i * 4) & 0x0F; + if (!n) + { + if (!v) + { + continue; + } + if (remaining <= (ZydisU8)(i + 1)) // TODO: +1? + { + return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE; + } + if (paddingLength > i) + { + n = paddingLength - i - 1; + ZydisMemorySet(buffer, '0', n); + } + } + if (uppercase) + { + buffer[n++] = "0123456789ABCDEF"[v]; + } else + { + buffer[n++] = "0123456789abcdef"[v]; + } + } + string->length += n; + + if (suffix) + { + ZYDIS_CHECK(ZydisStringAppend(string, suffix)); + } + + return ZYDIS_STATUS_SUCCESS; +} + +/* ---------------------------------------------------------------------------------------------- */ + +/* ============================================================================================== */ +/* Public Functions */ +/* ============================================================================================== */ + +/* ---------------------------------------------------------------------------------------------- */ +/* Basic Operations */ +/* ---------------------------------------------------------------------------------------------- */ + +ZydisStatus ZydisStringAppendEx(ZydisString* string, const ZydisString* text, + ZydisLetterCase letterCase) +{ + if (!string || !text) + { + return ZYDIS_STATUS_INVALID_PARAMETER; + } + + if (string->length + text->length >= string->capacity) + { + return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE; + } + + ZydisMemoryCopy(string->buffer + string->length, text->buffer, text->length); + switch (letterCase) + { + case ZYDIS_LETTER_CASE_DEFAULT: + break; + case ZYDIS_LETTER_CASE_LOWER: + { + const signed char rebase = 'a' - 'A'; + char* c = string->buffer + string->length; + for (ZydisUSize i = 0; i < text->length; ++i) + { + if ((*c >= 'A') && (*c <= 'Z')) + { + *c += rebase; + } + ++c; + } + break; + } + case ZYDIS_LETTER_CASE_UPPER: + { + const signed char rebase = 'A' - 'a'; + char* c = string->buffer + string->length; + for (ZydisUSize i = 0; i < text->length; ++i) + { + if ((*c >= 'a') && (*c <= 'z')) + { + *c += rebase; + } + ++c; + } + break; + } + default: + return ZYDIS_STATUS_INVALID_PARAMETER; + } + string->length += text->length; + + return ZYDIS_STATUS_SUCCESS; +} + +/* ---------------------------------------------------------------------------------------------- */ +/* Formatting */ +/* ---------------------------------------------------------------------------------------------- */ + +ZydisStatus ZydisPrintDecU(ZydisString* string, ZydisU64 value, ZydisU8 paddingLength) +{ +#if defined(ZYDIS_X64) || defined(ZYDIS_AARCH64) + return ZydisPrintDecU64(string, value, paddingLength); +#else + if (value & 0xFFFFFFFF00000000) + { + return ZydisPrintDecU64(string, value, paddingLength); + } else + { + return ZydisPrintDecU32(string, (ZydisU32)value, paddingLength); + } +#endif +} + +ZydisStatus ZydisPrintDecS(ZydisString* string, ZydisI64 value, ZydisU8 paddingLength) +{ + if (value < 0) + { + ZYDIS_CHECK(ZydisStringAppendC(string, "-")); + return ZydisPrintDecU(string, -value, paddingLength); + } + return ZydisPrintDecU(string, value, paddingLength); +} + +ZydisStatus ZydisPrintHexU(ZydisString* string, ZydisU64 value, ZydisU8 paddingLength, + ZydisBool uppercase, const ZydisString* prefix, const ZydisString* suffix) +{ +#if defined(ZYDIS_X64) || defined(ZYDIS_AARCH64) + return ZydisPrintHexU64(string, value, paddingLength, uppercase, prefix, suffix); +#else + if (value & 0xFFFFFFFF00000000) + { + return ZydisPrintHexU64(string, value, paddingLength, uppercase, prefix, suffix); + } else + { + return ZydisPrintHexU32(string, (ZydisU32)value, paddingLength, uppercase, prefix, suffix); + } +#endif +} + +ZydisStatus ZydisPrintHexS(ZydisString* string, ZydisI64 value, ZydisU8 paddingLength, + ZydisBool uppercase, const ZydisString* prefix, const ZydisString* suffix) +{ + if (value < 0) + { + ZYDIS_CHECK(ZydisStringAppendC(string, "-")); + if (prefix) + { + ZYDIS_CHECK(ZydisStringAppend(string, prefix)); + } + return ZydisPrintHexU(string, -value, paddingLength, uppercase, ZYDIS_NULL, suffix); + } + return ZydisPrintHexU(string, value, paddingLength, uppercase, prefix, suffix); +} + +/* ---------------------------------------------------------------------------------------------- */ + +/* ============================================================================================== */ From 71b21c4301197a5fa2a3eb9ed862e468ee1b7bd7 Mon Sep 17 00:00:00 2001 From: flobernd Date: Sat, 2 Dec 2017 06:40:40 +0100 Subject: [PATCH 03/14] Renamed `ZydisInternalString` to `ZydisGeneratedString` --- src/Generated/EnumMnemonic.inc | 2 +- src/Mnemonic.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Generated/EnumMnemonic.inc b/src/Generated/EnumMnemonic.inc index 682b3e0..d2c1605 100644 --- a/src/Generated/EnumMnemonic.inc +++ b/src/Generated/EnumMnemonic.inc @@ -1,4 +1,4 @@ -static const ZydisInternalString zydisMnemonicStrings[] = +static const ZydisGeneratedString zydisMnemonicStrings[] = { { "invalid", 0x07 }, { "aaa", 0x03 }, diff --git a/src/Mnemonic.c b/src/Mnemonic.c index e659ce0..26dd743 100644 --- a/src/Mnemonic.c +++ b/src/Mnemonic.c @@ -33,9 +33,9 @@ #pragma pack(push, 1) /** - * @brief Defines the `ZydisInternalString` struct. + * @brief Defines the `ZydisGeneratedString` struct. */ -typedef struct ZydisInternalString_ +typedef struct ZydisGeneratedString_ { /** * @brief Contains the actual string. @@ -45,7 +45,7 @@ typedef struct ZydisInternalString_ * @brief The length of the string (without 0-termination). */ ZydisU8 length; -} ZydisInternalString; +} ZydisGeneratedString; #pragma pack(pop) From 217d5cc9afd60ead9e1fb86b24ea3f016911b340 Mon Sep 17 00:00:00 2001 From: flobernd Date: Sat, 2 Dec 2017 06:54:47 +0100 Subject: [PATCH 04/14] Minor refactorings and bugfixes --- CMakeLists.txt | 5 ++- src/InternalTypes.h | 93 +++++++++++++++++++++++++++++++++++++++++++++ src/Mnemonic.c | 39 ++++--------------- 3 files changed, 104 insertions(+), 33 deletions(-) create mode 100644 src/InternalTypes.h diff --git a/CMakeLists.txt b/CMakeLists.txt index db6f0f0..a13fa7f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -108,8 +108,9 @@ target_sources("Zydis" "${CMAKE_CURRENT_LIST_DIR}/include/Zydis/String.h" "${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Utils.h" "${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Zydis.h" + "${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Internal/LibC.h" PRIVATE - "src/LibC.h" + "src/InternalTypes.h" "src/MetaInfo.c" "src/Mnemonic.c" "src/Register.c" @@ -126,8 +127,8 @@ if (ZYDIS_FEATURE_DECODER) "${CMAKE_CURRENT_LIST_DIR}/include/Zydis/DecoderTypes.h" "${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Formatter.h" PRIVATE - "src/DecoderData.h" "src/Decoder.c" + "src/DecoderData.h" "src/DecoderData.c" "src/Formatter.c") endif () diff --git a/src/InternalTypes.h b/src/InternalTypes.h new file mode 100644 index 0000000..159feee --- /dev/null +++ b/src/InternalTypes.h @@ -0,0 +1,93 @@ +/*************************************************************************************************** + + Zyan Disassembler Library (Zydis) + + Original Author : Florian Bernd + + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + +***************************************************************************************************/ + +#ifndef ZYDIS_INTERNALTYPES_H +#define ZYDIS_INTERNALTYPES_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* ============================================================================================== */ +/* Generated Strings */ +/* ============================================================================================== */ + +/* ---------------------------------------------------------------------------------------------- */ +/* Enums and types */ +/* ---------------------------------------------------------------------------------------------- */ + +#pragma pack(push, 1) + +/** + * @brief Defines the `ZydisGeneratedString` struct. + */ +typedef struct ZydisGeneratedString_ +{ + /** + * @brief Contains the actual string. + */ + char* buffer; + /** + * @brief The length of the string (without 0-termination). + */ + ZydisU8 length; +} ZydisGeneratedString; + +#pragma pack(pop) + +/* ---------------------------------------------------------------------------------------------- */ +/* Helper functions */ +/* ---------------------------------------------------------------------------------------------- */ + +/** + * @brief Initializes a `ZydisString` struct with the values from a `ZydisGeneratedString`. + * + * @param target A pointer to the target string. + * @param source A pointer to the source string. + */ +ZYDIS_NO_EXPORT ZYDIS_INLINE void ZydisStringInitWithGeneratedString(ZydisString* target, + const ZydisGeneratedString* source) +{ + ZYDIS_ASSERT(target); + ZYDIS_ASSERT(source); + + target->buffer = source->buffer; + target->length = source->length; + target->capacity = source->length; +} + +/* ---------------------------------------------------------------------------------------------- */ + +/* ============================================================================================== */ + +#ifdef __cplusplus +} +#endif + +#endif /* ZYDIS_INTERNALTYPES_H */ diff --git a/src/Mnemonic.c b/src/Mnemonic.c index 26dd743..e07ff42 100644 --- a/src/Mnemonic.c +++ b/src/Mnemonic.c @@ -25,39 +25,17 @@ ***************************************************************************************************/ #include - -/* ============================================================================================== */ -/* Mnemonic strings */ -/* ============================================================================================== */ - -#pragma pack(push, 1) - -/** - * @brief Defines the `ZydisGeneratedString` struct. - */ -typedef struct ZydisGeneratedString_ -{ - /** - * @brief Contains the actual string. - */ - char* buffer; - /** - * @brief The length of the string (without 0-termination). - */ - ZydisU8 length; -} ZydisGeneratedString; - -#pragma pack(pop) +#include #include /** - * @brief Contains all strings that were accessed by `ZydisMnemonicGetStringEx`. + * @brief Caches all strings that were accessed by `ZydisMnemonicGetStringEx`. * - * We could store `ZydisString` structs instead of `ZydisInternalString` ones in the + * We could store `ZydisString` structs instead of `ZydisGeneratedString` ones in the * `zydisMnemonicStrings` array, but this would significantly increase the table-size. */ -static ZydisString stringTable[ZYDIS_MNEMONIC_MAX_VALUE + 1]; +static ZydisString zydisMnemonicStringCache[ZYDIS_MNEMONIC_MAX_VALUE + 1]; /* ============================================================================================== */ /* Exported functions */ @@ -78,13 +56,12 @@ const ZydisString* ZydisMnemonicGetStringEx(ZydisMnemonic mnemonic) { return ZYDIS_NULL; } - if (!stringTable[mnemonic].buffer) + if (!zydisMnemonicStringCache[mnemonic].buffer) { - stringTable[mnemonic].buffer = zydisMnemonicStrings[mnemonic].buffer; - stringTable[mnemonic].length = zydisMnemonicStrings[mnemonic].length; - stringTable[mnemonic].capacity = zydisMnemonicStrings[mnemonic].length; + ZydisStringInitWithGeneratedString(&zydisMnemonicStringCache[mnemonic], + &zydisMnemonicStrings[mnemonic]); } - return &stringTable[mnemonic]; + return &zydisMnemonicStringCache[mnemonic]; } /* ============================================================================================== */ From 07c325b3672d2542a91137488a52db60dad96884 Mon Sep 17 00:00:00 2001 From: flobernd Date: Sat, 2 Dec 2017 07:05:29 +0100 Subject: [PATCH 05/14] Minor bugfixes --- include/Zydis/Formatter.h | 19 +- include/Zydis/Mnemonic.h | 2 + include/Zydis/String.h | 4 +- src/Generated/EnumMnemonic.inc | 3150 ++++++++++++++++---------------- src/InternalTypes.h | 10 + 5 files changed, 1607 insertions(+), 1578 deletions(-) diff --git a/include/Zydis/Formatter.h b/include/Zydis/Formatter.h index dfd2dc4..de10be4 100644 --- a/include/Zydis/Formatter.h +++ b/include/Zydis/Formatter.h @@ -63,6 +63,7 @@ enum ZydisFormatterStyles * @brief Generates intel-style disassembly. */ ZYDIS_FORMATTER_STYLE_INTEL, + /** * @brief Maximum value of this enum. */ @@ -185,11 +186,18 @@ enum ZydisAddressFormat { /** * @brief Displays absolute addresses instead of relative ones. + * + * Using this value will cause the formatter to invoke `ZYDIS_FORMATTER_HOOK_PRINT_ADDRESS` + * for every address. */ ZYDIS_ADDR_FORMAT_ABSOLUTE, /** * @brief Uses signed hexadecimal values to display relative addresses. * + * Using this value will cause the formatter to invoke either + * `ZYDIS_FORMATTER_HOOK_PRINT_DISPLACEMENT` or `ZYDIS_FORMATTER_HOOK_PRINT_IMMEDIATE` to + * format addresses. + * * Examples: * "JMP 0x20" * "JMP -0x20" @@ -197,12 +205,17 @@ enum ZydisAddressFormat ZYDIS_ADDR_FORMAT_RELATIVE_SIGNED, /** * @brief Uses unsigned hexadecimal values to display relative addresses. - * + * + * Using this value will cause the formatter to invoke either + * `ZYDIS_FORMATTER_HOOK_PRINT_DISPLACEMENT` or `ZYDIS_FORMATTER_HOOK_PRINT_IMMEDIATE` to + * format addresses. + * * Examples: * "JMP 0x20" * "JMP 0xE0" */ ZYDIS_ADDR_FORMAT_RELATIVE_UNSIGNED, + /** * @brief Maximum value of this enum. */ @@ -234,6 +247,7 @@ enum ZydisDisplacementFormat * "MOV EAX, DWORD PTR SS:[ESP+0xFFFFFC00]" */ ZYDIS_DISP_FORMAT_HEX_UNSIGNED, + /** * @brief Maximum value of this enum. */ @@ -270,6 +284,7 @@ enum ZydisImmediateFormat * "MOV EAX, 0xFFFFFC00" */ ZYDIS_IMM_FORMAT_HEX_UNSIGNED, + /** * @brief Maximum value of this enum. */ @@ -364,6 +379,7 @@ enum ZydisFormatterHookTypes * @brief This function is called to print an immediate value. */ ZYDIS_FORMATTER_HOOK_PRINT_IMMEDIATE, + /** * @brief Maximum value of this enum. */ @@ -390,6 +406,7 @@ enum ZydisDecoratorTypes ZYDIS_DECORATOR_TYPE_SWIZZLE, ZYDIS_DECORATOR_TYPE_CONVERSION, ZYDIS_DECORATOR_TYPE_EVICTION_HINT, + /** * @brief Maximum value of this enum. */ diff --git a/include/Zydis/Mnemonic.h b/include/Zydis/Mnemonic.h index 6afcf99..f14035f 100644 --- a/include/Zydis/Mnemonic.h +++ b/include/Zydis/Mnemonic.h @@ -65,6 +65,8 @@ ZYDIS_EXPORT const char* ZydisMnemonicGetString(ZydisMnemonic mnemonic); * @param mnemonic The mnemonic. * * @return The instruction mnemonic string or @c NULL, if an invalid mnemonic was passed. + * + * The `buffer` of the returned struct is guaranteed to be zero-terminated in this special case. */ ZYDIS_EXPORT const ZydisString* ZydisMnemonicGetStringEx(ZydisMnemonic mnemonic); diff --git a/include/Zydis/String.h b/include/Zydis/String.h index a5855bf..2432bb9 100644 --- a/include/Zydis/String.h +++ b/include/Zydis/String.h @@ -103,7 +103,7 @@ enum ZydisLetterCases /* ---------------------------------------------------------------------------------------------- */ /** - * @brief Creates a `ZydisString` struct from a constant C-string. + * @brief Creates a `ZydisString` struct from a static C-string. * * @param string The C-string constant. */ @@ -211,7 +211,7 @@ ZYDIS_NO_EXPORT ZYDIS_INLINE ZydisStatus ZydisStringAppendC(ZydisString* string, ZydisString other; ZYDIS_CHECK(ZydisStringInit(&other, (char*)text)); - return ZydisStringAppend(string, &other); + return ZydisStringAppendEx(string, &other, ZYDIS_LETTER_CASE_DEFAULT); } /* ---------------------------------------------------------------------------------------------- */ diff --git a/src/Generated/EnumMnemonic.inc b/src/Generated/EnumMnemonic.inc index d2c1605..a982726 100644 --- a/src/Generated/EnumMnemonic.inc +++ b/src/Generated/EnumMnemonic.inc @@ -1,1578 +1,1578 @@ static const ZydisGeneratedString zydisMnemonicStrings[] = { - { "invalid", 0x07 }, - { "aaa", 0x03 }, - { "aad", 0x03 }, - { "aam", 0x03 }, - { "aas", 0x03 }, - { "adc", 0x03 }, - { "adcx", 0x04 }, - { "add", 0x03 }, - { "addpd", 0x05 }, - { "addps", 0x05 }, - { "addsd", 0x05 }, - { "addss", 0x05 }, - { "addsubpd", 0x08 }, - { "addsubps", 0x08 }, - { "adox", 0x04 }, - { "aesdec", 0x06 }, - { "aesdeclast", 0x0A }, - { "aesenc", 0x06 }, - { "aesenclast", 0x0A }, - { "aesimc", 0x06 }, - { "aeskeygenassist", 0x0F }, - { "and", 0x03 }, - { "andn", 0x04 }, - { "andnpd", 0x06 }, - { "andnps", 0x06 }, - { "andpd", 0x05 }, - { "andps", 0x05 }, - { "arpl", 0x04 }, - { "bextr", 0x05 }, - { "blcfill", 0x07 }, - { "blci", 0x04 }, - { "blcic", 0x05 }, - { "blcmsk", 0x06 }, - { "blcs", 0x04 }, - { "blendpd", 0x07 }, - { "blendps", 0x07 }, - { "blendvpd", 0x08 }, - { "blendvps", 0x08 }, - { "blsfill", 0x07 }, - { "blsi", 0x04 }, - { "blsic", 0x05 }, - { "blsmsk", 0x06 }, - { "blsr", 0x04 }, - { "bndcl", 0x05 }, - { "bndcn", 0x05 }, - { "bndcu", 0x05 }, - { "bndldx", 0x06 }, - { "bndmk", 0x05 }, - { "bndmov", 0x06 }, - { "bndstx", 0x06 }, - { "bound", 0x05 }, - { "bsf", 0x03 }, - { "bsr", 0x03 }, - { "bswap", 0x05 }, - { "bt", 0x02 }, - { "btc", 0x03 }, - { "btr", 0x03 }, - { "bts", 0x03 }, - { "bzhi", 0x04 }, - { "call", 0x04 }, - { "cbw", 0x03 }, - { "cdq", 0x03 }, - { "cdqe", 0x04 }, - { "clac", 0x04 }, - { "clc", 0x03 }, - { "cld", 0x03 }, - { "clevict0", 0x08 }, - { "clevict1", 0x08 }, - { "clflush", 0x07 }, - { "clflushopt", 0x0A }, - { "clgi", 0x04 }, - { "cli", 0x03 }, - { "clrssbsy", 0x08 }, - { "clts", 0x04 }, - { "clwb", 0x04 }, - { "clzero", 0x06 }, - { "cmc", 0x03 }, - { "cmovb", 0x05 }, - { "cmovbe", 0x06 }, - { "cmovl", 0x05 }, - { "cmovle", 0x06 }, - { "cmovnb", 0x06 }, - { "cmovnbe", 0x07 }, - { "cmovnl", 0x06 }, - { "cmovnle", 0x07 }, - { "cmovno", 0x06 }, - { "cmovnp", 0x06 }, - { "cmovns", 0x06 }, - { "cmovnz", 0x06 }, - { "cmovo", 0x05 }, - { "cmovp", 0x05 }, - { "cmovs", 0x05 }, - { "cmovz", 0x05 }, - { "cmp", 0x03 }, - { "cmppd", 0x05 }, - { "cmpps", 0x05 }, - { "cmpsb", 0x05 }, - { "cmpsd", 0x05 }, - { "cmpsq", 0x05 }, - { "cmpss", 0x05 }, - { "cmpsw", 0x05 }, - { "cmpxchg", 0x07 }, - { "cmpxchg16b", 0x0A }, - { "cmpxchg8b", 0x09 }, - { "comisd", 0x06 }, - { "comiss", 0x06 }, - { "cpuid", 0x05 }, - { "cqo", 0x03 }, - { "crc32", 0x05 }, - { "cvtdq2pd", 0x08 }, - { "cvtdq2ps", 0x08 }, - { "cvtpd2dq", 0x08 }, - { "cvtpd2pi", 0x08 }, - { "cvtpd2ps", 0x08 }, - { "cvtpi2pd", 0x08 }, - { "cvtpi2ps", 0x08 }, - { "cvtps2dq", 0x08 }, - { "cvtps2pd", 0x08 }, - { "cvtps2pi", 0x08 }, - { "cvtsd2si", 0x08 }, - { "cvtsd2ss", 0x08 }, - { "cvtsi2sd", 0x08 }, - { "cvtsi2ss", 0x08 }, - { "cvtss2sd", 0x08 }, - { "cvtss2si", 0x08 }, - { "cvttpd2dq", 0x09 }, - { "cvttpd2pi", 0x09 }, - { "cvttps2dq", 0x09 }, - { "cvttps2pi", 0x09 }, - { "cvttsd2si", 0x09 }, - { "cvttss2si", 0x09 }, - { "cwd", 0x03 }, - { "cwde", 0x04 }, - { "daa", 0x03 }, - { "das", 0x03 }, - { "dec", 0x03 }, - { "delay", 0x05 }, - { "div", 0x03 }, - { "divpd", 0x05 }, - { "divps", 0x05 }, - { "divsd", 0x05 }, - { "divss", 0x05 }, - { "dppd", 0x04 }, - { "dpps", 0x04 }, - { "emms", 0x04 }, - { "encls", 0x05 }, - { "enclu", 0x05 }, - { "endbr32", 0x07 }, - { "endbr64", 0x07 }, - { "enter", 0x05 }, - { "extractps", 0x09 }, - { "f2xm1", 0x05 }, - { "fabs", 0x04 }, - { "fadd", 0x04 }, - { "faddp", 0x05 }, - { "fbld", 0x04 }, - { "fbstp", 0x05 }, - { "fchs", 0x04 }, - { "fcmovb", 0x06 }, - { "fcmovbe", 0x07 }, - { "fcmove", 0x06 }, - { "fcmovnb", 0x07 }, - { "fcmovnbe", 0x08 }, - { "fcmovne", 0x07 }, - { "fcmovnu", 0x07 }, - { "fcmovu", 0x06 }, - { "fcom", 0x04 }, - { "fcomi", 0x05 }, - { "fcomip", 0x06 }, - { "fcomp", 0x05 }, - { "fcompp", 0x06 }, - { "fcos", 0x04 }, - { "fdecstp", 0x07 }, - { "fdisi8087_nop", 0x0D }, - { "fdiv", 0x04 }, - { "fdivp", 0x05 }, - { "fdivr", 0x05 }, - { "fdivrp", 0x06 }, - { "femms", 0x05 }, - { "feni8087_nop", 0x0C }, - { "ffree", 0x05 }, - { "ffreep", 0x06 }, - { "fiadd", 0x05 }, - { "ficom", 0x05 }, - { "ficomp", 0x06 }, - { "fidiv", 0x05 }, - { "fidivr", 0x06 }, - { "fild", 0x04 }, - { "fimul", 0x05 }, - { "fincstp", 0x07 }, - { "fist", 0x04 }, - { "fistp", 0x05 }, - { "fisttp", 0x06 }, - { "fisub", 0x05 }, - { "fisubr", 0x06 }, - { "fld", 0x03 }, - { "fld1", 0x04 }, - { "fldcw", 0x05 }, - { "fldenv", 0x06 }, - { "fldl2e", 0x06 }, - { "fldl2t", 0x06 }, - { "fldlg2", 0x06 }, - { "fldln2", 0x06 }, - { "fldpi", 0x05 }, - { "fldz", 0x04 }, - { "fmul", 0x04 }, - { "fmulp", 0x05 }, - { "fnclex", 0x06 }, - { "fninit", 0x06 }, - { "fnop", 0x04 }, - { "fnsave", 0x06 }, - { "fnstcw", 0x06 }, - { "fnstenv", 0x07 }, - { "fnstsw", 0x06 }, - { "fpatan", 0x06 }, - { "fprem", 0x05 }, - { "fprem1", 0x06 }, - { "fptan", 0x05 }, - { "frndint", 0x07 }, - { "frstor", 0x06 }, - { "fscale", 0x06 }, - { "fsetpm287_nop", 0x0D }, - { "fsin", 0x04 }, - { "fsincos", 0x07 }, - { "fsqrt", 0x05 }, - { "fst", 0x03 }, - { "fstp", 0x04 }, - { "fstpnce", 0x07 }, - { "fsub", 0x04 }, - { "fsubp", 0x05 }, - { "fsubr", 0x05 }, - { "fsubrp", 0x06 }, - { "ftst", 0x04 }, - { "fucom", 0x05 }, - { "fucomi", 0x06 }, - { "fucomip", 0x07 }, - { "fucomp", 0x06 }, - { "fucompp", 0x07 }, - { "fwait", 0x05 }, - { "fxam", 0x04 }, - { "fxch", 0x04 }, - { "fxrstor", 0x07 }, - { "fxrstor64", 0x09 }, - { "fxsave", 0x06 }, - { "fxsave64", 0x08 }, - { "fxtract", 0x07 }, - { "fyl2x", 0x05 }, - { "fyl2xp1", 0x07 }, - { "getsec", 0x06 }, - { "gf2p8affineinvqb", 0x10 }, - { "gf2p8affineqb", 0x0D }, - { "gf2p8mulb", 0x09 }, - { "haddpd", 0x06 }, - { "haddps", 0x06 }, - { "hlt", 0x03 }, - { "hsubpd", 0x06 }, - { "hsubps", 0x06 }, - { "idiv", 0x04 }, - { "imul", 0x04 }, - { "in", 0x02 }, - { "inc", 0x03 }, - { "incsspd", 0x07 }, - { "incsspq", 0x07 }, - { "insb", 0x04 }, - { "insd", 0x04 }, - { "insertps", 0x08 }, - { "insw", 0x04 }, - { "int", 0x03 }, - { "int1", 0x04 }, - { "int3", 0x04 }, - { "into", 0x04 }, - { "invd", 0x04 }, - { "invept", 0x06 }, - { "invlpg", 0x06 }, - { "invlpga", 0x07 }, - { "invpcid", 0x07 }, - { "invvpid", 0x07 }, - { "iret", 0x04 }, - { "iretd", 0x05 }, - { "iretq", 0x05 }, - { "jb", 0x02 }, - { "jbe", 0x03 }, - { "jcxz", 0x04 }, - { "jecxz", 0x05 }, - { "jknzd", 0x05 }, - { "jkzd", 0x04 }, - { "jl", 0x02 }, - { "jle", 0x03 }, - { "jmp", 0x03 }, - { "jnb", 0x03 }, - { "jnbe", 0x04 }, - { "jnl", 0x03 }, - { "jnle", 0x04 }, - { "jno", 0x03 }, - { "jnp", 0x03 }, - { "jns", 0x03 }, - { "jnz", 0x03 }, - { "jo", 0x02 }, - { "jp", 0x02 }, - { "jrcxz", 0x05 }, - { "js", 0x02 }, - { "jz", 0x02 }, - { "kaddb", 0x05 }, - { "kaddd", 0x05 }, - { "kaddq", 0x05 }, - { "kaddw", 0x05 }, - { "kand", 0x04 }, - { "kandb", 0x05 }, - { "kandd", 0x05 }, - { "kandn", 0x05 }, - { "kandnb", 0x06 }, - { "kandnd", 0x06 }, - { "kandnq", 0x06 }, - { "kandnr", 0x06 }, - { "kandnw", 0x06 }, - { "kandq", 0x05 }, - { "kandw", 0x05 }, - { "kconcath", 0x08 }, - { "kconcatl", 0x08 }, - { "kextract", 0x08 }, - { "kmerge2l1h", 0x0A }, - { "kmerge2l1l", 0x0A }, - { "kmov", 0x04 }, - { "kmovb", 0x05 }, - { "kmovd", 0x05 }, - { "kmovq", 0x05 }, - { "kmovw", 0x05 }, - { "knot", 0x04 }, - { "knotb", 0x05 }, - { "knotd", 0x05 }, - { "knotq", 0x05 }, - { "knotw", 0x05 }, - { "kor", 0x03 }, - { "korb", 0x04 }, - { "kord", 0x04 }, - { "korq", 0x04 }, - { "kortest", 0x07 }, - { "kortestb", 0x08 }, - { "kortestd", 0x08 }, - { "kortestq", 0x08 }, - { "kortestw", 0x08 }, - { "korw", 0x04 }, - { "kshiftlb", 0x08 }, - { "kshiftld", 0x08 }, - { "kshiftlq", 0x08 }, - { "kshiftlw", 0x08 }, - { "kshiftrb", 0x08 }, - { "kshiftrd", 0x08 }, - { "kshiftrq", 0x08 }, - { "kshiftrw", 0x08 }, - { "ktestb", 0x06 }, - { "ktestd", 0x06 }, - { "ktestq", 0x06 }, - { "ktestw", 0x06 }, - { "kunpckbw", 0x08 }, - { "kunpckdq", 0x08 }, - { "kunpckwd", 0x08 }, - { "kxnor", 0x05 }, - { "kxnorb", 0x06 }, - { "kxnord", 0x06 }, - { "kxnorq", 0x06 }, - { "kxnorw", 0x06 }, - { "kxor", 0x04 }, - { "kxorb", 0x05 }, - { "kxord", 0x05 }, - { "kxorq", 0x05 }, - { "kxorw", 0x05 }, - { "lahf", 0x04 }, - { "lar", 0x03 }, - { "lddqu", 0x05 }, - { "ldmxcsr", 0x07 }, - { "lds", 0x03 }, - { "lea", 0x03 }, - { "leave", 0x05 }, - { "les", 0x03 }, - { "lfence", 0x06 }, - { "lfs", 0x03 }, - { "lgdt", 0x04 }, - { "lgs", 0x03 }, - { "lidt", 0x04 }, - { "lldt", 0x04 }, - { "llwpcb", 0x06 }, - { "lmsw", 0x04 }, - { "lodsb", 0x05 }, - { "lodsd", 0x05 }, - { "lodsq", 0x05 }, - { "lodsw", 0x05 }, - { "loop", 0x04 }, - { "loope", 0x05 }, - { "loopne", 0x06 }, - { "lsl", 0x03 }, - { "lss", 0x03 }, - { "ltr", 0x03 }, - { "lwpins", 0x06 }, - { "lwpval", 0x06 }, - { "lzcnt", 0x05 }, - { "maskmovdqu", 0x0A }, - { "maskmovq", 0x08 }, - { "maxpd", 0x05 }, - { "maxps", 0x05 }, - { "maxsd", 0x05 }, - { "maxss", 0x05 }, - { "mfence", 0x06 }, - { "minpd", 0x05 }, - { "minps", 0x05 }, - { "minsd", 0x05 }, - { "minss", 0x05 }, - { "monitor", 0x07 }, - { "mov", 0x03 }, - { "movapd", 0x06 }, - { "movaps", 0x06 }, - { "movbe", 0x05 }, - { "movd", 0x04 }, - { "movddup", 0x07 }, - { "movdq2q", 0x07 }, - { "movdqa", 0x06 }, - { "movdqu", 0x06 }, - { "movhlps", 0x07 }, - { "movhpd", 0x06 }, - { "movhps", 0x06 }, - { "movlhps", 0x07 }, - { "movlpd", 0x06 }, - { "movlps", 0x06 }, - { "movmskpd", 0x08 }, - { "movmskps", 0x08 }, - { "movntdq", 0x07 }, - { "movntdqa", 0x08 }, - { "movnti", 0x06 }, - { "movntpd", 0x07 }, - { "movntps", 0x07 }, - { "movntq", 0x06 }, - { "movq", 0x04 }, - { "movq2dq", 0x07 }, - { "movsb", 0x05 }, - { "movsd", 0x05 }, - { "movshdup", 0x08 }, - { "movsldup", 0x08 }, - { "movsq", 0x05 }, - { "movss", 0x05 }, - { "movsw", 0x05 }, - { "movsx", 0x05 }, - { "movsxd", 0x06 }, - { "movupd", 0x06 }, - { "movups", 0x06 }, - { "movzx", 0x05 }, - { "mpsadbw", 0x07 }, - { "mul", 0x03 }, - { "mulpd", 0x05 }, - { "mulps", 0x05 }, - { "mulsd", 0x05 }, - { "mulss", 0x05 }, - { "mulx", 0x04 }, - { "mwait", 0x05 }, - { "neg", 0x03 }, - { "nop", 0x03 }, - { "not", 0x03 }, - { "or", 0x02 }, - { "orpd", 0x04 }, - { "orps", 0x04 }, - { "out", 0x03 }, - { "outsb", 0x05 }, - { "outsd", 0x05 }, - { "outsw", 0x05 }, - { "pabsb", 0x05 }, - { "pabsd", 0x05 }, - { "pabsw", 0x05 }, - { "packssdw", 0x08 }, - { "packsswb", 0x08 }, - { "packusdw", 0x08 }, - { "packuswb", 0x08 }, - { "paddb", 0x05 }, - { "paddd", 0x05 }, - { "paddq", 0x05 }, - { "paddsb", 0x06 }, - { "paddsw", 0x06 }, - { "paddusb", 0x07 }, - { "paddusw", 0x07 }, - { "paddw", 0x05 }, - { "palignr", 0x07 }, - { "pand", 0x04 }, - { "pandn", 0x05 }, - { "pause", 0x05 }, - { "pavgb", 0x05 }, - { "pavgusb", 0x07 }, - { "pavgw", 0x05 }, - { "pblendvb", 0x08 }, - { "pblendw", 0x07 }, - { "pclmulqdq", 0x09 }, - { "pcmpeqb", 0x07 }, - { "pcmpeqd", 0x07 }, - { "pcmpeqq", 0x07 }, - { "pcmpeqw", 0x07 }, - { "pcmpestri", 0x09 }, - { "pcmpestrm", 0x09 }, - { "pcmpgtb", 0x07 }, - { "pcmpgtd", 0x07 }, - { "pcmpgtq", 0x07 }, - { "pcmpgtw", 0x07 }, - { "pcmpistri", 0x09 }, - { "pcmpistrm", 0x09 }, - { "pdep", 0x04 }, - { "pext", 0x04 }, - { "pextrb", 0x06 }, - { "pextrd", 0x06 }, - { "pextrq", 0x06 }, - { "pextrw", 0x06 }, - { "pf2id", 0x05 }, - { "pf2iw", 0x05 }, - { "pfacc", 0x05 }, - { "pfadd", 0x05 }, - { "pfcmpeq", 0x07 }, - { "pfcmpge", 0x07 }, - { "pfcmpgt", 0x07 }, - { "pfcpit1", 0x07 }, - { "pfmax", 0x05 }, - { "pfmin", 0x05 }, - { "pfmul", 0x05 }, - { "pfnacc", 0x06 }, - { "pfpnacc", 0x07 }, - { "pfrcp", 0x05 }, - { "pfrcpit2", 0x08 }, - { "pfrsqit1", 0x08 }, - { "pfsqrt", 0x06 }, - { "pfsub", 0x05 }, - { "pfsubr", 0x06 }, - { "phaddd", 0x06 }, - { "phaddsw", 0x07 }, - { "phaddw", 0x06 }, - { "phminposuw", 0x0A }, - { "phsubd", 0x06 }, - { "phsubsw", 0x07 }, - { "phsubw", 0x06 }, - { "pi2fd", 0x05 }, - { "pi2fw", 0x05 }, - { "pinsrb", 0x06 }, - { "pinsrd", 0x06 }, - { "pinsrq", 0x06 }, - { "pinsrw", 0x06 }, - { "pmaddubsw", 0x09 }, - { "pmaddwd", 0x07 }, - { "pmaxsb", 0x06 }, - { "pmaxsd", 0x06 }, - { "pmaxsw", 0x06 }, - { "pmaxub", 0x06 }, - { "pmaxud", 0x06 }, - { "pmaxuw", 0x06 }, - { "pminsb", 0x06 }, - { "pminsd", 0x06 }, - { "pminsw", 0x06 }, - { "pminub", 0x06 }, - { "pminud", 0x06 }, - { "pminuw", 0x06 }, - { "pmovmskb", 0x08 }, - { "pmovsxbd", 0x08 }, - { "pmovsxbq", 0x08 }, - { "pmovsxbw", 0x08 }, - { "pmovsxdq", 0x08 }, - { "pmovsxwd", 0x08 }, - { "pmovsxwq", 0x08 }, - { "pmovzxbd", 0x08 }, - { "pmovzxbq", 0x08 }, - { "pmovzxbw", 0x08 }, - { "pmovzxdq", 0x08 }, - { "pmovzxwd", 0x08 }, - { "pmovzxwq", 0x08 }, - { "pmuldq", 0x06 }, - { "pmulhrsw", 0x08 }, - { "pmulhrw", 0x07 }, - { "pmulhuw", 0x07 }, - { "pmulhw", 0x06 }, - { "pmulld", 0x06 }, - { "pmullw", 0x06 }, - { "pmuludq", 0x07 }, - { "pop", 0x03 }, - { "popa", 0x04 }, - { "popad", 0x05 }, - { "popcnt", 0x06 }, - { "popf", 0x04 }, - { "popfd", 0x05 }, - { "popfq", 0x05 }, - { "por", 0x03 }, - { "prefetch", 0x08 }, - { "prefetchnta", 0x0B }, - { "prefetcht0", 0x0A }, - { "prefetcht1", 0x0A }, - { "prefetcht2", 0x0A }, - { "prefetchw", 0x09 }, - { "prefetchwt1", 0x0B }, - { "psadbw", 0x06 }, - { "pshufb", 0x06 }, - { "pshufd", 0x06 }, - { "pshufhw", 0x07 }, - { "pshuflw", 0x07 }, - { "pshufw", 0x06 }, - { "psignb", 0x06 }, - { "psignd", 0x06 }, - { "psignw", 0x06 }, - { "pslld", 0x05 }, - { "pslldq", 0x06 }, - { "psllq", 0x05 }, - { "psllw", 0x05 }, - { "psrad", 0x05 }, - { "psraw", 0x05 }, - { "psrld", 0x05 }, - { "psrldq", 0x06 }, - { "psrlq", 0x05 }, - { "psrlw", 0x05 }, - { "psubb", 0x05 }, - { "psubd", 0x05 }, - { "psubq", 0x05 }, - { "psubsb", 0x06 }, - { "psubsw", 0x06 }, - { "psubusb", 0x07 }, - { "psubusw", 0x07 }, - { "psubw", 0x05 }, - { "pswapd", 0x06 }, - { "ptest", 0x05 }, - { "ptwrite", 0x07 }, - { "punpckhbw", 0x09 }, - { "punpckhdq", 0x09 }, - { "punpckhqdq", 0x0A }, - { "punpckhwd", 0x09 }, - { "punpcklbw", 0x09 }, - { "punpckldq", 0x09 }, - { "punpcklqdq", 0x0A }, - { "punpcklwd", 0x09 }, - { "push", 0x04 }, - { "pusha", 0x05 }, - { "pushad", 0x06 }, - { "pushf", 0x05 }, - { "pushfd", 0x06 }, - { "pushfq", 0x06 }, - { "pxor", 0x04 }, - { "rcl", 0x03 }, - { "rcpps", 0x05 }, - { "rcpss", 0x05 }, - { "rcr", 0x03 }, - { "rdfsbase", 0x08 }, - { "rdgsbase", 0x08 }, - { "rdmsr", 0x05 }, - { "rdpid", 0x05 }, - { "rdpkru", 0x06 }, - { "rdpmc", 0x05 }, - { "rdrand", 0x06 }, - { "rdseed", 0x06 }, - { "rdsspd", 0x06 }, - { "rdsspq", 0x06 }, - { "rdtsc", 0x05 }, - { "rdtscp", 0x06 }, - { "ret", 0x03 }, - { "rol", 0x03 }, - { "ror", 0x03 }, - { "rorx", 0x04 }, - { "roundpd", 0x07 }, - { "roundps", 0x07 }, - { "roundsd", 0x07 }, - { "roundss", 0x07 }, - { "rsm", 0x03 }, - { "rsqrtps", 0x07 }, - { "rsqrtss", 0x07 }, - { "rstorssp", 0x08 }, - { "sahf", 0x04 }, - { "salc", 0x04 }, - { "sar", 0x03 }, - { "sarx", 0x04 }, - { "savessp", 0x07 }, - { "sbb", 0x03 }, - { "scasb", 0x05 }, - { "scasd", 0x05 }, - { "scasq", 0x05 }, - { "scasw", 0x05 }, - { "setb", 0x04 }, - { "setbe", 0x05 }, - { "setl", 0x04 }, - { "setle", 0x05 }, - { "setnb", 0x05 }, - { "setnbe", 0x06 }, - { "setnl", 0x05 }, - { "setnle", 0x06 }, - { "setno", 0x05 }, - { "setnp", 0x05 }, - { "setns", 0x05 }, - { "setnz", 0x05 }, - { "seto", 0x04 }, - { "setp", 0x04 }, - { "sets", 0x04 }, - { "setssbsy", 0x08 }, - { "setz", 0x04 }, - { "sfence", 0x06 }, - { "sgdt", 0x04 }, - { "sha1msg1", 0x08 }, - { "sha1msg2", 0x08 }, - { "sha1nexte", 0x09 }, - { "sha1rnds4", 0x09 }, - { "sha256msg1", 0x0A }, - { "sha256msg2", 0x0A }, - { "sha256rnds2", 0x0B }, - { "shl", 0x03 }, - { "shld", 0x04 }, - { "shlx", 0x04 }, - { "shr", 0x03 }, - { "shrd", 0x04 }, - { "shrx", 0x04 }, - { "shufpd", 0x06 }, - { "shufps", 0x06 }, - { "sidt", 0x04 }, - { "skinit", 0x06 }, - { "sldt", 0x04 }, - { "slwpcb", 0x06 }, - { "smsw", 0x04 }, - { "spflt", 0x05 }, - { "sqrtpd", 0x06 }, - { "sqrtps", 0x06 }, - { "sqrtsd", 0x06 }, - { "sqrtss", 0x06 }, - { "stac", 0x04 }, - { "stc", 0x03 }, - { "std", 0x03 }, - { "stgi", 0x04 }, - { "sti", 0x03 }, - { "stmxcsr", 0x07 }, - { "stosb", 0x05 }, - { "stosd", 0x05 }, - { "stosq", 0x05 }, - { "stosw", 0x05 }, - { "str", 0x03 }, - { "sub", 0x03 }, - { "subpd", 0x05 }, - { "subps", 0x05 }, - { "subsd", 0x05 }, - { "subss", 0x05 }, - { "swapgs", 0x06 }, - { "syscall", 0x07 }, - { "sysenter", 0x08 }, - { "sysexit", 0x07 }, - { "sysret", 0x06 }, - { "t1mskc", 0x06 }, - { "test", 0x04 }, - { "tzcnt", 0x05 }, - { "tzcnti", 0x06 }, - { "tzmsk", 0x05 }, - { "ucomisd", 0x07 }, - { "ucomiss", 0x07 }, - { "ud0", 0x03 }, - { "ud1", 0x03 }, - { "ud2", 0x03 }, - { "unpckhpd", 0x08 }, - { "unpckhps", 0x08 }, - { "unpcklpd", 0x08 }, - { "unpcklps", 0x08 }, - { "v4fmaddps", 0x09 }, - { "v4fmaddss", 0x09 }, - { "v4fnmaddps", 0x0A }, - { "v4fnmaddss", 0x0A }, - { "vaddnpd", 0x07 }, - { "vaddnps", 0x07 }, - { "vaddpd", 0x06 }, - { "vaddps", 0x06 }, - { "vaddsd", 0x06 }, - { "vaddsetsps", 0x0A }, - { "vaddss", 0x06 }, - { "vaddsubpd", 0x09 }, - { "vaddsubps", 0x09 }, - { "vaesdec", 0x07 }, - { "vaesdeclast", 0x0B }, - { "vaesenc", 0x07 }, - { "vaesenclast", 0x0B }, - { "vaesimc", 0x07 }, - { "vaeskeygenassist", 0x10 }, - { "valignd", 0x07 }, - { "valignq", 0x07 }, - { "vandnpd", 0x07 }, - { "vandnps", 0x07 }, - { "vandpd", 0x06 }, - { "vandps", 0x06 }, - { "vblendmpd", 0x09 }, - { "vblendmps", 0x09 }, - { "vblendpd", 0x08 }, - { "vblendps", 0x08 }, - { "vblendvpd", 0x09 }, - { "vblendvps", 0x09 }, - { "vbroadcastf128", 0x0E }, - { "vbroadcastf32x2", 0x0F }, - { "vbroadcastf32x4", 0x0F }, - { "vbroadcastf32x8", 0x0F }, - { "vbroadcastf64x2", 0x0F }, - { "vbroadcastf64x4", 0x0F }, - { "vbroadcasti128", 0x0E }, - { "vbroadcasti32x2", 0x0F }, - { "vbroadcasti32x4", 0x0F }, - { "vbroadcasti32x8", 0x0F }, - { "vbroadcasti64x2", 0x0F }, - { "vbroadcasti64x4", 0x0F }, - { "vbroadcastsd", 0x0C }, - { "vbroadcastss", 0x0C }, - { "vcmppd", 0x06 }, - { "vcmpps", 0x06 }, - { "vcmpsd", 0x06 }, - { "vcmpss", 0x06 }, - { "vcomisd", 0x07 }, - { "vcomiss", 0x07 }, - { "vcompresspd", 0x0B }, - { "vcompressps", 0x0B }, - { "vcvtdq2pd", 0x09 }, - { "vcvtdq2ps", 0x09 }, - { "vcvtfxpntdq2ps", 0x0E }, - { "vcvtfxpntpd2dq", 0x0E }, - { "vcvtfxpntpd2udq", 0x0F }, - { "vcvtfxpntps2dq", 0x0E }, - { "vcvtfxpntps2udq", 0x0F }, - { "vcvtfxpntudq2ps", 0x0F }, - { "vcvtpd2dq", 0x09 }, - { "vcvtpd2ps", 0x09 }, - { "vcvtpd2qq", 0x09 }, - { "vcvtpd2udq", 0x0A }, - { "vcvtpd2uqq", 0x0A }, - { "vcvtph2ps", 0x09 }, - { "vcvtps2dq", 0x09 }, - { "vcvtps2pd", 0x09 }, - { "vcvtps2ph", 0x09 }, - { "vcvtps2qq", 0x09 }, - { "vcvtps2udq", 0x0A }, - { "vcvtps2uqq", 0x0A }, - { "vcvtqq2pd", 0x09 }, - { "vcvtqq2ps", 0x09 }, - { "vcvtsd2si", 0x09 }, - { "vcvtsd2ss", 0x09 }, - { "vcvtsd2usi", 0x0A }, - { "vcvtsi2sd", 0x09 }, - { "vcvtsi2ss", 0x09 }, - { "vcvtss2sd", 0x09 }, - { "vcvtss2si", 0x09 }, - { "vcvtss2usi", 0x0A }, - { "vcvttpd2dq", 0x0A }, - { "vcvttpd2qq", 0x0A }, - { "vcvttpd2udq", 0x0B }, - { "vcvttpd2uqq", 0x0B }, - { "vcvttps2dq", 0x0A }, - { "vcvttps2qq", 0x0A }, - { "vcvttps2udq", 0x0B }, - { "vcvttps2uqq", 0x0B }, - { "vcvttsd2si", 0x0A }, - { "vcvttsd2usi", 0x0B }, - { "vcvttss2si", 0x0A }, - { "vcvttss2usi", 0x0B }, - { "vcvtudq2pd", 0x0A }, - { "vcvtudq2ps", 0x0A }, - { "vcvtuqq2pd", 0x0A }, - { "vcvtuqq2ps", 0x0A }, - { "vcvtusi2sd", 0x0A }, - { "vcvtusi2ss", 0x0A }, - { "vdbpsadbw", 0x09 }, - { "vdivpd", 0x06 }, - { "vdivps", 0x06 }, - { "vdivsd", 0x06 }, - { "vdivss", 0x06 }, - { "vdppd", 0x05 }, - { "vdpps", 0x05 }, - { "verr", 0x04 }, - { "verw", 0x04 }, - { "vexp223ps", 0x09 }, - { "vexp2pd", 0x07 }, - { "vexp2ps", 0x07 }, - { "vexpandpd", 0x09 }, - { "vexpandps", 0x09 }, - { "vextractf128", 0x0C }, - { "vextractf32x4", 0x0D }, - { "vextractf32x8", 0x0D }, - { "vextractf64x2", 0x0D }, - { "vextractf64x4", 0x0D }, - { "vextracti128", 0x0C }, - { "vextracti32x4", 0x0D }, - { "vextracti32x8", 0x0D }, - { "vextracti64x2", 0x0D }, - { "vextracti64x4", 0x0D }, - { "vextractps", 0x0A }, - { "vfixupimmpd", 0x0B }, - { "vfixupimmps", 0x0B }, - { "vfixupimmsd", 0x0B }, - { "vfixupimmss", 0x0B }, - { "vfixupnanpd", 0x0B }, - { "vfixupnanps", 0x0B }, - { "vfmadd132pd", 0x0B }, - { "vfmadd132ps", 0x0B }, - { "vfmadd132sd", 0x0B }, - { "vfmadd132ss", 0x0B }, - { "vfmadd213pd", 0x0B }, - { "vfmadd213ps", 0x0B }, - { "vfmadd213sd", 0x0B }, - { "vfmadd213ss", 0x0B }, - { "vfmadd231pd", 0x0B }, - { "vfmadd231ps", 0x0B }, - { "vfmadd231sd", 0x0B }, - { "vfmadd231ss", 0x0B }, - { "vfmadd233ps", 0x0B }, - { "vfmaddpd", 0x08 }, - { "vfmaddps", 0x08 }, - { "vfmaddsd", 0x08 }, - { "vfmaddss", 0x08 }, - { "vfmaddsub132pd", 0x0E }, - { "vfmaddsub132ps", 0x0E }, - { "vfmaddsub213pd", 0x0E }, - { "vfmaddsub213ps", 0x0E }, - { "vfmaddsub231pd", 0x0E }, - { "vfmaddsub231ps", 0x0E }, - { "vfmaddsubpd", 0x0B }, - { "vfmaddsubps", 0x0B }, - { "vfmsub132pd", 0x0B }, - { "vfmsub132ps", 0x0B }, - { "vfmsub132sd", 0x0B }, - { "vfmsub132ss", 0x0B }, - { "vfmsub213pd", 0x0B }, - { "vfmsub213ps", 0x0B }, - { "vfmsub213sd", 0x0B }, - { "vfmsub213ss", 0x0B }, - { "vfmsub231pd", 0x0B }, - { "vfmsub231ps", 0x0B }, - { "vfmsub231sd", 0x0B }, - { "vfmsub231ss", 0x0B }, - { "vfmsubadd132pd", 0x0E }, - { "vfmsubadd132ps", 0x0E }, - { "vfmsubadd213pd", 0x0E }, - { "vfmsubadd213ps", 0x0E }, - { "vfmsubadd231pd", 0x0E }, - { "vfmsubadd231ps", 0x0E }, - { "vfmsubaddpd", 0x0B }, - { "vfmsubaddps", 0x0B }, - { "vfmsubpd", 0x08 }, - { "vfmsubps", 0x08 }, - { "vfmsubsd", 0x08 }, - { "vfmsubss", 0x08 }, - { "vfnmadd132pd", 0x0C }, - { "vfnmadd132ps", 0x0C }, - { "vfnmadd132sd", 0x0C }, - { "vfnmadd132ss", 0x0C }, - { "vfnmadd213pd", 0x0C }, - { "vfnmadd213ps", 0x0C }, - { "vfnmadd213sd", 0x0C }, - { "vfnmadd213ss", 0x0C }, - { "vfnmadd231pd", 0x0C }, - { "vfnmadd231ps", 0x0C }, - { "vfnmadd231sd", 0x0C }, - { "vfnmadd231ss", 0x0C }, - { "vfnmaddpd", 0x09 }, - { "vfnmaddps", 0x09 }, - { "vfnmaddsd", 0x09 }, - { "vfnmaddss", 0x09 }, - { "vfnmsub132pd", 0x0C }, - { "vfnmsub132ps", 0x0C }, - { "vfnmsub132sd", 0x0C }, - { "vfnmsub132ss", 0x0C }, - { "vfnmsub213pd", 0x0C }, - { "vfnmsub213ps", 0x0C }, - { "vfnmsub213sd", 0x0C }, - { "vfnmsub213ss", 0x0C }, - { "vfnmsub231pd", 0x0C }, - { "vfnmsub231ps", 0x0C }, - { "vfnmsub231sd", 0x0C }, - { "vfnmsub231ss", 0x0C }, - { "vfnmsubpd", 0x09 }, - { "vfnmsubps", 0x09 }, - { "vfnmsubsd", 0x09 }, - { "vfnmsubss", 0x09 }, - { "vfpclasspd", 0x0A }, - { "vfpclassps", 0x0A }, - { "vfpclasssd", 0x0A }, - { "vfpclassss", 0x0A }, - { "vfrczpd", 0x07 }, - { "vfrczps", 0x07 }, - { "vfrczsd", 0x07 }, - { "vfrczss", 0x07 }, - { "vgatherdpd", 0x0A }, - { "vgatherdps", 0x0A }, - { "vgatherpf0dpd", 0x0D }, - { "vgatherpf0dps", 0x0D }, - { "vgatherpf0hintdpd", 0x11 }, - { "vgatherpf0hintdps", 0x11 }, - { "vgatherpf0qpd", 0x0D }, - { "vgatherpf0qps", 0x0D }, - { "vgatherpf1dpd", 0x0D }, - { "vgatherpf1dps", 0x0D }, - { "vgatherpf1qpd", 0x0D }, - { "vgatherpf1qps", 0x0D }, - { "vgatherqpd", 0x0A }, - { "vgatherqps", 0x0A }, - { "vgetexppd", 0x09 }, - { "vgetexpps", 0x09 }, - { "vgetexpsd", 0x09 }, - { "vgetexpss", 0x09 }, - { "vgetmantpd", 0x0A }, - { "vgetmantps", 0x0A }, - { "vgetmantsd", 0x0A }, - { "vgetmantss", 0x0A }, - { "vgf2p8affineinvqb", 0x11 }, - { "vgf2p8affineqb", 0x0E }, - { "vgf2p8mulb", 0x0A }, - { "vgmaxabsps", 0x0A }, - { "vgmaxpd", 0x07 }, - { "vgmaxps", 0x07 }, - { "vgminpd", 0x07 }, - { "vgminps", 0x07 }, - { "vhaddpd", 0x07 }, - { "vhaddps", 0x07 }, - { "vhsubpd", 0x07 }, - { "vhsubps", 0x07 }, - { "vinsertf128", 0x0B }, - { "vinsertf32x4", 0x0C }, - { "vinsertf32x8", 0x0C }, - { "vinsertf64x2", 0x0C }, - { "vinsertf64x4", 0x0C }, - { "vinserti128", 0x0B }, - { "vinserti32x4", 0x0C }, - { "vinserti32x8", 0x0C }, - { "vinserti64x2", 0x0C }, - { "vinserti64x4", 0x0C }, - { "vinsertps", 0x09 }, - { "vlddqu", 0x06 }, - { "vldmxcsr", 0x08 }, - { "vloadunpackhd", 0x0D }, - { "vloadunpackhpd", 0x0E }, - { "vloadunpackhps", 0x0E }, - { "vloadunpackhq", 0x0D }, - { "vloadunpackld", 0x0D }, - { "vloadunpacklpd", 0x0E }, - { "vloadunpacklps", 0x0E }, - { "vloadunpacklq", 0x0D }, - { "vlog2ps", 0x07 }, - { "vmaskmovdqu", 0x0B }, - { "vmaskmovpd", 0x0A }, - { "vmaskmovps", 0x0A }, - { "vmaxpd", 0x06 }, - { "vmaxps", 0x06 }, - { "vmaxsd", 0x06 }, - { "vmaxss", 0x06 }, - { "vmcall", 0x06 }, - { "vmclear", 0x07 }, - { "vmfunc", 0x06 }, - { "vminpd", 0x06 }, - { "vminps", 0x06 }, - { "vminsd", 0x06 }, - { "vminss", 0x06 }, - { "vmlaunch", 0x08 }, - { "vmload", 0x06 }, - { "vmmcall", 0x07 }, - { "vmovapd", 0x07 }, - { "vmovaps", 0x07 }, - { "vmovd", 0x05 }, - { "vmovddup", 0x08 }, - { "vmovdqa", 0x07 }, - { "vmovdqa32", 0x09 }, - { "vmovdqa64", 0x09 }, - { "vmovdqu", 0x07 }, - { "vmovdqu16", 0x09 }, - { "vmovdqu32", 0x09 }, - { "vmovdqu64", 0x09 }, - { "vmovdqu8", 0x08 }, - { "vmovhlps", 0x08 }, - { "vmovhpd", 0x07 }, - { "vmovhps", 0x07 }, - { "vmovlhps", 0x08 }, - { "vmovlpd", 0x07 }, - { "vmovlps", 0x07 }, - { "vmovmskpd", 0x09 }, - { "vmovmskps", 0x09 }, - { "vmovnrapd", 0x09 }, - { "vmovnraps", 0x09 }, - { "vmovnrngoapd", 0x0C }, - { "vmovnrngoaps", 0x0C }, - { "vmovntdq", 0x08 }, - { "vmovntdqa", 0x09 }, - { "vmovntpd", 0x08 }, - { "vmovntps", 0x08 }, - { "vmovq", 0x05 }, - { "vmovsd", 0x06 }, - { "vmovshdup", 0x09 }, - { "vmovsldup", 0x09 }, - { "vmovss", 0x06 }, - { "vmovupd", 0x07 }, - { "vmovups", 0x07 }, - { "vmpsadbw", 0x08 }, - { "vmptrld", 0x07 }, - { "vmptrst", 0x07 }, - { "vmread", 0x06 }, - { "vmresume", 0x08 }, - { "vmrun", 0x05 }, - { "vmsave", 0x06 }, - { "vmulpd", 0x06 }, - { "vmulps", 0x06 }, - { "vmulsd", 0x06 }, - { "vmulss", 0x06 }, - { "vmwrite", 0x07 }, - { "vmxoff", 0x06 }, - { "vmxon", 0x05 }, - { "vorpd", 0x05 }, - { "vorps", 0x05 }, - { "vp4dpwssd", 0x09 }, - { "vp4dpwssds", 0x0A }, - { "vpabsb", 0x06 }, - { "vpabsd", 0x06 }, - { "vpabsq", 0x06 }, - { "vpabsw", 0x06 }, - { "vpackssdw", 0x09 }, - { "vpacksswb", 0x09 }, - { "vpackstorehd", 0x0C }, - { "vpackstorehpd", 0x0D }, - { "vpackstorehps", 0x0D }, - { "vpackstorehq", 0x0C }, - { "vpackstoreld", 0x0C }, - { "vpackstorelpd", 0x0D }, - { "vpackstorelps", 0x0D }, - { "vpackstorelq", 0x0C }, - { "vpackusdw", 0x09 }, - { "vpackuswb", 0x09 }, - { "vpadcd", 0x06 }, - { "vpaddb", 0x06 }, - { "vpaddd", 0x06 }, - { "vpaddq", 0x06 }, - { "vpaddsb", 0x07 }, - { "vpaddsetcd", 0x0A }, - { "vpaddsetsd", 0x0A }, - { "vpaddsw", 0x07 }, - { "vpaddusb", 0x08 }, - { "vpaddusw", 0x08 }, - { "vpaddw", 0x06 }, - { "vpalignr", 0x08 }, - { "vpand", 0x05 }, - { "vpandd", 0x06 }, - { "vpandn", 0x06 }, - { "vpandnd", 0x07 }, - { "vpandnq", 0x07 }, - { "vpandq", 0x06 }, - { "vpavgb", 0x06 }, - { "vpavgw", 0x06 }, - { "vpblendd", 0x08 }, - { "vpblendmb", 0x09 }, - { "vpblendmd", 0x09 }, - { "vpblendmq", 0x09 }, - { "vpblendmw", 0x09 }, - { "vpblendvb", 0x09 }, - { "vpblendw", 0x08 }, - { "vpbroadcastb", 0x0C }, - { "vpbroadcastd", 0x0C }, - { "vpbroadcastmb2q", 0x0F }, - { "vpbroadcastmw2d", 0x0F }, - { "vpbroadcastq", 0x0C }, - { "vpbroadcastw", 0x0C }, - { "vpclmulqdq", 0x0A }, - { "vpcmov", 0x06 }, - { "vpcmpb", 0x06 }, - { "vpcmpd", 0x06 }, - { "vpcmpeqb", 0x08 }, - { "vpcmpeqd", 0x08 }, - { "vpcmpeqq", 0x08 }, - { "vpcmpeqw", 0x08 }, - { "vpcmpestri", 0x0A }, - { "vpcmpestrm", 0x0A }, - { "vpcmpgtb", 0x08 }, - { "vpcmpgtd", 0x08 }, - { "vpcmpgtq", 0x08 }, - { "vpcmpgtw", 0x08 }, - { "vpcmpistri", 0x0A }, - { "vpcmpistrm", 0x0A }, - { "vpcmpltd", 0x08 }, - { "vpcmpq", 0x06 }, - { "vpcmpub", 0x07 }, - { "vpcmpud", 0x07 }, - { "vpcmpuq", 0x07 }, - { "vpcmpuw", 0x07 }, - { "vpcmpw", 0x06 }, - { "vpcomb", 0x06 }, - { "vpcomd", 0x06 }, - { "vpcompressb", 0x0B }, - { "vpcompressd", 0x0B }, - { "vpcompressq", 0x0B }, - { "vpcompressw", 0x0B }, - { "vpcomq", 0x06 }, - { "vpcomub", 0x07 }, - { "vpcomud", 0x07 }, - { "vpcomuq", 0x07 }, - { "vpcomuw", 0x07 }, - { "vpcomw", 0x06 }, - { "vpconflictd", 0x0B }, - { "vpconflictq", 0x0B }, - { "vpdpbusd", 0x08 }, - { "vpdpbusds", 0x09 }, - { "vpdpwssd", 0x08 }, - { "vpdpwssds", 0x09 }, - { "vperm2f128", 0x0A }, - { "vperm2i128", 0x0A }, - { "vpermb", 0x06 }, - { "vpermd", 0x06 }, - { "vpermf32x4", 0x0A }, - { "vpermi2b", 0x08 }, - { "vpermi2d", 0x08 }, - { "vpermi2pd", 0x09 }, - { "vpermi2ps", 0x09 }, - { "vpermi2q", 0x08 }, - { "vpermi2w", 0x08 }, - { "vpermil2pd", 0x0A }, - { "vpermil2ps", 0x0A }, - { "vpermilpd", 0x09 }, - { "vpermilps", 0x09 }, - { "vpermpd", 0x07 }, - { "vpermps", 0x07 }, - { "vpermq", 0x06 }, - { "vpermt2b", 0x08 }, - { "vpermt2d", 0x08 }, - { "vpermt2pd", 0x09 }, - { "vpermt2ps", 0x09 }, - { "vpermt2q", 0x08 }, - { "vpermt2w", 0x08 }, - { "vpermw", 0x06 }, - { "vpexpandb", 0x09 }, - { "vpexpandd", 0x09 }, - { "vpexpandq", 0x09 }, - { "vpexpandw", 0x09 }, - { "vpextrb", 0x07 }, - { "vpextrd", 0x07 }, - { "vpextrq", 0x07 }, - { "vpextrw", 0x07 }, - { "vpgatherdd", 0x0A }, - { "vpgatherdq", 0x0A }, - { "vpgatherqd", 0x0A }, - { "vpgatherqq", 0x0A }, - { "vphaddbd", 0x08 }, - { "vphaddbq", 0x08 }, - { "vphaddbw", 0x08 }, - { "vphaddd", 0x07 }, - { "vphadddq", 0x08 }, - { "vphaddsw", 0x08 }, - { "vphaddubd", 0x09 }, - { "vphaddubq", 0x09 }, - { "vphaddubw", 0x09 }, - { "vphaddudq", 0x09 }, - { "vphadduwd", 0x09 }, - { "vphadduwq", 0x09 }, - { "vphaddw", 0x07 }, - { "vphaddwd", 0x08 }, - { "vphaddwq", 0x08 }, - { "vphminposuw", 0x0B }, - { "vphsubbw", 0x08 }, - { "vphsubd", 0x07 }, - { "vphsubdq", 0x08 }, - { "vphsubsw", 0x08 }, - { "vphsubw", 0x07 }, - { "vphsubwd", 0x08 }, - { "vpinsrb", 0x07 }, - { "vpinsrd", 0x07 }, - { "vpinsrq", 0x07 }, - { "vpinsrw", 0x07 }, - { "vplzcntd", 0x08 }, - { "vplzcntq", 0x08 }, - { "vpmacsdd", 0x08 }, - { "vpmacsdqh", 0x09 }, - { "vpmacsdql", 0x09 }, - { "vpmacssdd", 0x09 }, - { "vpmacssdqh", 0x0A }, - { "vpmacssdql", 0x0A }, - { "vpmacsswd", 0x09 }, - { "vpmacssww", 0x09 }, - { "vpmacswd", 0x08 }, - { "vpmacsww", 0x08 }, - { "vpmadcsswd", 0x0A }, - { "vpmadcswd", 0x09 }, - { "vpmadd231d", 0x0A }, - { "vpmadd233d", 0x0A }, - { "vpmadd52huq", 0x0B }, - { "vpmadd52luq", 0x0B }, - { "vpmaddubsw", 0x0A }, - { "vpmaddwd", 0x08 }, - { "vpmaskmovd", 0x0A }, - { "vpmaskmovq", 0x0A }, - { "vpmaxsb", 0x07 }, - { "vpmaxsd", 0x07 }, - { "vpmaxsq", 0x07 }, - { "vpmaxsw", 0x07 }, - { "vpmaxub", 0x07 }, - { "vpmaxud", 0x07 }, - { "vpmaxuq", 0x07 }, - { "vpmaxuw", 0x07 }, - { "vpminsb", 0x07 }, - { "vpminsd", 0x07 }, - { "vpminsq", 0x07 }, - { "vpminsw", 0x07 }, - { "vpminub", 0x07 }, - { "vpminud", 0x07 }, - { "vpminuq", 0x07 }, - { "vpminuw", 0x07 }, - { "vpmovb2m", 0x08 }, - { "vpmovd2m", 0x08 }, - { "vpmovdb", 0x07 }, - { "vpmovdw", 0x07 }, - { "vpmovm2b", 0x08 }, - { "vpmovm2d", 0x08 }, - { "vpmovm2q", 0x08 }, - { "vpmovm2w", 0x08 }, - { "vpmovmskb", 0x09 }, - { "vpmovq2m", 0x08 }, - { "vpmovqb", 0x07 }, - { "vpmovqd", 0x07 }, - { "vpmovqw", 0x07 }, - { "vpmovsdb", 0x08 }, - { "vpmovsdw", 0x08 }, - { "vpmovsqb", 0x08 }, - { "vpmovsqd", 0x08 }, - { "vpmovsqw", 0x08 }, - { "vpmovswb", 0x08 }, - { "vpmovsxbd", 0x09 }, - { "vpmovsxbq", 0x09 }, - { "vpmovsxbw", 0x09 }, - { "vpmovsxdq", 0x09 }, - { "vpmovsxwd", 0x09 }, - { "vpmovsxwq", 0x09 }, - { "vpmovusdb", 0x09 }, - { "vpmovusdw", 0x09 }, - { "vpmovusqb", 0x09 }, - { "vpmovusqd", 0x09 }, - { "vpmovusqw", 0x09 }, - { "vpmovuswb", 0x09 }, - { "vpmovw2m", 0x08 }, - { "vpmovwb", 0x07 }, - { "vpmovzxbd", 0x09 }, - { "vpmovzxbq", 0x09 }, - { "vpmovzxbw", 0x09 }, - { "vpmovzxdq", 0x09 }, - { "vpmovzxwd", 0x09 }, - { "vpmovzxwq", 0x09 }, - { "vpmuldq", 0x07 }, - { "vpmulhd", 0x07 }, - { "vpmulhrsw", 0x09 }, - { "vpmulhud", 0x08 }, - { "vpmulhuw", 0x08 }, - { "vpmulhw", 0x07 }, - { "vpmulld", 0x07 }, - { "vpmullq", 0x07 }, - { "vpmullw", 0x07 }, - { "vpmultishiftqb", 0x0E }, - { "vpmuludq", 0x08 }, - { "vpopcntb", 0x08 }, - { "vpopcntd", 0x08 }, - { "vpopcntq", 0x08 }, - { "vpopcntw", 0x08 }, - { "vpor", 0x04 }, - { "vpord", 0x05 }, - { "vporq", 0x05 }, - { "vpperm", 0x06 }, - { "vprefetch0", 0x0A }, - { "vprefetch1", 0x0A }, - { "vprefetch2", 0x0A }, - { "vprefetche0", 0x0B }, - { "vprefetche1", 0x0B }, - { "vprefetche2", 0x0B }, - { "vprefetchenta", 0x0D }, - { "vprefetchnta", 0x0C }, - { "vprold", 0x06 }, - { "vprolq", 0x06 }, - { "vprolvd", 0x07 }, - { "vprolvq", 0x07 }, - { "vprord", 0x06 }, - { "vprorq", 0x06 }, - { "vprorvd", 0x07 }, - { "vprorvq", 0x07 }, - { "vprotb", 0x06 }, - { "vprotd", 0x06 }, - { "vprotq", 0x06 }, - { "vprotw", 0x06 }, - { "vpsadbw", 0x07 }, - { "vpsbbd", 0x06 }, - { "vpsbbrd", 0x07 }, - { "vpscatterdd", 0x0B }, - { "vpscatterdq", 0x0B }, - { "vpscatterqd", 0x0B }, - { "vpscatterqq", 0x0B }, - { "vpshab", 0x06 }, - { "vpshad", 0x06 }, - { "vpshaq", 0x06 }, - { "vpshaw", 0x06 }, - { "vpshlb", 0x06 }, - { "vpshld", 0x06 }, - { "vpshldd", 0x07 }, - { "vpshldq", 0x07 }, - { "vpshldvd", 0x08 }, - { "vpshldvq", 0x08 }, - { "vpshldvw", 0x08 }, - { "vpshldw", 0x07 }, - { "vpshlq", 0x06 }, - { "vpshlw", 0x06 }, - { "vpshrdd", 0x07 }, - { "vpshrdq", 0x07 }, - { "vpshrdvd", 0x08 }, - { "vpshrdvq", 0x08 }, - { "vpshrdvw", 0x08 }, - { "vpshrdw", 0x07 }, - { "vpshufb", 0x07 }, - { "vpshufbitqmb", 0x0C }, - { "vpshufd", 0x07 }, - { "vpshufhw", 0x08 }, - { "vpshuflw", 0x08 }, - { "vpsignb", 0x07 }, - { "vpsignd", 0x07 }, - { "vpsignw", 0x07 }, - { "vpslld", 0x06 }, - { "vpslldq", 0x07 }, - { "vpsllq", 0x06 }, - { "vpsllvd", 0x07 }, - { "vpsllvq", 0x07 }, - { "vpsllvw", 0x07 }, - { "vpsllw", 0x06 }, - { "vpsrad", 0x06 }, - { "vpsraq", 0x06 }, - { "vpsravd", 0x07 }, - { "vpsravq", 0x07 }, - { "vpsravw", 0x07 }, - { "vpsraw", 0x06 }, - { "vpsrld", 0x06 }, - { "vpsrldq", 0x07 }, - { "vpsrlq", 0x06 }, - { "vpsrlvd", 0x07 }, - { "vpsrlvq", 0x07 }, - { "vpsrlvw", 0x07 }, - { "vpsrlw", 0x06 }, - { "vpsubb", 0x06 }, - { "vpsubd", 0x06 }, - { "vpsubq", 0x06 }, - { "vpsubrd", 0x07 }, - { "vpsubrsetbd", 0x0B }, - { "vpsubsb", 0x07 }, - { "vpsubsetbd", 0x0A }, - { "vpsubsw", 0x07 }, - { "vpsubusb", 0x08 }, - { "vpsubusw", 0x08 }, - { "vpsubw", 0x06 }, - { "vpternlogd", 0x0A }, - { "vpternlogq", 0x0A }, - { "vptest", 0x06 }, - { "vptestmb", 0x08 }, - { "vptestmd", 0x08 }, - { "vptestmq", 0x08 }, - { "vptestmw", 0x08 }, - { "vptestnmb", 0x09 }, - { "vptestnmd", 0x09 }, - { "vptestnmq", 0x09 }, - { "vptestnmw", 0x09 }, - { "vpunpckhbw", 0x0A }, - { "vpunpckhdq", 0x0A }, - { "vpunpckhqdq", 0x0B }, - { "vpunpckhwd", 0x0A }, - { "vpunpcklbw", 0x0A }, - { "vpunpckldq", 0x0A }, - { "vpunpcklqdq", 0x0B }, - { "vpunpcklwd", 0x0A }, - { "vpxor", 0x05 }, - { "vpxord", 0x06 }, - { "vpxorq", 0x06 }, - { "vrangepd", 0x08 }, - { "vrangeps", 0x08 }, - { "vrangesd", 0x08 }, - { "vrangess", 0x08 }, - { "vrcp14pd", 0x08 }, - { "vrcp14ps", 0x08 }, - { "vrcp14sd", 0x08 }, - { "vrcp14ss", 0x08 }, - { "vrcp23ps", 0x08 }, - { "vrcp28pd", 0x08 }, - { "vrcp28ps", 0x08 }, - { "vrcp28sd", 0x08 }, - { "vrcp28ss", 0x08 }, - { "vrcpps", 0x06 }, - { "vrcpss", 0x06 }, - { "vreducepd", 0x09 }, - { "vreduceps", 0x09 }, - { "vreducesd", 0x09 }, - { "vreducess", 0x09 }, - { "vrndfxpntpd", 0x0B }, - { "vrndfxpntps", 0x0B }, - { "vrndscalepd", 0x0B }, - { "vrndscaleps", 0x0B }, - { "vrndscalesd", 0x0B }, - { "vrndscaless", 0x0B }, - { "vroundpd", 0x08 }, - { "vroundps", 0x08 }, - { "vroundsd", 0x08 }, - { "vroundss", 0x08 }, - { "vrsqrt14pd", 0x0A }, - { "vrsqrt14ps", 0x0A }, - { "vrsqrt14sd", 0x0A }, - { "vrsqrt14ss", 0x0A }, - { "vrsqrt23ps", 0x0A }, - { "vrsqrt28pd", 0x0A }, - { "vrsqrt28ps", 0x0A }, - { "vrsqrt28sd", 0x0A }, - { "vrsqrt28ss", 0x0A }, - { "vrsqrtps", 0x08 }, - { "vrsqrtss", 0x08 }, - { "vscalefpd", 0x09 }, - { "vscalefps", 0x09 }, - { "vscalefsd", 0x09 }, - { "vscalefss", 0x09 }, - { "vscaleps", 0x08 }, - { "vscatterdpd", 0x0B }, - { "vscatterdps", 0x0B }, - { "vscatterpf0dpd", 0x0E }, - { "vscatterpf0dps", 0x0E }, - { "vscatterpf0hintdpd", 0x12 }, - { "vscatterpf0hintdps", 0x12 }, - { "vscatterpf0qpd", 0x0E }, - { "vscatterpf0qps", 0x0E }, - { "vscatterpf1dpd", 0x0E }, - { "vscatterpf1dps", 0x0E }, - { "vscatterpf1qpd", 0x0E }, - { "vscatterpf1qps", 0x0E }, - { "vscatterqpd", 0x0B }, - { "vscatterqps", 0x0B }, - { "vshuff32x4", 0x0A }, - { "vshuff64x2", 0x0A }, - { "vshufi32x4", 0x0A }, - { "vshufi64x2", 0x0A }, - { "vshufpd", 0x07 }, - { "vshufps", 0x07 }, - { "vsqrtpd", 0x07 }, - { "vsqrtps", 0x07 }, - { "vsqrtsd", 0x07 }, - { "vsqrtss", 0x07 }, - { "vstmxcsr", 0x08 }, - { "vsubpd", 0x06 }, - { "vsubps", 0x06 }, - { "vsubrpd", 0x07 }, - { "vsubrps", 0x07 }, - { "vsubsd", 0x06 }, - { "vsubss", 0x06 }, - { "vtestpd", 0x07 }, - { "vtestps", 0x07 }, - { "vucomisd", 0x08 }, - { "vucomiss", 0x08 }, - { "vunpckhpd", 0x09 }, - { "vunpckhps", 0x09 }, - { "vunpcklpd", 0x09 }, - { "vunpcklps", 0x09 }, - { "vxorpd", 0x06 }, - { "vxorps", 0x06 }, - { "vzeroall", 0x08 }, - { "vzeroupper", 0x0A }, - { "wbinvd", 0x06 }, - { "wrfsbase", 0x08 }, - { "wrgsbase", 0x08 }, - { "wrmsr", 0x05 }, - { "wrpkru", 0x06 }, - { "wrssd", 0x05 }, - { "wrssq", 0x05 }, - { "wrussd", 0x06 }, - { "wrussq", 0x06 }, - { "xabort", 0x06 }, - { "xadd", 0x04 }, - { "xbegin", 0x06 }, - { "xchg", 0x04 }, - { "xend", 0x04 }, - { "xgetbv", 0x06 }, - { "xlat", 0x04 }, - { "xor", 0x03 }, - { "xorpd", 0x05 }, - { "xorps", 0x05 }, - { "xrstor", 0x06 }, - { "xrstor64", 0x08 }, - { "xrstors", 0x07 }, - { "xrstors64", 0x09 }, - { "xsave", 0x05 }, - { "xsave64", 0x07 }, - { "xsavec", 0x06 }, - { "xsavec64", 0x08 }, - { "xsaveopt", 0x08 }, - { "xsaveopt64", 0x0A }, - { "xsaves", 0x06 }, - { "xsaves64", 0x08 }, - { "xsetbv", 0x06 }, - { "xtest", 0x05 } + ZYDIS_MAKE_GENERATED_STRING("invalid"), + ZYDIS_MAKE_GENERATED_STRING("aaa"), + ZYDIS_MAKE_GENERATED_STRING("aad"), + ZYDIS_MAKE_GENERATED_STRING("aam"), + ZYDIS_MAKE_GENERATED_STRING("aas"), + ZYDIS_MAKE_GENERATED_STRING("adc"), + ZYDIS_MAKE_GENERATED_STRING("adcx"), + ZYDIS_MAKE_GENERATED_STRING("add"), + ZYDIS_MAKE_GENERATED_STRING("addpd"), + ZYDIS_MAKE_GENERATED_STRING("addps"), + ZYDIS_MAKE_GENERATED_STRING("addsd"), + ZYDIS_MAKE_GENERATED_STRING("addss"), + ZYDIS_MAKE_GENERATED_STRING("addsubpd"), + ZYDIS_MAKE_GENERATED_STRING("addsubps"), + ZYDIS_MAKE_GENERATED_STRING("adox"), + ZYDIS_MAKE_GENERATED_STRING("aesdec"), + ZYDIS_MAKE_GENERATED_STRING("aesdeclast"), + ZYDIS_MAKE_GENERATED_STRING("aesenc"), + ZYDIS_MAKE_GENERATED_STRING("aesenclast"), + ZYDIS_MAKE_GENERATED_STRING("aesimc"), + ZYDIS_MAKE_GENERATED_STRING("aeskeygenassist"), + ZYDIS_MAKE_GENERATED_STRING("and"), + ZYDIS_MAKE_GENERATED_STRING("andn"), + ZYDIS_MAKE_GENERATED_STRING("andnpd"), + ZYDIS_MAKE_GENERATED_STRING("andnps"), + ZYDIS_MAKE_GENERATED_STRING("andpd"), + ZYDIS_MAKE_GENERATED_STRING("andps"), + ZYDIS_MAKE_GENERATED_STRING("arpl"), + ZYDIS_MAKE_GENERATED_STRING("bextr"), + ZYDIS_MAKE_GENERATED_STRING("blcfill"), + ZYDIS_MAKE_GENERATED_STRING("blci"), + ZYDIS_MAKE_GENERATED_STRING("blcic"), + ZYDIS_MAKE_GENERATED_STRING("blcmsk"), + ZYDIS_MAKE_GENERATED_STRING("blcs"), + ZYDIS_MAKE_GENERATED_STRING("blendpd"), + ZYDIS_MAKE_GENERATED_STRING("blendps"), + ZYDIS_MAKE_GENERATED_STRING("blendvpd"), + ZYDIS_MAKE_GENERATED_STRING("blendvps"), + ZYDIS_MAKE_GENERATED_STRING("blsfill"), + ZYDIS_MAKE_GENERATED_STRING("blsi"), + ZYDIS_MAKE_GENERATED_STRING("blsic"), + ZYDIS_MAKE_GENERATED_STRING("blsmsk"), + ZYDIS_MAKE_GENERATED_STRING("blsr"), + ZYDIS_MAKE_GENERATED_STRING("bndcl"), + ZYDIS_MAKE_GENERATED_STRING("bndcn"), + ZYDIS_MAKE_GENERATED_STRING("bndcu"), + ZYDIS_MAKE_GENERATED_STRING("bndldx"), + ZYDIS_MAKE_GENERATED_STRING("bndmk"), + ZYDIS_MAKE_GENERATED_STRING("bndmov"), + ZYDIS_MAKE_GENERATED_STRING("bndstx"), + ZYDIS_MAKE_GENERATED_STRING("bound"), + ZYDIS_MAKE_GENERATED_STRING("bsf"), + ZYDIS_MAKE_GENERATED_STRING("bsr"), + ZYDIS_MAKE_GENERATED_STRING("bswap"), + ZYDIS_MAKE_GENERATED_STRING("bt"), + ZYDIS_MAKE_GENERATED_STRING("btc"), + ZYDIS_MAKE_GENERATED_STRING("btr"), + ZYDIS_MAKE_GENERATED_STRING("bts"), + ZYDIS_MAKE_GENERATED_STRING("bzhi"), + ZYDIS_MAKE_GENERATED_STRING("call"), + ZYDIS_MAKE_GENERATED_STRING("cbw"), + ZYDIS_MAKE_GENERATED_STRING("cdq"), + ZYDIS_MAKE_GENERATED_STRING("cdqe"), + ZYDIS_MAKE_GENERATED_STRING("clac"), + ZYDIS_MAKE_GENERATED_STRING("clc"), + ZYDIS_MAKE_GENERATED_STRING("cld"), + ZYDIS_MAKE_GENERATED_STRING("clevict0"), + ZYDIS_MAKE_GENERATED_STRING("clevict1"), + ZYDIS_MAKE_GENERATED_STRING("clflush"), + ZYDIS_MAKE_GENERATED_STRING("clflushopt"), + ZYDIS_MAKE_GENERATED_STRING("clgi"), + ZYDIS_MAKE_GENERATED_STRING("cli"), + ZYDIS_MAKE_GENERATED_STRING("clrssbsy"), + ZYDIS_MAKE_GENERATED_STRING("clts"), + ZYDIS_MAKE_GENERATED_STRING("clwb"), + ZYDIS_MAKE_GENERATED_STRING("clzero"), + ZYDIS_MAKE_GENERATED_STRING("cmc"), + ZYDIS_MAKE_GENERATED_STRING("cmovb"), + ZYDIS_MAKE_GENERATED_STRING("cmovbe"), + ZYDIS_MAKE_GENERATED_STRING("cmovl"), + ZYDIS_MAKE_GENERATED_STRING("cmovle"), + ZYDIS_MAKE_GENERATED_STRING("cmovnb"), + ZYDIS_MAKE_GENERATED_STRING("cmovnbe"), + ZYDIS_MAKE_GENERATED_STRING("cmovnl"), + ZYDIS_MAKE_GENERATED_STRING("cmovnle"), + ZYDIS_MAKE_GENERATED_STRING("cmovno"), + ZYDIS_MAKE_GENERATED_STRING("cmovnp"), + ZYDIS_MAKE_GENERATED_STRING("cmovns"), + ZYDIS_MAKE_GENERATED_STRING("cmovnz"), + ZYDIS_MAKE_GENERATED_STRING("cmovo"), + ZYDIS_MAKE_GENERATED_STRING("cmovp"), + ZYDIS_MAKE_GENERATED_STRING("cmovs"), + ZYDIS_MAKE_GENERATED_STRING("cmovz"), + ZYDIS_MAKE_GENERATED_STRING("cmp"), + ZYDIS_MAKE_GENERATED_STRING("cmppd"), + ZYDIS_MAKE_GENERATED_STRING("cmpps"), + ZYDIS_MAKE_GENERATED_STRING("cmpsb"), + ZYDIS_MAKE_GENERATED_STRING("cmpsd"), + ZYDIS_MAKE_GENERATED_STRING("cmpsq"), + ZYDIS_MAKE_GENERATED_STRING("cmpss"), + ZYDIS_MAKE_GENERATED_STRING("cmpsw"), + ZYDIS_MAKE_GENERATED_STRING("cmpxchg"), + ZYDIS_MAKE_GENERATED_STRING("cmpxchg16b"), + ZYDIS_MAKE_GENERATED_STRING("cmpxchg8b"), + ZYDIS_MAKE_GENERATED_STRING("comisd"), + ZYDIS_MAKE_GENERATED_STRING("comiss"), + ZYDIS_MAKE_GENERATED_STRING("cpuid"), + ZYDIS_MAKE_GENERATED_STRING("cqo"), + ZYDIS_MAKE_GENERATED_STRING("crc32"), + ZYDIS_MAKE_GENERATED_STRING("cvtdq2pd"), + ZYDIS_MAKE_GENERATED_STRING("cvtdq2ps"), + ZYDIS_MAKE_GENERATED_STRING("cvtpd2dq"), + ZYDIS_MAKE_GENERATED_STRING("cvtpd2pi"), + ZYDIS_MAKE_GENERATED_STRING("cvtpd2ps"), + ZYDIS_MAKE_GENERATED_STRING("cvtpi2pd"), + ZYDIS_MAKE_GENERATED_STRING("cvtpi2ps"), + ZYDIS_MAKE_GENERATED_STRING("cvtps2dq"), + ZYDIS_MAKE_GENERATED_STRING("cvtps2pd"), + ZYDIS_MAKE_GENERATED_STRING("cvtps2pi"), + ZYDIS_MAKE_GENERATED_STRING("cvtsd2si"), + ZYDIS_MAKE_GENERATED_STRING("cvtsd2ss"), + ZYDIS_MAKE_GENERATED_STRING("cvtsi2sd"), + ZYDIS_MAKE_GENERATED_STRING("cvtsi2ss"), + ZYDIS_MAKE_GENERATED_STRING("cvtss2sd"), + ZYDIS_MAKE_GENERATED_STRING("cvtss2si"), + ZYDIS_MAKE_GENERATED_STRING("cvttpd2dq"), + ZYDIS_MAKE_GENERATED_STRING("cvttpd2pi"), + ZYDIS_MAKE_GENERATED_STRING("cvttps2dq"), + ZYDIS_MAKE_GENERATED_STRING("cvttps2pi"), + ZYDIS_MAKE_GENERATED_STRING("cvttsd2si"), + ZYDIS_MAKE_GENERATED_STRING("cvttss2si"), + ZYDIS_MAKE_GENERATED_STRING("cwd"), + ZYDIS_MAKE_GENERATED_STRING("cwde"), + ZYDIS_MAKE_GENERATED_STRING("daa"), + ZYDIS_MAKE_GENERATED_STRING("das"), + ZYDIS_MAKE_GENERATED_STRING("dec"), + ZYDIS_MAKE_GENERATED_STRING("delay"), + ZYDIS_MAKE_GENERATED_STRING("div"), + ZYDIS_MAKE_GENERATED_STRING("divpd"), + ZYDIS_MAKE_GENERATED_STRING("divps"), + ZYDIS_MAKE_GENERATED_STRING("divsd"), + ZYDIS_MAKE_GENERATED_STRING("divss"), + ZYDIS_MAKE_GENERATED_STRING("dppd"), + ZYDIS_MAKE_GENERATED_STRING("dpps"), + ZYDIS_MAKE_GENERATED_STRING("emms"), + ZYDIS_MAKE_GENERATED_STRING("encls"), + ZYDIS_MAKE_GENERATED_STRING("enclu"), + ZYDIS_MAKE_GENERATED_STRING("endbr32"), + ZYDIS_MAKE_GENERATED_STRING("endbr64"), + ZYDIS_MAKE_GENERATED_STRING("enter"), + ZYDIS_MAKE_GENERATED_STRING("extractps"), + ZYDIS_MAKE_GENERATED_STRING("f2xm1"), + ZYDIS_MAKE_GENERATED_STRING("fabs"), + ZYDIS_MAKE_GENERATED_STRING("fadd"), + ZYDIS_MAKE_GENERATED_STRING("faddp"), + ZYDIS_MAKE_GENERATED_STRING("fbld"), + ZYDIS_MAKE_GENERATED_STRING("fbstp"), + ZYDIS_MAKE_GENERATED_STRING("fchs"), + ZYDIS_MAKE_GENERATED_STRING("fcmovb"), + ZYDIS_MAKE_GENERATED_STRING("fcmovbe"), + ZYDIS_MAKE_GENERATED_STRING("fcmove"), + ZYDIS_MAKE_GENERATED_STRING("fcmovnb"), + ZYDIS_MAKE_GENERATED_STRING("fcmovnbe"), + ZYDIS_MAKE_GENERATED_STRING("fcmovne"), + ZYDIS_MAKE_GENERATED_STRING("fcmovnu"), + ZYDIS_MAKE_GENERATED_STRING("fcmovu"), + ZYDIS_MAKE_GENERATED_STRING("fcom"), + ZYDIS_MAKE_GENERATED_STRING("fcomi"), + ZYDIS_MAKE_GENERATED_STRING("fcomip"), + ZYDIS_MAKE_GENERATED_STRING("fcomp"), + ZYDIS_MAKE_GENERATED_STRING("fcompp"), + ZYDIS_MAKE_GENERATED_STRING("fcos"), + ZYDIS_MAKE_GENERATED_STRING("fdecstp"), + ZYDIS_MAKE_GENERATED_STRING("fdisi8087_nop"), + ZYDIS_MAKE_GENERATED_STRING("fdiv"), + ZYDIS_MAKE_GENERATED_STRING("fdivp"), + ZYDIS_MAKE_GENERATED_STRING("fdivr"), + ZYDIS_MAKE_GENERATED_STRING("fdivrp"), + ZYDIS_MAKE_GENERATED_STRING("femms"), + ZYDIS_MAKE_GENERATED_STRING("feni8087_nop"), + ZYDIS_MAKE_GENERATED_STRING("ffree"), + ZYDIS_MAKE_GENERATED_STRING("ffreep"), + ZYDIS_MAKE_GENERATED_STRING("fiadd"), + ZYDIS_MAKE_GENERATED_STRING("ficom"), + ZYDIS_MAKE_GENERATED_STRING("ficomp"), + ZYDIS_MAKE_GENERATED_STRING("fidiv"), + ZYDIS_MAKE_GENERATED_STRING("fidivr"), + ZYDIS_MAKE_GENERATED_STRING("fild"), + ZYDIS_MAKE_GENERATED_STRING("fimul"), + ZYDIS_MAKE_GENERATED_STRING("fincstp"), + ZYDIS_MAKE_GENERATED_STRING("fist"), + ZYDIS_MAKE_GENERATED_STRING("fistp"), + ZYDIS_MAKE_GENERATED_STRING("fisttp"), + ZYDIS_MAKE_GENERATED_STRING("fisub"), + ZYDIS_MAKE_GENERATED_STRING("fisubr"), + ZYDIS_MAKE_GENERATED_STRING("fld"), + ZYDIS_MAKE_GENERATED_STRING("fld1"), + ZYDIS_MAKE_GENERATED_STRING("fldcw"), + ZYDIS_MAKE_GENERATED_STRING("fldenv"), + ZYDIS_MAKE_GENERATED_STRING("fldl2e"), + ZYDIS_MAKE_GENERATED_STRING("fldl2t"), + ZYDIS_MAKE_GENERATED_STRING("fldlg2"), + ZYDIS_MAKE_GENERATED_STRING("fldln2"), + ZYDIS_MAKE_GENERATED_STRING("fldpi"), + ZYDIS_MAKE_GENERATED_STRING("fldz"), + ZYDIS_MAKE_GENERATED_STRING("fmul"), + ZYDIS_MAKE_GENERATED_STRING("fmulp"), + ZYDIS_MAKE_GENERATED_STRING("fnclex"), + ZYDIS_MAKE_GENERATED_STRING("fninit"), + ZYDIS_MAKE_GENERATED_STRING("fnop"), + ZYDIS_MAKE_GENERATED_STRING("fnsave"), + ZYDIS_MAKE_GENERATED_STRING("fnstcw"), + ZYDIS_MAKE_GENERATED_STRING("fnstenv"), + ZYDIS_MAKE_GENERATED_STRING("fnstsw"), + ZYDIS_MAKE_GENERATED_STRING("fpatan"), + ZYDIS_MAKE_GENERATED_STRING("fprem"), + ZYDIS_MAKE_GENERATED_STRING("fprem1"), + ZYDIS_MAKE_GENERATED_STRING("fptan"), + ZYDIS_MAKE_GENERATED_STRING("frndint"), + ZYDIS_MAKE_GENERATED_STRING("frstor"), + ZYDIS_MAKE_GENERATED_STRING("fscale"), + ZYDIS_MAKE_GENERATED_STRING("fsetpm287_nop"), + ZYDIS_MAKE_GENERATED_STRING("fsin"), + ZYDIS_MAKE_GENERATED_STRING("fsincos"), + ZYDIS_MAKE_GENERATED_STRING("fsqrt"), + ZYDIS_MAKE_GENERATED_STRING("fst"), + ZYDIS_MAKE_GENERATED_STRING("fstp"), + ZYDIS_MAKE_GENERATED_STRING("fstpnce"), + ZYDIS_MAKE_GENERATED_STRING("fsub"), + ZYDIS_MAKE_GENERATED_STRING("fsubp"), + ZYDIS_MAKE_GENERATED_STRING("fsubr"), + ZYDIS_MAKE_GENERATED_STRING("fsubrp"), + ZYDIS_MAKE_GENERATED_STRING("ftst"), + ZYDIS_MAKE_GENERATED_STRING("fucom"), + ZYDIS_MAKE_GENERATED_STRING("fucomi"), + ZYDIS_MAKE_GENERATED_STRING("fucomip"), + ZYDIS_MAKE_GENERATED_STRING("fucomp"), + ZYDIS_MAKE_GENERATED_STRING("fucompp"), + ZYDIS_MAKE_GENERATED_STRING("fwait"), + ZYDIS_MAKE_GENERATED_STRING("fxam"), + ZYDIS_MAKE_GENERATED_STRING("fxch"), + ZYDIS_MAKE_GENERATED_STRING("fxrstor"), + ZYDIS_MAKE_GENERATED_STRING("fxrstor64"), + ZYDIS_MAKE_GENERATED_STRING("fxsave"), + ZYDIS_MAKE_GENERATED_STRING("fxsave64"), + ZYDIS_MAKE_GENERATED_STRING("fxtract"), + ZYDIS_MAKE_GENERATED_STRING("fyl2x"), + ZYDIS_MAKE_GENERATED_STRING("fyl2xp1"), + ZYDIS_MAKE_GENERATED_STRING("getsec"), + ZYDIS_MAKE_GENERATED_STRING("gf2p8affineinvqb"), + ZYDIS_MAKE_GENERATED_STRING("gf2p8affineqb"), + ZYDIS_MAKE_GENERATED_STRING("gf2p8mulb"), + ZYDIS_MAKE_GENERATED_STRING("haddpd"), + ZYDIS_MAKE_GENERATED_STRING("haddps"), + ZYDIS_MAKE_GENERATED_STRING("hlt"), + ZYDIS_MAKE_GENERATED_STRING("hsubpd"), + ZYDIS_MAKE_GENERATED_STRING("hsubps"), + ZYDIS_MAKE_GENERATED_STRING("idiv"), + ZYDIS_MAKE_GENERATED_STRING("imul"), + ZYDIS_MAKE_GENERATED_STRING("in"), + ZYDIS_MAKE_GENERATED_STRING("inc"), + ZYDIS_MAKE_GENERATED_STRING("incsspd"), + ZYDIS_MAKE_GENERATED_STRING("incsspq"), + ZYDIS_MAKE_GENERATED_STRING("insb"), + ZYDIS_MAKE_GENERATED_STRING("insd"), + ZYDIS_MAKE_GENERATED_STRING("insertps"), + ZYDIS_MAKE_GENERATED_STRING("insw"), + ZYDIS_MAKE_GENERATED_STRING("int"), + ZYDIS_MAKE_GENERATED_STRING("int1"), + ZYDIS_MAKE_GENERATED_STRING("int3"), + ZYDIS_MAKE_GENERATED_STRING("into"), + ZYDIS_MAKE_GENERATED_STRING("invd"), + ZYDIS_MAKE_GENERATED_STRING("invept"), + ZYDIS_MAKE_GENERATED_STRING("invlpg"), + ZYDIS_MAKE_GENERATED_STRING("invlpga"), + ZYDIS_MAKE_GENERATED_STRING("invpcid"), + ZYDIS_MAKE_GENERATED_STRING("invvpid"), + ZYDIS_MAKE_GENERATED_STRING("iret"), + ZYDIS_MAKE_GENERATED_STRING("iretd"), + ZYDIS_MAKE_GENERATED_STRING("iretq"), + ZYDIS_MAKE_GENERATED_STRING("jb"), + ZYDIS_MAKE_GENERATED_STRING("jbe"), + ZYDIS_MAKE_GENERATED_STRING("jcxz"), + ZYDIS_MAKE_GENERATED_STRING("jecxz"), + ZYDIS_MAKE_GENERATED_STRING("jknzd"), + ZYDIS_MAKE_GENERATED_STRING("jkzd"), + ZYDIS_MAKE_GENERATED_STRING("jl"), + ZYDIS_MAKE_GENERATED_STRING("jle"), + ZYDIS_MAKE_GENERATED_STRING("jmp"), + ZYDIS_MAKE_GENERATED_STRING("jnb"), + ZYDIS_MAKE_GENERATED_STRING("jnbe"), + ZYDIS_MAKE_GENERATED_STRING("jnl"), + ZYDIS_MAKE_GENERATED_STRING("jnle"), + ZYDIS_MAKE_GENERATED_STRING("jno"), + ZYDIS_MAKE_GENERATED_STRING("jnp"), + ZYDIS_MAKE_GENERATED_STRING("jns"), + ZYDIS_MAKE_GENERATED_STRING("jnz"), + ZYDIS_MAKE_GENERATED_STRING("jo"), + ZYDIS_MAKE_GENERATED_STRING("jp"), + ZYDIS_MAKE_GENERATED_STRING("jrcxz"), + ZYDIS_MAKE_GENERATED_STRING("js"), + ZYDIS_MAKE_GENERATED_STRING("jz"), + ZYDIS_MAKE_GENERATED_STRING("kaddb"), + ZYDIS_MAKE_GENERATED_STRING("kaddd"), + ZYDIS_MAKE_GENERATED_STRING("kaddq"), + ZYDIS_MAKE_GENERATED_STRING("kaddw"), + ZYDIS_MAKE_GENERATED_STRING("kand"), + ZYDIS_MAKE_GENERATED_STRING("kandb"), + ZYDIS_MAKE_GENERATED_STRING("kandd"), + ZYDIS_MAKE_GENERATED_STRING("kandn"), + ZYDIS_MAKE_GENERATED_STRING("kandnb"), + ZYDIS_MAKE_GENERATED_STRING("kandnd"), + ZYDIS_MAKE_GENERATED_STRING("kandnq"), + ZYDIS_MAKE_GENERATED_STRING("kandnr"), + ZYDIS_MAKE_GENERATED_STRING("kandnw"), + ZYDIS_MAKE_GENERATED_STRING("kandq"), + ZYDIS_MAKE_GENERATED_STRING("kandw"), + ZYDIS_MAKE_GENERATED_STRING("kconcath"), + ZYDIS_MAKE_GENERATED_STRING("kconcatl"), + ZYDIS_MAKE_GENERATED_STRING("kextract"), + ZYDIS_MAKE_GENERATED_STRING("kmerge2l1h"), + ZYDIS_MAKE_GENERATED_STRING("kmerge2l1l"), + ZYDIS_MAKE_GENERATED_STRING("kmov"), + ZYDIS_MAKE_GENERATED_STRING("kmovb"), + ZYDIS_MAKE_GENERATED_STRING("kmovd"), + ZYDIS_MAKE_GENERATED_STRING("kmovq"), + ZYDIS_MAKE_GENERATED_STRING("kmovw"), + ZYDIS_MAKE_GENERATED_STRING("knot"), + ZYDIS_MAKE_GENERATED_STRING("knotb"), + ZYDIS_MAKE_GENERATED_STRING("knotd"), + ZYDIS_MAKE_GENERATED_STRING("knotq"), + ZYDIS_MAKE_GENERATED_STRING("knotw"), + ZYDIS_MAKE_GENERATED_STRING("kor"), + ZYDIS_MAKE_GENERATED_STRING("korb"), + ZYDIS_MAKE_GENERATED_STRING("kord"), + ZYDIS_MAKE_GENERATED_STRING("korq"), + ZYDIS_MAKE_GENERATED_STRING("kortest"), + ZYDIS_MAKE_GENERATED_STRING("kortestb"), + ZYDIS_MAKE_GENERATED_STRING("kortestd"), + ZYDIS_MAKE_GENERATED_STRING("kortestq"), + ZYDIS_MAKE_GENERATED_STRING("kortestw"), + ZYDIS_MAKE_GENERATED_STRING("korw"), + ZYDIS_MAKE_GENERATED_STRING("kshiftlb"), + ZYDIS_MAKE_GENERATED_STRING("kshiftld"), + ZYDIS_MAKE_GENERATED_STRING("kshiftlq"), + ZYDIS_MAKE_GENERATED_STRING("kshiftlw"), + ZYDIS_MAKE_GENERATED_STRING("kshiftrb"), + ZYDIS_MAKE_GENERATED_STRING("kshiftrd"), + ZYDIS_MAKE_GENERATED_STRING("kshiftrq"), + ZYDIS_MAKE_GENERATED_STRING("kshiftrw"), + ZYDIS_MAKE_GENERATED_STRING("ktestb"), + ZYDIS_MAKE_GENERATED_STRING("ktestd"), + ZYDIS_MAKE_GENERATED_STRING("ktestq"), + ZYDIS_MAKE_GENERATED_STRING("ktestw"), + ZYDIS_MAKE_GENERATED_STRING("kunpckbw"), + ZYDIS_MAKE_GENERATED_STRING("kunpckdq"), + ZYDIS_MAKE_GENERATED_STRING("kunpckwd"), + ZYDIS_MAKE_GENERATED_STRING("kxnor"), + ZYDIS_MAKE_GENERATED_STRING("kxnorb"), + ZYDIS_MAKE_GENERATED_STRING("kxnord"), + ZYDIS_MAKE_GENERATED_STRING("kxnorq"), + ZYDIS_MAKE_GENERATED_STRING("kxnorw"), + ZYDIS_MAKE_GENERATED_STRING("kxor"), + ZYDIS_MAKE_GENERATED_STRING("kxorb"), + ZYDIS_MAKE_GENERATED_STRING("kxord"), + ZYDIS_MAKE_GENERATED_STRING("kxorq"), + ZYDIS_MAKE_GENERATED_STRING("kxorw"), + ZYDIS_MAKE_GENERATED_STRING("lahf"), + ZYDIS_MAKE_GENERATED_STRING("lar"), + ZYDIS_MAKE_GENERATED_STRING("lddqu"), + ZYDIS_MAKE_GENERATED_STRING("ldmxcsr"), + ZYDIS_MAKE_GENERATED_STRING("lds"), + ZYDIS_MAKE_GENERATED_STRING("lea"), + ZYDIS_MAKE_GENERATED_STRING("leave"), + ZYDIS_MAKE_GENERATED_STRING("les"), + ZYDIS_MAKE_GENERATED_STRING("lfence"), + ZYDIS_MAKE_GENERATED_STRING("lfs"), + ZYDIS_MAKE_GENERATED_STRING("lgdt"), + ZYDIS_MAKE_GENERATED_STRING("lgs"), + ZYDIS_MAKE_GENERATED_STRING("lidt"), + ZYDIS_MAKE_GENERATED_STRING("lldt"), + ZYDIS_MAKE_GENERATED_STRING("llwpcb"), + ZYDIS_MAKE_GENERATED_STRING("lmsw"), + ZYDIS_MAKE_GENERATED_STRING("lodsb"), + ZYDIS_MAKE_GENERATED_STRING("lodsd"), + ZYDIS_MAKE_GENERATED_STRING("lodsq"), + ZYDIS_MAKE_GENERATED_STRING("lodsw"), + ZYDIS_MAKE_GENERATED_STRING("loop"), + ZYDIS_MAKE_GENERATED_STRING("loope"), + ZYDIS_MAKE_GENERATED_STRING("loopne"), + ZYDIS_MAKE_GENERATED_STRING("lsl"), + ZYDIS_MAKE_GENERATED_STRING("lss"), + ZYDIS_MAKE_GENERATED_STRING("ltr"), + ZYDIS_MAKE_GENERATED_STRING("lwpins"), + ZYDIS_MAKE_GENERATED_STRING("lwpval"), + ZYDIS_MAKE_GENERATED_STRING("lzcnt"), + ZYDIS_MAKE_GENERATED_STRING("maskmovdqu"), + ZYDIS_MAKE_GENERATED_STRING("maskmovq"), + ZYDIS_MAKE_GENERATED_STRING("maxpd"), + ZYDIS_MAKE_GENERATED_STRING("maxps"), + ZYDIS_MAKE_GENERATED_STRING("maxsd"), + ZYDIS_MAKE_GENERATED_STRING("maxss"), + ZYDIS_MAKE_GENERATED_STRING("mfence"), + ZYDIS_MAKE_GENERATED_STRING("minpd"), + ZYDIS_MAKE_GENERATED_STRING("minps"), + ZYDIS_MAKE_GENERATED_STRING("minsd"), + ZYDIS_MAKE_GENERATED_STRING("minss"), + ZYDIS_MAKE_GENERATED_STRING("monitor"), + ZYDIS_MAKE_GENERATED_STRING("mov"), + ZYDIS_MAKE_GENERATED_STRING("movapd"), + ZYDIS_MAKE_GENERATED_STRING("movaps"), + ZYDIS_MAKE_GENERATED_STRING("movbe"), + ZYDIS_MAKE_GENERATED_STRING("movd"), + ZYDIS_MAKE_GENERATED_STRING("movddup"), + ZYDIS_MAKE_GENERATED_STRING("movdq2q"), + ZYDIS_MAKE_GENERATED_STRING("movdqa"), + ZYDIS_MAKE_GENERATED_STRING("movdqu"), + ZYDIS_MAKE_GENERATED_STRING("movhlps"), + ZYDIS_MAKE_GENERATED_STRING("movhpd"), + ZYDIS_MAKE_GENERATED_STRING("movhps"), + ZYDIS_MAKE_GENERATED_STRING("movlhps"), + ZYDIS_MAKE_GENERATED_STRING("movlpd"), + ZYDIS_MAKE_GENERATED_STRING("movlps"), + ZYDIS_MAKE_GENERATED_STRING("movmskpd"), + ZYDIS_MAKE_GENERATED_STRING("movmskps"), + ZYDIS_MAKE_GENERATED_STRING("movntdq"), + ZYDIS_MAKE_GENERATED_STRING("movntdqa"), + ZYDIS_MAKE_GENERATED_STRING("movnti"), + ZYDIS_MAKE_GENERATED_STRING("movntpd"), + ZYDIS_MAKE_GENERATED_STRING("movntps"), + ZYDIS_MAKE_GENERATED_STRING("movntq"), + ZYDIS_MAKE_GENERATED_STRING("movq"), + ZYDIS_MAKE_GENERATED_STRING("movq2dq"), + ZYDIS_MAKE_GENERATED_STRING("movsb"), + ZYDIS_MAKE_GENERATED_STRING("movsd"), + ZYDIS_MAKE_GENERATED_STRING("movshdup"), + ZYDIS_MAKE_GENERATED_STRING("movsldup"), + ZYDIS_MAKE_GENERATED_STRING("movsq"), + ZYDIS_MAKE_GENERATED_STRING("movss"), + ZYDIS_MAKE_GENERATED_STRING("movsw"), + ZYDIS_MAKE_GENERATED_STRING("movsx"), + ZYDIS_MAKE_GENERATED_STRING("movsxd"), + ZYDIS_MAKE_GENERATED_STRING("movupd"), + ZYDIS_MAKE_GENERATED_STRING("movups"), + ZYDIS_MAKE_GENERATED_STRING("movzx"), + ZYDIS_MAKE_GENERATED_STRING("mpsadbw"), + ZYDIS_MAKE_GENERATED_STRING("mul"), + ZYDIS_MAKE_GENERATED_STRING("mulpd"), + ZYDIS_MAKE_GENERATED_STRING("mulps"), + ZYDIS_MAKE_GENERATED_STRING("mulsd"), + ZYDIS_MAKE_GENERATED_STRING("mulss"), + ZYDIS_MAKE_GENERATED_STRING("mulx"), + ZYDIS_MAKE_GENERATED_STRING("mwait"), + ZYDIS_MAKE_GENERATED_STRING("neg"), + ZYDIS_MAKE_GENERATED_STRING("nop"), + ZYDIS_MAKE_GENERATED_STRING("not"), + ZYDIS_MAKE_GENERATED_STRING("or"), + ZYDIS_MAKE_GENERATED_STRING("orpd"), + ZYDIS_MAKE_GENERATED_STRING("orps"), + ZYDIS_MAKE_GENERATED_STRING("out"), + ZYDIS_MAKE_GENERATED_STRING("outsb"), + ZYDIS_MAKE_GENERATED_STRING("outsd"), + ZYDIS_MAKE_GENERATED_STRING("outsw"), + ZYDIS_MAKE_GENERATED_STRING("pabsb"), + ZYDIS_MAKE_GENERATED_STRING("pabsd"), + ZYDIS_MAKE_GENERATED_STRING("pabsw"), + ZYDIS_MAKE_GENERATED_STRING("packssdw"), + ZYDIS_MAKE_GENERATED_STRING("packsswb"), + ZYDIS_MAKE_GENERATED_STRING("packusdw"), + ZYDIS_MAKE_GENERATED_STRING("packuswb"), + ZYDIS_MAKE_GENERATED_STRING("paddb"), + ZYDIS_MAKE_GENERATED_STRING("paddd"), + ZYDIS_MAKE_GENERATED_STRING("paddq"), + ZYDIS_MAKE_GENERATED_STRING("paddsb"), + ZYDIS_MAKE_GENERATED_STRING("paddsw"), + ZYDIS_MAKE_GENERATED_STRING("paddusb"), + ZYDIS_MAKE_GENERATED_STRING("paddusw"), + ZYDIS_MAKE_GENERATED_STRING("paddw"), + ZYDIS_MAKE_GENERATED_STRING("palignr"), + ZYDIS_MAKE_GENERATED_STRING("pand"), + ZYDIS_MAKE_GENERATED_STRING("pandn"), + ZYDIS_MAKE_GENERATED_STRING("pause"), + ZYDIS_MAKE_GENERATED_STRING("pavgb"), + ZYDIS_MAKE_GENERATED_STRING("pavgusb"), + ZYDIS_MAKE_GENERATED_STRING("pavgw"), + ZYDIS_MAKE_GENERATED_STRING("pblendvb"), + ZYDIS_MAKE_GENERATED_STRING("pblendw"), + ZYDIS_MAKE_GENERATED_STRING("pclmulqdq"), + ZYDIS_MAKE_GENERATED_STRING("pcmpeqb"), + ZYDIS_MAKE_GENERATED_STRING("pcmpeqd"), + ZYDIS_MAKE_GENERATED_STRING("pcmpeqq"), + ZYDIS_MAKE_GENERATED_STRING("pcmpeqw"), + ZYDIS_MAKE_GENERATED_STRING("pcmpestri"), + ZYDIS_MAKE_GENERATED_STRING("pcmpestrm"), + ZYDIS_MAKE_GENERATED_STRING("pcmpgtb"), + ZYDIS_MAKE_GENERATED_STRING("pcmpgtd"), + ZYDIS_MAKE_GENERATED_STRING("pcmpgtq"), + ZYDIS_MAKE_GENERATED_STRING("pcmpgtw"), + ZYDIS_MAKE_GENERATED_STRING("pcmpistri"), + ZYDIS_MAKE_GENERATED_STRING("pcmpistrm"), + ZYDIS_MAKE_GENERATED_STRING("pdep"), + ZYDIS_MAKE_GENERATED_STRING("pext"), + ZYDIS_MAKE_GENERATED_STRING("pextrb"), + ZYDIS_MAKE_GENERATED_STRING("pextrd"), + ZYDIS_MAKE_GENERATED_STRING("pextrq"), + ZYDIS_MAKE_GENERATED_STRING("pextrw"), + ZYDIS_MAKE_GENERATED_STRING("pf2id"), + ZYDIS_MAKE_GENERATED_STRING("pf2iw"), + ZYDIS_MAKE_GENERATED_STRING("pfacc"), + ZYDIS_MAKE_GENERATED_STRING("pfadd"), + ZYDIS_MAKE_GENERATED_STRING("pfcmpeq"), + ZYDIS_MAKE_GENERATED_STRING("pfcmpge"), + ZYDIS_MAKE_GENERATED_STRING("pfcmpgt"), + ZYDIS_MAKE_GENERATED_STRING("pfcpit1"), + ZYDIS_MAKE_GENERATED_STRING("pfmax"), + ZYDIS_MAKE_GENERATED_STRING("pfmin"), + ZYDIS_MAKE_GENERATED_STRING("pfmul"), + ZYDIS_MAKE_GENERATED_STRING("pfnacc"), + ZYDIS_MAKE_GENERATED_STRING("pfpnacc"), + ZYDIS_MAKE_GENERATED_STRING("pfrcp"), + ZYDIS_MAKE_GENERATED_STRING("pfrcpit2"), + ZYDIS_MAKE_GENERATED_STRING("pfrsqit1"), + ZYDIS_MAKE_GENERATED_STRING("pfsqrt"), + ZYDIS_MAKE_GENERATED_STRING("pfsub"), + ZYDIS_MAKE_GENERATED_STRING("pfsubr"), + ZYDIS_MAKE_GENERATED_STRING("phaddd"), + ZYDIS_MAKE_GENERATED_STRING("phaddsw"), + ZYDIS_MAKE_GENERATED_STRING("phaddw"), + ZYDIS_MAKE_GENERATED_STRING("phminposuw"), + ZYDIS_MAKE_GENERATED_STRING("phsubd"), + ZYDIS_MAKE_GENERATED_STRING("phsubsw"), + ZYDIS_MAKE_GENERATED_STRING("phsubw"), + ZYDIS_MAKE_GENERATED_STRING("pi2fd"), + ZYDIS_MAKE_GENERATED_STRING("pi2fw"), + ZYDIS_MAKE_GENERATED_STRING("pinsrb"), + ZYDIS_MAKE_GENERATED_STRING("pinsrd"), + ZYDIS_MAKE_GENERATED_STRING("pinsrq"), + ZYDIS_MAKE_GENERATED_STRING("pinsrw"), + ZYDIS_MAKE_GENERATED_STRING("pmaddubsw"), + ZYDIS_MAKE_GENERATED_STRING("pmaddwd"), + ZYDIS_MAKE_GENERATED_STRING("pmaxsb"), + ZYDIS_MAKE_GENERATED_STRING("pmaxsd"), + ZYDIS_MAKE_GENERATED_STRING("pmaxsw"), + ZYDIS_MAKE_GENERATED_STRING("pmaxub"), + ZYDIS_MAKE_GENERATED_STRING("pmaxud"), + ZYDIS_MAKE_GENERATED_STRING("pmaxuw"), + ZYDIS_MAKE_GENERATED_STRING("pminsb"), + ZYDIS_MAKE_GENERATED_STRING("pminsd"), + ZYDIS_MAKE_GENERATED_STRING("pminsw"), + ZYDIS_MAKE_GENERATED_STRING("pminub"), + ZYDIS_MAKE_GENERATED_STRING("pminud"), + ZYDIS_MAKE_GENERATED_STRING("pminuw"), + ZYDIS_MAKE_GENERATED_STRING("pmovmskb"), + ZYDIS_MAKE_GENERATED_STRING("pmovsxbd"), + ZYDIS_MAKE_GENERATED_STRING("pmovsxbq"), + ZYDIS_MAKE_GENERATED_STRING("pmovsxbw"), + ZYDIS_MAKE_GENERATED_STRING("pmovsxdq"), + ZYDIS_MAKE_GENERATED_STRING("pmovsxwd"), + ZYDIS_MAKE_GENERATED_STRING("pmovsxwq"), + ZYDIS_MAKE_GENERATED_STRING("pmovzxbd"), + ZYDIS_MAKE_GENERATED_STRING("pmovzxbq"), + ZYDIS_MAKE_GENERATED_STRING("pmovzxbw"), + ZYDIS_MAKE_GENERATED_STRING("pmovzxdq"), + ZYDIS_MAKE_GENERATED_STRING("pmovzxwd"), + ZYDIS_MAKE_GENERATED_STRING("pmovzxwq"), + ZYDIS_MAKE_GENERATED_STRING("pmuldq"), + ZYDIS_MAKE_GENERATED_STRING("pmulhrsw"), + ZYDIS_MAKE_GENERATED_STRING("pmulhrw"), + ZYDIS_MAKE_GENERATED_STRING("pmulhuw"), + ZYDIS_MAKE_GENERATED_STRING("pmulhw"), + ZYDIS_MAKE_GENERATED_STRING("pmulld"), + ZYDIS_MAKE_GENERATED_STRING("pmullw"), + ZYDIS_MAKE_GENERATED_STRING("pmuludq"), + ZYDIS_MAKE_GENERATED_STRING("pop"), + ZYDIS_MAKE_GENERATED_STRING("popa"), + ZYDIS_MAKE_GENERATED_STRING("popad"), + ZYDIS_MAKE_GENERATED_STRING("popcnt"), + ZYDIS_MAKE_GENERATED_STRING("popf"), + ZYDIS_MAKE_GENERATED_STRING("popfd"), + ZYDIS_MAKE_GENERATED_STRING("popfq"), + ZYDIS_MAKE_GENERATED_STRING("por"), + ZYDIS_MAKE_GENERATED_STRING("prefetch"), + ZYDIS_MAKE_GENERATED_STRING("prefetchnta"), + ZYDIS_MAKE_GENERATED_STRING("prefetcht0"), + ZYDIS_MAKE_GENERATED_STRING("prefetcht1"), + ZYDIS_MAKE_GENERATED_STRING("prefetcht2"), + ZYDIS_MAKE_GENERATED_STRING("prefetchw"), + ZYDIS_MAKE_GENERATED_STRING("prefetchwt1"), + ZYDIS_MAKE_GENERATED_STRING("psadbw"), + ZYDIS_MAKE_GENERATED_STRING("pshufb"), + ZYDIS_MAKE_GENERATED_STRING("pshufd"), + ZYDIS_MAKE_GENERATED_STRING("pshufhw"), + ZYDIS_MAKE_GENERATED_STRING("pshuflw"), + ZYDIS_MAKE_GENERATED_STRING("pshufw"), + ZYDIS_MAKE_GENERATED_STRING("psignb"), + ZYDIS_MAKE_GENERATED_STRING("psignd"), + ZYDIS_MAKE_GENERATED_STRING("psignw"), + ZYDIS_MAKE_GENERATED_STRING("pslld"), + ZYDIS_MAKE_GENERATED_STRING("pslldq"), + ZYDIS_MAKE_GENERATED_STRING("psllq"), + ZYDIS_MAKE_GENERATED_STRING("psllw"), + ZYDIS_MAKE_GENERATED_STRING("psrad"), + ZYDIS_MAKE_GENERATED_STRING("psraw"), + ZYDIS_MAKE_GENERATED_STRING("psrld"), + ZYDIS_MAKE_GENERATED_STRING("psrldq"), + ZYDIS_MAKE_GENERATED_STRING("psrlq"), + ZYDIS_MAKE_GENERATED_STRING("psrlw"), + ZYDIS_MAKE_GENERATED_STRING("psubb"), + ZYDIS_MAKE_GENERATED_STRING("psubd"), + ZYDIS_MAKE_GENERATED_STRING("psubq"), + ZYDIS_MAKE_GENERATED_STRING("psubsb"), + ZYDIS_MAKE_GENERATED_STRING("psubsw"), + ZYDIS_MAKE_GENERATED_STRING("psubusb"), + ZYDIS_MAKE_GENERATED_STRING("psubusw"), + ZYDIS_MAKE_GENERATED_STRING("psubw"), + ZYDIS_MAKE_GENERATED_STRING("pswapd"), + ZYDIS_MAKE_GENERATED_STRING("ptest"), + ZYDIS_MAKE_GENERATED_STRING("ptwrite"), + ZYDIS_MAKE_GENERATED_STRING("punpckhbw"), + ZYDIS_MAKE_GENERATED_STRING("punpckhdq"), + ZYDIS_MAKE_GENERATED_STRING("punpckhqdq"), + ZYDIS_MAKE_GENERATED_STRING("punpckhwd"), + ZYDIS_MAKE_GENERATED_STRING("punpcklbw"), + ZYDIS_MAKE_GENERATED_STRING("punpckldq"), + ZYDIS_MAKE_GENERATED_STRING("punpcklqdq"), + ZYDIS_MAKE_GENERATED_STRING("punpcklwd"), + ZYDIS_MAKE_GENERATED_STRING("push"), + ZYDIS_MAKE_GENERATED_STRING("pusha"), + ZYDIS_MAKE_GENERATED_STRING("pushad"), + ZYDIS_MAKE_GENERATED_STRING("pushf"), + ZYDIS_MAKE_GENERATED_STRING("pushfd"), + ZYDIS_MAKE_GENERATED_STRING("pushfq"), + ZYDIS_MAKE_GENERATED_STRING("pxor"), + ZYDIS_MAKE_GENERATED_STRING("rcl"), + ZYDIS_MAKE_GENERATED_STRING("rcpps"), + ZYDIS_MAKE_GENERATED_STRING("rcpss"), + ZYDIS_MAKE_GENERATED_STRING("rcr"), + ZYDIS_MAKE_GENERATED_STRING("rdfsbase"), + ZYDIS_MAKE_GENERATED_STRING("rdgsbase"), + ZYDIS_MAKE_GENERATED_STRING("rdmsr"), + ZYDIS_MAKE_GENERATED_STRING("rdpid"), + ZYDIS_MAKE_GENERATED_STRING("rdpkru"), + ZYDIS_MAKE_GENERATED_STRING("rdpmc"), + ZYDIS_MAKE_GENERATED_STRING("rdrand"), + ZYDIS_MAKE_GENERATED_STRING("rdseed"), + ZYDIS_MAKE_GENERATED_STRING("rdsspd"), + ZYDIS_MAKE_GENERATED_STRING("rdsspq"), + ZYDIS_MAKE_GENERATED_STRING("rdtsc"), + ZYDIS_MAKE_GENERATED_STRING("rdtscp"), + ZYDIS_MAKE_GENERATED_STRING("ret"), + ZYDIS_MAKE_GENERATED_STRING("rol"), + ZYDIS_MAKE_GENERATED_STRING("ror"), + ZYDIS_MAKE_GENERATED_STRING("rorx"), + ZYDIS_MAKE_GENERATED_STRING("roundpd"), + ZYDIS_MAKE_GENERATED_STRING("roundps"), + ZYDIS_MAKE_GENERATED_STRING("roundsd"), + ZYDIS_MAKE_GENERATED_STRING("roundss"), + ZYDIS_MAKE_GENERATED_STRING("rsm"), + ZYDIS_MAKE_GENERATED_STRING("rsqrtps"), + ZYDIS_MAKE_GENERATED_STRING("rsqrtss"), + ZYDIS_MAKE_GENERATED_STRING("rstorssp"), + ZYDIS_MAKE_GENERATED_STRING("sahf"), + ZYDIS_MAKE_GENERATED_STRING("salc"), + ZYDIS_MAKE_GENERATED_STRING("sar"), + ZYDIS_MAKE_GENERATED_STRING("sarx"), + ZYDIS_MAKE_GENERATED_STRING("savessp"), + ZYDIS_MAKE_GENERATED_STRING("sbb"), + ZYDIS_MAKE_GENERATED_STRING("scasb"), + ZYDIS_MAKE_GENERATED_STRING("scasd"), + ZYDIS_MAKE_GENERATED_STRING("scasq"), + ZYDIS_MAKE_GENERATED_STRING("scasw"), + ZYDIS_MAKE_GENERATED_STRING("setb"), + ZYDIS_MAKE_GENERATED_STRING("setbe"), + ZYDIS_MAKE_GENERATED_STRING("setl"), + ZYDIS_MAKE_GENERATED_STRING("setle"), + ZYDIS_MAKE_GENERATED_STRING("setnb"), + ZYDIS_MAKE_GENERATED_STRING("setnbe"), + ZYDIS_MAKE_GENERATED_STRING("setnl"), + ZYDIS_MAKE_GENERATED_STRING("setnle"), + ZYDIS_MAKE_GENERATED_STRING("setno"), + ZYDIS_MAKE_GENERATED_STRING("setnp"), + ZYDIS_MAKE_GENERATED_STRING("setns"), + ZYDIS_MAKE_GENERATED_STRING("setnz"), + ZYDIS_MAKE_GENERATED_STRING("seto"), + ZYDIS_MAKE_GENERATED_STRING("setp"), + ZYDIS_MAKE_GENERATED_STRING("sets"), + ZYDIS_MAKE_GENERATED_STRING("setssbsy"), + ZYDIS_MAKE_GENERATED_STRING("setz"), + ZYDIS_MAKE_GENERATED_STRING("sfence"), + ZYDIS_MAKE_GENERATED_STRING("sgdt"), + ZYDIS_MAKE_GENERATED_STRING("sha1msg1"), + ZYDIS_MAKE_GENERATED_STRING("sha1msg2"), + ZYDIS_MAKE_GENERATED_STRING("sha1nexte"), + ZYDIS_MAKE_GENERATED_STRING("sha1rnds4"), + ZYDIS_MAKE_GENERATED_STRING("sha256msg1"), + ZYDIS_MAKE_GENERATED_STRING("sha256msg2"), + ZYDIS_MAKE_GENERATED_STRING("sha256rnds2"), + ZYDIS_MAKE_GENERATED_STRING("shl"), + ZYDIS_MAKE_GENERATED_STRING("shld"), + ZYDIS_MAKE_GENERATED_STRING("shlx"), + ZYDIS_MAKE_GENERATED_STRING("shr"), + ZYDIS_MAKE_GENERATED_STRING("shrd"), + ZYDIS_MAKE_GENERATED_STRING("shrx"), + ZYDIS_MAKE_GENERATED_STRING("shufpd"), + ZYDIS_MAKE_GENERATED_STRING("shufps"), + ZYDIS_MAKE_GENERATED_STRING("sidt"), + ZYDIS_MAKE_GENERATED_STRING("skinit"), + ZYDIS_MAKE_GENERATED_STRING("sldt"), + ZYDIS_MAKE_GENERATED_STRING("slwpcb"), + ZYDIS_MAKE_GENERATED_STRING("smsw"), + ZYDIS_MAKE_GENERATED_STRING("spflt"), + ZYDIS_MAKE_GENERATED_STRING("sqrtpd"), + ZYDIS_MAKE_GENERATED_STRING("sqrtps"), + ZYDIS_MAKE_GENERATED_STRING("sqrtsd"), + ZYDIS_MAKE_GENERATED_STRING("sqrtss"), + ZYDIS_MAKE_GENERATED_STRING("stac"), + ZYDIS_MAKE_GENERATED_STRING("stc"), + ZYDIS_MAKE_GENERATED_STRING("std"), + ZYDIS_MAKE_GENERATED_STRING("stgi"), + ZYDIS_MAKE_GENERATED_STRING("sti"), + ZYDIS_MAKE_GENERATED_STRING("stmxcsr"), + ZYDIS_MAKE_GENERATED_STRING("stosb"), + ZYDIS_MAKE_GENERATED_STRING("stosd"), + ZYDIS_MAKE_GENERATED_STRING("stosq"), + ZYDIS_MAKE_GENERATED_STRING("stosw"), + ZYDIS_MAKE_GENERATED_STRING("str"), + ZYDIS_MAKE_GENERATED_STRING("sub"), + ZYDIS_MAKE_GENERATED_STRING("subpd"), + ZYDIS_MAKE_GENERATED_STRING("subps"), + ZYDIS_MAKE_GENERATED_STRING("subsd"), + ZYDIS_MAKE_GENERATED_STRING("subss"), + ZYDIS_MAKE_GENERATED_STRING("swapgs"), + ZYDIS_MAKE_GENERATED_STRING("syscall"), + ZYDIS_MAKE_GENERATED_STRING("sysenter"), + ZYDIS_MAKE_GENERATED_STRING("sysexit"), + ZYDIS_MAKE_GENERATED_STRING("sysret"), + ZYDIS_MAKE_GENERATED_STRING("t1mskc"), + ZYDIS_MAKE_GENERATED_STRING("test"), + ZYDIS_MAKE_GENERATED_STRING("tzcnt"), + ZYDIS_MAKE_GENERATED_STRING("tzcnti"), + ZYDIS_MAKE_GENERATED_STRING("tzmsk"), + ZYDIS_MAKE_GENERATED_STRING("ucomisd"), + ZYDIS_MAKE_GENERATED_STRING("ucomiss"), + ZYDIS_MAKE_GENERATED_STRING("ud0"), + ZYDIS_MAKE_GENERATED_STRING("ud1"), + ZYDIS_MAKE_GENERATED_STRING("ud2"), + ZYDIS_MAKE_GENERATED_STRING("unpckhpd"), + ZYDIS_MAKE_GENERATED_STRING("unpckhps"), + ZYDIS_MAKE_GENERATED_STRING("unpcklpd"), + ZYDIS_MAKE_GENERATED_STRING("unpcklps"), + ZYDIS_MAKE_GENERATED_STRING("v4fmaddps"), + ZYDIS_MAKE_GENERATED_STRING("v4fmaddss"), + ZYDIS_MAKE_GENERATED_STRING("v4fnmaddps"), + ZYDIS_MAKE_GENERATED_STRING("v4fnmaddss"), + ZYDIS_MAKE_GENERATED_STRING("vaddnpd"), + ZYDIS_MAKE_GENERATED_STRING("vaddnps"), + ZYDIS_MAKE_GENERATED_STRING("vaddpd"), + ZYDIS_MAKE_GENERATED_STRING("vaddps"), + ZYDIS_MAKE_GENERATED_STRING("vaddsd"), + ZYDIS_MAKE_GENERATED_STRING("vaddsetsps"), + ZYDIS_MAKE_GENERATED_STRING("vaddss"), + ZYDIS_MAKE_GENERATED_STRING("vaddsubpd"), + ZYDIS_MAKE_GENERATED_STRING("vaddsubps"), + ZYDIS_MAKE_GENERATED_STRING("vaesdec"), + ZYDIS_MAKE_GENERATED_STRING("vaesdeclast"), + ZYDIS_MAKE_GENERATED_STRING("vaesenc"), + ZYDIS_MAKE_GENERATED_STRING("vaesenclast"), + ZYDIS_MAKE_GENERATED_STRING("vaesimc"), + ZYDIS_MAKE_GENERATED_STRING("vaeskeygenassist"), + ZYDIS_MAKE_GENERATED_STRING("valignd"), + ZYDIS_MAKE_GENERATED_STRING("valignq"), + ZYDIS_MAKE_GENERATED_STRING("vandnpd"), + ZYDIS_MAKE_GENERATED_STRING("vandnps"), + ZYDIS_MAKE_GENERATED_STRING("vandpd"), + ZYDIS_MAKE_GENERATED_STRING("vandps"), + ZYDIS_MAKE_GENERATED_STRING("vblendmpd"), + ZYDIS_MAKE_GENERATED_STRING("vblendmps"), + ZYDIS_MAKE_GENERATED_STRING("vblendpd"), + ZYDIS_MAKE_GENERATED_STRING("vblendps"), + ZYDIS_MAKE_GENERATED_STRING("vblendvpd"), + ZYDIS_MAKE_GENERATED_STRING("vblendvps"), + ZYDIS_MAKE_GENERATED_STRING("vbroadcastf128"), + ZYDIS_MAKE_GENERATED_STRING("vbroadcastf32x2"), + ZYDIS_MAKE_GENERATED_STRING("vbroadcastf32x4"), + ZYDIS_MAKE_GENERATED_STRING("vbroadcastf32x8"), + ZYDIS_MAKE_GENERATED_STRING("vbroadcastf64x2"), + ZYDIS_MAKE_GENERATED_STRING("vbroadcastf64x4"), + ZYDIS_MAKE_GENERATED_STRING("vbroadcasti128"), + ZYDIS_MAKE_GENERATED_STRING("vbroadcasti32x2"), + ZYDIS_MAKE_GENERATED_STRING("vbroadcasti32x4"), + ZYDIS_MAKE_GENERATED_STRING("vbroadcasti32x8"), + ZYDIS_MAKE_GENERATED_STRING("vbroadcasti64x2"), + ZYDIS_MAKE_GENERATED_STRING("vbroadcasti64x4"), + ZYDIS_MAKE_GENERATED_STRING("vbroadcastsd"), + ZYDIS_MAKE_GENERATED_STRING("vbroadcastss"), + ZYDIS_MAKE_GENERATED_STRING("vcmppd"), + ZYDIS_MAKE_GENERATED_STRING("vcmpps"), + ZYDIS_MAKE_GENERATED_STRING("vcmpsd"), + ZYDIS_MAKE_GENERATED_STRING("vcmpss"), + ZYDIS_MAKE_GENERATED_STRING("vcomisd"), + ZYDIS_MAKE_GENERATED_STRING("vcomiss"), + ZYDIS_MAKE_GENERATED_STRING("vcompresspd"), + ZYDIS_MAKE_GENERATED_STRING("vcompressps"), + ZYDIS_MAKE_GENERATED_STRING("vcvtdq2pd"), + ZYDIS_MAKE_GENERATED_STRING("vcvtdq2ps"), + ZYDIS_MAKE_GENERATED_STRING("vcvtfxpntdq2ps"), + ZYDIS_MAKE_GENERATED_STRING("vcvtfxpntpd2dq"), + ZYDIS_MAKE_GENERATED_STRING("vcvtfxpntpd2udq"), + ZYDIS_MAKE_GENERATED_STRING("vcvtfxpntps2dq"), + ZYDIS_MAKE_GENERATED_STRING("vcvtfxpntps2udq"), + ZYDIS_MAKE_GENERATED_STRING("vcvtfxpntudq2ps"), + ZYDIS_MAKE_GENERATED_STRING("vcvtpd2dq"), + ZYDIS_MAKE_GENERATED_STRING("vcvtpd2ps"), + ZYDIS_MAKE_GENERATED_STRING("vcvtpd2qq"), + ZYDIS_MAKE_GENERATED_STRING("vcvtpd2udq"), + ZYDIS_MAKE_GENERATED_STRING("vcvtpd2uqq"), + ZYDIS_MAKE_GENERATED_STRING("vcvtph2ps"), + ZYDIS_MAKE_GENERATED_STRING("vcvtps2dq"), + ZYDIS_MAKE_GENERATED_STRING("vcvtps2pd"), + ZYDIS_MAKE_GENERATED_STRING("vcvtps2ph"), + ZYDIS_MAKE_GENERATED_STRING("vcvtps2qq"), + ZYDIS_MAKE_GENERATED_STRING("vcvtps2udq"), + ZYDIS_MAKE_GENERATED_STRING("vcvtps2uqq"), + ZYDIS_MAKE_GENERATED_STRING("vcvtqq2pd"), + ZYDIS_MAKE_GENERATED_STRING("vcvtqq2ps"), + ZYDIS_MAKE_GENERATED_STRING("vcvtsd2si"), + ZYDIS_MAKE_GENERATED_STRING("vcvtsd2ss"), + ZYDIS_MAKE_GENERATED_STRING("vcvtsd2usi"), + ZYDIS_MAKE_GENERATED_STRING("vcvtsi2sd"), + ZYDIS_MAKE_GENERATED_STRING("vcvtsi2ss"), + ZYDIS_MAKE_GENERATED_STRING("vcvtss2sd"), + ZYDIS_MAKE_GENERATED_STRING("vcvtss2si"), + ZYDIS_MAKE_GENERATED_STRING("vcvtss2usi"), + ZYDIS_MAKE_GENERATED_STRING("vcvttpd2dq"), + ZYDIS_MAKE_GENERATED_STRING("vcvttpd2qq"), + ZYDIS_MAKE_GENERATED_STRING("vcvttpd2udq"), + ZYDIS_MAKE_GENERATED_STRING("vcvttpd2uqq"), + ZYDIS_MAKE_GENERATED_STRING("vcvttps2dq"), + ZYDIS_MAKE_GENERATED_STRING("vcvttps2qq"), + ZYDIS_MAKE_GENERATED_STRING("vcvttps2udq"), + ZYDIS_MAKE_GENERATED_STRING("vcvttps2uqq"), + ZYDIS_MAKE_GENERATED_STRING("vcvttsd2si"), + ZYDIS_MAKE_GENERATED_STRING("vcvttsd2usi"), + ZYDIS_MAKE_GENERATED_STRING("vcvttss2si"), + ZYDIS_MAKE_GENERATED_STRING("vcvttss2usi"), + ZYDIS_MAKE_GENERATED_STRING("vcvtudq2pd"), + ZYDIS_MAKE_GENERATED_STRING("vcvtudq2ps"), + ZYDIS_MAKE_GENERATED_STRING("vcvtuqq2pd"), + ZYDIS_MAKE_GENERATED_STRING("vcvtuqq2ps"), + ZYDIS_MAKE_GENERATED_STRING("vcvtusi2sd"), + ZYDIS_MAKE_GENERATED_STRING("vcvtusi2ss"), + ZYDIS_MAKE_GENERATED_STRING("vdbpsadbw"), + ZYDIS_MAKE_GENERATED_STRING("vdivpd"), + ZYDIS_MAKE_GENERATED_STRING("vdivps"), + ZYDIS_MAKE_GENERATED_STRING("vdivsd"), + ZYDIS_MAKE_GENERATED_STRING("vdivss"), + ZYDIS_MAKE_GENERATED_STRING("vdppd"), + ZYDIS_MAKE_GENERATED_STRING("vdpps"), + ZYDIS_MAKE_GENERATED_STRING("verr"), + ZYDIS_MAKE_GENERATED_STRING("verw"), + ZYDIS_MAKE_GENERATED_STRING("vexp223ps"), + ZYDIS_MAKE_GENERATED_STRING("vexp2pd"), + ZYDIS_MAKE_GENERATED_STRING("vexp2ps"), + ZYDIS_MAKE_GENERATED_STRING("vexpandpd"), + ZYDIS_MAKE_GENERATED_STRING("vexpandps"), + ZYDIS_MAKE_GENERATED_STRING("vextractf128"), + ZYDIS_MAKE_GENERATED_STRING("vextractf32x4"), + ZYDIS_MAKE_GENERATED_STRING("vextractf32x8"), + ZYDIS_MAKE_GENERATED_STRING("vextractf64x2"), + ZYDIS_MAKE_GENERATED_STRING("vextractf64x4"), + ZYDIS_MAKE_GENERATED_STRING("vextracti128"), + ZYDIS_MAKE_GENERATED_STRING("vextracti32x4"), + ZYDIS_MAKE_GENERATED_STRING("vextracti32x8"), + ZYDIS_MAKE_GENERATED_STRING("vextracti64x2"), + ZYDIS_MAKE_GENERATED_STRING("vextracti64x4"), + ZYDIS_MAKE_GENERATED_STRING("vextractps"), + ZYDIS_MAKE_GENERATED_STRING("vfixupimmpd"), + ZYDIS_MAKE_GENERATED_STRING("vfixupimmps"), + ZYDIS_MAKE_GENERATED_STRING("vfixupimmsd"), + ZYDIS_MAKE_GENERATED_STRING("vfixupimmss"), + ZYDIS_MAKE_GENERATED_STRING("vfixupnanpd"), + ZYDIS_MAKE_GENERATED_STRING("vfixupnanps"), + ZYDIS_MAKE_GENERATED_STRING("vfmadd132pd"), + ZYDIS_MAKE_GENERATED_STRING("vfmadd132ps"), + ZYDIS_MAKE_GENERATED_STRING("vfmadd132sd"), + ZYDIS_MAKE_GENERATED_STRING("vfmadd132ss"), + ZYDIS_MAKE_GENERATED_STRING("vfmadd213pd"), + ZYDIS_MAKE_GENERATED_STRING("vfmadd213ps"), + ZYDIS_MAKE_GENERATED_STRING("vfmadd213sd"), + ZYDIS_MAKE_GENERATED_STRING("vfmadd213ss"), + ZYDIS_MAKE_GENERATED_STRING("vfmadd231pd"), + ZYDIS_MAKE_GENERATED_STRING("vfmadd231ps"), + ZYDIS_MAKE_GENERATED_STRING("vfmadd231sd"), + ZYDIS_MAKE_GENERATED_STRING("vfmadd231ss"), + ZYDIS_MAKE_GENERATED_STRING("vfmadd233ps"), + ZYDIS_MAKE_GENERATED_STRING("vfmaddpd"), + ZYDIS_MAKE_GENERATED_STRING("vfmaddps"), + ZYDIS_MAKE_GENERATED_STRING("vfmaddsd"), + ZYDIS_MAKE_GENERATED_STRING("vfmaddss"), + ZYDIS_MAKE_GENERATED_STRING("vfmaddsub132pd"), + ZYDIS_MAKE_GENERATED_STRING("vfmaddsub132ps"), + ZYDIS_MAKE_GENERATED_STRING("vfmaddsub213pd"), + ZYDIS_MAKE_GENERATED_STRING("vfmaddsub213ps"), + ZYDIS_MAKE_GENERATED_STRING("vfmaddsub231pd"), + ZYDIS_MAKE_GENERATED_STRING("vfmaddsub231ps"), + ZYDIS_MAKE_GENERATED_STRING("vfmaddsubpd"), + ZYDIS_MAKE_GENERATED_STRING("vfmaddsubps"), + ZYDIS_MAKE_GENERATED_STRING("vfmsub132pd"), + ZYDIS_MAKE_GENERATED_STRING("vfmsub132ps"), + ZYDIS_MAKE_GENERATED_STRING("vfmsub132sd"), + ZYDIS_MAKE_GENERATED_STRING("vfmsub132ss"), + ZYDIS_MAKE_GENERATED_STRING("vfmsub213pd"), + ZYDIS_MAKE_GENERATED_STRING("vfmsub213ps"), + ZYDIS_MAKE_GENERATED_STRING("vfmsub213sd"), + ZYDIS_MAKE_GENERATED_STRING("vfmsub213ss"), + ZYDIS_MAKE_GENERATED_STRING("vfmsub231pd"), + ZYDIS_MAKE_GENERATED_STRING("vfmsub231ps"), + ZYDIS_MAKE_GENERATED_STRING("vfmsub231sd"), + ZYDIS_MAKE_GENERATED_STRING("vfmsub231ss"), + ZYDIS_MAKE_GENERATED_STRING("vfmsubadd132pd"), + ZYDIS_MAKE_GENERATED_STRING("vfmsubadd132ps"), + ZYDIS_MAKE_GENERATED_STRING("vfmsubadd213pd"), + ZYDIS_MAKE_GENERATED_STRING("vfmsubadd213ps"), + ZYDIS_MAKE_GENERATED_STRING("vfmsubadd231pd"), + ZYDIS_MAKE_GENERATED_STRING("vfmsubadd231ps"), + ZYDIS_MAKE_GENERATED_STRING("vfmsubaddpd"), + ZYDIS_MAKE_GENERATED_STRING("vfmsubaddps"), + ZYDIS_MAKE_GENERATED_STRING("vfmsubpd"), + ZYDIS_MAKE_GENERATED_STRING("vfmsubps"), + ZYDIS_MAKE_GENERATED_STRING("vfmsubsd"), + ZYDIS_MAKE_GENERATED_STRING("vfmsubss"), + ZYDIS_MAKE_GENERATED_STRING("vfnmadd132pd"), + ZYDIS_MAKE_GENERATED_STRING("vfnmadd132ps"), + ZYDIS_MAKE_GENERATED_STRING("vfnmadd132sd"), + ZYDIS_MAKE_GENERATED_STRING("vfnmadd132ss"), + ZYDIS_MAKE_GENERATED_STRING("vfnmadd213pd"), + ZYDIS_MAKE_GENERATED_STRING("vfnmadd213ps"), + ZYDIS_MAKE_GENERATED_STRING("vfnmadd213sd"), + ZYDIS_MAKE_GENERATED_STRING("vfnmadd213ss"), + ZYDIS_MAKE_GENERATED_STRING("vfnmadd231pd"), + ZYDIS_MAKE_GENERATED_STRING("vfnmadd231ps"), + ZYDIS_MAKE_GENERATED_STRING("vfnmadd231sd"), + ZYDIS_MAKE_GENERATED_STRING("vfnmadd231ss"), + ZYDIS_MAKE_GENERATED_STRING("vfnmaddpd"), + ZYDIS_MAKE_GENERATED_STRING("vfnmaddps"), + ZYDIS_MAKE_GENERATED_STRING("vfnmaddsd"), + ZYDIS_MAKE_GENERATED_STRING("vfnmaddss"), + ZYDIS_MAKE_GENERATED_STRING("vfnmsub132pd"), + ZYDIS_MAKE_GENERATED_STRING("vfnmsub132ps"), + ZYDIS_MAKE_GENERATED_STRING("vfnmsub132sd"), + ZYDIS_MAKE_GENERATED_STRING("vfnmsub132ss"), + ZYDIS_MAKE_GENERATED_STRING("vfnmsub213pd"), + ZYDIS_MAKE_GENERATED_STRING("vfnmsub213ps"), + ZYDIS_MAKE_GENERATED_STRING("vfnmsub213sd"), + ZYDIS_MAKE_GENERATED_STRING("vfnmsub213ss"), + ZYDIS_MAKE_GENERATED_STRING("vfnmsub231pd"), + ZYDIS_MAKE_GENERATED_STRING("vfnmsub231ps"), + ZYDIS_MAKE_GENERATED_STRING("vfnmsub231sd"), + ZYDIS_MAKE_GENERATED_STRING("vfnmsub231ss"), + ZYDIS_MAKE_GENERATED_STRING("vfnmsubpd"), + ZYDIS_MAKE_GENERATED_STRING("vfnmsubps"), + ZYDIS_MAKE_GENERATED_STRING("vfnmsubsd"), + ZYDIS_MAKE_GENERATED_STRING("vfnmsubss"), + ZYDIS_MAKE_GENERATED_STRING("vfpclasspd"), + ZYDIS_MAKE_GENERATED_STRING("vfpclassps"), + ZYDIS_MAKE_GENERATED_STRING("vfpclasssd"), + ZYDIS_MAKE_GENERATED_STRING("vfpclassss"), + ZYDIS_MAKE_GENERATED_STRING("vfrczpd"), + ZYDIS_MAKE_GENERATED_STRING("vfrczps"), + ZYDIS_MAKE_GENERATED_STRING("vfrczsd"), + ZYDIS_MAKE_GENERATED_STRING("vfrczss"), + ZYDIS_MAKE_GENERATED_STRING("vgatherdpd"), + ZYDIS_MAKE_GENERATED_STRING("vgatherdps"), + ZYDIS_MAKE_GENERATED_STRING("vgatherpf0dpd"), + ZYDIS_MAKE_GENERATED_STRING("vgatherpf0dps"), + ZYDIS_MAKE_GENERATED_STRING("vgatherpf0hintdpd"), + ZYDIS_MAKE_GENERATED_STRING("vgatherpf0hintdps"), + ZYDIS_MAKE_GENERATED_STRING("vgatherpf0qpd"), + ZYDIS_MAKE_GENERATED_STRING("vgatherpf0qps"), + ZYDIS_MAKE_GENERATED_STRING("vgatherpf1dpd"), + ZYDIS_MAKE_GENERATED_STRING("vgatherpf1dps"), + ZYDIS_MAKE_GENERATED_STRING("vgatherpf1qpd"), + ZYDIS_MAKE_GENERATED_STRING("vgatherpf1qps"), + ZYDIS_MAKE_GENERATED_STRING("vgatherqpd"), + ZYDIS_MAKE_GENERATED_STRING("vgatherqps"), + ZYDIS_MAKE_GENERATED_STRING("vgetexppd"), + ZYDIS_MAKE_GENERATED_STRING("vgetexpps"), + ZYDIS_MAKE_GENERATED_STRING("vgetexpsd"), + ZYDIS_MAKE_GENERATED_STRING("vgetexpss"), + ZYDIS_MAKE_GENERATED_STRING("vgetmantpd"), + ZYDIS_MAKE_GENERATED_STRING("vgetmantps"), + ZYDIS_MAKE_GENERATED_STRING("vgetmantsd"), + ZYDIS_MAKE_GENERATED_STRING("vgetmantss"), + ZYDIS_MAKE_GENERATED_STRING("vgf2p8affineinvqb"), + ZYDIS_MAKE_GENERATED_STRING("vgf2p8affineqb"), + ZYDIS_MAKE_GENERATED_STRING("vgf2p8mulb"), + ZYDIS_MAKE_GENERATED_STRING("vgmaxabsps"), + ZYDIS_MAKE_GENERATED_STRING("vgmaxpd"), + ZYDIS_MAKE_GENERATED_STRING("vgmaxps"), + ZYDIS_MAKE_GENERATED_STRING("vgminpd"), + ZYDIS_MAKE_GENERATED_STRING("vgminps"), + ZYDIS_MAKE_GENERATED_STRING("vhaddpd"), + ZYDIS_MAKE_GENERATED_STRING("vhaddps"), + ZYDIS_MAKE_GENERATED_STRING("vhsubpd"), + ZYDIS_MAKE_GENERATED_STRING("vhsubps"), + ZYDIS_MAKE_GENERATED_STRING("vinsertf128"), + ZYDIS_MAKE_GENERATED_STRING("vinsertf32x4"), + ZYDIS_MAKE_GENERATED_STRING("vinsertf32x8"), + ZYDIS_MAKE_GENERATED_STRING("vinsertf64x2"), + ZYDIS_MAKE_GENERATED_STRING("vinsertf64x4"), + ZYDIS_MAKE_GENERATED_STRING("vinserti128"), + ZYDIS_MAKE_GENERATED_STRING("vinserti32x4"), + ZYDIS_MAKE_GENERATED_STRING("vinserti32x8"), + ZYDIS_MAKE_GENERATED_STRING("vinserti64x2"), + ZYDIS_MAKE_GENERATED_STRING("vinserti64x4"), + ZYDIS_MAKE_GENERATED_STRING("vinsertps"), + ZYDIS_MAKE_GENERATED_STRING("vlddqu"), + ZYDIS_MAKE_GENERATED_STRING("vldmxcsr"), + ZYDIS_MAKE_GENERATED_STRING("vloadunpackhd"), + ZYDIS_MAKE_GENERATED_STRING("vloadunpackhpd"), + ZYDIS_MAKE_GENERATED_STRING("vloadunpackhps"), + ZYDIS_MAKE_GENERATED_STRING("vloadunpackhq"), + ZYDIS_MAKE_GENERATED_STRING("vloadunpackld"), + ZYDIS_MAKE_GENERATED_STRING("vloadunpacklpd"), + ZYDIS_MAKE_GENERATED_STRING("vloadunpacklps"), + ZYDIS_MAKE_GENERATED_STRING("vloadunpacklq"), + ZYDIS_MAKE_GENERATED_STRING("vlog2ps"), + ZYDIS_MAKE_GENERATED_STRING("vmaskmovdqu"), + ZYDIS_MAKE_GENERATED_STRING("vmaskmovpd"), + ZYDIS_MAKE_GENERATED_STRING("vmaskmovps"), + ZYDIS_MAKE_GENERATED_STRING("vmaxpd"), + ZYDIS_MAKE_GENERATED_STRING("vmaxps"), + ZYDIS_MAKE_GENERATED_STRING("vmaxsd"), + ZYDIS_MAKE_GENERATED_STRING("vmaxss"), + ZYDIS_MAKE_GENERATED_STRING("vmcall"), + ZYDIS_MAKE_GENERATED_STRING("vmclear"), + ZYDIS_MAKE_GENERATED_STRING("vmfunc"), + ZYDIS_MAKE_GENERATED_STRING("vminpd"), + ZYDIS_MAKE_GENERATED_STRING("vminps"), + ZYDIS_MAKE_GENERATED_STRING("vminsd"), + ZYDIS_MAKE_GENERATED_STRING("vminss"), + ZYDIS_MAKE_GENERATED_STRING("vmlaunch"), + ZYDIS_MAKE_GENERATED_STRING("vmload"), + ZYDIS_MAKE_GENERATED_STRING("vmmcall"), + ZYDIS_MAKE_GENERATED_STRING("vmovapd"), + ZYDIS_MAKE_GENERATED_STRING("vmovaps"), + ZYDIS_MAKE_GENERATED_STRING("vmovd"), + ZYDIS_MAKE_GENERATED_STRING("vmovddup"), + ZYDIS_MAKE_GENERATED_STRING("vmovdqa"), + ZYDIS_MAKE_GENERATED_STRING("vmovdqa32"), + ZYDIS_MAKE_GENERATED_STRING("vmovdqa64"), + ZYDIS_MAKE_GENERATED_STRING("vmovdqu"), + ZYDIS_MAKE_GENERATED_STRING("vmovdqu16"), + ZYDIS_MAKE_GENERATED_STRING("vmovdqu32"), + ZYDIS_MAKE_GENERATED_STRING("vmovdqu64"), + ZYDIS_MAKE_GENERATED_STRING("vmovdqu8"), + ZYDIS_MAKE_GENERATED_STRING("vmovhlps"), + ZYDIS_MAKE_GENERATED_STRING("vmovhpd"), + ZYDIS_MAKE_GENERATED_STRING("vmovhps"), + ZYDIS_MAKE_GENERATED_STRING("vmovlhps"), + ZYDIS_MAKE_GENERATED_STRING("vmovlpd"), + ZYDIS_MAKE_GENERATED_STRING("vmovlps"), + ZYDIS_MAKE_GENERATED_STRING("vmovmskpd"), + ZYDIS_MAKE_GENERATED_STRING("vmovmskps"), + ZYDIS_MAKE_GENERATED_STRING("vmovnrapd"), + ZYDIS_MAKE_GENERATED_STRING("vmovnraps"), + ZYDIS_MAKE_GENERATED_STRING("vmovnrngoapd"), + ZYDIS_MAKE_GENERATED_STRING("vmovnrngoaps"), + ZYDIS_MAKE_GENERATED_STRING("vmovntdq"), + ZYDIS_MAKE_GENERATED_STRING("vmovntdqa"), + ZYDIS_MAKE_GENERATED_STRING("vmovntpd"), + ZYDIS_MAKE_GENERATED_STRING("vmovntps"), + ZYDIS_MAKE_GENERATED_STRING("vmovq"), + ZYDIS_MAKE_GENERATED_STRING("vmovsd"), + ZYDIS_MAKE_GENERATED_STRING("vmovshdup"), + ZYDIS_MAKE_GENERATED_STRING("vmovsldup"), + ZYDIS_MAKE_GENERATED_STRING("vmovss"), + ZYDIS_MAKE_GENERATED_STRING("vmovupd"), + ZYDIS_MAKE_GENERATED_STRING("vmovups"), + ZYDIS_MAKE_GENERATED_STRING("vmpsadbw"), + ZYDIS_MAKE_GENERATED_STRING("vmptrld"), + ZYDIS_MAKE_GENERATED_STRING("vmptrst"), + ZYDIS_MAKE_GENERATED_STRING("vmread"), + ZYDIS_MAKE_GENERATED_STRING("vmresume"), + ZYDIS_MAKE_GENERATED_STRING("vmrun"), + ZYDIS_MAKE_GENERATED_STRING("vmsave"), + ZYDIS_MAKE_GENERATED_STRING("vmulpd"), + ZYDIS_MAKE_GENERATED_STRING("vmulps"), + ZYDIS_MAKE_GENERATED_STRING("vmulsd"), + ZYDIS_MAKE_GENERATED_STRING("vmulss"), + ZYDIS_MAKE_GENERATED_STRING("vmwrite"), + ZYDIS_MAKE_GENERATED_STRING("vmxoff"), + ZYDIS_MAKE_GENERATED_STRING("vmxon"), + ZYDIS_MAKE_GENERATED_STRING("vorpd"), + ZYDIS_MAKE_GENERATED_STRING("vorps"), + ZYDIS_MAKE_GENERATED_STRING("vp4dpwssd"), + ZYDIS_MAKE_GENERATED_STRING("vp4dpwssds"), + ZYDIS_MAKE_GENERATED_STRING("vpabsb"), + ZYDIS_MAKE_GENERATED_STRING("vpabsd"), + ZYDIS_MAKE_GENERATED_STRING("vpabsq"), + ZYDIS_MAKE_GENERATED_STRING("vpabsw"), + ZYDIS_MAKE_GENERATED_STRING("vpackssdw"), + ZYDIS_MAKE_GENERATED_STRING("vpacksswb"), + ZYDIS_MAKE_GENERATED_STRING("vpackstorehd"), + ZYDIS_MAKE_GENERATED_STRING("vpackstorehpd"), + ZYDIS_MAKE_GENERATED_STRING("vpackstorehps"), + ZYDIS_MAKE_GENERATED_STRING("vpackstorehq"), + ZYDIS_MAKE_GENERATED_STRING("vpackstoreld"), + ZYDIS_MAKE_GENERATED_STRING("vpackstorelpd"), + ZYDIS_MAKE_GENERATED_STRING("vpackstorelps"), + ZYDIS_MAKE_GENERATED_STRING("vpackstorelq"), + ZYDIS_MAKE_GENERATED_STRING("vpackusdw"), + ZYDIS_MAKE_GENERATED_STRING("vpackuswb"), + ZYDIS_MAKE_GENERATED_STRING("vpadcd"), + ZYDIS_MAKE_GENERATED_STRING("vpaddb"), + ZYDIS_MAKE_GENERATED_STRING("vpaddd"), + ZYDIS_MAKE_GENERATED_STRING("vpaddq"), + ZYDIS_MAKE_GENERATED_STRING("vpaddsb"), + ZYDIS_MAKE_GENERATED_STRING("vpaddsetcd"), + ZYDIS_MAKE_GENERATED_STRING("vpaddsetsd"), + ZYDIS_MAKE_GENERATED_STRING("vpaddsw"), + ZYDIS_MAKE_GENERATED_STRING("vpaddusb"), + ZYDIS_MAKE_GENERATED_STRING("vpaddusw"), + ZYDIS_MAKE_GENERATED_STRING("vpaddw"), + ZYDIS_MAKE_GENERATED_STRING("vpalignr"), + ZYDIS_MAKE_GENERATED_STRING("vpand"), + ZYDIS_MAKE_GENERATED_STRING("vpandd"), + ZYDIS_MAKE_GENERATED_STRING("vpandn"), + ZYDIS_MAKE_GENERATED_STRING("vpandnd"), + ZYDIS_MAKE_GENERATED_STRING("vpandnq"), + ZYDIS_MAKE_GENERATED_STRING("vpandq"), + ZYDIS_MAKE_GENERATED_STRING("vpavgb"), + ZYDIS_MAKE_GENERATED_STRING("vpavgw"), + ZYDIS_MAKE_GENERATED_STRING("vpblendd"), + ZYDIS_MAKE_GENERATED_STRING("vpblendmb"), + ZYDIS_MAKE_GENERATED_STRING("vpblendmd"), + ZYDIS_MAKE_GENERATED_STRING("vpblendmq"), + ZYDIS_MAKE_GENERATED_STRING("vpblendmw"), + ZYDIS_MAKE_GENERATED_STRING("vpblendvb"), + ZYDIS_MAKE_GENERATED_STRING("vpblendw"), + ZYDIS_MAKE_GENERATED_STRING("vpbroadcastb"), + ZYDIS_MAKE_GENERATED_STRING("vpbroadcastd"), + ZYDIS_MAKE_GENERATED_STRING("vpbroadcastmb2q"), + ZYDIS_MAKE_GENERATED_STRING("vpbroadcastmw2d"), + ZYDIS_MAKE_GENERATED_STRING("vpbroadcastq"), + ZYDIS_MAKE_GENERATED_STRING("vpbroadcastw"), + ZYDIS_MAKE_GENERATED_STRING("vpclmulqdq"), + ZYDIS_MAKE_GENERATED_STRING("vpcmov"), + ZYDIS_MAKE_GENERATED_STRING("vpcmpb"), + ZYDIS_MAKE_GENERATED_STRING("vpcmpd"), + ZYDIS_MAKE_GENERATED_STRING("vpcmpeqb"), + ZYDIS_MAKE_GENERATED_STRING("vpcmpeqd"), + ZYDIS_MAKE_GENERATED_STRING("vpcmpeqq"), + ZYDIS_MAKE_GENERATED_STRING("vpcmpeqw"), + ZYDIS_MAKE_GENERATED_STRING("vpcmpestri"), + ZYDIS_MAKE_GENERATED_STRING("vpcmpestrm"), + ZYDIS_MAKE_GENERATED_STRING("vpcmpgtb"), + ZYDIS_MAKE_GENERATED_STRING("vpcmpgtd"), + ZYDIS_MAKE_GENERATED_STRING("vpcmpgtq"), + ZYDIS_MAKE_GENERATED_STRING("vpcmpgtw"), + ZYDIS_MAKE_GENERATED_STRING("vpcmpistri"), + ZYDIS_MAKE_GENERATED_STRING("vpcmpistrm"), + ZYDIS_MAKE_GENERATED_STRING("vpcmpltd"), + ZYDIS_MAKE_GENERATED_STRING("vpcmpq"), + ZYDIS_MAKE_GENERATED_STRING("vpcmpub"), + ZYDIS_MAKE_GENERATED_STRING("vpcmpud"), + ZYDIS_MAKE_GENERATED_STRING("vpcmpuq"), + ZYDIS_MAKE_GENERATED_STRING("vpcmpuw"), + ZYDIS_MAKE_GENERATED_STRING("vpcmpw"), + ZYDIS_MAKE_GENERATED_STRING("vpcomb"), + ZYDIS_MAKE_GENERATED_STRING("vpcomd"), + ZYDIS_MAKE_GENERATED_STRING("vpcompressb"), + ZYDIS_MAKE_GENERATED_STRING("vpcompressd"), + ZYDIS_MAKE_GENERATED_STRING("vpcompressq"), + ZYDIS_MAKE_GENERATED_STRING("vpcompressw"), + ZYDIS_MAKE_GENERATED_STRING("vpcomq"), + ZYDIS_MAKE_GENERATED_STRING("vpcomub"), + ZYDIS_MAKE_GENERATED_STRING("vpcomud"), + ZYDIS_MAKE_GENERATED_STRING("vpcomuq"), + ZYDIS_MAKE_GENERATED_STRING("vpcomuw"), + ZYDIS_MAKE_GENERATED_STRING("vpcomw"), + ZYDIS_MAKE_GENERATED_STRING("vpconflictd"), + ZYDIS_MAKE_GENERATED_STRING("vpconflictq"), + ZYDIS_MAKE_GENERATED_STRING("vpdpbusd"), + ZYDIS_MAKE_GENERATED_STRING("vpdpbusds"), + ZYDIS_MAKE_GENERATED_STRING("vpdpwssd"), + ZYDIS_MAKE_GENERATED_STRING("vpdpwssds"), + ZYDIS_MAKE_GENERATED_STRING("vperm2f128"), + ZYDIS_MAKE_GENERATED_STRING("vperm2i128"), + ZYDIS_MAKE_GENERATED_STRING("vpermb"), + ZYDIS_MAKE_GENERATED_STRING("vpermd"), + ZYDIS_MAKE_GENERATED_STRING("vpermf32x4"), + ZYDIS_MAKE_GENERATED_STRING("vpermi2b"), + ZYDIS_MAKE_GENERATED_STRING("vpermi2d"), + ZYDIS_MAKE_GENERATED_STRING("vpermi2pd"), + ZYDIS_MAKE_GENERATED_STRING("vpermi2ps"), + ZYDIS_MAKE_GENERATED_STRING("vpermi2q"), + ZYDIS_MAKE_GENERATED_STRING("vpermi2w"), + ZYDIS_MAKE_GENERATED_STRING("vpermil2pd"), + ZYDIS_MAKE_GENERATED_STRING("vpermil2ps"), + ZYDIS_MAKE_GENERATED_STRING("vpermilpd"), + ZYDIS_MAKE_GENERATED_STRING("vpermilps"), + ZYDIS_MAKE_GENERATED_STRING("vpermpd"), + ZYDIS_MAKE_GENERATED_STRING("vpermps"), + ZYDIS_MAKE_GENERATED_STRING("vpermq"), + ZYDIS_MAKE_GENERATED_STRING("vpermt2b"), + ZYDIS_MAKE_GENERATED_STRING("vpermt2d"), + ZYDIS_MAKE_GENERATED_STRING("vpermt2pd"), + ZYDIS_MAKE_GENERATED_STRING("vpermt2ps"), + ZYDIS_MAKE_GENERATED_STRING("vpermt2q"), + ZYDIS_MAKE_GENERATED_STRING("vpermt2w"), + ZYDIS_MAKE_GENERATED_STRING("vpermw"), + ZYDIS_MAKE_GENERATED_STRING("vpexpandb"), + ZYDIS_MAKE_GENERATED_STRING("vpexpandd"), + ZYDIS_MAKE_GENERATED_STRING("vpexpandq"), + ZYDIS_MAKE_GENERATED_STRING("vpexpandw"), + ZYDIS_MAKE_GENERATED_STRING("vpextrb"), + ZYDIS_MAKE_GENERATED_STRING("vpextrd"), + ZYDIS_MAKE_GENERATED_STRING("vpextrq"), + ZYDIS_MAKE_GENERATED_STRING("vpextrw"), + ZYDIS_MAKE_GENERATED_STRING("vpgatherdd"), + ZYDIS_MAKE_GENERATED_STRING("vpgatherdq"), + ZYDIS_MAKE_GENERATED_STRING("vpgatherqd"), + ZYDIS_MAKE_GENERATED_STRING("vpgatherqq"), + ZYDIS_MAKE_GENERATED_STRING("vphaddbd"), + ZYDIS_MAKE_GENERATED_STRING("vphaddbq"), + ZYDIS_MAKE_GENERATED_STRING("vphaddbw"), + ZYDIS_MAKE_GENERATED_STRING("vphaddd"), + ZYDIS_MAKE_GENERATED_STRING("vphadddq"), + ZYDIS_MAKE_GENERATED_STRING("vphaddsw"), + ZYDIS_MAKE_GENERATED_STRING("vphaddubd"), + ZYDIS_MAKE_GENERATED_STRING("vphaddubq"), + ZYDIS_MAKE_GENERATED_STRING("vphaddubw"), + ZYDIS_MAKE_GENERATED_STRING("vphaddudq"), + ZYDIS_MAKE_GENERATED_STRING("vphadduwd"), + ZYDIS_MAKE_GENERATED_STRING("vphadduwq"), + ZYDIS_MAKE_GENERATED_STRING("vphaddw"), + ZYDIS_MAKE_GENERATED_STRING("vphaddwd"), + ZYDIS_MAKE_GENERATED_STRING("vphaddwq"), + ZYDIS_MAKE_GENERATED_STRING("vphminposuw"), + ZYDIS_MAKE_GENERATED_STRING("vphsubbw"), + ZYDIS_MAKE_GENERATED_STRING("vphsubd"), + ZYDIS_MAKE_GENERATED_STRING("vphsubdq"), + ZYDIS_MAKE_GENERATED_STRING("vphsubsw"), + ZYDIS_MAKE_GENERATED_STRING("vphsubw"), + ZYDIS_MAKE_GENERATED_STRING("vphsubwd"), + ZYDIS_MAKE_GENERATED_STRING("vpinsrb"), + ZYDIS_MAKE_GENERATED_STRING("vpinsrd"), + ZYDIS_MAKE_GENERATED_STRING("vpinsrq"), + ZYDIS_MAKE_GENERATED_STRING("vpinsrw"), + ZYDIS_MAKE_GENERATED_STRING("vplzcntd"), + ZYDIS_MAKE_GENERATED_STRING("vplzcntq"), + ZYDIS_MAKE_GENERATED_STRING("vpmacsdd"), + ZYDIS_MAKE_GENERATED_STRING("vpmacsdqh"), + ZYDIS_MAKE_GENERATED_STRING("vpmacsdql"), + ZYDIS_MAKE_GENERATED_STRING("vpmacssdd"), + ZYDIS_MAKE_GENERATED_STRING("vpmacssdqh"), + ZYDIS_MAKE_GENERATED_STRING("vpmacssdql"), + ZYDIS_MAKE_GENERATED_STRING("vpmacsswd"), + ZYDIS_MAKE_GENERATED_STRING("vpmacssww"), + ZYDIS_MAKE_GENERATED_STRING("vpmacswd"), + ZYDIS_MAKE_GENERATED_STRING("vpmacsww"), + ZYDIS_MAKE_GENERATED_STRING("vpmadcsswd"), + ZYDIS_MAKE_GENERATED_STRING("vpmadcswd"), + ZYDIS_MAKE_GENERATED_STRING("vpmadd231d"), + ZYDIS_MAKE_GENERATED_STRING("vpmadd233d"), + ZYDIS_MAKE_GENERATED_STRING("vpmadd52huq"), + ZYDIS_MAKE_GENERATED_STRING("vpmadd52luq"), + ZYDIS_MAKE_GENERATED_STRING("vpmaddubsw"), + ZYDIS_MAKE_GENERATED_STRING("vpmaddwd"), + ZYDIS_MAKE_GENERATED_STRING("vpmaskmovd"), + ZYDIS_MAKE_GENERATED_STRING("vpmaskmovq"), + ZYDIS_MAKE_GENERATED_STRING("vpmaxsb"), + ZYDIS_MAKE_GENERATED_STRING("vpmaxsd"), + ZYDIS_MAKE_GENERATED_STRING("vpmaxsq"), + ZYDIS_MAKE_GENERATED_STRING("vpmaxsw"), + ZYDIS_MAKE_GENERATED_STRING("vpmaxub"), + ZYDIS_MAKE_GENERATED_STRING("vpmaxud"), + ZYDIS_MAKE_GENERATED_STRING("vpmaxuq"), + ZYDIS_MAKE_GENERATED_STRING("vpmaxuw"), + ZYDIS_MAKE_GENERATED_STRING("vpminsb"), + ZYDIS_MAKE_GENERATED_STRING("vpminsd"), + ZYDIS_MAKE_GENERATED_STRING("vpminsq"), + ZYDIS_MAKE_GENERATED_STRING("vpminsw"), + ZYDIS_MAKE_GENERATED_STRING("vpminub"), + ZYDIS_MAKE_GENERATED_STRING("vpminud"), + ZYDIS_MAKE_GENERATED_STRING("vpminuq"), + ZYDIS_MAKE_GENERATED_STRING("vpminuw"), + ZYDIS_MAKE_GENERATED_STRING("vpmovb2m"), + ZYDIS_MAKE_GENERATED_STRING("vpmovd2m"), + ZYDIS_MAKE_GENERATED_STRING("vpmovdb"), + ZYDIS_MAKE_GENERATED_STRING("vpmovdw"), + ZYDIS_MAKE_GENERATED_STRING("vpmovm2b"), + ZYDIS_MAKE_GENERATED_STRING("vpmovm2d"), + ZYDIS_MAKE_GENERATED_STRING("vpmovm2q"), + ZYDIS_MAKE_GENERATED_STRING("vpmovm2w"), + ZYDIS_MAKE_GENERATED_STRING("vpmovmskb"), + ZYDIS_MAKE_GENERATED_STRING("vpmovq2m"), + ZYDIS_MAKE_GENERATED_STRING("vpmovqb"), + ZYDIS_MAKE_GENERATED_STRING("vpmovqd"), + ZYDIS_MAKE_GENERATED_STRING("vpmovqw"), + ZYDIS_MAKE_GENERATED_STRING("vpmovsdb"), + ZYDIS_MAKE_GENERATED_STRING("vpmovsdw"), + ZYDIS_MAKE_GENERATED_STRING("vpmovsqb"), + ZYDIS_MAKE_GENERATED_STRING("vpmovsqd"), + ZYDIS_MAKE_GENERATED_STRING("vpmovsqw"), + ZYDIS_MAKE_GENERATED_STRING("vpmovswb"), + ZYDIS_MAKE_GENERATED_STRING("vpmovsxbd"), + ZYDIS_MAKE_GENERATED_STRING("vpmovsxbq"), + ZYDIS_MAKE_GENERATED_STRING("vpmovsxbw"), + ZYDIS_MAKE_GENERATED_STRING("vpmovsxdq"), + ZYDIS_MAKE_GENERATED_STRING("vpmovsxwd"), + ZYDIS_MAKE_GENERATED_STRING("vpmovsxwq"), + ZYDIS_MAKE_GENERATED_STRING("vpmovusdb"), + ZYDIS_MAKE_GENERATED_STRING("vpmovusdw"), + ZYDIS_MAKE_GENERATED_STRING("vpmovusqb"), + ZYDIS_MAKE_GENERATED_STRING("vpmovusqd"), + ZYDIS_MAKE_GENERATED_STRING("vpmovusqw"), + ZYDIS_MAKE_GENERATED_STRING("vpmovuswb"), + ZYDIS_MAKE_GENERATED_STRING("vpmovw2m"), + ZYDIS_MAKE_GENERATED_STRING("vpmovwb"), + ZYDIS_MAKE_GENERATED_STRING("vpmovzxbd"), + ZYDIS_MAKE_GENERATED_STRING("vpmovzxbq"), + ZYDIS_MAKE_GENERATED_STRING("vpmovzxbw"), + ZYDIS_MAKE_GENERATED_STRING("vpmovzxdq"), + ZYDIS_MAKE_GENERATED_STRING("vpmovzxwd"), + ZYDIS_MAKE_GENERATED_STRING("vpmovzxwq"), + ZYDIS_MAKE_GENERATED_STRING("vpmuldq"), + ZYDIS_MAKE_GENERATED_STRING("vpmulhd"), + ZYDIS_MAKE_GENERATED_STRING("vpmulhrsw"), + ZYDIS_MAKE_GENERATED_STRING("vpmulhud"), + ZYDIS_MAKE_GENERATED_STRING("vpmulhuw"), + ZYDIS_MAKE_GENERATED_STRING("vpmulhw"), + ZYDIS_MAKE_GENERATED_STRING("vpmulld"), + ZYDIS_MAKE_GENERATED_STRING("vpmullq"), + ZYDIS_MAKE_GENERATED_STRING("vpmullw"), + ZYDIS_MAKE_GENERATED_STRING("vpmultishiftqb"), + ZYDIS_MAKE_GENERATED_STRING("vpmuludq"), + ZYDIS_MAKE_GENERATED_STRING("vpopcntb"), + ZYDIS_MAKE_GENERATED_STRING("vpopcntd"), + ZYDIS_MAKE_GENERATED_STRING("vpopcntq"), + ZYDIS_MAKE_GENERATED_STRING("vpopcntw"), + ZYDIS_MAKE_GENERATED_STRING("vpor"), + ZYDIS_MAKE_GENERATED_STRING("vpord"), + ZYDIS_MAKE_GENERATED_STRING("vporq"), + ZYDIS_MAKE_GENERATED_STRING("vpperm"), + ZYDIS_MAKE_GENERATED_STRING("vprefetch0"), + ZYDIS_MAKE_GENERATED_STRING("vprefetch1"), + ZYDIS_MAKE_GENERATED_STRING("vprefetch2"), + ZYDIS_MAKE_GENERATED_STRING("vprefetche0"), + ZYDIS_MAKE_GENERATED_STRING("vprefetche1"), + ZYDIS_MAKE_GENERATED_STRING("vprefetche2"), + ZYDIS_MAKE_GENERATED_STRING("vprefetchenta"), + ZYDIS_MAKE_GENERATED_STRING("vprefetchnta"), + ZYDIS_MAKE_GENERATED_STRING("vprold"), + ZYDIS_MAKE_GENERATED_STRING("vprolq"), + ZYDIS_MAKE_GENERATED_STRING("vprolvd"), + ZYDIS_MAKE_GENERATED_STRING("vprolvq"), + ZYDIS_MAKE_GENERATED_STRING("vprord"), + ZYDIS_MAKE_GENERATED_STRING("vprorq"), + ZYDIS_MAKE_GENERATED_STRING("vprorvd"), + ZYDIS_MAKE_GENERATED_STRING("vprorvq"), + ZYDIS_MAKE_GENERATED_STRING("vprotb"), + ZYDIS_MAKE_GENERATED_STRING("vprotd"), + ZYDIS_MAKE_GENERATED_STRING("vprotq"), + ZYDIS_MAKE_GENERATED_STRING("vprotw"), + ZYDIS_MAKE_GENERATED_STRING("vpsadbw"), + ZYDIS_MAKE_GENERATED_STRING("vpsbbd"), + ZYDIS_MAKE_GENERATED_STRING("vpsbbrd"), + ZYDIS_MAKE_GENERATED_STRING("vpscatterdd"), + ZYDIS_MAKE_GENERATED_STRING("vpscatterdq"), + ZYDIS_MAKE_GENERATED_STRING("vpscatterqd"), + ZYDIS_MAKE_GENERATED_STRING("vpscatterqq"), + ZYDIS_MAKE_GENERATED_STRING("vpshab"), + ZYDIS_MAKE_GENERATED_STRING("vpshad"), + ZYDIS_MAKE_GENERATED_STRING("vpshaq"), + ZYDIS_MAKE_GENERATED_STRING("vpshaw"), + ZYDIS_MAKE_GENERATED_STRING("vpshlb"), + ZYDIS_MAKE_GENERATED_STRING("vpshld"), + ZYDIS_MAKE_GENERATED_STRING("vpshldd"), + ZYDIS_MAKE_GENERATED_STRING("vpshldq"), + ZYDIS_MAKE_GENERATED_STRING("vpshldvd"), + ZYDIS_MAKE_GENERATED_STRING("vpshldvq"), + ZYDIS_MAKE_GENERATED_STRING("vpshldvw"), + ZYDIS_MAKE_GENERATED_STRING("vpshldw"), + ZYDIS_MAKE_GENERATED_STRING("vpshlq"), + ZYDIS_MAKE_GENERATED_STRING("vpshlw"), + ZYDIS_MAKE_GENERATED_STRING("vpshrdd"), + ZYDIS_MAKE_GENERATED_STRING("vpshrdq"), + ZYDIS_MAKE_GENERATED_STRING("vpshrdvd"), + ZYDIS_MAKE_GENERATED_STRING("vpshrdvq"), + ZYDIS_MAKE_GENERATED_STRING("vpshrdvw"), + ZYDIS_MAKE_GENERATED_STRING("vpshrdw"), + ZYDIS_MAKE_GENERATED_STRING("vpshufb"), + ZYDIS_MAKE_GENERATED_STRING("vpshufbitqmb"), + ZYDIS_MAKE_GENERATED_STRING("vpshufd"), + ZYDIS_MAKE_GENERATED_STRING("vpshufhw"), + ZYDIS_MAKE_GENERATED_STRING("vpshuflw"), + ZYDIS_MAKE_GENERATED_STRING("vpsignb"), + ZYDIS_MAKE_GENERATED_STRING("vpsignd"), + ZYDIS_MAKE_GENERATED_STRING("vpsignw"), + ZYDIS_MAKE_GENERATED_STRING("vpslld"), + ZYDIS_MAKE_GENERATED_STRING("vpslldq"), + ZYDIS_MAKE_GENERATED_STRING("vpsllq"), + ZYDIS_MAKE_GENERATED_STRING("vpsllvd"), + ZYDIS_MAKE_GENERATED_STRING("vpsllvq"), + ZYDIS_MAKE_GENERATED_STRING("vpsllvw"), + ZYDIS_MAKE_GENERATED_STRING("vpsllw"), + ZYDIS_MAKE_GENERATED_STRING("vpsrad"), + ZYDIS_MAKE_GENERATED_STRING("vpsraq"), + ZYDIS_MAKE_GENERATED_STRING("vpsravd"), + ZYDIS_MAKE_GENERATED_STRING("vpsravq"), + ZYDIS_MAKE_GENERATED_STRING("vpsravw"), + ZYDIS_MAKE_GENERATED_STRING("vpsraw"), + ZYDIS_MAKE_GENERATED_STRING("vpsrld"), + ZYDIS_MAKE_GENERATED_STRING("vpsrldq"), + ZYDIS_MAKE_GENERATED_STRING("vpsrlq"), + ZYDIS_MAKE_GENERATED_STRING("vpsrlvd"), + ZYDIS_MAKE_GENERATED_STRING("vpsrlvq"), + ZYDIS_MAKE_GENERATED_STRING("vpsrlvw"), + ZYDIS_MAKE_GENERATED_STRING("vpsrlw"), + ZYDIS_MAKE_GENERATED_STRING("vpsubb"), + ZYDIS_MAKE_GENERATED_STRING("vpsubd"), + ZYDIS_MAKE_GENERATED_STRING("vpsubq"), + ZYDIS_MAKE_GENERATED_STRING("vpsubrd"), + ZYDIS_MAKE_GENERATED_STRING("vpsubrsetbd"), + ZYDIS_MAKE_GENERATED_STRING("vpsubsb"), + ZYDIS_MAKE_GENERATED_STRING("vpsubsetbd"), + ZYDIS_MAKE_GENERATED_STRING("vpsubsw"), + ZYDIS_MAKE_GENERATED_STRING("vpsubusb"), + ZYDIS_MAKE_GENERATED_STRING("vpsubusw"), + ZYDIS_MAKE_GENERATED_STRING("vpsubw"), + ZYDIS_MAKE_GENERATED_STRING("vpternlogd"), + ZYDIS_MAKE_GENERATED_STRING("vpternlogq"), + ZYDIS_MAKE_GENERATED_STRING("vptest"), + ZYDIS_MAKE_GENERATED_STRING("vptestmb"), + ZYDIS_MAKE_GENERATED_STRING("vptestmd"), + ZYDIS_MAKE_GENERATED_STRING("vptestmq"), + ZYDIS_MAKE_GENERATED_STRING("vptestmw"), + ZYDIS_MAKE_GENERATED_STRING("vptestnmb"), + ZYDIS_MAKE_GENERATED_STRING("vptestnmd"), + ZYDIS_MAKE_GENERATED_STRING("vptestnmq"), + ZYDIS_MAKE_GENERATED_STRING("vptestnmw"), + ZYDIS_MAKE_GENERATED_STRING("vpunpckhbw"), + ZYDIS_MAKE_GENERATED_STRING("vpunpckhdq"), + ZYDIS_MAKE_GENERATED_STRING("vpunpckhqdq"), + ZYDIS_MAKE_GENERATED_STRING("vpunpckhwd"), + ZYDIS_MAKE_GENERATED_STRING("vpunpcklbw"), + ZYDIS_MAKE_GENERATED_STRING("vpunpckldq"), + ZYDIS_MAKE_GENERATED_STRING("vpunpcklqdq"), + ZYDIS_MAKE_GENERATED_STRING("vpunpcklwd"), + ZYDIS_MAKE_GENERATED_STRING("vpxor"), + ZYDIS_MAKE_GENERATED_STRING("vpxord"), + ZYDIS_MAKE_GENERATED_STRING("vpxorq"), + ZYDIS_MAKE_GENERATED_STRING("vrangepd"), + ZYDIS_MAKE_GENERATED_STRING("vrangeps"), + ZYDIS_MAKE_GENERATED_STRING("vrangesd"), + ZYDIS_MAKE_GENERATED_STRING("vrangess"), + ZYDIS_MAKE_GENERATED_STRING("vrcp14pd"), + ZYDIS_MAKE_GENERATED_STRING("vrcp14ps"), + ZYDIS_MAKE_GENERATED_STRING("vrcp14sd"), + ZYDIS_MAKE_GENERATED_STRING("vrcp14ss"), + ZYDIS_MAKE_GENERATED_STRING("vrcp23ps"), + ZYDIS_MAKE_GENERATED_STRING("vrcp28pd"), + ZYDIS_MAKE_GENERATED_STRING("vrcp28ps"), + ZYDIS_MAKE_GENERATED_STRING("vrcp28sd"), + ZYDIS_MAKE_GENERATED_STRING("vrcp28ss"), + ZYDIS_MAKE_GENERATED_STRING("vrcpps"), + ZYDIS_MAKE_GENERATED_STRING("vrcpss"), + ZYDIS_MAKE_GENERATED_STRING("vreducepd"), + ZYDIS_MAKE_GENERATED_STRING("vreduceps"), + ZYDIS_MAKE_GENERATED_STRING("vreducesd"), + ZYDIS_MAKE_GENERATED_STRING("vreducess"), + ZYDIS_MAKE_GENERATED_STRING("vrndfxpntpd"), + ZYDIS_MAKE_GENERATED_STRING("vrndfxpntps"), + ZYDIS_MAKE_GENERATED_STRING("vrndscalepd"), + ZYDIS_MAKE_GENERATED_STRING("vrndscaleps"), + ZYDIS_MAKE_GENERATED_STRING("vrndscalesd"), + ZYDIS_MAKE_GENERATED_STRING("vrndscaless"), + ZYDIS_MAKE_GENERATED_STRING("vroundpd"), + ZYDIS_MAKE_GENERATED_STRING("vroundps"), + ZYDIS_MAKE_GENERATED_STRING("vroundsd"), + ZYDIS_MAKE_GENERATED_STRING("vroundss"), + ZYDIS_MAKE_GENERATED_STRING("vrsqrt14pd"), + ZYDIS_MAKE_GENERATED_STRING("vrsqrt14ps"), + ZYDIS_MAKE_GENERATED_STRING("vrsqrt14sd"), + ZYDIS_MAKE_GENERATED_STRING("vrsqrt14ss"), + ZYDIS_MAKE_GENERATED_STRING("vrsqrt23ps"), + ZYDIS_MAKE_GENERATED_STRING("vrsqrt28pd"), + ZYDIS_MAKE_GENERATED_STRING("vrsqrt28ps"), + ZYDIS_MAKE_GENERATED_STRING("vrsqrt28sd"), + ZYDIS_MAKE_GENERATED_STRING("vrsqrt28ss"), + ZYDIS_MAKE_GENERATED_STRING("vrsqrtps"), + ZYDIS_MAKE_GENERATED_STRING("vrsqrtss"), + ZYDIS_MAKE_GENERATED_STRING("vscalefpd"), + ZYDIS_MAKE_GENERATED_STRING("vscalefps"), + ZYDIS_MAKE_GENERATED_STRING("vscalefsd"), + ZYDIS_MAKE_GENERATED_STRING("vscalefss"), + ZYDIS_MAKE_GENERATED_STRING("vscaleps"), + ZYDIS_MAKE_GENERATED_STRING("vscatterdpd"), + ZYDIS_MAKE_GENERATED_STRING("vscatterdps"), + ZYDIS_MAKE_GENERATED_STRING("vscatterpf0dpd"), + ZYDIS_MAKE_GENERATED_STRING("vscatterpf0dps"), + ZYDIS_MAKE_GENERATED_STRING("vscatterpf0hintdpd"), + ZYDIS_MAKE_GENERATED_STRING("vscatterpf0hintdps"), + ZYDIS_MAKE_GENERATED_STRING("vscatterpf0qpd"), + ZYDIS_MAKE_GENERATED_STRING("vscatterpf0qps"), + ZYDIS_MAKE_GENERATED_STRING("vscatterpf1dpd"), + ZYDIS_MAKE_GENERATED_STRING("vscatterpf1dps"), + ZYDIS_MAKE_GENERATED_STRING("vscatterpf1qpd"), + ZYDIS_MAKE_GENERATED_STRING("vscatterpf1qps"), + ZYDIS_MAKE_GENERATED_STRING("vscatterqpd"), + ZYDIS_MAKE_GENERATED_STRING("vscatterqps"), + ZYDIS_MAKE_GENERATED_STRING("vshuff32x4"), + ZYDIS_MAKE_GENERATED_STRING("vshuff64x2"), + ZYDIS_MAKE_GENERATED_STRING("vshufi32x4"), + ZYDIS_MAKE_GENERATED_STRING("vshufi64x2"), + ZYDIS_MAKE_GENERATED_STRING("vshufpd"), + ZYDIS_MAKE_GENERATED_STRING("vshufps"), + ZYDIS_MAKE_GENERATED_STRING("vsqrtpd"), + ZYDIS_MAKE_GENERATED_STRING("vsqrtps"), + ZYDIS_MAKE_GENERATED_STRING("vsqrtsd"), + ZYDIS_MAKE_GENERATED_STRING("vsqrtss"), + ZYDIS_MAKE_GENERATED_STRING("vstmxcsr"), + ZYDIS_MAKE_GENERATED_STRING("vsubpd"), + ZYDIS_MAKE_GENERATED_STRING("vsubps"), + ZYDIS_MAKE_GENERATED_STRING("vsubrpd"), + ZYDIS_MAKE_GENERATED_STRING("vsubrps"), + ZYDIS_MAKE_GENERATED_STRING("vsubsd"), + ZYDIS_MAKE_GENERATED_STRING("vsubss"), + ZYDIS_MAKE_GENERATED_STRING("vtestpd"), + ZYDIS_MAKE_GENERATED_STRING("vtestps"), + ZYDIS_MAKE_GENERATED_STRING("vucomisd"), + ZYDIS_MAKE_GENERATED_STRING("vucomiss"), + ZYDIS_MAKE_GENERATED_STRING("vunpckhpd"), + ZYDIS_MAKE_GENERATED_STRING("vunpckhps"), + ZYDIS_MAKE_GENERATED_STRING("vunpcklpd"), + ZYDIS_MAKE_GENERATED_STRING("vunpcklps"), + ZYDIS_MAKE_GENERATED_STRING("vxorpd"), + ZYDIS_MAKE_GENERATED_STRING("vxorps"), + ZYDIS_MAKE_GENERATED_STRING("vzeroall"), + ZYDIS_MAKE_GENERATED_STRING("vzeroupper"), + ZYDIS_MAKE_GENERATED_STRING("wbinvd"), + ZYDIS_MAKE_GENERATED_STRING("wrfsbase"), + ZYDIS_MAKE_GENERATED_STRING("wrgsbase"), + ZYDIS_MAKE_GENERATED_STRING("wrmsr"), + ZYDIS_MAKE_GENERATED_STRING("wrpkru"), + ZYDIS_MAKE_GENERATED_STRING("wrssd"), + ZYDIS_MAKE_GENERATED_STRING("wrssq"), + ZYDIS_MAKE_GENERATED_STRING("wrussd"), + ZYDIS_MAKE_GENERATED_STRING("wrussq"), + ZYDIS_MAKE_GENERATED_STRING("xabort"), + ZYDIS_MAKE_GENERATED_STRING("xadd"), + ZYDIS_MAKE_GENERATED_STRING("xbegin"), + ZYDIS_MAKE_GENERATED_STRING("xchg"), + ZYDIS_MAKE_GENERATED_STRING("xend"), + ZYDIS_MAKE_GENERATED_STRING("xgetbv"), + ZYDIS_MAKE_GENERATED_STRING("xlat"), + ZYDIS_MAKE_GENERATED_STRING("xor"), + ZYDIS_MAKE_GENERATED_STRING("xorpd"), + ZYDIS_MAKE_GENERATED_STRING("xorps"), + ZYDIS_MAKE_GENERATED_STRING("xrstor"), + ZYDIS_MAKE_GENERATED_STRING("xrstor64"), + ZYDIS_MAKE_GENERATED_STRING("xrstors"), + ZYDIS_MAKE_GENERATED_STRING("xrstors64"), + ZYDIS_MAKE_GENERATED_STRING("xsave"), + ZYDIS_MAKE_GENERATED_STRING("xsave64"), + ZYDIS_MAKE_GENERATED_STRING("xsavec"), + ZYDIS_MAKE_GENERATED_STRING("xsavec64"), + ZYDIS_MAKE_GENERATED_STRING("xsaveopt"), + ZYDIS_MAKE_GENERATED_STRING("xsaveopt64"), + ZYDIS_MAKE_GENERATED_STRING("xsaves"), + ZYDIS_MAKE_GENERATED_STRING("xsaves64"), + ZYDIS_MAKE_GENERATED_STRING("xsetbv"), + ZYDIS_MAKE_GENERATED_STRING("xtest") }; diff --git a/src/InternalTypes.h b/src/InternalTypes.h index 159feee..fe47051 100644 --- a/src/InternalTypes.h +++ b/src/InternalTypes.h @@ -61,6 +61,16 @@ typedef struct ZydisGeneratedString_ #pragma pack(pop) +/* ---------------------------------------------------------------------------------------------- */ +/* Helper macros */ +/* ---------------------------------------------------------------------------------------------- */ + +/** + * @brief Creates a `ZydisGeneratedString` from a static C-string. + */ +#define ZYDIS_MAKE_GENERATED_STRING(string) \ + { string, sizeof(string) - 1 } + /* ---------------------------------------------------------------------------------------------- */ /* Helper functions */ /* ---------------------------------------------------------------------------------------------- */ From 618557a8144b33221bc13bef917c183904294487 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joel=20Ho=CC=88ner?= Date: Sat, 2 Dec 2017 17:50:34 +0100 Subject: [PATCH 06/14] Minor documentation tweaks --- include/Zydis/String.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/Zydis/String.h b/include/Zydis/String.h index 2432bb9..0ebf3b2 100644 --- a/include/Zydis/String.h +++ b/include/Zydis/String.h @@ -58,7 +58,6 @@ typedef struct ZydisString_ ZydisUSize capacity; } ZydisString; - /* ---------------------------------------------------------------------------------------------- */ /* Letter Case */ /* ---------------------------------------------------------------------------------------------- */ @@ -74,7 +73,7 @@ typedef ZydisU8 ZydisLetterCase; enum ZydisLetterCases { /** - * @brief Uses the given text "as it is". + * @brief Uses the given text "as is". */ ZYDIS_LETTER_CASE_DEFAULT, /** @@ -135,9 +134,10 @@ ZYDIS_NO_EXPORT ZYDIS_INLINE ZydisStatus ZydisStringInit(ZydisString* string, ch return ZYDIS_STATUS_INVALID_PARAMETER; } + ZydisUSize length = ZydisStrLen(value); string->buffer = value; - string->length = ZydisStrLen(value); - string->capacity = ZydisStrLen(value); + string->length = length; + string->capacity = length; return ZYDIS_STATUS_SUCCESS; } @@ -145,7 +145,7 @@ ZYDIS_NO_EXPORT ZYDIS_INLINE ZydisStatus ZydisStringInit(ZydisString* string, ch /* ---------------------------------------------------------------------------------------------- */ /** - * @brief Appends a `ZydisString` to another `ZydisString` after converting it to the specified + * @brief Appends a `ZydisString` to another `ZydisString`, converting it to the specified * letter-case. * * @param string The string to append to. @@ -160,7 +160,7 @@ ZYDIS_NO_EXPORT ZydisStatus ZydisStringAppendEx(ZydisString* string, const Zydis ZydisLetterCase letterCase); /** - * @brief Appends the given C-string to a `ZydisString` after converting it to the specified + * @brief Appends the given C-string to a `ZydisString`, converting it to the specified * letter-case. * * @param string The string to append to. From 346b7fec10c730a32eafeac930bf67f6e51ed69d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joel=20Ho=CC=88ner?= Date: Sat, 2 Dec 2017 19:26:26 +0100 Subject: [PATCH 07/14] Moved internal headers --- CMakeLists.txt | 6 +++--- {src => include/Zydis/Internal}/DecoderData.h | 6 +++--- {src => include/Zydis/Internal}/InternalTypes.h | 6 +++--- include/Zydis/Internal/LibC.h | 6 +++--- {src => include/Zydis/Internal}/SharedData.h | 6 +++--- src/Decoder.c | 4 ++-- src/DecoderData.c | 2 +- src/Mnemonic.c | 2 +- src/SharedData.c | 2 +- 9 files changed, 20 insertions(+), 20 deletions(-) rename {src => include/Zydis/Internal}/DecoderData.h (98%) rename {src => include/Zydis/Internal}/InternalTypes.h (96%) rename {src => include/Zydis/Internal}/SharedData.h (99%) diff --git a/CMakeLists.txt b/CMakeLists.txt index a13fa7f..5d7c2c7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -109,12 +109,12 @@ target_sources("Zydis" "${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Utils.h" "${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Zydis.h" "${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Internal/LibC.h" + "${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Internal/SharedData.h" + "${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Internal/InternalTypes.h" PRIVATE - "src/InternalTypes.h" "src/MetaInfo.c" "src/Mnemonic.c" "src/Register.c" - "src/SharedData.h" "src/SharedData.c" "src/String.c" "src/Utils.c" @@ -126,9 +126,9 @@ if (ZYDIS_FEATURE_DECODER) "${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Decoder.h" "${CMAKE_CURRENT_LIST_DIR}/include/Zydis/DecoderTypes.h" "${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Formatter.h" + "${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Internal/DecoderData.h" PRIVATE "src/Decoder.c" - "src/DecoderData.h" "src/DecoderData.c" "src/Formatter.c") endif () diff --git a/src/DecoderData.h b/include/Zydis/Internal/DecoderData.h similarity index 98% rename from src/DecoderData.h rename to include/Zydis/Internal/DecoderData.h index ec54d69..0062607 100644 --- a/src/DecoderData.h +++ b/include/Zydis/Internal/DecoderData.h @@ -24,8 +24,8 @@ ***************************************************************************************************/ -#ifndef ZYDIS_DECODERDATA_H -#define ZYDIS_DECODERDATA_H +#ifndef ZYDIS_INTERNAL_DECODERDATA_H +#define ZYDIS_INTERNAL_DECODERDATA_H #include #include @@ -311,4 +311,4 @@ ZYDIS_NO_EXPORT void ZydisGetInstructionEncodingInfo(const ZydisDecoderTreeNode* } #endif -#endif /* ZYDIS_DECODERDATA_H */ +#endif /* ZYDIS_INTERNAL_DECODERDATA_H */ diff --git a/src/InternalTypes.h b/include/Zydis/Internal/InternalTypes.h similarity index 96% rename from src/InternalTypes.h rename to include/Zydis/Internal/InternalTypes.h index fe47051..4b1f1c3 100644 --- a/src/InternalTypes.h +++ b/include/Zydis/Internal/InternalTypes.h @@ -24,8 +24,8 @@ ***************************************************************************************************/ -#ifndef ZYDIS_INTERNALTYPES_H -#define ZYDIS_INTERNALTYPES_H +#ifndef ZYDIS_INTERNAL_INTERNALTYPES_H +#define ZYDIS_INTERNAL_INTERNALTYPES_H #include #include @@ -100,4 +100,4 @@ ZYDIS_NO_EXPORT ZYDIS_INLINE void ZydisStringInitWithGeneratedString(ZydisString } #endif -#endif /* ZYDIS_INTERNALTYPES_H */ +#endif /* ZYDIS_INTERNAL_INTERNALTYPES_H */ diff --git a/include/Zydis/Internal/LibC.h b/include/Zydis/Internal/LibC.h index d79329c..8fabf87 100644 --- a/include/Zydis/Internal/LibC.h +++ b/include/Zydis/Internal/LibC.h @@ -24,8 +24,8 @@ ***************************************************************************************************/ -#ifndef ZYDIS_LIBC_H -#define ZYDIS_LIBC_H +#ifndef ZYDIS_INTERNAL_LIBC_H +#define ZYDIS_INTERNAL_LIBC_H #include @@ -79,4 +79,4 @@ ZYDIS_INLINE ZydisUSize ZydisStrLen(const char* str) #endif -#endif /* ZYDIS_LIBC_H */ +#endif /* ZYDIS_INTERNAL_LIBC_H */ diff --git a/src/SharedData.h b/include/Zydis/Internal/SharedData.h similarity index 99% rename from src/SharedData.h rename to include/Zydis/Internal/SharedData.h index 386cee3..30325b7 100644 --- a/src/SharedData.h +++ b/include/Zydis/Internal/SharedData.h @@ -24,8 +24,8 @@ ***************************************************************************************************/ -#ifndef ZYDIS_SHAREDDATA_H -#define ZYDIS_SHAREDDATA_H +#ifndef ZYDIS_INTERNAL_SHAREDDATA_H +#define ZYDIS_INTERNAL_SHAREDDATA_H #include #include @@ -717,4 +717,4 @@ ZYDIS_NO_EXPORT void ZydisGetAccessedFlags(const ZydisInstructionDefinition* def } #endif -#endif /* ZYDIS_SHAREDDATA_H */ +#endif /* ZYDIS_INTERNAL_SHAREDDATA_H */ diff --git a/src/Decoder.c b/src/Decoder.c index 752fbde..d4d2a9e 100644 --- a/src/Decoder.c +++ b/src/Decoder.c @@ -27,8 +27,8 @@ #include #include #include -#include -#include +#include +#include /* ============================================================================================== */ /* Internal enums and types */ diff --git a/src/DecoderData.c b/src/DecoderData.c index c0d9b91..6946fb0 100644 --- a/src/DecoderData.c +++ b/src/DecoderData.c @@ -24,7 +24,7 @@ ***************************************************************************************************/ -#include +#include /* ============================================================================================== */ /* Data tables */ diff --git a/src/Mnemonic.c b/src/Mnemonic.c index e07ff42..5b8732b 100644 --- a/src/Mnemonic.c +++ b/src/Mnemonic.c @@ -25,7 +25,7 @@ ***************************************************************************************************/ #include -#include +#include #include diff --git a/src/SharedData.c b/src/SharedData.c index 3e79f0e..9c98246 100644 --- a/src/SharedData.c +++ b/src/SharedData.c @@ -24,7 +24,7 @@ ***************************************************************************************************/ -#include +#include /* ============================================================================================== */ /* Data tables */ From 39facdf5fe8a2ed4e6e20c8f1c8f11a8fc3c0585 Mon Sep 17 00:00:00 2001 From: flobernd Date: Sat, 2 Dec 2017 23:46:05 +0100 Subject: [PATCH 08/14] Reworked `ZydisString` --- include/Zydis/Internal/InternalTypes.h | 103 - include/Zydis/Mnemonic.h | 5 +- include/Zydis/Register.h | 13 +- include/Zydis/String.h | 111 +- src/Formatter.c | 38 +- src/Generated/EnumMnemonic.inc | 3152 ++++++++++++------------ src/Mnemonic.c | 19 +- src/Register.c | 231 +- 8 files changed, 1877 insertions(+), 1795 deletions(-) delete mode 100644 include/Zydis/Internal/InternalTypes.h diff --git a/include/Zydis/Internal/InternalTypes.h b/include/Zydis/Internal/InternalTypes.h deleted file mode 100644 index 4b1f1c3..0000000 --- a/include/Zydis/Internal/InternalTypes.h +++ /dev/null @@ -1,103 +0,0 @@ -/*************************************************************************************************** - - Zyan Disassembler Library (Zydis) - - Original Author : Florian Bernd - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - -***************************************************************************************************/ - -#ifndef ZYDIS_INTERNAL_INTERNALTYPES_H -#define ZYDIS_INTERNAL_INTERNALTYPES_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* ============================================================================================== */ -/* Generated Strings */ -/* ============================================================================================== */ - -/* ---------------------------------------------------------------------------------------------- */ -/* Enums and types */ -/* ---------------------------------------------------------------------------------------------- */ - -#pragma pack(push, 1) - -/** - * @brief Defines the `ZydisGeneratedString` struct. - */ -typedef struct ZydisGeneratedString_ -{ - /** - * @brief Contains the actual string. - */ - char* buffer; - /** - * @brief The length of the string (without 0-termination). - */ - ZydisU8 length; -} ZydisGeneratedString; - -#pragma pack(pop) - -/* ---------------------------------------------------------------------------------------------- */ -/* Helper macros */ -/* ---------------------------------------------------------------------------------------------- */ - -/** - * @brief Creates a `ZydisGeneratedString` from a static C-string. - */ -#define ZYDIS_MAKE_GENERATED_STRING(string) \ - { string, sizeof(string) - 1 } - -/* ---------------------------------------------------------------------------------------------- */ -/* Helper functions */ -/* ---------------------------------------------------------------------------------------------- */ - -/** - * @brief Initializes a `ZydisString` struct with the values from a `ZydisGeneratedString`. - * - * @param target A pointer to the target string. - * @param source A pointer to the source string. - */ -ZYDIS_NO_EXPORT ZYDIS_INLINE void ZydisStringInitWithGeneratedString(ZydisString* target, - const ZydisGeneratedString* source) -{ - ZYDIS_ASSERT(target); - ZYDIS_ASSERT(source); - - target->buffer = source->buffer; - target->length = source->length; - target->capacity = source->length; -} - -/* ---------------------------------------------------------------------------------------------- */ - -/* ============================================================================================== */ - -#ifdef __cplusplus -} -#endif - -#endif /* ZYDIS_INTERNAL_INTERNALTYPES_H */ diff --git a/include/Zydis/Mnemonic.h b/include/Zydis/Mnemonic.h index f14035f..30652ee 100644 --- a/include/Zydis/Mnemonic.h +++ b/include/Zydis/Mnemonic.h @@ -33,7 +33,6 @@ #define ZYDIS_MNEMONIC_H #include -#include #include #ifdef __cplusplus @@ -60,7 +59,7 @@ extern "C" { ZYDIS_EXPORT const char* ZydisMnemonicGetString(ZydisMnemonic mnemonic); /** - * @brief Returns the specified instruction mnemonic as `ZydisString`. + * @brief Returns the specified instruction mnemonic as `ZydisStaticString`. * * @param mnemonic The mnemonic. * @@ -68,7 +67,7 @@ ZYDIS_EXPORT const char* ZydisMnemonicGetString(ZydisMnemonic mnemonic); * * The `buffer` of the returned struct is guaranteed to be zero-terminated in this special case. */ -ZYDIS_EXPORT const ZydisString* ZydisMnemonicGetStringEx(ZydisMnemonic mnemonic); +ZYDIS_EXPORT const ZydisStaticString* ZydisMnemonicGetStaticString(ZydisMnemonic mnemonic); /* ============================================================================================== */ diff --git a/include/Zydis/Register.h b/include/Zydis/Register.h index fcf652f..30fcd5d 100644 --- a/include/Zydis/Register.h +++ b/include/Zydis/Register.h @@ -34,7 +34,7 @@ #include #include -#include +#include #ifdef __cplusplus extern "C" { @@ -314,6 +314,17 @@ ZYDIS_EXPORT ZydisRegisterWidth ZydisRegisterGetWidth64(ZydisRegister reg); */ ZYDIS_EXPORT const char* ZydisRegisterGetString(ZydisRegister reg); +/** + * @brief Returns the specified register string as `ZydisStaticString`. + * + * @param reg The register. + * + * @return The register string or @c NULL, if an invalid register was passed. + * + * The `buffer` of the returned struct is guaranteed to be zero-terminated in this special case. + */ +ZYDIS_EXPORT const ZydisStaticString* ZydisRegisterGetStaticString(ZydisRegister reg); + /* ============================================================================================== */ #ifdef __cplusplus diff --git a/include/Zydis/String.h b/include/Zydis/String.h index 0ebf3b2..59afcf5 100644 --- a/include/Zydis/String.h +++ b/include/Zydis/String.h @@ -49,7 +49,7 @@ typedef struct ZydisString_ */ char *buffer; /** - * @brief The length of the string (without any optional 0). + * @brief The length of the string (without 0-termination). */ ZydisUSize length; /** @@ -58,6 +58,31 @@ typedef struct ZydisString_ ZydisUSize capacity; } ZydisString; +/* ---------------------------------------------------------------------------------------------- */ +/* Static string */ +/* ---------------------------------------------------------------------------------------------- */ + +#pragma pack(push, 1) + +/** + * @brief Defines the `ZydisStaticString` struct. + * + * This more compact struct is mainly used for internal string-tables to save up some bytes. + */ +typedef struct ZydisStaticString_ +{ + /** + * @brief The buffer that contains the actual string (0-termination is optional!). + */ + const char* buffer; + /** + * @brief The length of the string (without 0-termination). + */ + ZydisU8 length; +} ZydisStaticString; + +#pragma pack(pop) + /* ---------------------------------------------------------------------------------------------- */ /* Letter Case */ /* ---------------------------------------------------------------------------------------------- */ @@ -109,6 +134,14 @@ enum ZydisLetterCases #define ZYDIS_MAKE_STRING(string) \ { (char*)string, sizeof(string) - 1, sizeof(string) - 1 } +/** + * @brief Creates a `ZydisStaticString` from a static C-string. + * + * @param string The C-string constant. + */ +#define ZYDIS_MAKE_STATIC_STRING(string) \ + { string, sizeof(string) - 1 } + /* ---------------------------------------------------------------------------------------------- */ /* ============================================================================================== */ @@ -134,7 +167,7 @@ ZYDIS_NO_EXPORT ZYDIS_INLINE ZydisStatus ZydisStringInit(ZydisString* string, ch return ZYDIS_STATUS_INVALID_PARAMETER; } - ZydisUSize length = ZydisStrLen(value); + const ZydisUSize length = ZydisStrLen(value); string->buffer = value; string->length = length; string->capacity = length; @@ -142,6 +175,28 @@ ZYDIS_NO_EXPORT ZYDIS_INLINE ZydisStatus ZydisStringInit(ZydisString* string, ch return ZYDIS_STATUS_SUCCESS; } +/** + * @brief Finalizes a `ZydisString` struct by adding a terminating zero byte. + * + * @param string The string to finalize. + * + * @return A zydis status code. + */ +ZYDIS_NO_EXPORT ZYDIS_INLINE ZydisStatus ZydisStringFinalize(ZydisString* string) +{ + if (!string) + { + return ZYDIS_STATUS_INVALID_PARAMETER; + } + if (string->length >= string->capacity) + { + return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE; + } + + string->buffer[string->length] = 0; + return ZYDIS_STATUS_SUCCESS; +} + /* ---------------------------------------------------------------------------------------------- */ /** @@ -180,6 +235,33 @@ ZYDIS_NO_EXPORT ZYDIS_INLINE ZydisStatus ZydisStringAppendExC(ZydisString* strin return ZydisStringAppendEx(string, &other, letterCase); } +/** + * @brief Appends the given 'ZydisStaticString' to a `ZydisString`, converting it to the + * specified letter-case. + * + * @param string The string to append to. + * @param text The static-string to append. + * @param letterCase The letter case to use. + * + * @return @c ZYDIS_STATUS_SUCCESS, if the function succeeded, or + * @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not + * sufficient to append the given @c text. + */ +ZYDIS_NO_EXPORT ZYDIS_INLINE ZydisStatus ZydisStringAppendStaticEx(ZydisString* string, + const ZydisStaticString* text, ZydisLetterCase letterCase) +{ + if (!text || !text->buffer) + { + return ZYDIS_STATUS_INVALID_PARAMETER; + } + + ZydisString other; + other.buffer = (char*)text->buffer; + other.length = text->length; + + return ZydisStringAppendEx(string, &other, letterCase); +} + /** * @brief Appends a `ZydisString` to another `ZydisString`. * @@ -214,6 +296,31 @@ ZYDIS_NO_EXPORT ZYDIS_INLINE ZydisStatus ZydisStringAppendC(ZydisString* string, return ZydisStringAppendEx(string, &other, ZYDIS_LETTER_CASE_DEFAULT); } +/** + * @brief Appends the given 'ZydisStaticString' to a `ZydisString`. + * + * @param string The string to append to. + * @param text The static-string to append. + * + * @return @c ZYDIS_STATUS_SUCCESS, if the function succeeded, or + * @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not + * sufficient to append the given @c text. + */ +ZYDIS_NO_EXPORT ZYDIS_INLINE ZydisStatus ZydisStringAppendStatic(ZydisString* string, + const ZydisStaticString* text, ZydisLetterCase letterCase) +{ + if (!text || !text->buffer) + { + return ZYDIS_STATUS_INVALID_PARAMETER; + } + + ZydisString other; + other.buffer = (char*)text->buffer; + other.length = text->length; + + return ZydisStringAppendEx(string, &other, letterCase); +} + /* ---------------------------------------------------------------------------------------------- */ /* Formatting */ /* ---------------------------------------------------------------------------------------------- */ diff --git a/src/Formatter.c b/src/Formatter.c index 6fa78fb..0d5ebed 100644 --- a/src/Formatter.c +++ b/src/Formatter.c @@ -91,12 +91,12 @@ static ZydisStatus ZydisFormatterPrintMnemonicIntel(const ZydisFormatter* format return ZYDIS_STATUS_INVALID_PARAMETER; } - const ZydisString* mnemonic = ZydisMnemonicGetStringEx(instruction->mnemonic); + const ZydisStaticString* mnemonic = ZydisMnemonicGetStaticString(instruction->mnemonic); if (!mnemonic) { return ZydisStringAppendExC(string, "invalid", formatter->letterCase); } - ZYDIS_CHECK(ZydisStringAppendEx(string, mnemonic, formatter->letterCase)); + ZYDIS_CHECK(ZydisStringAppendStaticEx(string, mnemonic, formatter->letterCase)); if (instruction->attributes & ZYDIS_ATTRIB_IS_FAR_BRANCH) { @@ -124,12 +124,12 @@ static ZydisStatus ZydisFormatterFormatOperandRegIntel(const ZydisFormatter* for return ZYDIS_STATUS_SUCCESS; } - const char* reg = ZydisRegisterGetString(operand->reg.value); + const ZydisStaticString* reg = ZydisRegisterGetStaticString(operand->reg.value); if (!reg) { return ZydisStringAppendExC(string, "invalid", formatter->letterCase); } - return ZydisStringAppendExC(string, reg, formatter->letterCase); + return ZydisStringAppendStaticEx(string, reg, formatter->letterCase); } static ZydisStatus ZydisFormatterFormatOperandMemIntel(const ZydisFormatter* formatter, @@ -159,8 +159,8 @@ static ZydisStatus ZydisFormatterFormatOperandMemIntel(const ZydisFormatter* for address, userData)); } else { - ZYDIS_CHECK(ZydisStringAppendExC(string, ZydisRegisterGetString(operand->mem.base), - formatter->letterCase)); + ZYDIS_CHECK(ZydisStringAppendStaticEx(string, + ZydisRegisterGetStaticString(operand->mem.base), formatter->letterCase)); ZYDIS_CHECK(formatter->funcPrintDisplacement(formatter, string, instruction, operand, userData)); } @@ -169,17 +169,17 @@ static ZydisStatus ZydisFormatterFormatOperandMemIntel(const ZydisFormatter* for // Regular memory operand if (operand->mem.base != ZYDIS_REGISTER_NONE) { - const char* reg = ZydisRegisterGetString(operand->mem.base); + const ZydisStaticString* reg = ZydisRegisterGetStaticString(operand->mem.base); if (!reg) { return ZYDIS_STATUS_INVALID_PARAMETER; } - ZYDIS_CHECK(ZydisStringAppendExC(string, reg, formatter->letterCase)); + ZYDIS_CHECK(ZydisStringAppendStaticEx(string, reg, formatter->letterCase)); } if ((operand->mem.index != ZYDIS_REGISTER_NONE) && (operand->mem.type != ZYDIS_MEMOP_TYPE_MIB)) { - const char* reg = ZydisRegisterGetString(operand->mem.index); + const ZydisStaticString* reg = ZydisRegisterGetStaticString(operand->mem.index); if (!reg) { return ZYDIS_STATUS_INVALID_PARAMETER; @@ -188,7 +188,7 @@ static ZydisStatus ZydisFormatterFormatOperandMemIntel(const ZydisFormatter* for { ZYDIS_CHECK(ZydisStringAppendC(string, "+")); } - ZYDIS_CHECK(ZydisStringAppendExC(string, reg, formatter->letterCase)); + ZYDIS_CHECK(ZydisStringAppendStaticEx(string, reg, formatter->letterCase)); if (operand->mem.scale) { ZYDIS_CHECK(ZydisStringAppendC(string, "*")); @@ -523,15 +523,15 @@ static ZydisStatus ZydisFormatterPrintSegmentIntel(const ZydisFormatter* formatt case ZYDIS_REGISTER_CS: case ZYDIS_REGISTER_FS: case ZYDIS_REGISTER_GS: - ZYDIS_CHECK(ZydisStringAppendExC(string, - ZydisRegisterGetString(operand->mem.segment), formatter->letterCase)); + ZYDIS_CHECK(ZydisStringAppendStaticEx(string, + ZydisRegisterGetStaticString(operand->mem.segment), formatter->letterCase)); return ZydisStringAppendC(string, ":"); case ZYDIS_REGISTER_SS: if ((formatter->forceSegments) || (instruction->attributes & ZYDIS_ATTRIB_HAS_SEGMENT_SS)) { - ZYDIS_CHECK(ZydisStringAppendExC(string, - ZydisRegisterGetString(operand->mem.segment), formatter->letterCase)); + ZYDIS_CHECK(ZydisStringAppendStaticEx(string, + ZydisRegisterGetStaticString(operand->mem.segment), formatter->letterCase)); return ZydisStringAppendC(string, ":"); } break; @@ -539,8 +539,8 @@ static ZydisStatus ZydisFormatterPrintSegmentIntel(const ZydisFormatter* formatt if ((formatter->forceSegments) || (instruction->attributes & ZYDIS_ATTRIB_HAS_SEGMENT_DS)) { - ZYDIS_CHECK(ZydisStringAppendExC(string, - ZydisRegisterGetString(operand->mem.segment), formatter->letterCase)); + ZYDIS_CHECK(ZydisStringAppendStaticEx(string, + ZydisRegisterGetStaticString(operand->mem.segment), formatter->letterCase)); return ZydisStringAppendC(string, ":"); } break; @@ -568,13 +568,13 @@ static ZydisStatus ZydisFormatterPrintDecoratorIntel(const ZydisFormatter* forma { if (instruction->avx.mask.reg != ZYDIS_REGISTER_K0) { - const char* reg = ZydisRegisterGetString(instruction->avx.mask.reg); + const ZydisStaticString* reg = ZydisRegisterGetStaticString(instruction->avx.mask.reg); if (!reg) { return ZYDIS_STATUS_INVALID_PARAMETER; } ZYDIS_CHECK(ZydisStringAppendC(string, " {")); - ZYDIS_CHECK(ZydisStringAppendExC(string, reg, formatter->letterCase)); + ZYDIS_CHECK(ZydisStringAppendStaticEx(string, reg, formatter->letterCase)); ZYDIS_CHECK(ZydisStringAppendC(string, "}")); if (instruction->avx.mask.mode == ZYDIS_MASK_MODE_ZERO) { @@ -1132,7 +1132,7 @@ ZydisStatus ZydisFormatterFormatInstructionEx(const ZydisFormatter* formatter, return formatter->funcPost(formatter, &string, instruction, userData); } - buffer[string.length] = 0; + buffer[string.length] = 0; // TODO: Should we add 0-termination in error case? return ZYDIS_STATUS_SUCCESS; } diff --git a/src/Generated/EnumMnemonic.inc b/src/Generated/EnumMnemonic.inc index a982726..8097afe 100644 --- a/src/Generated/EnumMnemonic.inc +++ b/src/Generated/EnumMnemonic.inc @@ -1,1578 +1,1578 @@ -static const ZydisGeneratedString zydisMnemonicStrings[] = +static const ZydisStaticString zydisMnemonicStrings[] = { - ZYDIS_MAKE_GENERATED_STRING("invalid"), - ZYDIS_MAKE_GENERATED_STRING("aaa"), - ZYDIS_MAKE_GENERATED_STRING("aad"), - ZYDIS_MAKE_GENERATED_STRING("aam"), - ZYDIS_MAKE_GENERATED_STRING("aas"), - ZYDIS_MAKE_GENERATED_STRING("adc"), - ZYDIS_MAKE_GENERATED_STRING("adcx"), - ZYDIS_MAKE_GENERATED_STRING("add"), - ZYDIS_MAKE_GENERATED_STRING("addpd"), - ZYDIS_MAKE_GENERATED_STRING("addps"), - ZYDIS_MAKE_GENERATED_STRING("addsd"), - ZYDIS_MAKE_GENERATED_STRING("addss"), - ZYDIS_MAKE_GENERATED_STRING("addsubpd"), - ZYDIS_MAKE_GENERATED_STRING("addsubps"), - ZYDIS_MAKE_GENERATED_STRING("adox"), - ZYDIS_MAKE_GENERATED_STRING("aesdec"), - ZYDIS_MAKE_GENERATED_STRING("aesdeclast"), - ZYDIS_MAKE_GENERATED_STRING("aesenc"), - ZYDIS_MAKE_GENERATED_STRING("aesenclast"), - ZYDIS_MAKE_GENERATED_STRING("aesimc"), - ZYDIS_MAKE_GENERATED_STRING("aeskeygenassist"), - ZYDIS_MAKE_GENERATED_STRING("and"), - ZYDIS_MAKE_GENERATED_STRING("andn"), - ZYDIS_MAKE_GENERATED_STRING("andnpd"), - ZYDIS_MAKE_GENERATED_STRING("andnps"), - ZYDIS_MAKE_GENERATED_STRING("andpd"), - ZYDIS_MAKE_GENERATED_STRING("andps"), - ZYDIS_MAKE_GENERATED_STRING("arpl"), - ZYDIS_MAKE_GENERATED_STRING("bextr"), - ZYDIS_MAKE_GENERATED_STRING("blcfill"), - ZYDIS_MAKE_GENERATED_STRING("blci"), - ZYDIS_MAKE_GENERATED_STRING("blcic"), - ZYDIS_MAKE_GENERATED_STRING("blcmsk"), - ZYDIS_MAKE_GENERATED_STRING("blcs"), - ZYDIS_MAKE_GENERATED_STRING("blendpd"), - ZYDIS_MAKE_GENERATED_STRING("blendps"), - ZYDIS_MAKE_GENERATED_STRING("blendvpd"), - ZYDIS_MAKE_GENERATED_STRING("blendvps"), - ZYDIS_MAKE_GENERATED_STRING("blsfill"), - ZYDIS_MAKE_GENERATED_STRING("blsi"), - ZYDIS_MAKE_GENERATED_STRING("blsic"), - ZYDIS_MAKE_GENERATED_STRING("blsmsk"), - ZYDIS_MAKE_GENERATED_STRING("blsr"), - ZYDIS_MAKE_GENERATED_STRING("bndcl"), - ZYDIS_MAKE_GENERATED_STRING("bndcn"), - ZYDIS_MAKE_GENERATED_STRING("bndcu"), - ZYDIS_MAKE_GENERATED_STRING("bndldx"), - ZYDIS_MAKE_GENERATED_STRING("bndmk"), - ZYDIS_MAKE_GENERATED_STRING("bndmov"), - ZYDIS_MAKE_GENERATED_STRING("bndstx"), - ZYDIS_MAKE_GENERATED_STRING("bound"), - ZYDIS_MAKE_GENERATED_STRING("bsf"), - ZYDIS_MAKE_GENERATED_STRING("bsr"), - ZYDIS_MAKE_GENERATED_STRING("bswap"), - ZYDIS_MAKE_GENERATED_STRING("bt"), - ZYDIS_MAKE_GENERATED_STRING("btc"), - ZYDIS_MAKE_GENERATED_STRING("btr"), - ZYDIS_MAKE_GENERATED_STRING("bts"), - ZYDIS_MAKE_GENERATED_STRING("bzhi"), - ZYDIS_MAKE_GENERATED_STRING("call"), - ZYDIS_MAKE_GENERATED_STRING("cbw"), - ZYDIS_MAKE_GENERATED_STRING("cdq"), - ZYDIS_MAKE_GENERATED_STRING("cdqe"), - ZYDIS_MAKE_GENERATED_STRING("clac"), - ZYDIS_MAKE_GENERATED_STRING("clc"), - ZYDIS_MAKE_GENERATED_STRING("cld"), - ZYDIS_MAKE_GENERATED_STRING("clevict0"), - ZYDIS_MAKE_GENERATED_STRING("clevict1"), - ZYDIS_MAKE_GENERATED_STRING("clflush"), - ZYDIS_MAKE_GENERATED_STRING("clflushopt"), - ZYDIS_MAKE_GENERATED_STRING("clgi"), - ZYDIS_MAKE_GENERATED_STRING("cli"), - ZYDIS_MAKE_GENERATED_STRING("clrssbsy"), - ZYDIS_MAKE_GENERATED_STRING("clts"), - ZYDIS_MAKE_GENERATED_STRING("clwb"), - ZYDIS_MAKE_GENERATED_STRING("clzero"), - ZYDIS_MAKE_GENERATED_STRING("cmc"), - ZYDIS_MAKE_GENERATED_STRING("cmovb"), - ZYDIS_MAKE_GENERATED_STRING("cmovbe"), - ZYDIS_MAKE_GENERATED_STRING("cmovl"), - ZYDIS_MAKE_GENERATED_STRING("cmovle"), - ZYDIS_MAKE_GENERATED_STRING("cmovnb"), - ZYDIS_MAKE_GENERATED_STRING("cmovnbe"), - ZYDIS_MAKE_GENERATED_STRING("cmovnl"), - ZYDIS_MAKE_GENERATED_STRING("cmovnle"), - ZYDIS_MAKE_GENERATED_STRING("cmovno"), - ZYDIS_MAKE_GENERATED_STRING("cmovnp"), - ZYDIS_MAKE_GENERATED_STRING("cmovns"), - ZYDIS_MAKE_GENERATED_STRING("cmovnz"), - ZYDIS_MAKE_GENERATED_STRING("cmovo"), - ZYDIS_MAKE_GENERATED_STRING("cmovp"), - ZYDIS_MAKE_GENERATED_STRING("cmovs"), - ZYDIS_MAKE_GENERATED_STRING("cmovz"), - ZYDIS_MAKE_GENERATED_STRING("cmp"), - ZYDIS_MAKE_GENERATED_STRING("cmppd"), - ZYDIS_MAKE_GENERATED_STRING("cmpps"), - ZYDIS_MAKE_GENERATED_STRING("cmpsb"), - ZYDIS_MAKE_GENERATED_STRING("cmpsd"), - ZYDIS_MAKE_GENERATED_STRING("cmpsq"), - ZYDIS_MAKE_GENERATED_STRING("cmpss"), - ZYDIS_MAKE_GENERATED_STRING("cmpsw"), - ZYDIS_MAKE_GENERATED_STRING("cmpxchg"), - ZYDIS_MAKE_GENERATED_STRING("cmpxchg16b"), - ZYDIS_MAKE_GENERATED_STRING("cmpxchg8b"), - ZYDIS_MAKE_GENERATED_STRING("comisd"), - ZYDIS_MAKE_GENERATED_STRING("comiss"), - ZYDIS_MAKE_GENERATED_STRING("cpuid"), - ZYDIS_MAKE_GENERATED_STRING("cqo"), - ZYDIS_MAKE_GENERATED_STRING("crc32"), - ZYDIS_MAKE_GENERATED_STRING("cvtdq2pd"), - ZYDIS_MAKE_GENERATED_STRING("cvtdq2ps"), - ZYDIS_MAKE_GENERATED_STRING("cvtpd2dq"), - ZYDIS_MAKE_GENERATED_STRING("cvtpd2pi"), - ZYDIS_MAKE_GENERATED_STRING("cvtpd2ps"), - ZYDIS_MAKE_GENERATED_STRING("cvtpi2pd"), - ZYDIS_MAKE_GENERATED_STRING("cvtpi2ps"), - ZYDIS_MAKE_GENERATED_STRING("cvtps2dq"), - ZYDIS_MAKE_GENERATED_STRING("cvtps2pd"), - ZYDIS_MAKE_GENERATED_STRING("cvtps2pi"), - ZYDIS_MAKE_GENERATED_STRING("cvtsd2si"), - ZYDIS_MAKE_GENERATED_STRING("cvtsd2ss"), - ZYDIS_MAKE_GENERATED_STRING("cvtsi2sd"), - ZYDIS_MAKE_GENERATED_STRING("cvtsi2ss"), - ZYDIS_MAKE_GENERATED_STRING("cvtss2sd"), - ZYDIS_MAKE_GENERATED_STRING("cvtss2si"), - ZYDIS_MAKE_GENERATED_STRING("cvttpd2dq"), - ZYDIS_MAKE_GENERATED_STRING("cvttpd2pi"), - ZYDIS_MAKE_GENERATED_STRING("cvttps2dq"), - ZYDIS_MAKE_GENERATED_STRING("cvttps2pi"), - ZYDIS_MAKE_GENERATED_STRING("cvttsd2si"), - ZYDIS_MAKE_GENERATED_STRING("cvttss2si"), - ZYDIS_MAKE_GENERATED_STRING("cwd"), - ZYDIS_MAKE_GENERATED_STRING("cwde"), - ZYDIS_MAKE_GENERATED_STRING("daa"), - ZYDIS_MAKE_GENERATED_STRING("das"), - ZYDIS_MAKE_GENERATED_STRING("dec"), - ZYDIS_MAKE_GENERATED_STRING("delay"), - ZYDIS_MAKE_GENERATED_STRING("div"), - ZYDIS_MAKE_GENERATED_STRING("divpd"), - ZYDIS_MAKE_GENERATED_STRING("divps"), - ZYDIS_MAKE_GENERATED_STRING("divsd"), - ZYDIS_MAKE_GENERATED_STRING("divss"), - ZYDIS_MAKE_GENERATED_STRING("dppd"), - ZYDIS_MAKE_GENERATED_STRING("dpps"), - ZYDIS_MAKE_GENERATED_STRING("emms"), - ZYDIS_MAKE_GENERATED_STRING("encls"), - ZYDIS_MAKE_GENERATED_STRING("enclu"), - ZYDIS_MAKE_GENERATED_STRING("endbr32"), - ZYDIS_MAKE_GENERATED_STRING("endbr64"), - ZYDIS_MAKE_GENERATED_STRING("enter"), - ZYDIS_MAKE_GENERATED_STRING("extractps"), - ZYDIS_MAKE_GENERATED_STRING("f2xm1"), - ZYDIS_MAKE_GENERATED_STRING("fabs"), - ZYDIS_MAKE_GENERATED_STRING("fadd"), - ZYDIS_MAKE_GENERATED_STRING("faddp"), - ZYDIS_MAKE_GENERATED_STRING("fbld"), - ZYDIS_MAKE_GENERATED_STRING("fbstp"), - ZYDIS_MAKE_GENERATED_STRING("fchs"), - ZYDIS_MAKE_GENERATED_STRING("fcmovb"), - ZYDIS_MAKE_GENERATED_STRING("fcmovbe"), - ZYDIS_MAKE_GENERATED_STRING("fcmove"), - ZYDIS_MAKE_GENERATED_STRING("fcmovnb"), - ZYDIS_MAKE_GENERATED_STRING("fcmovnbe"), - ZYDIS_MAKE_GENERATED_STRING("fcmovne"), - ZYDIS_MAKE_GENERATED_STRING("fcmovnu"), - ZYDIS_MAKE_GENERATED_STRING("fcmovu"), - ZYDIS_MAKE_GENERATED_STRING("fcom"), - ZYDIS_MAKE_GENERATED_STRING("fcomi"), - ZYDIS_MAKE_GENERATED_STRING("fcomip"), - ZYDIS_MAKE_GENERATED_STRING("fcomp"), - ZYDIS_MAKE_GENERATED_STRING("fcompp"), - ZYDIS_MAKE_GENERATED_STRING("fcos"), - ZYDIS_MAKE_GENERATED_STRING("fdecstp"), - ZYDIS_MAKE_GENERATED_STRING("fdisi8087_nop"), - ZYDIS_MAKE_GENERATED_STRING("fdiv"), - ZYDIS_MAKE_GENERATED_STRING("fdivp"), - ZYDIS_MAKE_GENERATED_STRING("fdivr"), - ZYDIS_MAKE_GENERATED_STRING("fdivrp"), - ZYDIS_MAKE_GENERATED_STRING("femms"), - ZYDIS_MAKE_GENERATED_STRING("feni8087_nop"), - ZYDIS_MAKE_GENERATED_STRING("ffree"), - ZYDIS_MAKE_GENERATED_STRING("ffreep"), - ZYDIS_MAKE_GENERATED_STRING("fiadd"), - ZYDIS_MAKE_GENERATED_STRING("ficom"), - ZYDIS_MAKE_GENERATED_STRING("ficomp"), - ZYDIS_MAKE_GENERATED_STRING("fidiv"), - ZYDIS_MAKE_GENERATED_STRING("fidivr"), - ZYDIS_MAKE_GENERATED_STRING("fild"), - ZYDIS_MAKE_GENERATED_STRING("fimul"), - ZYDIS_MAKE_GENERATED_STRING("fincstp"), - ZYDIS_MAKE_GENERATED_STRING("fist"), - ZYDIS_MAKE_GENERATED_STRING("fistp"), - ZYDIS_MAKE_GENERATED_STRING("fisttp"), - ZYDIS_MAKE_GENERATED_STRING("fisub"), - ZYDIS_MAKE_GENERATED_STRING("fisubr"), - ZYDIS_MAKE_GENERATED_STRING("fld"), - ZYDIS_MAKE_GENERATED_STRING("fld1"), - ZYDIS_MAKE_GENERATED_STRING("fldcw"), - ZYDIS_MAKE_GENERATED_STRING("fldenv"), - ZYDIS_MAKE_GENERATED_STRING("fldl2e"), - ZYDIS_MAKE_GENERATED_STRING("fldl2t"), - ZYDIS_MAKE_GENERATED_STRING("fldlg2"), - ZYDIS_MAKE_GENERATED_STRING("fldln2"), - ZYDIS_MAKE_GENERATED_STRING("fldpi"), - ZYDIS_MAKE_GENERATED_STRING("fldz"), - ZYDIS_MAKE_GENERATED_STRING("fmul"), - ZYDIS_MAKE_GENERATED_STRING("fmulp"), - ZYDIS_MAKE_GENERATED_STRING("fnclex"), - ZYDIS_MAKE_GENERATED_STRING("fninit"), - ZYDIS_MAKE_GENERATED_STRING("fnop"), - ZYDIS_MAKE_GENERATED_STRING("fnsave"), - ZYDIS_MAKE_GENERATED_STRING("fnstcw"), - ZYDIS_MAKE_GENERATED_STRING("fnstenv"), - ZYDIS_MAKE_GENERATED_STRING("fnstsw"), - ZYDIS_MAKE_GENERATED_STRING("fpatan"), - ZYDIS_MAKE_GENERATED_STRING("fprem"), - ZYDIS_MAKE_GENERATED_STRING("fprem1"), - ZYDIS_MAKE_GENERATED_STRING("fptan"), - ZYDIS_MAKE_GENERATED_STRING("frndint"), - ZYDIS_MAKE_GENERATED_STRING("frstor"), - ZYDIS_MAKE_GENERATED_STRING("fscale"), - ZYDIS_MAKE_GENERATED_STRING("fsetpm287_nop"), - ZYDIS_MAKE_GENERATED_STRING("fsin"), - ZYDIS_MAKE_GENERATED_STRING("fsincos"), - ZYDIS_MAKE_GENERATED_STRING("fsqrt"), - ZYDIS_MAKE_GENERATED_STRING("fst"), - ZYDIS_MAKE_GENERATED_STRING("fstp"), - ZYDIS_MAKE_GENERATED_STRING("fstpnce"), - ZYDIS_MAKE_GENERATED_STRING("fsub"), - ZYDIS_MAKE_GENERATED_STRING("fsubp"), - ZYDIS_MAKE_GENERATED_STRING("fsubr"), - ZYDIS_MAKE_GENERATED_STRING("fsubrp"), - ZYDIS_MAKE_GENERATED_STRING("ftst"), - ZYDIS_MAKE_GENERATED_STRING("fucom"), - ZYDIS_MAKE_GENERATED_STRING("fucomi"), - ZYDIS_MAKE_GENERATED_STRING("fucomip"), - ZYDIS_MAKE_GENERATED_STRING("fucomp"), - ZYDIS_MAKE_GENERATED_STRING("fucompp"), - ZYDIS_MAKE_GENERATED_STRING("fwait"), - ZYDIS_MAKE_GENERATED_STRING("fxam"), - ZYDIS_MAKE_GENERATED_STRING("fxch"), - ZYDIS_MAKE_GENERATED_STRING("fxrstor"), - ZYDIS_MAKE_GENERATED_STRING("fxrstor64"), - ZYDIS_MAKE_GENERATED_STRING("fxsave"), - ZYDIS_MAKE_GENERATED_STRING("fxsave64"), - ZYDIS_MAKE_GENERATED_STRING("fxtract"), - ZYDIS_MAKE_GENERATED_STRING("fyl2x"), - ZYDIS_MAKE_GENERATED_STRING("fyl2xp1"), - ZYDIS_MAKE_GENERATED_STRING("getsec"), - ZYDIS_MAKE_GENERATED_STRING("gf2p8affineinvqb"), - ZYDIS_MAKE_GENERATED_STRING("gf2p8affineqb"), - ZYDIS_MAKE_GENERATED_STRING("gf2p8mulb"), - ZYDIS_MAKE_GENERATED_STRING("haddpd"), - ZYDIS_MAKE_GENERATED_STRING("haddps"), - ZYDIS_MAKE_GENERATED_STRING("hlt"), - ZYDIS_MAKE_GENERATED_STRING("hsubpd"), - ZYDIS_MAKE_GENERATED_STRING("hsubps"), - ZYDIS_MAKE_GENERATED_STRING("idiv"), - ZYDIS_MAKE_GENERATED_STRING("imul"), - ZYDIS_MAKE_GENERATED_STRING("in"), - ZYDIS_MAKE_GENERATED_STRING("inc"), - ZYDIS_MAKE_GENERATED_STRING("incsspd"), - ZYDIS_MAKE_GENERATED_STRING("incsspq"), - ZYDIS_MAKE_GENERATED_STRING("insb"), - ZYDIS_MAKE_GENERATED_STRING("insd"), - ZYDIS_MAKE_GENERATED_STRING("insertps"), - ZYDIS_MAKE_GENERATED_STRING("insw"), - ZYDIS_MAKE_GENERATED_STRING("int"), - ZYDIS_MAKE_GENERATED_STRING("int1"), - ZYDIS_MAKE_GENERATED_STRING("int3"), - ZYDIS_MAKE_GENERATED_STRING("into"), - ZYDIS_MAKE_GENERATED_STRING("invd"), - ZYDIS_MAKE_GENERATED_STRING("invept"), - ZYDIS_MAKE_GENERATED_STRING("invlpg"), - ZYDIS_MAKE_GENERATED_STRING("invlpga"), - ZYDIS_MAKE_GENERATED_STRING("invpcid"), - ZYDIS_MAKE_GENERATED_STRING("invvpid"), - ZYDIS_MAKE_GENERATED_STRING("iret"), - ZYDIS_MAKE_GENERATED_STRING("iretd"), - ZYDIS_MAKE_GENERATED_STRING("iretq"), - ZYDIS_MAKE_GENERATED_STRING("jb"), - ZYDIS_MAKE_GENERATED_STRING("jbe"), - ZYDIS_MAKE_GENERATED_STRING("jcxz"), - ZYDIS_MAKE_GENERATED_STRING("jecxz"), - ZYDIS_MAKE_GENERATED_STRING("jknzd"), - ZYDIS_MAKE_GENERATED_STRING("jkzd"), - ZYDIS_MAKE_GENERATED_STRING("jl"), - ZYDIS_MAKE_GENERATED_STRING("jle"), - ZYDIS_MAKE_GENERATED_STRING("jmp"), - ZYDIS_MAKE_GENERATED_STRING("jnb"), - ZYDIS_MAKE_GENERATED_STRING("jnbe"), - ZYDIS_MAKE_GENERATED_STRING("jnl"), - ZYDIS_MAKE_GENERATED_STRING("jnle"), - ZYDIS_MAKE_GENERATED_STRING("jno"), - ZYDIS_MAKE_GENERATED_STRING("jnp"), - ZYDIS_MAKE_GENERATED_STRING("jns"), - ZYDIS_MAKE_GENERATED_STRING("jnz"), - ZYDIS_MAKE_GENERATED_STRING("jo"), - ZYDIS_MAKE_GENERATED_STRING("jp"), - ZYDIS_MAKE_GENERATED_STRING("jrcxz"), - ZYDIS_MAKE_GENERATED_STRING("js"), - ZYDIS_MAKE_GENERATED_STRING("jz"), - ZYDIS_MAKE_GENERATED_STRING("kaddb"), - ZYDIS_MAKE_GENERATED_STRING("kaddd"), - ZYDIS_MAKE_GENERATED_STRING("kaddq"), - ZYDIS_MAKE_GENERATED_STRING("kaddw"), - ZYDIS_MAKE_GENERATED_STRING("kand"), - ZYDIS_MAKE_GENERATED_STRING("kandb"), - ZYDIS_MAKE_GENERATED_STRING("kandd"), - ZYDIS_MAKE_GENERATED_STRING("kandn"), - ZYDIS_MAKE_GENERATED_STRING("kandnb"), - ZYDIS_MAKE_GENERATED_STRING("kandnd"), - ZYDIS_MAKE_GENERATED_STRING("kandnq"), - ZYDIS_MAKE_GENERATED_STRING("kandnr"), - ZYDIS_MAKE_GENERATED_STRING("kandnw"), - ZYDIS_MAKE_GENERATED_STRING("kandq"), - ZYDIS_MAKE_GENERATED_STRING("kandw"), - ZYDIS_MAKE_GENERATED_STRING("kconcath"), - ZYDIS_MAKE_GENERATED_STRING("kconcatl"), - ZYDIS_MAKE_GENERATED_STRING("kextract"), - ZYDIS_MAKE_GENERATED_STRING("kmerge2l1h"), - ZYDIS_MAKE_GENERATED_STRING("kmerge2l1l"), - ZYDIS_MAKE_GENERATED_STRING("kmov"), - ZYDIS_MAKE_GENERATED_STRING("kmovb"), - ZYDIS_MAKE_GENERATED_STRING("kmovd"), - ZYDIS_MAKE_GENERATED_STRING("kmovq"), - ZYDIS_MAKE_GENERATED_STRING("kmovw"), - ZYDIS_MAKE_GENERATED_STRING("knot"), - ZYDIS_MAKE_GENERATED_STRING("knotb"), - ZYDIS_MAKE_GENERATED_STRING("knotd"), - ZYDIS_MAKE_GENERATED_STRING("knotq"), - ZYDIS_MAKE_GENERATED_STRING("knotw"), - ZYDIS_MAKE_GENERATED_STRING("kor"), - ZYDIS_MAKE_GENERATED_STRING("korb"), - ZYDIS_MAKE_GENERATED_STRING("kord"), - ZYDIS_MAKE_GENERATED_STRING("korq"), - ZYDIS_MAKE_GENERATED_STRING("kortest"), - ZYDIS_MAKE_GENERATED_STRING("kortestb"), - ZYDIS_MAKE_GENERATED_STRING("kortestd"), - ZYDIS_MAKE_GENERATED_STRING("kortestq"), - ZYDIS_MAKE_GENERATED_STRING("kortestw"), - ZYDIS_MAKE_GENERATED_STRING("korw"), - ZYDIS_MAKE_GENERATED_STRING("kshiftlb"), - ZYDIS_MAKE_GENERATED_STRING("kshiftld"), - ZYDIS_MAKE_GENERATED_STRING("kshiftlq"), - ZYDIS_MAKE_GENERATED_STRING("kshiftlw"), - ZYDIS_MAKE_GENERATED_STRING("kshiftrb"), - ZYDIS_MAKE_GENERATED_STRING("kshiftrd"), - ZYDIS_MAKE_GENERATED_STRING("kshiftrq"), - ZYDIS_MAKE_GENERATED_STRING("kshiftrw"), - ZYDIS_MAKE_GENERATED_STRING("ktestb"), - ZYDIS_MAKE_GENERATED_STRING("ktestd"), - ZYDIS_MAKE_GENERATED_STRING("ktestq"), - ZYDIS_MAKE_GENERATED_STRING("ktestw"), - ZYDIS_MAKE_GENERATED_STRING("kunpckbw"), - ZYDIS_MAKE_GENERATED_STRING("kunpckdq"), - ZYDIS_MAKE_GENERATED_STRING("kunpckwd"), - ZYDIS_MAKE_GENERATED_STRING("kxnor"), - ZYDIS_MAKE_GENERATED_STRING("kxnorb"), - ZYDIS_MAKE_GENERATED_STRING("kxnord"), - ZYDIS_MAKE_GENERATED_STRING("kxnorq"), - ZYDIS_MAKE_GENERATED_STRING("kxnorw"), - ZYDIS_MAKE_GENERATED_STRING("kxor"), - ZYDIS_MAKE_GENERATED_STRING("kxorb"), - ZYDIS_MAKE_GENERATED_STRING("kxord"), - ZYDIS_MAKE_GENERATED_STRING("kxorq"), - ZYDIS_MAKE_GENERATED_STRING("kxorw"), - ZYDIS_MAKE_GENERATED_STRING("lahf"), - ZYDIS_MAKE_GENERATED_STRING("lar"), - ZYDIS_MAKE_GENERATED_STRING("lddqu"), - ZYDIS_MAKE_GENERATED_STRING("ldmxcsr"), - ZYDIS_MAKE_GENERATED_STRING("lds"), - ZYDIS_MAKE_GENERATED_STRING("lea"), - ZYDIS_MAKE_GENERATED_STRING("leave"), - ZYDIS_MAKE_GENERATED_STRING("les"), - ZYDIS_MAKE_GENERATED_STRING("lfence"), - ZYDIS_MAKE_GENERATED_STRING("lfs"), - ZYDIS_MAKE_GENERATED_STRING("lgdt"), - ZYDIS_MAKE_GENERATED_STRING("lgs"), - ZYDIS_MAKE_GENERATED_STRING("lidt"), - ZYDIS_MAKE_GENERATED_STRING("lldt"), - ZYDIS_MAKE_GENERATED_STRING("llwpcb"), - ZYDIS_MAKE_GENERATED_STRING("lmsw"), - ZYDIS_MAKE_GENERATED_STRING("lodsb"), - ZYDIS_MAKE_GENERATED_STRING("lodsd"), - ZYDIS_MAKE_GENERATED_STRING("lodsq"), - ZYDIS_MAKE_GENERATED_STRING("lodsw"), - ZYDIS_MAKE_GENERATED_STRING("loop"), - ZYDIS_MAKE_GENERATED_STRING("loope"), - ZYDIS_MAKE_GENERATED_STRING("loopne"), - ZYDIS_MAKE_GENERATED_STRING("lsl"), - ZYDIS_MAKE_GENERATED_STRING("lss"), - ZYDIS_MAKE_GENERATED_STRING("ltr"), - ZYDIS_MAKE_GENERATED_STRING("lwpins"), - ZYDIS_MAKE_GENERATED_STRING("lwpval"), - ZYDIS_MAKE_GENERATED_STRING("lzcnt"), - ZYDIS_MAKE_GENERATED_STRING("maskmovdqu"), - ZYDIS_MAKE_GENERATED_STRING("maskmovq"), - ZYDIS_MAKE_GENERATED_STRING("maxpd"), - ZYDIS_MAKE_GENERATED_STRING("maxps"), - ZYDIS_MAKE_GENERATED_STRING("maxsd"), - ZYDIS_MAKE_GENERATED_STRING("maxss"), - ZYDIS_MAKE_GENERATED_STRING("mfence"), - ZYDIS_MAKE_GENERATED_STRING("minpd"), - ZYDIS_MAKE_GENERATED_STRING("minps"), - ZYDIS_MAKE_GENERATED_STRING("minsd"), - ZYDIS_MAKE_GENERATED_STRING("minss"), - ZYDIS_MAKE_GENERATED_STRING("monitor"), - ZYDIS_MAKE_GENERATED_STRING("mov"), - ZYDIS_MAKE_GENERATED_STRING("movapd"), - ZYDIS_MAKE_GENERATED_STRING("movaps"), - ZYDIS_MAKE_GENERATED_STRING("movbe"), - ZYDIS_MAKE_GENERATED_STRING("movd"), - ZYDIS_MAKE_GENERATED_STRING("movddup"), - ZYDIS_MAKE_GENERATED_STRING("movdq2q"), - ZYDIS_MAKE_GENERATED_STRING("movdqa"), - ZYDIS_MAKE_GENERATED_STRING("movdqu"), - ZYDIS_MAKE_GENERATED_STRING("movhlps"), - ZYDIS_MAKE_GENERATED_STRING("movhpd"), - ZYDIS_MAKE_GENERATED_STRING("movhps"), - ZYDIS_MAKE_GENERATED_STRING("movlhps"), - ZYDIS_MAKE_GENERATED_STRING("movlpd"), - ZYDIS_MAKE_GENERATED_STRING("movlps"), - ZYDIS_MAKE_GENERATED_STRING("movmskpd"), - ZYDIS_MAKE_GENERATED_STRING("movmskps"), - ZYDIS_MAKE_GENERATED_STRING("movntdq"), - ZYDIS_MAKE_GENERATED_STRING("movntdqa"), - ZYDIS_MAKE_GENERATED_STRING("movnti"), - ZYDIS_MAKE_GENERATED_STRING("movntpd"), - ZYDIS_MAKE_GENERATED_STRING("movntps"), - ZYDIS_MAKE_GENERATED_STRING("movntq"), - ZYDIS_MAKE_GENERATED_STRING("movq"), - ZYDIS_MAKE_GENERATED_STRING("movq2dq"), - ZYDIS_MAKE_GENERATED_STRING("movsb"), - ZYDIS_MAKE_GENERATED_STRING("movsd"), - ZYDIS_MAKE_GENERATED_STRING("movshdup"), - ZYDIS_MAKE_GENERATED_STRING("movsldup"), - ZYDIS_MAKE_GENERATED_STRING("movsq"), - ZYDIS_MAKE_GENERATED_STRING("movss"), - ZYDIS_MAKE_GENERATED_STRING("movsw"), - ZYDIS_MAKE_GENERATED_STRING("movsx"), - ZYDIS_MAKE_GENERATED_STRING("movsxd"), - ZYDIS_MAKE_GENERATED_STRING("movupd"), - ZYDIS_MAKE_GENERATED_STRING("movups"), - ZYDIS_MAKE_GENERATED_STRING("movzx"), - ZYDIS_MAKE_GENERATED_STRING("mpsadbw"), - ZYDIS_MAKE_GENERATED_STRING("mul"), - ZYDIS_MAKE_GENERATED_STRING("mulpd"), - ZYDIS_MAKE_GENERATED_STRING("mulps"), - ZYDIS_MAKE_GENERATED_STRING("mulsd"), - ZYDIS_MAKE_GENERATED_STRING("mulss"), - ZYDIS_MAKE_GENERATED_STRING("mulx"), - ZYDIS_MAKE_GENERATED_STRING("mwait"), - ZYDIS_MAKE_GENERATED_STRING("neg"), - ZYDIS_MAKE_GENERATED_STRING("nop"), - ZYDIS_MAKE_GENERATED_STRING("not"), - ZYDIS_MAKE_GENERATED_STRING("or"), - ZYDIS_MAKE_GENERATED_STRING("orpd"), - ZYDIS_MAKE_GENERATED_STRING("orps"), - ZYDIS_MAKE_GENERATED_STRING("out"), - ZYDIS_MAKE_GENERATED_STRING("outsb"), - ZYDIS_MAKE_GENERATED_STRING("outsd"), - ZYDIS_MAKE_GENERATED_STRING("outsw"), - ZYDIS_MAKE_GENERATED_STRING("pabsb"), - ZYDIS_MAKE_GENERATED_STRING("pabsd"), - ZYDIS_MAKE_GENERATED_STRING("pabsw"), - ZYDIS_MAKE_GENERATED_STRING("packssdw"), - ZYDIS_MAKE_GENERATED_STRING("packsswb"), - ZYDIS_MAKE_GENERATED_STRING("packusdw"), - ZYDIS_MAKE_GENERATED_STRING("packuswb"), - ZYDIS_MAKE_GENERATED_STRING("paddb"), - ZYDIS_MAKE_GENERATED_STRING("paddd"), - ZYDIS_MAKE_GENERATED_STRING("paddq"), - ZYDIS_MAKE_GENERATED_STRING("paddsb"), - ZYDIS_MAKE_GENERATED_STRING("paddsw"), - ZYDIS_MAKE_GENERATED_STRING("paddusb"), - ZYDIS_MAKE_GENERATED_STRING("paddusw"), - ZYDIS_MAKE_GENERATED_STRING("paddw"), - ZYDIS_MAKE_GENERATED_STRING("palignr"), - ZYDIS_MAKE_GENERATED_STRING("pand"), - ZYDIS_MAKE_GENERATED_STRING("pandn"), - ZYDIS_MAKE_GENERATED_STRING("pause"), - ZYDIS_MAKE_GENERATED_STRING("pavgb"), - ZYDIS_MAKE_GENERATED_STRING("pavgusb"), - ZYDIS_MAKE_GENERATED_STRING("pavgw"), - ZYDIS_MAKE_GENERATED_STRING("pblendvb"), - ZYDIS_MAKE_GENERATED_STRING("pblendw"), - ZYDIS_MAKE_GENERATED_STRING("pclmulqdq"), - ZYDIS_MAKE_GENERATED_STRING("pcmpeqb"), - ZYDIS_MAKE_GENERATED_STRING("pcmpeqd"), - ZYDIS_MAKE_GENERATED_STRING("pcmpeqq"), - ZYDIS_MAKE_GENERATED_STRING("pcmpeqw"), - ZYDIS_MAKE_GENERATED_STRING("pcmpestri"), - ZYDIS_MAKE_GENERATED_STRING("pcmpestrm"), - ZYDIS_MAKE_GENERATED_STRING("pcmpgtb"), - ZYDIS_MAKE_GENERATED_STRING("pcmpgtd"), - ZYDIS_MAKE_GENERATED_STRING("pcmpgtq"), - ZYDIS_MAKE_GENERATED_STRING("pcmpgtw"), - ZYDIS_MAKE_GENERATED_STRING("pcmpistri"), - ZYDIS_MAKE_GENERATED_STRING("pcmpistrm"), - ZYDIS_MAKE_GENERATED_STRING("pdep"), - ZYDIS_MAKE_GENERATED_STRING("pext"), - ZYDIS_MAKE_GENERATED_STRING("pextrb"), - ZYDIS_MAKE_GENERATED_STRING("pextrd"), - ZYDIS_MAKE_GENERATED_STRING("pextrq"), - ZYDIS_MAKE_GENERATED_STRING("pextrw"), - ZYDIS_MAKE_GENERATED_STRING("pf2id"), - ZYDIS_MAKE_GENERATED_STRING("pf2iw"), - ZYDIS_MAKE_GENERATED_STRING("pfacc"), - ZYDIS_MAKE_GENERATED_STRING("pfadd"), - ZYDIS_MAKE_GENERATED_STRING("pfcmpeq"), - ZYDIS_MAKE_GENERATED_STRING("pfcmpge"), - ZYDIS_MAKE_GENERATED_STRING("pfcmpgt"), - ZYDIS_MAKE_GENERATED_STRING("pfcpit1"), - ZYDIS_MAKE_GENERATED_STRING("pfmax"), - ZYDIS_MAKE_GENERATED_STRING("pfmin"), - ZYDIS_MAKE_GENERATED_STRING("pfmul"), - ZYDIS_MAKE_GENERATED_STRING("pfnacc"), - ZYDIS_MAKE_GENERATED_STRING("pfpnacc"), - ZYDIS_MAKE_GENERATED_STRING("pfrcp"), - ZYDIS_MAKE_GENERATED_STRING("pfrcpit2"), - ZYDIS_MAKE_GENERATED_STRING("pfrsqit1"), - ZYDIS_MAKE_GENERATED_STRING("pfsqrt"), - ZYDIS_MAKE_GENERATED_STRING("pfsub"), - ZYDIS_MAKE_GENERATED_STRING("pfsubr"), - ZYDIS_MAKE_GENERATED_STRING("phaddd"), - ZYDIS_MAKE_GENERATED_STRING("phaddsw"), - ZYDIS_MAKE_GENERATED_STRING("phaddw"), - ZYDIS_MAKE_GENERATED_STRING("phminposuw"), - ZYDIS_MAKE_GENERATED_STRING("phsubd"), - ZYDIS_MAKE_GENERATED_STRING("phsubsw"), - ZYDIS_MAKE_GENERATED_STRING("phsubw"), - ZYDIS_MAKE_GENERATED_STRING("pi2fd"), - ZYDIS_MAKE_GENERATED_STRING("pi2fw"), - ZYDIS_MAKE_GENERATED_STRING("pinsrb"), - ZYDIS_MAKE_GENERATED_STRING("pinsrd"), - ZYDIS_MAKE_GENERATED_STRING("pinsrq"), - ZYDIS_MAKE_GENERATED_STRING("pinsrw"), - ZYDIS_MAKE_GENERATED_STRING("pmaddubsw"), - ZYDIS_MAKE_GENERATED_STRING("pmaddwd"), - ZYDIS_MAKE_GENERATED_STRING("pmaxsb"), - ZYDIS_MAKE_GENERATED_STRING("pmaxsd"), - ZYDIS_MAKE_GENERATED_STRING("pmaxsw"), - ZYDIS_MAKE_GENERATED_STRING("pmaxub"), - ZYDIS_MAKE_GENERATED_STRING("pmaxud"), - ZYDIS_MAKE_GENERATED_STRING("pmaxuw"), - ZYDIS_MAKE_GENERATED_STRING("pminsb"), - ZYDIS_MAKE_GENERATED_STRING("pminsd"), - ZYDIS_MAKE_GENERATED_STRING("pminsw"), - ZYDIS_MAKE_GENERATED_STRING("pminub"), - ZYDIS_MAKE_GENERATED_STRING("pminud"), - ZYDIS_MAKE_GENERATED_STRING("pminuw"), - ZYDIS_MAKE_GENERATED_STRING("pmovmskb"), - ZYDIS_MAKE_GENERATED_STRING("pmovsxbd"), - ZYDIS_MAKE_GENERATED_STRING("pmovsxbq"), - ZYDIS_MAKE_GENERATED_STRING("pmovsxbw"), - ZYDIS_MAKE_GENERATED_STRING("pmovsxdq"), - ZYDIS_MAKE_GENERATED_STRING("pmovsxwd"), - ZYDIS_MAKE_GENERATED_STRING("pmovsxwq"), - ZYDIS_MAKE_GENERATED_STRING("pmovzxbd"), - ZYDIS_MAKE_GENERATED_STRING("pmovzxbq"), - ZYDIS_MAKE_GENERATED_STRING("pmovzxbw"), - ZYDIS_MAKE_GENERATED_STRING("pmovzxdq"), - ZYDIS_MAKE_GENERATED_STRING("pmovzxwd"), - ZYDIS_MAKE_GENERATED_STRING("pmovzxwq"), - ZYDIS_MAKE_GENERATED_STRING("pmuldq"), - ZYDIS_MAKE_GENERATED_STRING("pmulhrsw"), - ZYDIS_MAKE_GENERATED_STRING("pmulhrw"), - ZYDIS_MAKE_GENERATED_STRING("pmulhuw"), - ZYDIS_MAKE_GENERATED_STRING("pmulhw"), - ZYDIS_MAKE_GENERATED_STRING("pmulld"), - ZYDIS_MAKE_GENERATED_STRING("pmullw"), - ZYDIS_MAKE_GENERATED_STRING("pmuludq"), - ZYDIS_MAKE_GENERATED_STRING("pop"), - ZYDIS_MAKE_GENERATED_STRING("popa"), - ZYDIS_MAKE_GENERATED_STRING("popad"), - ZYDIS_MAKE_GENERATED_STRING("popcnt"), - ZYDIS_MAKE_GENERATED_STRING("popf"), - ZYDIS_MAKE_GENERATED_STRING("popfd"), - ZYDIS_MAKE_GENERATED_STRING("popfq"), - ZYDIS_MAKE_GENERATED_STRING("por"), - ZYDIS_MAKE_GENERATED_STRING("prefetch"), - ZYDIS_MAKE_GENERATED_STRING("prefetchnta"), - ZYDIS_MAKE_GENERATED_STRING("prefetcht0"), - ZYDIS_MAKE_GENERATED_STRING("prefetcht1"), - ZYDIS_MAKE_GENERATED_STRING("prefetcht2"), - ZYDIS_MAKE_GENERATED_STRING("prefetchw"), - ZYDIS_MAKE_GENERATED_STRING("prefetchwt1"), - ZYDIS_MAKE_GENERATED_STRING("psadbw"), - ZYDIS_MAKE_GENERATED_STRING("pshufb"), - ZYDIS_MAKE_GENERATED_STRING("pshufd"), - ZYDIS_MAKE_GENERATED_STRING("pshufhw"), - ZYDIS_MAKE_GENERATED_STRING("pshuflw"), - ZYDIS_MAKE_GENERATED_STRING("pshufw"), - ZYDIS_MAKE_GENERATED_STRING("psignb"), - ZYDIS_MAKE_GENERATED_STRING("psignd"), - ZYDIS_MAKE_GENERATED_STRING("psignw"), - ZYDIS_MAKE_GENERATED_STRING("pslld"), - ZYDIS_MAKE_GENERATED_STRING("pslldq"), - ZYDIS_MAKE_GENERATED_STRING("psllq"), - ZYDIS_MAKE_GENERATED_STRING("psllw"), - ZYDIS_MAKE_GENERATED_STRING("psrad"), - ZYDIS_MAKE_GENERATED_STRING("psraw"), - ZYDIS_MAKE_GENERATED_STRING("psrld"), - ZYDIS_MAKE_GENERATED_STRING("psrldq"), - ZYDIS_MAKE_GENERATED_STRING("psrlq"), - ZYDIS_MAKE_GENERATED_STRING("psrlw"), - ZYDIS_MAKE_GENERATED_STRING("psubb"), - ZYDIS_MAKE_GENERATED_STRING("psubd"), - ZYDIS_MAKE_GENERATED_STRING("psubq"), - ZYDIS_MAKE_GENERATED_STRING("psubsb"), - ZYDIS_MAKE_GENERATED_STRING("psubsw"), - ZYDIS_MAKE_GENERATED_STRING("psubusb"), - ZYDIS_MAKE_GENERATED_STRING("psubusw"), - ZYDIS_MAKE_GENERATED_STRING("psubw"), - ZYDIS_MAKE_GENERATED_STRING("pswapd"), - ZYDIS_MAKE_GENERATED_STRING("ptest"), - ZYDIS_MAKE_GENERATED_STRING("ptwrite"), - ZYDIS_MAKE_GENERATED_STRING("punpckhbw"), - ZYDIS_MAKE_GENERATED_STRING("punpckhdq"), - ZYDIS_MAKE_GENERATED_STRING("punpckhqdq"), - ZYDIS_MAKE_GENERATED_STRING("punpckhwd"), - ZYDIS_MAKE_GENERATED_STRING("punpcklbw"), - ZYDIS_MAKE_GENERATED_STRING("punpckldq"), - ZYDIS_MAKE_GENERATED_STRING("punpcklqdq"), - ZYDIS_MAKE_GENERATED_STRING("punpcklwd"), - ZYDIS_MAKE_GENERATED_STRING("push"), - ZYDIS_MAKE_GENERATED_STRING("pusha"), - ZYDIS_MAKE_GENERATED_STRING("pushad"), - ZYDIS_MAKE_GENERATED_STRING("pushf"), - ZYDIS_MAKE_GENERATED_STRING("pushfd"), - ZYDIS_MAKE_GENERATED_STRING("pushfq"), - ZYDIS_MAKE_GENERATED_STRING("pxor"), - ZYDIS_MAKE_GENERATED_STRING("rcl"), - ZYDIS_MAKE_GENERATED_STRING("rcpps"), - ZYDIS_MAKE_GENERATED_STRING("rcpss"), - ZYDIS_MAKE_GENERATED_STRING("rcr"), - ZYDIS_MAKE_GENERATED_STRING("rdfsbase"), - ZYDIS_MAKE_GENERATED_STRING("rdgsbase"), - ZYDIS_MAKE_GENERATED_STRING("rdmsr"), - ZYDIS_MAKE_GENERATED_STRING("rdpid"), - ZYDIS_MAKE_GENERATED_STRING("rdpkru"), - ZYDIS_MAKE_GENERATED_STRING("rdpmc"), - ZYDIS_MAKE_GENERATED_STRING("rdrand"), - ZYDIS_MAKE_GENERATED_STRING("rdseed"), - ZYDIS_MAKE_GENERATED_STRING("rdsspd"), - ZYDIS_MAKE_GENERATED_STRING("rdsspq"), - ZYDIS_MAKE_GENERATED_STRING("rdtsc"), - ZYDIS_MAKE_GENERATED_STRING("rdtscp"), - ZYDIS_MAKE_GENERATED_STRING("ret"), - ZYDIS_MAKE_GENERATED_STRING("rol"), - ZYDIS_MAKE_GENERATED_STRING("ror"), - ZYDIS_MAKE_GENERATED_STRING("rorx"), - ZYDIS_MAKE_GENERATED_STRING("roundpd"), - ZYDIS_MAKE_GENERATED_STRING("roundps"), - ZYDIS_MAKE_GENERATED_STRING("roundsd"), - ZYDIS_MAKE_GENERATED_STRING("roundss"), - ZYDIS_MAKE_GENERATED_STRING("rsm"), - ZYDIS_MAKE_GENERATED_STRING("rsqrtps"), - ZYDIS_MAKE_GENERATED_STRING("rsqrtss"), - ZYDIS_MAKE_GENERATED_STRING("rstorssp"), - ZYDIS_MAKE_GENERATED_STRING("sahf"), - ZYDIS_MAKE_GENERATED_STRING("salc"), - ZYDIS_MAKE_GENERATED_STRING("sar"), - ZYDIS_MAKE_GENERATED_STRING("sarx"), - ZYDIS_MAKE_GENERATED_STRING("savessp"), - ZYDIS_MAKE_GENERATED_STRING("sbb"), - ZYDIS_MAKE_GENERATED_STRING("scasb"), - ZYDIS_MAKE_GENERATED_STRING("scasd"), - ZYDIS_MAKE_GENERATED_STRING("scasq"), - ZYDIS_MAKE_GENERATED_STRING("scasw"), - ZYDIS_MAKE_GENERATED_STRING("setb"), - ZYDIS_MAKE_GENERATED_STRING("setbe"), - ZYDIS_MAKE_GENERATED_STRING("setl"), - ZYDIS_MAKE_GENERATED_STRING("setle"), - ZYDIS_MAKE_GENERATED_STRING("setnb"), - ZYDIS_MAKE_GENERATED_STRING("setnbe"), - ZYDIS_MAKE_GENERATED_STRING("setnl"), - ZYDIS_MAKE_GENERATED_STRING("setnle"), - ZYDIS_MAKE_GENERATED_STRING("setno"), - ZYDIS_MAKE_GENERATED_STRING("setnp"), - ZYDIS_MAKE_GENERATED_STRING("setns"), - ZYDIS_MAKE_GENERATED_STRING("setnz"), - ZYDIS_MAKE_GENERATED_STRING("seto"), - ZYDIS_MAKE_GENERATED_STRING("setp"), - ZYDIS_MAKE_GENERATED_STRING("sets"), - ZYDIS_MAKE_GENERATED_STRING("setssbsy"), - ZYDIS_MAKE_GENERATED_STRING("setz"), - ZYDIS_MAKE_GENERATED_STRING("sfence"), - ZYDIS_MAKE_GENERATED_STRING("sgdt"), - ZYDIS_MAKE_GENERATED_STRING("sha1msg1"), - ZYDIS_MAKE_GENERATED_STRING("sha1msg2"), - ZYDIS_MAKE_GENERATED_STRING("sha1nexte"), - ZYDIS_MAKE_GENERATED_STRING("sha1rnds4"), - ZYDIS_MAKE_GENERATED_STRING("sha256msg1"), - ZYDIS_MAKE_GENERATED_STRING("sha256msg2"), - ZYDIS_MAKE_GENERATED_STRING("sha256rnds2"), - ZYDIS_MAKE_GENERATED_STRING("shl"), - ZYDIS_MAKE_GENERATED_STRING("shld"), - ZYDIS_MAKE_GENERATED_STRING("shlx"), - ZYDIS_MAKE_GENERATED_STRING("shr"), - ZYDIS_MAKE_GENERATED_STRING("shrd"), - ZYDIS_MAKE_GENERATED_STRING("shrx"), - ZYDIS_MAKE_GENERATED_STRING("shufpd"), - ZYDIS_MAKE_GENERATED_STRING("shufps"), - ZYDIS_MAKE_GENERATED_STRING("sidt"), - ZYDIS_MAKE_GENERATED_STRING("skinit"), - ZYDIS_MAKE_GENERATED_STRING("sldt"), - ZYDIS_MAKE_GENERATED_STRING("slwpcb"), - ZYDIS_MAKE_GENERATED_STRING("smsw"), - ZYDIS_MAKE_GENERATED_STRING("spflt"), - ZYDIS_MAKE_GENERATED_STRING("sqrtpd"), - ZYDIS_MAKE_GENERATED_STRING("sqrtps"), - ZYDIS_MAKE_GENERATED_STRING("sqrtsd"), - ZYDIS_MAKE_GENERATED_STRING("sqrtss"), - ZYDIS_MAKE_GENERATED_STRING("stac"), - ZYDIS_MAKE_GENERATED_STRING("stc"), - ZYDIS_MAKE_GENERATED_STRING("std"), - ZYDIS_MAKE_GENERATED_STRING("stgi"), - ZYDIS_MAKE_GENERATED_STRING("sti"), - ZYDIS_MAKE_GENERATED_STRING("stmxcsr"), - ZYDIS_MAKE_GENERATED_STRING("stosb"), - ZYDIS_MAKE_GENERATED_STRING("stosd"), - ZYDIS_MAKE_GENERATED_STRING("stosq"), - ZYDIS_MAKE_GENERATED_STRING("stosw"), - ZYDIS_MAKE_GENERATED_STRING("str"), - ZYDIS_MAKE_GENERATED_STRING("sub"), - ZYDIS_MAKE_GENERATED_STRING("subpd"), - ZYDIS_MAKE_GENERATED_STRING("subps"), - ZYDIS_MAKE_GENERATED_STRING("subsd"), - ZYDIS_MAKE_GENERATED_STRING("subss"), - ZYDIS_MAKE_GENERATED_STRING("swapgs"), - ZYDIS_MAKE_GENERATED_STRING("syscall"), - ZYDIS_MAKE_GENERATED_STRING("sysenter"), - ZYDIS_MAKE_GENERATED_STRING("sysexit"), - ZYDIS_MAKE_GENERATED_STRING("sysret"), - ZYDIS_MAKE_GENERATED_STRING("t1mskc"), - ZYDIS_MAKE_GENERATED_STRING("test"), - ZYDIS_MAKE_GENERATED_STRING("tzcnt"), - ZYDIS_MAKE_GENERATED_STRING("tzcnti"), - ZYDIS_MAKE_GENERATED_STRING("tzmsk"), - ZYDIS_MAKE_GENERATED_STRING("ucomisd"), - ZYDIS_MAKE_GENERATED_STRING("ucomiss"), - ZYDIS_MAKE_GENERATED_STRING("ud0"), - ZYDIS_MAKE_GENERATED_STRING("ud1"), - ZYDIS_MAKE_GENERATED_STRING("ud2"), - ZYDIS_MAKE_GENERATED_STRING("unpckhpd"), - ZYDIS_MAKE_GENERATED_STRING("unpckhps"), - ZYDIS_MAKE_GENERATED_STRING("unpcklpd"), - ZYDIS_MAKE_GENERATED_STRING("unpcklps"), - ZYDIS_MAKE_GENERATED_STRING("v4fmaddps"), - ZYDIS_MAKE_GENERATED_STRING("v4fmaddss"), - ZYDIS_MAKE_GENERATED_STRING("v4fnmaddps"), - ZYDIS_MAKE_GENERATED_STRING("v4fnmaddss"), - ZYDIS_MAKE_GENERATED_STRING("vaddnpd"), - ZYDIS_MAKE_GENERATED_STRING("vaddnps"), - ZYDIS_MAKE_GENERATED_STRING("vaddpd"), - ZYDIS_MAKE_GENERATED_STRING("vaddps"), - ZYDIS_MAKE_GENERATED_STRING("vaddsd"), - ZYDIS_MAKE_GENERATED_STRING("vaddsetsps"), - ZYDIS_MAKE_GENERATED_STRING("vaddss"), - ZYDIS_MAKE_GENERATED_STRING("vaddsubpd"), - ZYDIS_MAKE_GENERATED_STRING("vaddsubps"), - ZYDIS_MAKE_GENERATED_STRING("vaesdec"), - ZYDIS_MAKE_GENERATED_STRING("vaesdeclast"), - ZYDIS_MAKE_GENERATED_STRING("vaesenc"), - ZYDIS_MAKE_GENERATED_STRING("vaesenclast"), - ZYDIS_MAKE_GENERATED_STRING("vaesimc"), - ZYDIS_MAKE_GENERATED_STRING("vaeskeygenassist"), - ZYDIS_MAKE_GENERATED_STRING("valignd"), - ZYDIS_MAKE_GENERATED_STRING("valignq"), - ZYDIS_MAKE_GENERATED_STRING("vandnpd"), - ZYDIS_MAKE_GENERATED_STRING("vandnps"), - ZYDIS_MAKE_GENERATED_STRING("vandpd"), - ZYDIS_MAKE_GENERATED_STRING("vandps"), - ZYDIS_MAKE_GENERATED_STRING("vblendmpd"), - ZYDIS_MAKE_GENERATED_STRING("vblendmps"), - ZYDIS_MAKE_GENERATED_STRING("vblendpd"), - ZYDIS_MAKE_GENERATED_STRING("vblendps"), - ZYDIS_MAKE_GENERATED_STRING("vblendvpd"), - ZYDIS_MAKE_GENERATED_STRING("vblendvps"), - ZYDIS_MAKE_GENERATED_STRING("vbroadcastf128"), - ZYDIS_MAKE_GENERATED_STRING("vbroadcastf32x2"), - ZYDIS_MAKE_GENERATED_STRING("vbroadcastf32x4"), - ZYDIS_MAKE_GENERATED_STRING("vbroadcastf32x8"), - ZYDIS_MAKE_GENERATED_STRING("vbroadcastf64x2"), - ZYDIS_MAKE_GENERATED_STRING("vbroadcastf64x4"), - ZYDIS_MAKE_GENERATED_STRING("vbroadcasti128"), - ZYDIS_MAKE_GENERATED_STRING("vbroadcasti32x2"), - ZYDIS_MAKE_GENERATED_STRING("vbroadcasti32x4"), - ZYDIS_MAKE_GENERATED_STRING("vbroadcasti32x8"), - ZYDIS_MAKE_GENERATED_STRING("vbroadcasti64x2"), - ZYDIS_MAKE_GENERATED_STRING("vbroadcasti64x4"), - ZYDIS_MAKE_GENERATED_STRING("vbroadcastsd"), - ZYDIS_MAKE_GENERATED_STRING("vbroadcastss"), - ZYDIS_MAKE_GENERATED_STRING("vcmppd"), - ZYDIS_MAKE_GENERATED_STRING("vcmpps"), - ZYDIS_MAKE_GENERATED_STRING("vcmpsd"), - ZYDIS_MAKE_GENERATED_STRING("vcmpss"), - ZYDIS_MAKE_GENERATED_STRING("vcomisd"), - ZYDIS_MAKE_GENERATED_STRING("vcomiss"), - ZYDIS_MAKE_GENERATED_STRING("vcompresspd"), - ZYDIS_MAKE_GENERATED_STRING("vcompressps"), - ZYDIS_MAKE_GENERATED_STRING("vcvtdq2pd"), - ZYDIS_MAKE_GENERATED_STRING("vcvtdq2ps"), - ZYDIS_MAKE_GENERATED_STRING("vcvtfxpntdq2ps"), - ZYDIS_MAKE_GENERATED_STRING("vcvtfxpntpd2dq"), - ZYDIS_MAKE_GENERATED_STRING("vcvtfxpntpd2udq"), - ZYDIS_MAKE_GENERATED_STRING("vcvtfxpntps2dq"), - ZYDIS_MAKE_GENERATED_STRING("vcvtfxpntps2udq"), - ZYDIS_MAKE_GENERATED_STRING("vcvtfxpntudq2ps"), - ZYDIS_MAKE_GENERATED_STRING("vcvtpd2dq"), - ZYDIS_MAKE_GENERATED_STRING("vcvtpd2ps"), - ZYDIS_MAKE_GENERATED_STRING("vcvtpd2qq"), - ZYDIS_MAKE_GENERATED_STRING("vcvtpd2udq"), - ZYDIS_MAKE_GENERATED_STRING("vcvtpd2uqq"), - ZYDIS_MAKE_GENERATED_STRING("vcvtph2ps"), - ZYDIS_MAKE_GENERATED_STRING("vcvtps2dq"), - ZYDIS_MAKE_GENERATED_STRING("vcvtps2pd"), - ZYDIS_MAKE_GENERATED_STRING("vcvtps2ph"), - ZYDIS_MAKE_GENERATED_STRING("vcvtps2qq"), - ZYDIS_MAKE_GENERATED_STRING("vcvtps2udq"), - ZYDIS_MAKE_GENERATED_STRING("vcvtps2uqq"), - ZYDIS_MAKE_GENERATED_STRING("vcvtqq2pd"), - ZYDIS_MAKE_GENERATED_STRING("vcvtqq2ps"), - ZYDIS_MAKE_GENERATED_STRING("vcvtsd2si"), - ZYDIS_MAKE_GENERATED_STRING("vcvtsd2ss"), - ZYDIS_MAKE_GENERATED_STRING("vcvtsd2usi"), - ZYDIS_MAKE_GENERATED_STRING("vcvtsi2sd"), - ZYDIS_MAKE_GENERATED_STRING("vcvtsi2ss"), - ZYDIS_MAKE_GENERATED_STRING("vcvtss2sd"), - ZYDIS_MAKE_GENERATED_STRING("vcvtss2si"), - ZYDIS_MAKE_GENERATED_STRING("vcvtss2usi"), - ZYDIS_MAKE_GENERATED_STRING("vcvttpd2dq"), - ZYDIS_MAKE_GENERATED_STRING("vcvttpd2qq"), - ZYDIS_MAKE_GENERATED_STRING("vcvttpd2udq"), - ZYDIS_MAKE_GENERATED_STRING("vcvttpd2uqq"), - ZYDIS_MAKE_GENERATED_STRING("vcvttps2dq"), - ZYDIS_MAKE_GENERATED_STRING("vcvttps2qq"), - ZYDIS_MAKE_GENERATED_STRING("vcvttps2udq"), - ZYDIS_MAKE_GENERATED_STRING("vcvttps2uqq"), - ZYDIS_MAKE_GENERATED_STRING("vcvttsd2si"), - ZYDIS_MAKE_GENERATED_STRING("vcvttsd2usi"), - ZYDIS_MAKE_GENERATED_STRING("vcvttss2si"), - ZYDIS_MAKE_GENERATED_STRING("vcvttss2usi"), - ZYDIS_MAKE_GENERATED_STRING("vcvtudq2pd"), - ZYDIS_MAKE_GENERATED_STRING("vcvtudq2ps"), - ZYDIS_MAKE_GENERATED_STRING("vcvtuqq2pd"), - ZYDIS_MAKE_GENERATED_STRING("vcvtuqq2ps"), - ZYDIS_MAKE_GENERATED_STRING("vcvtusi2sd"), - ZYDIS_MAKE_GENERATED_STRING("vcvtusi2ss"), - ZYDIS_MAKE_GENERATED_STRING("vdbpsadbw"), - ZYDIS_MAKE_GENERATED_STRING("vdivpd"), - ZYDIS_MAKE_GENERATED_STRING("vdivps"), - ZYDIS_MAKE_GENERATED_STRING("vdivsd"), - ZYDIS_MAKE_GENERATED_STRING("vdivss"), - ZYDIS_MAKE_GENERATED_STRING("vdppd"), - ZYDIS_MAKE_GENERATED_STRING("vdpps"), - ZYDIS_MAKE_GENERATED_STRING("verr"), - ZYDIS_MAKE_GENERATED_STRING("verw"), - ZYDIS_MAKE_GENERATED_STRING("vexp223ps"), - ZYDIS_MAKE_GENERATED_STRING("vexp2pd"), - ZYDIS_MAKE_GENERATED_STRING("vexp2ps"), - ZYDIS_MAKE_GENERATED_STRING("vexpandpd"), - ZYDIS_MAKE_GENERATED_STRING("vexpandps"), - ZYDIS_MAKE_GENERATED_STRING("vextractf128"), - ZYDIS_MAKE_GENERATED_STRING("vextractf32x4"), - ZYDIS_MAKE_GENERATED_STRING("vextractf32x8"), - ZYDIS_MAKE_GENERATED_STRING("vextractf64x2"), - ZYDIS_MAKE_GENERATED_STRING("vextractf64x4"), - ZYDIS_MAKE_GENERATED_STRING("vextracti128"), - ZYDIS_MAKE_GENERATED_STRING("vextracti32x4"), - ZYDIS_MAKE_GENERATED_STRING("vextracti32x8"), - ZYDIS_MAKE_GENERATED_STRING("vextracti64x2"), - ZYDIS_MAKE_GENERATED_STRING("vextracti64x4"), - ZYDIS_MAKE_GENERATED_STRING("vextractps"), - ZYDIS_MAKE_GENERATED_STRING("vfixupimmpd"), - ZYDIS_MAKE_GENERATED_STRING("vfixupimmps"), - ZYDIS_MAKE_GENERATED_STRING("vfixupimmsd"), - ZYDIS_MAKE_GENERATED_STRING("vfixupimmss"), - ZYDIS_MAKE_GENERATED_STRING("vfixupnanpd"), - ZYDIS_MAKE_GENERATED_STRING("vfixupnanps"), - ZYDIS_MAKE_GENERATED_STRING("vfmadd132pd"), - ZYDIS_MAKE_GENERATED_STRING("vfmadd132ps"), - ZYDIS_MAKE_GENERATED_STRING("vfmadd132sd"), - ZYDIS_MAKE_GENERATED_STRING("vfmadd132ss"), - ZYDIS_MAKE_GENERATED_STRING("vfmadd213pd"), - ZYDIS_MAKE_GENERATED_STRING("vfmadd213ps"), - ZYDIS_MAKE_GENERATED_STRING("vfmadd213sd"), - ZYDIS_MAKE_GENERATED_STRING("vfmadd213ss"), - ZYDIS_MAKE_GENERATED_STRING("vfmadd231pd"), - ZYDIS_MAKE_GENERATED_STRING("vfmadd231ps"), - ZYDIS_MAKE_GENERATED_STRING("vfmadd231sd"), - ZYDIS_MAKE_GENERATED_STRING("vfmadd231ss"), - ZYDIS_MAKE_GENERATED_STRING("vfmadd233ps"), - ZYDIS_MAKE_GENERATED_STRING("vfmaddpd"), - ZYDIS_MAKE_GENERATED_STRING("vfmaddps"), - ZYDIS_MAKE_GENERATED_STRING("vfmaddsd"), - ZYDIS_MAKE_GENERATED_STRING("vfmaddss"), - ZYDIS_MAKE_GENERATED_STRING("vfmaddsub132pd"), - ZYDIS_MAKE_GENERATED_STRING("vfmaddsub132ps"), - ZYDIS_MAKE_GENERATED_STRING("vfmaddsub213pd"), - ZYDIS_MAKE_GENERATED_STRING("vfmaddsub213ps"), - ZYDIS_MAKE_GENERATED_STRING("vfmaddsub231pd"), - ZYDIS_MAKE_GENERATED_STRING("vfmaddsub231ps"), - ZYDIS_MAKE_GENERATED_STRING("vfmaddsubpd"), - ZYDIS_MAKE_GENERATED_STRING("vfmaddsubps"), - ZYDIS_MAKE_GENERATED_STRING("vfmsub132pd"), - ZYDIS_MAKE_GENERATED_STRING("vfmsub132ps"), - ZYDIS_MAKE_GENERATED_STRING("vfmsub132sd"), - ZYDIS_MAKE_GENERATED_STRING("vfmsub132ss"), - ZYDIS_MAKE_GENERATED_STRING("vfmsub213pd"), - ZYDIS_MAKE_GENERATED_STRING("vfmsub213ps"), - ZYDIS_MAKE_GENERATED_STRING("vfmsub213sd"), - ZYDIS_MAKE_GENERATED_STRING("vfmsub213ss"), - ZYDIS_MAKE_GENERATED_STRING("vfmsub231pd"), - ZYDIS_MAKE_GENERATED_STRING("vfmsub231ps"), - ZYDIS_MAKE_GENERATED_STRING("vfmsub231sd"), - ZYDIS_MAKE_GENERATED_STRING("vfmsub231ss"), - ZYDIS_MAKE_GENERATED_STRING("vfmsubadd132pd"), - ZYDIS_MAKE_GENERATED_STRING("vfmsubadd132ps"), - ZYDIS_MAKE_GENERATED_STRING("vfmsubadd213pd"), - ZYDIS_MAKE_GENERATED_STRING("vfmsubadd213ps"), - ZYDIS_MAKE_GENERATED_STRING("vfmsubadd231pd"), - ZYDIS_MAKE_GENERATED_STRING("vfmsubadd231ps"), - ZYDIS_MAKE_GENERATED_STRING("vfmsubaddpd"), - ZYDIS_MAKE_GENERATED_STRING("vfmsubaddps"), - ZYDIS_MAKE_GENERATED_STRING("vfmsubpd"), - ZYDIS_MAKE_GENERATED_STRING("vfmsubps"), - ZYDIS_MAKE_GENERATED_STRING("vfmsubsd"), - ZYDIS_MAKE_GENERATED_STRING("vfmsubss"), - ZYDIS_MAKE_GENERATED_STRING("vfnmadd132pd"), - ZYDIS_MAKE_GENERATED_STRING("vfnmadd132ps"), - ZYDIS_MAKE_GENERATED_STRING("vfnmadd132sd"), - ZYDIS_MAKE_GENERATED_STRING("vfnmadd132ss"), - ZYDIS_MAKE_GENERATED_STRING("vfnmadd213pd"), - ZYDIS_MAKE_GENERATED_STRING("vfnmadd213ps"), - ZYDIS_MAKE_GENERATED_STRING("vfnmadd213sd"), - ZYDIS_MAKE_GENERATED_STRING("vfnmadd213ss"), - ZYDIS_MAKE_GENERATED_STRING("vfnmadd231pd"), - ZYDIS_MAKE_GENERATED_STRING("vfnmadd231ps"), - ZYDIS_MAKE_GENERATED_STRING("vfnmadd231sd"), - ZYDIS_MAKE_GENERATED_STRING("vfnmadd231ss"), - ZYDIS_MAKE_GENERATED_STRING("vfnmaddpd"), - ZYDIS_MAKE_GENERATED_STRING("vfnmaddps"), - ZYDIS_MAKE_GENERATED_STRING("vfnmaddsd"), - ZYDIS_MAKE_GENERATED_STRING("vfnmaddss"), - ZYDIS_MAKE_GENERATED_STRING("vfnmsub132pd"), - ZYDIS_MAKE_GENERATED_STRING("vfnmsub132ps"), - ZYDIS_MAKE_GENERATED_STRING("vfnmsub132sd"), - ZYDIS_MAKE_GENERATED_STRING("vfnmsub132ss"), - ZYDIS_MAKE_GENERATED_STRING("vfnmsub213pd"), - ZYDIS_MAKE_GENERATED_STRING("vfnmsub213ps"), - ZYDIS_MAKE_GENERATED_STRING("vfnmsub213sd"), - ZYDIS_MAKE_GENERATED_STRING("vfnmsub213ss"), - ZYDIS_MAKE_GENERATED_STRING("vfnmsub231pd"), - ZYDIS_MAKE_GENERATED_STRING("vfnmsub231ps"), - ZYDIS_MAKE_GENERATED_STRING("vfnmsub231sd"), - ZYDIS_MAKE_GENERATED_STRING("vfnmsub231ss"), - ZYDIS_MAKE_GENERATED_STRING("vfnmsubpd"), - ZYDIS_MAKE_GENERATED_STRING("vfnmsubps"), - ZYDIS_MAKE_GENERATED_STRING("vfnmsubsd"), - ZYDIS_MAKE_GENERATED_STRING("vfnmsubss"), - ZYDIS_MAKE_GENERATED_STRING("vfpclasspd"), - ZYDIS_MAKE_GENERATED_STRING("vfpclassps"), - ZYDIS_MAKE_GENERATED_STRING("vfpclasssd"), - ZYDIS_MAKE_GENERATED_STRING("vfpclassss"), - ZYDIS_MAKE_GENERATED_STRING("vfrczpd"), - ZYDIS_MAKE_GENERATED_STRING("vfrczps"), - ZYDIS_MAKE_GENERATED_STRING("vfrczsd"), - ZYDIS_MAKE_GENERATED_STRING("vfrczss"), - ZYDIS_MAKE_GENERATED_STRING("vgatherdpd"), - ZYDIS_MAKE_GENERATED_STRING("vgatherdps"), - ZYDIS_MAKE_GENERATED_STRING("vgatherpf0dpd"), - ZYDIS_MAKE_GENERATED_STRING("vgatherpf0dps"), - ZYDIS_MAKE_GENERATED_STRING("vgatherpf0hintdpd"), - ZYDIS_MAKE_GENERATED_STRING("vgatherpf0hintdps"), - ZYDIS_MAKE_GENERATED_STRING("vgatherpf0qpd"), - ZYDIS_MAKE_GENERATED_STRING("vgatherpf0qps"), - ZYDIS_MAKE_GENERATED_STRING("vgatherpf1dpd"), - ZYDIS_MAKE_GENERATED_STRING("vgatherpf1dps"), - ZYDIS_MAKE_GENERATED_STRING("vgatherpf1qpd"), - ZYDIS_MAKE_GENERATED_STRING("vgatherpf1qps"), - ZYDIS_MAKE_GENERATED_STRING("vgatherqpd"), - ZYDIS_MAKE_GENERATED_STRING("vgatherqps"), - ZYDIS_MAKE_GENERATED_STRING("vgetexppd"), - ZYDIS_MAKE_GENERATED_STRING("vgetexpps"), - ZYDIS_MAKE_GENERATED_STRING("vgetexpsd"), - ZYDIS_MAKE_GENERATED_STRING("vgetexpss"), - ZYDIS_MAKE_GENERATED_STRING("vgetmantpd"), - ZYDIS_MAKE_GENERATED_STRING("vgetmantps"), - ZYDIS_MAKE_GENERATED_STRING("vgetmantsd"), - ZYDIS_MAKE_GENERATED_STRING("vgetmantss"), - ZYDIS_MAKE_GENERATED_STRING("vgf2p8affineinvqb"), - ZYDIS_MAKE_GENERATED_STRING("vgf2p8affineqb"), - ZYDIS_MAKE_GENERATED_STRING("vgf2p8mulb"), - ZYDIS_MAKE_GENERATED_STRING("vgmaxabsps"), - ZYDIS_MAKE_GENERATED_STRING("vgmaxpd"), - ZYDIS_MAKE_GENERATED_STRING("vgmaxps"), - ZYDIS_MAKE_GENERATED_STRING("vgminpd"), - ZYDIS_MAKE_GENERATED_STRING("vgminps"), - ZYDIS_MAKE_GENERATED_STRING("vhaddpd"), - ZYDIS_MAKE_GENERATED_STRING("vhaddps"), - ZYDIS_MAKE_GENERATED_STRING("vhsubpd"), - ZYDIS_MAKE_GENERATED_STRING("vhsubps"), - ZYDIS_MAKE_GENERATED_STRING("vinsertf128"), - ZYDIS_MAKE_GENERATED_STRING("vinsertf32x4"), - ZYDIS_MAKE_GENERATED_STRING("vinsertf32x8"), - ZYDIS_MAKE_GENERATED_STRING("vinsertf64x2"), - ZYDIS_MAKE_GENERATED_STRING("vinsertf64x4"), - ZYDIS_MAKE_GENERATED_STRING("vinserti128"), - ZYDIS_MAKE_GENERATED_STRING("vinserti32x4"), - ZYDIS_MAKE_GENERATED_STRING("vinserti32x8"), - ZYDIS_MAKE_GENERATED_STRING("vinserti64x2"), - ZYDIS_MAKE_GENERATED_STRING("vinserti64x4"), - ZYDIS_MAKE_GENERATED_STRING("vinsertps"), - ZYDIS_MAKE_GENERATED_STRING("vlddqu"), - ZYDIS_MAKE_GENERATED_STRING("vldmxcsr"), - ZYDIS_MAKE_GENERATED_STRING("vloadunpackhd"), - ZYDIS_MAKE_GENERATED_STRING("vloadunpackhpd"), - ZYDIS_MAKE_GENERATED_STRING("vloadunpackhps"), - ZYDIS_MAKE_GENERATED_STRING("vloadunpackhq"), - ZYDIS_MAKE_GENERATED_STRING("vloadunpackld"), - ZYDIS_MAKE_GENERATED_STRING("vloadunpacklpd"), - ZYDIS_MAKE_GENERATED_STRING("vloadunpacklps"), - ZYDIS_MAKE_GENERATED_STRING("vloadunpacklq"), - ZYDIS_MAKE_GENERATED_STRING("vlog2ps"), - ZYDIS_MAKE_GENERATED_STRING("vmaskmovdqu"), - ZYDIS_MAKE_GENERATED_STRING("vmaskmovpd"), - ZYDIS_MAKE_GENERATED_STRING("vmaskmovps"), - ZYDIS_MAKE_GENERATED_STRING("vmaxpd"), - ZYDIS_MAKE_GENERATED_STRING("vmaxps"), - ZYDIS_MAKE_GENERATED_STRING("vmaxsd"), - ZYDIS_MAKE_GENERATED_STRING("vmaxss"), - ZYDIS_MAKE_GENERATED_STRING("vmcall"), - ZYDIS_MAKE_GENERATED_STRING("vmclear"), - ZYDIS_MAKE_GENERATED_STRING("vmfunc"), - ZYDIS_MAKE_GENERATED_STRING("vminpd"), - ZYDIS_MAKE_GENERATED_STRING("vminps"), - ZYDIS_MAKE_GENERATED_STRING("vminsd"), - ZYDIS_MAKE_GENERATED_STRING("vminss"), - ZYDIS_MAKE_GENERATED_STRING("vmlaunch"), - ZYDIS_MAKE_GENERATED_STRING("vmload"), - ZYDIS_MAKE_GENERATED_STRING("vmmcall"), - ZYDIS_MAKE_GENERATED_STRING("vmovapd"), - ZYDIS_MAKE_GENERATED_STRING("vmovaps"), - ZYDIS_MAKE_GENERATED_STRING("vmovd"), - ZYDIS_MAKE_GENERATED_STRING("vmovddup"), - ZYDIS_MAKE_GENERATED_STRING("vmovdqa"), - ZYDIS_MAKE_GENERATED_STRING("vmovdqa32"), - ZYDIS_MAKE_GENERATED_STRING("vmovdqa64"), - ZYDIS_MAKE_GENERATED_STRING("vmovdqu"), - ZYDIS_MAKE_GENERATED_STRING("vmovdqu16"), - ZYDIS_MAKE_GENERATED_STRING("vmovdqu32"), - ZYDIS_MAKE_GENERATED_STRING("vmovdqu64"), - ZYDIS_MAKE_GENERATED_STRING("vmovdqu8"), - ZYDIS_MAKE_GENERATED_STRING("vmovhlps"), - ZYDIS_MAKE_GENERATED_STRING("vmovhpd"), - ZYDIS_MAKE_GENERATED_STRING("vmovhps"), - ZYDIS_MAKE_GENERATED_STRING("vmovlhps"), - ZYDIS_MAKE_GENERATED_STRING("vmovlpd"), - ZYDIS_MAKE_GENERATED_STRING("vmovlps"), - ZYDIS_MAKE_GENERATED_STRING("vmovmskpd"), - ZYDIS_MAKE_GENERATED_STRING("vmovmskps"), - ZYDIS_MAKE_GENERATED_STRING("vmovnrapd"), - ZYDIS_MAKE_GENERATED_STRING("vmovnraps"), - ZYDIS_MAKE_GENERATED_STRING("vmovnrngoapd"), - ZYDIS_MAKE_GENERATED_STRING("vmovnrngoaps"), - ZYDIS_MAKE_GENERATED_STRING("vmovntdq"), - ZYDIS_MAKE_GENERATED_STRING("vmovntdqa"), - ZYDIS_MAKE_GENERATED_STRING("vmovntpd"), - ZYDIS_MAKE_GENERATED_STRING("vmovntps"), - ZYDIS_MAKE_GENERATED_STRING("vmovq"), - ZYDIS_MAKE_GENERATED_STRING("vmovsd"), - ZYDIS_MAKE_GENERATED_STRING("vmovshdup"), - ZYDIS_MAKE_GENERATED_STRING("vmovsldup"), - ZYDIS_MAKE_GENERATED_STRING("vmovss"), - ZYDIS_MAKE_GENERATED_STRING("vmovupd"), - ZYDIS_MAKE_GENERATED_STRING("vmovups"), - ZYDIS_MAKE_GENERATED_STRING("vmpsadbw"), - ZYDIS_MAKE_GENERATED_STRING("vmptrld"), - ZYDIS_MAKE_GENERATED_STRING("vmptrst"), - ZYDIS_MAKE_GENERATED_STRING("vmread"), - ZYDIS_MAKE_GENERATED_STRING("vmresume"), - ZYDIS_MAKE_GENERATED_STRING("vmrun"), - ZYDIS_MAKE_GENERATED_STRING("vmsave"), - ZYDIS_MAKE_GENERATED_STRING("vmulpd"), - ZYDIS_MAKE_GENERATED_STRING("vmulps"), - ZYDIS_MAKE_GENERATED_STRING("vmulsd"), - ZYDIS_MAKE_GENERATED_STRING("vmulss"), - ZYDIS_MAKE_GENERATED_STRING("vmwrite"), - ZYDIS_MAKE_GENERATED_STRING("vmxoff"), - ZYDIS_MAKE_GENERATED_STRING("vmxon"), - ZYDIS_MAKE_GENERATED_STRING("vorpd"), - ZYDIS_MAKE_GENERATED_STRING("vorps"), - ZYDIS_MAKE_GENERATED_STRING("vp4dpwssd"), - ZYDIS_MAKE_GENERATED_STRING("vp4dpwssds"), - ZYDIS_MAKE_GENERATED_STRING("vpabsb"), - ZYDIS_MAKE_GENERATED_STRING("vpabsd"), - ZYDIS_MAKE_GENERATED_STRING("vpabsq"), - ZYDIS_MAKE_GENERATED_STRING("vpabsw"), - ZYDIS_MAKE_GENERATED_STRING("vpackssdw"), - ZYDIS_MAKE_GENERATED_STRING("vpacksswb"), - ZYDIS_MAKE_GENERATED_STRING("vpackstorehd"), - ZYDIS_MAKE_GENERATED_STRING("vpackstorehpd"), - ZYDIS_MAKE_GENERATED_STRING("vpackstorehps"), - ZYDIS_MAKE_GENERATED_STRING("vpackstorehq"), - ZYDIS_MAKE_GENERATED_STRING("vpackstoreld"), - ZYDIS_MAKE_GENERATED_STRING("vpackstorelpd"), - ZYDIS_MAKE_GENERATED_STRING("vpackstorelps"), - ZYDIS_MAKE_GENERATED_STRING("vpackstorelq"), - ZYDIS_MAKE_GENERATED_STRING("vpackusdw"), - ZYDIS_MAKE_GENERATED_STRING("vpackuswb"), - ZYDIS_MAKE_GENERATED_STRING("vpadcd"), - ZYDIS_MAKE_GENERATED_STRING("vpaddb"), - ZYDIS_MAKE_GENERATED_STRING("vpaddd"), - ZYDIS_MAKE_GENERATED_STRING("vpaddq"), - ZYDIS_MAKE_GENERATED_STRING("vpaddsb"), - ZYDIS_MAKE_GENERATED_STRING("vpaddsetcd"), - ZYDIS_MAKE_GENERATED_STRING("vpaddsetsd"), - ZYDIS_MAKE_GENERATED_STRING("vpaddsw"), - ZYDIS_MAKE_GENERATED_STRING("vpaddusb"), - ZYDIS_MAKE_GENERATED_STRING("vpaddusw"), - ZYDIS_MAKE_GENERATED_STRING("vpaddw"), - ZYDIS_MAKE_GENERATED_STRING("vpalignr"), - ZYDIS_MAKE_GENERATED_STRING("vpand"), - ZYDIS_MAKE_GENERATED_STRING("vpandd"), - ZYDIS_MAKE_GENERATED_STRING("vpandn"), - ZYDIS_MAKE_GENERATED_STRING("vpandnd"), - ZYDIS_MAKE_GENERATED_STRING("vpandnq"), - ZYDIS_MAKE_GENERATED_STRING("vpandq"), - ZYDIS_MAKE_GENERATED_STRING("vpavgb"), - ZYDIS_MAKE_GENERATED_STRING("vpavgw"), - ZYDIS_MAKE_GENERATED_STRING("vpblendd"), - ZYDIS_MAKE_GENERATED_STRING("vpblendmb"), - ZYDIS_MAKE_GENERATED_STRING("vpblendmd"), - ZYDIS_MAKE_GENERATED_STRING("vpblendmq"), - ZYDIS_MAKE_GENERATED_STRING("vpblendmw"), - ZYDIS_MAKE_GENERATED_STRING("vpblendvb"), - ZYDIS_MAKE_GENERATED_STRING("vpblendw"), - ZYDIS_MAKE_GENERATED_STRING("vpbroadcastb"), - ZYDIS_MAKE_GENERATED_STRING("vpbroadcastd"), - ZYDIS_MAKE_GENERATED_STRING("vpbroadcastmb2q"), - ZYDIS_MAKE_GENERATED_STRING("vpbroadcastmw2d"), - ZYDIS_MAKE_GENERATED_STRING("vpbroadcastq"), - ZYDIS_MAKE_GENERATED_STRING("vpbroadcastw"), - ZYDIS_MAKE_GENERATED_STRING("vpclmulqdq"), - ZYDIS_MAKE_GENERATED_STRING("vpcmov"), - ZYDIS_MAKE_GENERATED_STRING("vpcmpb"), - ZYDIS_MAKE_GENERATED_STRING("vpcmpd"), - ZYDIS_MAKE_GENERATED_STRING("vpcmpeqb"), - ZYDIS_MAKE_GENERATED_STRING("vpcmpeqd"), - ZYDIS_MAKE_GENERATED_STRING("vpcmpeqq"), - ZYDIS_MAKE_GENERATED_STRING("vpcmpeqw"), - ZYDIS_MAKE_GENERATED_STRING("vpcmpestri"), - ZYDIS_MAKE_GENERATED_STRING("vpcmpestrm"), - ZYDIS_MAKE_GENERATED_STRING("vpcmpgtb"), - ZYDIS_MAKE_GENERATED_STRING("vpcmpgtd"), - ZYDIS_MAKE_GENERATED_STRING("vpcmpgtq"), - ZYDIS_MAKE_GENERATED_STRING("vpcmpgtw"), - ZYDIS_MAKE_GENERATED_STRING("vpcmpistri"), - ZYDIS_MAKE_GENERATED_STRING("vpcmpistrm"), - ZYDIS_MAKE_GENERATED_STRING("vpcmpltd"), - ZYDIS_MAKE_GENERATED_STRING("vpcmpq"), - ZYDIS_MAKE_GENERATED_STRING("vpcmpub"), - ZYDIS_MAKE_GENERATED_STRING("vpcmpud"), - ZYDIS_MAKE_GENERATED_STRING("vpcmpuq"), - ZYDIS_MAKE_GENERATED_STRING("vpcmpuw"), - ZYDIS_MAKE_GENERATED_STRING("vpcmpw"), - ZYDIS_MAKE_GENERATED_STRING("vpcomb"), - ZYDIS_MAKE_GENERATED_STRING("vpcomd"), - ZYDIS_MAKE_GENERATED_STRING("vpcompressb"), - ZYDIS_MAKE_GENERATED_STRING("vpcompressd"), - ZYDIS_MAKE_GENERATED_STRING("vpcompressq"), - ZYDIS_MAKE_GENERATED_STRING("vpcompressw"), - ZYDIS_MAKE_GENERATED_STRING("vpcomq"), - ZYDIS_MAKE_GENERATED_STRING("vpcomub"), - ZYDIS_MAKE_GENERATED_STRING("vpcomud"), - ZYDIS_MAKE_GENERATED_STRING("vpcomuq"), - ZYDIS_MAKE_GENERATED_STRING("vpcomuw"), - ZYDIS_MAKE_GENERATED_STRING("vpcomw"), - ZYDIS_MAKE_GENERATED_STRING("vpconflictd"), - ZYDIS_MAKE_GENERATED_STRING("vpconflictq"), - ZYDIS_MAKE_GENERATED_STRING("vpdpbusd"), - ZYDIS_MAKE_GENERATED_STRING("vpdpbusds"), - ZYDIS_MAKE_GENERATED_STRING("vpdpwssd"), - ZYDIS_MAKE_GENERATED_STRING("vpdpwssds"), - ZYDIS_MAKE_GENERATED_STRING("vperm2f128"), - ZYDIS_MAKE_GENERATED_STRING("vperm2i128"), - ZYDIS_MAKE_GENERATED_STRING("vpermb"), - ZYDIS_MAKE_GENERATED_STRING("vpermd"), - ZYDIS_MAKE_GENERATED_STRING("vpermf32x4"), - ZYDIS_MAKE_GENERATED_STRING("vpermi2b"), - ZYDIS_MAKE_GENERATED_STRING("vpermi2d"), - ZYDIS_MAKE_GENERATED_STRING("vpermi2pd"), - ZYDIS_MAKE_GENERATED_STRING("vpermi2ps"), - ZYDIS_MAKE_GENERATED_STRING("vpermi2q"), - ZYDIS_MAKE_GENERATED_STRING("vpermi2w"), - ZYDIS_MAKE_GENERATED_STRING("vpermil2pd"), - ZYDIS_MAKE_GENERATED_STRING("vpermil2ps"), - ZYDIS_MAKE_GENERATED_STRING("vpermilpd"), - ZYDIS_MAKE_GENERATED_STRING("vpermilps"), - ZYDIS_MAKE_GENERATED_STRING("vpermpd"), - ZYDIS_MAKE_GENERATED_STRING("vpermps"), - ZYDIS_MAKE_GENERATED_STRING("vpermq"), - ZYDIS_MAKE_GENERATED_STRING("vpermt2b"), - ZYDIS_MAKE_GENERATED_STRING("vpermt2d"), - ZYDIS_MAKE_GENERATED_STRING("vpermt2pd"), - ZYDIS_MAKE_GENERATED_STRING("vpermt2ps"), - ZYDIS_MAKE_GENERATED_STRING("vpermt2q"), - ZYDIS_MAKE_GENERATED_STRING("vpermt2w"), - ZYDIS_MAKE_GENERATED_STRING("vpermw"), - ZYDIS_MAKE_GENERATED_STRING("vpexpandb"), - ZYDIS_MAKE_GENERATED_STRING("vpexpandd"), - ZYDIS_MAKE_GENERATED_STRING("vpexpandq"), - ZYDIS_MAKE_GENERATED_STRING("vpexpandw"), - ZYDIS_MAKE_GENERATED_STRING("vpextrb"), - ZYDIS_MAKE_GENERATED_STRING("vpextrd"), - ZYDIS_MAKE_GENERATED_STRING("vpextrq"), - ZYDIS_MAKE_GENERATED_STRING("vpextrw"), - ZYDIS_MAKE_GENERATED_STRING("vpgatherdd"), - ZYDIS_MAKE_GENERATED_STRING("vpgatherdq"), - ZYDIS_MAKE_GENERATED_STRING("vpgatherqd"), - ZYDIS_MAKE_GENERATED_STRING("vpgatherqq"), - ZYDIS_MAKE_GENERATED_STRING("vphaddbd"), - ZYDIS_MAKE_GENERATED_STRING("vphaddbq"), - ZYDIS_MAKE_GENERATED_STRING("vphaddbw"), - ZYDIS_MAKE_GENERATED_STRING("vphaddd"), - ZYDIS_MAKE_GENERATED_STRING("vphadddq"), - ZYDIS_MAKE_GENERATED_STRING("vphaddsw"), - ZYDIS_MAKE_GENERATED_STRING("vphaddubd"), - ZYDIS_MAKE_GENERATED_STRING("vphaddubq"), - ZYDIS_MAKE_GENERATED_STRING("vphaddubw"), - ZYDIS_MAKE_GENERATED_STRING("vphaddudq"), - ZYDIS_MAKE_GENERATED_STRING("vphadduwd"), - ZYDIS_MAKE_GENERATED_STRING("vphadduwq"), - ZYDIS_MAKE_GENERATED_STRING("vphaddw"), - ZYDIS_MAKE_GENERATED_STRING("vphaddwd"), - ZYDIS_MAKE_GENERATED_STRING("vphaddwq"), - ZYDIS_MAKE_GENERATED_STRING("vphminposuw"), - ZYDIS_MAKE_GENERATED_STRING("vphsubbw"), - ZYDIS_MAKE_GENERATED_STRING("vphsubd"), - ZYDIS_MAKE_GENERATED_STRING("vphsubdq"), - ZYDIS_MAKE_GENERATED_STRING("vphsubsw"), - ZYDIS_MAKE_GENERATED_STRING("vphsubw"), - ZYDIS_MAKE_GENERATED_STRING("vphsubwd"), - ZYDIS_MAKE_GENERATED_STRING("vpinsrb"), - ZYDIS_MAKE_GENERATED_STRING("vpinsrd"), - ZYDIS_MAKE_GENERATED_STRING("vpinsrq"), - ZYDIS_MAKE_GENERATED_STRING("vpinsrw"), - ZYDIS_MAKE_GENERATED_STRING("vplzcntd"), - ZYDIS_MAKE_GENERATED_STRING("vplzcntq"), - ZYDIS_MAKE_GENERATED_STRING("vpmacsdd"), - ZYDIS_MAKE_GENERATED_STRING("vpmacsdqh"), - ZYDIS_MAKE_GENERATED_STRING("vpmacsdql"), - ZYDIS_MAKE_GENERATED_STRING("vpmacssdd"), - ZYDIS_MAKE_GENERATED_STRING("vpmacssdqh"), - ZYDIS_MAKE_GENERATED_STRING("vpmacssdql"), - ZYDIS_MAKE_GENERATED_STRING("vpmacsswd"), - ZYDIS_MAKE_GENERATED_STRING("vpmacssww"), - ZYDIS_MAKE_GENERATED_STRING("vpmacswd"), - ZYDIS_MAKE_GENERATED_STRING("vpmacsww"), - ZYDIS_MAKE_GENERATED_STRING("vpmadcsswd"), - ZYDIS_MAKE_GENERATED_STRING("vpmadcswd"), - ZYDIS_MAKE_GENERATED_STRING("vpmadd231d"), - ZYDIS_MAKE_GENERATED_STRING("vpmadd233d"), - ZYDIS_MAKE_GENERATED_STRING("vpmadd52huq"), - ZYDIS_MAKE_GENERATED_STRING("vpmadd52luq"), - ZYDIS_MAKE_GENERATED_STRING("vpmaddubsw"), - ZYDIS_MAKE_GENERATED_STRING("vpmaddwd"), - ZYDIS_MAKE_GENERATED_STRING("vpmaskmovd"), - ZYDIS_MAKE_GENERATED_STRING("vpmaskmovq"), - ZYDIS_MAKE_GENERATED_STRING("vpmaxsb"), - ZYDIS_MAKE_GENERATED_STRING("vpmaxsd"), - ZYDIS_MAKE_GENERATED_STRING("vpmaxsq"), - ZYDIS_MAKE_GENERATED_STRING("vpmaxsw"), - ZYDIS_MAKE_GENERATED_STRING("vpmaxub"), - ZYDIS_MAKE_GENERATED_STRING("vpmaxud"), - ZYDIS_MAKE_GENERATED_STRING("vpmaxuq"), - ZYDIS_MAKE_GENERATED_STRING("vpmaxuw"), - ZYDIS_MAKE_GENERATED_STRING("vpminsb"), - ZYDIS_MAKE_GENERATED_STRING("vpminsd"), - ZYDIS_MAKE_GENERATED_STRING("vpminsq"), - ZYDIS_MAKE_GENERATED_STRING("vpminsw"), - ZYDIS_MAKE_GENERATED_STRING("vpminub"), - ZYDIS_MAKE_GENERATED_STRING("vpminud"), - ZYDIS_MAKE_GENERATED_STRING("vpminuq"), - ZYDIS_MAKE_GENERATED_STRING("vpminuw"), - ZYDIS_MAKE_GENERATED_STRING("vpmovb2m"), - ZYDIS_MAKE_GENERATED_STRING("vpmovd2m"), - ZYDIS_MAKE_GENERATED_STRING("vpmovdb"), - ZYDIS_MAKE_GENERATED_STRING("vpmovdw"), - ZYDIS_MAKE_GENERATED_STRING("vpmovm2b"), - ZYDIS_MAKE_GENERATED_STRING("vpmovm2d"), - ZYDIS_MAKE_GENERATED_STRING("vpmovm2q"), - ZYDIS_MAKE_GENERATED_STRING("vpmovm2w"), - ZYDIS_MAKE_GENERATED_STRING("vpmovmskb"), - ZYDIS_MAKE_GENERATED_STRING("vpmovq2m"), - ZYDIS_MAKE_GENERATED_STRING("vpmovqb"), - ZYDIS_MAKE_GENERATED_STRING("vpmovqd"), - ZYDIS_MAKE_GENERATED_STRING("vpmovqw"), - ZYDIS_MAKE_GENERATED_STRING("vpmovsdb"), - ZYDIS_MAKE_GENERATED_STRING("vpmovsdw"), - ZYDIS_MAKE_GENERATED_STRING("vpmovsqb"), - ZYDIS_MAKE_GENERATED_STRING("vpmovsqd"), - ZYDIS_MAKE_GENERATED_STRING("vpmovsqw"), - ZYDIS_MAKE_GENERATED_STRING("vpmovswb"), - ZYDIS_MAKE_GENERATED_STRING("vpmovsxbd"), - ZYDIS_MAKE_GENERATED_STRING("vpmovsxbq"), - ZYDIS_MAKE_GENERATED_STRING("vpmovsxbw"), - ZYDIS_MAKE_GENERATED_STRING("vpmovsxdq"), - ZYDIS_MAKE_GENERATED_STRING("vpmovsxwd"), - ZYDIS_MAKE_GENERATED_STRING("vpmovsxwq"), - ZYDIS_MAKE_GENERATED_STRING("vpmovusdb"), - ZYDIS_MAKE_GENERATED_STRING("vpmovusdw"), - ZYDIS_MAKE_GENERATED_STRING("vpmovusqb"), - ZYDIS_MAKE_GENERATED_STRING("vpmovusqd"), - ZYDIS_MAKE_GENERATED_STRING("vpmovusqw"), - ZYDIS_MAKE_GENERATED_STRING("vpmovuswb"), - ZYDIS_MAKE_GENERATED_STRING("vpmovw2m"), - ZYDIS_MAKE_GENERATED_STRING("vpmovwb"), - ZYDIS_MAKE_GENERATED_STRING("vpmovzxbd"), - ZYDIS_MAKE_GENERATED_STRING("vpmovzxbq"), - ZYDIS_MAKE_GENERATED_STRING("vpmovzxbw"), - ZYDIS_MAKE_GENERATED_STRING("vpmovzxdq"), - ZYDIS_MAKE_GENERATED_STRING("vpmovzxwd"), - ZYDIS_MAKE_GENERATED_STRING("vpmovzxwq"), - ZYDIS_MAKE_GENERATED_STRING("vpmuldq"), - ZYDIS_MAKE_GENERATED_STRING("vpmulhd"), - ZYDIS_MAKE_GENERATED_STRING("vpmulhrsw"), - ZYDIS_MAKE_GENERATED_STRING("vpmulhud"), - ZYDIS_MAKE_GENERATED_STRING("vpmulhuw"), - ZYDIS_MAKE_GENERATED_STRING("vpmulhw"), - ZYDIS_MAKE_GENERATED_STRING("vpmulld"), - ZYDIS_MAKE_GENERATED_STRING("vpmullq"), - ZYDIS_MAKE_GENERATED_STRING("vpmullw"), - ZYDIS_MAKE_GENERATED_STRING("vpmultishiftqb"), - ZYDIS_MAKE_GENERATED_STRING("vpmuludq"), - ZYDIS_MAKE_GENERATED_STRING("vpopcntb"), - ZYDIS_MAKE_GENERATED_STRING("vpopcntd"), - ZYDIS_MAKE_GENERATED_STRING("vpopcntq"), - ZYDIS_MAKE_GENERATED_STRING("vpopcntw"), - ZYDIS_MAKE_GENERATED_STRING("vpor"), - ZYDIS_MAKE_GENERATED_STRING("vpord"), - ZYDIS_MAKE_GENERATED_STRING("vporq"), - ZYDIS_MAKE_GENERATED_STRING("vpperm"), - ZYDIS_MAKE_GENERATED_STRING("vprefetch0"), - ZYDIS_MAKE_GENERATED_STRING("vprefetch1"), - ZYDIS_MAKE_GENERATED_STRING("vprefetch2"), - ZYDIS_MAKE_GENERATED_STRING("vprefetche0"), - ZYDIS_MAKE_GENERATED_STRING("vprefetche1"), - ZYDIS_MAKE_GENERATED_STRING("vprefetche2"), - ZYDIS_MAKE_GENERATED_STRING("vprefetchenta"), - ZYDIS_MAKE_GENERATED_STRING("vprefetchnta"), - ZYDIS_MAKE_GENERATED_STRING("vprold"), - ZYDIS_MAKE_GENERATED_STRING("vprolq"), - ZYDIS_MAKE_GENERATED_STRING("vprolvd"), - ZYDIS_MAKE_GENERATED_STRING("vprolvq"), - ZYDIS_MAKE_GENERATED_STRING("vprord"), - ZYDIS_MAKE_GENERATED_STRING("vprorq"), - ZYDIS_MAKE_GENERATED_STRING("vprorvd"), - ZYDIS_MAKE_GENERATED_STRING("vprorvq"), - ZYDIS_MAKE_GENERATED_STRING("vprotb"), - ZYDIS_MAKE_GENERATED_STRING("vprotd"), - ZYDIS_MAKE_GENERATED_STRING("vprotq"), - ZYDIS_MAKE_GENERATED_STRING("vprotw"), - ZYDIS_MAKE_GENERATED_STRING("vpsadbw"), - ZYDIS_MAKE_GENERATED_STRING("vpsbbd"), - ZYDIS_MAKE_GENERATED_STRING("vpsbbrd"), - ZYDIS_MAKE_GENERATED_STRING("vpscatterdd"), - ZYDIS_MAKE_GENERATED_STRING("vpscatterdq"), - ZYDIS_MAKE_GENERATED_STRING("vpscatterqd"), - ZYDIS_MAKE_GENERATED_STRING("vpscatterqq"), - ZYDIS_MAKE_GENERATED_STRING("vpshab"), - ZYDIS_MAKE_GENERATED_STRING("vpshad"), - ZYDIS_MAKE_GENERATED_STRING("vpshaq"), - ZYDIS_MAKE_GENERATED_STRING("vpshaw"), - ZYDIS_MAKE_GENERATED_STRING("vpshlb"), - ZYDIS_MAKE_GENERATED_STRING("vpshld"), - ZYDIS_MAKE_GENERATED_STRING("vpshldd"), - ZYDIS_MAKE_GENERATED_STRING("vpshldq"), - ZYDIS_MAKE_GENERATED_STRING("vpshldvd"), - ZYDIS_MAKE_GENERATED_STRING("vpshldvq"), - ZYDIS_MAKE_GENERATED_STRING("vpshldvw"), - ZYDIS_MAKE_GENERATED_STRING("vpshldw"), - ZYDIS_MAKE_GENERATED_STRING("vpshlq"), - ZYDIS_MAKE_GENERATED_STRING("vpshlw"), - ZYDIS_MAKE_GENERATED_STRING("vpshrdd"), - ZYDIS_MAKE_GENERATED_STRING("vpshrdq"), - ZYDIS_MAKE_GENERATED_STRING("vpshrdvd"), - ZYDIS_MAKE_GENERATED_STRING("vpshrdvq"), - ZYDIS_MAKE_GENERATED_STRING("vpshrdvw"), - ZYDIS_MAKE_GENERATED_STRING("vpshrdw"), - ZYDIS_MAKE_GENERATED_STRING("vpshufb"), - ZYDIS_MAKE_GENERATED_STRING("vpshufbitqmb"), - ZYDIS_MAKE_GENERATED_STRING("vpshufd"), - ZYDIS_MAKE_GENERATED_STRING("vpshufhw"), - ZYDIS_MAKE_GENERATED_STRING("vpshuflw"), - ZYDIS_MAKE_GENERATED_STRING("vpsignb"), - ZYDIS_MAKE_GENERATED_STRING("vpsignd"), - ZYDIS_MAKE_GENERATED_STRING("vpsignw"), - ZYDIS_MAKE_GENERATED_STRING("vpslld"), - ZYDIS_MAKE_GENERATED_STRING("vpslldq"), - ZYDIS_MAKE_GENERATED_STRING("vpsllq"), - ZYDIS_MAKE_GENERATED_STRING("vpsllvd"), - ZYDIS_MAKE_GENERATED_STRING("vpsllvq"), - ZYDIS_MAKE_GENERATED_STRING("vpsllvw"), - ZYDIS_MAKE_GENERATED_STRING("vpsllw"), - ZYDIS_MAKE_GENERATED_STRING("vpsrad"), - ZYDIS_MAKE_GENERATED_STRING("vpsraq"), - ZYDIS_MAKE_GENERATED_STRING("vpsravd"), - ZYDIS_MAKE_GENERATED_STRING("vpsravq"), - ZYDIS_MAKE_GENERATED_STRING("vpsravw"), - ZYDIS_MAKE_GENERATED_STRING("vpsraw"), - ZYDIS_MAKE_GENERATED_STRING("vpsrld"), - ZYDIS_MAKE_GENERATED_STRING("vpsrldq"), - ZYDIS_MAKE_GENERATED_STRING("vpsrlq"), - ZYDIS_MAKE_GENERATED_STRING("vpsrlvd"), - ZYDIS_MAKE_GENERATED_STRING("vpsrlvq"), - ZYDIS_MAKE_GENERATED_STRING("vpsrlvw"), - ZYDIS_MAKE_GENERATED_STRING("vpsrlw"), - ZYDIS_MAKE_GENERATED_STRING("vpsubb"), - ZYDIS_MAKE_GENERATED_STRING("vpsubd"), - ZYDIS_MAKE_GENERATED_STRING("vpsubq"), - ZYDIS_MAKE_GENERATED_STRING("vpsubrd"), - ZYDIS_MAKE_GENERATED_STRING("vpsubrsetbd"), - ZYDIS_MAKE_GENERATED_STRING("vpsubsb"), - ZYDIS_MAKE_GENERATED_STRING("vpsubsetbd"), - ZYDIS_MAKE_GENERATED_STRING("vpsubsw"), - ZYDIS_MAKE_GENERATED_STRING("vpsubusb"), - ZYDIS_MAKE_GENERATED_STRING("vpsubusw"), - ZYDIS_MAKE_GENERATED_STRING("vpsubw"), - ZYDIS_MAKE_GENERATED_STRING("vpternlogd"), - ZYDIS_MAKE_GENERATED_STRING("vpternlogq"), - ZYDIS_MAKE_GENERATED_STRING("vptest"), - ZYDIS_MAKE_GENERATED_STRING("vptestmb"), - ZYDIS_MAKE_GENERATED_STRING("vptestmd"), - ZYDIS_MAKE_GENERATED_STRING("vptestmq"), - ZYDIS_MAKE_GENERATED_STRING("vptestmw"), - ZYDIS_MAKE_GENERATED_STRING("vptestnmb"), - ZYDIS_MAKE_GENERATED_STRING("vptestnmd"), - ZYDIS_MAKE_GENERATED_STRING("vptestnmq"), - ZYDIS_MAKE_GENERATED_STRING("vptestnmw"), - ZYDIS_MAKE_GENERATED_STRING("vpunpckhbw"), - ZYDIS_MAKE_GENERATED_STRING("vpunpckhdq"), - ZYDIS_MAKE_GENERATED_STRING("vpunpckhqdq"), - ZYDIS_MAKE_GENERATED_STRING("vpunpckhwd"), - ZYDIS_MAKE_GENERATED_STRING("vpunpcklbw"), - ZYDIS_MAKE_GENERATED_STRING("vpunpckldq"), - ZYDIS_MAKE_GENERATED_STRING("vpunpcklqdq"), - ZYDIS_MAKE_GENERATED_STRING("vpunpcklwd"), - ZYDIS_MAKE_GENERATED_STRING("vpxor"), - ZYDIS_MAKE_GENERATED_STRING("vpxord"), - ZYDIS_MAKE_GENERATED_STRING("vpxorq"), - ZYDIS_MAKE_GENERATED_STRING("vrangepd"), - ZYDIS_MAKE_GENERATED_STRING("vrangeps"), - ZYDIS_MAKE_GENERATED_STRING("vrangesd"), - ZYDIS_MAKE_GENERATED_STRING("vrangess"), - ZYDIS_MAKE_GENERATED_STRING("vrcp14pd"), - ZYDIS_MAKE_GENERATED_STRING("vrcp14ps"), - ZYDIS_MAKE_GENERATED_STRING("vrcp14sd"), - ZYDIS_MAKE_GENERATED_STRING("vrcp14ss"), - ZYDIS_MAKE_GENERATED_STRING("vrcp23ps"), - ZYDIS_MAKE_GENERATED_STRING("vrcp28pd"), - ZYDIS_MAKE_GENERATED_STRING("vrcp28ps"), - ZYDIS_MAKE_GENERATED_STRING("vrcp28sd"), - ZYDIS_MAKE_GENERATED_STRING("vrcp28ss"), - ZYDIS_MAKE_GENERATED_STRING("vrcpps"), - ZYDIS_MAKE_GENERATED_STRING("vrcpss"), - ZYDIS_MAKE_GENERATED_STRING("vreducepd"), - ZYDIS_MAKE_GENERATED_STRING("vreduceps"), - ZYDIS_MAKE_GENERATED_STRING("vreducesd"), - ZYDIS_MAKE_GENERATED_STRING("vreducess"), - ZYDIS_MAKE_GENERATED_STRING("vrndfxpntpd"), - ZYDIS_MAKE_GENERATED_STRING("vrndfxpntps"), - ZYDIS_MAKE_GENERATED_STRING("vrndscalepd"), - ZYDIS_MAKE_GENERATED_STRING("vrndscaleps"), - ZYDIS_MAKE_GENERATED_STRING("vrndscalesd"), - ZYDIS_MAKE_GENERATED_STRING("vrndscaless"), - ZYDIS_MAKE_GENERATED_STRING("vroundpd"), - ZYDIS_MAKE_GENERATED_STRING("vroundps"), - ZYDIS_MAKE_GENERATED_STRING("vroundsd"), - ZYDIS_MAKE_GENERATED_STRING("vroundss"), - ZYDIS_MAKE_GENERATED_STRING("vrsqrt14pd"), - ZYDIS_MAKE_GENERATED_STRING("vrsqrt14ps"), - ZYDIS_MAKE_GENERATED_STRING("vrsqrt14sd"), - ZYDIS_MAKE_GENERATED_STRING("vrsqrt14ss"), - ZYDIS_MAKE_GENERATED_STRING("vrsqrt23ps"), - ZYDIS_MAKE_GENERATED_STRING("vrsqrt28pd"), - ZYDIS_MAKE_GENERATED_STRING("vrsqrt28ps"), - ZYDIS_MAKE_GENERATED_STRING("vrsqrt28sd"), - ZYDIS_MAKE_GENERATED_STRING("vrsqrt28ss"), - ZYDIS_MAKE_GENERATED_STRING("vrsqrtps"), - ZYDIS_MAKE_GENERATED_STRING("vrsqrtss"), - ZYDIS_MAKE_GENERATED_STRING("vscalefpd"), - ZYDIS_MAKE_GENERATED_STRING("vscalefps"), - ZYDIS_MAKE_GENERATED_STRING("vscalefsd"), - ZYDIS_MAKE_GENERATED_STRING("vscalefss"), - ZYDIS_MAKE_GENERATED_STRING("vscaleps"), - ZYDIS_MAKE_GENERATED_STRING("vscatterdpd"), - ZYDIS_MAKE_GENERATED_STRING("vscatterdps"), - ZYDIS_MAKE_GENERATED_STRING("vscatterpf0dpd"), - ZYDIS_MAKE_GENERATED_STRING("vscatterpf0dps"), - ZYDIS_MAKE_GENERATED_STRING("vscatterpf0hintdpd"), - ZYDIS_MAKE_GENERATED_STRING("vscatterpf0hintdps"), - ZYDIS_MAKE_GENERATED_STRING("vscatterpf0qpd"), - ZYDIS_MAKE_GENERATED_STRING("vscatterpf0qps"), - ZYDIS_MAKE_GENERATED_STRING("vscatterpf1dpd"), - ZYDIS_MAKE_GENERATED_STRING("vscatterpf1dps"), - ZYDIS_MAKE_GENERATED_STRING("vscatterpf1qpd"), - ZYDIS_MAKE_GENERATED_STRING("vscatterpf1qps"), - ZYDIS_MAKE_GENERATED_STRING("vscatterqpd"), - ZYDIS_MAKE_GENERATED_STRING("vscatterqps"), - ZYDIS_MAKE_GENERATED_STRING("vshuff32x4"), - ZYDIS_MAKE_GENERATED_STRING("vshuff64x2"), - ZYDIS_MAKE_GENERATED_STRING("vshufi32x4"), - ZYDIS_MAKE_GENERATED_STRING("vshufi64x2"), - ZYDIS_MAKE_GENERATED_STRING("vshufpd"), - ZYDIS_MAKE_GENERATED_STRING("vshufps"), - ZYDIS_MAKE_GENERATED_STRING("vsqrtpd"), - ZYDIS_MAKE_GENERATED_STRING("vsqrtps"), - ZYDIS_MAKE_GENERATED_STRING("vsqrtsd"), - ZYDIS_MAKE_GENERATED_STRING("vsqrtss"), - ZYDIS_MAKE_GENERATED_STRING("vstmxcsr"), - ZYDIS_MAKE_GENERATED_STRING("vsubpd"), - ZYDIS_MAKE_GENERATED_STRING("vsubps"), - ZYDIS_MAKE_GENERATED_STRING("vsubrpd"), - ZYDIS_MAKE_GENERATED_STRING("vsubrps"), - ZYDIS_MAKE_GENERATED_STRING("vsubsd"), - ZYDIS_MAKE_GENERATED_STRING("vsubss"), - ZYDIS_MAKE_GENERATED_STRING("vtestpd"), - ZYDIS_MAKE_GENERATED_STRING("vtestps"), - ZYDIS_MAKE_GENERATED_STRING("vucomisd"), - ZYDIS_MAKE_GENERATED_STRING("vucomiss"), - ZYDIS_MAKE_GENERATED_STRING("vunpckhpd"), - ZYDIS_MAKE_GENERATED_STRING("vunpckhps"), - ZYDIS_MAKE_GENERATED_STRING("vunpcklpd"), - ZYDIS_MAKE_GENERATED_STRING("vunpcklps"), - ZYDIS_MAKE_GENERATED_STRING("vxorpd"), - ZYDIS_MAKE_GENERATED_STRING("vxorps"), - ZYDIS_MAKE_GENERATED_STRING("vzeroall"), - ZYDIS_MAKE_GENERATED_STRING("vzeroupper"), - ZYDIS_MAKE_GENERATED_STRING("wbinvd"), - ZYDIS_MAKE_GENERATED_STRING("wrfsbase"), - ZYDIS_MAKE_GENERATED_STRING("wrgsbase"), - ZYDIS_MAKE_GENERATED_STRING("wrmsr"), - ZYDIS_MAKE_GENERATED_STRING("wrpkru"), - ZYDIS_MAKE_GENERATED_STRING("wrssd"), - ZYDIS_MAKE_GENERATED_STRING("wrssq"), - ZYDIS_MAKE_GENERATED_STRING("wrussd"), - ZYDIS_MAKE_GENERATED_STRING("wrussq"), - ZYDIS_MAKE_GENERATED_STRING("xabort"), - ZYDIS_MAKE_GENERATED_STRING("xadd"), - ZYDIS_MAKE_GENERATED_STRING("xbegin"), - ZYDIS_MAKE_GENERATED_STRING("xchg"), - ZYDIS_MAKE_GENERATED_STRING("xend"), - ZYDIS_MAKE_GENERATED_STRING("xgetbv"), - ZYDIS_MAKE_GENERATED_STRING("xlat"), - ZYDIS_MAKE_GENERATED_STRING("xor"), - ZYDIS_MAKE_GENERATED_STRING("xorpd"), - ZYDIS_MAKE_GENERATED_STRING("xorps"), - ZYDIS_MAKE_GENERATED_STRING("xrstor"), - ZYDIS_MAKE_GENERATED_STRING("xrstor64"), - ZYDIS_MAKE_GENERATED_STRING("xrstors"), - ZYDIS_MAKE_GENERATED_STRING("xrstors64"), - ZYDIS_MAKE_GENERATED_STRING("xsave"), - ZYDIS_MAKE_GENERATED_STRING("xsave64"), - ZYDIS_MAKE_GENERATED_STRING("xsavec"), - ZYDIS_MAKE_GENERATED_STRING("xsavec64"), - ZYDIS_MAKE_GENERATED_STRING("xsaveopt"), - ZYDIS_MAKE_GENERATED_STRING("xsaveopt64"), - ZYDIS_MAKE_GENERATED_STRING("xsaves"), - ZYDIS_MAKE_GENERATED_STRING("xsaves64"), - ZYDIS_MAKE_GENERATED_STRING("xsetbv"), - ZYDIS_MAKE_GENERATED_STRING("xtest") + ZYDIS_MAKE_STATIC_STRING("invalid"), + ZYDIS_MAKE_STATIC_STRING("aaa"), + ZYDIS_MAKE_STATIC_STRING("aad"), + ZYDIS_MAKE_STATIC_STRING("aam"), + ZYDIS_MAKE_STATIC_STRING("aas"), + ZYDIS_MAKE_STATIC_STRING("adc"), + ZYDIS_MAKE_STATIC_STRING("adcx"), + ZYDIS_MAKE_STATIC_STRING("add"), + ZYDIS_MAKE_STATIC_STRING("addpd"), + ZYDIS_MAKE_STATIC_STRING("addps"), + ZYDIS_MAKE_STATIC_STRING("addsd"), + ZYDIS_MAKE_STATIC_STRING("addss"), + ZYDIS_MAKE_STATIC_STRING("addsubpd"), + ZYDIS_MAKE_STATIC_STRING("addsubps"), + ZYDIS_MAKE_STATIC_STRING("adox"), + ZYDIS_MAKE_STATIC_STRING("aesdec"), + ZYDIS_MAKE_STATIC_STRING("aesdeclast"), + ZYDIS_MAKE_STATIC_STRING("aesenc"), + ZYDIS_MAKE_STATIC_STRING("aesenclast"), + ZYDIS_MAKE_STATIC_STRING("aesimc"), + ZYDIS_MAKE_STATIC_STRING("aeskeygenassist"), + ZYDIS_MAKE_STATIC_STRING("and"), + ZYDIS_MAKE_STATIC_STRING("andn"), + ZYDIS_MAKE_STATIC_STRING("andnpd"), + ZYDIS_MAKE_STATIC_STRING("andnps"), + ZYDIS_MAKE_STATIC_STRING("andpd"), + ZYDIS_MAKE_STATIC_STRING("andps"), + ZYDIS_MAKE_STATIC_STRING("arpl"), + ZYDIS_MAKE_STATIC_STRING("bextr"), + ZYDIS_MAKE_STATIC_STRING("blcfill"), + ZYDIS_MAKE_STATIC_STRING("blci"), + ZYDIS_MAKE_STATIC_STRING("blcic"), + ZYDIS_MAKE_STATIC_STRING("blcmsk"), + ZYDIS_MAKE_STATIC_STRING("blcs"), + ZYDIS_MAKE_STATIC_STRING("blendpd"), + ZYDIS_MAKE_STATIC_STRING("blendps"), + ZYDIS_MAKE_STATIC_STRING("blendvpd"), + ZYDIS_MAKE_STATIC_STRING("blendvps"), + ZYDIS_MAKE_STATIC_STRING("blsfill"), + ZYDIS_MAKE_STATIC_STRING("blsi"), + ZYDIS_MAKE_STATIC_STRING("blsic"), + ZYDIS_MAKE_STATIC_STRING("blsmsk"), + ZYDIS_MAKE_STATIC_STRING("blsr"), + ZYDIS_MAKE_STATIC_STRING("bndcl"), + ZYDIS_MAKE_STATIC_STRING("bndcn"), + ZYDIS_MAKE_STATIC_STRING("bndcu"), + ZYDIS_MAKE_STATIC_STRING("bndldx"), + ZYDIS_MAKE_STATIC_STRING("bndmk"), + ZYDIS_MAKE_STATIC_STRING("bndmov"), + ZYDIS_MAKE_STATIC_STRING("bndstx"), + ZYDIS_MAKE_STATIC_STRING("bound"), + ZYDIS_MAKE_STATIC_STRING("bsf"), + ZYDIS_MAKE_STATIC_STRING("bsr"), + ZYDIS_MAKE_STATIC_STRING("bswap"), + ZYDIS_MAKE_STATIC_STRING("bt"), + ZYDIS_MAKE_STATIC_STRING("btc"), + ZYDIS_MAKE_STATIC_STRING("btr"), + ZYDIS_MAKE_STATIC_STRING("bts"), + ZYDIS_MAKE_STATIC_STRING("bzhi"), + ZYDIS_MAKE_STATIC_STRING("call"), + ZYDIS_MAKE_STATIC_STRING("cbw"), + ZYDIS_MAKE_STATIC_STRING("cdq"), + ZYDIS_MAKE_STATIC_STRING("cdqe"), + ZYDIS_MAKE_STATIC_STRING("clac"), + ZYDIS_MAKE_STATIC_STRING("clc"), + ZYDIS_MAKE_STATIC_STRING("cld"), + ZYDIS_MAKE_STATIC_STRING("clevict0"), + ZYDIS_MAKE_STATIC_STRING("clevict1"), + ZYDIS_MAKE_STATIC_STRING("clflush"), + ZYDIS_MAKE_STATIC_STRING("clflushopt"), + ZYDIS_MAKE_STATIC_STRING("clgi"), + ZYDIS_MAKE_STATIC_STRING("cli"), + ZYDIS_MAKE_STATIC_STRING("clrssbsy"), + ZYDIS_MAKE_STATIC_STRING("clts"), + ZYDIS_MAKE_STATIC_STRING("clwb"), + ZYDIS_MAKE_STATIC_STRING("clzero"), + ZYDIS_MAKE_STATIC_STRING("cmc"), + ZYDIS_MAKE_STATIC_STRING("cmovb"), + ZYDIS_MAKE_STATIC_STRING("cmovbe"), + ZYDIS_MAKE_STATIC_STRING("cmovl"), + ZYDIS_MAKE_STATIC_STRING("cmovle"), + ZYDIS_MAKE_STATIC_STRING("cmovnb"), + ZYDIS_MAKE_STATIC_STRING("cmovnbe"), + ZYDIS_MAKE_STATIC_STRING("cmovnl"), + ZYDIS_MAKE_STATIC_STRING("cmovnle"), + ZYDIS_MAKE_STATIC_STRING("cmovno"), + ZYDIS_MAKE_STATIC_STRING("cmovnp"), + ZYDIS_MAKE_STATIC_STRING("cmovns"), + ZYDIS_MAKE_STATIC_STRING("cmovnz"), + ZYDIS_MAKE_STATIC_STRING("cmovo"), + ZYDIS_MAKE_STATIC_STRING("cmovp"), + ZYDIS_MAKE_STATIC_STRING("cmovs"), + ZYDIS_MAKE_STATIC_STRING("cmovz"), + ZYDIS_MAKE_STATIC_STRING("cmp"), + ZYDIS_MAKE_STATIC_STRING("cmppd"), + ZYDIS_MAKE_STATIC_STRING("cmpps"), + ZYDIS_MAKE_STATIC_STRING("cmpsb"), + ZYDIS_MAKE_STATIC_STRING("cmpsd"), + ZYDIS_MAKE_STATIC_STRING("cmpsq"), + ZYDIS_MAKE_STATIC_STRING("cmpss"), + ZYDIS_MAKE_STATIC_STRING("cmpsw"), + ZYDIS_MAKE_STATIC_STRING("cmpxchg"), + ZYDIS_MAKE_STATIC_STRING("cmpxchg16b"), + ZYDIS_MAKE_STATIC_STRING("cmpxchg8b"), + ZYDIS_MAKE_STATIC_STRING("comisd"), + ZYDIS_MAKE_STATIC_STRING("comiss"), + ZYDIS_MAKE_STATIC_STRING("cpuid"), + ZYDIS_MAKE_STATIC_STRING("cqo"), + ZYDIS_MAKE_STATIC_STRING("crc32"), + ZYDIS_MAKE_STATIC_STRING("cvtdq2pd"), + ZYDIS_MAKE_STATIC_STRING("cvtdq2ps"), + ZYDIS_MAKE_STATIC_STRING("cvtpd2dq"), + ZYDIS_MAKE_STATIC_STRING("cvtpd2pi"), + ZYDIS_MAKE_STATIC_STRING("cvtpd2ps"), + ZYDIS_MAKE_STATIC_STRING("cvtpi2pd"), + ZYDIS_MAKE_STATIC_STRING("cvtpi2ps"), + ZYDIS_MAKE_STATIC_STRING("cvtps2dq"), + ZYDIS_MAKE_STATIC_STRING("cvtps2pd"), + ZYDIS_MAKE_STATIC_STRING("cvtps2pi"), + ZYDIS_MAKE_STATIC_STRING("cvtsd2si"), + ZYDIS_MAKE_STATIC_STRING("cvtsd2ss"), + ZYDIS_MAKE_STATIC_STRING("cvtsi2sd"), + ZYDIS_MAKE_STATIC_STRING("cvtsi2ss"), + ZYDIS_MAKE_STATIC_STRING("cvtss2sd"), + ZYDIS_MAKE_STATIC_STRING("cvtss2si"), + ZYDIS_MAKE_STATIC_STRING("cvttpd2dq"), + ZYDIS_MAKE_STATIC_STRING("cvttpd2pi"), + ZYDIS_MAKE_STATIC_STRING("cvttps2dq"), + ZYDIS_MAKE_STATIC_STRING("cvttps2pi"), + ZYDIS_MAKE_STATIC_STRING("cvttsd2si"), + ZYDIS_MAKE_STATIC_STRING("cvttss2si"), + ZYDIS_MAKE_STATIC_STRING("cwd"), + ZYDIS_MAKE_STATIC_STRING("cwde"), + ZYDIS_MAKE_STATIC_STRING("daa"), + ZYDIS_MAKE_STATIC_STRING("das"), + ZYDIS_MAKE_STATIC_STRING("dec"), + ZYDIS_MAKE_STATIC_STRING("delay"), + ZYDIS_MAKE_STATIC_STRING("div"), + ZYDIS_MAKE_STATIC_STRING("divpd"), + ZYDIS_MAKE_STATIC_STRING("divps"), + ZYDIS_MAKE_STATIC_STRING("divsd"), + ZYDIS_MAKE_STATIC_STRING("divss"), + ZYDIS_MAKE_STATIC_STRING("dppd"), + ZYDIS_MAKE_STATIC_STRING("dpps"), + ZYDIS_MAKE_STATIC_STRING("emms"), + ZYDIS_MAKE_STATIC_STRING("encls"), + ZYDIS_MAKE_STATIC_STRING("enclu"), + ZYDIS_MAKE_STATIC_STRING("endbr32"), + ZYDIS_MAKE_STATIC_STRING("endbr64"), + ZYDIS_MAKE_STATIC_STRING("enter"), + ZYDIS_MAKE_STATIC_STRING("extractps"), + ZYDIS_MAKE_STATIC_STRING("f2xm1"), + ZYDIS_MAKE_STATIC_STRING("fabs"), + ZYDIS_MAKE_STATIC_STRING("fadd"), + ZYDIS_MAKE_STATIC_STRING("faddp"), + ZYDIS_MAKE_STATIC_STRING("fbld"), + ZYDIS_MAKE_STATIC_STRING("fbstp"), + ZYDIS_MAKE_STATIC_STRING("fchs"), + ZYDIS_MAKE_STATIC_STRING("fcmovb"), + ZYDIS_MAKE_STATIC_STRING("fcmovbe"), + ZYDIS_MAKE_STATIC_STRING("fcmove"), + ZYDIS_MAKE_STATIC_STRING("fcmovnb"), + ZYDIS_MAKE_STATIC_STRING("fcmovnbe"), + ZYDIS_MAKE_STATIC_STRING("fcmovne"), + ZYDIS_MAKE_STATIC_STRING("fcmovnu"), + ZYDIS_MAKE_STATIC_STRING("fcmovu"), + ZYDIS_MAKE_STATIC_STRING("fcom"), + ZYDIS_MAKE_STATIC_STRING("fcomi"), + ZYDIS_MAKE_STATIC_STRING("fcomip"), + ZYDIS_MAKE_STATIC_STRING("fcomp"), + ZYDIS_MAKE_STATIC_STRING("fcompp"), + ZYDIS_MAKE_STATIC_STRING("fcos"), + ZYDIS_MAKE_STATIC_STRING("fdecstp"), + ZYDIS_MAKE_STATIC_STRING("fdisi8087_nop"), + ZYDIS_MAKE_STATIC_STRING("fdiv"), + ZYDIS_MAKE_STATIC_STRING("fdivp"), + ZYDIS_MAKE_STATIC_STRING("fdivr"), + ZYDIS_MAKE_STATIC_STRING("fdivrp"), + ZYDIS_MAKE_STATIC_STRING("femms"), + ZYDIS_MAKE_STATIC_STRING("feni8087_nop"), + ZYDIS_MAKE_STATIC_STRING("ffree"), + ZYDIS_MAKE_STATIC_STRING("ffreep"), + ZYDIS_MAKE_STATIC_STRING("fiadd"), + ZYDIS_MAKE_STATIC_STRING("ficom"), + ZYDIS_MAKE_STATIC_STRING("ficomp"), + ZYDIS_MAKE_STATIC_STRING("fidiv"), + ZYDIS_MAKE_STATIC_STRING("fidivr"), + ZYDIS_MAKE_STATIC_STRING("fild"), + ZYDIS_MAKE_STATIC_STRING("fimul"), + ZYDIS_MAKE_STATIC_STRING("fincstp"), + ZYDIS_MAKE_STATIC_STRING("fist"), + ZYDIS_MAKE_STATIC_STRING("fistp"), + ZYDIS_MAKE_STATIC_STRING("fisttp"), + ZYDIS_MAKE_STATIC_STRING("fisub"), + ZYDIS_MAKE_STATIC_STRING("fisubr"), + ZYDIS_MAKE_STATIC_STRING("fld"), + ZYDIS_MAKE_STATIC_STRING("fld1"), + ZYDIS_MAKE_STATIC_STRING("fldcw"), + ZYDIS_MAKE_STATIC_STRING("fldenv"), + ZYDIS_MAKE_STATIC_STRING("fldl2e"), + ZYDIS_MAKE_STATIC_STRING("fldl2t"), + ZYDIS_MAKE_STATIC_STRING("fldlg2"), + ZYDIS_MAKE_STATIC_STRING("fldln2"), + ZYDIS_MAKE_STATIC_STRING("fldpi"), + ZYDIS_MAKE_STATIC_STRING("fldz"), + ZYDIS_MAKE_STATIC_STRING("fmul"), + ZYDIS_MAKE_STATIC_STRING("fmulp"), + ZYDIS_MAKE_STATIC_STRING("fnclex"), + ZYDIS_MAKE_STATIC_STRING("fninit"), + ZYDIS_MAKE_STATIC_STRING("fnop"), + ZYDIS_MAKE_STATIC_STRING("fnsave"), + ZYDIS_MAKE_STATIC_STRING("fnstcw"), + ZYDIS_MAKE_STATIC_STRING("fnstenv"), + ZYDIS_MAKE_STATIC_STRING("fnstsw"), + ZYDIS_MAKE_STATIC_STRING("fpatan"), + ZYDIS_MAKE_STATIC_STRING("fprem"), + ZYDIS_MAKE_STATIC_STRING("fprem1"), + ZYDIS_MAKE_STATIC_STRING("fptan"), + ZYDIS_MAKE_STATIC_STRING("frndint"), + ZYDIS_MAKE_STATIC_STRING("frstor"), + ZYDIS_MAKE_STATIC_STRING("fscale"), + ZYDIS_MAKE_STATIC_STRING("fsetpm287_nop"), + ZYDIS_MAKE_STATIC_STRING("fsin"), + ZYDIS_MAKE_STATIC_STRING("fsincos"), + ZYDIS_MAKE_STATIC_STRING("fsqrt"), + ZYDIS_MAKE_STATIC_STRING("fst"), + ZYDIS_MAKE_STATIC_STRING("fstp"), + ZYDIS_MAKE_STATIC_STRING("fstpnce"), + ZYDIS_MAKE_STATIC_STRING("fsub"), + ZYDIS_MAKE_STATIC_STRING("fsubp"), + ZYDIS_MAKE_STATIC_STRING("fsubr"), + ZYDIS_MAKE_STATIC_STRING("fsubrp"), + ZYDIS_MAKE_STATIC_STRING("ftst"), + ZYDIS_MAKE_STATIC_STRING("fucom"), + ZYDIS_MAKE_STATIC_STRING("fucomi"), + ZYDIS_MAKE_STATIC_STRING("fucomip"), + ZYDIS_MAKE_STATIC_STRING("fucomp"), + ZYDIS_MAKE_STATIC_STRING("fucompp"), + ZYDIS_MAKE_STATIC_STRING("fwait"), + ZYDIS_MAKE_STATIC_STRING("fxam"), + ZYDIS_MAKE_STATIC_STRING("fxch"), + ZYDIS_MAKE_STATIC_STRING("fxrstor"), + ZYDIS_MAKE_STATIC_STRING("fxrstor64"), + ZYDIS_MAKE_STATIC_STRING("fxsave"), + ZYDIS_MAKE_STATIC_STRING("fxsave64"), + ZYDIS_MAKE_STATIC_STRING("fxtract"), + ZYDIS_MAKE_STATIC_STRING("fyl2x"), + ZYDIS_MAKE_STATIC_STRING("fyl2xp1"), + ZYDIS_MAKE_STATIC_STRING("getsec"), + ZYDIS_MAKE_STATIC_STRING("gf2p8affineinvqb"), + ZYDIS_MAKE_STATIC_STRING("gf2p8affineqb"), + ZYDIS_MAKE_STATIC_STRING("gf2p8mulb"), + ZYDIS_MAKE_STATIC_STRING("haddpd"), + ZYDIS_MAKE_STATIC_STRING("haddps"), + ZYDIS_MAKE_STATIC_STRING("hlt"), + ZYDIS_MAKE_STATIC_STRING("hsubpd"), + ZYDIS_MAKE_STATIC_STRING("hsubps"), + ZYDIS_MAKE_STATIC_STRING("idiv"), + ZYDIS_MAKE_STATIC_STRING("imul"), + ZYDIS_MAKE_STATIC_STRING("in"), + ZYDIS_MAKE_STATIC_STRING("inc"), + ZYDIS_MAKE_STATIC_STRING("incsspd"), + ZYDIS_MAKE_STATIC_STRING("incsspq"), + ZYDIS_MAKE_STATIC_STRING("insb"), + ZYDIS_MAKE_STATIC_STRING("insd"), + ZYDIS_MAKE_STATIC_STRING("insertps"), + ZYDIS_MAKE_STATIC_STRING("insw"), + ZYDIS_MAKE_STATIC_STRING("int"), + ZYDIS_MAKE_STATIC_STRING("int1"), + ZYDIS_MAKE_STATIC_STRING("int3"), + ZYDIS_MAKE_STATIC_STRING("into"), + ZYDIS_MAKE_STATIC_STRING("invd"), + ZYDIS_MAKE_STATIC_STRING("invept"), + ZYDIS_MAKE_STATIC_STRING("invlpg"), + ZYDIS_MAKE_STATIC_STRING("invlpga"), + ZYDIS_MAKE_STATIC_STRING("invpcid"), + ZYDIS_MAKE_STATIC_STRING("invvpid"), + ZYDIS_MAKE_STATIC_STRING("iret"), + ZYDIS_MAKE_STATIC_STRING("iretd"), + ZYDIS_MAKE_STATIC_STRING("iretq"), + ZYDIS_MAKE_STATIC_STRING("jb"), + ZYDIS_MAKE_STATIC_STRING("jbe"), + ZYDIS_MAKE_STATIC_STRING("jcxz"), + ZYDIS_MAKE_STATIC_STRING("jecxz"), + ZYDIS_MAKE_STATIC_STRING("jknzd"), + ZYDIS_MAKE_STATIC_STRING("jkzd"), + ZYDIS_MAKE_STATIC_STRING("jl"), + ZYDIS_MAKE_STATIC_STRING("jle"), + ZYDIS_MAKE_STATIC_STRING("jmp"), + ZYDIS_MAKE_STATIC_STRING("jnb"), + ZYDIS_MAKE_STATIC_STRING("jnbe"), + ZYDIS_MAKE_STATIC_STRING("jnl"), + ZYDIS_MAKE_STATIC_STRING("jnle"), + ZYDIS_MAKE_STATIC_STRING("jno"), + ZYDIS_MAKE_STATIC_STRING("jnp"), + ZYDIS_MAKE_STATIC_STRING("jns"), + ZYDIS_MAKE_STATIC_STRING("jnz"), + ZYDIS_MAKE_STATIC_STRING("jo"), + ZYDIS_MAKE_STATIC_STRING("jp"), + ZYDIS_MAKE_STATIC_STRING("jrcxz"), + ZYDIS_MAKE_STATIC_STRING("js"), + ZYDIS_MAKE_STATIC_STRING("jz"), + ZYDIS_MAKE_STATIC_STRING("kaddb"), + ZYDIS_MAKE_STATIC_STRING("kaddd"), + ZYDIS_MAKE_STATIC_STRING("kaddq"), + ZYDIS_MAKE_STATIC_STRING("kaddw"), + ZYDIS_MAKE_STATIC_STRING("kand"), + ZYDIS_MAKE_STATIC_STRING("kandb"), + ZYDIS_MAKE_STATIC_STRING("kandd"), + ZYDIS_MAKE_STATIC_STRING("kandn"), + ZYDIS_MAKE_STATIC_STRING("kandnb"), + ZYDIS_MAKE_STATIC_STRING("kandnd"), + ZYDIS_MAKE_STATIC_STRING("kandnq"), + ZYDIS_MAKE_STATIC_STRING("kandnr"), + ZYDIS_MAKE_STATIC_STRING("kandnw"), + ZYDIS_MAKE_STATIC_STRING("kandq"), + ZYDIS_MAKE_STATIC_STRING("kandw"), + ZYDIS_MAKE_STATIC_STRING("kconcath"), + ZYDIS_MAKE_STATIC_STRING("kconcatl"), + ZYDIS_MAKE_STATIC_STRING("kextract"), + ZYDIS_MAKE_STATIC_STRING("kmerge2l1h"), + ZYDIS_MAKE_STATIC_STRING("kmerge2l1l"), + ZYDIS_MAKE_STATIC_STRING("kmov"), + ZYDIS_MAKE_STATIC_STRING("kmovb"), + ZYDIS_MAKE_STATIC_STRING("kmovd"), + ZYDIS_MAKE_STATIC_STRING("kmovq"), + ZYDIS_MAKE_STATIC_STRING("kmovw"), + ZYDIS_MAKE_STATIC_STRING("knot"), + ZYDIS_MAKE_STATIC_STRING("knotb"), + ZYDIS_MAKE_STATIC_STRING("knotd"), + ZYDIS_MAKE_STATIC_STRING("knotq"), + ZYDIS_MAKE_STATIC_STRING("knotw"), + ZYDIS_MAKE_STATIC_STRING("kor"), + ZYDIS_MAKE_STATIC_STRING("korb"), + ZYDIS_MAKE_STATIC_STRING("kord"), + ZYDIS_MAKE_STATIC_STRING("korq"), + ZYDIS_MAKE_STATIC_STRING("kortest"), + ZYDIS_MAKE_STATIC_STRING("kortestb"), + ZYDIS_MAKE_STATIC_STRING("kortestd"), + ZYDIS_MAKE_STATIC_STRING("kortestq"), + ZYDIS_MAKE_STATIC_STRING("kortestw"), + ZYDIS_MAKE_STATIC_STRING("korw"), + ZYDIS_MAKE_STATIC_STRING("kshiftlb"), + ZYDIS_MAKE_STATIC_STRING("kshiftld"), + ZYDIS_MAKE_STATIC_STRING("kshiftlq"), + ZYDIS_MAKE_STATIC_STRING("kshiftlw"), + ZYDIS_MAKE_STATIC_STRING("kshiftrb"), + ZYDIS_MAKE_STATIC_STRING("kshiftrd"), + ZYDIS_MAKE_STATIC_STRING("kshiftrq"), + ZYDIS_MAKE_STATIC_STRING("kshiftrw"), + ZYDIS_MAKE_STATIC_STRING("ktestb"), + ZYDIS_MAKE_STATIC_STRING("ktestd"), + ZYDIS_MAKE_STATIC_STRING("ktestq"), + ZYDIS_MAKE_STATIC_STRING("ktestw"), + ZYDIS_MAKE_STATIC_STRING("kunpckbw"), + ZYDIS_MAKE_STATIC_STRING("kunpckdq"), + ZYDIS_MAKE_STATIC_STRING("kunpckwd"), + ZYDIS_MAKE_STATIC_STRING("kxnor"), + ZYDIS_MAKE_STATIC_STRING("kxnorb"), + ZYDIS_MAKE_STATIC_STRING("kxnord"), + ZYDIS_MAKE_STATIC_STRING("kxnorq"), + ZYDIS_MAKE_STATIC_STRING("kxnorw"), + ZYDIS_MAKE_STATIC_STRING("kxor"), + ZYDIS_MAKE_STATIC_STRING("kxorb"), + ZYDIS_MAKE_STATIC_STRING("kxord"), + ZYDIS_MAKE_STATIC_STRING("kxorq"), + ZYDIS_MAKE_STATIC_STRING("kxorw"), + ZYDIS_MAKE_STATIC_STRING("lahf"), + ZYDIS_MAKE_STATIC_STRING("lar"), + ZYDIS_MAKE_STATIC_STRING("lddqu"), + ZYDIS_MAKE_STATIC_STRING("ldmxcsr"), + ZYDIS_MAKE_STATIC_STRING("lds"), + ZYDIS_MAKE_STATIC_STRING("lea"), + ZYDIS_MAKE_STATIC_STRING("leave"), + ZYDIS_MAKE_STATIC_STRING("les"), + ZYDIS_MAKE_STATIC_STRING("lfence"), + ZYDIS_MAKE_STATIC_STRING("lfs"), + ZYDIS_MAKE_STATIC_STRING("lgdt"), + ZYDIS_MAKE_STATIC_STRING("lgs"), + ZYDIS_MAKE_STATIC_STRING("lidt"), + ZYDIS_MAKE_STATIC_STRING("lldt"), + ZYDIS_MAKE_STATIC_STRING("llwpcb"), + ZYDIS_MAKE_STATIC_STRING("lmsw"), + ZYDIS_MAKE_STATIC_STRING("lodsb"), + ZYDIS_MAKE_STATIC_STRING("lodsd"), + ZYDIS_MAKE_STATIC_STRING("lodsq"), + ZYDIS_MAKE_STATIC_STRING("lodsw"), + ZYDIS_MAKE_STATIC_STRING("loop"), + ZYDIS_MAKE_STATIC_STRING("loope"), + ZYDIS_MAKE_STATIC_STRING("loopne"), + ZYDIS_MAKE_STATIC_STRING("lsl"), + ZYDIS_MAKE_STATIC_STRING("lss"), + ZYDIS_MAKE_STATIC_STRING("ltr"), + ZYDIS_MAKE_STATIC_STRING("lwpins"), + ZYDIS_MAKE_STATIC_STRING("lwpval"), + ZYDIS_MAKE_STATIC_STRING("lzcnt"), + ZYDIS_MAKE_STATIC_STRING("maskmovdqu"), + ZYDIS_MAKE_STATIC_STRING("maskmovq"), + ZYDIS_MAKE_STATIC_STRING("maxpd"), + ZYDIS_MAKE_STATIC_STRING("maxps"), + ZYDIS_MAKE_STATIC_STRING("maxsd"), + ZYDIS_MAKE_STATIC_STRING("maxss"), + ZYDIS_MAKE_STATIC_STRING("mfence"), + ZYDIS_MAKE_STATIC_STRING("minpd"), + ZYDIS_MAKE_STATIC_STRING("minps"), + ZYDIS_MAKE_STATIC_STRING("minsd"), + ZYDIS_MAKE_STATIC_STRING("minss"), + ZYDIS_MAKE_STATIC_STRING("monitor"), + ZYDIS_MAKE_STATIC_STRING("mov"), + ZYDIS_MAKE_STATIC_STRING("movapd"), + ZYDIS_MAKE_STATIC_STRING("movaps"), + ZYDIS_MAKE_STATIC_STRING("movbe"), + ZYDIS_MAKE_STATIC_STRING("movd"), + ZYDIS_MAKE_STATIC_STRING("movddup"), + ZYDIS_MAKE_STATIC_STRING("movdq2q"), + ZYDIS_MAKE_STATIC_STRING("movdqa"), + ZYDIS_MAKE_STATIC_STRING("movdqu"), + ZYDIS_MAKE_STATIC_STRING("movhlps"), + ZYDIS_MAKE_STATIC_STRING("movhpd"), + ZYDIS_MAKE_STATIC_STRING("movhps"), + ZYDIS_MAKE_STATIC_STRING("movlhps"), + ZYDIS_MAKE_STATIC_STRING("movlpd"), + ZYDIS_MAKE_STATIC_STRING("movlps"), + ZYDIS_MAKE_STATIC_STRING("movmskpd"), + ZYDIS_MAKE_STATIC_STRING("movmskps"), + ZYDIS_MAKE_STATIC_STRING("movntdq"), + ZYDIS_MAKE_STATIC_STRING("movntdqa"), + ZYDIS_MAKE_STATIC_STRING("movnti"), + ZYDIS_MAKE_STATIC_STRING("movntpd"), + ZYDIS_MAKE_STATIC_STRING("movntps"), + ZYDIS_MAKE_STATIC_STRING("movntq"), + ZYDIS_MAKE_STATIC_STRING("movq"), + ZYDIS_MAKE_STATIC_STRING("movq2dq"), + ZYDIS_MAKE_STATIC_STRING("movsb"), + ZYDIS_MAKE_STATIC_STRING("movsd"), + ZYDIS_MAKE_STATIC_STRING("movshdup"), + ZYDIS_MAKE_STATIC_STRING("movsldup"), + ZYDIS_MAKE_STATIC_STRING("movsq"), + ZYDIS_MAKE_STATIC_STRING("movss"), + ZYDIS_MAKE_STATIC_STRING("movsw"), + ZYDIS_MAKE_STATIC_STRING("movsx"), + ZYDIS_MAKE_STATIC_STRING("movsxd"), + ZYDIS_MAKE_STATIC_STRING("movupd"), + ZYDIS_MAKE_STATIC_STRING("movups"), + ZYDIS_MAKE_STATIC_STRING("movzx"), + ZYDIS_MAKE_STATIC_STRING("mpsadbw"), + ZYDIS_MAKE_STATIC_STRING("mul"), + ZYDIS_MAKE_STATIC_STRING("mulpd"), + ZYDIS_MAKE_STATIC_STRING("mulps"), + ZYDIS_MAKE_STATIC_STRING("mulsd"), + ZYDIS_MAKE_STATIC_STRING("mulss"), + ZYDIS_MAKE_STATIC_STRING("mulx"), + ZYDIS_MAKE_STATIC_STRING("mwait"), + ZYDIS_MAKE_STATIC_STRING("neg"), + ZYDIS_MAKE_STATIC_STRING("nop"), + ZYDIS_MAKE_STATIC_STRING("not"), + ZYDIS_MAKE_STATIC_STRING("or"), + ZYDIS_MAKE_STATIC_STRING("orpd"), + ZYDIS_MAKE_STATIC_STRING("orps"), + ZYDIS_MAKE_STATIC_STRING("out"), + ZYDIS_MAKE_STATIC_STRING("outsb"), + ZYDIS_MAKE_STATIC_STRING("outsd"), + ZYDIS_MAKE_STATIC_STRING("outsw"), + ZYDIS_MAKE_STATIC_STRING("pabsb"), + ZYDIS_MAKE_STATIC_STRING("pabsd"), + ZYDIS_MAKE_STATIC_STRING("pabsw"), + ZYDIS_MAKE_STATIC_STRING("packssdw"), + ZYDIS_MAKE_STATIC_STRING("packsswb"), + ZYDIS_MAKE_STATIC_STRING("packusdw"), + ZYDIS_MAKE_STATIC_STRING("packuswb"), + ZYDIS_MAKE_STATIC_STRING("paddb"), + ZYDIS_MAKE_STATIC_STRING("paddd"), + ZYDIS_MAKE_STATIC_STRING("paddq"), + ZYDIS_MAKE_STATIC_STRING("paddsb"), + ZYDIS_MAKE_STATIC_STRING("paddsw"), + ZYDIS_MAKE_STATIC_STRING("paddusb"), + ZYDIS_MAKE_STATIC_STRING("paddusw"), + ZYDIS_MAKE_STATIC_STRING("paddw"), + ZYDIS_MAKE_STATIC_STRING("palignr"), + ZYDIS_MAKE_STATIC_STRING("pand"), + ZYDIS_MAKE_STATIC_STRING("pandn"), + ZYDIS_MAKE_STATIC_STRING("pause"), + ZYDIS_MAKE_STATIC_STRING("pavgb"), + ZYDIS_MAKE_STATIC_STRING("pavgusb"), + ZYDIS_MAKE_STATIC_STRING("pavgw"), + ZYDIS_MAKE_STATIC_STRING("pblendvb"), + ZYDIS_MAKE_STATIC_STRING("pblendw"), + ZYDIS_MAKE_STATIC_STRING("pclmulqdq"), + ZYDIS_MAKE_STATIC_STRING("pcmpeqb"), + ZYDIS_MAKE_STATIC_STRING("pcmpeqd"), + ZYDIS_MAKE_STATIC_STRING("pcmpeqq"), + ZYDIS_MAKE_STATIC_STRING("pcmpeqw"), + ZYDIS_MAKE_STATIC_STRING("pcmpestri"), + ZYDIS_MAKE_STATIC_STRING("pcmpestrm"), + ZYDIS_MAKE_STATIC_STRING("pcmpgtb"), + ZYDIS_MAKE_STATIC_STRING("pcmpgtd"), + ZYDIS_MAKE_STATIC_STRING("pcmpgtq"), + ZYDIS_MAKE_STATIC_STRING("pcmpgtw"), + ZYDIS_MAKE_STATIC_STRING("pcmpistri"), + ZYDIS_MAKE_STATIC_STRING("pcmpistrm"), + ZYDIS_MAKE_STATIC_STRING("pdep"), + ZYDIS_MAKE_STATIC_STRING("pext"), + ZYDIS_MAKE_STATIC_STRING("pextrb"), + ZYDIS_MAKE_STATIC_STRING("pextrd"), + ZYDIS_MAKE_STATIC_STRING("pextrq"), + ZYDIS_MAKE_STATIC_STRING("pextrw"), + ZYDIS_MAKE_STATIC_STRING("pf2id"), + ZYDIS_MAKE_STATIC_STRING("pf2iw"), + ZYDIS_MAKE_STATIC_STRING("pfacc"), + ZYDIS_MAKE_STATIC_STRING("pfadd"), + ZYDIS_MAKE_STATIC_STRING("pfcmpeq"), + ZYDIS_MAKE_STATIC_STRING("pfcmpge"), + ZYDIS_MAKE_STATIC_STRING("pfcmpgt"), + ZYDIS_MAKE_STATIC_STRING("pfcpit1"), + ZYDIS_MAKE_STATIC_STRING("pfmax"), + ZYDIS_MAKE_STATIC_STRING("pfmin"), + ZYDIS_MAKE_STATIC_STRING("pfmul"), + ZYDIS_MAKE_STATIC_STRING("pfnacc"), + ZYDIS_MAKE_STATIC_STRING("pfpnacc"), + ZYDIS_MAKE_STATIC_STRING("pfrcp"), + ZYDIS_MAKE_STATIC_STRING("pfrcpit2"), + ZYDIS_MAKE_STATIC_STRING("pfrsqit1"), + ZYDIS_MAKE_STATIC_STRING("pfsqrt"), + ZYDIS_MAKE_STATIC_STRING("pfsub"), + ZYDIS_MAKE_STATIC_STRING("pfsubr"), + ZYDIS_MAKE_STATIC_STRING("phaddd"), + ZYDIS_MAKE_STATIC_STRING("phaddsw"), + ZYDIS_MAKE_STATIC_STRING("phaddw"), + ZYDIS_MAKE_STATIC_STRING("phminposuw"), + ZYDIS_MAKE_STATIC_STRING("phsubd"), + ZYDIS_MAKE_STATIC_STRING("phsubsw"), + ZYDIS_MAKE_STATIC_STRING("phsubw"), + ZYDIS_MAKE_STATIC_STRING("pi2fd"), + ZYDIS_MAKE_STATIC_STRING("pi2fw"), + ZYDIS_MAKE_STATIC_STRING("pinsrb"), + ZYDIS_MAKE_STATIC_STRING("pinsrd"), + ZYDIS_MAKE_STATIC_STRING("pinsrq"), + ZYDIS_MAKE_STATIC_STRING("pinsrw"), + ZYDIS_MAKE_STATIC_STRING("pmaddubsw"), + ZYDIS_MAKE_STATIC_STRING("pmaddwd"), + ZYDIS_MAKE_STATIC_STRING("pmaxsb"), + ZYDIS_MAKE_STATIC_STRING("pmaxsd"), + ZYDIS_MAKE_STATIC_STRING("pmaxsw"), + ZYDIS_MAKE_STATIC_STRING("pmaxub"), + ZYDIS_MAKE_STATIC_STRING("pmaxud"), + ZYDIS_MAKE_STATIC_STRING("pmaxuw"), + ZYDIS_MAKE_STATIC_STRING("pminsb"), + ZYDIS_MAKE_STATIC_STRING("pminsd"), + ZYDIS_MAKE_STATIC_STRING("pminsw"), + ZYDIS_MAKE_STATIC_STRING("pminub"), + ZYDIS_MAKE_STATIC_STRING("pminud"), + ZYDIS_MAKE_STATIC_STRING("pminuw"), + ZYDIS_MAKE_STATIC_STRING("pmovmskb"), + ZYDIS_MAKE_STATIC_STRING("pmovsxbd"), + ZYDIS_MAKE_STATIC_STRING("pmovsxbq"), + ZYDIS_MAKE_STATIC_STRING("pmovsxbw"), + ZYDIS_MAKE_STATIC_STRING("pmovsxdq"), + ZYDIS_MAKE_STATIC_STRING("pmovsxwd"), + ZYDIS_MAKE_STATIC_STRING("pmovsxwq"), + ZYDIS_MAKE_STATIC_STRING("pmovzxbd"), + ZYDIS_MAKE_STATIC_STRING("pmovzxbq"), + ZYDIS_MAKE_STATIC_STRING("pmovzxbw"), + ZYDIS_MAKE_STATIC_STRING("pmovzxdq"), + ZYDIS_MAKE_STATIC_STRING("pmovzxwd"), + ZYDIS_MAKE_STATIC_STRING("pmovzxwq"), + ZYDIS_MAKE_STATIC_STRING("pmuldq"), + ZYDIS_MAKE_STATIC_STRING("pmulhrsw"), + ZYDIS_MAKE_STATIC_STRING("pmulhrw"), + ZYDIS_MAKE_STATIC_STRING("pmulhuw"), + ZYDIS_MAKE_STATIC_STRING("pmulhw"), + ZYDIS_MAKE_STATIC_STRING("pmulld"), + ZYDIS_MAKE_STATIC_STRING("pmullw"), + ZYDIS_MAKE_STATIC_STRING("pmuludq"), + ZYDIS_MAKE_STATIC_STRING("pop"), + ZYDIS_MAKE_STATIC_STRING("popa"), + ZYDIS_MAKE_STATIC_STRING("popad"), + ZYDIS_MAKE_STATIC_STRING("popcnt"), + ZYDIS_MAKE_STATIC_STRING("popf"), + ZYDIS_MAKE_STATIC_STRING("popfd"), + ZYDIS_MAKE_STATIC_STRING("popfq"), + ZYDIS_MAKE_STATIC_STRING("por"), + ZYDIS_MAKE_STATIC_STRING("prefetch"), + ZYDIS_MAKE_STATIC_STRING("prefetchnta"), + ZYDIS_MAKE_STATIC_STRING("prefetcht0"), + ZYDIS_MAKE_STATIC_STRING("prefetcht1"), + ZYDIS_MAKE_STATIC_STRING("prefetcht2"), + ZYDIS_MAKE_STATIC_STRING("prefetchw"), + ZYDIS_MAKE_STATIC_STRING("prefetchwt1"), + ZYDIS_MAKE_STATIC_STRING("psadbw"), + ZYDIS_MAKE_STATIC_STRING("pshufb"), + ZYDIS_MAKE_STATIC_STRING("pshufd"), + ZYDIS_MAKE_STATIC_STRING("pshufhw"), + ZYDIS_MAKE_STATIC_STRING("pshuflw"), + ZYDIS_MAKE_STATIC_STRING("pshufw"), + ZYDIS_MAKE_STATIC_STRING("psignb"), + ZYDIS_MAKE_STATIC_STRING("psignd"), + ZYDIS_MAKE_STATIC_STRING("psignw"), + ZYDIS_MAKE_STATIC_STRING("pslld"), + ZYDIS_MAKE_STATIC_STRING("pslldq"), + ZYDIS_MAKE_STATIC_STRING("psllq"), + ZYDIS_MAKE_STATIC_STRING("psllw"), + ZYDIS_MAKE_STATIC_STRING("psrad"), + ZYDIS_MAKE_STATIC_STRING("psraw"), + ZYDIS_MAKE_STATIC_STRING("psrld"), + ZYDIS_MAKE_STATIC_STRING("psrldq"), + ZYDIS_MAKE_STATIC_STRING("psrlq"), + ZYDIS_MAKE_STATIC_STRING("psrlw"), + ZYDIS_MAKE_STATIC_STRING("psubb"), + ZYDIS_MAKE_STATIC_STRING("psubd"), + ZYDIS_MAKE_STATIC_STRING("psubq"), + ZYDIS_MAKE_STATIC_STRING("psubsb"), + ZYDIS_MAKE_STATIC_STRING("psubsw"), + ZYDIS_MAKE_STATIC_STRING("psubusb"), + ZYDIS_MAKE_STATIC_STRING("psubusw"), + ZYDIS_MAKE_STATIC_STRING("psubw"), + ZYDIS_MAKE_STATIC_STRING("pswapd"), + ZYDIS_MAKE_STATIC_STRING("ptest"), + ZYDIS_MAKE_STATIC_STRING("ptwrite"), + ZYDIS_MAKE_STATIC_STRING("punpckhbw"), + ZYDIS_MAKE_STATIC_STRING("punpckhdq"), + ZYDIS_MAKE_STATIC_STRING("punpckhqdq"), + ZYDIS_MAKE_STATIC_STRING("punpckhwd"), + ZYDIS_MAKE_STATIC_STRING("punpcklbw"), + ZYDIS_MAKE_STATIC_STRING("punpckldq"), + ZYDIS_MAKE_STATIC_STRING("punpcklqdq"), + ZYDIS_MAKE_STATIC_STRING("punpcklwd"), + ZYDIS_MAKE_STATIC_STRING("push"), + ZYDIS_MAKE_STATIC_STRING("pusha"), + ZYDIS_MAKE_STATIC_STRING("pushad"), + ZYDIS_MAKE_STATIC_STRING("pushf"), + ZYDIS_MAKE_STATIC_STRING("pushfd"), + ZYDIS_MAKE_STATIC_STRING("pushfq"), + ZYDIS_MAKE_STATIC_STRING("pxor"), + ZYDIS_MAKE_STATIC_STRING("rcl"), + ZYDIS_MAKE_STATIC_STRING("rcpps"), + ZYDIS_MAKE_STATIC_STRING("rcpss"), + ZYDIS_MAKE_STATIC_STRING("rcr"), + ZYDIS_MAKE_STATIC_STRING("rdfsbase"), + ZYDIS_MAKE_STATIC_STRING("rdgsbase"), + ZYDIS_MAKE_STATIC_STRING("rdmsr"), + ZYDIS_MAKE_STATIC_STRING("rdpid"), + ZYDIS_MAKE_STATIC_STRING("rdpkru"), + ZYDIS_MAKE_STATIC_STRING("rdpmc"), + ZYDIS_MAKE_STATIC_STRING("rdrand"), + ZYDIS_MAKE_STATIC_STRING("rdseed"), + ZYDIS_MAKE_STATIC_STRING("rdsspd"), + ZYDIS_MAKE_STATIC_STRING("rdsspq"), + ZYDIS_MAKE_STATIC_STRING("rdtsc"), + ZYDIS_MAKE_STATIC_STRING("rdtscp"), + ZYDIS_MAKE_STATIC_STRING("ret"), + ZYDIS_MAKE_STATIC_STRING("rol"), + ZYDIS_MAKE_STATIC_STRING("ror"), + ZYDIS_MAKE_STATIC_STRING("rorx"), + ZYDIS_MAKE_STATIC_STRING("roundpd"), + ZYDIS_MAKE_STATIC_STRING("roundps"), + ZYDIS_MAKE_STATIC_STRING("roundsd"), + ZYDIS_MAKE_STATIC_STRING("roundss"), + ZYDIS_MAKE_STATIC_STRING("rsm"), + ZYDIS_MAKE_STATIC_STRING("rsqrtps"), + ZYDIS_MAKE_STATIC_STRING("rsqrtss"), + ZYDIS_MAKE_STATIC_STRING("rstorssp"), + ZYDIS_MAKE_STATIC_STRING("sahf"), + ZYDIS_MAKE_STATIC_STRING("salc"), + ZYDIS_MAKE_STATIC_STRING("sar"), + ZYDIS_MAKE_STATIC_STRING("sarx"), + ZYDIS_MAKE_STATIC_STRING("savessp"), + ZYDIS_MAKE_STATIC_STRING("sbb"), + ZYDIS_MAKE_STATIC_STRING("scasb"), + ZYDIS_MAKE_STATIC_STRING("scasd"), + ZYDIS_MAKE_STATIC_STRING("scasq"), + ZYDIS_MAKE_STATIC_STRING("scasw"), + ZYDIS_MAKE_STATIC_STRING("setb"), + ZYDIS_MAKE_STATIC_STRING("setbe"), + ZYDIS_MAKE_STATIC_STRING("setl"), + ZYDIS_MAKE_STATIC_STRING("setle"), + ZYDIS_MAKE_STATIC_STRING("setnb"), + ZYDIS_MAKE_STATIC_STRING("setnbe"), + ZYDIS_MAKE_STATIC_STRING("setnl"), + ZYDIS_MAKE_STATIC_STRING("setnle"), + ZYDIS_MAKE_STATIC_STRING("setno"), + ZYDIS_MAKE_STATIC_STRING("setnp"), + ZYDIS_MAKE_STATIC_STRING("setns"), + ZYDIS_MAKE_STATIC_STRING("setnz"), + ZYDIS_MAKE_STATIC_STRING("seto"), + ZYDIS_MAKE_STATIC_STRING("setp"), + ZYDIS_MAKE_STATIC_STRING("sets"), + ZYDIS_MAKE_STATIC_STRING("setssbsy"), + ZYDIS_MAKE_STATIC_STRING("setz"), + ZYDIS_MAKE_STATIC_STRING("sfence"), + ZYDIS_MAKE_STATIC_STRING("sgdt"), + ZYDIS_MAKE_STATIC_STRING("sha1msg1"), + ZYDIS_MAKE_STATIC_STRING("sha1msg2"), + ZYDIS_MAKE_STATIC_STRING("sha1nexte"), + ZYDIS_MAKE_STATIC_STRING("sha1rnds4"), + ZYDIS_MAKE_STATIC_STRING("sha256msg1"), + ZYDIS_MAKE_STATIC_STRING("sha256msg2"), + ZYDIS_MAKE_STATIC_STRING("sha256rnds2"), + ZYDIS_MAKE_STATIC_STRING("shl"), + ZYDIS_MAKE_STATIC_STRING("shld"), + ZYDIS_MAKE_STATIC_STRING("shlx"), + ZYDIS_MAKE_STATIC_STRING("shr"), + ZYDIS_MAKE_STATIC_STRING("shrd"), + ZYDIS_MAKE_STATIC_STRING("shrx"), + ZYDIS_MAKE_STATIC_STRING("shufpd"), + ZYDIS_MAKE_STATIC_STRING("shufps"), + ZYDIS_MAKE_STATIC_STRING("sidt"), + ZYDIS_MAKE_STATIC_STRING("skinit"), + ZYDIS_MAKE_STATIC_STRING("sldt"), + ZYDIS_MAKE_STATIC_STRING("slwpcb"), + ZYDIS_MAKE_STATIC_STRING("smsw"), + ZYDIS_MAKE_STATIC_STRING("spflt"), + ZYDIS_MAKE_STATIC_STRING("sqrtpd"), + ZYDIS_MAKE_STATIC_STRING("sqrtps"), + ZYDIS_MAKE_STATIC_STRING("sqrtsd"), + ZYDIS_MAKE_STATIC_STRING("sqrtss"), + ZYDIS_MAKE_STATIC_STRING("stac"), + ZYDIS_MAKE_STATIC_STRING("stc"), + ZYDIS_MAKE_STATIC_STRING("std"), + ZYDIS_MAKE_STATIC_STRING("stgi"), + ZYDIS_MAKE_STATIC_STRING("sti"), + ZYDIS_MAKE_STATIC_STRING("stmxcsr"), + ZYDIS_MAKE_STATIC_STRING("stosb"), + ZYDIS_MAKE_STATIC_STRING("stosd"), + ZYDIS_MAKE_STATIC_STRING("stosq"), + ZYDIS_MAKE_STATIC_STRING("stosw"), + ZYDIS_MAKE_STATIC_STRING("str"), + ZYDIS_MAKE_STATIC_STRING("sub"), + ZYDIS_MAKE_STATIC_STRING("subpd"), + ZYDIS_MAKE_STATIC_STRING("subps"), + ZYDIS_MAKE_STATIC_STRING("subsd"), + ZYDIS_MAKE_STATIC_STRING("subss"), + ZYDIS_MAKE_STATIC_STRING("swapgs"), + ZYDIS_MAKE_STATIC_STRING("syscall"), + ZYDIS_MAKE_STATIC_STRING("sysenter"), + ZYDIS_MAKE_STATIC_STRING("sysexit"), + ZYDIS_MAKE_STATIC_STRING("sysret"), + ZYDIS_MAKE_STATIC_STRING("t1mskc"), + ZYDIS_MAKE_STATIC_STRING("test"), + ZYDIS_MAKE_STATIC_STRING("tzcnt"), + ZYDIS_MAKE_STATIC_STRING("tzcnti"), + ZYDIS_MAKE_STATIC_STRING("tzmsk"), + ZYDIS_MAKE_STATIC_STRING("ucomisd"), + ZYDIS_MAKE_STATIC_STRING("ucomiss"), + ZYDIS_MAKE_STATIC_STRING("ud0"), + ZYDIS_MAKE_STATIC_STRING("ud1"), + ZYDIS_MAKE_STATIC_STRING("ud2"), + ZYDIS_MAKE_STATIC_STRING("unpckhpd"), + ZYDIS_MAKE_STATIC_STRING("unpckhps"), + ZYDIS_MAKE_STATIC_STRING("unpcklpd"), + ZYDIS_MAKE_STATIC_STRING("unpcklps"), + ZYDIS_MAKE_STATIC_STRING("v4fmaddps"), + ZYDIS_MAKE_STATIC_STRING("v4fmaddss"), + ZYDIS_MAKE_STATIC_STRING("v4fnmaddps"), + ZYDIS_MAKE_STATIC_STRING("v4fnmaddss"), + ZYDIS_MAKE_STATIC_STRING("vaddnpd"), + ZYDIS_MAKE_STATIC_STRING("vaddnps"), + ZYDIS_MAKE_STATIC_STRING("vaddpd"), + ZYDIS_MAKE_STATIC_STRING("vaddps"), + ZYDIS_MAKE_STATIC_STRING("vaddsd"), + ZYDIS_MAKE_STATIC_STRING("vaddsetsps"), + ZYDIS_MAKE_STATIC_STRING("vaddss"), + ZYDIS_MAKE_STATIC_STRING("vaddsubpd"), + ZYDIS_MAKE_STATIC_STRING("vaddsubps"), + ZYDIS_MAKE_STATIC_STRING("vaesdec"), + ZYDIS_MAKE_STATIC_STRING("vaesdeclast"), + ZYDIS_MAKE_STATIC_STRING("vaesenc"), + ZYDIS_MAKE_STATIC_STRING("vaesenclast"), + ZYDIS_MAKE_STATIC_STRING("vaesimc"), + ZYDIS_MAKE_STATIC_STRING("vaeskeygenassist"), + ZYDIS_MAKE_STATIC_STRING("valignd"), + ZYDIS_MAKE_STATIC_STRING("valignq"), + ZYDIS_MAKE_STATIC_STRING("vandnpd"), + ZYDIS_MAKE_STATIC_STRING("vandnps"), + ZYDIS_MAKE_STATIC_STRING("vandpd"), + ZYDIS_MAKE_STATIC_STRING("vandps"), + ZYDIS_MAKE_STATIC_STRING("vblendmpd"), + ZYDIS_MAKE_STATIC_STRING("vblendmps"), + ZYDIS_MAKE_STATIC_STRING("vblendpd"), + ZYDIS_MAKE_STATIC_STRING("vblendps"), + ZYDIS_MAKE_STATIC_STRING("vblendvpd"), + ZYDIS_MAKE_STATIC_STRING("vblendvps"), + ZYDIS_MAKE_STATIC_STRING("vbroadcastf128"), + ZYDIS_MAKE_STATIC_STRING("vbroadcastf32x2"), + ZYDIS_MAKE_STATIC_STRING("vbroadcastf32x4"), + ZYDIS_MAKE_STATIC_STRING("vbroadcastf32x8"), + ZYDIS_MAKE_STATIC_STRING("vbroadcastf64x2"), + ZYDIS_MAKE_STATIC_STRING("vbroadcastf64x4"), + ZYDIS_MAKE_STATIC_STRING("vbroadcasti128"), + ZYDIS_MAKE_STATIC_STRING("vbroadcasti32x2"), + ZYDIS_MAKE_STATIC_STRING("vbroadcasti32x4"), + ZYDIS_MAKE_STATIC_STRING("vbroadcasti32x8"), + ZYDIS_MAKE_STATIC_STRING("vbroadcasti64x2"), + ZYDIS_MAKE_STATIC_STRING("vbroadcasti64x4"), + ZYDIS_MAKE_STATIC_STRING("vbroadcastsd"), + ZYDIS_MAKE_STATIC_STRING("vbroadcastss"), + ZYDIS_MAKE_STATIC_STRING("vcmppd"), + ZYDIS_MAKE_STATIC_STRING("vcmpps"), + ZYDIS_MAKE_STATIC_STRING("vcmpsd"), + ZYDIS_MAKE_STATIC_STRING("vcmpss"), + ZYDIS_MAKE_STATIC_STRING("vcomisd"), + ZYDIS_MAKE_STATIC_STRING("vcomiss"), + ZYDIS_MAKE_STATIC_STRING("vcompresspd"), + ZYDIS_MAKE_STATIC_STRING("vcompressps"), + ZYDIS_MAKE_STATIC_STRING("vcvtdq2pd"), + ZYDIS_MAKE_STATIC_STRING("vcvtdq2ps"), + ZYDIS_MAKE_STATIC_STRING("vcvtfxpntdq2ps"), + ZYDIS_MAKE_STATIC_STRING("vcvtfxpntpd2dq"), + ZYDIS_MAKE_STATIC_STRING("vcvtfxpntpd2udq"), + ZYDIS_MAKE_STATIC_STRING("vcvtfxpntps2dq"), + ZYDIS_MAKE_STATIC_STRING("vcvtfxpntps2udq"), + ZYDIS_MAKE_STATIC_STRING("vcvtfxpntudq2ps"), + ZYDIS_MAKE_STATIC_STRING("vcvtpd2dq"), + ZYDIS_MAKE_STATIC_STRING("vcvtpd2ps"), + ZYDIS_MAKE_STATIC_STRING("vcvtpd2qq"), + ZYDIS_MAKE_STATIC_STRING("vcvtpd2udq"), + ZYDIS_MAKE_STATIC_STRING("vcvtpd2uqq"), + ZYDIS_MAKE_STATIC_STRING("vcvtph2ps"), + ZYDIS_MAKE_STATIC_STRING("vcvtps2dq"), + ZYDIS_MAKE_STATIC_STRING("vcvtps2pd"), + ZYDIS_MAKE_STATIC_STRING("vcvtps2ph"), + ZYDIS_MAKE_STATIC_STRING("vcvtps2qq"), + ZYDIS_MAKE_STATIC_STRING("vcvtps2udq"), + ZYDIS_MAKE_STATIC_STRING("vcvtps2uqq"), + ZYDIS_MAKE_STATIC_STRING("vcvtqq2pd"), + ZYDIS_MAKE_STATIC_STRING("vcvtqq2ps"), + ZYDIS_MAKE_STATIC_STRING("vcvtsd2si"), + ZYDIS_MAKE_STATIC_STRING("vcvtsd2ss"), + ZYDIS_MAKE_STATIC_STRING("vcvtsd2usi"), + ZYDIS_MAKE_STATIC_STRING("vcvtsi2sd"), + ZYDIS_MAKE_STATIC_STRING("vcvtsi2ss"), + ZYDIS_MAKE_STATIC_STRING("vcvtss2sd"), + ZYDIS_MAKE_STATIC_STRING("vcvtss2si"), + ZYDIS_MAKE_STATIC_STRING("vcvtss2usi"), + ZYDIS_MAKE_STATIC_STRING("vcvttpd2dq"), + ZYDIS_MAKE_STATIC_STRING("vcvttpd2qq"), + ZYDIS_MAKE_STATIC_STRING("vcvttpd2udq"), + ZYDIS_MAKE_STATIC_STRING("vcvttpd2uqq"), + ZYDIS_MAKE_STATIC_STRING("vcvttps2dq"), + ZYDIS_MAKE_STATIC_STRING("vcvttps2qq"), + ZYDIS_MAKE_STATIC_STRING("vcvttps2udq"), + ZYDIS_MAKE_STATIC_STRING("vcvttps2uqq"), + ZYDIS_MAKE_STATIC_STRING("vcvttsd2si"), + ZYDIS_MAKE_STATIC_STRING("vcvttsd2usi"), + ZYDIS_MAKE_STATIC_STRING("vcvttss2si"), + ZYDIS_MAKE_STATIC_STRING("vcvttss2usi"), + ZYDIS_MAKE_STATIC_STRING("vcvtudq2pd"), + ZYDIS_MAKE_STATIC_STRING("vcvtudq2ps"), + ZYDIS_MAKE_STATIC_STRING("vcvtuqq2pd"), + ZYDIS_MAKE_STATIC_STRING("vcvtuqq2ps"), + ZYDIS_MAKE_STATIC_STRING("vcvtusi2sd"), + ZYDIS_MAKE_STATIC_STRING("vcvtusi2ss"), + ZYDIS_MAKE_STATIC_STRING("vdbpsadbw"), + ZYDIS_MAKE_STATIC_STRING("vdivpd"), + ZYDIS_MAKE_STATIC_STRING("vdivps"), + ZYDIS_MAKE_STATIC_STRING("vdivsd"), + ZYDIS_MAKE_STATIC_STRING("vdivss"), + ZYDIS_MAKE_STATIC_STRING("vdppd"), + ZYDIS_MAKE_STATIC_STRING("vdpps"), + ZYDIS_MAKE_STATIC_STRING("verr"), + ZYDIS_MAKE_STATIC_STRING("verw"), + ZYDIS_MAKE_STATIC_STRING("vexp223ps"), + ZYDIS_MAKE_STATIC_STRING("vexp2pd"), + ZYDIS_MAKE_STATIC_STRING("vexp2ps"), + ZYDIS_MAKE_STATIC_STRING("vexpandpd"), + ZYDIS_MAKE_STATIC_STRING("vexpandps"), + ZYDIS_MAKE_STATIC_STRING("vextractf128"), + ZYDIS_MAKE_STATIC_STRING("vextractf32x4"), + ZYDIS_MAKE_STATIC_STRING("vextractf32x8"), + ZYDIS_MAKE_STATIC_STRING("vextractf64x2"), + ZYDIS_MAKE_STATIC_STRING("vextractf64x4"), + ZYDIS_MAKE_STATIC_STRING("vextracti128"), + ZYDIS_MAKE_STATIC_STRING("vextracti32x4"), + ZYDIS_MAKE_STATIC_STRING("vextracti32x8"), + ZYDIS_MAKE_STATIC_STRING("vextracti64x2"), + ZYDIS_MAKE_STATIC_STRING("vextracti64x4"), + ZYDIS_MAKE_STATIC_STRING("vextractps"), + ZYDIS_MAKE_STATIC_STRING("vfixupimmpd"), + ZYDIS_MAKE_STATIC_STRING("vfixupimmps"), + ZYDIS_MAKE_STATIC_STRING("vfixupimmsd"), + ZYDIS_MAKE_STATIC_STRING("vfixupimmss"), + ZYDIS_MAKE_STATIC_STRING("vfixupnanpd"), + ZYDIS_MAKE_STATIC_STRING("vfixupnanps"), + ZYDIS_MAKE_STATIC_STRING("vfmadd132pd"), + ZYDIS_MAKE_STATIC_STRING("vfmadd132ps"), + ZYDIS_MAKE_STATIC_STRING("vfmadd132sd"), + ZYDIS_MAKE_STATIC_STRING("vfmadd132ss"), + ZYDIS_MAKE_STATIC_STRING("vfmadd213pd"), + ZYDIS_MAKE_STATIC_STRING("vfmadd213ps"), + ZYDIS_MAKE_STATIC_STRING("vfmadd213sd"), + ZYDIS_MAKE_STATIC_STRING("vfmadd213ss"), + ZYDIS_MAKE_STATIC_STRING("vfmadd231pd"), + ZYDIS_MAKE_STATIC_STRING("vfmadd231ps"), + ZYDIS_MAKE_STATIC_STRING("vfmadd231sd"), + ZYDIS_MAKE_STATIC_STRING("vfmadd231ss"), + ZYDIS_MAKE_STATIC_STRING("vfmadd233ps"), + ZYDIS_MAKE_STATIC_STRING("vfmaddpd"), + ZYDIS_MAKE_STATIC_STRING("vfmaddps"), + ZYDIS_MAKE_STATIC_STRING("vfmaddsd"), + ZYDIS_MAKE_STATIC_STRING("vfmaddss"), + ZYDIS_MAKE_STATIC_STRING("vfmaddsub132pd"), + ZYDIS_MAKE_STATIC_STRING("vfmaddsub132ps"), + ZYDIS_MAKE_STATIC_STRING("vfmaddsub213pd"), + ZYDIS_MAKE_STATIC_STRING("vfmaddsub213ps"), + ZYDIS_MAKE_STATIC_STRING("vfmaddsub231pd"), + ZYDIS_MAKE_STATIC_STRING("vfmaddsub231ps"), + ZYDIS_MAKE_STATIC_STRING("vfmaddsubpd"), + ZYDIS_MAKE_STATIC_STRING("vfmaddsubps"), + ZYDIS_MAKE_STATIC_STRING("vfmsub132pd"), + ZYDIS_MAKE_STATIC_STRING("vfmsub132ps"), + ZYDIS_MAKE_STATIC_STRING("vfmsub132sd"), + ZYDIS_MAKE_STATIC_STRING("vfmsub132ss"), + ZYDIS_MAKE_STATIC_STRING("vfmsub213pd"), + ZYDIS_MAKE_STATIC_STRING("vfmsub213ps"), + ZYDIS_MAKE_STATIC_STRING("vfmsub213sd"), + ZYDIS_MAKE_STATIC_STRING("vfmsub213ss"), + ZYDIS_MAKE_STATIC_STRING("vfmsub231pd"), + ZYDIS_MAKE_STATIC_STRING("vfmsub231ps"), + ZYDIS_MAKE_STATIC_STRING("vfmsub231sd"), + ZYDIS_MAKE_STATIC_STRING("vfmsub231ss"), + ZYDIS_MAKE_STATIC_STRING("vfmsubadd132pd"), + ZYDIS_MAKE_STATIC_STRING("vfmsubadd132ps"), + ZYDIS_MAKE_STATIC_STRING("vfmsubadd213pd"), + ZYDIS_MAKE_STATIC_STRING("vfmsubadd213ps"), + ZYDIS_MAKE_STATIC_STRING("vfmsubadd231pd"), + ZYDIS_MAKE_STATIC_STRING("vfmsubadd231ps"), + ZYDIS_MAKE_STATIC_STRING("vfmsubaddpd"), + ZYDIS_MAKE_STATIC_STRING("vfmsubaddps"), + ZYDIS_MAKE_STATIC_STRING("vfmsubpd"), + ZYDIS_MAKE_STATIC_STRING("vfmsubps"), + ZYDIS_MAKE_STATIC_STRING("vfmsubsd"), + ZYDIS_MAKE_STATIC_STRING("vfmsubss"), + ZYDIS_MAKE_STATIC_STRING("vfnmadd132pd"), + ZYDIS_MAKE_STATIC_STRING("vfnmadd132ps"), + ZYDIS_MAKE_STATIC_STRING("vfnmadd132sd"), + ZYDIS_MAKE_STATIC_STRING("vfnmadd132ss"), + ZYDIS_MAKE_STATIC_STRING("vfnmadd213pd"), + ZYDIS_MAKE_STATIC_STRING("vfnmadd213ps"), + ZYDIS_MAKE_STATIC_STRING("vfnmadd213sd"), + ZYDIS_MAKE_STATIC_STRING("vfnmadd213ss"), + ZYDIS_MAKE_STATIC_STRING("vfnmadd231pd"), + ZYDIS_MAKE_STATIC_STRING("vfnmadd231ps"), + ZYDIS_MAKE_STATIC_STRING("vfnmadd231sd"), + ZYDIS_MAKE_STATIC_STRING("vfnmadd231ss"), + ZYDIS_MAKE_STATIC_STRING("vfnmaddpd"), + ZYDIS_MAKE_STATIC_STRING("vfnmaddps"), + ZYDIS_MAKE_STATIC_STRING("vfnmaddsd"), + ZYDIS_MAKE_STATIC_STRING("vfnmaddss"), + ZYDIS_MAKE_STATIC_STRING("vfnmsub132pd"), + ZYDIS_MAKE_STATIC_STRING("vfnmsub132ps"), + ZYDIS_MAKE_STATIC_STRING("vfnmsub132sd"), + ZYDIS_MAKE_STATIC_STRING("vfnmsub132ss"), + ZYDIS_MAKE_STATIC_STRING("vfnmsub213pd"), + ZYDIS_MAKE_STATIC_STRING("vfnmsub213ps"), + ZYDIS_MAKE_STATIC_STRING("vfnmsub213sd"), + ZYDIS_MAKE_STATIC_STRING("vfnmsub213ss"), + ZYDIS_MAKE_STATIC_STRING("vfnmsub231pd"), + ZYDIS_MAKE_STATIC_STRING("vfnmsub231ps"), + ZYDIS_MAKE_STATIC_STRING("vfnmsub231sd"), + ZYDIS_MAKE_STATIC_STRING("vfnmsub231ss"), + ZYDIS_MAKE_STATIC_STRING("vfnmsubpd"), + ZYDIS_MAKE_STATIC_STRING("vfnmsubps"), + ZYDIS_MAKE_STATIC_STRING("vfnmsubsd"), + ZYDIS_MAKE_STATIC_STRING("vfnmsubss"), + ZYDIS_MAKE_STATIC_STRING("vfpclasspd"), + ZYDIS_MAKE_STATIC_STRING("vfpclassps"), + ZYDIS_MAKE_STATIC_STRING("vfpclasssd"), + ZYDIS_MAKE_STATIC_STRING("vfpclassss"), + ZYDIS_MAKE_STATIC_STRING("vfrczpd"), + ZYDIS_MAKE_STATIC_STRING("vfrczps"), + ZYDIS_MAKE_STATIC_STRING("vfrczsd"), + ZYDIS_MAKE_STATIC_STRING("vfrczss"), + ZYDIS_MAKE_STATIC_STRING("vgatherdpd"), + ZYDIS_MAKE_STATIC_STRING("vgatherdps"), + ZYDIS_MAKE_STATIC_STRING("vgatherpf0dpd"), + ZYDIS_MAKE_STATIC_STRING("vgatherpf0dps"), + ZYDIS_MAKE_STATIC_STRING("vgatherpf0hintdpd"), + ZYDIS_MAKE_STATIC_STRING("vgatherpf0hintdps"), + ZYDIS_MAKE_STATIC_STRING("vgatherpf0qpd"), + ZYDIS_MAKE_STATIC_STRING("vgatherpf0qps"), + ZYDIS_MAKE_STATIC_STRING("vgatherpf1dpd"), + ZYDIS_MAKE_STATIC_STRING("vgatherpf1dps"), + ZYDIS_MAKE_STATIC_STRING("vgatherpf1qpd"), + ZYDIS_MAKE_STATIC_STRING("vgatherpf1qps"), + ZYDIS_MAKE_STATIC_STRING("vgatherqpd"), + ZYDIS_MAKE_STATIC_STRING("vgatherqps"), + ZYDIS_MAKE_STATIC_STRING("vgetexppd"), + ZYDIS_MAKE_STATIC_STRING("vgetexpps"), + ZYDIS_MAKE_STATIC_STRING("vgetexpsd"), + ZYDIS_MAKE_STATIC_STRING("vgetexpss"), + ZYDIS_MAKE_STATIC_STRING("vgetmantpd"), + ZYDIS_MAKE_STATIC_STRING("vgetmantps"), + ZYDIS_MAKE_STATIC_STRING("vgetmantsd"), + ZYDIS_MAKE_STATIC_STRING("vgetmantss"), + ZYDIS_MAKE_STATIC_STRING("vgf2p8affineinvqb"), + ZYDIS_MAKE_STATIC_STRING("vgf2p8affineqb"), + ZYDIS_MAKE_STATIC_STRING("vgf2p8mulb"), + ZYDIS_MAKE_STATIC_STRING("vgmaxabsps"), + ZYDIS_MAKE_STATIC_STRING("vgmaxpd"), + ZYDIS_MAKE_STATIC_STRING("vgmaxps"), + ZYDIS_MAKE_STATIC_STRING("vgminpd"), + ZYDIS_MAKE_STATIC_STRING("vgminps"), + ZYDIS_MAKE_STATIC_STRING("vhaddpd"), + ZYDIS_MAKE_STATIC_STRING("vhaddps"), + ZYDIS_MAKE_STATIC_STRING("vhsubpd"), + ZYDIS_MAKE_STATIC_STRING("vhsubps"), + ZYDIS_MAKE_STATIC_STRING("vinsertf128"), + ZYDIS_MAKE_STATIC_STRING("vinsertf32x4"), + ZYDIS_MAKE_STATIC_STRING("vinsertf32x8"), + ZYDIS_MAKE_STATIC_STRING("vinsertf64x2"), + ZYDIS_MAKE_STATIC_STRING("vinsertf64x4"), + ZYDIS_MAKE_STATIC_STRING("vinserti128"), + ZYDIS_MAKE_STATIC_STRING("vinserti32x4"), + ZYDIS_MAKE_STATIC_STRING("vinserti32x8"), + ZYDIS_MAKE_STATIC_STRING("vinserti64x2"), + ZYDIS_MAKE_STATIC_STRING("vinserti64x4"), + ZYDIS_MAKE_STATIC_STRING("vinsertps"), + ZYDIS_MAKE_STATIC_STRING("vlddqu"), + ZYDIS_MAKE_STATIC_STRING("vldmxcsr"), + ZYDIS_MAKE_STATIC_STRING("vloadunpackhd"), + ZYDIS_MAKE_STATIC_STRING("vloadunpackhpd"), + ZYDIS_MAKE_STATIC_STRING("vloadunpackhps"), + ZYDIS_MAKE_STATIC_STRING("vloadunpackhq"), + ZYDIS_MAKE_STATIC_STRING("vloadunpackld"), + ZYDIS_MAKE_STATIC_STRING("vloadunpacklpd"), + ZYDIS_MAKE_STATIC_STRING("vloadunpacklps"), + ZYDIS_MAKE_STATIC_STRING("vloadunpacklq"), + ZYDIS_MAKE_STATIC_STRING("vlog2ps"), + ZYDIS_MAKE_STATIC_STRING("vmaskmovdqu"), + ZYDIS_MAKE_STATIC_STRING("vmaskmovpd"), + ZYDIS_MAKE_STATIC_STRING("vmaskmovps"), + ZYDIS_MAKE_STATIC_STRING("vmaxpd"), + ZYDIS_MAKE_STATIC_STRING("vmaxps"), + ZYDIS_MAKE_STATIC_STRING("vmaxsd"), + ZYDIS_MAKE_STATIC_STRING("vmaxss"), + ZYDIS_MAKE_STATIC_STRING("vmcall"), + ZYDIS_MAKE_STATIC_STRING("vmclear"), + ZYDIS_MAKE_STATIC_STRING("vmfunc"), + ZYDIS_MAKE_STATIC_STRING("vminpd"), + ZYDIS_MAKE_STATIC_STRING("vminps"), + ZYDIS_MAKE_STATIC_STRING("vminsd"), + ZYDIS_MAKE_STATIC_STRING("vminss"), + ZYDIS_MAKE_STATIC_STRING("vmlaunch"), + ZYDIS_MAKE_STATIC_STRING("vmload"), + ZYDIS_MAKE_STATIC_STRING("vmmcall"), + ZYDIS_MAKE_STATIC_STRING("vmovapd"), + ZYDIS_MAKE_STATIC_STRING("vmovaps"), + ZYDIS_MAKE_STATIC_STRING("vmovd"), + ZYDIS_MAKE_STATIC_STRING("vmovddup"), + ZYDIS_MAKE_STATIC_STRING("vmovdqa"), + ZYDIS_MAKE_STATIC_STRING("vmovdqa32"), + ZYDIS_MAKE_STATIC_STRING("vmovdqa64"), + ZYDIS_MAKE_STATIC_STRING("vmovdqu"), + ZYDIS_MAKE_STATIC_STRING("vmovdqu16"), + ZYDIS_MAKE_STATIC_STRING("vmovdqu32"), + ZYDIS_MAKE_STATIC_STRING("vmovdqu64"), + ZYDIS_MAKE_STATIC_STRING("vmovdqu8"), + ZYDIS_MAKE_STATIC_STRING("vmovhlps"), + ZYDIS_MAKE_STATIC_STRING("vmovhpd"), + ZYDIS_MAKE_STATIC_STRING("vmovhps"), + ZYDIS_MAKE_STATIC_STRING("vmovlhps"), + ZYDIS_MAKE_STATIC_STRING("vmovlpd"), + ZYDIS_MAKE_STATIC_STRING("vmovlps"), + ZYDIS_MAKE_STATIC_STRING("vmovmskpd"), + ZYDIS_MAKE_STATIC_STRING("vmovmskps"), + ZYDIS_MAKE_STATIC_STRING("vmovnrapd"), + ZYDIS_MAKE_STATIC_STRING("vmovnraps"), + ZYDIS_MAKE_STATIC_STRING("vmovnrngoapd"), + ZYDIS_MAKE_STATIC_STRING("vmovnrngoaps"), + ZYDIS_MAKE_STATIC_STRING("vmovntdq"), + ZYDIS_MAKE_STATIC_STRING("vmovntdqa"), + ZYDIS_MAKE_STATIC_STRING("vmovntpd"), + ZYDIS_MAKE_STATIC_STRING("vmovntps"), + ZYDIS_MAKE_STATIC_STRING("vmovq"), + ZYDIS_MAKE_STATIC_STRING("vmovsd"), + ZYDIS_MAKE_STATIC_STRING("vmovshdup"), + ZYDIS_MAKE_STATIC_STRING("vmovsldup"), + ZYDIS_MAKE_STATIC_STRING("vmovss"), + ZYDIS_MAKE_STATIC_STRING("vmovupd"), + ZYDIS_MAKE_STATIC_STRING("vmovups"), + ZYDIS_MAKE_STATIC_STRING("vmpsadbw"), + ZYDIS_MAKE_STATIC_STRING("vmptrld"), + ZYDIS_MAKE_STATIC_STRING("vmptrst"), + ZYDIS_MAKE_STATIC_STRING("vmread"), + ZYDIS_MAKE_STATIC_STRING("vmresume"), + ZYDIS_MAKE_STATIC_STRING("vmrun"), + ZYDIS_MAKE_STATIC_STRING("vmsave"), + ZYDIS_MAKE_STATIC_STRING("vmulpd"), + ZYDIS_MAKE_STATIC_STRING("vmulps"), + ZYDIS_MAKE_STATIC_STRING("vmulsd"), + ZYDIS_MAKE_STATIC_STRING("vmulss"), + ZYDIS_MAKE_STATIC_STRING("vmwrite"), + ZYDIS_MAKE_STATIC_STRING("vmxoff"), + ZYDIS_MAKE_STATIC_STRING("vmxon"), + ZYDIS_MAKE_STATIC_STRING("vorpd"), + ZYDIS_MAKE_STATIC_STRING("vorps"), + ZYDIS_MAKE_STATIC_STRING("vp4dpwssd"), + ZYDIS_MAKE_STATIC_STRING("vp4dpwssds"), + ZYDIS_MAKE_STATIC_STRING("vpabsb"), + ZYDIS_MAKE_STATIC_STRING("vpabsd"), + ZYDIS_MAKE_STATIC_STRING("vpabsq"), + ZYDIS_MAKE_STATIC_STRING("vpabsw"), + ZYDIS_MAKE_STATIC_STRING("vpackssdw"), + ZYDIS_MAKE_STATIC_STRING("vpacksswb"), + ZYDIS_MAKE_STATIC_STRING("vpackstorehd"), + ZYDIS_MAKE_STATIC_STRING("vpackstorehpd"), + ZYDIS_MAKE_STATIC_STRING("vpackstorehps"), + ZYDIS_MAKE_STATIC_STRING("vpackstorehq"), + ZYDIS_MAKE_STATIC_STRING("vpackstoreld"), + ZYDIS_MAKE_STATIC_STRING("vpackstorelpd"), + ZYDIS_MAKE_STATIC_STRING("vpackstorelps"), + ZYDIS_MAKE_STATIC_STRING("vpackstorelq"), + ZYDIS_MAKE_STATIC_STRING("vpackusdw"), + ZYDIS_MAKE_STATIC_STRING("vpackuswb"), + ZYDIS_MAKE_STATIC_STRING("vpadcd"), + ZYDIS_MAKE_STATIC_STRING("vpaddb"), + ZYDIS_MAKE_STATIC_STRING("vpaddd"), + ZYDIS_MAKE_STATIC_STRING("vpaddq"), + ZYDIS_MAKE_STATIC_STRING("vpaddsb"), + ZYDIS_MAKE_STATIC_STRING("vpaddsetcd"), + ZYDIS_MAKE_STATIC_STRING("vpaddsetsd"), + ZYDIS_MAKE_STATIC_STRING("vpaddsw"), + ZYDIS_MAKE_STATIC_STRING("vpaddusb"), + ZYDIS_MAKE_STATIC_STRING("vpaddusw"), + ZYDIS_MAKE_STATIC_STRING("vpaddw"), + ZYDIS_MAKE_STATIC_STRING("vpalignr"), + ZYDIS_MAKE_STATIC_STRING("vpand"), + ZYDIS_MAKE_STATIC_STRING("vpandd"), + ZYDIS_MAKE_STATIC_STRING("vpandn"), + ZYDIS_MAKE_STATIC_STRING("vpandnd"), + ZYDIS_MAKE_STATIC_STRING("vpandnq"), + ZYDIS_MAKE_STATIC_STRING("vpandq"), + ZYDIS_MAKE_STATIC_STRING("vpavgb"), + ZYDIS_MAKE_STATIC_STRING("vpavgw"), + ZYDIS_MAKE_STATIC_STRING("vpblendd"), + ZYDIS_MAKE_STATIC_STRING("vpblendmb"), + ZYDIS_MAKE_STATIC_STRING("vpblendmd"), + ZYDIS_MAKE_STATIC_STRING("vpblendmq"), + ZYDIS_MAKE_STATIC_STRING("vpblendmw"), + ZYDIS_MAKE_STATIC_STRING("vpblendvb"), + ZYDIS_MAKE_STATIC_STRING("vpblendw"), + ZYDIS_MAKE_STATIC_STRING("vpbroadcastb"), + ZYDIS_MAKE_STATIC_STRING("vpbroadcastd"), + ZYDIS_MAKE_STATIC_STRING("vpbroadcastmb2q"), + ZYDIS_MAKE_STATIC_STRING("vpbroadcastmw2d"), + ZYDIS_MAKE_STATIC_STRING("vpbroadcastq"), + ZYDIS_MAKE_STATIC_STRING("vpbroadcastw"), + ZYDIS_MAKE_STATIC_STRING("vpclmulqdq"), + ZYDIS_MAKE_STATIC_STRING("vpcmov"), + ZYDIS_MAKE_STATIC_STRING("vpcmpb"), + ZYDIS_MAKE_STATIC_STRING("vpcmpd"), + ZYDIS_MAKE_STATIC_STRING("vpcmpeqb"), + ZYDIS_MAKE_STATIC_STRING("vpcmpeqd"), + ZYDIS_MAKE_STATIC_STRING("vpcmpeqq"), + ZYDIS_MAKE_STATIC_STRING("vpcmpeqw"), + ZYDIS_MAKE_STATIC_STRING("vpcmpestri"), + ZYDIS_MAKE_STATIC_STRING("vpcmpestrm"), + ZYDIS_MAKE_STATIC_STRING("vpcmpgtb"), + ZYDIS_MAKE_STATIC_STRING("vpcmpgtd"), + ZYDIS_MAKE_STATIC_STRING("vpcmpgtq"), + ZYDIS_MAKE_STATIC_STRING("vpcmpgtw"), + ZYDIS_MAKE_STATIC_STRING("vpcmpistri"), + ZYDIS_MAKE_STATIC_STRING("vpcmpistrm"), + ZYDIS_MAKE_STATIC_STRING("vpcmpltd"), + ZYDIS_MAKE_STATIC_STRING("vpcmpq"), + ZYDIS_MAKE_STATIC_STRING("vpcmpub"), + ZYDIS_MAKE_STATIC_STRING("vpcmpud"), + ZYDIS_MAKE_STATIC_STRING("vpcmpuq"), + ZYDIS_MAKE_STATIC_STRING("vpcmpuw"), + ZYDIS_MAKE_STATIC_STRING("vpcmpw"), + ZYDIS_MAKE_STATIC_STRING("vpcomb"), + ZYDIS_MAKE_STATIC_STRING("vpcomd"), + ZYDIS_MAKE_STATIC_STRING("vpcompressb"), + ZYDIS_MAKE_STATIC_STRING("vpcompressd"), + ZYDIS_MAKE_STATIC_STRING("vpcompressq"), + ZYDIS_MAKE_STATIC_STRING("vpcompressw"), + ZYDIS_MAKE_STATIC_STRING("vpcomq"), + ZYDIS_MAKE_STATIC_STRING("vpcomub"), + ZYDIS_MAKE_STATIC_STRING("vpcomud"), + ZYDIS_MAKE_STATIC_STRING("vpcomuq"), + ZYDIS_MAKE_STATIC_STRING("vpcomuw"), + ZYDIS_MAKE_STATIC_STRING("vpcomw"), + ZYDIS_MAKE_STATIC_STRING("vpconflictd"), + ZYDIS_MAKE_STATIC_STRING("vpconflictq"), + ZYDIS_MAKE_STATIC_STRING("vpdpbusd"), + ZYDIS_MAKE_STATIC_STRING("vpdpbusds"), + ZYDIS_MAKE_STATIC_STRING("vpdpwssd"), + ZYDIS_MAKE_STATIC_STRING("vpdpwssds"), + ZYDIS_MAKE_STATIC_STRING("vperm2f128"), + ZYDIS_MAKE_STATIC_STRING("vperm2i128"), + ZYDIS_MAKE_STATIC_STRING("vpermb"), + ZYDIS_MAKE_STATIC_STRING("vpermd"), + ZYDIS_MAKE_STATIC_STRING("vpermf32x4"), + ZYDIS_MAKE_STATIC_STRING("vpermi2b"), + ZYDIS_MAKE_STATIC_STRING("vpermi2d"), + ZYDIS_MAKE_STATIC_STRING("vpermi2pd"), + ZYDIS_MAKE_STATIC_STRING("vpermi2ps"), + ZYDIS_MAKE_STATIC_STRING("vpermi2q"), + ZYDIS_MAKE_STATIC_STRING("vpermi2w"), + ZYDIS_MAKE_STATIC_STRING("vpermil2pd"), + ZYDIS_MAKE_STATIC_STRING("vpermil2ps"), + ZYDIS_MAKE_STATIC_STRING("vpermilpd"), + ZYDIS_MAKE_STATIC_STRING("vpermilps"), + ZYDIS_MAKE_STATIC_STRING("vpermpd"), + ZYDIS_MAKE_STATIC_STRING("vpermps"), + ZYDIS_MAKE_STATIC_STRING("vpermq"), + ZYDIS_MAKE_STATIC_STRING("vpermt2b"), + ZYDIS_MAKE_STATIC_STRING("vpermt2d"), + ZYDIS_MAKE_STATIC_STRING("vpermt2pd"), + ZYDIS_MAKE_STATIC_STRING("vpermt2ps"), + ZYDIS_MAKE_STATIC_STRING("vpermt2q"), + ZYDIS_MAKE_STATIC_STRING("vpermt2w"), + ZYDIS_MAKE_STATIC_STRING("vpermw"), + ZYDIS_MAKE_STATIC_STRING("vpexpandb"), + ZYDIS_MAKE_STATIC_STRING("vpexpandd"), + ZYDIS_MAKE_STATIC_STRING("vpexpandq"), + ZYDIS_MAKE_STATIC_STRING("vpexpandw"), + ZYDIS_MAKE_STATIC_STRING("vpextrb"), + ZYDIS_MAKE_STATIC_STRING("vpextrd"), + ZYDIS_MAKE_STATIC_STRING("vpextrq"), + ZYDIS_MAKE_STATIC_STRING("vpextrw"), + ZYDIS_MAKE_STATIC_STRING("vpgatherdd"), + ZYDIS_MAKE_STATIC_STRING("vpgatherdq"), + ZYDIS_MAKE_STATIC_STRING("vpgatherqd"), + ZYDIS_MAKE_STATIC_STRING("vpgatherqq"), + ZYDIS_MAKE_STATIC_STRING("vphaddbd"), + ZYDIS_MAKE_STATIC_STRING("vphaddbq"), + ZYDIS_MAKE_STATIC_STRING("vphaddbw"), + ZYDIS_MAKE_STATIC_STRING("vphaddd"), + ZYDIS_MAKE_STATIC_STRING("vphadddq"), + ZYDIS_MAKE_STATIC_STRING("vphaddsw"), + ZYDIS_MAKE_STATIC_STRING("vphaddubd"), + ZYDIS_MAKE_STATIC_STRING("vphaddubq"), + ZYDIS_MAKE_STATIC_STRING("vphaddubw"), + ZYDIS_MAKE_STATIC_STRING("vphaddudq"), + ZYDIS_MAKE_STATIC_STRING("vphadduwd"), + ZYDIS_MAKE_STATIC_STRING("vphadduwq"), + ZYDIS_MAKE_STATIC_STRING("vphaddw"), + ZYDIS_MAKE_STATIC_STRING("vphaddwd"), + ZYDIS_MAKE_STATIC_STRING("vphaddwq"), + ZYDIS_MAKE_STATIC_STRING("vphminposuw"), + ZYDIS_MAKE_STATIC_STRING("vphsubbw"), + ZYDIS_MAKE_STATIC_STRING("vphsubd"), + ZYDIS_MAKE_STATIC_STRING("vphsubdq"), + ZYDIS_MAKE_STATIC_STRING("vphsubsw"), + ZYDIS_MAKE_STATIC_STRING("vphsubw"), + ZYDIS_MAKE_STATIC_STRING("vphsubwd"), + ZYDIS_MAKE_STATIC_STRING("vpinsrb"), + ZYDIS_MAKE_STATIC_STRING("vpinsrd"), + ZYDIS_MAKE_STATIC_STRING("vpinsrq"), + ZYDIS_MAKE_STATIC_STRING("vpinsrw"), + ZYDIS_MAKE_STATIC_STRING("vplzcntd"), + ZYDIS_MAKE_STATIC_STRING("vplzcntq"), + ZYDIS_MAKE_STATIC_STRING("vpmacsdd"), + ZYDIS_MAKE_STATIC_STRING("vpmacsdqh"), + ZYDIS_MAKE_STATIC_STRING("vpmacsdql"), + ZYDIS_MAKE_STATIC_STRING("vpmacssdd"), + ZYDIS_MAKE_STATIC_STRING("vpmacssdqh"), + ZYDIS_MAKE_STATIC_STRING("vpmacssdql"), + ZYDIS_MAKE_STATIC_STRING("vpmacsswd"), + ZYDIS_MAKE_STATIC_STRING("vpmacssww"), + ZYDIS_MAKE_STATIC_STRING("vpmacswd"), + ZYDIS_MAKE_STATIC_STRING("vpmacsww"), + ZYDIS_MAKE_STATIC_STRING("vpmadcsswd"), + ZYDIS_MAKE_STATIC_STRING("vpmadcswd"), + ZYDIS_MAKE_STATIC_STRING("vpmadd231d"), + ZYDIS_MAKE_STATIC_STRING("vpmadd233d"), + ZYDIS_MAKE_STATIC_STRING("vpmadd52huq"), + ZYDIS_MAKE_STATIC_STRING("vpmadd52luq"), + ZYDIS_MAKE_STATIC_STRING("vpmaddubsw"), + ZYDIS_MAKE_STATIC_STRING("vpmaddwd"), + ZYDIS_MAKE_STATIC_STRING("vpmaskmovd"), + ZYDIS_MAKE_STATIC_STRING("vpmaskmovq"), + ZYDIS_MAKE_STATIC_STRING("vpmaxsb"), + ZYDIS_MAKE_STATIC_STRING("vpmaxsd"), + ZYDIS_MAKE_STATIC_STRING("vpmaxsq"), + ZYDIS_MAKE_STATIC_STRING("vpmaxsw"), + ZYDIS_MAKE_STATIC_STRING("vpmaxub"), + ZYDIS_MAKE_STATIC_STRING("vpmaxud"), + ZYDIS_MAKE_STATIC_STRING("vpmaxuq"), + ZYDIS_MAKE_STATIC_STRING("vpmaxuw"), + ZYDIS_MAKE_STATIC_STRING("vpminsb"), + ZYDIS_MAKE_STATIC_STRING("vpminsd"), + ZYDIS_MAKE_STATIC_STRING("vpminsq"), + ZYDIS_MAKE_STATIC_STRING("vpminsw"), + ZYDIS_MAKE_STATIC_STRING("vpminub"), + ZYDIS_MAKE_STATIC_STRING("vpminud"), + ZYDIS_MAKE_STATIC_STRING("vpminuq"), + ZYDIS_MAKE_STATIC_STRING("vpminuw"), + ZYDIS_MAKE_STATIC_STRING("vpmovb2m"), + ZYDIS_MAKE_STATIC_STRING("vpmovd2m"), + ZYDIS_MAKE_STATIC_STRING("vpmovdb"), + ZYDIS_MAKE_STATIC_STRING("vpmovdw"), + ZYDIS_MAKE_STATIC_STRING("vpmovm2b"), + ZYDIS_MAKE_STATIC_STRING("vpmovm2d"), + ZYDIS_MAKE_STATIC_STRING("vpmovm2q"), + ZYDIS_MAKE_STATIC_STRING("vpmovm2w"), + ZYDIS_MAKE_STATIC_STRING("vpmovmskb"), + ZYDIS_MAKE_STATIC_STRING("vpmovq2m"), + ZYDIS_MAKE_STATIC_STRING("vpmovqb"), + ZYDIS_MAKE_STATIC_STRING("vpmovqd"), + ZYDIS_MAKE_STATIC_STRING("vpmovqw"), + ZYDIS_MAKE_STATIC_STRING("vpmovsdb"), + ZYDIS_MAKE_STATIC_STRING("vpmovsdw"), + ZYDIS_MAKE_STATIC_STRING("vpmovsqb"), + ZYDIS_MAKE_STATIC_STRING("vpmovsqd"), + ZYDIS_MAKE_STATIC_STRING("vpmovsqw"), + ZYDIS_MAKE_STATIC_STRING("vpmovswb"), + ZYDIS_MAKE_STATIC_STRING("vpmovsxbd"), + ZYDIS_MAKE_STATIC_STRING("vpmovsxbq"), + ZYDIS_MAKE_STATIC_STRING("vpmovsxbw"), + ZYDIS_MAKE_STATIC_STRING("vpmovsxdq"), + ZYDIS_MAKE_STATIC_STRING("vpmovsxwd"), + ZYDIS_MAKE_STATIC_STRING("vpmovsxwq"), + ZYDIS_MAKE_STATIC_STRING("vpmovusdb"), + ZYDIS_MAKE_STATIC_STRING("vpmovusdw"), + ZYDIS_MAKE_STATIC_STRING("vpmovusqb"), + ZYDIS_MAKE_STATIC_STRING("vpmovusqd"), + ZYDIS_MAKE_STATIC_STRING("vpmovusqw"), + ZYDIS_MAKE_STATIC_STRING("vpmovuswb"), + ZYDIS_MAKE_STATIC_STRING("vpmovw2m"), + ZYDIS_MAKE_STATIC_STRING("vpmovwb"), + ZYDIS_MAKE_STATIC_STRING("vpmovzxbd"), + ZYDIS_MAKE_STATIC_STRING("vpmovzxbq"), + ZYDIS_MAKE_STATIC_STRING("vpmovzxbw"), + ZYDIS_MAKE_STATIC_STRING("vpmovzxdq"), + ZYDIS_MAKE_STATIC_STRING("vpmovzxwd"), + ZYDIS_MAKE_STATIC_STRING("vpmovzxwq"), + ZYDIS_MAKE_STATIC_STRING("vpmuldq"), + ZYDIS_MAKE_STATIC_STRING("vpmulhd"), + ZYDIS_MAKE_STATIC_STRING("vpmulhrsw"), + ZYDIS_MAKE_STATIC_STRING("vpmulhud"), + ZYDIS_MAKE_STATIC_STRING("vpmulhuw"), + ZYDIS_MAKE_STATIC_STRING("vpmulhw"), + ZYDIS_MAKE_STATIC_STRING("vpmulld"), + ZYDIS_MAKE_STATIC_STRING("vpmullq"), + ZYDIS_MAKE_STATIC_STRING("vpmullw"), + ZYDIS_MAKE_STATIC_STRING("vpmultishiftqb"), + ZYDIS_MAKE_STATIC_STRING("vpmuludq"), + ZYDIS_MAKE_STATIC_STRING("vpopcntb"), + ZYDIS_MAKE_STATIC_STRING("vpopcntd"), + ZYDIS_MAKE_STATIC_STRING("vpopcntq"), + ZYDIS_MAKE_STATIC_STRING("vpopcntw"), + ZYDIS_MAKE_STATIC_STRING("vpor"), + ZYDIS_MAKE_STATIC_STRING("vpord"), + ZYDIS_MAKE_STATIC_STRING("vporq"), + ZYDIS_MAKE_STATIC_STRING("vpperm"), + ZYDIS_MAKE_STATIC_STRING("vprefetch0"), + ZYDIS_MAKE_STATIC_STRING("vprefetch1"), + ZYDIS_MAKE_STATIC_STRING("vprefetch2"), + ZYDIS_MAKE_STATIC_STRING("vprefetche0"), + ZYDIS_MAKE_STATIC_STRING("vprefetche1"), + ZYDIS_MAKE_STATIC_STRING("vprefetche2"), + ZYDIS_MAKE_STATIC_STRING("vprefetchenta"), + ZYDIS_MAKE_STATIC_STRING("vprefetchnta"), + ZYDIS_MAKE_STATIC_STRING("vprold"), + ZYDIS_MAKE_STATIC_STRING("vprolq"), + ZYDIS_MAKE_STATIC_STRING("vprolvd"), + ZYDIS_MAKE_STATIC_STRING("vprolvq"), + ZYDIS_MAKE_STATIC_STRING("vprord"), + ZYDIS_MAKE_STATIC_STRING("vprorq"), + ZYDIS_MAKE_STATIC_STRING("vprorvd"), + ZYDIS_MAKE_STATIC_STRING("vprorvq"), + ZYDIS_MAKE_STATIC_STRING("vprotb"), + ZYDIS_MAKE_STATIC_STRING("vprotd"), + ZYDIS_MAKE_STATIC_STRING("vprotq"), + ZYDIS_MAKE_STATIC_STRING("vprotw"), + ZYDIS_MAKE_STATIC_STRING("vpsadbw"), + ZYDIS_MAKE_STATIC_STRING("vpsbbd"), + ZYDIS_MAKE_STATIC_STRING("vpsbbrd"), + ZYDIS_MAKE_STATIC_STRING("vpscatterdd"), + ZYDIS_MAKE_STATIC_STRING("vpscatterdq"), + ZYDIS_MAKE_STATIC_STRING("vpscatterqd"), + ZYDIS_MAKE_STATIC_STRING("vpscatterqq"), + ZYDIS_MAKE_STATIC_STRING("vpshab"), + ZYDIS_MAKE_STATIC_STRING("vpshad"), + ZYDIS_MAKE_STATIC_STRING("vpshaq"), + ZYDIS_MAKE_STATIC_STRING("vpshaw"), + ZYDIS_MAKE_STATIC_STRING("vpshlb"), + ZYDIS_MAKE_STATIC_STRING("vpshld"), + ZYDIS_MAKE_STATIC_STRING("vpshldd"), + ZYDIS_MAKE_STATIC_STRING("vpshldq"), + ZYDIS_MAKE_STATIC_STRING("vpshldvd"), + ZYDIS_MAKE_STATIC_STRING("vpshldvq"), + ZYDIS_MAKE_STATIC_STRING("vpshldvw"), + ZYDIS_MAKE_STATIC_STRING("vpshldw"), + ZYDIS_MAKE_STATIC_STRING("vpshlq"), + ZYDIS_MAKE_STATIC_STRING("vpshlw"), + ZYDIS_MAKE_STATIC_STRING("vpshrdd"), + ZYDIS_MAKE_STATIC_STRING("vpshrdq"), + ZYDIS_MAKE_STATIC_STRING("vpshrdvd"), + ZYDIS_MAKE_STATIC_STRING("vpshrdvq"), + ZYDIS_MAKE_STATIC_STRING("vpshrdvw"), + ZYDIS_MAKE_STATIC_STRING("vpshrdw"), + ZYDIS_MAKE_STATIC_STRING("vpshufb"), + ZYDIS_MAKE_STATIC_STRING("vpshufbitqmb"), + ZYDIS_MAKE_STATIC_STRING("vpshufd"), + ZYDIS_MAKE_STATIC_STRING("vpshufhw"), + ZYDIS_MAKE_STATIC_STRING("vpshuflw"), + ZYDIS_MAKE_STATIC_STRING("vpsignb"), + ZYDIS_MAKE_STATIC_STRING("vpsignd"), + ZYDIS_MAKE_STATIC_STRING("vpsignw"), + ZYDIS_MAKE_STATIC_STRING("vpslld"), + ZYDIS_MAKE_STATIC_STRING("vpslldq"), + ZYDIS_MAKE_STATIC_STRING("vpsllq"), + ZYDIS_MAKE_STATIC_STRING("vpsllvd"), + ZYDIS_MAKE_STATIC_STRING("vpsllvq"), + ZYDIS_MAKE_STATIC_STRING("vpsllvw"), + ZYDIS_MAKE_STATIC_STRING("vpsllw"), + ZYDIS_MAKE_STATIC_STRING("vpsrad"), + ZYDIS_MAKE_STATIC_STRING("vpsraq"), + ZYDIS_MAKE_STATIC_STRING("vpsravd"), + ZYDIS_MAKE_STATIC_STRING("vpsravq"), + ZYDIS_MAKE_STATIC_STRING("vpsravw"), + ZYDIS_MAKE_STATIC_STRING("vpsraw"), + ZYDIS_MAKE_STATIC_STRING("vpsrld"), + ZYDIS_MAKE_STATIC_STRING("vpsrldq"), + ZYDIS_MAKE_STATIC_STRING("vpsrlq"), + ZYDIS_MAKE_STATIC_STRING("vpsrlvd"), + ZYDIS_MAKE_STATIC_STRING("vpsrlvq"), + ZYDIS_MAKE_STATIC_STRING("vpsrlvw"), + ZYDIS_MAKE_STATIC_STRING("vpsrlw"), + ZYDIS_MAKE_STATIC_STRING("vpsubb"), + ZYDIS_MAKE_STATIC_STRING("vpsubd"), + ZYDIS_MAKE_STATIC_STRING("vpsubq"), + ZYDIS_MAKE_STATIC_STRING("vpsubrd"), + ZYDIS_MAKE_STATIC_STRING("vpsubrsetbd"), + ZYDIS_MAKE_STATIC_STRING("vpsubsb"), + ZYDIS_MAKE_STATIC_STRING("vpsubsetbd"), + ZYDIS_MAKE_STATIC_STRING("vpsubsw"), + ZYDIS_MAKE_STATIC_STRING("vpsubusb"), + ZYDIS_MAKE_STATIC_STRING("vpsubusw"), + ZYDIS_MAKE_STATIC_STRING("vpsubw"), + ZYDIS_MAKE_STATIC_STRING("vpternlogd"), + ZYDIS_MAKE_STATIC_STRING("vpternlogq"), + ZYDIS_MAKE_STATIC_STRING("vptest"), + ZYDIS_MAKE_STATIC_STRING("vptestmb"), + ZYDIS_MAKE_STATIC_STRING("vptestmd"), + ZYDIS_MAKE_STATIC_STRING("vptestmq"), + ZYDIS_MAKE_STATIC_STRING("vptestmw"), + ZYDIS_MAKE_STATIC_STRING("vptestnmb"), + ZYDIS_MAKE_STATIC_STRING("vptestnmd"), + ZYDIS_MAKE_STATIC_STRING("vptestnmq"), + ZYDIS_MAKE_STATIC_STRING("vptestnmw"), + ZYDIS_MAKE_STATIC_STRING("vpunpckhbw"), + ZYDIS_MAKE_STATIC_STRING("vpunpckhdq"), + ZYDIS_MAKE_STATIC_STRING("vpunpckhqdq"), + ZYDIS_MAKE_STATIC_STRING("vpunpckhwd"), + ZYDIS_MAKE_STATIC_STRING("vpunpcklbw"), + ZYDIS_MAKE_STATIC_STRING("vpunpckldq"), + ZYDIS_MAKE_STATIC_STRING("vpunpcklqdq"), + ZYDIS_MAKE_STATIC_STRING("vpunpcklwd"), + ZYDIS_MAKE_STATIC_STRING("vpxor"), + ZYDIS_MAKE_STATIC_STRING("vpxord"), + ZYDIS_MAKE_STATIC_STRING("vpxorq"), + ZYDIS_MAKE_STATIC_STRING("vrangepd"), + ZYDIS_MAKE_STATIC_STRING("vrangeps"), + ZYDIS_MAKE_STATIC_STRING("vrangesd"), + ZYDIS_MAKE_STATIC_STRING("vrangess"), + ZYDIS_MAKE_STATIC_STRING("vrcp14pd"), + ZYDIS_MAKE_STATIC_STRING("vrcp14ps"), + ZYDIS_MAKE_STATIC_STRING("vrcp14sd"), + ZYDIS_MAKE_STATIC_STRING("vrcp14ss"), + ZYDIS_MAKE_STATIC_STRING("vrcp23ps"), + ZYDIS_MAKE_STATIC_STRING("vrcp28pd"), + ZYDIS_MAKE_STATIC_STRING("vrcp28ps"), + ZYDIS_MAKE_STATIC_STRING("vrcp28sd"), + ZYDIS_MAKE_STATIC_STRING("vrcp28ss"), + ZYDIS_MAKE_STATIC_STRING("vrcpps"), + ZYDIS_MAKE_STATIC_STRING("vrcpss"), + ZYDIS_MAKE_STATIC_STRING("vreducepd"), + ZYDIS_MAKE_STATIC_STRING("vreduceps"), + ZYDIS_MAKE_STATIC_STRING("vreducesd"), + ZYDIS_MAKE_STATIC_STRING("vreducess"), + ZYDIS_MAKE_STATIC_STRING("vrndfxpntpd"), + ZYDIS_MAKE_STATIC_STRING("vrndfxpntps"), + ZYDIS_MAKE_STATIC_STRING("vrndscalepd"), + ZYDIS_MAKE_STATIC_STRING("vrndscaleps"), + ZYDIS_MAKE_STATIC_STRING("vrndscalesd"), + ZYDIS_MAKE_STATIC_STRING("vrndscaless"), + ZYDIS_MAKE_STATIC_STRING("vroundpd"), + ZYDIS_MAKE_STATIC_STRING("vroundps"), + ZYDIS_MAKE_STATIC_STRING("vroundsd"), + ZYDIS_MAKE_STATIC_STRING("vroundss"), + ZYDIS_MAKE_STATIC_STRING("vrsqrt14pd"), + ZYDIS_MAKE_STATIC_STRING("vrsqrt14ps"), + ZYDIS_MAKE_STATIC_STRING("vrsqrt14sd"), + ZYDIS_MAKE_STATIC_STRING("vrsqrt14ss"), + ZYDIS_MAKE_STATIC_STRING("vrsqrt23ps"), + ZYDIS_MAKE_STATIC_STRING("vrsqrt28pd"), + ZYDIS_MAKE_STATIC_STRING("vrsqrt28ps"), + ZYDIS_MAKE_STATIC_STRING("vrsqrt28sd"), + ZYDIS_MAKE_STATIC_STRING("vrsqrt28ss"), + ZYDIS_MAKE_STATIC_STRING("vrsqrtps"), + ZYDIS_MAKE_STATIC_STRING("vrsqrtss"), + ZYDIS_MAKE_STATIC_STRING("vscalefpd"), + ZYDIS_MAKE_STATIC_STRING("vscalefps"), + ZYDIS_MAKE_STATIC_STRING("vscalefsd"), + ZYDIS_MAKE_STATIC_STRING("vscalefss"), + ZYDIS_MAKE_STATIC_STRING("vscaleps"), + ZYDIS_MAKE_STATIC_STRING("vscatterdpd"), + ZYDIS_MAKE_STATIC_STRING("vscatterdps"), + ZYDIS_MAKE_STATIC_STRING("vscatterpf0dpd"), + ZYDIS_MAKE_STATIC_STRING("vscatterpf0dps"), + ZYDIS_MAKE_STATIC_STRING("vscatterpf0hintdpd"), + ZYDIS_MAKE_STATIC_STRING("vscatterpf0hintdps"), + ZYDIS_MAKE_STATIC_STRING("vscatterpf0qpd"), + ZYDIS_MAKE_STATIC_STRING("vscatterpf0qps"), + ZYDIS_MAKE_STATIC_STRING("vscatterpf1dpd"), + ZYDIS_MAKE_STATIC_STRING("vscatterpf1dps"), + ZYDIS_MAKE_STATIC_STRING("vscatterpf1qpd"), + ZYDIS_MAKE_STATIC_STRING("vscatterpf1qps"), + ZYDIS_MAKE_STATIC_STRING("vscatterqpd"), + ZYDIS_MAKE_STATIC_STRING("vscatterqps"), + ZYDIS_MAKE_STATIC_STRING("vshuff32x4"), + ZYDIS_MAKE_STATIC_STRING("vshuff64x2"), + ZYDIS_MAKE_STATIC_STRING("vshufi32x4"), + ZYDIS_MAKE_STATIC_STRING("vshufi64x2"), + ZYDIS_MAKE_STATIC_STRING("vshufpd"), + ZYDIS_MAKE_STATIC_STRING("vshufps"), + ZYDIS_MAKE_STATIC_STRING("vsqrtpd"), + ZYDIS_MAKE_STATIC_STRING("vsqrtps"), + ZYDIS_MAKE_STATIC_STRING("vsqrtsd"), + ZYDIS_MAKE_STATIC_STRING("vsqrtss"), + ZYDIS_MAKE_STATIC_STRING("vstmxcsr"), + ZYDIS_MAKE_STATIC_STRING("vsubpd"), + ZYDIS_MAKE_STATIC_STRING("vsubps"), + ZYDIS_MAKE_STATIC_STRING("vsubrpd"), + ZYDIS_MAKE_STATIC_STRING("vsubrps"), + ZYDIS_MAKE_STATIC_STRING("vsubsd"), + ZYDIS_MAKE_STATIC_STRING("vsubss"), + ZYDIS_MAKE_STATIC_STRING("vtestpd"), + ZYDIS_MAKE_STATIC_STRING("vtestps"), + ZYDIS_MAKE_STATIC_STRING("vucomisd"), + ZYDIS_MAKE_STATIC_STRING("vucomiss"), + ZYDIS_MAKE_STATIC_STRING("vunpckhpd"), + ZYDIS_MAKE_STATIC_STRING("vunpckhps"), + ZYDIS_MAKE_STATIC_STRING("vunpcklpd"), + ZYDIS_MAKE_STATIC_STRING("vunpcklps"), + ZYDIS_MAKE_STATIC_STRING("vxorpd"), + ZYDIS_MAKE_STATIC_STRING("vxorps"), + ZYDIS_MAKE_STATIC_STRING("vzeroall"), + ZYDIS_MAKE_STATIC_STRING("vzeroupper"), + ZYDIS_MAKE_STATIC_STRING("wbinvd"), + ZYDIS_MAKE_STATIC_STRING("wrfsbase"), + ZYDIS_MAKE_STATIC_STRING("wrgsbase"), + ZYDIS_MAKE_STATIC_STRING("wrmsr"), + ZYDIS_MAKE_STATIC_STRING("wrpkru"), + ZYDIS_MAKE_STATIC_STRING("wrssd"), + ZYDIS_MAKE_STATIC_STRING("wrssq"), + ZYDIS_MAKE_STATIC_STRING("wrussd"), + ZYDIS_MAKE_STATIC_STRING("wrussq"), + ZYDIS_MAKE_STATIC_STRING("xabort"), + ZYDIS_MAKE_STATIC_STRING("xadd"), + ZYDIS_MAKE_STATIC_STRING("xbegin"), + ZYDIS_MAKE_STATIC_STRING("xchg"), + ZYDIS_MAKE_STATIC_STRING("xend"), + ZYDIS_MAKE_STATIC_STRING("xgetbv"), + ZYDIS_MAKE_STATIC_STRING("xlat"), + ZYDIS_MAKE_STATIC_STRING("xor"), + ZYDIS_MAKE_STATIC_STRING("xorpd"), + ZYDIS_MAKE_STATIC_STRING("xorps"), + ZYDIS_MAKE_STATIC_STRING("xrstor"), + ZYDIS_MAKE_STATIC_STRING("xrstor64"), + ZYDIS_MAKE_STATIC_STRING("xrstors"), + ZYDIS_MAKE_STATIC_STRING("xrstors64"), + ZYDIS_MAKE_STATIC_STRING("xsave"), + ZYDIS_MAKE_STATIC_STRING("xsave64"), + ZYDIS_MAKE_STATIC_STRING("xsavec"), + ZYDIS_MAKE_STATIC_STRING("xsavec64"), + ZYDIS_MAKE_STATIC_STRING("xsaveopt"), + ZYDIS_MAKE_STATIC_STRING("xsaveopt64"), + ZYDIS_MAKE_STATIC_STRING("xsaves"), + ZYDIS_MAKE_STATIC_STRING("xsaves64"), + ZYDIS_MAKE_STATIC_STRING("xsetbv"), + ZYDIS_MAKE_STATIC_STRING("xtest") }; diff --git a/src/Mnemonic.c b/src/Mnemonic.c index 5b8732b..7fc56f8 100644 --- a/src/Mnemonic.c +++ b/src/Mnemonic.c @@ -25,18 +25,8 @@ ***************************************************************************************************/ #include -#include - #include -/** - * @brief Caches all strings that were accessed by `ZydisMnemonicGetStringEx`. - * - * We could store `ZydisString` structs instead of `ZydisGeneratedString` ones in the - * `zydisMnemonicStrings` array, but this would significantly increase the table-size. - */ -static ZydisString zydisMnemonicStringCache[ZYDIS_MNEMONIC_MAX_VALUE + 1]; - /* ============================================================================================== */ /* Exported functions */ /* ============================================================================================== */ @@ -50,18 +40,13 @@ const char* ZydisMnemonicGetString(ZydisMnemonic mnemonic) return (const char*)zydisMnemonicStrings[mnemonic].buffer; } -const ZydisString* ZydisMnemonicGetStringEx(ZydisMnemonic mnemonic) +const ZydisStaticString* ZydisMnemonicGetStaticString(ZydisMnemonic mnemonic) { if (mnemonic > ZYDIS_ARRAY_SIZE(zydisMnemonicStrings) - 1) { return ZYDIS_NULL; } - if (!zydisMnemonicStringCache[mnemonic].buffer) - { - ZydisStringInitWithGeneratedString(&zydisMnemonicStringCache[mnemonic], - &zydisMnemonicStrings[mnemonic]); - } - return &zydisMnemonicStringCache[mnemonic]; + return &zydisMnemonicStrings[mnemonic]; } /* ============================================================================================== */ diff --git a/src/Register.c b/src/Register.c index 737e924..93fb816 100644 --- a/src/Register.c +++ b/src/Register.c @@ -30,91 +30,165 @@ /* Register strings */ /* ============================================================================================== */ -const char* registerStrings[] = +static const ZydisStaticString registerStrings[] = { - "none", - // General purpose registers 8-bit - "al", "cl", "dl", "bl", - "ah", "ch", "dh", "bh", - "spl", "bpl", "sil", "dil", - "r8b", "r9b", "r10b", "r11b", - "r12b", "r13b", "r14b", "r15b", + ZYDIS_MAKE_STATIC_STRING("none"), + // General purpose registers 8-bit + ZYDIS_MAKE_STATIC_STRING("al"), ZYDIS_MAKE_STATIC_STRING("cl"), + ZYDIS_MAKE_STATIC_STRING("dl"), ZYDIS_MAKE_STATIC_STRING("bl"), + ZYDIS_MAKE_STATIC_STRING("ah"), ZYDIS_MAKE_STATIC_STRING("ch"), + ZYDIS_MAKE_STATIC_STRING("dh"), ZYDIS_MAKE_STATIC_STRING("bh"), + ZYDIS_MAKE_STATIC_STRING("spl"), ZYDIS_MAKE_STATIC_STRING("bpl"), + ZYDIS_MAKE_STATIC_STRING("sil"), ZYDIS_MAKE_STATIC_STRING("dil"), + ZYDIS_MAKE_STATIC_STRING("r8b"), ZYDIS_MAKE_STATIC_STRING("r9b"), + ZYDIS_MAKE_STATIC_STRING("r10b"), ZYDIS_MAKE_STATIC_STRING("r11b"), + ZYDIS_MAKE_STATIC_STRING("r12b"), ZYDIS_MAKE_STATIC_STRING("r13b"), + ZYDIS_MAKE_STATIC_STRING("r14b"), ZYDIS_MAKE_STATIC_STRING("r15b"), // General purpose registers 16-bit - "ax", "cx", "dx", "bx", - "sp", "bp", "si", "di", - "r8w", "r9w", "r10w", "r11w", - "r12w", "r13w", "r14w", "r15w", + ZYDIS_MAKE_STATIC_STRING("ax"), ZYDIS_MAKE_STATIC_STRING("cx"), + ZYDIS_MAKE_STATIC_STRING("dx"), ZYDIS_MAKE_STATIC_STRING("bx"), + ZYDIS_MAKE_STATIC_STRING("sp"), ZYDIS_MAKE_STATIC_STRING("bp"), + ZYDIS_MAKE_STATIC_STRING("si"), ZYDIS_MAKE_STATIC_STRING("di"), + ZYDIS_MAKE_STATIC_STRING("r8d"), ZYDIS_MAKE_STATIC_STRING("r9d"), + ZYDIS_MAKE_STATIC_STRING("r10d"), ZYDIS_MAKE_STATIC_STRING("r11d"), + ZYDIS_MAKE_STATIC_STRING("r12d"), ZYDIS_MAKE_STATIC_STRING("r13d"), + ZYDIS_MAKE_STATIC_STRING("r14d"), ZYDIS_MAKE_STATIC_STRING("r15d"), // General purpose registers 32-bit - "eax", "ecx", "edx", "ebx", - "esp", "ebp", "esi", "edi", - "r8d", "r9d", "r10d", "r11d", - "r12d", "r13d", "r14d", "r15d", + ZYDIS_MAKE_STATIC_STRING("rax"), ZYDIS_MAKE_STATIC_STRING("rcx"), + ZYDIS_MAKE_STATIC_STRING("rdx"), ZYDIS_MAKE_STATIC_STRING("rbx"), + ZYDIS_MAKE_STATIC_STRING("rsp"), ZYDIS_MAKE_STATIC_STRING("rbp"), + ZYDIS_MAKE_STATIC_STRING("rsi"), ZYDIS_MAKE_STATIC_STRING("rdi"), + ZYDIS_MAKE_STATIC_STRING("r8"), ZYDIS_MAKE_STATIC_STRING("r9"), + ZYDIS_MAKE_STATIC_STRING("r10"), ZYDIS_MAKE_STATIC_STRING("r11"), + ZYDIS_MAKE_STATIC_STRING("r12"), ZYDIS_MAKE_STATIC_STRING("r13"), + ZYDIS_MAKE_STATIC_STRING("r14"), ZYDIS_MAKE_STATIC_STRING("r15"), // General purpose registers 64-bit - "rax", "rcx", "rdx", "rbx", - "rsp", "rbp", "rsi", "rdi", - "r8", "r9", "r10", "r11", - "r12", "r13", "r14", "r15", + ZYDIS_MAKE_STATIC_STRING("rax"), ZYDIS_MAKE_STATIC_STRING("rcx"), + ZYDIS_MAKE_STATIC_STRING("rdx"), ZYDIS_MAKE_STATIC_STRING("rbx"), + ZYDIS_MAKE_STATIC_STRING("rsp"), ZYDIS_MAKE_STATIC_STRING("rbp"), + ZYDIS_MAKE_STATIC_STRING("rsi"), ZYDIS_MAKE_STATIC_STRING("rdi"), + ZYDIS_MAKE_STATIC_STRING("r8"), ZYDIS_MAKE_STATIC_STRING("r9"), + ZYDIS_MAKE_STATIC_STRING("r10"), ZYDIS_MAKE_STATIC_STRING("r11"), + ZYDIS_MAKE_STATIC_STRING("r12"), ZYDIS_MAKE_STATIC_STRING("r13"), + ZYDIS_MAKE_STATIC_STRING("r14"), ZYDIS_MAKE_STATIC_STRING("r15"), + // Address-size scaling general purpose pseudo-registers + ZYDIS_MAKE_STATIC_STRING("aszax"), ZYDIS_MAKE_STATIC_STRING("aszcx"), + ZYDIS_MAKE_STATIC_STRING("aszdx"), ZYDIS_MAKE_STATIC_STRING("aszbx"), + ZYDIS_MAKE_STATIC_STRING("aszsp"), ZYDIS_MAKE_STATIC_STRING("aszbp"), + ZYDIS_MAKE_STATIC_STRING("aszsi"), ZYDIS_MAKE_STATIC_STRING("aszdi"), + // Stack-size scaling general purpose pseudo-registers + ZYDIS_MAKE_STATIC_STRING("sszax"), ZYDIS_MAKE_STATIC_STRING("sszcx"), + ZYDIS_MAKE_STATIC_STRING("sszdx"), ZYDIS_MAKE_STATIC_STRING("sszbx"), + ZYDIS_MAKE_STATIC_STRING("sszsp"), ZYDIS_MAKE_STATIC_STRING("sszbp"), + ZYDIS_MAKE_STATIC_STRING("sszsi"), ZYDIS_MAKE_STATIC_STRING("sszdi"), // Floating point legacy registers - "st0", "st1", "st2", "st3", - "st4", "st5", "st6", "st7", + ZYDIS_MAKE_STATIC_STRING("st0"), ZYDIS_MAKE_STATIC_STRING("st1"), + ZYDIS_MAKE_STATIC_STRING("st2"), ZYDIS_MAKE_STATIC_STRING("st3"), + ZYDIS_MAKE_STATIC_STRING("st4"), ZYDIS_MAKE_STATIC_STRING("st5"), + ZYDIS_MAKE_STATIC_STRING("st6"), ZYDIS_MAKE_STATIC_STRING("st7"), // Floating point multimedia registers - "mm0", "mm1", "mm2", "mm3", - "mm4", "mm5", "mm6", "mm7", - // Floating point vector registers 512-bit - "zmm0", "zmm1", "zmm2", "zmm3", - "zmm4", "zmm5", "zmm6", "zmm7", - "zmm8", "zmm9", "zmm10", "zmm11", - "zmm12", "zmm13", "zmm14", "zmm15", - "zmm16", "zmm17", "zmm18", "zmm19", - "zmm20", "zmm21", "zmm22", "zmm23", - "zmm24", "zmm25", "zmm26", "zmm27", - "zmm28", "zmm29", "zmm30", "zmm31", - // Floating point vector registers 256-bit - "ymm0", "ymm1", "ymm2", "ymm3", - "ymm4", "ymm5", "ymm6", "ymm7", - "ymm8", "ymm9", "ymm10", "ymm11", - "ymm12", "ymm13", "ymm14", "ymm15", - "ymm16", "ymm17", "ymm18", "ymm19", - "ymm20", "ymm21", "ymm22", "ymm23", - "ymm24", "ymm25", "ymm26", "ymm27", - "ymm28", "ymm29", "ymm30", "ymm31", + ZYDIS_MAKE_STATIC_STRING("mm0"), ZYDIS_MAKE_STATIC_STRING("mm1"), + ZYDIS_MAKE_STATIC_STRING("mm2"), ZYDIS_MAKE_STATIC_STRING("mm3"), + ZYDIS_MAKE_STATIC_STRING("mm4"), ZYDIS_MAKE_STATIC_STRING("mm5"), + ZYDIS_MAKE_STATIC_STRING("mm6"), ZYDIS_MAKE_STATIC_STRING("mm7"), // Floating point vector registers 128-bit - "xmm0", "xmm1", "xmm2", "xmm3", - "xmm4", "xmm5", "xmm6", "xmm7", - "xmm8", "xmm9", "xmm10", "xmm11", - "xmm12", "xmm13", "xmm14", "xmm15", - "xmm16", "xmm17", "xmm18", "xmm19", - "xmm20", "xmm21", "xmm22", "xmm23", - "xmm24", "xmm25", "xmm26", "xmm27", - "xmm28", "xmm29", "xmm30", "xmm31", - // Special registers - "rflags", "eflags", "flags", "rip", - "eip", "ip", "mxcsr", "pkru", - "xcr0", + ZYDIS_MAKE_STATIC_STRING("xmm0"), ZYDIS_MAKE_STATIC_STRING("xmm1"), + ZYDIS_MAKE_STATIC_STRING("xmm2"), ZYDIS_MAKE_STATIC_STRING("xmm3"), + ZYDIS_MAKE_STATIC_STRING("xmm4"), ZYDIS_MAKE_STATIC_STRING("xmm5"), + ZYDIS_MAKE_STATIC_STRING("xmm6"), ZYDIS_MAKE_STATIC_STRING("xmm7"), + ZYDIS_MAKE_STATIC_STRING("xmm8"), ZYDIS_MAKE_STATIC_STRING("xmm9"), + ZYDIS_MAKE_STATIC_STRING("xmm10"), ZYDIS_MAKE_STATIC_STRING("xmm11"), + ZYDIS_MAKE_STATIC_STRING("xmm12"), ZYDIS_MAKE_STATIC_STRING("xmm13"), + ZYDIS_MAKE_STATIC_STRING("xmm14"), ZYDIS_MAKE_STATIC_STRING("xmm15"), + ZYDIS_MAKE_STATIC_STRING("xmm16"), ZYDIS_MAKE_STATIC_STRING("xmm17"), + ZYDIS_MAKE_STATIC_STRING("xmm18"), ZYDIS_MAKE_STATIC_STRING("xmm19"), + ZYDIS_MAKE_STATIC_STRING("xmm20"), ZYDIS_MAKE_STATIC_STRING("xmm21"), + ZYDIS_MAKE_STATIC_STRING("xmm22"), ZYDIS_MAKE_STATIC_STRING("xmm23"), + ZYDIS_MAKE_STATIC_STRING("xmm24"), ZYDIS_MAKE_STATIC_STRING("xmm25"), + ZYDIS_MAKE_STATIC_STRING("xmm26"), ZYDIS_MAKE_STATIC_STRING("xmm27"), + ZYDIS_MAKE_STATIC_STRING("xmm28"), ZYDIS_MAKE_STATIC_STRING("xmm29"), + ZYDIS_MAKE_STATIC_STRING("xmm30"), ZYDIS_MAKE_STATIC_STRING("xmm31"), + // Floating point vector registers 256-bit + ZYDIS_MAKE_STATIC_STRING("ymm0"), ZYDIS_MAKE_STATIC_STRING("ymm1"), + ZYDIS_MAKE_STATIC_STRING("ymm2"), ZYDIS_MAKE_STATIC_STRING("ymm3"), + ZYDIS_MAKE_STATIC_STRING("ymm4"), ZYDIS_MAKE_STATIC_STRING("ymm5"), + ZYDIS_MAKE_STATIC_STRING("ymm6"), ZYDIS_MAKE_STATIC_STRING("ymm7"), + ZYDIS_MAKE_STATIC_STRING("ymm8"), ZYDIS_MAKE_STATIC_STRING("ymm9"), + ZYDIS_MAKE_STATIC_STRING("ymm10"), ZYDIS_MAKE_STATIC_STRING("ymm11"), + ZYDIS_MAKE_STATIC_STRING("ymm12"), ZYDIS_MAKE_STATIC_STRING("ymm13"), + ZYDIS_MAKE_STATIC_STRING("ymm14"), ZYDIS_MAKE_STATIC_STRING("ymm15"), + ZYDIS_MAKE_STATIC_STRING("ymm16"), ZYDIS_MAKE_STATIC_STRING("ymm17"), + ZYDIS_MAKE_STATIC_STRING("ymm18"), ZYDIS_MAKE_STATIC_STRING("ymm19"), + ZYDIS_MAKE_STATIC_STRING("ymm20"), ZYDIS_MAKE_STATIC_STRING("ymm21"), + ZYDIS_MAKE_STATIC_STRING("ymm22"), ZYDIS_MAKE_STATIC_STRING("ymm23"), + ZYDIS_MAKE_STATIC_STRING("ymm24"), ZYDIS_MAKE_STATIC_STRING("ymm25"), + ZYDIS_MAKE_STATIC_STRING("ymm26"), ZYDIS_MAKE_STATIC_STRING("ymm27"), + ZYDIS_MAKE_STATIC_STRING("ymm28"), ZYDIS_MAKE_STATIC_STRING("ymm29"), + ZYDIS_MAKE_STATIC_STRING("ymm30"), ZYDIS_MAKE_STATIC_STRING("ymm31"), + // Floating point vector registers 512-bit + ZYDIS_MAKE_STATIC_STRING("zmm0"), ZYDIS_MAKE_STATIC_STRING("zmm1"), + ZYDIS_MAKE_STATIC_STRING("zmm2"), ZYDIS_MAKE_STATIC_STRING("zmm3"), + ZYDIS_MAKE_STATIC_STRING("zmm4"), ZYDIS_MAKE_STATIC_STRING("zmm5"), + ZYDIS_MAKE_STATIC_STRING("zmm6"), ZYDIS_MAKE_STATIC_STRING("zmm7"), + ZYDIS_MAKE_STATIC_STRING("zmm8"), ZYDIS_MAKE_STATIC_STRING("zmm9"), + ZYDIS_MAKE_STATIC_STRING("zmm10"), ZYDIS_MAKE_STATIC_STRING("zmm11"), + ZYDIS_MAKE_STATIC_STRING("zmm12"), ZYDIS_MAKE_STATIC_STRING("zmm13"), + ZYDIS_MAKE_STATIC_STRING("zmm14"), ZYDIS_MAKE_STATIC_STRING("zmm15"), + ZYDIS_MAKE_STATIC_STRING("zmm16"), ZYDIS_MAKE_STATIC_STRING("zmm17"), + ZYDIS_MAKE_STATIC_STRING("zmm18"), ZYDIS_MAKE_STATIC_STRING("zmm19"), + ZYDIS_MAKE_STATIC_STRING("zmm20"), ZYDIS_MAKE_STATIC_STRING("zmm21"), + ZYDIS_MAKE_STATIC_STRING("zmm22"), ZYDIS_MAKE_STATIC_STRING("zmm23"), + ZYDIS_MAKE_STATIC_STRING("zmm24"), ZYDIS_MAKE_STATIC_STRING("zmm25"), + ZYDIS_MAKE_STATIC_STRING("zmm26"), ZYDIS_MAKE_STATIC_STRING("zmm27"), + ZYDIS_MAKE_STATIC_STRING("zmm28"), ZYDIS_MAKE_STATIC_STRING("zmm29"), + ZYDIS_MAKE_STATIC_STRING("zmm30"), ZYDIS_MAKE_STATIC_STRING("zmm31"), + // Flags registers + ZYDIS_MAKE_STATIC_STRING("flags"), ZYDIS_MAKE_STATIC_STRING("eflags"), + ZYDIS_MAKE_STATIC_STRING("rflags"), + // Instruction-pointer registers + ZYDIS_MAKE_STATIC_STRING("ip"), ZYDIS_MAKE_STATIC_STRING("eip"), + ZYDIS_MAKE_STATIC_STRING("rip"), // Segment registers - "es", "cs", "ss", "ds", - "fs", "gs", - // Table registers - "gdtr", "ldtr", "idtr", "tr", + ZYDIS_MAKE_STATIC_STRING("es"), ZYDIS_MAKE_STATIC_STRING("ss"), + ZYDIS_MAKE_STATIC_STRING("cs"), ZYDIS_MAKE_STATIC_STRING("ds"), + ZYDIS_MAKE_STATIC_STRING("fs"), ZYDIS_MAKE_STATIC_STRING("gs"), // Test registers - "tr0", "tr1", "tr2", "tr3", - "tr4", "tr5", "tr6", "tr7", + ZYDIS_MAKE_STATIC_STRING("tr0"), ZYDIS_MAKE_STATIC_STRING("tr1"), + ZYDIS_MAKE_STATIC_STRING("tr2"), ZYDIS_MAKE_STATIC_STRING("tr3"), + ZYDIS_MAKE_STATIC_STRING("tr4"), ZYDIS_MAKE_STATIC_STRING("tr5"), + ZYDIS_MAKE_STATIC_STRING("tr6"), ZYDIS_MAKE_STATIC_STRING("tr7"), // Control registers - "cr0", "cr1", "cr2", "cr3", - "cr4", "cr5", "cr6", "cr7", - "cr8", "cr9", "cr10", "cr11", - "cr12", "cr13", "cr14", "cr15", + ZYDIS_MAKE_STATIC_STRING("cr0"), ZYDIS_MAKE_STATIC_STRING("cr1"), + ZYDIS_MAKE_STATIC_STRING("cr2"), ZYDIS_MAKE_STATIC_STRING("cr3"), + ZYDIS_MAKE_STATIC_STRING("cr4"), ZYDIS_MAKE_STATIC_STRING("cr5"), + ZYDIS_MAKE_STATIC_STRING("cr6"), ZYDIS_MAKE_STATIC_STRING("cr7"), + ZYDIS_MAKE_STATIC_STRING("cr8"), ZYDIS_MAKE_STATIC_STRING("cr9"), + ZYDIS_MAKE_STATIC_STRING("cr10"), ZYDIS_MAKE_STATIC_STRING("cr11"), + ZYDIS_MAKE_STATIC_STRING("cr12"), ZYDIS_MAKE_STATIC_STRING("cr13"), + ZYDIS_MAKE_STATIC_STRING("cr14"), ZYDIS_MAKE_STATIC_STRING("cr15"), // Debug registers - "dr0", "dr1", "dr2", "dr3", - "dr4", "dr5", "dr6", "dr7", - "dr8", "dr9", "dr10", "dr11", - "dr12", "dr13", "dr14", "dr15", + ZYDIS_MAKE_STATIC_STRING("dr0"), ZYDIS_MAKE_STATIC_STRING("dr1"), + ZYDIS_MAKE_STATIC_STRING("dr2"), ZYDIS_MAKE_STATIC_STRING("dr3"), + ZYDIS_MAKE_STATIC_STRING("dr4"), ZYDIS_MAKE_STATIC_STRING("dr5"), + ZYDIS_MAKE_STATIC_STRING("dr6"), ZYDIS_MAKE_STATIC_STRING("dr7"), + ZYDIS_MAKE_STATIC_STRING("dr8"), ZYDIS_MAKE_STATIC_STRING("dr9"), + ZYDIS_MAKE_STATIC_STRING("dr10"), ZYDIS_MAKE_STATIC_STRING("dr11"), + ZYDIS_MAKE_STATIC_STRING("dr12"), ZYDIS_MAKE_STATIC_STRING("dr13"), + ZYDIS_MAKE_STATIC_STRING("dr14"), ZYDIS_MAKE_STATIC_STRING("dr15"), // Mask registers - "k0", "k1", "k2", "k3", - "k4", "k5", "k6", "k7", - // Bounds registers - "bnd0", "bnd1", "bnd2", "bnd3", - "bndcfg", "bndstatus" + ZYDIS_MAKE_STATIC_STRING("k0"), ZYDIS_MAKE_STATIC_STRING("k1"), + ZYDIS_MAKE_STATIC_STRING("k2"), ZYDIS_MAKE_STATIC_STRING("k3"), + ZYDIS_MAKE_STATIC_STRING("k4"), ZYDIS_MAKE_STATIC_STRING("k5"), + ZYDIS_MAKE_STATIC_STRING("k6"), ZYDIS_MAKE_STATIC_STRING("k7"), + // Bound registers + ZYDIS_MAKE_STATIC_STRING("bnd0"), ZYDIS_MAKE_STATIC_STRING("bnd1"), + ZYDIS_MAKE_STATIC_STRING("bnd2"), ZYDIS_MAKE_STATIC_STRING("bnd3"), + // Misc registers + ZYDIS_MAKE_STATIC_STRING("mxcsr"), ZYDIS_MAKE_STATIC_STRING("pkru"), + ZYDIS_MAKE_STATIC_STRING("xcr0"), ZYDIS_MAKE_STATIC_STRING("gdtr"), + ZYDIS_MAKE_STATIC_STRING("ldtr"), ZYDIS_MAKE_STATIC_STRING("idtr"), + ZYDIS_MAKE_STATIC_STRING("tr"), ZYDIS_MAKE_STATIC_STRING("bndcfg"), + ZYDIS_MAKE_STATIC_STRING("bndstatus") }; /* ============================================================================================== */ @@ -272,7 +346,16 @@ const char* ZydisRegisterGetString(ZydisRegister reg) { return ZYDIS_NULL; } - return registerStrings[reg]; + return registerStrings[reg].buffer; +} + +const ZydisStaticString* ZydisRegisterGetStaticString(ZydisRegister reg) +{ + if (reg > (sizeof(registerStrings) / sizeof(registerStrings[0])) - 1) + { + return ZYDIS_NULL; + } + return ®isterStrings[reg]; } /* ============================================================================================== */ From e943baa683f23f8c6d7bfee2fe1819672ac7aead Mon Sep 17 00:00:00 2001 From: flobernd Date: Sun, 3 Dec 2017 00:01:23 +0100 Subject: [PATCH 09/14] Removed `InternalTypes.h` from `CMakeLists.txt` --- CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5d7c2c7..8eeddd3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -110,7 +110,6 @@ target_sources("Zydis" "${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Zydis.h" "${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Internal/LibC.h" "${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Internal/SharedData.h" - "${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Internal/InternalTypes.h" PRIVATE "src/MetaInfo.c" "src/Mnemonic.c" From 1d6c296c5f72ff94d32093a56c5b2af97a306fe6 Mon Sep 17 00:00:00 2001 From: flobernd Date: Sun, 3 Dec 2017 11:57:49 +0100 Subject: [PATCH 10/14] Renamed `ZydisStringAppendStaticEx` to `ZydisStringAppendExStatic` --- include/Zydis/String.h | 2 +- src/Formatter.c | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/Zydis/String.h b/include/Zydis/String.h index 59afcf5..2bad113 100644 --- a/include/Zydis/String.h +++ b/include/Zydis/String.h @@ -247,7 +247,7 @@ ZYDIS_NO_EXPORT ZYDIS_INLINE ZydisStatus ZydisStringAppendExC(ZydisString* strin * @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not * sufficient to append the given @c text. */ -ZYDIS_NO_EXPORT ZYDIS_INLINE ZydisStatus ZydisStringAppendStaticEx(ZydisString* string, +ZYDIS_NO_EXPORT ZYDIS_INLINE ZydisStatus ZydisStringAppendExStatic(ZydisString* string, const ZydisStaticString* text, ZydisLetterCase letterCase) { if (!text || !text->buffer) diff --git a/src/Formatter.c b/src/Formatter.c index 0d5ebed..bd61f06 100644 --- a/src/Formatter.c +++ b/src/Formatter.c @@ -96,7 +96,7 @@ static ZydisStatus ZydisFormatterPrintMnemonicIntel(const ZydisFormatter* format { return ZydisStringAppendExC(string, "invalid", formatter->letterCase); } - ZYDIS_CHECK(ZydisStringAppendStaticEx(string, mnemonic, formatter->letterCase)); + ZYDIS_CHECK(ZydisStringAppendExStatic(string, mnemonic, formatter->letterCase)); if (instruction->attributes & ZYDIS_ATTRIB_IS_FAR_BRANCH) { @@ -129,7 +129,7 @@ static ZydisStatus ZydisFormatterFormatOperandRegIntel(const ZydisFormatter* for { return ZydisStringAppendExC(string, "invalid", formatter->letterCase); } - return ZydisStringAppendStaticEx(string, reg, formatter->letterCase); + return ZydisStringAppendExStatic(string, reg, formatter->letterCase); } static ZydisStatus ZydisFormatterFormatOperandMemIntel(const ZydisFormatter* formatter, @@ -159,7 +159,7 @@ static ZydisStatus ZydisFormatterFormatOperandMemIntel(const ZydisFormatter* for address, userData)); } else { - ZYDIS_CHECK(ZydisStringAppendStaticEx(string, + ZYDIS_CHECK(ZydisStringAppendExStatic(string, ZydisRegisterGetStaticString(operand->mem.base), formatter->letterCase)); ZYDIS_CHECK(formatter->funcPrintDisplacement(formatter, string, instruction, operand, userData)); @@ -174,7 +174,7 @@ static ZydisStatus ZydisFormatterFormatOperandMemIntel(const ZydisFormatter* for { return ZYDIS_STATUS_INVALID_PARAMETER; } - ZYDIS_CHECK(ZydisStringAppendStaticEx(string, reg, formatter->letterCase)); + ZYDIS_CHECK(ZydisStringAppendExStatic(string, reg, formatter->letterCase)); } if ((operand->mem.index != ZYDIS_REGISTER_NONE) && (operand->mem.type != ZYDIS_MEMOP_TYPE_MIB)) @@ -188,7 +188,7 @@ static ZydisStatus ZydisFormatterFormatOperandMemIntel(const ZydisFormatter* for { ZYDIS_CHECK(ZydisStringAppendC(string, "+")); } - ZYDIS_CHECK(ZydisStringAppendStaticEx(string, reg, formatter->letterCase)); + ZYDIS_CHECK(ZydisStringAppendExStatic(string, reg, formatter->letterCase)); if (operand->mem.scale) { ZYDIS_CHECK(ZydisStringAppendC(string, "*")); @@ -523,14 +523,14 @@ static ZydisStatus ZydisFormatterPrintSegmentIntel(const ZydisFormatter* formatt case ZYDIS_REGISTER_CS: case ZYDIS_REGISTER_FS: case ZYDIS_REGISTER_GS: - ZYDIS_CHECK(ZydisStringAppendStaticEx(string, + ZYDIS_CHECK(ZydisStringAppendExStatic(string, ZydisRegisterGetStaticString(operand->mem.segment), formatter->letterCase)); return ZydisStringAppendC(string, ":"); case ZYDIS_REGISTER_SS: if ((formatter->forceSegments) || (instruction->attributes & ZYDIS_ATTRIB_HAS_SEGMENT_SS)) { - ZYDIS_CHECK(ZydisStringAppendStaticEx(string, + ZYDIS_CHECK(ZydisStringAppendExStatic(string, ZydisRegisterGetStaticString(operand->mem.segment), formatter->letterCase)); return ZydisStringAppendC(string, ":"); } @@ -539,7 +539,7 @@ static ZydisStatus ZydisFormatterPrintSegmentIntel(const ZydisFormatter* formatt if ((formatter->forceSegments) || (instruction->attributes & ZYDIS_ATTRIB_HAS_SEGMENT_DS)) { - ZYDIS_CHECK(ZydisStringAppendStaticEx(string, + ZYDIS_CHECK(ZydisStringAppendExStatic(string, ZydisRegisterGetStaticString(operand->mem.segment), formatter->letterCase)); return ZydisStringAppendC(string, ":"); } @@ -574,7 +574,7 @@ static ZydisStatus ZydisFormatterPrintDecoratorIntel(const ZydisFormatter* forma return ZYDIS_STATUS_INVALID_PARAMETER; } ZYDIS_CHECK(ZydisStringAppendC(string, " {")); - ZYDIS_CHECK(ZydisStringAppendStaticEx(string, reg, formatter->letterCase)); + ZYDIS_CHECK(ZydisStringAppendExStatic(string, reg, formatter->letterCase)); ZYDIS_CHECK(ZydisStringAppendC(string, "}")); if (instruction->avx.mask.mode == ZYDIS_MASK_MODE_ZERO) { From 043b1f5a5a3bd422cd6af7a68794b34d8b3a426b Mon Sep 17 00:00:00 2001 From: flobernd Date: Sun, 3 Dec 2017 12:12:19 +0100 Subject: [PATCH 11/14] Minor improvements to the instruction-formatter - Added zero-termination for the output string of `ZydisFormatterFormatInstruction` / `ZydisFormatterFormatInstructionEx` in error cases - Renamed some internal functions --- src/Formatter.c | 136 +++++++++++++++++++++++++----------------------- 1 file changed, 71 insertions(+), 65 deletions(-) diff --git a/src/Formatter.c b/src/Formatter.c index bd61f06..4e7d59f 100644 --- a/src/Formatter.c +++ b/src/Formatter.c @@ -29,15 +29,37 @@ #include /* ============================================================================================== */ -/* Instruction formatter */ +/* Internal functions */ /* ============================================================================================== */ +/* ---------------------------------------------------------------------------------------------- */ +/* General */ +/* ---------------------------------------------------------------------------------------------- */ + +static ZydisStatus ZydisFormatInstruction(const ZydisFormatter* formatter, const + ZydisDecodedInstruction* instruction, ZydisString* string, void* userData) +{ + if (formatter->funcPre) + { + ZYDIS_CHECK(formatter->funcPre(formatter, string, instruction, userData)); + } + + ZYDIS_CHECK(formatter->funcFormatInstruction(formatter, string, instruction, userData)); + + if (formatter->funcPost) + { + return formatter->funcPost(formatter, string, instruction, userData); + } + + return ZYDIS_STATUS_SUCCESS; +} + /* ---------------------------------------------------------------------------------------------- */ /* Intel style */ /* ---------------------------------------------------------------------------------------------- */ -static ZydisStatus ZydisFormatterPrintPrefixesIntel(const ZydisFormatter* formatter, - ZydisString* string, const ZydisDecodedInstruction* instruction, void* userData) +static ZydisStatus ZydisPrintPrefixesIntel(const ZydisFormatter* formatter, ZydisString* string, + const ZydisDecodedInstruction* instruction, void* userData) { ZYDIS_UNUSED_PARAMETER(userData); @@ -81,8 +103,8 @@ static ZydisStatus ZydisFormatterPrintPrefixesIntel(const ZydisFormatter* format return ZYDIS_STATUS_SUCCESS; } -static ZydisStatus ZydisFormatterPrintMnemonicIntel(const ZydisFormatter* formatter, - ZydisString* string, const ZydisDecodedInstruction* instruction, void* userData) +static ZydisStatus ZydisPrintMnemonicIntel(const ZydisFormatter* formatter, ZydisString* string, + const ZydisDecodedInstruction* instruction, void* userData) { ZYDIS_UNUSED_PARAMETER(userData); @@ -108,9 +130,8 @@ static ZydisStatus ZydisFormatterPrintMnemonicIntel(const ZydisFormatter* format /* ---------------------------------------------------------------------------------------------- */ -static ZydisStatus ZydisFormatterFormatOperandRegIntel(const ZydisFormatter* formatter, - ZydisString* string, const ZydisDecodedInstruction* instruction, - const ZydisDecodedOperand* operand, void* userData) +static ZydisStatus ZydisFormatOperandRegIntel(const ZydisFormatter* formatter, ZydisString* string, + const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, void* userData) { ZYDIS_UNUSED_PARAMETER(userData); @@ -132,9 +153,8 @@ static ZydisStatus ZydisFormatterFormatOperandRegIntel(const ZydisFormatter* for return ZydisStringAppendExStatic(string, reg, formatter->letterCase); } -static ZydisStatus ZydisFormatterFormatOperandMemIntel(const ZydisFormatter* formatter, - ZydisString* string, const ZydisDecodedInstruction* instruction, - const ZydisDecodedOperand* operand, void* userData) +static ZydisStatus ZydisFormatOperandMemIntel(const ZydisFormatter* formatter, ZydisString* string, + const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, void* userData) { if (!formatter || !instruction || !operand) { @@ -202,9 +222,8 @@ static ZydisStatus ZydisFormatterFormatOperandMemIntel(const ZydisFormatter* for return ZydisStringAppendC(string, "]"); } -static ZydisStatus ZydisFormatterFormatOperandPtrIntel(const ZydisFormatter* formatter, - ZydisString* string, const ZydisDecodedInstruction* instruction, - const ZydisDecodedOperand* operand, void* userData) +static ZydisStatus ZydisFormatOperandPtrIntel(const ZydisFormatter* formatter, ZydisString* string, + const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, void* userData) { ZYDIS_UNUSED_PARAMETER(userData); @@ -220,9 +239,8 @@ static ZydisStatus ZydisFormatterFormatOperandPtrIntel(const ZydisFormatter* for formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); } -static ZydisStatus ZydisFormatterFormatOperandImmIntel(const ZydisFormatter* formatter, - ZydisString* string, const ZydisDecodedInstruction* instruction, - const ZydisDecodedOperand* operand, void* userData) +static ZydisStatus ZydisFormatOperandImmIntel(const ZydisFormatter* formatter, ZydisString* string, + const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, void* userData) { if (!formatter || !instruction || !operand) { @@ -268,9 +286,9 @@ static ZydisStatus ZydisFormatterFormatOperandImmIntel(const ZydisFormatter* for /* ---------------------------------------------------------------------------------------------- */ -static ZydisStatus ZydisFormatterPrintAddressIntel(const ZydisFormatter* formatter, - ZydisString* string, const ZydisDecodedInstruction* instruction, - const ZydisDecodedOperand* operand, ZydisU64 address, void* userData) +static ZydisStatus ZydisPrintAddressIntel(const ZydisFormatter* formatter, ZydisString* string, + const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, + ZydisU64 address, void* userData) { ZYDIS_UNUSED_PARAMETER(userData); @@ -295,9 +313,8 @@ static ZydisStatus ZydisFormatterPrintAddressIntel(const ZydisFormatter* formatt } } -static ZydisStatus ZydisFormatterPrintDisplacementIntel(const ZydisFormatter* formatter, - ZydisString* string, const ZydisDecodedInstruction* instruction, - const ZydisDecodedOperand* operand, void* userData) +static ZydisStatus ZydisPrintDisplacementIntel(const ZydisFormatter* formatter, ZydisString* string, + const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, void* userData) { ZYDIS_UNUSED_PARAMETER(userData); @@ -332,9 +349,8 @@ static ZydisStatus ZydisFormatterPrintDisplacementIntel(const ZydisFormatter* fo return ZYDIS_STATUS_SUCCESS; } -static ZydisStatus ZydisFormatterPrintImmediateIntel(const ZydisFormatter* formatter, - ZydisString* string, const ZydisDecodedInstruction* instruction, - const ZydisDecodedOperand* operand, void* userData) +static ZydisStatus ZydisPrintImmediateIntel(const ZydisFormatter* formatter, ZydisString* string, + const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, void* userData) { ZYDIS_UNUSED_PARAMETER(userData); @@ -398,9 +414,8 @@ static ZydisStatus ZydisFormatterPrintImmediateIntel(const ZydisFormatter* forma /* ---------------------------------------------------------------------------------------------- */ -static ZydisStatus ZydisFormatterPrintOperandSizeIntel(const ZydisFormatter* formatter, - ZydisString* string, const ZydisDecodedInstruction* instruction, - const ZydisDecodedOperand* operand, void* userData) +static ZydisStatus ZydisPrintOperandSizeIntel(const ZydisFormatter* formatter, ZydisString* string, + const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, void* userData) { ZYDIS_UNUSED_PARAMETER(userData); @@ -506,9 +521,8 @@ static ZydisStatus ZydisFormatterPrintOperandSizeIntel(const ZydisFormatter* for return ZYDIS_STATUS_SUCCESS; } -static ZydisStatus ZydisFormatterPrintSegmentIntel(const ZydisFormatter* formatter, - ZydisString* string, const ZydisDecodedInstruction* instruction, - const ZydisDecodedOperand* operand, void* userData) +static ZydisStatus ZydisPrintSegmentIntel(const ZydisFormatter* formatter, ZydisString* string, + const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, void* userData) { ZYDIS_UNUSED_PARAMETER(userData); @@ -551,9 +565,9 @@ static ZydisStatus ZydisFormatterPrintSegmentIntel(const ZydisFormatter* formatt return ZYDIS_STATUS_SUCCESS; } -static ZydisStatus ZydisFormatterPrintDecoratorIntel(const ZydisFormatter* formatter, - ZydisString* string, const ZydisDecodedInstruction* instruction, - const ZydisDecodedOperand* operand, ZydisDecoratorType type, void* userData) +static ZydisStatus ZydisPrintDecoratorIntel(const ZydisFormatter* formatter, ZydisString* string, + const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, + ZydisDecoratorType type, void* userData) { ZYDIS_UNUSED_PARAMETER(userData); @@ -733,8 +747,8 @@ static ZydisStatus ZydisFormatterPrintDecoratorIntel(const ZydisFormatter* forma return ZYDIS_STATUS_SUCCESS; } -static ZydisStatus ZydisFormatterFormatInstrIntel(const ZydisFormatter* formatter, - ZydisString* string, const ZydisDecodedInstruction* instruction, void* userData) +static ZydisStatus ZydisFormatInstrIntel(const ZydisFormatter* formatter, ZydisString* string, + const ZydisDecodedInstruction* instruction, void* userData) { if (!formatter || !string || !instruction) { @@ -845,8 +859,10 @@ static ZydisStatus ZydisFormatterFormatInstrIntel(const ZydisFormatter* formatte } /* ---------------------------------------------------------------------------------------------- */ + +/* ============================================================================================== */ /* Exported functions */ -/* ---------------------------------------------------------------------------------------------- */ +/* ============================================================================================== */ ZydisStatus ZydisFormatterInit(ZydisFormatter* formatter, ZydisFormatterStyle style) { @@ -874,19 +890,19 @@ ZydisStatus ZydisFormatterInit(ZydisFormatter* formatter, ZydisFormatterStyle st switch (style) { case ZYDIS_FORMATTER_STYLE_INTEL: - formatter->funcFormatInstruction = &ZydisFormatterFormatInstrIntel; - formatter->funcPrintPrefixes = &ZydisFormatterPrintPrefixesIntel; - formatter->funcPrintMnemonic = &ZydisFormatterPrintMnemonicIntel; - formatter->funcFormatOperandReg = &ZydisFormatterFormatOperandRegIntel; - formatter->funcFormatOperandMem = &ZydisFormatterFormatOperandMemIntel; - formatter->funcFormatOperandPtr = &ZydisFormatterFormatOperandPtrIntel; - formatter->funcFormatOperandImm = &ZydisFormatterFormatOperandImmIntel; - formatter->funcPrintOperandSize = &ZydisFormatterPrintOperandSizeIntel; - formatter->funcPrintSegment = &ZydisFormatterPrintSegmentIntel; - formatter->funcPrintDecorator = &ZydisFormatterPrintDecoratorIntel; - formatter->funcPrintAddress = &ZydisFormatterPrintAddressIntel; - formatter->funcPrintDisplacement = &ZydisFormatterPrintDisplacementIntel; - formatter->funcPrintImmediate = &ZydisFormatterPrintImmediateIntel; + formatter->funcFormatInstruction = &ZydisFormatInstrIntel; + formatter->funcPrintPrefixes = &ZydisPrintPrefixesIntel; + formatter->funcPrintMnemonic = &ZydisPrintMnemonicIntel; + formatter->funcFormatOperandReg = &ZydisFormatOperandRegIntel; + formatter->funcFormatOperandMem = &ZydisFormatOperandMemIntel; + formatter->funcFormatOperandPtr = &ZydisFormatOperandPtrIntel; + formatter->funcFormatOperandImm = &ZydisFormatOperandImmIntel; + formatter->funcPrintOperandSize = &ZydisPrintOperandSizeIntel; + formatter->funcPrintSegment = &ZydisPrintSegmentIntel; + formatter->funcPrintDecorator = &ZydisPrintDecoratorIntel; + formatter->funcPrintAddress = &ZydisPrintAddressIntel; + formatter->funcPrintDisplacement = &ZydisPrintDisplacementIntel; + formatter->funcPrintImmediate = &ZydisPrintImmediateIntel; break; default: return ZYDIS_STATUS_INVALID_PARAMETER; @@ -1120,23 +1136,13 @@ ZydisStatus ZydisFormatterFormatInstructionEx(const ZydisFormatter* formatter, ZydisString string; string.buffer = buffer; string.length = 0; - string.capacity = bufferLen; + string.capacity = bufferLen - 1; - if (formatter->funcPre) - { - ZYDIS_CHECK(formatter->funcPre(formatter, &string, instruction, userData)); - } - ZYDIS_CHECK(formatter->funcFormatInstruction(formatter, &string, instruction, userData)); - if (formatter->funcPost) - { - return formatter->funcPost(formatter, &string, instruction, userData); - } + const ZydisStatus status = ZydisFormatInstruction(formatter, instruction, &string, userData); - buffer[string.length] = 0; // TODO: Should we add 0-termination in error case? + buffer[string.length] = 0; - return ZYDIS_STATUS_SUCCESS; + return status; } -/* ---------------------------------------------------------------------------------------------- */ - /* ============================================================================================== */ From 451d7fb1a8f3bd2c01b14c21989a5cd80897c237 Mon Sep 17 00:00:00 2001 From: flobernd Date: Sun, 3 Dec 2017 18:36:43 +0100 Subject: [PATCH 12/14] Fixed and refactored some enums - Fixed `ZydisRegister` enum and string-table - Renamed `ZYDIS_XXX_MAX_BITS` in `ZYDIS_XXX_MIN_BITS` --- include/Zydis/Generated/EnumISAExt.h | 7 ++- include/Zydis/Generated/EnumISASet.h | 7 ++- .../Zydis/Generated/EnumInstructionCategory.h | 7 ++- include/Zydis/Generated/EnumMnemonic.h | 7 ++- include/Zydis/Internal/SharedData.h | 10 ++-- include/Zydis/Register.h | 53 ++++++++++--------- src/Register.c | 27 ++++------ 7 files changed, 53 insertions(+), 65 deletions(-) diff --git a/include/Zydis/Generated/EnumISAExt.h b/include/Zydis/Generated/EnumISAExt.h index 7f6f5d6..c7418bf 100644 --- a/include/Zydis/Generated/EnumISAExt.h +++ b/include/Zydis/Generated/EnumISAExt.h @@ -148,8 +148,7 @@ enum ZydisISAExts ZYDIS_ISA_EXT_XSAVE, ZYDIS_ISA_EXT_XSAVEC, ZYDIS_ISA_EXT_XSAVEOPT, - ZYDIS_ISA_EXT_XSAVES + ZYDIS_ISA_EXT_XSAVES, + ZYDIS_ISA_EXT_MAX_VALUE = ZYDIS_ISA_EXT_XSAVES, + ZYDIS_ISA_EXT_MIN_BITS = 0x0008 }; - -#define ZYDIS_ISA_EXT_MAX_VALUE ZYDIS_ISA_EXT_XSAVES -#define ZYDIS_ISA_EXT_MAX_BITS 0x0008 diff --git a/include/Zydis/Generated/EnumISASet.h b/include/Zydis/Generated/EnumISASet.h index 635e35f..e886ac5 100644 --- a/include/Zydis/Generated/EnumISASet.h +++ b/include/Zydis/Generated/EnumISASet.h @@ -71,8 +71,7 @@ enum ZydisISASets ZYDIS_ISA_SET_XSAVE, ZYDIS_ISA_SET_XSAVEC, ZYDIS_ISA_SET_XSAVEOPT, - ZYDIS_ISA_SET_XSAVES + ZYDIS_ISA_SET_XSAVES, + ZYDIS_ISA_SET_MAX_VALUE = ZYDIS_ISA_SET_XSAVES, + ZYDIS_ISA_SET_MIN_BITS = 0x0006 }; - -#define ZYDIS_ISA_SET_MAX_VALUE ZYDIS_ISA_SET_XSAVES -#define ZYDIS_ISA_SET_MAX_BITS 0x0006 diff --git a/include/Zydis/Generated/EnumInstructionCategory.h b/include/Zydis/Generated/EnumInstructionCategory.h index e6c0230..509acbb 100644 --- a/include/Zydis/Generated/EnumInstructionCategory.h +++ b/include/Zydis/Generated/EnumInstructionCategory.h @@ -98,8 +98,7 @@ enum ZydisInstructionCategories ZYDIS_CATEGORY_X87_ALU, ZYDIS_CATEGORY_XOP, ZYDIS_CATEGORY_XSAVE, - ZYDIS_CATEGORY_XSAVEOPT + ZYDIS_CATEGORY_XSAVEOPT, + ZYDIS_CATEGORY_MAX_VALUE = ZYDIS_CATEGORY_XSAVEOPT, + ZYDIS_CATEGORY_MIN_BITS = 0x0007 }; - -#define ZYDIS_CATEGORY_MAX_VALUE ZYDIS_CATEGORY_XSAVEOPT -#define ZYDIS_CATEGORY_MAX_BITS 0x0007 diff --git a/include/Zydis/Generated/EnumMnemonic.h b/include/Zydis/Generated/EnumMnemonic.h index 91cb06b..3801e1c 100644 --- a/include/Zydis/Generated/EnumMnemonic.h +++ b/include/Zydis/Generated/EnumMnemonic.h @@ -1582,8 +1582,7 @@ enum ZydisMnemonics ZYDIS_MNEMONIC_XSAVES, ZYDIS_MNEMONIC_XSAVES64, ZYDIS_MNEMONIC_XSETBV, - ZYDIS_MNEMONIC_XTEST + ZYDIS_MNEMONIC_XTEST, + ZYDIS_MNEMONIC_MAX_VALUE = ZYDIS_MNEMONIC_XTEST, + ZYDIS_MNEMONIC_MIN_BITS = 0x000B }; - -#define ZYDIS_MNEMONIC_MAX_VALUE ZYDIS_MNEMONIC_XTEST -#define ZYDIS_MNEMONIC_MAX_BITS 0x000B diff --git a/include/Zydis/Internal/SharedData.h b/include/Zydis/Internal/SharedData.h index 30325b7..907a929 100644 --- a/include/Zydis/Internal/SharedData.h +++ b/include/Zydis/Internal/SharedData.h @@ -147,7 +147,7 @@ typedef struct ZydisOperandDefinition_ ZydisU8 type ZYDIS_BITFIELD(3); union { - ZydisRegister reg; + ZydisRegister reg ZYDIS_BITFIELD(ZYDIS_REGISTER_MIN_BITS); ZydisU8 id ZYDIS_BITFIELD(6); } reg; } reg; @@ -543,16 +543,16 @@ enum ZydisMaskPolicies /* ---------------------------------------------------------------------------------------------- */ #define ZYDIS_INSTRUCTION_DEFINITION_BASE \ - ZydisMnemonic mnemonic ZYDIS_BITFIELD(ZYDIS_MNEMONIC_MAX_BITS); \ + ZydisMnemonic mnemonic ZYDIS_BITFIELD(ZYDIS_MNEMONIC_MIN_BITS); \ ZydisU8 operandCount ZYDIS_BITFIELD( 4); \ ZydisU16 operandReference ZYDIS_BITFIELD(15); \ ZydisU8 operandSizeMap ZYDIS_BITFIELD( 3); \ ZydisU8 flagsReference ZYDIS_BITFIELD( 7); \ ZydisBool requiresProtectedMode ZYDIS_BITFIELD( 1); \ ZydisBool acceptsAddressSizeOverride ZYDIS_BITFIELD( 1); \ - ZydisInstructionCategory category ZYDIS_BITFIELD(ZYDIS_CATEGORY_MAX_BITS); \ - ZydisISASet isaSet ZYDIS_BITFIELD(ZYDIS_ISA_SET_MAX_BITS); \ - ZydisISAExt isaExt ZYDIS_BITFIELD(ZYDIS_ISA_EXT_MAX_BITS); \ + ZydisInstructionCategory category ZYDIS_BITFIELD(ZYDIS_CATEGORY_MIN_BITS); \ + ZydisISASet isaSet ZYDIS_BITFIELD(ZYDIS_ISA_SET_MIN_BITS); \ + ZydisISAExt isaExt ZYDIS_BITFIELD(ZYDIS_ISA_EXT_MIN_BITS); \ ZydisExceptionClass exceptionClass ZYDIS_BITFIELD( 6) #define ZYDIS_INSTRUCTION_DEFINITION_BASE_VECTOR \ diff --git a/include/Zydis/Register.h b/include/Zydis/Register.h index 30fcd5d..b3b8b78 100644 --- a/include/Zydis/Register.h +++ b/include/Zydis/Register.h @@ -59,6 +59,7 @@ typedef ZydisU8 ZydisRegister; enum ZydisRegisters { ZYDIS_REGISTER_NONE, + // General purpose registers 8-bit ZYDIS_REGISTER_AL, ZYDIS_REGISTER_CL, ZYDIS_REGISTER_DL, ZYDIS_REGISTER_BL, ZYDIS_REGISTER_AH, ZYDIS_REGISTER_CH, ZYDIS_REGISTER_DH, ZYDIS_REGISTER_BH, @@ -86,24 +87,6 @@ enum ZydisRegisters // Floating point multimedia registers ZYDIS_REGISTER_MM0, ZYDIS_REGISTER_MM1, ZYDIS_REGISTER_MM2, ZYDIS_REGISTER_MM3, ZYDIS_REGISTER_MM4, ZYDIS_REGISTER_MM5, ZYDIS_REGISTER_MM6, ZYDIS_REGISTER_MM7, - // Floating point vector registers 512-bit - ZYDIS_REGISTER_ZMM0, ZYDIS_REGISTER_ZMM1, ZYDIS_REGISTER_ZMM2, ZYDIS_REGISTER_ZMM3, - ZYDIS_REGISTER_ZMM4, ZYDIS_REGISTER_ZMM5, ZYDIS_REGISTER_ZMM6, ZYDIS_REGISTER_ZMM7, - ZYDIS_REGISTER_ZMM8, ZYDIS_REGISTER_ZMM9, ZYDIS_REGISTER_ZMM10, ZYDIS_REGISTER_ZMM11, - ZYDIS_REGISTER_ZMM12, ZYDIS_REGISTER_ZMM13, ZYDIS_REGISTER_ZMM14, ZYDIS_REGISTER_ZMM15, - ZYDIS_REGISTER_ZMM16, ZYDIS_REGISTER_ZMM17, ZYDIS_REGISTER_ZMM18, ZYDIS_REGISTER_ZMM19, - ZYDIS_REGISTER_ZMM20, ZYDIS_REGISTER_ZMM21, ZYDIS_REGISTER_ZMM22, ZYDIS_REGISTER_ZMM23, - ZYDIS_REGISTER_ZMM24, ZYDIS_REGISTER_ZMM25, ZYDIS_REGISTER_ZMM26, ZYDIS_REGISTER_ZMM27, - ZYDIS_REGISTER_ZMM28, ZYDIS_REGISTER_ZMM29, ZYDIS_REGISTER_ZMM30, ZYDIS_REGISTER_ZMM31, - // Floating point vector registers 256-bit - ZYDIS_REGISTER_YMM0, ZYDIS_REGISTER_YMM1, ZYDIS_REGISTER_YMM2, ZYDIS_REGISTER_YMM3, - ZYDIS_REGISTER_YMM4, ZYDIS_REGISTER_YMM5, ZYDIS_REGISTER_YMM6, ZYDIS_REGISTER_YMM7, - ZYDIS_REGISTER_YMM8, ZYDIS_REGISTER_YMM9, ZYDIS_REGISTER_YMM10, ZYDIS_REGISTER_YMM11, - ZYDIS_REGISTER_YMM12, ZYDIS_REGISTER_YMM13, ZYDIS_REGISTER_YMM14, ZYDIS_REGISTER_YMM15, - ZYDIS_REGISTER_YMM16, ZYDIS_REGISTER_YMM17, ZYDIS_REGISTER_YMM18, ZYDIS_REGISTER_YMM19, - ZYDIS_REGISTER_YMM20, ZYDIS_REGISTER_YMM21, ZYDIS_REGISTER_YMM22, ZYDIS_REGISTER_YMM23, - ZYDIS_REGISTER_YMM24, ZYDIS_REGISTER_YMM25, ZYDIS_REGISTER_YMM26, ZYDIS_REGISTER_YMM27, - ZYDIS_REGISTER_YMM28, ZYDIS_REGISTER_YMM29, ZYDIS_REGISTER_YMM30, ZYDIS_REGISTER_YMM31, // Floating point vector registers 128-bit ZYDIS_REGISTER_XMM0, ZYDIS_REGISTER_XMM1, ZYDIS_REGISTER_XMM2, ZYDIS_REGISTER_XMM3, ZYDIS_REGISTER_XMM4, ZYDIS_REGISTER_XMM5, ZYDIS_REGISTER_XMM6, ZYDIS_REGISTER_XMM7, @@ -113,12 +96,28 @@ enum ZydisRegisters ZYDIS_REGISTER_XMM20, ZYDIS_REGISTER_XMM21, ZYDIS_REGISTER_XMM22, ZYDIS_REGISTER_XMM23, ZYDIS_REGISTER_XMM24, ZYDIS_REGISTER_XMM25, ZYDIS_REGISTER_XMM26, ZYDIS_REGISTER_XMM27, ZYDIS_REGISTER_XMM28, ZYDIS_REGISTER_XMM29, ZYDIS_REGISTER_XMM30, ZYDIS_REGISTER_XMM31, + // Floating point vector registers 256-bit + ZYDIS_REGISTER_YMM0, ZYDIS_REGISTER_YMM1, ZYDIS_REGISTER_YMM2, ZYDIS_REGISTER_YMM3, + ZYDIS_REGISTER_YMM4, ZYDIS_REGISTER_YMM5, ZYDIS_REGISTER_YMM6, ZYDIS_REGISTER_YMM7, + ZYDIS_REGISTER_YMM8, ZYDIS_REGISTER_YMM9, ZYDIS_REGISTER_YMM10, ZYDIS_REGISTER_YMM11, + ZYDIS_REGISTER_YMM12, ZYDIS_REGISTER_YMM13, ZYDIS_REGISTER_YMM14, ZYDIS_REGISTER_YMM15, + ZYDIS_REGISTER_YMM16, ZYDIS_REGISTER_YMM17, ZYDIS_REGISTER_YMM18, ZYDIS_REGISTER_YMM19, + ZYDIS_REGISTER_YMM20, ZYDIS_REGISTER_YMM21, ZYDIS_REGISTER_YMM22, ZYDIS_REGISTER_YMM23, + ZYDIS_REGISTER_YMM24, ZYDIS_REGISTER_YMM25, ZYDIS_REGISTER_YMM26, ZYDIS_REGISTER_YMM27, + ZYDIS_REGISTER_YMM28, ZYDIS_REGISTER_YMM29, ZYDIS_REGISTER_YMM30, ZYDIS_REGISTER_YMM31, + // Floating point vector registers 512-bit + ZYDIS_REGISTER_ZMM0, ZYDIS_REGISTER_ZMM1, ZYDIS_REGISTER_ZMM2, ZYDIS_REGISTER_ZMM3, + ZYDIS_REGISTER_ZMM4, ZYDIS_REGISTER_ZMM5, ZYDIS_REGISTER_ZMM6, ZYDIS_REGISTER_ZMM7, + ZYDIS_REGISTER_ZMM8, ZYDIS_REGISTER_ZMM9, ZYDIS_REGISTER_ZMM10, ZYDIS_REGISTER_ZMM11, + ZYDIS_REGISTER_ZMM12, ZYDIS_REGISTER_ZMM13, ZYDIS_REGISTER_ZMM14, ZYDIS_REGISTER_ZMM15, + ZYDIS_REGISTER_ZMM16, ZYDIS_REGISTER_ZMM17, ZYDIS_REGISTER_ZMM18, ZYDIS_REGISTER_ZMM19, + ZYDIS_REGISTER_ZMM20, ZYDIS_REGISTER_ZMM21, ZYDIS_REGISTER_ZMM22, ZYDIS_REGISTER_ZMM23, + ZYDIS_REGISTER_ZMM24, ZYDIS_REGISTER_ZMM25, ZYDIS_REGISTER_ZMM26, ZYDIS_REGISTER_ZMM27, + ZYDIS_REGISTER_ZMM28, ZYDIS_REGISTER_ZMM29, ZYDIS_REGISTER_ZMM30, ZYDIS_REGISTER_ZMM31, // Flags registers - ZYDIS_REGISTER_RFLAGS, ZYDIS_REGISTER_EFLAGS, ZYDIS_REGISTER_FLAGS, - // Instruction-pointer registers - ZYDIS_REGISTER_RIP, ZYDIS_REGISTER_EIP, ZYDIS_REGISTER_IP, - // Special registers - ZYDIS_REGISTER_MXCSR, ZYDIS_REGISTER_PKRU, ZYDIS_REGISTER_XCR0, + ZYDIS_REGISTER_FLAGS, ZYDIS_REGISTER_EFLAGS, ZYDIS_REGISTER_RFLAGS, + // IP registers + ZYDIS_REGISTER_IP, ZYDIS_REGISTER_EIP, ZYDIS_REGISTER_RIP, // Segment registers ZYDIS_REGISTER_ES, ZYDIS_REGISTER_CS, ZYDIS_REGISTER_SS, ZYDIS_REGISTER_DS, ZYDIS_REGISTER_FS, ZYDIS_REGISTER_GS, @@ -143,15 +142,17 @@ enum ZydisRegisters // Bound registers ZYDIS_REGISTER_BND0, ZYDIS_REGISTER_BND1, ZYDIS_REGISTER_BND2, ZYDIS_REGISTER_BND3, ZYDIS_REGISTER_BNDCFG, ZYDIS_REGISTER_BNDSTATUS, + // Misc registers + ZYDIS_REGISTER_MXCSR, ZYDIS_REGISTER_PKRU, ZYDIS_REGISTER_XCR0, /** * @brief Maximum value of this enum. */ - ZYDIS_REGISTER_MAX_VALUE = ZYDIS_REGISTER_BNDSTATUS, + ZYDIS_REGISTER_MAX_VALUE = ZYDIS_REGISTER_XCR0, /** - * @brief Maximum amount of bits occupied by an integer from this enum. + * @brief Minimum amount of bits required to store a value of this enum. */ - ZYDIS_REGISTER_MAX_BITS = 8 + ZYDIS_REGISTER_MIN_BITS = 0x0008 }; /* ---------------------------------------------------------------------------------------------- */ diff --git a/src/Register.c b/src/Register.c index 93fb816..fbc7ae2 100644 --- a/src/Register.c +++ b/src/Register.c @@ -71,16 +71,6 @@ static const ZydisStaticString registerStrings[] = ZYDIS_MAKE_STATIC_STRING("r10"), ZYDIS_MAKE_STATIC_STRING("r11"), ZYDIS_MAKE_STATIC_STRING("r12"), ZYDIS_MAKE_STATIC_STRING("r13"), ZYDIS_MAKE_STATIC_STRING("r14"), ZYDIS_MAKE_STATIC_STRING("r15"), - // Address-size scaling general purpose pseudo-registers - ZYDIS_MAKE_STATIC_STRING("aszax"), ZYDIS_MAKE_STATIC_STRING("aszcx"), - ZYDIS_MAKE_STATIC_STRING("aszdx"), ZYDIS_MAKE_STATIC_STRING("aszbx"), - ZYDIS_MAKE_STATIC_STRING("aszsp"), ZYDIS_MAKE_STATIC_STRING("aszbp"), - ZYDIS_MAKE_STATIC_STRING("aszsi"), ZYDIS_MAKE_STATIC_STRING("aszdi"), - // Stack-size scaling general purpose pseudo-registers - ZYDIS_MAKE_STATIC_STRING("sszax"), ZYDIS_MAKE_STATIC_STRING("sszcx"), - ZYDIS_MAKE_STATIC_STRING("sszdx"), ZYDIS_MAKE_STATIC_STRING("sszbx"), - ZYDIS_MAKE_STATIC_STRING("sszsp"), ZYDIS_MAKE_STATIC_STRING("sszbp"), - ZYDIS_MAKE_STATIC_STRING("sszsi"), ZYDIS_MAKE_STATIC_STRING("sszdi"), // Floating point legacy registers ZYDIS_MAKE_STATIC_STRING("st0"), ZYDIS_MAKE_STATIC_STRING("st1"), ZYDIS_MAKE_STATIC_STRING("st2"), ZYDIS_MAKE_STATIC_STRING("st3"), @@ -149,9 +139,12 @@ static const ZydisStaticString registerStrings[] = ZYDIS_MAKE_STATIC_STRING("ip"), ZYDIS_MAKE_STATIC_STRING("eip"), ZYDIS_MAKE_STATIC_STRING("rip"), // Segment registers - ZYDIS_MAKE_STATIC_STRING("es"), ZYDIS_MAKE_STATIC_STRING("ss"), - ZYDIS_MAKE_STATIC_STRING("cs"), ZYDIS_MAKE_STATIC_STRING("ds"), + ZYDIS_MAKE_STATIC_STRING("es"), ZYDIS_MAKE_STATIC_STRING("cs"), + ZYDIS_MAKE_STATIC_STRING("ss"), ZYDIS_MAKE_STATIC_STRING("ds"), ZYDIS_MAKE_STATIC_STRING("fs"), ZYDIS_MAKE_STATIC_STRING("gs"), + // Table registers + ZYDIS_MAKE_STATIC_STRING("gdtr"), ZYDIS_MAKE_STATIC_STRING("ldtr"), + ZYDIS_MAKE_STATIC_STRING("idtr"), ZYDIS_MAKE_STATIC_STRING("tr"), // Test registers ZYDIS_MAKE_STATIC_STRING("tr0"), ZYDIS_MAKE_STATIC_STRING("tr1"), ZYDIS_MAKE_STATIC_STRING("tr2"), ZYDIS_MAKE_STATIC_STRING("tr3"), @@ -183,12 +176,10 @@ static const ZydisStaticString registerStrings[] = // Bound registers ZYDIS_MAKE_STATIC_STRING("bnd0"), ZYDIS_MAKE_STATIC_STRING("bnd1"), ZYDIS_MAKE_STATIC_STRING("bnd2"), ZYDIS_MAKE_STATIC_STRING("bnd3"), + ZYDIS_MAKE_STATIC_STRING("bndcfg"), ZYDIS_MAKE_STATIC_STRING("bndstatus"), // Misc registers ZYDIS_MAKE_STATIC_STRING("mxcsr"), ZYDIS_MAKE_STATIC_STRING("pkru"), - ZYDIS_MAKE_STATIC_STRING("xcr0"), ZYDIS_MAKE_STATIC_STRING("gdtr"), - ZYDIS_MAKE_STATIC_STRING("ldtr"), ZYDIS_MAKE_STATIC_STRING("idtr"), - ZYDIS_MAKE_STATIC_STRING("tr"), ZYDIS_MAKE_STATIC_STRING("bndcfg"), - ZYDIS_MAKE_STATIC_STRING("bndstatus") + ZYDIS_MAKE_STATIC_STRING("xcr0") }; /* ============================================================================================== */ @@ -342,7 +333,7 @@ ZydisRegisterWidth ZydisRegisterGetWidth64(ZydisRegister reg) const char* ZydisRegisterGetString(ZydisRegister reg) { - if (reg > (sizeof(registerStrings) / sizeof(registerStrings[0])) - 1) + if (reg >= ZYDIS_ARRAY_SIZE(registerStrings)) { return ZYDIS_NULL; } @@ -351,7 +342,7 @@ const char* ZydisRegisterGetString(ZydisRegister reg) const ZydisStaticString* ZydisRegisterGetStaticString(ZydisRegister reg) { - if (reg > (sizeof(registerStrings) / sizeof(registerStrings[0])) - 1) + if (reg >= ZYDIS_ARRAY_SIZE(registerStrings)) { return ZYDIS_NULL; } From e145402d2ef5819e56359ec9552101a4f9a8086d Mon Sep 17 00:00:00 2001 From: flobernd Date: Sun, 3 Dec 2017 18:37:57 +0100 Subject: [PATCH 13/14] Added `ZydisUPointer` and `ZydisIPointer` types --- include/Zydis/CommonTypes.h | 252 +++++++++++++++++++----------------- 1 file changed, 131 insertions(+), 121 deletions(-) diff --git a/include/Zydis/CommonTypes.h b/include/Zydis/CommonTypes.h index cd51b5f..c4966b0 100644 --- a/include/Zydis/CommonTypes.h +++ b/include/Zydis/CommonTypes.h @@ -1,127 +1,137 @@ -/*************************************************************************************************** - - Zyan Disassembler Library (Zydis) - - Original Author : Florian Bernd, Joel Höner - - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - -***************************************************************************************************/ - -/** - * @file - * @brief Includes and defines some default datatypes. - */ - -#ifndef ZYDIS_COMMONTYPES_H -#define ZYDIS_COMMONTYPES_H - -#include - -/* ============================================================================================== */ -/* Integer types */ -/* ============================================================================================== */ - -#if !defined(ZYDIS_NO_LIBC) - // If is LibC present, we use stdint types. -# include -# include - typedef uint8_t ZydisU8; - typedef uint16_t ZydisU16; - typedef uint32_t ZydisU32; - typedef uint64_t ZydisU64; - typedef int8_t ZydisI8; - typedef int16_t ZydisI16; - typedef int32_t ZydisI32; - typedef int64_t ZydisI64; - typedef size_t ZydisUSize; - typedef ptrdiff_t ZydisISize; -#else - // No LibC, use compiler built-in types / macros. -# if defined(ZYDIS_MSVC) - typedef unsigned __int8 ZydisU8; - typedef unsigned __int16 ZydisU16; - typedef unsigned __int32 ZydisU32; - typedef unsigned __int64 ZydisU64; - typedef signed __int8 ZydisI8; - typedef signed __int16 ZydisI16; - typedef signed __int32 ZydisI32; - typedef signed __int64 ZydisI64; +/*************************************************************************************************** + + Zyan Disassembler Library (Zydis) + + Original Author : Florian Bernd, Joel Höner + + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + +***************************************************************************************************/ + +/** + * @file + * @brief Includes and defines some default datatypes. + */ + +#ifndef ZYDIS_COMMONTYPES_H +#define ZYDIS_COMMONTYPES_H + +#include + +/* ============================================================================================== */ +/* Integer types */ +/* ============================================================================================== */ + +#if !defined(ZYDIS_NO_LIBC) + // If is LibC present, we use stdint types. +# include +# include + typedef uint8_t ZydisU8; + typedef uint16_t ZydisU16; + typedef uint32_t ZydisU32; + typedef uint64_t ZydisU64; + typedef int8_t ZydisI8; + typedef int16_t ZydisI16; + typedef int32_t ZydisI32; + typedef int64_t ZydisI64; + typedef size_t ZydisUSize; + typedef ptrdiff_t ZydisISize; + typedef uintptr_t ZydisUPointer; + typedef intptr_t ZydisIPointer; +#else + // No LibC, use compiler built-in types / macros. +# if defined(ZYDIS_MSVC) + typedef unsigned __int8 ZydisU8; + typedef unsigned __int16 ZydisU16; + typedef unsigned __int32 ZydisU32; + typedef unsigned __int64 ZydisU64; + typedef signed __int8 ZydisI8; + typedef signed __int16 ZydisI16; + typedef signed __int32 ZydisI32; + typedef signed __int64 ZydisI64; # if _WIN64 typedef ZydisU64 ZydisUSize; typedef ZydisI64 ZydisISize; + typedef ZydisU64 ZydisUPointer; + typedef ZydisI64 ZydisIPointer; # else typedef ZydisU32 ZydisUSize; typedef ZydisI32 ZydisISize; -# endif -# elif defined(ZYDIS_GNUC) - typedef __UINT8_TYPE__ ZydisU8; - typedef __UINT16_TYPE__ ZydisU16; - typedef __UINT32_TYPE__ ZydisU32; - typedef __UINT64_TYPE__ ZydisU64; - typedef __INT8_TYPE__ ZydisI8; - typedef __INT16_TYPE__ ZydisI16; - typedef __INT32_TYPE__ ZydisI32; - typedef __INT64_TYPE__ ZydisI64; - typedef __SIZE_TYPE__ ZydisUSize; - typedef __PTRDIFF_TYPE__ ZydisISize; -# else -# error "Unsupported compiler for no-libc mode." -# endif -#endif - -// Verify size assumptions. -ZYDIS_STATIC_ASSERT(sizeof(ZydisU8 ) == 1 ); -ZYDIS_STATIC_ASSERT(sizeof(ZydisU16 ) == 2 ); -ZYDIS_STATIC_ASSERT(sizeof(ZydisU32 ) == 4 ); -ZYDIS_STATIC_ASSERT(sizeof(ZydisU64 ) == 8 ); -ZYDIS_STATIC_ASSERT(sizeof(ZydisI8 ) == 1 ); -ZYDIS_STATIC_ASSERT(sizeof(ZydisI16 ) == 2 ); -ZYDIS_STATIC_ASSERT(sizeof(ZydisI32 ) == 4 ); -ZYDIS_STATIC_ASSERT(sizeof(ZydisI64 ) == 8 ); -ZYDIS_STATIC_ASSERT(sizeof(ZydisUSize) == sizeof(void*)); -ZYDIS_STATIC_ASSERT(sizeof(ZydisISize) == sizeof(void*)); - -// Verify signedness assumptions (relies on size checks above). -ZYDIS_STATIC_ASSERT((ZydisI8 )-1 >> 1 < (ZydisI8 )((ZydisU8 )-1 >> 1)); -ZYDIS_STATIC_ASSERT((ZydisI16)-1 >> 1 < (ZydisI16)((ZydisU16)-1 >> 1)); -ZYDIS_STATIC_ASSERT((ZydisI32)-1 >> 1 < (ZydisI32)((ZydisU32)-1 >> 1)); -ZYDIS_STATIC_ASSERT((ZydisI64)-1 >> 1 < (ZydisI64)((ZydisU64)-1 >> 1)); - -/* ============================================================================================== */ -/* NULL */ -/* ============================================================================================== */ - -#define ZYDIS_NULL ((void*)0) - -/* ============================================================================================== */ -/* Boolean */ -/* ============================================================================================== */ - -#define ZYDIS_FALSE 0 -#define ZYDIS_TRUE 1 - -/** - * @briefs Defines the @c ZydisBool datatype. - */ -typedef ZydisU8 ZydisBool; - -/* ============================================================================================== */ - -#endif /* ZYDIS_COMMONTYPES_H */ + typedef ZydisU32 ZydisUPointer; + typedef ZydisI32 ZydisIPointer; +# endif +# elif defined(ZYDIS_GNUC) + typedef __UINT8_TYPE__ ZydisU8; + typedef __UINT16_TYPE__ ZydisU16; + typedef __UINT32_TYPE__ ZydisU32; + typedef __UINT64_TYPE__ ZydisU64; + typedef __INT8_TYPE__ ZydisI8; + typedef __INT16_TYPE__ ZydisI16; + typedef __INT32_TYPE__ ZydisI32; + typedef __INT64_TYPE__ ZydisI64; + typedef __SIZE_TYPE__ ZydisUSize; + typedef __PTRDIFF_TYPE__ ZydisISize; + typedef __UINTPTR_TYPE__ ZydisUPointer; + typedef __INTPTR_TYPE__ ZydisIPointer; +# else +# error "Unsupported compiler for no-libc mode." +# endif +#endif + +// Verify size assumptions. +ZYDIS_STATIC_ASSERT(sizeof(ZydisU8 ) == 1 ); +ZYDIS_STATIC_ASSERT(sizeof(ZydisU16 ) == 2 ); +ZYDIS_STATIC_ASSERT(sizeof(ZydisU32 ) == 4 ); +ZYDIS_STATIC_ASSERT(sizeof(ZydisU64 ) == 8 ); +ZYDIS_STATIC_ASSERT(sizeof(ZydisI8 ) == 1 ); +ZYDIS_STATIC_ASSERT(sizeof(ZydisI16 ) == 2 ); +ZYDIS_STATIC_ASSERT(sizeof(ZydisI32 ) == 4 ); +ZYDIS_STATIC_ASSERT(sizeof(ZydisI64 ) == 8 ); +ZYDIS_STATIC_ASSERT(sizeof(ZydisUSize ) == sizeof(void*)); // TODO: This one is incorrect! +ZYDIS_STATIC_ASSERT(sizeof(ZydisISize ) == sizeof(void*)); // TODO: This one is incorrect! +ZYDIS_STATIC_ASSERT(sizeof(ZydisUPointer) == sizeof(void*)); +ZYDIS_STATIC_ASSERT(sizeof(ZydisIPointer) == sizeof(void*)); + +// Verify signedness assumptions (relies on size checks above). +ZYDIS_STATIC_ASSERT((ZydisI8 )-1 >> 1 < (ZydisI8 )((ZydisU8 )-1 >> 1)); +ZYDIS_STATIC_ASSERT((ZydisI16)-1 >> 1 < (ZydisI16)((ZydisU16)-1 >> 1)); +ZYDIS_STATIC_ASSERT((ZydisI32)-1 >> 1 < (ZydisI32)((ZydisU32)-1 >> 1)); +ZYDIS_STATIC_ASSERT((ZydisI64)-1 >> 1 < (ZydisI64)((ZydisU64)-1 >> 1)); + +/* ============================================================================================== */ +/* NULL */ +/* ============================================================================================== */ + +#define ZYDIS_NULL ((void*)0) + +/* ============================================================================================== */ +/* Boolean */ +/* ============================================================================================== */ + +#define ZYDIS_FALSE 0 +#define ZYDIS_TRUE 1 + +/** + * @briefs Defines the @c ZydisBool datatype. + */ +typedef ZydisU8 ZydisBool; + +/* ============================================================================================== */ + +#endif /* ZYDIS_COMMONTYPES_H */ From dff821402b3559ef237aeb8cc8384a4fb2b0eaf6 Mon Sep 17 00:00:00 2001 From: flobernd Date: Sun, 3 Dec 2017 18:49:45 +0100 Subject: [PATCH 14/14] Refactored `ZydisFormatter` - Added `ZYDIS_FORMATTER_HOOK_PRE_OPERAND`, `ZYDIS_FORMATTER_HOOK_POST_OPERAND` and `ZYDIS_FORMATTER_HOOK_PRINT_REGISTER` - Renamed `ZYDIS_FORMATTER_HOOK_PRINT_DISPLACEMENT` to `ZYDIS_FORMATTER_HOOK_PRINT_DISP` - Renamed `ZYDIS_FORMATTER_HOOK_PRINT_IMMEDIATE` to `ZYDIS_FORMATTER_HOOK_PRINT_IMM` - Renamed `ZYDIS_FORMATTER_HOOK_PRINT_OPERANDSIZE` to `ZYDIS_FORMATTER_HOOK_PRINT_MEMSIZE` - Removed `ZYDIS_FORMATTER_HOOK_PRINT_SEGMENT` - Renamed some enums and types - Revised documentation - Fixed examples and tools --- examples/FormatterHooks.c | 12 +- examples/ZydisPerfTest.c | 4 +- include/Zydis/Formatter.h | 375 +++++++++++-------- src/Formatter.c | 762 +++++++++++++++++++------------------- src/MetaInfo.c | 6 +- src/Mnemonic.c | 4 +- tools/ZydisDisasm.c | 4 +- tools/ZydisInfo.c | 4 +- 8 files changed, 620 insertions(+), 551 deletions(-) diff --git a/examples/FormatterHooks.c b/examples/FormatterHooks.c index 7a3b73e..92313e9 100644 --- a/examples/FormatterHooks.c +++ b/examples/FormatterHooks.c @@ -133,7 +133,7 @@ typedef struct ZydisCustomUserData_ /* Hook callbacks */ /* ============================================================================================== */ -ZydisFormatterFormatFunc defaultPrintMnemonic; +ZydisFormatterFunc defaultPrintMnemonic; static ZydisStatus ZydisFormatterPrintMnemonic(const ZydisFormatter* formatter, ZydisString* string, const ZydisDecodedInstruction* instruction, ZydisCustomUserData* userData) @@ -191,7 +191,7 @@ static ZydisStatus ZydisFormatterPrintMnemonic(const ZydisFormatter* formatter, /* ---------------------------------------------------------------------------------------------- */ -ZydisFormatterFormatOperandFunc defaultFormatOperandImm; +ZydisFormatterOperandFunc defaultFormatOperandImm; static ZydisStatus ZydisFormatterFormatOperandImm(const ZydisFormatter* formatter, ZydisString* string, const ZydisDecodedInstruction* instruction, @@ -220,15 +220,15 @@ void disassembleBuffer(ZydisDecoder* decoder, uint8_t* data, size_t length, Zydi { ZydisFormatter formatter; ZydisFormatterInit(&formatter, ZYDIS_FORMATTER_STYLE_INTEL); - ZydisFormatterSetProperty(&formatter, ZYDIS_FORMATTER_PROP_FORCE_SEGMENTS, ZYDIS_TRUE); - ZydisFormatterSetProperty(&formatter, ZYDIS_FORMATTER_PROP_FORCE_OPERANDSIZE, ZYDIS_TRUE); + ZydisFormatterSetProperty(&formatter, ZYDIS_FORMATTER_PROP_FORCE_MEMSEG, ZYDIS_TRUE); + ZydisFormatterSetProperty(&formatter, ZYDIS_FORMATTER_PROP_FORCE_MEMSIZE, ZYDIS_TRUE); if (installHooks) { - defaultPrintMnemonic = (ZydisFormatterFormatFunc)&ZydisFormatterPrintMnemonic; + defaultPrintMnemonic = (ZydisFormatterFunc)&ZydisFormatterPrintMnemonic; ZydisFormatterSetHook(&formatter, ZYDIS_FORMATTER_HOOK_PRINT_MNEMONIC, (const void**)&defaultPrintMnemonic); - defaultFormatOperandImm = (ZydisFormatterFormatOperandFunc)&ZydisFormatterFormatOperandImm; + defaultFormatOperandImm = (ZydisFormatterOperandFunc)&ZydisFormatterFormatOperandImm; ZydisFormatterSetHook(&formatter, ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_IMM, (const void**)&defaultFormatOperandImm); } diff --git a/examples/ZydisPerfTest.c b/examples/ZydisPerfTest.c index 103cb2a..95cab7d 100644 --- a/examples/ZydisPerfTest.c +++ b/examples/ZydisPerfTest.c @@ -174,9 +174,9 @@ uint64_t processBuffer(const char* buffer, size_t length, ZydisBool minimalMode, { if (!ZYDIS_SUCCESS(ZydisFormatterInit(&formatter, ZYDIS_FORMATTER_STYLE_INTEL)) || !ZYDIS_SUCCESS(ZydisFormatterSetProperty(&formatter, - ZYDIS_FORMATTER_PROP_FORCE_SEGMENTS, ZYDIS_TRUE)) || + ZYDIS_FORMATTER_PROP_FORCE_MEMSEG, ZYDIS_TRUE)) || !ZYDIS_SUCCESS(ZydisFormatterSetProperty(&formatter, - ZYDIS_FORMATTER_PROP_FORCE_OPERANDSIZE, ZYDIS_TRUE))) + ZYDIS_FORMATTER_PROP_FORCE_MEMSIZE, ZYDIS_TRUE))) { fputs("Failed to initialize instruction-formatter\n", stderr); exit(EXIT_FAILURE); diff --git a/include/Zydis/Formatter.h b/include/Zydis/Formatter.h index de10be4..4f6d0b4 100644 --- a/include/Zydis/Formatter.h +++ b/include/Zydis/Formatter.h @@ -50,7 +50,7 @@ extern "C" { /* ---------------------------------------------------------------------------------------------- */ /** - * @brief Defines the @c ZydisFormatterStyle datatype. + * @brief Defines the `ZydisFormatterStyle` datatype. */ typedef ZydisU8 ZydisFormatterStyle; @@ -75,7 +75,7 @@ enum ZydisFormatterStyles /* ---------------------------------------------------------------------------------------------- */ /** - * @brief Defines the @c ZydisFormatterProperty datatype. + * @brief Defines the `ZydisFormatterProperty` datatype. */ typedef ZydisU8 ZydisFormatterProperty; @@ -100,16 +100,16 @@ enum ZydisFormatterProperties * * The default value is `ZYDIS_FALSE`. */ - ZYDIS_FORMATTER_PROP_FORCE_SEGMENTS, + ZYDIS_FORMATTER_PROP_FORCE_MEMSEG, /** - * @brief Controls the printing of operand-sizes. + * @brief Controls the printing of memory-operand sizes. * * Pass `ZYDIS_TRUE` as value to force the formatter to always print the size of memory-operands * or `ZYDIS_FALSE` to only print it on demand. * * The default value is `ZYDIS_FALSE`. */ - ZYDIS_FORMATTER_PROP_FORCE_OPERANDSIZE, + ZYDIS_FORMATTER_PROP_FORCE_MEMSIZE, /** * @brief Controls the format of addresses. @@ -141,7 +141,7 @@ enum ZydisFormatterProperties /** * @brief Sets the prefix for hexadecimal values. * - * The default value is `0x`. + * The default value is `"0x"`. */ ZYDIS_FORMATTER_PROP_HEX_PREFIX, /** @@ -176,7 +176,7 @@ enum ZydisFormatterProperties }; /* ---------------------------------------------------------------------------------------------- */ -/* Address format constants */ +/* Address format */ /* ---------------------------------------------------------------------------------------------- */ /** @@ -194,25 +194,23 @@ enum ZydisAddressFormat /** * @brief Uses signed hexadecimal values to display relative addresses. * - * Using this value will cause the formatter to invoke either - * `ZYDIS_FORMATTER_HOOK_PRINT_DISPLACEMENT` or `ZYDIS_FORMATTER_HOOK_PRINT_IMMEDIATE` to - * format addresses. + * Using this value will cause the formatter to either invoke + * `ZYDIS_FORMATTER_HOOK_PRINT_DISP` or `ZYDIS_FORMATTER_HOOK_PRINT_IMM` to format addresses. * * Examples: - * "JMP 0x20" - * "JMP -0x20" + * - `"JMP 0x20"` + * - `"JMP -0x20"` */ ZYDIS_ADDR_FORMAT_RELATIVE_SIGNED, /** * @brief Uses unsigned hexadecimal values to display relative addresses. * - * Using this value will cause the formatter to invoke either - * `ZYDIS_FORMATTER_HOOK_PRINT_DISPLACEMENT` or `ZYDIS_FORMATTER_HOOK_PRINT_IMMEDIATE` to - * format addresses. + * Using this value will cause the formatter to either invoke + * `ZYDIS_FORMATTER_HOOK_PRINT_DISP` or `ZYDIS_FORMATTER_HOOK_PRINT_IMM` to format addresses. * * Examples: - * "JMP 0x20" - * "JMP 0xE0" + * - `"JMP 0x20"` + * - `"JMP 0xE0"` */ ZYDIS_ADDR_FORMAT_RELATIVE_UNSIGNED, @@ -223,7 +221,7 @@ enum ZydisAddressFormat }; /* ---------------------------------------------------------------------------------------------- */ -/* Displacement formats */ +/* Displacement format */ /* ---------------------------------------------------------------------------------------------- */ /** @@ -235,16 +233,16 @@ enum ZydisDisplacementFormat * @brief Formats displacements as signed hexadecimal values. * * Examples: - * "MOV EAX, DWORD PTR SS:[ESP+0x400]" - * "MOV EAX, DWORD PTR SS:[ESP-0x400]" + * - `"MOV EAX, DWORD PTR SS:[ESP+0x400]"` + * - `"MOV EAX, DWORD PTR SS:[ESP-0x400]"` */ ZYDIS_DISP_FORMAT_HEX_SIGNED, /** * @brief Formats displacements as unsigned hexadecimal values. * * Examples: - * "MOV EAX, DWORD PTR SS:[ESP+0x400]" - * "MOV EAX, DWORD PTR SS:[ESP+0xFFFFFC00]" + * - `"MOV EAX, DWORD PTR SS:[ESP+0x400]"` + * - `"MOV EAX, DWORD PTR SS:[ESP+0xFFFFFC00]"` */ ZYDIS_DISP_FORMAT_HEX_UNSIGNED, @@ -255,7 +253,7 @@ enum ZydisDisplacementFormat }; /* ---------------------------------------------------------------------------------------------- */ -/* Immediate formats */ +/* Immediate format */ /* ---------------------------------------------------------------------------------------------- */ /** @@ -265,23 +263,23 @@ enum ZydisImmediateFormat { /** * @brief Automatically chooses the most suitable formatting-mode based on the operands - * @c ZydisOperandInfo.imm.isSigned attribute. + * `ZydisOperandInfo.imm.isSigned` attribute. */ ZYDIS_IMM_FORMAT_HEX_AUTO, /** * @brief Formats immediates as signed hexadecimal values. * * Examples: - * "MOV EAX, 0x400" - * "MOV EAX, -0x400" + * - `"MOV EAX, 0x400"` + * - `"MOV EAX, -0x400"` */ ZYDIS_IMM_FORMAT_HEX_SIGNED, /** * @brief Formats immediates as unsigned hexadecimal values. * * Examples: - * "MOV EAX, 0x400" - * "MOV EAX, 0xFFFFFC00" + * - `"MOV EAX, 0x400"` + * - `"MOV EAX, 0xFFFFFC00"` */ ZYDIS_IMM_FORMAT_HEX_UNSIGNED, @@ -296,7 +294,7 @@ enum ZydisImmediateFormat /* ---------------------------------------------------------------------------------------------- */ /** - * @brief Defines the @c ZydisFormatterHookType datatype. + * @brief Defines the `ZydisFormatterHookType` datatype. */ typedef ZydisU8 ZydisFormatterHookType; @@ -306,90 +304,98 @@ typedef ZydisU8 ZydisFormatterHookType; enum ZydisFormatterHookTypes { /** - * @brief This function is called before the formatter starts formatting an instruction. + * @brief This function is invoked before the formatter formats an instruction. */ - ZYDIS_FORMATTER_HOOK_PRE, + ZYDIS_FORMATTER_HOOK_PRE_INSTRUCTION, /** - * @brief This function is called before the formatter finished formatting an instruction. + * @brief This function is invoked before the formatter formatted an instruction. */ - ZYDIS_FORMATTER_HOOK_POST, + ZYDIS_FORMATTER_HOOK_POST_INSTRUCTION, /** - * @brief This function refers to the main formatting function, that internally calls all - * other function except the ones that are hooked by @c ZYDIS_FORMATTER_HOOK_PRE and - * @c ZYDIS_FORMATTER_HOOK_POST. + * @brief This function is invoked before the formatter formats an operand. + */ + ZYDIS_FORMATTER_HOOK_PRE_OPERAND, + /** + * @brief This function is invoked before the formatter formatted an operand. + */ + ZYDIS_FORMATTER_HOOK_POST_OPERAND, + + /** + * @brief This function refers to the main formatting function. * * Replacing this function allows for complete custom formatting, but indirectly disables all - * other hooks except for @c ZYDIS_FORMATTER_HOOK_PRE and @c ZYDIS_FORMATTER_HOOK_POST. + * other hooks except for `ZYDIS_FORMATTER_HOOK_PRE_INSTRUCTION` and + * `ZYDIS_FORMATTER_HOOK_POST_INSTRUCTION`. */ ZYDIS_FORMATTER_HOOK_FORMAT_INSTRUCTION, /** - * @brief This function is called to print the instruction prefixes. - */ - ZYDIS_FORMATTER_HOOK_PRINT_PREFIXES, - /** - * @brief This function is called to print the instruction mnemonic. - */ - ZYDIS_FORMATTER_HOOK_PRINT_MNEMONIC, - /** - * @brief This function is called to format an register operand. + * @brief This function is invoked to format a register operand. */ ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_REG, /** - * @brief This function is called to format an memory operand. + * @brief This function is invoked to format a memory operand. * * Replacing this function might indirectly disable some specific calls to the - * @c ZYDIS_FORMATTER_PRINT_ADDRESS and @c ZYDIS_FORMATTER_HOOK_PRINT_DISPLACEMENT functions. + * `ZYDIS_FORMATTER_HOOK_PRINT_ADDRESS` and `ZYDIS_FORMATTER_HOOK_PRINT_DISP` functions. */ ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_MEM, /** - * @brief This function is called to format an pointer operand. + * @brief This function is invoked to format a pointer operand. */ ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_PTR, /** - * @brief This function is called to format an immediate operand. + * @brief This function is invoked to format an immediate operand. * * Replacing this function might indirectly disable some specific calls to the - * @c ZYDIS_FORMATTER_PRINT_ADDRESS and @c ZYDIS_FORMATTER_HOOK_PRINT_IMMEDIATE functions. + * `ZYDIS_FORMATTER_HOOK_PRINT_ADDRESS` and `ZYDIS_FORMATTER_HOOK_PRINT_IMM` functions. */ ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_IMM, + /** - * @brief This function is called right before formatting an memory operand to print the - * optional size-specifier. + * @brief This function is invoked to print the instruction mnemonic. */ - ZYDIS_FORMATTER_HOOK_PRINT_OPERANDSIZE, + ZYDIS_FORMATTER_HOOK_PRINT_MNEMONIC, /** - * @brief This function is called right before formatting an memory operand to print the - * optional segment-register. + * @brief This function is invoked to print a register. */ - ZYDIS_FORMATTER_HOOK_PRINT_SEGMENT, + ZYDIS_FORMATTER_HOOK_PRINT_REGISTER, /** - * @brief This function is called right after formatting an operand to print the optional - * EVEX/MVEX operand-decorator. - */ - ZYDIS_FORMATTER_HOOK_PRINT_DECORATOR, - /** - * @brief This function is called to print an absolute address. + * @brief This function is invoked to print an absolute address. */ ZYDIS_FORMATTER_HOOK_PRINT_ADDRESS, /** - * @brief This function is called to print a memory displacement value. + * @brief This function is invoked to print a memory displacement value. */ - ZYDIS_FORMATTER_HOOK_PRINT_DISPLACEMENT, + ZYDIS_FORMATTER_HOOK_PRINT_DISP, /** - * @brief This function is called to print an immediate value. + * @brief This function is invoked to print an immediate value. */ - ZYDIS_FORMATTER_HOOK_PRINT_IMMEDIATE, + ZYDIS_FORMATTER_HOOK_PRINT_IMM, + + /** + * @brief This function is invoked to print the size of a memory operand. + */ + ZYDIS_FORMATTER_HOOK_PRINT_MEMSIZE, + /** + * @brief This function is invoked to print the instruction prefixes. + */ + ZYDIS_FORMATTER_HOOK_PRINT_PREFIXES, + /** + * @brief This function is invoked after formatting an operand to print a `EVEX`/`MVEX` + * decorator. + */ + ZYDIS_FORMATTER_HOOK_PRINT_DECORATOR, /** * @brief Maximum value of this enum. */ - ZYDIS_FORMATTER_HOOK_MAX_VALUE = ZYDIS_FORMATTER_HOOK_PRINT_IMMEDIATE + ZYDIS_FORMATTER_HOOK_MAX_VALUE = ZYDIS_FORMATTER_HOOK_PRINT_DECORATOR }; /* ---------------------------------------------------------------------------------------------- */ /** - * @brief Defines the @c ZydisDecoratorType datatype. + * @brief Defines the `ZydisDecoratorType` datatype. */ typedef ZydisU8 ZydisDecoratorType; @@ -399,18 +405,39 @@ typedef ZydisU8 ZydisDecoratorType; enum ZydisDecoratorTypes { ZYDIS_DECORATOR_TYPE_INVALID, + /** + * @brief The embedded-mask decorator. + */ ZYDIS_DECORATOR_TYPE_MASK, - ZYDIS_DECORATOR_TYPE_BROADCAST, - ZYDIS_DECORATOR_TYPE_ROUNDING_CONTROL, + /** + * @brief The broadcast decorator. + */ + ZYDIS_DECORATOR_TYPE_BC, + /** + * @brief The rounding-control decorator. + */ + ZYDIS_DECORATOR_TYPE_RC, + /** + * @brief The suppress-all-exceptions decorator. + */ ZYDIS_DECORATOR_TYPE_SAE, + /** + * @brief The register-swizzle decorator. + */ ZYDIS_DECORATOR_TYPE_SWIZZLE, + /** + * @brief The conversion decorator. + */ ZYDIS_DECORATOR_TYPE_CONVERSION, - ZYDIS_DECORATOR_TYPE_EVICTION_HINT, + /** + * @brief The eviction-hint decorator. + */ + ZYDIS_DECORATOR_TYPE_EH, /** * @brief Maximum value of this enum. */ - ZYDIS_DECORATOR_TYPE_MAX_VALUE = ZYDIS_DECORATOR_TYPE_EVICTION_HINT + ZYDIS_DECORATOR_TYPE_MAX_VALUE = ZYDIS_DECORATOR_TYPE_EH }; /* ---------------------------------------------------------------------------------------------- */ @@ -418,108 +445,128 @@ enum ZydisDecoratorTypes typedef struct ZydisFormatter_ ZydisFormatter; /** - * @brief Defines the @c ZydisFormatterNotifyFunc function pointer. + * @brief Defines the `ZydisFormatterFunc` function pointer. * - * @param formatter A pointer to the @c ZydisFormatter instance. + * @param formatter A pointer to the `ZydisFormatter` instance. * @param string A pointer to the string. - * @param instruction A pointer to the @c ZydisDecodedInstruction struct. + * @param instruction A pointer to the `ZydisDecodedInstruction` struct. * @param userData A pointer to user-defined data. * - * @return Returning a status code other than @c ZYDIS_STATUS_SUCCESS will immediately cause the - * formatting process to fail. + * @return A zydis status code. * - * This function type is used for the @c ZYDIS_FORMATTER_HOOK_PRE and - * @c ZYDIS_FORMATTER_HOOK_POST hook-types. + * Returning a status code other than `ZYDIS_STATUS_SUCCESS` will immediately cause the formatting + * process to fail. + * + * Returning `ZYDIS_STATUS_SUCCESS` in `ZYDIS_FORMATTER_HOOK_PRINT_PREFIXES` without writing to + * the string is valid and signals that the corresponding element should not be printed. + * + * This function type is used for: + * - `ZYDIS_FORMATTER_HOOK_PRE_INSTRUCTION` + * - `ZYDIS_FORMATTER_HOOK_POST_INSTRUCTION` + * - `ZYDIS_FORMATTER_HOOK_FORMAT_INSTRUCTION` + * - `ZYDIS_FORMATTER_HOOK_PRINT_MNEMONIC` + * - `ZYDIS_FORMATTER_HOOK_PRINT_PREFIXES` */ -typedef ZydisStatus (*ZydisFormatterNotifyFunc)(const ZydisFormatter* formatter, +typedef ZydisStatus (*ZydisFormatterFunc)(const ZydisFormatter* formatter, ZydisString* string, const ZydisDecodedInstruction* instruction, void* userData); /** - * @brief Defines the @c ZydisFormatterFormatFunc function pointer. + * @brief Defines the `ZydisFormatterOperandFunc` function pointer. * - * @param formatter A pointer to the @c ZydisFormatter instance. + * @param formatter A pointer to the `ZydisFormatter` instance. * @param string A pointer to the string. - * @param instruction A pointer to the @c ZydisDecodedInstruction struct. + * @param instruction A pointer to the `ZydisDecodedInstruction` struct. + * @param operand A pointer to the `ZydisDecodedOperand` struct. * @param userData A pointer to user-defined data. * - * @return Returning a status code other than @c ZYDIS_STATUS_SUCCESS will immediately cause the - * formatting process to fail. - * - * This function type is used for the @c ZYDIS_FORMATTER_HOOK_FORMAT_INSTRUCTION, - * @c ZYDIS_FORMATTER_HOOK_PRINT_PREFIXES and @c ZYDIS_FORMATTER_HOOK_PRINT_MNEMONIC hook-types. - */ -typedef ZydisStatus (*ZydisFormatterFormatFunc)(const ZydisFormatter* formatter, - ZydisString* string, const ZydisDecodedInstruction* instruction, void* userData); - -/** - * @brief Defines the @c ZydisFormatterFormatOperandFunc function pointer. - * - * @param formatter A pointer to the @c ZydisFormatter instance. - * @param string A pointer to the string. - * @param instruction A pointer to the @c ZydisDecodedInstruction struct. - * @param operand A pointer to the @c ZydisDecodedOperand struct. - * @param userData A pointer to user-defined data. + * @return A zydis status code. * - * @return Returning a status code other than @c ZYDIS_STATUS_SUCCESS will immediately cause the - * formatting process to fail. + * Returning a status code other than `ZYDIS_STATUS_SUCCESS` will immediately cause the formatting + * process to fail. * - * Returning @c ZYDIS_STATUS_SUCCESS in one of the @c ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_X hooks + * Returning `ZYDIS_STATUS_SUCCESS` in one of the `ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_X` hooks * without writing to the string is valid and will cause the formatter to omit the current * operand. * - * Returning @c ZYDIS_STATUS_SUCCESS in @c ZYDIS_FORMATTER_HOOK_PRINT_OPERANDSIZE, - * @c ZYDIS_FORMATTER_HOOK_PRINT_SEGMENT or @c ZYDIS_FORMATTER_HOOK_PRINT_DECORATOR without - * writing to the string is valid and signals that the corresponding element should not be - * printed for the current operand. + * Returning `ZYDIS_STATUS_SUCCESS` in `ZYDIS_FORMATTER_HOOK_PRINT_MEMSIZE` or + * `ZYDIS_FORMATTER_HOOK_PRINT_DECORATOR` without writing to the string is valid and signals that + * the corresponding element should not be printed for the current operand. * - * This function type is used for the @c ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_REG, - * @c ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_MEM, @c ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_PTR, - * @c ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_IMM, @c ZYDIS_FORMATTER_HOOK_PRINT_OPERANDSIZE, - * @c ZYDIS_FORMATTER_HOOK_PRINT_SEGMENT, @c ZYDIS_FORMATTER_HOOK_PRINT_DECORATOR, - * @c ZYDIS_FORMATTER_HOOK_PRINT_DISPLACEMENT and @c ZYDIS_FORMATTER_HOOK_PRINT_IMMEDIATE - * hook-types. + * This function type is used for: + * - `ZYDIS_FORMATTER_HOOK_PRE_OPERAND` + * - `ZYDIS_FORMATTER_HOOK_POST_OPERAND` + * - `ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_REG` + * - `ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_MEM` + * - `ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_PTR` + * - `ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_IMM` + * - `ZYDIS_FORMATTER_HOOK_PRINT_DISP` + * - `ZYDIS_FORMATTER_HOOK_PRINT_IMM` + * - `ZYDIS_FORMATTER_HOOK_PRINT_MEMSIZE` */ -typedef ZydisStatus (*ZydisFormatterFormatOperandFunc)(const ZydisFormatter* formatter, +typedef ZydisStatus (*ZydisFormatterOperandFunc)(const ZydisFormatter* formatter, ZydisString* string, const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, void* userData); /** - * @brief Defines the @c ZydisFormatterFormatAddressFunc function pointer. + * @brief Defines the `ZydisFormatterRegisterFunc` function pointer. * - * @param formatter A pointer to the @c ZydisFormatter instance. + * @param formatter A pointer to the `ZydisFormatter` instance. * @param string A pointer to the string. - * @param instruction A pointer to the @c ZydisDecodedInstruction struct. - * @param operand A pointer to the @c ZydisDecodedOperand struct. + * @param instruction A pointer to the `ZydisDecodedInstruction` struct. + * @param operand A pointer to the `ZydisDecodedOperand` struct. + * @param reg The register. * @param userData A pointer to user-defined data. * - * @return Returning a status code other than @c ZYDIS_STATUS_SUCCESS will immediately cause the + * @return Returning a status code other than `ZYDIS_STATUS_SUCCESS` will immediately cause the * formatting process to fail. * - * This function type is used for the @c ZYDIS_FORMATTER_HOOK_PRINT_ADDRESS hook-type. + * This function type is used for: + * - `ZYDIS_FORMATTER_HOOK_PRINT_REGISTER`. */ -typedef ZydisStatus (*ZydisFormatterFormatAddressFunc)(const ZydisFormatter* formatter, +typedef ZydisStatus (*ZydisFormatterRegisterFunc)(const ZydisFormatter* formatter, + ZydisString* string, const ZydisDecodedInstruction* instruction, + const ZydisDecodedOperand* operand, ZydisRegister reg, void* userData); + + /** + * @brief Defines the `ZydisFormatterAddressFunc` function pointer. + * + * @param formatter A pointer to the `ZydisFormatter` instance. + * @param string A pointer to the string. + * @param instruction A pointer to the `ZydisDecodedInstruction` struct. + * @param operand A pointer to the `ZydisDecodedOperand` struct. + * @param address The address. + * @param userData A pointer to user-defined data. + * + * @return Returning a status code other than `ZYDIS_STATUS_SUCCESS` will immediately cause the + * formatting process to fail. + * + * This function type is used for: + * - `ZYDIS_FORMATTER_HOOK_PRINT_ADDRESS` + */ +typedef ZydisStatus (*ZydisFormatterAddressFunc)(const ZydisFormatter* formatter, ZydisString* string, const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, ZydisU64 address, void* userData); /** - * @brief Defines the @c ZydisFormatterFormatDecoratorFunc function pointer. + * @brief Defines the `ZydisFormatterDecoratorFunc` function pointer. * - * @param formatter A pointer to the @c ZydisFormatter instance. + * @param formatter A pointer to the `ZydisFormatter` instance. * @param string A pointer to the string. - * @param instruction A pointer to the @c ZydisDecodedInstruction struct. - * @param operand A pointer to the @c ZydisDecodedOperand struct. + * @param instruction A pointer to the `ZydisDecodedInstruction` struct. + * @param operand A pointer to the `ZydisDecodedOperand` struct. * @param type The decorator type. * @param userData A pointer to user-defined data. * - * @return Returning a status code other than @c ZYDIS_STATUS_SUCCESS will immediately cause the + * @return Returning a status code other than `ZYDIS_STATUS_SUCCESS` will immediately cause the * formatting process to fail. * - * Returning @c ZYDIS_STATUS_SUCCESS without writing to the string is valid and will cause the + * Returning `ZYDIS_STATUS_SUCCESS` without writing to the string is valid and will cause the * formatter to omit the current decorator. * - * This function type is used for the @c ZYDIS_FORMATTER_HOOK_PRINT_DECORATOR hook-type. + * This function type is used for: + * - `ZYDIS_FORMATTER_HOOK_PRINT_DECORATOR` */ -typedef ZydisStatus (*ZydisFormatterFormatDecoratorFunc)(const ZydisFormatter* formatter, +typedef ZydisStatus (*ZydisFormatterDecoratorFunc)(const ZydisFormatter* formatter, ZydisString* string, const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, ZydisDecoratorType type, void* userData); @@ -528,39 +575,41 @@ typedef ZydisStatus (*ZydisFormatterFormatDecoratorFunc)(const ZydisFormatter* f /* ---------------------------------------------------------------------------------------------- */ /** - * @brief Defines the @c ZydisFormatter struct. + * @brief Defines the `ZydisFormatter` struct. */ struct ZydisFormatter_ { - ZydisU8 letterCase; - ZydisBool forceSegments; - ZydisBool forceOperandSize; - ZydisU8 addressFormat; - ZydisU8 displacementFormat; - ZydisU8 immediateFormat; + ZydisLetterCase letterCase; + ZydisBool forceMemorySegment; + ZydisBool forceMemorySize; + ZydisU8 formatAddress; + ZydisU8 formatDisp; + ZydisU8 formatImm; ZydisBool hexUppercase; ZydisString* hexPrefix; ZydisString hexPrefixData; ZydisString* hexSuffix; ZydisString hexSuffixData; ZydisU8 hexPaddingAddress; - ZydisU8 hexPaddingDisplacement; - ZydisU8 hexPaddingImmediate; - ZydisFormatterNotifyFunc funcPre; - ZydisFormatterNotifyFunc funcPost; - ZydisFormatterFormatFunc funcFormatInstruction; - ZydisFormatterFormatFunc funcPrintPrefixes; - ZydisFormatterFormatFunc funcPrintMnemonic; - ZydisFormatterFormatOperandFunc funcFormatOperandReg; - ZydisFormatterFormatOperandFunc funcFormatOperandMem; - ZydisFormatterFormatOperandFunc funcFormatOperandPtr; - ZydisFormatterFormatOperandFunc funcFormatOperandImm; - ZydisFormatterFormatOperandFunc funcPrintOperandSize; - ZydisFormatterFormatOperandFunc funcPrintSegment; - ZydisFormatterFormatDecoratorFunc funcPrintDecorator; - ZydisFormatterFormatAddressFunc funcPrintAddress; - ZydisFormatterFormatOperandFunc funcPrintDisplacement; - ZydisFormatterFormatOperandFunc funcPrintImmediate; + ZydisU8 hexPaddingDisp; + ZydisU8 hexPaddingImm; + ZydisFormatterFunc funcPreInstruction; + ZydisFormatterFunc funcPostInstruction; + ZydisFormatterOperandFunc funcPreOperand; + ZydisFormatterOperandFunc funcPostOperand; + ZydisFormatterFunc funcFormatInstruction; + ZydisFormatterOperandFunc funcFormatOperandReg; + ZydisFormatterOperandFunc funcFormatOperandMem; + ZydisFormatterOperandFunc funcFormatOperandPtr; + ZydisFormatterOperandFunc funcFormatOperandImm; + ZydisFormatterFunc funcPrintMnemonic; + ZydisFormatterRegisterFunc funcPrintRegister; + ZydisFormatterAddressFunc funcPrintAddress; + ZydisFormatterOperandFunc funcPrintDisp; + ZydisFormatterOperandFunc funcPrintImm; + ZydisFormatterOperandFunc funcPrintMemSize; + ZydisFormatterFunc funcPrintPrefixes; + ZydisFormatterDecoratorFunc funcPrintDecorator; }; /* ---------------------------------------------------------------------------------------------- */ @@ -570,9 +619,9 @@ struct ZydisFormatter_ /* ============================================================================================== */ /** - * @brief Initializes the given @c ZydisFormatter instance. + * @brief Initializes the given `ZydisFormatter` instance. * - * @param formatter A pointer to the @c ZydisFormatter instance. + * @param formatter A pointer to the `ZydisFormatter` instance. * @param style The formatter style. * * @return A zydis status code. @@ -582,20 +631,20 @@ ZYDIS_EXPORT ZydisStatus ZydisFormatterInit(ZydisFormatter* formatter, ZydisForm /** * @brief Sets the value of the specified formatter `attribute`. * - * @param formatter A pointer to the @c ZydisFormatter instance. + * @param formatter A pointer to the `ZydisFormatter` instance. * @param property The id of the formatter-property. * @param value The new value. * * @return A zydis status code. */ ZYDIS_EXPORT ZydisStatus ZydisFormatterSetProperty(ZydisFormatter* formatter, - ZydisFormatterProperty property, ZydisUSize value); + ZydisFormatterProperty property, ZydisUPointer value); /** * @brief Replaces a formatter function with a custom callback and/or retrieves the currently * used function. * - * @param formatter A pointer to the @c ZydisFormatter instance. + * @param formatter A pointer to the `ZydisFormatter` instance. * @param hook The formatter hook-type. * @param callback A pointer to a variable that contains the pointer of the callback function * and receives the pointer of the currently used function. @@ -611,8 +660,8 @@ ZYDIS_EXPORT ZydisStatus ZydisFormatterSetHook(ZydisFormatter* formatter, /** * @brief Formats the given instruction and writes it into the output buffer. * - * @param formatter A pointer to the @c ZydisFormatter instance. - * @param instruction A pointer to the @c ZydisDecodedInstruction struct. + * @param formatter A pointer to the `ZydisFormatter` instance. + * @param instruction A pointer to the `ZydisDecodedInstruction` struct. * @param buffer A pointer to the output buffer. * @param bufferLen The length of the output buffer. * @@ -624,8 +673,8 @@ ZYDIS_EXPORT ZydisStatus ZydisFormatterFormatInstruction(const ZydisFormatter* f /** * @brief Formats the given instruction and writes it into the output buffer. * - * @param formatter A pointer to the @c ZydisFormatter instance. - * @param instruction A pointer to the @c ZydisDecodedInstruction struct. + * @param formatter A pointer to the `ZydisFormatter` instance. + * @param instruction A pointer to the `ZydisDecodedInstruction` struct. * @param buffer A pointer to the output buffer. * @param bufferLen The length of the output buffer. * @param userData A pointer to user-defined data which can be used in custom formatter diff --git a/src/Formatter.c b/src/Formatter.c index 4e7d59f..235c746 100644 --- a/src/Formatter.c +++ b/src/Formatter.c @@ -39,16 +39,16 @@ static ZydisStatus ZydisFormatInstruction(const ZydisFormatter* formatter, const ZydisDecodedInstruction* instruction, ZydisString* string, void* userData) { - if (formatter->funcPre) + if (formatter->funcPreInstruction) { - ZYDIS_CHECK(formatter->funcPre(formatter, string, instruction, userData)); + ZYDIS_CHECK(formatter->funcPreInstruction(formatter, string, instruction, userData)); } ZYDIS_CHECK(formatter->funcFormatInstruction(formatter, string, instruction, userData)); - if (formatter->funcPost) + if (formatter->funcPostInstruction) { - return formatter->funcPost(formatter, string, instruction, userData); + return formatter->funcPostInstruction(formatter, string, instruction, userData); } return ZYDIS_STATUS_SUCCESS; @@ -58,71 +58,43 @@ static ZydisStatus ZydisFormatInstruction(const ZydisFormatter* formatter, const /* Intel style */ /* ---------------------------------------------------------------------------------------------- */ -static ZydisStatus ZydisPrintPrefixesIntel(const ZydisFormatter* formatter, ZydisString* string, - const ZydisDecodedInstruction* instruction, void* userData) +static ZydisStatus ZydisPrintSegmentIntel(const ZydisFormatter* formatter, ZydisString* string, + const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, void* userData) { - ZYDIS_UNUSED_PARAMETER(userData); + ZYDIS_ASSERT(formatter); + ZYDIS_ASSERT(string); + ZYDIS_ASSERT(instruction); + ZYDIS_ASSERT(operand); - if (!formatter || !instruction) + switch (operand->mem.segment) { - return ZYDIS_STATUS_INVALID_PARAMETER; - } - - if (instruction->attributes & ZYDIS_ATTRIB_HAS_LOCK) - { - return ZydisStringAppendExC(string, "lock ", formatter->letterCase); - } - - if (instruction->attributes & ZYDIS_ATTRIB_HAS_REP) - { - return ZydisStringAppendExC(string, "rep ", formatter->letterCase); - } - if (instruction->attributes & ZYDIS_ATTRIB_HAS_REPE) - { - return ZydisStringAppendExC(string, "repe ", formatter->letterCase); - } - if (instruction->attributes & ZYDIS_ATTRIB_HAS_REPNE) - { - return ZydisStringAppendExC(string, "repne ", formatter->letterCase); - } - - if (instruction->attributes & ZYDIS_ATTRIB_HAS_BOUND) - { - return ZydisStringAppendExC(string, "bnd ", formatter->letterCase); - } - - if (instruction->attributes & ZYDIS_ATTRIB_HAS_XACQUIRE) - { - return ZydisStringAppendExC(string, "xacquire ", formatter->letterCase); - } - if (instruction->attributes & ZYDIS_ATTRIB_HAS_XRELEASE) - { - return ZydisStringAppendExC(string, "xrelease ", formatter->letterCase); - } - - return ZYDIS_STATUS_SUCCESS; -} - -static ZydisStatus ZydisPrintMnemonicIntel(const ZydisFormatter* formatter, ZydisString* string, - const ZydisDecodedInstruction* instruction, void* userData) -{ - ZYDIS_UNUSED_PARAMETER(userData); - - if (!formatter || !instruction) - { - return ZYDIS_STATUS_INVALID_PARAMETER; - } - - const ZydisStaticString* mnemonic = ZydisMnemonicGetStaticString(instruction->mnemonic); - if (!mnemonic) - { - return ZydisStringAppendExC(string, "invalid", formatter->letterCase); - } - ZYDIS_CHECK(ZydisStringAppendExStatic(string, mnemonic, formatter->letterCase)); - - if (instruction->attributes & ZYDIS_ATTRIB_IS_FAR_BRANCH) - { - return ZydisStringAppendExC(string, " far", formatter->letterCase); + case ZYDIS_REGISTER_ES: + case ZYDIS_REGISTER_CS: + case ZYDIS_REGISTER_FS: + case ZYDIS_REGISTER_GS: + ZYDIS_CHECK(formatter->funcPrintRegister(formatter, string, instruction, operand, + operand->mem.segment, userData)); + return ZydisStringAppendC(string, ":"); + case ZYDIS_REGISTER_SS: + if ((formatter->forceMemorySegment) || + (instruction->attributes & ZYDIS_ATTRIB_HAS_SEGMENT_SS)) + { + ZYDIS_CHECK(formatter->funcPrintRegister(formatter, string, instruction, operand, + operand->mem.segment, userData)); + return ZydisStringAppendC(string, ":"); + } + break; + case ZYDIS_REGISTER_DS: + if ((formatter->forceMemorySegment) || + (instruction->attributes & ZYDIS_ATTRIB_HAS_SEGMENT_DS)) + { + ZYDIS_CHECK(formatter->funcPrintRegister(formatter, string, instruction, operand, + operand->mem.segment, userData)); + return ZydisStringAppendC(string, ":"); + } + break; + default: + break; } return ZYDIS_STATUS_SUCCESS; @@ -130,27 +102,149 @@ static ZydisStatus ZydisPrintMnemonicIntel(const ZydisFormatter* formatter, Zydi /* ---------------------------------------------------------------------------------------------- */ -static ZydisStatus ZydisFormatOperandRegIntel(const ZydisFormatter* formatter, ZydisString* string, - const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, void* userData) +static ZydisStatus ZydisFormatInstrIntel(const ZydisFormatter* formatter, ZydisString* string, + const ZydisDecodedInstruction* instruction, void* userData) { - ZYDIS_UNUSED_PARAMETER(userData); - - if (!formatter || !instruction || !operand) + if (!formatter || !string || !instruction) { return ZYDIS_STATUS_INVALID_PARAMETER; } + ZYDIS_CHECK(formatter->funcPrintPrefixes(formatter, string, instruction, userData)); + ZYDIS_CHECK(formatter->funcPrintMnemonic(formatter, string, instruction, userData)); + + for (ZydisU8 i = 0; i < instruction->operandCount; ++i) + { + if (instruction->operands[i].visibility == ZYDIS_OPERAND_VISIBILITY_HIDDEN) + { + break; + } + + const ZydisUSize strLenRestore = string->length; + if (i == 0) + { + ZYDIS_CHECK(ZydisStringAppendC(string, " ")); + } else + { + ZYDIS_CHECK(ZydisStringAppendC(string, ", ")); + } + + if (formatter->funcPreOperand) + { + formatter->funcPreOperand(formatter, string, instruction, &instruction->operands[i], + userData); + } + + const ZydisUSize strLenPreOperand = string->length; + switch (instruction->operands[i].type) + { + case ZYDIS_OPERAND_TYPE_REGISTER: + ZYDIS_CHECK(formatter->funcFormatOperandReg(formatter, string, instruction, + &instruction->operands[i], userData)); + break; + case ZYDIS_OPERAND_TYPE_MEMORY: + { + ZYDIS_CHECK(formatter->funcPrintMemSize(formatter, string, instruction, + &instruction->operands[i], userData)); + const ZydisUSize strLenTemp = string->length; + ZYDIS_CHECK(formatter->funcFormatOperandMem(formatter, string, instruction, + &instruction->operands[i], userData)); + if (strLenTemp == string->length) + { + string->length = strLenPreOperand; + } + break; + } + case ZYDIS_OPERAND_TYPE_POINTER: + ZYDIS_CHECK(formatter->funcFormatOperandPtr(formatter, string, instruction, + &instruction->operands[i], userData)); + break; + case ZYDIS_OPERAND_TYPE_IMMEDIATE: + ZYDIS_CHECK(formatter->funcFormatOperandImm(formatter, string, instruction, + &instruction->operands[i], userData)); + break; + default: + return ZYDIS_STATUS_INVALID_PARAMETER; + } + + if (strLenPreOperand == string->length) + { + // Omit whole operand, if the string did not change during the formatting-callback + string->length = strLenRestore; + + if (formatter->funcPostOperand) + { + formatter->funcPostOperand(formatter, string, instruction, + &instruction->operands[i], userData); + } + + continue; + } + + if (formatter->funcPostOperand) + { + formatter->funcPostOperand(formatter, string, instruction, &instruction->operands[i], + userData); + } + + if ((instruction->encoding == ZYDIS_INSTRUCTION_ENCODING_EVEX) || + (instruction->encoding == ZYDIS_INSTRUCTION_ENCODING_MVEX)) + { + if ((i == 0) && + (instruction->operands[i + 1].encoding == ZYDIS_OPERAND_ENCODING_MASK)) + { + ZYDIS_CHECK(formatter->funcPrintDecorator(formatter, string, instruction, + &instruction->operands[i], ZYDIS_DECORATOR_TYPE_MASK, userData)); + } + if (instruction->operands[i].type == ZYDIS_OPERAND_TYPE_MEMORY) + { + ZYDIS_CHECK(formatter->funcPrintDecorator(formatter, string, instruction, + &instruction->operands[i], ZYDIS_DECORATOR_TYPE_BC, userData)); + if (instruction->encoding == ZYDIS_INSTRUCTION_ENCODING_MVEX) + { + ZYDIS_CHECK(formatter->funcPrintDecorator(formatter, string, instruction, + &instruction->operands[i], ZYDIS_DECORATOR_TYPE_CONVERSION, userData)); + ZYDIS_CHECK(formatter->funcPrintDecorator(formatter, string, instruction, + &instruction->operands[i], ZYDIS_DECORATOR_TYPE_EH, userData)); + } + } else + { + if ((i == (instruction->operandCount - 1)) || + (instruction->operands[i + 1].type == ZYDIS_OPERAND_TYPE_IMMEDIATE)) + { + if (instruction->encoding == ZYDIS_INSTRUCTION_ENCODING_MVEX) + { + ZYDIS_CHECK(formatter->funcPrintDecorator(formatter, string, instruction, + &instruction->operands[i], ZYDIS_DECORATOR_TYPE_SWIZZLE, userData)); + } + ZYDIS_CHECK(formatter->funcPrintDecorator(formatter, string, instruction, + &instruction->operands[i], ZYDIS_DECORATOR_TYPE_RC, userData)); + ZYDIS_CHECK(formatter->funcPrintDecorator(formatter, string, instruction, + &instruction->operands[i], ZYDIS_DECORATOR_TYPE_SAE, userData)); + } + } + } + } + + return ZYDIS_STATUS_SUCCESS; +} + +static ZydisStatus ZydisFormatOperandRegIntel(const ZydisFormatter* formatter, ZydisString* string, + const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, void* userData) +{ + if (!operand) + { + return ZYDIS_STATUS_INVALID_PARAMETER; + } + + // We want to print embedded-mask registers as decorator instead of a regular operand if ((operand->id == 1) && (operand->encoding == ZYDIS_OPERAND_ENCODING_MASK)) { return ZYDIS_STATUS_SUCCESS; } - const ZydisStaticString* reg = ZydisRegisterGetStaticString(operand->reg.value); - if (!reg) - { - return ZydisStringAppendExC(string, "invalid", formatter->letterCase); - } - return ZydisStringAppendExStatic(string, reg, formatter->letterCase); + return formatter->funcPrintRegister(formatter, string, instruction, operand, + operand->reg.value, userData); } static ZydisStatus ZydisFormatOperandMemIntel(const ZydisFormatter* formatter, ZydisString* string, @@ -161,6 +255,7 @@ static ZydisStatus ZydisFormatOperandMemIntel(const ZydisFormatter* formatter, Z return ZYDIS_STATUS_INVALID_PARAMETER; } + ZYDIS_CHECK(ZydisPrintSegmentIntel(formatter, string, instruction, operand, userData)); ZYDIS_CHECK(ZydisStringAppendC(string, "[")); if (operand->mem.disp.hasDisplacement && ( @@ -170,7 +265,7 @@ static ZydisStatus ZydisFormatOperandMemIntel(const ZydisFormatter* formatter, Z (operand->mem.index == ZYDIS_REGISTER_NONE) && (operand->mem.scale == 0)) { // EIP/RIP-relative or absolute-displacement address operand - if ((formatter->addressFormat == ZYDIS_ADDR_FORMAT_ABSOLUTE) || + if ((formatter->formatAddress == ZYDIS_ADDR_FORMAT_ABSOLUTE) || (operand->mem.base == ZYDIS_REGISTER_NONE)) { ZydisU64 address; @@ -179,9 +274,9 @@ static ZydisStatus ZydisFormatOperandMemIntel(const ZydisFormatter* formatter, Z address, userData)); } else { - ZYDIS_CHECK(ZydisStringAppendExStatic(string, - ZydisRegisterGetStaticString(operand->mem.base), formatter->letterCase)); - ZYDIS_CHECK(formatter->funcPrintDisplacement(formatter, string, instruction, operand, + ZYDIS_CHECK(formatter->funcPrintRegister(formatter, string, instruction, operand, + operand->mem.base, userData)); + ZYDIS_CHECK(formatter->funcPrintDisp(formatter, string, instruction, operand, userData)); } } else @@ -189,34 +284,25 @@ static ZydisStatus ZydisFormatOperandMemIntel(const ZydisFormatter* formatter, Z // Regular memory operand if (operand->mem.base != ZYDIS_REGISTER_NONE) { - const ZydisStaticString* reg = ZydisRegisterGetStaticString(operand->mem.base); - if (!reg) - { - return ZYDIS_STATUS_INVALID_PARAMETER; - } - ZYDIS_CHECK(ZydisStringAppendExStatic(string, reg, formatter->letterCase)); + ZYDIS_CHECK(formatter->funcPrintRegister(formatter, string, instruction, operand, + operand->mem.base, userData)); } if ((operand->mem.index != ZYDIS_REGISTER_NONE) && (operand->mem.type != ZYDIS_MEMOP_TYPE_MIB)) { - const ZydisStaticString* reg = ZydisRegisterGetStaticString(operand->mem.index); - if (!reg) - { - return ZYDIS_STATUS_INVALID_PARAMETER; - } if (operand->mem.base != ZYDIS_REGISTER_NONE) { ZYDIS_CHECK(ZydisStringAppendC(string, "+")); } - ZYDIS_CHECK(ZydisStringAppendExStatic(string, reg, formatter->letterCase)); + ZYDIS_CHECK(formatter->funcPrintRegister(formatter, string, instruction, operand, + operand->mem.index, userData)); if (operand->mem.scale) { ZYDIS_CHECK(ZydisStringAppendC(string, "*")); ZYDIS_CHECK(ZydisPrintDecU(string, operand->mem.scale, 0)); } } - ZYDIS_CHECK(formatter->funcPrintDisplacement(formatter, string, instruction, operand, - userData)); + ZYDIS_CHECK(formatter->funcPrintDisp(formatter, string, instruction, operand, userData)); } return ZydisStringAppendC(string, "]"); @@ -225,9 +311,10 @@ static ZydisStatus ZydisFormatOperandMemIntel(const ZydisFormatter* formatter, Z static ZydisStatus ZydisFormatOperandPtrIntel(const ZydisFormatter* formatter, ZydisString* string, const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, void* userData) { + ZYDIS_UNUSED_PARAMETER(instruction); ZYDIS_UNUSED_PARAMETER(userData); - if (!formatter || !instruction || !operand) + if (!formatter || !operand) { return ZYDIS_STATUS_INVALID_PARAMETER; } @@ -251,7 +338,7 @@ static ZydisStatus ZydisFormatOperandImmIntel(const ZydisFormatter* formatter, Z if (operand->imm.isRelative) { ZydisBool printSignedHEX = ZYDIS_FALSE; - switch (formatter->addressFormat) + switch (formatter->formatAddress) { case ZYDIS_ADDR_FORMAT_ABSOLUTE: { @@ -281,18 +368,65 @@ static ZydisStatus ZydisFormatOperandImmIntel(const ZydisFormatter* formatter, Z } // The immediate operand contains an actual ordinal value - return formatter->funcPrintImmediate(formatter, string, instruction, operand, userData); + return formatter->funcPrintImm(formatter, string, instruction, operand, userData); } /* ---------------------------------------------------------------------------------------------- */ -static ZydisStatus ZydisPrintAddressIntel(const ZydisFormatter* formatter, ZydisString* string, - const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, - ZydisU64 address, void* userData) +static ZydisStatus ZydisPrintMnemonicIntel(const ZydisFormatter* formatter, ZydisString* string, + const ZydisDecodedInstruction* instruction, void* userData) { ZYDIS_UNUSED_PARAMETER(userData); - if (!formatter || !instruction || !operand) + if (!formatter || !instruction) + { + return ZYDIS_STATUS_INVALID_PARAMETER; + } + + const ZydisStaticString* mnemonic = ZydisMnemonicGetStaticString(instruction->mnemonic); + if (!mnemonic) + { + return ZydisStringAppendExC(string, "invalid", formatter->letterCase); + } + ZYDIS_CHECK(ZydisStringAppendExStatic(string, mnemonic, formatter->letterCase)); + + if (instruction->attributes & ZYDIS_ATTRIB_IS_FAR_BRANCH) + { + return ZydisStringAppendExC(string, " far", formatter->letterCase); + } + + return ZYDIS_STATUS_SUCCESS; +} + +static ZydisStatus ZydisPrintRegisterIntel(const ZydisFormatter* formatter, ZydisString* string, + const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, + ZydisRegister reg, void* userData) +{ + ZYDIS_UNUSED_PARAMETER(instruction); + ZYDIS_UNUSED_PARAMETER(operand); + ZYDIS_UNUSED_PARAMETER(userData); + + if (!formatter) + { + return ZYDIS_STATUS_INVALID_PARAMETER; + } + + const ZydisStaticString* str = ZydisRegisterGetStaticString(reg); + if (!str) + { + return ZydisStringAppendExC(string, "invalid", formatter->letterCase); + } + return ZydisStringAppendExStatic(string, str, formatter->letterCase); +} + +static ZydisStatus ZydisPrintAddrIntel(const ZydisFormatter* formatter, ZydisString* string, + const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, + ZydisU64 address, void* userData) +{ + ZYDIS_UNUSED_PARAMETER(operand); + ZYDIS_UNUSED_PARAMETER(userData); + + if (!formatter || !instruction) { return ZYDIS_STATUS_INVALID_PARAMETER; } @@ -313,12 +447,13 @@ static ZydisStatus ZydisPrintAddressIntel(const ZydisFormatter* formatter, Zydis } } -static ZydisStatus ZydisPrintDisplacementIntel(const ZydisFormatter* formatter, ZydisString* string, +static ZydisStatus ZydisPrintDispIntel(const ZydisFormatter* formatter, ZydisString* string, const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, void* userData) { + ZYDIS_UNUSED_PARAMETER(instruction); ZYDIS_UNUSED_PARAMETER(userData); - if (!formatter || !instruction || !operand) + if (!formatter || !operand) { return ZYDIS_STATUS_INVALID_PARAMETER; } @@ -327,29 +462,26 @@ static ZydisStatus ZydisPrintDisplacementIntel(const ZydisFormatter* formatter, ((operand->mem.base == ZYDIS_REGISTER_NONE) && (operand->mem.index == ZYDIS_REGISTER_NONE)))) { - const ZydisBool printSignedHEX = - (formatter->displacementFormat != ZYDIS_DISP_FORMAT_HEX_UNSIGNED); + const ZydisBool printSignedHEX = (formatter->formatDisp != ZYDIS_DISP_FORMAT_HEX_UNSIGNED); if (printSignedHEX && (operand->mem.disp.value < 0) && ( (operand->mem.base != ZYDIS_REGISTER_NONE) || (operand->mem.index != ZYDIS_REGISTER_NONE))) { - return ZydisPrintHexS(string, operand->mem.disp.value, - formatter->hexPaddingDisplacement, formatter->hexUppercase, formatter->hexPrefix, - formatter->hexSuffix); + return ZydisPrintHexS(string, operand->mem.disp.value, formatter->hexPaddingDisp, + formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); } if ((operand->mem.base != ZYDIS_REGISTER_NONE) || (operand->mem.index != ZYDIS_REGISTER_NONE)) { ZYDIS_CHECK(ZydisStringAppendC(string, "+")); } - return ZydisPrintHexU(string, (ZydisU64)operand->mem.disp.value, - formatter->hexPaddingDisplacement, formatter->hexUppercase, formatter->hexPrefix, - formatter->hexSuffix); + return ZydisPrintHexU(string, (ZydisU64)operand->mem.disp.value, formatter->hexPaddingDisp, + formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); } return ZYDIS_STATUS_SUCCESS; } -static ZydisStatus ZydisPrintImmediateIntel(const ZydisFormatter* formatter, ZydisString* string, +static ZydisStatus ZydisPrintImmIntel(const ZydisFormatter* formatter, ZydisString* string, const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, void* userData) { ZYDIS_UNUSED_PARAMETER(userData); @@ -359,8 +491,8 @@ static ZydisStatus ZydisPrintImmediateIntel(const ZydisFormatter* formatter, Zyd return ZYDIS_STATUS_INVALID_PARAMETER; } - ZydisBool printSignedHEX = (formatter->immediateFormat == ZYDIS_IMM_FORMAT_HEX_SIGNED); - if (formatter->immediateFormat == ZYDIS_IMM_FORMAT_HEX_AUTO) + ZydisBool printSignedHEX = (formatter->formatImm == ZYDIS_IMM_FORMAT_HEX_SIGNED); + if (formatter->formatImm == ZYDIS_IMM_FORMAT_HEX_AUTO) { printSignedHEX = operand->imm.isSigned; } @@ -370,21 +502,17 @@ static ZydisStatus ZydisPrintImmediateIntel(const ZydisFormatter* formatter, Zyd switch (operand->size) { case 8: - return ZydisPrintHexS(string, (ZydisI8)operand->imm.value.s, - formatter->hexPaddingImmediate, formatter->hexUppercase, formatter->hexPrefix, - formatter->hexSuffix); + return ZydisPrintHexS(string, (ZydisI8)operand->imm.value.s, formatter->formatImm, + formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); case 16: - return ZydisPrintHexS(string, (ZydisI16)operand->imm.value.s, - formatter->hexPaddingImmediate, formatter->hexUppercase, formatter->hexPrefix, - formatter->hexSuffix); + return ZydisPrintHexS(string, (ZydisI16)operand->imm.value.s, formatter->formatImm, + formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); case 32: - return ZydisPrintHexS(string, (ZydisI32)operand->imm.value.s, - formatter->hexPaddingImmediate, formatter->hexUppercase, formatter->hexPrefix, - formatter->hexSuffix); + return ZydisPrintHexS(string, (ZydisI32)operand->imm.value.s, formatter->formatImm, + formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); case 64: - return ZydisPrintHexS(string, operand->imm.value.s, - formatter->hexPaddingImmediate, formatter->hexUppercase, formatter->hexPrefix, - formatter->hexSuffix); + return ZydisPrintHexS(string, operand->imm.value.s, formatter->formatImm, + formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); default: return ZYDIS_STATUS_INVALID_PARAMETER; } @@ -392,29 +520,23 @@ static ZydisStatus ZydisPrintImmediateIntel(const ZydisFormatter* formatter, Zyd switch (instruction->operandWidth) { case 8: - return ZydisPrintHexU(string, (ZydisU8)operand->imm.value.u, - formatter->hexPaddingImmediate, formatter->hexUppercase, formatter->hexPrefix, - formatter->hexSuffix); + return ZydisPrintHexU(string, (ZydisU8)operand->imm.value.u, formatter->formatImm, + formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); case 16: - return ZydisPrintHexU(string, (ZydisU16)operand->imm.value.u, - formatter->hexPaddingImmediate, formatter->hexUppercase, formatter->hexPrefix, - formatter->hexSuffix); + return ZydisPrintHexU(string, (ZydisU16)operand->imm.value.u, formatter->formatImm, + formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); case 32: - return ZydisPrintHexU(string, (ZydisU32)operand->imm.value.u, - formatter->hexPaddingImmediate, formatter->hexUppercase, formatter->hexPrefix, - formatter->hexSuffix); + return ZydisPrintHexU(string, (ZydisU32)operand->imm.value.u, formatter->formatImm, + formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); case 64: - return ZydisPrintHexU(string, operand->imm.value.u, - formatter->hexPaddingImmediate, formatter->hexUppercase, formatter->hexPrefix, - formatter->hexSuffix); + return ZydisPrintHexU(string, operand->imm.value.u, formatter->formatImm, + formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); default: return ZYDIS_STATUS_INVALID_PARAMETER; } } -/* ---------------------------------------------------------------------------------------------- */ - -static ZydisStatus ZydisPrintOperandSizeIntel(const ZydisFormatter* formatter, ZydisString* string, +static ZydisStatus ZydisPrintMemSizeIntel(const ZydisFormatter* formatter, ZydisString* string, const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, void* userData) { ZYDIS_UNUSED_PARAMETER(userData); @@ -427,7 +549,7 @@ static ZydisStatus ZydisPrintOperandSizeIntel(const ZydisFormatter* formatter, Z // TODO: refactor ZydisU32 typecast = 0; - if (formatter->forceOperandSize) + if (formatter->forceMemorySize) { if ((operand->type == ZYDIS_OPERAND_TYPE_MEMORY) && (operand->mem.type == ZYDIS_MEMOP_TYPE_MEM)) @@ -521,57 +643,58 @@ static ZydisStatus ZydisPrintOperandSizeIntel(const ZydisFormatter* formatter, Z return ZYDIS_STATUS_SUCCESS; } -static ZydisStatus ZydisPrintSegmentIntel(const ZydisFormatter* formatter, ZydisString* string, - const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, void* userData) +/* ---------------------------------------------------------------------------------------------- */ + +static ZydisStatus ZydisPrintPrefixesIntel(const ZydisFormatter* formatter, ZydisString* string, + const ZydisDecodedInstruction* instruction, void* userData) { ZYDIS_UNUSED_PARAMETER(userData); - if (!formatter || !instruction || !operand) + if (!formatter || !instruction) { return ZYDIS_STATUS_INVALID_PARAMETER; } - switch (operand->mem.segment) + if (instruction->attributes & ZYDIS_ATTRIB_HAS_LOCK) { - case ZYDIS_REGISTER_ES: - case ZYDIS_REGISTER_CS: - case ZYDIS_REGISTER_FS: - case ZYDIS_REGISTER_GS: - ZYDIS_CHECK(ZydisStringAppendExStatic(string, - ZydisRegisterGetStaticString(operand->mem.segment), formatter->letterCase)); - return ZydisStringAppendC(string, ":"); - case ZYDIS_REGISTER_SS: - if ((formatter->forceSegments) || - (instruction->attributes & ZYDIS_ATTRIB_HAS_SEGMENT_SS)) - { - ZYDIS_CHECK(ZydisStringAppendExStatic(string, - ZydisRegisterGetStaticString(operand->mem.segment), formatter->letterCase)); - return ZydisStringAppendC(string, ":"); - } - break; - case ZYDIS_REGISTER_DS: - if ((formatter->forceSegments) || - (instruction->attributes & ZYDIS_ATTRIB_HAS_SEGMENT_DS)) - { - ZYDIS_CHECK(ZydisStringAppendExStatic(string, - ZydisRegisterGetStaticString(operand->mem.segment), formatter->letterCase)); - return ZydisStringAppendC(string, ":"); - } - break; - default: - break; + return ZydisStringAppendExC(string, "lock ", formatter->letterCase); } - return ZYDIS_STATUS_SUCCESS; + if (instruction->attributes & ZYDIS_ATTRIB_HAS_REP) + { + return ZydisStringAppendExC(string, "rep ", formatter->letterCase); + } + if (instruction->attributes & ZYDIS_ATTRIB_HAS_REPE) + { + return ZydisStringAppendExC(string, "repe ", formatter->letterCase); + } + if (instruction->attributes & ZYDIS_ATTRIB_HAS_REPNE) + { + return ZydisStringAppendExC(string, "repne ", formatter->letterCase); + } + + if (instruction->attributes & ZYDIS_ATTRIB_HAS_BOUND) + { + return ZydisStringAppendExC(string, "bnd ", formatter->letterCase); + } + + if (instruction->attributes & ZYDIS_ATTRIB_HAS_XACQUIRE) + { + return ZydisStringAppendExC(string, "xacquire ", formatter->letterCase); + } + if (instruction->attributes & ZYDIS_ATTRIB_HAS_XRELEASE) + { + return ZydisStringAppendExC(string, "xrelease ", formatter->letterCase); + } + + return ZYDIS_STATUS_SUCCESS; } static ZydisStatus ZydisPrintDecoratorIntel(const ZydisFormatter* formatter, ZydisString* string, const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand, ZydisDecoratorType type, void* userData) { - ZYDIS_UNUSED_PARAMETER(userData); - - if (!formatter || !instruction || !operand) + if (!formatter || !instruction) { return ZYDIS_STATUS_INVALID_PARAMETER; } @@ -582,13 +705,9 @@ static ZydisStatus ZydisPrintDecoratorIntel(const ZydisFormatter* formatter, Zyd { if (instruction->avx.mask.reg != ZYDIS_REGISTER_K0) { - const ZydisStaticString* reg = ZydisRegisterGetStaticString(instruction->avx.mask.reg); - if (!reg) - { - return ZYDIS_STATUS_INVALID_PARAMETER; - } ZYDIS_CHECK(ZydisStringAppendC(string, " {")); - ZYDIS_CHECK(ZydisStringAppendExStatic(string, reg, formatter->letterCase)); + ZYDIS_CHECK(formatter->funcPrintRegister(formatter, string, instruction, operand, + instruction->avx.mask.reg, userData)); ZYDIS_CHECK(ZydisStringAppendC(string, "}")); if (instruction->avx.mask.mode == ZYDIS_MASK_MODE_ZERO) { @@ -597,7 +716,7 @@ static ZydisStatus ZydisPrintDecoratorIntel(const ZydisFormatter* formatter, Zyd } break; } - case ZYDIS_DECORATOR_TYPE_BROADCAST: + case ZYDIS_DECORATOR_TYPE_BC: if (!instruction->avx.broadcast.isStatic) { switch (instruction->avx.broadcast.mode) @@ -627,7 +746,7 @@ static ZydisStatus ZydisPrintDecoratorIntel(const ZydisFormatter* formatter, Zyd } } break; - case ZYDIS_DECORATOR_TYPE_ROUNDING_CONTROL: + case ZYDIS_DECORATOR_TYPE_RC: if (instruction->avx.hasSAE) { switch (instruction->avx.rounding.mode) @@ -734,7 +853,7 @@ static ZydisStatus ZydisPrintDecoratorIntel(const ZydisFormatter* formatter, Zyd return ZYDIS_STATUS_INVALID_PARAMETER; } break; - case ZYDIS_DECORATOR_TYPE_EVICTION_HINT: + case ZYDIS_DECORATOR_TYPE_EH: if (instruction->avx.hasEvictionHint) { ZYDIS_CHECK(ZydisStringAppendC(string, " {eh}")); @@ -747,117 +866,6 @@ static ZydisStatus ZydisPrintDecoratorIntel(const ZydisFormatter* formatter, Zyd return ZYDIS_STATUS_SUCCESS; } -static ZydisStatus ZydisFormatInstrIntel(const ZydisFormatter* formatter, ZydisString* string, - const ZydisDecodedInstruction* instruction, void* userData) -{ - if (!formatter || !string || !instruction) - { - return ZYDIS_STATUS_INVALID_PARAMETER; - } - - ZYDIS_CHECK(formatter->funcPrintPrefixes(formatter, string, instruction, userData)); - ZYDIS_CHECK(formatter->funcPrintMnemonic(formatter, string, instruction, userData)); - - for (ZydisU8 i = 0; i < instruction->operandCount; ++i) - { - if (instruction->operands[i].visibility == ZYDIS_OPERAND_VISIBILITY_HIDDEN) - { - break; - } - - const ZydisUSize strLenRestore = string->length; - if (i == 0) - { - ZYDIS_CHECK(ZydisStringAppendC(string, " ")); - } else - { - ZYDIS_CHECK(ZydisStringAppendC(string, ", ")); - } - - const ZydisUSize strLenPreOperand = string->length; - switch (instruction->operands[i].type) - { - case ZYDIS_OPERAND_TYPE_REGISTER: - ZYDIS_CHECK(formatter->funcFormatOperandReg(formatter, string, instruction, - &instruction->operands[i], userData)); - break; - case ZYDIS_OPERAND_TYPE_MEMORY: - { - ZYDIS_CHECK(formatter->funcPrintOperandSize(formatter, string, instruction, - &instruction->operands[i], userData)); - ZYDIS_CHECK(formatter->funcPrintSegment(formatter, string, instruction, - &instruction->operands[i], userData)); - const ZydisUSize strLenTemp = string->length; - ZYDIS_CHECK(formatter->funcFormatOperandMem(formatter, string, instruction, - &instruction->operands[i], userData)); - if (strLenTemp == string->length) - { - string->length = strLenPreOperand; - } - break; - } - case ZYDIS_OPERAND_TYPE_POINTER: - ZYDIS_CHECK(formatter->funcFormatOperandPtr(formatter, string, instruction, - &instruction->operands[i], userData)); - break; - case ZYDIS_OPERAND_TYPE_IMMEDIATE: - ZYDIS_CHECK(formatter->funcFormatOperandImm(formatter, string, instruction, - &instruction->operands[i], userData)); - break; - default: - return ZYDIS_STATUS_INVALID_PARAMETER; - } - - if (strLenPreOperand == string->length) - { - // Omit whole operand, if the string did not change during the formatting-callback - string->length = strLenRestore; - continue; - } - - if ((instruction->encoding == ZYDIS_INSTRUCTION_ENCODING_EVEX) || - (instruction->encoding == ZYDIS_INSTRUCTION_ENCODING_MVEX)) - { - if ((i == 0) && - (instruction->operands[i + 1].encoding == ZYDIS_OPERAND_ENCODING_MASK)) - { - ZYDIS_CHECK(formatter->funcPrintDecorator(formatter, string, instruction, - &instruction->operands[i], ZYDIS_DECORATOR_TYPE_MASK, userData)); - } - if (instruction->operands[i].type == ZYDIS_OPERAND_TYPE_MEMORY) - { - ZYDIS_CHECK(formatter->funcPrintDecorator(formatter, string, instruction, - &instruction->operands[i], ZYDIS_DECORATOR_TYPE_BROADCAST, userData)); - if (instruction->encoding == ZYDIS_INSTRUCTION_ENCODING_MVEX) - { - ZYDIS_CHECK(formatter->funcPrintDecorator(formatter, string, instruction, - &instruction->operands[i], ZYDIS_DECORATOR_TYPE_CONVERSION, userData)); - ZYDIS_CHECK(formatter->funcPrintDecorator(formatter, string, instruction, - &instruction->operands[i], ZYDIS_DECORATOR_TYPE_EVICTION_HINT, userData)); - } - } else - { - if ((i == (instruction->operandCount - 1)) || - (instruction->operands[i + 1].type == ZYDIS_OPERAND_TYPE_IMMEDIATE)) - { - if (instruction->encoding == ZYDIS_INSTRUCTION_ENCODING_MVEX) - { - ZYDIS_CHECK(formatter->funcPrintDecorator(formatter, string, instruction, - &instruction->operands[i], ZYDIS_DECORATOR_TYPE_SWIZZLE, userData)); - } - ZYDIS_CHECK(formatter->funcPrintDecorator(formatter, string, instruction, - &instruction->operands[i], ZYDIS_DECORATOR_TYPE_ROUNDING_CONTROL, - userData)); - ZYDIS_CHECK(formatter->funcPrintDecorator(formatter, string, instruction, - &instruction->operands[i], ZYDIS_DECORATOR_TYPE_SAE, userData)); - } - } - } - } - - return ZYDIS_STATUS_SUCCESS; -} - /* ---------------------------------------------------------------------------------------------- */ /* ============================================================================================== */ @@ -875,34 +883,34 @@ ZydisStatus ZydisFormatterInit(ZydisFormatter* formatter, ZydisFormatterStyle st ZydisMemorySet(formatter, 0, sizeof(ZydisFormatter)); formatter->letterCase = ZYDIS_LETTER_CASE_DEFAULT; - formatter->forceSegments = ZYDIS_FALSE; - formatter->forceOperandSize = ZYDIS_FALSE; - formatter->addressFormat = ZYDIS_ADDR_FORMAT_ABSOLUTE; - formatter->displacementFormat = ZYDIS_DISP_FORMAT_HEX_SIGNED; - formatter->immediateFormat = ZYDIS_IMM_FORMAT_HEX_UNSIGNED; + formatter->forceMemorySegment = ZYDIS_FALSE; + formatter->forceMemorySize = ZYDIS_FALSE; + formatter->formatAddress = ZYDIS_ADDR_FORMAT_ABSOLUTE; + formatter->formatDisp = ZYDIS_DISP_FORMAT_HEX_SIGNED; + formatter->formatImm = ZYDIS_IMM_FORMAT_HEX_UNSIGNED; formatter->hexUppercase = ZYDIS_TRUE; formatter->hexPrefix = &hexPrefixDefault; formatter->hexSuffix = ZYDIS_NULL; formatter->hexPaddingAddress = 2; - formatter->hexPaddingDisplacement = 2; - formatter->hexPaddingImmediate = 2; + formatter->hexPaddingDisp = 2; + formatter->hexPaddingImm = 2; switch (style) { case ZYDIS_FORMATTER_STYLE_INTEL: formatter->funcFormatInstruction = &ZydisFormatInstrIntel; - formatter->funcPrintPrefixes = &ZydisPrintPrefixesIntel; - formatter->funcPrintMnemonic = &ZydisPrintMnemonicIntel; formatter->funcFormatOperandReg = &ZydisFormatOperandRegIntel; formatter->funcFormatOperandMem = &ZydisFormatOperandMemIntel; formatter->funcFormatOperandPtr = &ZydisFormatOperandPtrIntel; - formatter->funcFormatOperandImm = &ZydisFormatOperandImmIntel; - formatter->funcPrintOperandSize = &ZydisPrintOperandSizeIntel; - formatter->funcPrintSegment = &ZydisPrintSegmentIntel; + formatter->funcFormatOperandImm = &ZydisFormatOperandImmIntel; + formatter->funcPrintMnemonic = &ZydisPrintMnemonicIntel; + formatter->funcPrintRegister = &ZydisPrintRegisterIntel; + formatter->funcPrintAddress = &ZydisPrintAddrIntel; + formatter->funcPrintDisp = &ZydisPrintDispIntel; + formatter->funcPrintImm = &ZydisPrintImmIntel; + formatter->funcPrintMemSize = &ZydisPrintMemSizeIntel; + formatter->funcPrintPrefixes = &ZydisPrintPrefixesIntel; formatter->funcPrintDecorator = &ZydisPrintDecoratorIntel; - formatter->funcPrintAddress = &ZydisPrintAddressIntel; - formatter->funcPrintDisplacement = &ZydisPrintDisplacementIntel; - formatter->funcPrintImmediate = &ZydisPrintImmediateIntel; break; default: return ZYDIS_STATUS_INVALID_PARAMETER; @@ -912,7 +920,7 @@ ZydisStatus ZydisFormatterInit(ZydisFormatter* formatter, ZydisFormatterStyle st } ZydisStatus ZydisFormatterSetProperty(ZydisFormatter* formatter, - ZydisFormatterProperty property, ZydisUSize value) + ZydisFormatterProperty property, ZydisUPointer value) { if (!formatter) { @@ -924,32 +932,32 @@ ZydisStatus ZydisFormatterSetProperty(ZydisFormatter* formatter, case ZYDIS_FORMATTER_PROP_UPPERCASE: formatter->letterCase = (value) ? ZYDIS_LETTER_CASE_UPPER : ZYDIS_LETTER_CASE_DEFAULT; break; - case ZYDIS_FORMATTER_PROP_FORCE_SEGMENTS: - formatter->forceSegments = (value) ? ZYDIS_TRUE : ZYDIS_FALSE; + case ZYDIS_FORMATTER_PROP_FORCE_MEMSEG: + formatter->forceMemorySegment = (value) ? ZYDIS_TRUE : ZYDIS_FALSE; break; - case ZYDIS_FORMATTER_PROP_FORCE_OPERANDSIZE: - formatter->forceOperandSize = (value) ? ZYDIS_TRUE : ZYDIS_FALSE; + case ZYDIS_FORMATTER_PROP_FORCE_MEMSIZE: + formatter->forceMemorySize = (value) ? ZYDIS_TRUE : ZYDIS_FALSE; break; case ZYDIS_FORMATTER_PROP_ADDR_FORMAT: if (value > ZYDIS_ADDR_FORMAT_MAX_VALUE) { return ZYDIS_STATUS_INVALID_PARAMETER; } - formatter->addressFormat = (ZydisU8)value; + formatter->formatAddress = (ZydisU8)value; break; case ZYDIS_FORMATTER_PROP_DISP_FORMAT: if (value > ZYDIS_DISP_FORMAT_MAX_VALUE) { return ZYDIS_STATUS_INVALID_PARAMETER; } - formatter->displacementFormat = (ZydisU8)value; + formatter->formatDisp = (ZydisU8)value; break; case ZYDIS_FORMATTER_PROP_IMM_FORMAT: if (value > ZYDIS_IMM_FORMAT_MAX_VALUE) { return ZYDIS_STATUS_INVALID_PARAMETER; } - formatter->immediateFormat = (ZydisU8)value; + formatter->formatImm = (ZydisU8)value; break; case ZYDIS_FORMATTER_PROP_HEX_UPPERCASE: formatter->hexUppercase = (value) ? ZYDIS_TRUE : ZYDIS_FALSE; @@ -980,14 +988,14 @@ ZydisStatus ZydisFormatterSetProperty(ZydisFormatter* formatter, { return ZYDIS_STATUS_INVALID_PARAMETER; } - formatter->hexPaddingDisplacement = (ZydisU8)value; + formatter->hexPaddingDisp = (ZydisU8)value; break; case ZYDIS_FORMATTER_PROP_HEX_PADDING_IMM: if (value > 20) { return ZYDIS_STATUS_INVALID_PARAMETER; } - formatter->hexPaddingImmediate = (ZydisU8)value; + formatter->hexPaddingImm = (ZydisU8)value; break; default: return ZYDIS_STATUS_INVALID_PARAMETER; @@ -1009,21 +1017,21 @@ ZydisStatus ZydisFormatterSetHook(ZydisFormatter* formatter, ZydisFormatterHookT // Backup the function-pointer switch (hook) { - case ZYDIS_FORMATTER_HOOK_PRE: - *callback = *(const void**)&formatter->funcPre; + case ZYDIS_FORMATTER_HOOK_PRE_INSTRUCTION: + *callback = *(const void**)&formatter->funcPreInstruction; break; - case ZYDIS_FORMATTER_HOOK_POST: - *callback = *(const void**)&formatter->funcPost; + case ZYDIS_FORMATTER_HOOK_POST_INSTRUCTION: + *callback = *(const void**)&formatter->funcPostInstruction; + break; + case ZYDIS_FORMATTER_HOOK_PRE_OPERAND: + *callback = *(const void**)&formatter->funcPreOperand; + break; + case ZYDIS_FORMATTER_HOOK_POST_OPERAND: + *callback = *(const void**)&formatter->funcPostOperand; break; case ZYDIS_FORMATTER_HOOK_FORMAT_INSTRUCTION: *callback = *(const void**)&formatter->funcFormatInstruction; break; - case ZYDIS_FORMATTER_HOOK_PRINT_PREFIXES: - *callback = *(const void**)&formatter->funcPrintPrefixes; - break; - case ZYDIS_FORMATTER_HOOK_PRINT_MNEMONIC: - *callback = *(const void**)&formatter->funcPrintMnemonic; - break; case ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_REG: *callback = *(const void**)&formatter->funcFormatOperandReg; break; @@ -1036,23 +1044,29 @@ ZydisStatus ZydisFormatterSetHook(ZydisFormatter* formatter, ZydisFormatterHookT case ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_IMM: *callback = *(const void**)&formatter->funcFormatOperandImm; break; - case ZYDIS_FORMATTER_HOOK_PRINT_OPERANDSIZE: - *callback = *(const void**)&formatter->funcPrintOperandSize; + case ZYDIS_FORMATTER_HOOK_PRINT_MNEMONIC: + *callback = *(const void**)&formatter->funcPrintMnemonic; break; - case ZYDIS_FORMATTER_HOOK_PRINT_SEGMENT: - *callback = *(const void**)&formatter->funcPrintSegment; - break; - case ZYDIS_FORMATTER_HOOK_PRINT_DECORATOR: - *callback = *(const void**)&formatter->funcPrintDecorator; + case ZYDIS_FORMATTER_HOOK_PRINT_REGISTER: + *callback = *(const void**)&formatter->funcPrintRegister; break; case ZYDIS_FORMATTER_HOOK_PRINT_ADDRESS: *callback = *(const void**)&formatter->funcPrintAddress; break; - case ZYDIS_FORMATTER_HOOK_PRINT_DISPLACEMENT: - *callback = *(const void**)&formatter->funcPrintDisplacement; + case ZYDIS_FORMATTER_HOOK_PRINT_DISP: + *callback = *(const void**)&formatter->funcPrintDisp; break; - case ZYDIS_FORMATTER_HOOK_PRINT_IMMEDIATE: - *callback = *(const void**)&formatter->funcPrintImmediate; + case ZYDIS_FORMATTER_HOOK_PRINT_IMM: + *callback = *(const void**)&formatter->funcPrintImm; + break; + case ZYDIS_FORMATTER_HOOK_PRINT_MEMSIZE: + *callback = *(const void**)&formatter->funcPrintMemSize; + break; + case ZYDIS_FORMATTER_HOOK_PRINT_PREFIXES: + *callback = *(const void**)&formatter->funcPrintPrefixes; + break; + case ZYDIS_FORMATTER_HOOK_PRINT_DECORATOR: + *callback = *(const void**)&formatter->funcPrintDecorator; break; default: return ZYDIS_STATUS_INVALID_PARAMETER; @@ -1067,50 +1081,56 @@ ZydisStatus ZydisFormatterSetHook(ZydisFormatter* formatter, ZydisFormatterHookT // Replace the function-pointer switch (hook) { - case ZYDIS_FORMATTER_HOOK_PRE: - formatter->funcPre = *(ZydisFormatterNotifyFunc*)&temp; + case ZYDIS_FORMATTER_HOOK_PRE_INSTRUCTION: + formatter->funcPreInstruction = *(ZydisFormatterFunc*)&temp; break; - case ZYDIS_FORMATTER_HOOK_POST: - formatter->funcPost = *(ZydisFormatterNotifyFunc*)&temp; + case ZYDIS_FORMATTER_HOOK_POST_INSTRUCTION: + formatter->funcPostInstruction = *(ZydisFormatterFunc*)&temp; + break; + case ZYDIS_FORMATTER_HOOK_PRE_OPERAND: + formatter->funcPreOperand = *(ZydisFormatterOperandFunc*)&temp; + break; + case ZYDIS_FORMATTER_HOOK_POST_OPERAND: + formatter->funcPostOperand = *(ZydisFormatterOperandFunc*)&temp; break; case ZYDIS_FORMATTER_HOOK_FORMAT_INSTRUCTION: - formatter->funcFormatInstruction = *(ZydisFormatterFormatFunc*)&temp; - break; - case ZYDIS_FORMATTER_HOOK_PRINT_PREFIXES: - formatter->funcPrintPrefixes = *(ZydisFormatterFormatFunc*)&temp; - break; - case ZYDIS_FORMATTER_HOOK_PRINT_MNEMONIC: - formatter->funcPrintMnemonic = *(ZydisFormatterFormatFunc*)&temp; + formatter->funcFormatInstruction = *(ZydisFormatterFunc*)&temp; break; case ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_REG: - formatter->funcFormatOperandReg = *(ZydisFormatterFormatOperandFunc*)&temp; + formatter->funcFormatOperandReg = *(ZydisFormatterOperandFunc*)&temp; break; case ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_MEM: - formatter->funcFormatOperandMem = *(ZydisFormatterFormatOperandFunc*)&temp; + formatter->funcFormatOperandMem = *(ZydisFormatterOperandFunc*)&temp; break; case ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_PTR: - formatter->funcFormatOperandPtr = *(ZydisFormatterFormatOperandFunc*)&temp; + formatter->funcFormatOperandPtr = *(ZydisFormatterOperandFunc*)&temp; break; case ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_IMM: - formatter->funcFormatOperandImm = *(ZydisFormatterFormatOperandFunc*)&temp; + formatter->funcFormatOperandImm = *(ZydisFormatterOperandFunc*)&temp; break; - case ZYDIS_FORMATTER_HOOK_PRINT_OPERANDSIZE: - formatter->funcPrintOperandSize = *(ZydisFormatterFormatOperandFunc*)&temp; + case ZYDIS_FORMATTER_HOOK_PRINT_MNEMONIC: + formatter->funcPrintMnemonic = *(ZydisFormatterFunc*)&temp; break; - case ZYDIS_FORMATTER_HOOK_PRINT_SEGMENT: - formatter->funcPrintSegment = *(ZydisFormatterFormatOperandFunc*)&temp; - break; - case ZYDIS_FORMATTER_HOOK_PRINT_DECORATOR: - formatter->funcPrintDecorator = *(ZydisFormatterFormatDecoratorFunc*)&temp; + case ZYDIS_FORMATTER_HOOK_PRINT_REGISTER: + formatter->funcPrintRegister = *(ZydisFormatterRegisterFunc*)&temp; break; case ZYDIS_FORMATTER_HOOK_PRINT_ADDRESS: - formatter->funcPrintAddress = *(ZydisFormatterFormatAddressFunc*)&temp; + formatter->funcPrintAddress = *(ZydisFormatterAddressFunc*)&temp; break; - case ZYDIS_FORMATTER_HOOK_PRINT_DISPLACEMENT: - formatter->funcPrintDisplacement = *(ZydisFormatterFormatOperandFunc*)&temp; + case ZYDIS_FORMATTER_HOOK_PRINT_DISP: + formatter->funcPrintDisp = *(ZydisFormatterOperandFunc*)&temp; break; - case ZYDIS_FORMATTER_HOOK_PRINT_IMMEDIATE: - formatter->funcPrintImmediate = *(ZydisFormatterFormatOperandFunc*)&temp; + case ZYDIS_FORMATTER_HOOK_PRINT_IMM: + formatter->funcPrintImm = *(ZydisFormatterOperandFunc*)&temp; + break; + case ZYDIS_FORMATTER_HOOK_PRINT_MEMSIZE: + formatter->funcPrintMemSize = *(ZydisFormatterOperandFunc*)&temp; + break; + case ZYDIS_FORMATTER_HOOK_PRINT_PREFIXES: + formatter->funcPrintPrefixes = *(ZydisFormatterFunc*)&temp; + break; + case ZYDIS_FORMATTER_HOOK_PRINT_DECORATOR: + formatter->funcPrintDecorator = *(ZydisFormatterDecoratorFunc*)&temp; break; default: return ZYDIS_STATUS_INVALID_PARAMETER; diff --git a/src/MetaInfo.c b/src/MetaInfo.c index 853e9c8..1b8281e 100644 --- a/src/MetaInfo.c +++ b/src/MetaInfo.c @@ -40,7 +40,7 @@ const char* ZydisCategoryGetString(ZydisInstructionCategory category) { - if (category > ZYDIS_ARRAY_SIZE(zydisInstructionCategoryStrings) - 1) + if (category >= ZYDIS_ARRAY_SIZE(zydisInstructionCategoryStrings)) { return ZYDIS_NULL; } @@ -49,7 +49,7 @@ const char* ZydisCategoryGetString(ZydisInstructionCategory category) const char* ZydisISASetGetString(ZydisISASet isaSet) { - if (isaSet > ZYDIS_ARRAY_SIZE(zydisISASetStrings) - 1) + if (isaSet >= ZYDIS_ARRAY_SIZE(zydisISASetStrings)) { return ZYDIS_NULL; } @@ -58,7 +58,7 @@ const char* ZydisISASetGetString(ZydisISASet isaSet) const char* ZydisISAExtGetString(ZydisISAExt isaExt) { - if (isaExt > ZYDIS_ARRAY_SIZE(zydisISAExtStrings) - 1) + if (isaExt >= ZYDIS_ARRAY_SIZE(zydisISAExtStrings)) { return ZYDIS_NULL; } diff --git a/src/Mnemonic.c b/src/Mnemonic.c index 7fc56f8..fcacb14 100644 --- a/src/Mnemonic.c +++ b/src/Mnemonic.c @@ -33,7 +33,7 @@ const char* ZydisMnemonicGetString(ZydisMnemonic mnemonic) { - if (mnemonic > ZYDIS_ARRAY_SIZE(zydisMnemonicStrings) - 1) + if (mnemonic >= ZYDIS_ARRAY_SIZE(zydisMnemonicStrings)) { return ZYDIS_NULL; } @@ -42,7 +42,7 @@ const char* ZydisMnemonicGetString(ZydisMnemonic mnemonic) const ZydisStaticString* ZydisMnemonicGetStaticString(ZydisMnemonic mnemonic) { - if (mnemonic > ZYDIS_ARRAY_SIZE(zydisMnemonicStrings) - 1) + if (mnemonic >= ZYDIS_ARRAY_SIZE(zydisMnemonicStrings)) { return ZYDIS_NULL; } diff --git a/tools/ZydisDisasm.c b/tools/ZydisDisasm.c index b7289ca..e6a7f3a 100644 --- a/tools/ZydisDisasm.c +++ b/tools/ZydisDisasm.c @@ -69,9 +69,9 @@ int main(int argc, char** argv) ZydisFormatter formatter; if (!ZYDIS_SUCCESS(ZydisFormatterInit(&formatter, ZYDIS_FORMATTER_STYLE_INTEL)) || !ZYDIS_SUCCESS(ZydisFormatterSetProperty(&formatter, - ZYDIS_FORMATTER_PROP_FORCE_SEGMENTS, ZYDIS_TRUE)) || + ZYDIS_FORMATTER_PROP_FORCE_MEMSEG, ZYDIS_TRUE)) || !ZYDIS_SUCCESS(ZydisFormatterSetProperty(&formatter, - ZYDIS_FORMATTER_PROP_FORCE_OPERANDSIZE, ZYDIS_TRUE))) + ZYDIS_FORMATTER_PROP_FORCE_MEMSIZE, ZYDIS_TRUE))) { fputs("Failed to initialized instruction-formatter\n", stderr); return EXIT_FAILURE; diff --git a/tools/ZydisInfo.c b/tools/ZydisInfo.c index 78584cd..5c26a85 100644 --- a/tools/ZydisInfo.c +++ b/tools/ZydisInfo.c @@ -551,9 +551,9 @@ void printInstruction(ZydisDecodedInstruction* instruction) ZydisFormatter formatter; if (!ZYDIS_SUCCESS((status = ZydisFormatterInit(&formatter, ZYDIS_FORMATTER_STYLE_INTEL))) || !ZYDIS_SUCCESS((status = ZydisFormatterSetProperty(&formatter, - ZYDIS_FORMATTER_PROP_FORCE_SEGMENTS, ZYDIS_TRUE))) || + ZYDIS_FORMATTER_PROP_FORCE_MEMSEG, ZYDIS_TRUE))) || !ZYDIS_SUCCESS((status = ZydisFormatterSetProperty(&formatter, - ZYDIS_FORMATTER_PROP_FORCE_OPERANDSIZE, ZYDIS_TRUE)))) + ZYDIS_FORMATTER_PROP_FORCE_MEMSIZE, ZYDIS_TRUE)))) { fputs("Failed to initialize instruction-formatter\n", stderr); exit(status);