mirror of https://github.com/x64dbg/zydis
commit
4dd632463c
|
@ -12,9 +12,9 @@ project(Zydis VERSION 2.0)
|
|||
option(ZYDIS_FEATURE_DECODER
|
||||
"Enable instruction decoding and formtting functionality"
|
||||
ON)
|
||||
option(ZYDIS_FEATURE_ENCODER
|
||||
"Enable instruction encoding functionality"
|
||||
OFF)
|
||||
#option(ZYDIS_FEATURE_ENCODER
|
||||
# "Enable instruction encoding functionality"
|
||||
# OFF)
|
||||
option(ZYDIS_FEATURE_EVEX
|
||||
"Enable support for EVEX instructions"
|
||||
ON)
|
||||
|
@ -29,6 +29,9 @@ option(ZYDIS_FEATURE_CPUID
|
|||
OFF)
|
||||
|
||||
# Build configuration
|
||||
option(BUILD_SHARED_LIBS
|
||||
"Build shared libraries"
|
||||
OFF)
|
||||
option(ZYDIS_BUILD_EXAMPLES
|
||||
"Build examples"
|
||||
ON)
|
||||
|
@ -70,11 +73,11 @@ target_compile_definitions("Zydis" PRIVATE "_CRT_SECURE_NO_WARNINGS" "ZYDIS_EXPO
|
|||
generate_export_header("Zydis" BASE_NAME "ZYDIS" EXPORT_FILE_NAME "ZydisExportConfig.h")
|
||||
|
||||
if (NOT ZYDIS_FEATURE_ENCODER AND NOT ZYDIS_FEATURE_DECODER)
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"\nIt's dangerous to go alone! Take at least one of these:\n"
|
||||
"[ ] ZYDIS_FEATURE_ENCODER [ ] ZYDIS_FEATURE_DECODER"
|
||||
)
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"\nIt's dangerous to go alone! Take at least one of these:\n"
|
||||
"[ ] ZYDIS_FEATURE_ENCODER [ ] ZYDIS_FEATURE_DECODER"
|
||||
)
|
||||
endif ()
|
||||
|
||||
if (ZYDIS_FEATURE_EVEX)
|
||||
|
@ -92,14 +95,15 @@ endif ()
|
|||
if (ZYDIS_FEATURE_DECODER)
|
||||
target_compile_definitions("Zydis" PUBLIC "ZYDIS_ENABLE_FEATURE_DECODER")
|
||||
endif ()
|
||||
if (ZYDIS_FEATURE_ENCODER)
|
||||
target_compile_definitions("Zydis" PUBLIC "ZYDIS_ENABLE_FEATURE_ENCODER")
|
||||
endif ()
|
||||
#if (ZYDIS_FEATURE_ENCODER)
|
||||
# target_compile_definitions("Zydis" PUBLIC "ZYDIS_ENABLE_FEATURE_ENCODER")
|
||||
#endif ()
|
||||
|
||||
target_sources("Zydis"
|
||||
PUBLIC
|
||||
"${CMAKE_CURRENT_LIST_DIR}/include/Zydis/CommonTypes.h"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Defines.h"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/include/Zydis/MetaInfo.h"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Mnemonic.h"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Register.h"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/include/Zydis/SharedTypes.h"
|
||||
|
@ -107,6 +111,7 @@ target_sources("Zydis"
|
|||
"${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Utils.h"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Zydis.h"
|
||||
PRIVATE
|
||||
"src/MetaInfo.c"
|
||||
"src/Mnemonic.c"
|
||||
"src/Register.c"
|
||||
"src/SharedData.h"
|
||||
|
@ -122,20 +127,22 @@ 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/Formatter.c"
|
||||
"src/FormatHelper.c")
|
||||
endif ()
|
||||
|
||||
if (ZYDIS_FEATURE_ENCODER)
|
||||
target_sources("Zydis"
|
||||
PUBLIC
|
||||
"${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Encoder.h"
|
||||
PRIVATE
|
||||
"src/EncoderData.h"
|
||||
"src/Encoder.c"
|
||||
"src/EncoderData.c")
|
||||
endif ()
|
||||
#if (ZYDIS_FEATURE_ENCODER)
|
||||
# target_sources("Zydis"
|
||||
# PUBLIC
|
||||
# "${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Encoder.h"
|
||||
# PRIVATE
|
||||
# "src/EncoderData.h"
|
||||
# "src/Encoder.c"
|
||||
# "src/EncoderData.c")
|
||||
#endif ()
|
||||
|
||||
if (BUILD_SHARED_LIBS AND WIN32)
|
||||
target_sources("Zydis" PRIVATE "src/VersionInfo.rc")
|
||||
|
@ -153,26 +160,29 @@ install(DIRECTORY "include" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
|||
# =============================================================================================== #
|
||||
|
||||
if (ZYDIS_BUILD_EXAMPLES)
|
||||
if (ZYDIS_FEATURE_DECODER)
|
||||
add_executable("FormatterHooks"
|
||||
"examples/FormatterHooks.c"
|
||||
"examples/FormatHelper.h")
|
||||
target_link_libraries("FormatterHooks" "Zydis")
|
||||
set_target_properties("FormatterHooks" PROPERTIES FOLDER "Examples/Formatter")
|
||||
target_compile_definitions("FormatterHooks" PRIVATE "_CRT_SECURE_NO_WARNINGS")
|
||||
if (ZYDIS_FEATURE_DECODER)
|
||||
add_executable("FormatterHooks"
|
||||
"examples/FormatterHooks.c"
|
||||
"examples/FormatHelper.h")
|
||||
target_link_libraries("FormatterHooks" "Zydis")
|
||||
set_target_properties("FormatterHooks" PROPERTIES FOLDER "Examples/Formatter")
|
||||
target_compile_definitions("FormatterHooks" PRIVATE "_CRT_SECURE_NO_WARNINGS")
|
||||
|
||||
add_executable("ZydisFuzzIn" "examples/ZydisFuzzIn.c")
|
||||
target_link_libraries("ZydisFuzzIn" "Zydis")
|
||||
set_target_properties("FormatterHooks" PROPERTIES FOLDER "Examples")
|
||||
target_compile_definitions("ZydisFuzzIn" PRIVATE "_CRT_SECURE_NO_WARNINGS")
|
||||
|
||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" OR ${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
||||
add_executable("ZydisPerfTest" "examples/ZydisPerfTest.c")
|
||||
target_link_libraries("ZydisPerfTest" "Zydis")
|
||||
set_target_properties("FormatterHooks" PROPERTIES FOLDER "Examples")
|
||||
target_compile_definitions("ZydisPerfTest" PRIVATE "_CRT_SECURE_NO_WARNINGS")
|
||||
add_executable("ZydisPerfTest" "examples/ZydisPerfTest.c")
|
||||
target_link_libraries("ZydisPerfTest" "Zydis")
|
||||
set_target_properties("FormatterHooks" PROPERTIES FOLDER "Examples")
|
||||
target_compile_definitions("ZydisPerfTest" PRIVATE "_CRT_SECURE_NO_WARNINGS")
|
||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
||||
target_compile_definitions("ZydisPerfTest" PRIVATE "_GNU_SOURCE")
|
||||
find_package(Threads REQUIRED)
|
||||
target_link_libraries("ZydisPerfTest" Threads::Threads)
|
||||
endif ()
|
||||
endif ()
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
# =============================================================================================== #
|
||||
|
@ -180,15 +190,15 @@ endif ()
|
|||
# =============================================================================================== #
|
||||
|
||||
if (ZYDIS_BUILD_TOOLS)
|
||||
if (ZYDIS_FEATURE_DECODER)
|
||||
add_executable("ZydisDisasm" "tools/ZydisDisasm.c")
|
||||
target_link_libraries("ZydisDisasm" "Zydis")
|
||||
set_target_properties ("ZydisDisasm" PROPERTIES FOLDER "Tools")
|
||||
target_compile_definitions("ZydisDisasm" PRIVATE "_CRT_SECURE_NO_WARNINGS")
|
||||
if (ZYDIS_FEATURE_DECODER)
|
||||
add_executable("ZydisDisasm" "tools/ZydisDisasm.c")
|
||||
target_link_libraries("ZydisDisasm" "Zydis")
|
||||
set_target_properties ("ZydisDisasm" PROPERTIES FOLDER "Tools")
|
||||
target_compile_definitions("ZydisDisasm" PRIVATE "_CRT_SECURE_NO_WARNINGS")
|
||||
|
||||
add_executable("ZydisInfo" "tools/ZydisInfo.c")
|
||||
target_link_libraries("ZydisInfo" "Zydis")
|
||||
set_target_properties ("ZydisInfo" PROPERTIES FOLDER "Tools")
|
||||
target_compile_definitions("ZydisInfo" PRIVATE "_CRT_SECURE_NO_WARNINGS")
|
||||
endif ()
|
||||
endif ()
|
||||
endif ()
|
||||
|
|
|
@ -81,6 +81,18 @@ static const char* conditionCodeStrings[0x20] =
|
|||
/*1F*/ "true_us"
|
||||
};
|
||||
|
||||
/* ============================================================================================== */
|
||||
/* Enums and Types */
|
||||
/* ============================================================================================== */
|
||||
|
||||
/**
|
||||
* @brief Custom user data struct.
|
||||
*/
|
||||
typedef struct ZydisCustomUserData_
|
||||
{
|
||||
ZydisBool ommitImmediate;
|
||||
} ZydisCustomUserData;
|
||||
|
||||
/* ============================================================================================== */
|
||||
/* Hook callbacks */
|
||||
/* ============================================================================================== */
|
||||
|
@ -88,13 +100,11 @@ static const char* conditionCodeStrings[0x20] =
|
|||
ZydisFormatterFormatFunc defaultPrintMnemonic;
|
||||
|
||||
static ZydisStatus ZydisFormatterPrintMnemonic(const ZydisFormatter* formatter,
|
||||
char** buffer, size_t bufferLen, ZydisDecodedInstruction* instruction)
|
||||
char** buffer, size_t bufferLen, const ZydisDecodedInstruction* instruction,
|
||||
ZydisCustomUserData* userData)
|
||||
{
|
||||
// We use the user-data field of the instruction-info to pass data to the
|
||||
// @c ZydisFormatterFormatOperandImm function.
|
||||
// In this case we are using a simple ordinal value, but you could pass a pointer to a
|
||||
// complex datatype as well.
|
||||
instruction->userData = (void*)1;
|
||||
// We use the user-data to pass data to the @c ZydisFormatterFormatOperandImm function.
|
||||
userData->ommitImmediate = ZYDIS_TRUE;
|
||||
|
||||
// Rewrite the instruction-mnemonic for the given instructions
|
||||
if (instruction->operands[instruction->operandCount - 1].type == ZYDIS_OPERAND_TYPE_IMMEDIATE)
|
||||
|
@ -142,10 +152,10 @@ static ZydisStatus ZydisFormatterPrintMnemonic(const ZydisFormatter* formatter,
|
|||
|
||||
// We did not rewrite the instruction-mnemonic. Signal the @c ZydisFormatterFormatOperandImm
|
||||
// function not to omit the operand
|
||||
instruction->userData = (void*)0;
|
||||
userData->ommitImmediate = ZYDIS_FALSE;
|
||||
|
||||
// Default mnemonic printing
|
||||
return defaultPrintMnemonic(formatter, buffer, bufferLen, instruction);
|
||||
return defaultPrintMnemonic(formatter, buffer, bufferLen, instruction, userData);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
@ -153,12 +163,12 @@ static ZydisStatus ZydisFormatterPrintMnemonic(const ZydisFormatter* formatter,
|
|||
ZydisFormatterFormatOperandFunc defaultFormatOperandImm;
|
||||
|
||||
static ZydisStatus ZydisFormatterFormatOperandImm(const ZydisFormatter* formatter,
|
||||
char** buffer, size_t bufferLen, ZydisDecodedInstruction* instruction,
|
||||
ZydisDecodedOperand* operand)
|
||||
char** buffer, size_t bufferLen, const ZydisDecodedInstruction* instruction,
|
||||
const ZydisDecodedOperand* operand, ZydisCustomUserData* userData)
|
||||
{
|
||||
// The @c ZydisFormatterFormatMnemonic sinals us to omit the immediate (condition-code)
|
||||
// operand, because it got replaced by the alias-mnemonic
|
||||
if ((uintptr_t)instruction->userData == 1)
|
||||
if (userData->ommitImmediate)
|
||||
{
|
||||
// The formatter will automatically omit the operand, if the buffer remains unchanged
|
||||
// after the callback returns
|
||||
|
@ -166,7 +176,7 @@ static ZydisStatus ZydisFormatterFormatOperandImm(const ZydisFormatter* formatte
|
|||
}
|
||||
|
||||
// Default immediate formatting
|
||||
return defaultFormatOperandImm(formatter, buffer, bufferLen, instruction, operand);
|
||||
return defaultFormatOperandImm(formatter, buffer, bufferLen, instruction, operand, userData);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
@ -184,10 +194,10 @@ void disassembleBuffer(ZydisDecoder* decoder, uint8_t* data, size_t length, Zydi
|
|||
|
||||
if (installHooks)
|
||||
{
|
||||
defaultPrintMnemonic = &ZydisFormatterPrintMnemonic;
|
||||
defaultPrintMnemonic = (ZydisFormatterFormatFunc)&ZydisFormatterPrintMnemonic;
|
||||
ZydisFormatterSetHook(&formatter, ZYDIS_FORMATTER_HOOK_PRINT_MNEMONIC,
|
||||
(const void**)&defaultPrintMnemonic);
|
||||
defaultFormatOperandImm = &ZydisFormatterFormatOperandImm;
|
||||
defaultFormatOperandImm = (ZydisFormatterFormatOperandFunc)&ZydisFormatterFormatOperandImm;
|
||||
ZydisFormatterSetHook(&formatter, ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_IMM,
|
||||
(const void**)&defaultFormatOperandImm);
|
||||
}
|
||||
|
@ -195,6 +205,7 @@ void disassembleBuffer(ZydisDecoder* decoder, uint8_t* data, size_t length, Zydi
|
|||
uint64_t instructionPointer = 0x007FFFFFFF400000;
|
||||
|
||||
ZydisDecodedInstruction instruction;
|
||||
ZydisCustomUserData userData;
|
||||
char buffer[256];
|
||||
while (ZYDIS_SUCCESS(
|
||||
ZydisDecoderDecodeBuffer(decoder, data, length, instructionPointer, &instruction)))
|
||||
|
@ -203,7 +214,8 @@ void disassembleBuffer(ZydisDecoder* decoder, uint8_t* data, size_t length, Zydi
|
|||
length -= instruction.length;
|
||||
instructionPointer += instruction.length;
|
||||
printf("%016" PRIX64 " ", instruction.instrAddress);
|
||||
ZydisFormatterFormatInstruction(&formatter, &instruction, &buffer[0], sizeof(buffer));
|
||||
ZydisFormatterFormatInstructionEx(
|
||||
&formatter, &instruction, &buffer[0], sizeof(buffer), &userData);
|
||||
printf(" %s\n", &buffer[0]);
|
||||
}
|
||||
}
|
||||
|
@ -214,6 +226,11 @@ void disassembleBuffer(ZydisDecoder* decoder, uint8_t* data, size_t length, Zydi
|
|||
|
||||
int main()
|
||||
{
|
||||
if (ZydisGetVersion() != ZYDIS_VERSION)
|
||||
{
|
||||
fputs("Invalid zydis version\n", stderr);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
uint8_t data[] =
|
||||
{
|
||||
|
|
|
@ -56,6 +56,12 @@ typedef struct ZydisFuzzControlBlock_ {
|
|||
|
||||
int main()
|
||||
{
|
||||
if (ZydisGetVersion() != ZYDIS_VERSION)
|
||||
{
|
||||
fputs("Invalid zydis version\n", stderr);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
ZydisFuzzControlBlock controlBlock;
|
||||
if (fread(&controlBlock, 1, sizeof(controlBlock), stdin) != sizeof(controlBlock))
|
||||
{
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
# include <mach/mach_time.h>
|
||||
#elif defined(ZYDIS_LINUX)
|
||||
# include <sys/time.h>
|
||||
# include <pthread.h>
|
||||
#else
|
||||
# error "Unsupported platform detected"
|
||||
#endif
|
||||
|
@ -47,6 +48,10 @@
|
|||
/* Helper functions */
|
||||
/* ============================================================================================== */
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
/* Time measurement */
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
||||
#if defined(ZYDIS_WINDOWS)
|
||||
double CounterFreq = 0.0;
|
||||
uint64_t CounterStart = 0;
|
||||
|
@ -56,7 +61,7 @@ void StartCounter()
|
|||
LARGE_INTEGER li;
|
||||
if (!QueryPerformanceFrequency(&li))
|
||||
{
|
||||
fputs("QueryPerformanceFrequency failed!\n", stderr);
|
||||
fputs("Error: QueryPerformanceFrequency failed!\n", stderr);
|
||||
}
|
||||
CounterFreq = (double)li.QuadPart / 1000.0;
|
||||
QueryPerformanceCounter(&li);
|
||||
|
@ -90,9 +95,59 @@ double GetCounter()
|
|||
return (double)elapsed * timebaseInfo.numer / timebaseInfo.denom / 1000000;
|
||||
}
|
||||
#elif defined(ZYDIS_LINUX)
|
||||
// TODO:
|
||||
struct timeval t1;
|
||||
|
||||
void StartCounter()
|
||||
{
|
||||
gettimeofday(&t1, NULL);
|
||||
}
|
||||
|
||||
double GetCounter()
|
||||
{
|
||||
struct timeval t2;
|
||||
gettimeofday(&t2, NULL);
|
||||
|
||||
double t = (t2.tv_sec - t1.tv_sec) * 1000.0;
|
||||
return t + (t2.tv_usec - t1.tv_usec) / 1000.0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
/* Process & Thread Priority */
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
||||
void adjustProcessAndThreadPriority()
|
||||
{
|
||||
#ifdef ZYDIS_WINDOWS
|
||||
SYSTEM_INFO info;
|
||||
GetSystemInfo(&info);
|
||||
if (info.dwNumberOfProcessors > 1)
|
||||
{
|
||||
if (!SetThreadAffinityMask(GetCurrentThread(), (DWORD_PTR)1))
|
||||
{
|
||||
fputs("Warning: Could not set thread affinity mask\n", stderr);
|
||||
}
|
||||
if (!SetPriorityClass(GetCurrentProcess(), REALTIME_PRIORITY_CLASS))
|
||||
{
|
||||
fputs("Warning: Could not set process priority class\n", stderr);
|
||||
}
|
||||
if (!SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL))
|
||||
{
|
||||
fputs("Warning: Could not set thread priority class\n", stderr);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#ifdef ZYDIS_LINUX
|
||||
pthread_t thread = pthread_self();
|
||||
cpu_set_t cpus;
|
||||
CPU_ZERO(&cpus);
|
||||
CPU_SET(0, &cpus);
|
||||
pthread_setaffinity_np(thread, sizeof(cpus), &cpus);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
||||
/* ============================================================================================== */
|
||||
/* Internal functions */
|
||||
/* ============================================================================================== */
|
||||
|
@ -132,7 +187,7 @@ uint64_t processBuffer(const char* buffer, size_t length, ZydisDecodeGranularity
|
|||
ZYDIS_ASSERT(ZYDIS_SUCCESS(status));
|
||||
if (!ZYDIS_SUCCESS(status))
|
||||
{
|
||||
puts("Unexpected decoding error");
|
||||
fputs("Unexpected decoding error\n", stderr);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
++count;
|
||||
|
@ -150,13 +205,17 @@ uint64_t processBuffer(const char* buffer, size_t length, ZydisDecodeGranularity
|
|||
void testPerformance(const char* buffer, size_t length, ZydisDecodeGranularity granularity,
|
||||
ZydisBool format)
|
||||
{
|
||||
// Cache warmup
|
||||
processBuffer(buffer, length, granularity, format);
|
||||
|
||||
// Testing
|
||||
uint64_t count = 0;
|
||||
StartCounter();
|
||||
for (uint8_t j = 0; j < 100; ++j)
|
||||
{
|
||||
count += processBuffer(buffer, length, granularity, format);
|
||||
}
|
||||
printf("Granularity %d, Formatting %d, Instructions: ~%6.2fM, Time: %8.2f msec\n",
|
||||
printf("Granularity %d, Formatting %d, Instructions: %6.2fM, Time: %8.2f msec\n",
|
||||
granularity, format, (double)count / 1000000, GetCounter());
|
||||
}
|
||||
|
||||
|
@ -171,9 +230,9 @@ void generateTestData(FILE* file, uint8_t encoding)
|
|||
}
|
||||
|
||||
uint8_t last = 0;
|
||||
double size = 0;
|
||||
uint32_t count = 0;
|
||||
ZydisDecodedInstruction instruction;
|
||||
while (size < 1024 * 1024)
|
||||
while (count < 100000)
|
||||
{
|
||||
uint8_t data[ZYDIS_MAX_INSTRUCTION_LENGTH];
|
||||
for (int i = 0; i < ZYDIS_MAX_INSTRUCTION_LENGTH; ++i)
|
||||
|
@ -235,13 +294,13 @@ void generateTestData(FILE* file, uint8_t encoding)
|
|||
if (b)
|
||||
{
|
||||
fwrite(&instruction.data[0], 1, instruction.length, file);
|
||||
size += instruction.length;
|
||||
++count;
|
||||
|
||||
double p = (size / (1024 * 1024) * 100);
|
||||
if (last < (uint8_t)p)
|
||||
uint8_t p = (uint8_t)((double)count / 100000 * 100);
|
||||
if (last < p)
|
||||
{
|
||||
last = (uint8_t)p;
|
||||
printf("%3.0f%%\n", p);
|
||||
last = p;
|
||||
printf("%3.0d%%\n", p);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -255,6 +314,12 @@ void generateTestData(FILE* file, uint8_t encoding)
|
|||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
if (ZydisGetVersion() != ZYDIS_VERSION)
|
||||
{
|
||||
fputs("Invalid zydis version\n", stderr);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (argc < 3 || (strcmp(argv[1], "-test") && strcmp(argv[1], "-generate")))
|
||||
{
|
||||
fputs("Usage: PerfTest -[test|generate] [directory]\n", stderr);
|
||||
|
@ -286,21 +351,24 @@ int main(int argc, char** argv)
|
|||
if (generate)
|
||||
{
|
||||
time_t t;
|
||||
srand((unsigned) time(&t));
|
||||
srand((unsigned)time(&t));
|
||||
}
|
||||
|
||||
adjustProcessAndThreadPriority();
|
||||
|
||||
for (uint8_t i = 0; i < ZYDIS_ARRAY_SIZE(tests); ++i)
|
||||
{
|
||||
FILE* file;
|
||||
|
||||
char buf[256];
|
||||
strcpy(&buf[0], directory);
|
||||
size_t len = strlen(directory);
|
||||
char buf[1024];
|
||||
strncpy(&buf[0], directory, sizeof(buf) - 1);
|
||||
if (generate)
|
||||
{
|
||||
file = fopen(strcat(buf, tests[i].filename), "wb");
|
||||
file = fopen(strncat(buf, tests[i].filename, sizeof(buf) - len - 1), "wb");
|
||||
} else
|
||||
{
|
||||
file = fopen(strcat(buf, tests[i].filename), "rb");
|
||||
file = fopen(strncat(buf, tests[i].filename, sizeof(buf) - len - 1), "rb");
|
||||
}
|
||||
if (!file)
|
||||
{
|
||||
|
@ -317,16 +385,30 @@ int main(int argc, char** argv)
|
|||
fseek(file, 0L, SEEK_END);
|
||||
long length = ftell(file);
|
||||
void* buffer = malloc(length);
|
||||
if (!buffer)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"Failed to allocate %" PRIu64 " bytes on the heap", (uint64_t)length);
|
||||
goto NextFile2;
|
||||
}
|
||||
|
||||
rewind(file);
|
||||
fread(buffer, 1, length, file);
|
||||
if (fread(buffer, 1, length, file) != length)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"Could not read %" PRIu64 " bytes from file \"%s\"", (uint64_t)length, &buf[0]);
|
||||
goto NextFile1;
|
||||
}
|
||||
|
||||
printf("Testing %s ...\n", tests[i].encoding);
|
||||
testPerformance(buffer, length, ZYDIS_DECODE_GRANULARITY_MINIMAL, ZYDIS_FALSE);
|
||||
testPerformance(buffer, length, ZYDIS_DECODE_GRANULARITY_FULL , ZYDIS_FALSE);
|
||||
// testPerformance(buffer, length, ZYDIS_DECODE_GRANULARITY_FULL , ZYDIS_TRUE );
|
||||
|
||||
testPerformance(buffer, length, ZYDIS_DECODE_GRANULARITY_FULL , ZYDIS_TRUE );
|
||||
puts("");
|
||||
|
||||
NextFile1:
|
||||
free(buffer);
|
||||
NextFile2:
|
||||
fclose(file);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
@ -32,18 +32,47 @@
|
|||
#ifndef ZYDIS_COMMONTYPES_H
|
||||
#define ZYDIS_COMMONTYPES_H
|
||||
|
||||
#include <Zydis/Defines.h>
|
||||
|
||||
/* ============================================================================================== */
|
||||
/* Integral types */
|
||||
/* ============================================================================================== */
|
||||
|
||||
/**
|
||||
* uint8_t, uint16_t, uint32_t, uint64_t, int8_t, int16_t, int32_t, int64_t
|
||||
*/
|
||||
#include <stdint.h>
|
||||
// Fixed width integer types.
|
||||
#if defined(ZYDIS_WINKERNEL)
|
||||
# if !defined(ZYDIS_MSVC)
|
||||
# error "Windows kernel drivers are only supported with MSVC"
|
||||
# endif
|
||||
typedef unsigned __int8 uint8_t;
|
||||
typedef unsigned __int16 uint16_t;
|
||||
typedef unsigned __int32 uint32_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
typedef __int8 int8_t;
|
||||
typedef __int16 int16_t;
|
||||
typedef __int32 int32_t;
|
||||
typedef __int64 int64_t;
|
||||
# define UINT8_MAX (255)
|
||||
# define UINT16_MAX (65535U)
|
||||
# define UINT32_MAX (4294967295UL)
|
||||
# define UINT64_MAX (18446744073709551615ULL)
|
||||
# define INT8_MAX (127)
|
||||
# define INT8_MIN (-128)
|
||||
# define INT16_MAX (32767)
|
||||
# define INT16_MIN (-32767-1)
|
||||
# define INT32_MIN (-2147483647L-1)
|
||||
# define INT32_MAX (2147483647L)
|
||||
# define INT64_MIN (-9223372036854775807LL-1)
|
||||
# define INT64_MAX (9223372036854775807LL)
|
||||
# define PRIX8 "hhX"
|
||||
# define PRIX16 "hX"
|
||||
# define PRIX32 "X"
|
||||
# define PRIX64 "llX"
|
||||
#else
|
||||
# include <stdint.h>
|
||||
# include <inttypes.h>
|
||||
#endif
|
||||
|
||||
/**
|
||||
* size_t, ptrdiff_t
|
||||
*/
|
||||
// size_t, ptrdiff_t
|
||||
#include <stddef.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -48,7 +48,7 @@ extern "C" {
|
|||
/**
|
||||
* @brief Defines the @c ZydisDecodeGranularity datatype.
|
||||
*/
|
||||
typedef uint32_t ZydisDecodeGranularity;
|
||||
typedef uint8_t ZydisDecodeGranularity;
|
||||
|
||||
/**
|
||||
* @brief Decoder modes defining how granular the instruction should be decoded.
|
||||
|
@ -73,7 +73,11 @@ enum ZydisDecodeGranularities
|
|||
/**
|
||||
* @brief Full physical and semantic instruction-decoding.
|
||||
*/
|
||||
ZYDIS_DECODE_GRANULARITY_FULL
|
||||
ZYDIS_DECODE_GRANULARITY_FULL,
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
ZYDIS_DECODE_GRANULARITY_MAX_VALUE = ZYDIS_DECODE_GRANULARITY_FULL,
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -83,7 +87,7 @@ typedef struct ZydisDecoder_
|
|||
{
|
||||
ZydisMachineMode machineMode;
|
||||
ZydisAddressWidth addressWidth;
|
||||
ZydisDecodeGranularity decodeGranularity;
|
||||
ZydisDecodeGranularity granularity;
|
||||
} ZydisDecoder;
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
@ -107,15 +111,15 @@ ZYDIS_EXPORT ZydisStatus ZydisDecoderInit(ZydisDecoder* decoder, ZydisMachineMod
|
|||
/**
|
||||
* @brief Initializes the given @c ZydisDecoder instance.
|
||||
*
|
||||
* @param decoder A pointer to the @c ZydisDecoder instance.
|
||||
* @param machineMode The machine mode.
|
||||
* @param addressWidth The address width.
|
||||
* @param decodeGranularity The decode granularity.
|
||||
* @param decoder A pointer to the @c ZydisDecoder instance.
|
||||
* @param machineMode The machine mode.
|
||||
* @param addressWidth The address width.
|
||||
* @param granularity The decode granularity.
|
||||
*
|
||||
* @return A zydis status code.
|
||||
*/
|
||||
ZYDIS_EXPORT ZydisStatus ZydisDecoderInitEx(ZydisDecoder* decoder, ZydisMachineMode machineMode,
|
||||
ZydisAddressWidth addressWidth, ZydisDecodeGranularity decodeGranularity);
|
||||
ZydisAddressWidth addressWidth, ZydisDecodeGranularity granularity);
|
||||
|
||||
/**
|
||||
* @brief Decodes the instruction in the given input @c buffer.
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#define ZYDIS_INSTRUCTIONINFO_H
|
||||
|
||||
#include <Zydis/CommonTypes.h>
|
||||
#include <Zydis/MetaInfo.h>
|
||||
#include <Zydis/Mnemonic.h>
|
||||
#include <Zydis/Register.h>
|
||||
#include <Zydis/SharedTypes.h>
|
||||
|
@ -89,7 +90,14 @@ typedef struct ZydisDecodedOperand_
|
|||
/**
|
||||
* @brief Extended info for register-operands.
|
||||
*/
|
||||
ZydisRegister reg;
|
||||
struct
|
||||
{
|
||||
/**
|
||||
* @brief The register value.
|
||||
*/
|
||||
ZydisRegister value;
|
||||
// TODO: AVX512_4VNNIW MULTISOURCE registers
|
||||
} reg;
|
||||
/**
|
||||
* @brief Extended info for memory-operands.
|
||||
*/
|
||||
|
@ -149,7 +157,7 @@ typedef struct ZydisDecodedOperand_
|
|||
ZydisBool isSigned;
|
||||
/**
|
||||
* @brief Signals, if the immediate value contains a relative offset. You can use
|
||||
* @c ZydisUtilsCalcAbsoluteTargetAddress to determine the absolute address value.
|
||||
* @c ZydisCalcAbsoluteAddress to determine the absolute address value.
|
||||
*/
|
||||
ZydisBool isRelative;
|
||||
/**
|
||||
|
@ -176,171 +184,179 @@ typedef struct ZydisDecodedOperand_
|
|||
*/
|
||||
typedef uint64_t ZydisInstructionAttributes;
|
||||
|
||||
// TODO: Update values
|
||||
|
||||
/**
|
||||
* @brief The instruction has the ModRM byte.
|
||||
*/
|
||||
#define ZYDIS_ATTRIB_HAS_MODRM 0x0000000000000001
|
||||
#define ZYDIS_ATTRIB_HAS_MODRM 0x0000000000000001 // (1 << 0)
|
||||
/**
|
||||
* @brief The instruction has the SUB byte.
|
||||
*/
|
||||
#define ZYDIS_ATTRIB_HAS_SIB 0x0000000000000002
|
||||
#define ZYDIS_ATTRIB_HAS_SIB 0x0000000000000002 // (1 << 1)
|
||||
/**
|
||||
* @brief The instruction has the REX prefix.
|
||||
*/
|
||||
#define ZYDIS_ATTRIB_HAS_REX 0x0000000000000004
|
||||
#define ZYDIS_ATTRIB_HAS_REX 0x0000000000000004 // (1 << 2)
|
||||
/**
|
||||
* @brief The instruction has the XOP prefix.
|
||||
*/
|
||||
#define ZYDIS_ATTRIB_HAS_XOP 0x0000000000000008
|
||||
#define ZYDIS_ATTRIB_HAS_XOP 0x0000000000000008 // (1 << 3)
|
||||
/**
|
||||
* @brief The instruction has the VEX prefix.
|
||||
*/
|
||||
#define ZYDIS_ATTRIB_HAS_VEX 0x0000000000000010
|
||||
#define ZYDIS_ATTRIB_HAS_VEX 0x0000000000000010 // (1 << 4)
|
||||
/**
|
||||
* @brief The instruction has the EVEX prefix.
|
||||
*/
|
||||
#define ZYDIS_ATTRIB_HAS_EVEX 0x0000000000000020
|
||||
#define ZYDIS_ATTRIB_HAS_EVEX 0x0000000000000020 // (1 << 5)
|
||||
/**
|
||||
* @brief The instruction has the MVEX prefix.
|
||||
*/
|
||||
#define ZYDIS_ATTRIB_HAS_MVEX 0x0000000000000040 // (1 << 6)
|
||||
/**
|
||||
* @brief The instruction has one or more operands with position-relative offsets.
|
||||
*/
|
||||
#define ZYDIS_ATTRIB_IS_RELATIVE 0x0000000000000040
|
||||
#define ZYDIS_ATTRIB_IS_RELATIVE 0x0000000000000080 // (1 << 7)
|
||||
/**
|
||||
* @brief The instruction is privileged.
|
||||
*
|
||||
* Priviliged instructions are any instructions that require a current ring level below 3.
|
||||
*/
|
||||
#define ZYDIS_ATTRIB_IS_PRIVILEGED 0x0000000000000080
|
||||
#define ZYDIS_ATTRIB_IS_PRIVILEGED 0x0000000000000100 // (1 << 8)
|
||||
|
||||
/**
|
||||
* @brief The instruction is a far JMP/CALL/RET.
|
||||
*/
|
||||
#define ZYDIS_ATTRIB_IS_FAR_BRANCH 0x0000001000000000 // (1 << 36) // TODO: rebase
|
||||
|
||||
/**
|
||||
* @brief The instruction accepts the lock prefix (0xF0).
|
||||
*/
|
||||
#define ZYDIS_ATTRIB_ACCEPTS_LOCK 0x0000000000000100
|
||||
#define ZYDIS_ATTRIB_ACCEPTS_LOCK 0x0000000000000200 // (1 << 9)
|
||||
/**
|
||||
* @brief The instruction accepts the rep prefix (0xF3).
|
||||
*/
|
||||
#define ZYDIS_ATTRIB_ACCEPTS_REP 0x0000000000000200
|
||||
#define ZYDIS_ATTRIB_ACCEPTS_REP 0x0000000000000400 // (1 << 10)
|
||||
/**
|
||||
* @brief The instruction accepts the repe/repz prefix (0xF3).
|
||||
*/
|
||||
#define ZYDIS_ATTRIB_ACCEPTS_REPE 0x0000000000000400
|
||||
#define ZYDIS_ATTRIB_ACCEPTS_REPE 0x0000000000000800 // (1 << 11)
|
||||
/**
|
||||
* @brief The instruction accepts the repe/repz prefix (0xF3).
|
||||
*/
|
||||
#define ZYDIS_ATTRIB_ACCEPTS_REPZ 0x0000000000000400
|
||||
#define ZYDIS_ATTRIB_ACCEPTS_REPZ 0x0000000000000800 // (1 << 11)
|
||||
/**
|
||||
* @brief The instruction accepts the repne/repnz prefix (0xF2).
|
||||
*/
|
||||
#define ZYDIS_ATTRIB_ACCEPTS_REPNE 0x0000000000000800
|
||||
#define ZYDIS_ATTRIB_ACCEPTS_REPNE 0x0000000000001000 // (1 << 12)
|
||||
/**
|
||||
* @brief The instruction accepts the repne/repnz prefix (0xF2).
|
||||
*/
|
||||
#define ZYDIS_ATTRIB_ACCEPTS_REPNZ 0x0000000000000800
|
||||
#define ZYDIS_ATTRIB_ACCEPTS_REPNZ 0x0000000000001000 // (1 << 12)
|
||||
/**
|
||||
* @brief The instruction accepts the bound prefix (0xF2).
|
||||
*/
|
||||
#define ZYDIS_ATTRIB_ACCEPTS_BOUND 0x0000000000001000
|
||||
#define ZYDIS_ATTRIB_ACCEPTS_BOUND 0x0000000000002000 // (1 << 13)
|
||||
/**
|
||||
* @brief The instruction accepts the xacquire prefix (0xF2).
|
||||
*/
|
||||
#define ZYDIS_ATTRIB_ACCEPTS_XACQUIRE 0x0000000000002000
|
||||
#define ZYDIS_ATTRIB_ACCEPTS_XACQUIRE 0x0000000000004000 // (1 << 14)
|
||||
/**
|
||||
* @brief The instruction accepts the xrelease prefix (0xF3).
|
||||
*/
|
||||
#define ZYDIS_ATTRIB_ACCEPTS_XRELEASE 0x0000000000004000
|
||||
#define ZYDIS_ATTRIB_ACCEPTS_XRELEASE 0x0000000000008000 // (1 << 15)
|
||||
/**
|
||||
* @brief The instruction accepts the xacquire/xrelease prefixes (0xF2, 0xF3) without the
|
||||
* lock-prefix (0x0F).
|
||||
*/
|
||||
#define ZYDIS_ATTRIB_ACCEPTS_HLE_WITHOUT_LOCK 0x0000000000008000
|
||||
#define ZYDIS_ATTRIB_ACCEPTS_HLE_WITHOUT_LOCK 0x0000000000010000 // (1 << 16)
|
||||
/**
|
||||
* @brief The instruction accepts branch hints (0x2E, 0x3E).
|
||||
*/
|
||||
#define ZYDIS_ATTRIB_ACCEPTS_BRANCH_HINTS 0x0000000000010000
|
||||
#define ZYDIS_ATTRIB_ACCEPTS_BRANCH_HINTS 0x0000000000020000 // (1 << 17)
|
||||
/**
|
||||
* @brief The instruction accepts segment prefixes (0x2E, 0x36, 0x3E, 0x26, 0x64, 0x65).
|
||||
*/
|
||||
#define ZYDIS_ATTRIB_ACCEPTS_SEGMENT 0x0000000000020000
|
||||
#define ZYDIS_ATTRIB_ACCEPTS_SEGMENT 0x0000000000040000 // (1 << 18)
|
||||
/**
|
||||
* @brief The instruction has the lock prefix (0xF0).
|
||||
*/
|
||||
#define ZYDIS_ATTRIB_HAS_LOCK 0x0000000000100000
|
||||
#define ZYDIS_ATTRIB_HAS_LOCK 0x0000000000080000 // (1 << 19)
|
||||
/**
|
||||
* @brief The instruction has the rep prefix (0xF3).
|
||||
*/
|
||||
#define ZYDIS_ATTRIB_HAS_REP 0x0000000000200000
|
||||
#define ZYDIS_ATTRIB_HAS_REP 0x0000000000100000 // (1 << 20)
|
||||
/**
|
||||
* @brief The instruction has the repe/repz prefix (0xF3).
|
||||
*/
|
||||
#define ZYDIS_ATTRIB_HAS_REPE 0x0000000000400000
|
||||
#define ZYDIS_ATTRIB_HAS_REPE 0x0000000000200000 // (1 << 21)
|
||||
/**
|
||||
* @brief The instruction has the repe/repz prefix (0xF3).
|
||||
*/
|
||||
#define ZYDIS_ATTRIB_HAS_REPZ 0x0000000000400000
|
||||
#define ZYDIS_ATTRIB_HAS_REPZ 0x0000000000200000 // (1 << 21)
|
||||
/**
|
||||
* @brief The instruction has the repne/repnz prefix (0xF2).
|
||||
*/
|
||||
#define ZYDIS_ATTRIB_HAS_REPNE 0x0000000000800000
|
||||
#define ZYDIS_ATTRIB_HAS_REPNE 0x0000000000400000 // (1 << 22)
|
||||
/**
|
||||
* @brief The instruction has the repne/repnz prefix (0xF2).
|
||||
*/
|
||||
#define ZYDIS_ATTRIB_HAS_REPNZ 0x0000000000800000
|
||||
#define ZYDIS_ATTRIB_HAS_REPNZ 0x0000000000400000 // (1 << 22)
|
||||
/**
|
||||
* @brief The instruction has the bound prefix (0xF2).
|
||||
*/
|
||||
#define ZYDIS_ATTRIB_HAS_BOUND 0x0000000001000000
|
||||
#define ZYDIS_ATTRIB_HAS_BOUND 0x0000000000800000 // (1 << 23)
|
||||
/**
|
||||
* @brief The instruction has the xacquire prefix (0xF2).
|
||||
*/
|
||||
#define ZYDIS_ATTRIB_HAS_XACQUIRE 0x0000000002000000
|
||||
#define ZYDIS_ATTRIB_HAS_XACQUIRE 0x0000000001000000 // (1 << 24)
|
||||
/**
|
||||
* @brief The instruction has the xrelease prefix (0xF3).
|
||||
*/
|
||||
#define ZYDIS_ATTRIB_HAS_XRELEASE 0x0000000004000000
|
||||
#define ZYDIS_ATTRIB_HAS_XRELEASE 0x0000000002000000 // (1 << 25)
|
||||
/**
|
||||
* @brief The instruction has the branch-not-taken hint (0x2E).
|
||||
*/
|
||||
#define ZYDIS_ATTRIB_HAS_BRANCH_NOT_TAKEN 0x0000000008000000
|
||||
#define ZYDIS_ATTRIB_HAS_BRANCH_NOT_TAKEN 0x0000000004000000 // (1 << 26)
|
||||
/**
|
||||
* @brief The instruction has the branch-taken hint (0x3E).
|
||||
*/
|
||||
#define ZYDIS_ATTRIB_HAS_BRANCH_TAKEN 0x0000000010000000
|
||||
#define ZYDIS_ATTRIB_HAS_BRANCH_TAKEN 0x0000000008000000 // (1 << 27)
|
||||
/**
|
||||
* @brief The instruction has a segment modifier.
|
||||
*/
|
||||
#define ZYDIS_ATTRIB_HAS_SEGMENT 0x00000007E0000000
|
||||
#define ZYDIS_ATTRIB_HAS_SEGMENT 0x00000003F0000000
|
||||
/**
|
||||
* @brief The instruction has the CS segment modifier (0x2E).
|
||||
*/
|
||||
#define ZYDIS_ATTRIB_HAS_SEGMENT_CS 0x0000000020000000
|
||||
#define ZYDIS_ATTRIB_HAS_SEGMENT_CS 0x0000000010000000 // (1 << 28)
|
||||
/**
|
||||
* @brief The instruction has the SS segment modifier (0x36).
|
||||
*/
|
||||
#define ZYDIS_ATTRIB_HAS_SEGMENT_SS 0x0000000040000000
|
||||
#define ZYDIS_ATTRIB_HAS_SEGMENT_SS 0x0000000020000000 // (1 << 29)
|
||||
/**
|
||||
* @brief The instruction has the DS segment modifier (0x3E).
|
||||
*/
|
||||
#define ZYDIS_ATTRIB_HAS_SEGMENT_DS 0x0000000080000000
|
||||
#define ZYDIS_ATTRIB_HAS_SEGMENT_DS 0x0000000040000000 // (1 << 30)
|
||||
/**
|
||||
* @brief The instruction has the ES segment modifier (0x26).
|
||||
*/
|
||||
#define ZYDIS_ATTRIB_HAS_SEGMENT_ES 0x0000000100000000
|
||||
#define ZYDIS_ATTRIB_HAS_SEGMENT_ES 0x0000000080000000 // (1 << 31)
|
||||
/**
|
||||
* @brief The instruction has the FS segment modifier (0x64).
|
||||
*/
|
||||
#define ZYDIS_ATTRIB_HAS_SEGMENT_FS 0x0000000200000000
|
||||
#define ZYDIS_ATTRIB_HAS_SEGMENT_FS 0x0000000100000000 // (1 << 32)
|
||||
/**
|
||||
* @brief The instruction has the GS segment modifier (0x65).
|
||||
*/
|
||||
#define ZYDIS_ATTRIB_HAS_SEGMENT_GS 0x0000000400000000
|
||||
#define ZYDIS_ATTRIB_HAS_SEGMENT_GS 0x0000000200000000 // (1 << 33)
|
||||
/**
|
||||
* @brief The instruction has the operand-size prefix (0x66).
|
||||
*/
|
||||
#define ZYDIS_ATTRIB_HAS_OPERANDSIZE 0x0000000800000000
|
||||
#define ZYDIS_ATTRIB_HAS_OPERANDSIZE 0x0000000400000000 // (1 << 34) // TODO: rename
|
||||
/**
|
||||
* @brief The instruction has the address-size prefix (0x67).
|
||||
*/
|
||||
#define ZYDIS_ATTRIB_HAS_ADDRESSSIZE 0x0000001000000000
|
||||
#define ZYDIS_ATTRIB_HAS_ADDRESSSIZE 0x0000000800000000 // (1 << 35) // TODO: rename
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
/* R/E/FLAGS info */
|
||||
|
@ -445,11 +461,10 @@ enum ZydisCPUFlags
|
|||
* @brief FPU condition-code flag 3.
|
||||
*/
|
||||
ZYDIS_CPUFLAG_C3,
|
||||
|
||||
/**
|
||||
* @brief Marker value.
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
ZYDIS_CPUFLAG_ENUM_COUNT
|
||||
ZYDIS_CPUFLAG_MAX_VALUE = ZYDIS_CPUFLAG_C3
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -467,7 +482,11 @@ enum ZydisCPUFlagActions
|
|||
ZYDIS_CPUFLAG_ACTION_MODIFIED,
|
||||
ZYDIS_CPUFLAG_ACTION_SET_0,
|
||||
ZYDIS_CPUFLAG_ACTION_SET_1,
|
||||
ZYDIS_CPUFLAG_ACTION_UNDEFINED
|
||||
ZYDIS_CPUFLAG_ACTION_UNDEFINED,
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
ZYDIS_CPUFLAG_ACTION_MAX_VALUE = ZYDIS_CPUFLAG_ACTION_UNDEFINED
|
||||
};
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
@ -477,7 +496,7 @@ enum ZydisCPUFlagActions
|
|||
/**
|
||||
* @brief Defines the @c ZydisExceptionClass datatype.
|
||||
*/
|
||||
typedef uint16_t ZydisExceptionClass;
|
||||
typedef uint8_t ZydisExceptionClass;
|
||||
|
||||
/**
|
||||
* @brief Values that represent exception-classes.
|
||||
|
@ -485,7 +504,23 @@ typedef uint16_t ZydisExceptionClass;
|
|||
enum ZydisExceptionClasses
|
||||
{
|
||||
ZYDIS_EXCEPTION_CLASS_NONE,
|
||||
// TODO: SSE and AVX
|
||||
// TODO: FP Exceptions
|
||||
ZYDIS_EXCEPTION_CLASS_SSE1,
|
||||
ZYDIS_EXCEPTION_CLASS_SSE2,
|
||||
ZYDIS_EXCEPTION_CLASS_SSE3,
|
||||
ZYDIS_EXCEPTION_CLASS_SSE4,
|
||||
ZYDIS_EXCEPTION_CLASS_SSE5,
|
||||
ZYDIS_EXCEPTION_CLASS_SSE7,
|
||||
ZYDIS_EXCEPTION_CLASS_AVX1,
|
||||
ZYDIS_EXCEPTION_CLASS_AVX2,
|
||||
ZYDIS_EXCEPTION_CLASS_AVX3,
|
||||
ZYDIS_EXCEPTION_CLASS_AVX4,
|
||||
ZYDIS_EXCEPTION_CLASS_AVX5,
|
||||
ZYDIS_EXCEPTION_CLASS_AVX6,
|
||||
ZYDIS_EXCEPTION_CLASS_AVX7,
|
||||
ZYDIS_EXCEPTION_CLASS_AVX8,
|
||||
ZYDIS_EXCEPTION_CLASS_AVX11,
|
||||
ZYDIS_EXCEPTION_CLASS_AVX12,
|
||||
ZYDIS_EXCEPTION_CLASS_E1,
|
||||
ZYDIS_EXCEPTION_CLASS_E1NF,
|
||||
ZYDIS_EXCEPTION_CLASS_E2,
|
||||
|
@ -504,10 +539,15 @@ enum ZydisExceptionClasses
|
|||
ZYDIS_EXCEPTION_CLASS_E10,
|
||||
ZYDIS_EXCEPTION_CLASS_E10NF,
|
||||
ZYDIS_EXCEPTION_CLASS_E11,
|
||||
ZYDIS_EXCEPTION_CLASS_E11NF,
|
||||
ZYDIS_EXCEPTION_CLASS_E12,
|
||||
ZYDIS_EXCEPTION_CLASS_E12NP,
|
||||
ZYDIS_EXCEPTION_CLASS_K20,
|
||||
ZYDIS_EXCEPTION_CLASS_K21
|
||||
ZYDIS_EXCEPTION_CLASS_K21,
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
ZYDIS_EXCEPTION_CLASS_MAX_VALUE = ZYDIS_EXCEPTION_CLASS_K21
|
||||
};
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
@ -527,7 +567,11 @@ enum ZydisVectorLengths
|
|||
ZYDIS_VECTOR_LENGTH_INVALID = 0,
|
||||
ZYDIS_VECTOR_LENGTH_128 = 128,
|
||||
ZYDIS_VECTOR_LENGTH_256 = 256,
|
||||
ZYDIS_VECTOR_LENGTH_512 = 512
|
||||
ZYDIS_VECTOR_LENGTH_512 = 512,
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
ZYDIS_VECTOR_LENGTH_MAX_VALUE = ZYDIS_VECTOR_LENGTH_512
|
||||
};
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
@ -553,7 +597,11 @@ enum ZydisMaskModes
|
|||
/**
|
||||
* @brief The embedded mask register is used as a zero-mask.
|
||||
*/
|
||||
ZYDIS_MASK_MODE_ZERO
|
||||
ZYDIS_MASK_MODE_ZERO,
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
ZYDIS_MASK_MODE_MAX_VALUE = ZYDIS_MASK_MODE_ZERO
|
||||
};
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
@ -563,7 +611,7 @@ enum ZydisMaskModes
|
|||
/**
|
||||
* @brief Defines the @c ZydisBroadcastMode datatype.
|
||||
*/
|
||||
typedef uint16_t ZydisBroadcastMode;
|
||||
typedef uint8_t ZydisBroadcastMode;
|
||||
|
||||
/**
|
||||
* @brief Values that represent AVX broadcast-modes.
|
||||
|
@ -582,7 +630,11 @@ enum ZydisBroadcastModes
|
|||
ZYDIS_BROADCAST_MODE_2_TO_16,
|
||||
ZYDIS_BROADCAST_MODE_4_TO_8,
|
||||
ZYDIS_BROADCAST_MODE_4_TO_16,
|
||||
ZYDIS_BROADCAST_MODE_8_TO_16
|
||||
ZYDIS_BROADCAST_MODE_8_TO_16,
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
ZYDIS_BROADCAST_MODE_MAX_VALUE = ZYDIS_BROADCAST_MODE_8_TO_16
|
||||
};
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
@ -615,7 +667,11 @@ enum ZydisRoundingModes
|
|||
/**
|
||||
* @brief Round towards zero.
|
||||
*/
|
||||
ZYDIS_ROUNDING_MODE_RZ
|
||||
ZYDIS_ROUNDING_MODE_RZ,
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
ZYDIS_ROUNDING_MODE_MAX_VALUE = ZYDIS_ROUNDING_MODE_RZ
|
||||
};
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
@ -625,7 +681,7 @@ enum ZydisRoundingModes
|
|||
/**
|
||||
* @brief Defines the @c ZydisSwizzleMode datatype.
|
||||
*/
|
||||
typedef uint16_t ZydisSwizzleMode;
|
||||
typedef uint8_t ZydisSwizzleMode;
|
||||
|
||||
/**
|
||||
* @brief Values that represent swizzle-modes.
|
||||
|
@ -640,7 +696,11 @@ enum ZydisSwizzleModes
|
|||
ZYDIS_SWIZZLE_MODE_AAAA,
|
||||
ZYDIS_SWIZZLE_MODE_BBBB,
|
||||
ZYDIS_SWIZZLE_MODE_CCCC,
|
||||
ZYDIS_SWIZZLE_MODE_DDDD
|
||||
ZYDIS_SWIZZLE_MODE_DDDD,
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
ZYDIS_SWIZZLE_MODE_MAX_VALUE = ZYDIS_SWIZZLE_MODE_DDDD
|
||||
};
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
@ -650,7 +710,7 @@ enum ZydisSwizzleModes
|
|||
/**
|
||||
* @brief Defines the @c ZydisConversionMode datatype.
|
||||
*/
|
||||
typedef uint16_t ZydisConversionMode;
|
||||
typedef uint8_t ZydisConversionMode;
|
||||
|
||||
/**
|
||||
* @brief Values that represent conversion-modes.
|
||||
|
@ -662,7 +722,11 @@ enum ZydisConversionModes
|
|||
ZYDIS_CONVERSION_MODE_SINT8,
|
||||
ZYDIS_CONVERSION_MODE_UINT8,
|
||||
ZYDIS_CONVERSION_MODE_SINT16,
|
||||
ZYDIS_CONVERSION_MODE_UINT16
|
||||
ZYDIS_CONVERSION_MODE_UINT16,
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
ZYDIS_CONVERSION_MODE_MAX_VALUE = ZYDIS_CONVERSION_MODE_UINT16
|
||||
};
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
@ -702,14 +766,14 @@ typedef struct ZydisDecodedInstruction_
|
|||
* @brief The instruction-opcode.
|
||||
*/
|
||||
uint8_t opcode;
|
||||
/**
|
||||
* @brief The effective operand size.
|
||||
*/
|
||||
uint8_t operandSize;
|
||||
/**
|
||||
* @brief The stack width.
|
||||
*/
|
||||
uint8_t stackWidth;
|
||||
/**
|
||||
* @brief The effective operand width.
|
||||
*/
|
||||
uint8_t operandWidth;
|
||||
/**
|
||||
* @brief The effective address width.
|
||||
*/
|
||||
|
@ -746,11 +810,11 @@ typedef struct ZydisDecodedInstruction_
|
|||
/**
|
||||
* @brief The CPU-flag action.
|
||||
*
|
||||
* You can call `ZydisGetCPUFlagsByAction` to get a mask with all flags matching a specific
|
||||
* action.
|
||||
* You can call `ZydisGetAccessedFlagsByAction` to get a mask with all flags matching a
|
||||
* specific action.
|
||||
*/
|
||||
ZydisCPUFlagAction action;
|
||||
} flags[ZYDIS_CPUFLAG_ENUM_COUNT];
|
||||
} accessedFlags[ZYDIS_CPUFLAG_MAX_VALUE + 1];
|
||||
/**
|
||||
* @brief Extended info for AVX instructions.
|
||||
*/
|
||||
|
@ -779,7 +843,7 @@ typedef struct ZydisDecodedInstruction_
|
|||
ZydisBool isControlMask;
|
||||
} mask;
|
||||
/**
|
||||
* @brief Contains info about the AVX broadcast-factor.
|
||||
* @brief Contains info about the AVX broadcast.
|
||||
*/
|
||||
struct
|
||||
{
|
||||
|
@ -796,17 +860,35 @@ typedef struct ZydisDecodedInstruction_
|
|||
ZydisBroadcastMode mode;
|
||||
} broadcast;
|
||||
/**
|
||||
* @brief The AVX rounding-mode.
|
||||
* @brief Contains info about the AVX rounding.
|
||||
*/
|
||||
ZydisRoundingMode roundingMode;
|
||||
struct
|
||||
{
|
||||
/**
|
||||
* @brief The AVX rounding-mode.
|
||||
*/
|
||||
ZydisRoundingMode mode;
|
||||
} rounding;
|
||||
/**
|
||||
* @brief The AVX register-swizzle mode (MVEX only).
|
||||
* @brief Contains info about the AVX register-swizzle (MVEX only).
|
||||
*/
|
||||
ZydisSwizzleMode swizzleMode;
|
||||
struct
|
||||
{
|
||||
/**
|
||||
* @brief The AVX register-swizzle mode (MVEX only).
|
||||
*/
|
||||
ZydisSwizzleMode mode;
|
||||
} swizzle;
|
||||
/**
|
||||
* @brief The AVX data-conversion mode (MVEX only).
|
||||
* @brief Contains info about the AVX data-conversion (MVEX only).
|
||||
*/
|
||||
ZydisConversionMode conversionMode;
|
||||
struct
|
||||
{
|
||||
/**
|
||||
* @brief The AVX data-conversion mode (MVEX only).
|
||||
*/
|
||||
ZydisConversionMode mode;
|
||||
} conversion;
|
||||
/**
|
||||
* @brief Signals, if the sae functionality is enabled for the instruction.
|
||||
*/
|
||||
|
@ -815,7 +897,29 @@ typedef struct ZydisDecodedInstruction_
|
|||
* @brief Signals, if the instruction has a memory eviction-hint (MVEX only).
|
||||
*/
|
||||
ZydisBool hasEvictionHint;
|
||||
} avx;
|
||||
} avx;
|
||||
/**
|
||||
* @brief Meta info.
|
||||
*/
|
||||
struct
|
||||
{
|
||||
/**
|
||||
* @brief The instruction category.
|
||||
*/
|
||||
ZydisInstructionCategory category;
|
||||
/**
|
||||
* @brief The ISA-set.
|
||||
*/
|
||||
ZydisISASet isaSet;
|
||||
/**
|
||||
* @brief The ISA-set extension.
|
||||
*/
|
||||
ZydisISAExt isaExt;
|
||||
/**
|
||||
* @brief The exception class.
|
||||
*/
|
||||
ZydisExceptionClass exceptionClass;
|
||||
} meta;
|
||||
/**
|
||||
* @brief Extended info about different instruction-parts like ModRM, SIB or
|
||||
* encoding-prefixes.
|
||||
|
@ -1147,8 +1251,7 @@ typedef struct ZydisDecodedInstruction_
|
|||
ZydisBool isSigned;
|
||||
/**
|
||||
* @brief Signals, if the immediate value contains a relative offset. You can use
|
||||
* @c ZydisUtilsCalcAbsoluteTargetAddress to determine the absolute address
|
||||
* value.
|
||||
* @c ZydisCalcAbsoluteAddress to determine the absolute address value.
|
||||
*/
|
||||
ZydisBool isRelative;
|
||||
/**
|
||||
|
@ -1170,10 +1273,6 @@ typedef struct ZydisDecodedInstruction_
|
|||
uint8_t offset;
|
||||
} imm[2];
|
||||
} raw;
|
||||
/**
|
||||
* @brief This field is intended for custom data and may be freely set by the user.
|
||||
*/
|
||||
void* userData;
|
||||
} ZydisDecodedInstruction;
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
#ifndef ZYDIS_DEFINES_H
|
||||
#define ZYDIS_DEFINES_H
|
||||
|
||||
#include <assert.h>
|
||||
#include <ZydisExportConfig.h>
|
||||
|
||||
/* ============================================================================================== */
|
||||
|
@ -122,20 +121,39 @@
|
|||
/* Debugging and optimization macros */
|
||||
/* ============================================================================================== */
|
||||
|
||||
#define ZYDIS_ASSERT(condition) assert(condition)
|
||||
#if defined(ZYDIS_WINKERNEL)
|
||||
# define ZYDIS_ASSERT(condition)
|
||||
#else
|
||||
# include <assert.h>
|
||||
# define ZYDIS_ASSERT(condition) assert(condition)
|
||||
#endif
|
||||
|
||||
#if defined(ZYDIS_RELEASE)
|
||||
# if defined(ZYDIS_GNUC)
|
||||
# if defined(ZYDIS_CLANG) // GCC eagerly evals && RHS, we have to use nested ifs.
|
||||
# if __has_builtin(__builtin_unreachable)
|
||||
# define ZYDIS_UNREACHABLE __builtin_unreachable()
|
||||
# else
|
||||
# define ZYDIS_UNREACHABLE
|
||||
# endif
|
||||
# elif defined(ZYDIS_GCC) && ((__GNUC__ == 4 && __GNUC_MINOR__ > 4) || __GNUC__ > 4)
|
||||
# define ZYDIS_UNREACHABLE __builtin_unreachable()
|
||||
# elif defined(ZYDIS_ICC)
|
||||
# ifdef ZYDIS_WINDOWS
|
||||
# include <stdlib.h> // "missing return statement" workaround
|
||||
# define ZYDIS_UNREACHABLE __assume(0); (void)abort()
|
||||
# else
|
||||
# define ZYDIS_UNREACHABLE __builtin_unreachable()
|
||||
# endif
|
||||
# elif defined(ZYDIS_MSVC)
|
||||
# define ZYDIS_UNREACHABLE __assume(0)
|
||||
# else
|
||||
# define ZYDIS_UNREACHABLE
|
||||
# endif
|
||||
#elif defined(ZYDIS_WINKERNEL)
|
||||
# define ZYDIS_UNREACHABLE
|
||||
#else
|
||||
# define ZYDIS_UNREACHABLE assert(0)
|
||||
# include <stdlib.h>
|
||||
# define ZYDIS_UNREACHABLE { assert(0); abort(); }
|
||||
#endif
|
||||
|
||||
/* ============================================================================================== */
|
||||
|
|
|
@ -1,137 +0,0 @@
|
|||
/***************************************************************************************************
|
||||
|
||||
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.
|
||||
|
||||
***************************************************************************************************/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @brief Functions for (re-)encoding instructions.
|
||||
*/
|
||||
|
||||
#ifndef ZYDIS_ENCODER_H
|
||||
#define ZYDIS_ENCODER_H
|
||||
|
||||
#include <Zydis/Defines.h>
|
||||
#include <Zydis/Status.h>
|
||||
#include <Zydis/SharedTypes.h>
|
||||
#ifdef ZYDIS_ENABLE_FEATURE_DECODER
|
||||
# include <Zydis/DecoderTypes.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* ============================================================================================== */
|
||||
/* Constants */
|
||||
/* ============================================================================================== */
|
||||
|
||||
/**
|
||||
* @brief Defines a mask of attributes users may excplicitly ask for.
|
||||
*/
|
||||
#define ZYDIS_USER_ENCODABLE_ATTRIB_MASK ( \
|
||||
ZYDIS_ATTRIB_HAS_LOCK | \
|
||||
ZYDIS_ATTRIB_HAS_REP | \
|
||||
ZYDIS_ATTRIB_HAS_REPE | \
|
||||
ZYDIS_ATTRIB_HAS_REPNE | \
|
||||
ZYDIS_ATTRIB_HAS_BOUND | \
|
||||
ZYDIS_ATTRIB_HAS_XACQUIRE | \
|
||||
ZYDIS_ATTRIB_HAS_XRELEASE | \
|
||||
ZYDIS_ATTRIB_HAS_BRANCH_TAKEN | \
|
||||
ZYDIS_ATTRIB_HAS_BRANCH_NOT_TAKEN \
|
||||
)
|
||||
|
||||
/* ============================================================================================== */
|
||||
/* Structs */
|
||||
/* ============================================================================================== */
|
||||
|
||||
#define ZYDIS_ENCODER_MAX_OPERANDS (5)
|
||||
|
||||
typedef struct ZydisEncoderOperand_
|
||||
{
|
||||
ZydisOperandType type;
|
||||
ZydisRegister reg;
|
||||
struct
|
||||
{
|
||||
ZydisRegister segment;
|
||||
ZydisRegister base;
|
||||
ZydisRegister index;
|
||||
uint8_t scale;
|
||||
uint8_t dispSize;
|
||||
int64_t disp;
|
||||
} mem;
|
||||
struct
|
||||
{
|
||||
uint16_t segment;
|
||||
uint32_t offset;
|
||||
} ptr;
|
||||
uint8_t immSize;
|
||||
union
|
||||
{
|
||||
uint64_t u;
|
||||
int64_t s;
|
||||
} imm;
|
||||
} ZydisEncoderOperand;
|
||||
|
||||
typedef struct ZydisEncoderRequest_
|
||||
{
|
||||
ZydisMachineMode machineMode;
|
||||
ZydisMnemonic mnemonic;
|
||||
ZydisInstructionAttributes attributes;
|
||||
ZydisInstructionEncoding encoding;
|
||||
uint8_t operandCount;
|
||||
ZydisEncoderOperand operands[ZYDIS_ENCODER_MAX_OPERANDS];
|
||||
|
||||
// TODO: AVX stuff
|
||||
// TODO: MVEX stuff
|
||||
} ZydisEncoderRequest;
|
||||
|
||||
/* ============================================================================================== */
|
||||
/* Exported functions */
|
||||
/* ============================================================================================== */
|
||||
|
||||
#ifdef ZYDIS_ENABLE_FEATURE_DECODER
|
||||
ZYDIS_EXPORT ZydisStatus ZydisEncoderDecodedInstructionToRequest(
|
||||
const ZydisDecodedInstruction* in, ZydisEncoderRequest* out);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Encodes the given instruction info to byte-code.
|
||||
*
|
||||
* @param buffer A pointer to the output buffer.
|
||||
* @param bufferLen The length of the output buffer.
|
||||
* @param request A pointer to the @c ZydisEncoderRequest encode.
|
||||
*
|
||||
* @return A zydis status code.
|
||||
*/
|
||||
ZYDIS_EXPORT ZydisStatus ZydisEncoderEncodeInstruction(void* buffer, size_t* bufferLen,
|
||||
const ZydisEncoderRequest* request);
|
||||
|
||||
/* ============================================================================================== */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ZYDIS_ENCODER_H */
|
|
@ -57,7 +57,11 @@ enum ZydisFormatterStyles
|
|||
/**
|
||||
* @brief Generates intel-style disassembly.
|
||||
*/
|
||||
ZYDIS_FORMATTER_STYLE_INTEL
|
||||
ZYDIS_FORMATTER_STYLE_INTEL,
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
ZYDIS_FORMATTER_STYLE_MAX_VALUE = ZYDIS_FORMATTER_STYLE_INTEL
|
||||
};
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
@ -70,16 +74,16 @@ typedef uint32_t ZydisFormatterFlags;
|
|||
/**
|
||||
* @brief Formats the instruction in uppercase instead of lowercase.
|
||||
*/
|
||||
#define ZYDIS_FMTFLAG_UPPERCASE 0x00000001
|
||||
#define ZYDIS_FMTFLAG_UPPERCASE 0x00000001 // (1 << 0)
|
||||
/**
|
||||
* @brief Forces the formatter to always print the segment register of memory-operands, instead
|
||||
* of ommiting implicit DS/SS segments.
|
||||
*/
|
||||
#define ZYDIS_FMTFLAG_FORCE_SEGMENTS 0x00000002
|
||||
#define ZYDIS_FMTFLAG_FORCE_SEGMENTS 0x00000002 // (1 << 1)
|
||||
/**
|
||||
* @brief Forces the formatter to always print the size of memory-operands.
|
||||
*/
|
||||
#define ZYDIS_FMTFLAG_FORCE_OPERANDSIZE 0x00000004
|
||||
#define ZYDIS_FMTFLAG_FORCE_OPERANDSIZE 0x00000004 // (1 << 2)
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
||||
|
@ -117,6 +121,10 @@ enum ZydisFormatterAddressFormats
|
|||
* "JMP 0xE0"
|
||||
*/
|
||||
ZYDIS_FORMATTER_ADDR_RELATIVE_UNSIGNED,
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
ZYDIS_FORMATTER_ADDR_MAX_VALUE = ZYDIS_FORMATTER_ADDR_RELATIVE_UNSIGNED
|
||||
};
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
@ -150,7 +158,11 @@ enum ZydisFormatterDisplacementFormats
|
|||
* "MOV EAX, DWORD PTR SS:[ESP+0x400]"
|
||||
* "MOV EAX, DWORD PTR SS:[ESP+0xFFFFFC00]"
|
||||
*/
|
||||
ZYDIS_FORMATTER_DISP_HEX_UNSIGNED
|
||||
ZYDIS_FORMATTER_DISP_HEX_UNSIGNED,
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
ZYDIS_FORMATTER_DISP_MAX_VALUE = ZYDIS_FORMATTER_DISP_HEX_UNSIGNED
|
||||
};
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
@ -189,7 +201,11 @@ enum ZydisFormatterImmediateFormats
|
|||
* "MOV EAX, 0x400"
|
||||
* "MOV EAX, 0xFFFFFC00"
|
||||
*/
|
||||
ZYDIS_FORMATTER_IMM_HEX_UNSIGNED
|
||||
ZYDIS_FORMATTER_IMM_HEX_UNSIGNED,
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
ZYDIS_FORMATTER_IMM_MAX_VALUE = ZYDIS_FORMATTER_IMM_HEX_UNSIGNED
|
||||
};
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
@ -277,7 +293,11 @@ enum ZydisFormatterHookTypes
|
|||
/**
|
||||
* @brief This function is called to print an immediate value.
|
||||
*/
|
||||
ZYDIS_FORMATTER_HOOK_PRINT_IMMEDIATE
|
||||
ZYDIS_FORMATTER_HOOK_PRINT_IMMEDIATE,
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
ZYDIS_FORMATTER_HOOK_MAX_VALUE = ZYDIS_FORMATTER_HOOK_PRINT_IMMEDIATE
|
||||
};
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
@ -299,16 +319,21 @@ enum ZydisDecoratorTypes
|
|||
ZYDIS_DECORATOR_TYPE_SAE,
|
||||
ZYDIS_DECORATOR_TYPE_SWIZZLE,
|
||||
ZYDIS_DECORATOR_TYPE_CONVERSION,
|
||||
ZYDIS_DECORATOR_TYPE_EVICTION_HINT
|
||||
ZYDIS_DECORATOR_TYPE_EVICTION_HINT,
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
ZYDIS_DECORATOR_TYPE_MAX_VALUE = ZYDIS_DECORATOR_TYPE_EVICTION_HINT
|
||||
};
|
||||
|
||||
typedef struct ZydisFormatter_ ZydisFormatter;
|
||||
typedef struct ZydisFormatter_ ZydisFormatter;
|
||||
|
||||
/**
|
||||
* @brief Defines the @c ZydisFormatterNotifyFunc function pointer.
|
||||
*
|
||||
* @param formatter A pointer to the @c ZydisFormatter instance.
|
||||
* @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.
|
||||
|
@ -317,7 +342,7 @@ typedef struct ZydisFormatter_ ZydisFormatter;
|
|||
* @c ZYDIS_FORMATTER_HOOK_POST hook-types.
|
||||
*/
|
||||
typedef ZydisStatus (*ZydisFormatterNotifyFunc)(const ZydisFormatter* formatter,
|
||||
ZydisDecodedInstruction* instruction);
|
||||
const ZydisDecodedInstruction* instruction, void* userData);
|
||||
|
||||
/**
|
||||
* @brief Defines the @c ZydisFormatterFormatFunc function pointer.
|
||||
|
@ -326,6 +351,7 @@ typedef ZydisStatus (*ZydisFormatterNotifyFunc)(const ZydisFormatter* formatter,
|
|||
* @param buffer A pointer to the string-buffer.
|
||||
* @param bufferLen The length of the string-buffer.
|
||||
* @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.
|
||||
|
@ -337,7 +363,7 @@ 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, size_t bufferLen, ZydisDecodedInstruction* instruction);
|
||||
char** buffer, size_t bufferLen, const ZydisDecodedInstruction* instruction, void* userData);
|
||||
|
||||
/**
|
||||
* @brief Defines the @c ZydisFormatterFormatOperandFunc function pointer.
|
||||
|
@ -347,6 +373,7 @@ typedef ZydisStatus (*ZydisFormatterFormatFunc)(const ZydisFormatter* formatter,
|
|||
* @param bufferLen The length of 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.
|
||||
*
|
||||
* @return Returning a status code other than @c ZYDIS_STATUS_SUCCESS will immediately cause the
|
||||
* formatting process to fail.
|
||||
|
@ -373,8 +400,8 @@ typedef ZydisStatus (*ZydisFormatterFormatFunc)(const ZydisFormatter* formatter,
|
|||
* hook-types.
|
||||
*/
|
||||
typedef ZydisStatus (*ZydisFormatterFormatOperandFunc)(const ZydisFormatter* formatter,
|
||||
char** buffer, size_t bufferLen, ZydisDecodedInstruction* instruction,
|
||||
ZydisDecodedOperand* operand);
|
||||
char** buffer, size_t bufferLen, const ZydisDecodedInstruction* instruction,
|
||||
const ZydisDecodedOperand* operand, void* userData);
|
||||
|
||||
/**
|
||||
* @brief Defines the @c ZydisFormatterFormatAddressFunc function pointer.
|
||||
|
@ -384,6 +411,7 @@ typedef ZydisStatus (*ZydisFormatterFormatOperandFunc)(const ZydisFormatter* for
|
|||
* @param bufferLen The length of 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.
|
||||
*
|
||||
* @return Returning a status code other than @c ZYDIS_STATUS_SUCCESS will immediately cause the
|
||||
* formatting process to fail.
|
||||
|
@ -395,8 +423,8 @@ 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, size_t bufferLen, ZydisDecodedInstruction* instruction,
|
||||
ZydisDecodedOperand* operand, uint64_t address);
|
||||
char** buffer, size_t bufferLen, const ZydisDecodedInstruction* instruction,
|
||||
const ZydisDecodedOperand* operand, uint64_t address, void* userData);
|
||||
|
||||
/**
|
||||
* @brief Defines the @c ZydisFormatterFormatDecoratorFunc function pointer.
|
||||
|
@ -407,6 +435,7 @@ typedef ZydisStatus (*ZydisFormatterFormatAddressFunc)(const ZydisFormatter* for
|
|||
* @param instruction A pointer to the @c ZydisDecodedInstruction struct.
|
||||
* @param operand A pointer to the @c 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
|
||||
* formatting process to fail.
|
||||
|
@ -420,8 +449,8 @@ 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, size_t bufferLen, ZydisDecodedInstruction* instruction,
|
||||
ZydisDecodedOperand* operand, ZydisDecoratorType type);
|
||||
char** buffer, size_t bufferLen, const ZydisDecodedInstruction* instruction,
|
||||
const ZydisDecodedOperand* operand, ZydisDecoratorType type, void* userData);
|
||||
|
||||
/**
|
||||
* @brief Defines the @c ZydisFormatter struct.
|
||||
|
@ -509,6 +538,21 @@ ZYDIS_EXPORT ZydisStatus ZydisFormatterSetHook(ZydisFormatter* formatter,
|
|||
ZYDIS_EXPORT ZydisStatus ZydisFormatterFormatInstruction(const ZydisFormatter* formatter,
|
||||
ZydisDecodedInstruction* instruction, char* buffer, size_t bufferLen);
|
||||
|
||||
/**
|
||||
* @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 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
|
||||
* callbacks.
|
||||
*
|
||||
* @return A zydis status code.
|
||||
*/
|
||||
ZYDIS_EXPORT ZydisStatus ZydisFormatterFormatInstructionEx(const ZydisFormatter* formatter,
|
||||
ZydisDecodedInstruction* instruction, char* buffer, size_t bufferLen, void* userData);
|
||||
|
||||
/* ============================================================================================== */
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -0,0 +1,133 @@
|
|||
/**
|
||||
* @brief Defines the `ZydisISAExt` datatype.
|
||||
*/
|
||||
typedef uint8_t ZydisISAExt;
|
||||
|
||||
/**
|
||||
* @brief Values that represent `ZydisISAExt` elements.
|
||||
*/
|
||||
enum ZydisISAExts
|
||||
{
|
||||
ZYDIS_ISA_EXT_INVALID,
|
||||
ZYDIS_ISA_EXT_AES,
|
||||
ZYDIS_ISA_EXT_AMD,
|
||||
ZYDIS_ISA_EXT_AMD3DNOW,
|
||||
ZYDIS_ISA_EXT_AVX,
|
||||
ZYDIS_ISA_EXT_AVX2,
|
||||
ZYDIS_ISA_EXT_AVX2GATHER,
|
||||
ZYDIS_ISA_EXT_AVX512BW_128,
|
||||
ZYDIS_ISA_EXT_AVX512BW_128N,
|
||||
ZYDIS_ISA_EXT_AVX512BW_256,
|
||||
ZYDIS_ISA_EXT_AVX512BW_512,
|
||||
ZYDIS_ISA_EXT_AVX512BW_KOP,
|
||||
ZYDIS_ISA_EXT_AVX512CD_128,
|
||||
ZYDIS_ISA_EXT_AVX512CD_256,
|
||||
ZYDIS_ISA_EXT_AVX512CD_512,
|
||||
ZYDIS_ISA_EXT_AVX512DQ_128,
|
||||
ZYDIS_ISA_EXT_AVX512DQ_128N,
|
||||
ZYDIS_ISA_EXT_AVX512DQ_256,
|
||||
ZYDIS_ISA_EXT_AVX512DQ_512,
|
||||
ZYDIS_ISA_EXT_AVX512DQ_KOP,
|
||||
ZYDIS_ISA_EXT_AVX512DQ_SCALAR,
|
||||
ZYDIS_ISA_EXT_AVX512ER_512,
|
||||
ZYDIS_ISA_EXT_AVX512ER_SCALAR,
|
||||
ZYDIS_ISA_EXT_AVX512F_128,
|
||||
ZYDIS_ISA_EXT_AVX512F_128N,
|
||||
ZYDIS_ISA_EXT_AVX512F_256,
|
||||
ZYDIS_ISA_EXT_AVX512F_512,
|
||||
ZYDIS_ISA_EXT_AVX512F_KOP,
|
||||
ZYDIS_ISA_EXT_AVX512F_SCALAR,
|
||||
ZYDIS_ISA_EXT_AVX512PF_512,
|
||||
ZYDIS_ISA_EXT_AVX512_4FMAPS_512,
|
||||
ZYDIS_ISA_EXT_AVX512_4FMAPS_SCALAR,
|
||||
ZYDIS_ISA_EXT_AVX512_4VNNIW_512,
|
||||
ZYDIS_ISA_EXT_AVX512_IFMA_128,
|
||||
ZYDIS_ISA_EXT_AVX512_IFMA_256,
|
||||
ZYDIS_ISA_EXT_AVX512_IFMA_512,
|
||||
ZYDIS_ISA_EXT_AVX512_VBMI_128,
|
||||
ZYDIS_ISA_EXT_AVX512_VBMI_256,
|
||||
ZYDIS_ISA_EXT_AVX512_VBMI_512,
|
||||
ZYDIS_ISA_EXT_AVX512_VPOPCNTDQ_512,
|
||||
ZYDIS_ISA_EXT_AVXAES,
|
||||
ZYDIS_ISA_EXT_BDW,
|
||||
ZYDIS_ISA_EXT_BMI1,
|
||||
ZYDIS_ISA_EXT_BMI2,
|
||||
ZYDIS_ISA_EXT_CET,
|
||||
ZYDIS_ISA_EXT_CLFLUSHOPT,
|
||||
ZYDIS_ISA_EXT_CLFSH,
|
||||
ZYDIS_ISA_EXT_CLWB,
|
||||
ZYDIS_ISA_EXT_CLZERO,
|
||||
ZYDIS_ISA_EXT_CMOV,
|
||||
ZYDIS_ISA_EXT_CMPXCHG16B,
|
||||
ZYDIS_ISA_EXT_F16C,
|
||||
ZYDIS_ISA_EXT_FAT_NOP,
|
||||
ZYDIS_ISA_EXT_FCMOV,
|
||||
ZYDIS_ISA_EXT_FMA,
|
||||
ZYDIS_ISA_EXT_FMA4,
|
||||
ZYDIS_ISA_EXT_FXSAVE,
|
||||
ZYDIS_ISA_EXT_FXSAVE64,
|
||||
ZYDIS_ISA_EXT_I186,
|
||||
ZYDIS_ISA_EXT_I286PROTECTED,
|
||||
ZYDIS_ISA_EXT_I286REAL,
|
||||
ZYDIS_ISA_EXT_I386,
|
||||
ZYDIS_ISA_EXT_I486,
|
||||
ZYDIS_ISA_EXT_I486REAL,
|
||||
ZYDIS_ISA_EXT_I86,
|
||||
ZYDIS_ISA_EXT_INVPCID,
|
||||
ZYDIS_ISA_EXT_KNCE,
|
||||
ZYDIS_ISA_EXT_KNCJKBR,
|
||||
ZYDIS_ISA_EXT_KNCSTREAM,
|
||||
ZYDIS_ISA_EXT_KNCV,
|
||||
ZYDIS_ISA_EXT_KNC_MISC,
|
||||
ZYDIS_ISA_EXT_KNC_PF_HINT,
|
||||
ZYDIS_ISA_EXT_LAHF,
|
||||
ZYDIS_ISA_EXT_LONGMODE,
|
||||
ZYDIS_ISA_EXT_LZCNT,
|
||||
ZYDIS_ISA_EXT_MONITOR,
|
||||
ZYDIS_ISA_EXT_MOVBE,
|
||||
ZYDIS_ISA_EXT_MPX,
|
||||
ZYDIS_ISA_EXT_PAUSE,
|
||||
ZYDIS_ISA_EXT_PCLMULQDQ,
|
||||
ZYDIS_ISA_EXT_PENTIUMMMX,
|
||||
ZYDIS_ISA_EXT_PENTIUMREAL,
|
||||
ZYDIS_ISA_EXT_PKU,
|
||||
ZYDIS_ISA_EXT_POPCNT,
|
||||
ZYDIS_ISA_EXT_PPRO,
|
||||
ZYDIS_ISA_EXT_PREFETCHWT1,
|
||||
ZYDIS_ISA_EXT_PREFETCH_NOP,
|
||||
ZYDIS_ISA_EXT_PT,
|
||||
ZYDIS_ISA_EXT_RDPMC,
|
||||
ZYDIS_ISA_EXT_RDRAND,
|
||||
ZYDIS_ISA_EXT_RDSEED,
|
||||
ZYDIS_ISA_EXT_RDTSCP,
|
||||
ZYDIS_ISA_EXT_RDWRFSGS,
|
||||
ZYDIS_ISA_EXT_RTM,
|
||||
ZYDIS_ISA_EXT_SGX,
|
||||
ZYDIS_ISA_EXT_SHA,
|
||||
ZYDIS_ISA_EXT_SMAP,
|
||||
ZYDIS_ISA_EXT_SMX,
|
||||
ZYDIS_ISA_EXT_SSE,
|
||||
ZYDIS_ISA_EXT_SSE2,
|
||||
ZYDIS_ISA_EXT_SSE2MMX,
|
||||
ZYDIS_ISA_EXT_SSE3,
|
||||
ZYDIS_ISA_EXT_SSE3X87,
|
||||
ZYDIS_ISA_EXT_SSE4,
|
||||
ZYDIS_ISA_EXT_SSE42,
|
||||
ZYDIS_ISA_EXT_SSEMXCSR,
|
||||
ZYDIS_ISA_EXT_SSE_PREFETCH,
|
||||
ZYDIS_ISA_EXT_SSSE3,
|
||||
ZYDIS_ISA_EXT_SSSE3MMX,
|
||||
ZYDIS_ISA_EXT_SVM,
|
||||
ZYDIS_ISA_EXT_TBM,
|
||||
ZYDIS_ISA_EXT_VMFUNC,
|
||||
ZYDIS_ISA_EXT_VTX,
|
||||
ZYDIS_ISA_EXT_X87,
|
||||
ZYDIS_ISA_EXT_XOP,
|
||||
ZYDIS_ISA_EXT_XSAVE,
|
||||
ZYDIS_ISA_EXT_XSAVEC,
|
||||
ZYDIS_ISA_EXT_XSAVEOPT,
|
||||
ZYDIS_ISA_EXT_XSAVES
|
||||
};
|
||||
|
||||
#define ZYDIS_ISA_EXT_MAX_VALUE ZYDIS_ISA_EXT_XSAVES
|
||||
#define ZYDIS_ISA_EXT_MAX_BITS 0x0007
|
|
@ -0,0 +1,74 @@
|
|||
/**
|
||||
* @brief Defines the `ZydisISASet` datatype.
|
||||
*/
|
||||
typedef uint8_t ZydisISASet;
|
||||
|
||||
/**
|
||||
* @brief Values that represent `ZydisISASet` elements.
|
||||
*/
|
||||
enum ZydisISASets
|
||||
{
|
||||
ZYDIS_ISA_SET_INVALID,
|
||||
ZYDIS_ISA_SET_AES,
|
||||
ZYDIS_ISA_SET_AMD3DNOW,
|
||||
ZYDIS_ISA_SET_AVX,
|
||||
ZYDIS_ISA_SET_AVX2,
|
||||
ZYDIS_ISA_SET_AVX2GATHER,
|
||||
ZYDIS_ISA_SET_AVX512EVEX,
|
||||
ZYDIS_ISA_SET_AVX512VEX,
|
||||
ZYDIS_ISA_SET_AVXAES,
|
||||
ZYDIS_ISA_SET_BASE,
|
||||
ZYDIS_ISA_SET_BDW,
|
||||
ZYDIS_ISA_SET_BMI1,
|
||||
ZYDIS_ISA_SET_BMI2,
|
||||
ZYDIS_ISA_SET_CET,
|
||||
ZYDIS_ISA_SET_CLFLUSHOPT,
|
||||
ZYDIS_ISA_SET_CLFSH,
|
||||
ZYDIS_ISA_SET_CLWB,
|
||||
ZYDIS_ISA_SET_CLZERO,
|
||||
ZYDIS_ISA_SET_F16C,
|
||||
ZYDIS_ISA_SET_FMA,
|
||||
ZYDIS_ISA_SET_FMA4,
|
||||
ZYDIS_ISA_SET_INVPCID,
|
||||
ZYDIS_ISA_SET_KNC,
|
||||
ZYDIS_ISA_SET_KNCE,
|
||||
ZYDIS_ISA_SET_KNCV,
|
||||
ZYDIS_ISA_SET_LONGMODE,
|
||||
ZYDIS_ISA_SET_LZCNT,
|
||||
ZYDIS_ISA_SET_MMX,
|
||||
ZYDIS_ISA_SET_MONITOR,
|
||||
ZYDIS_ISA_SET_MOVBE,
|
||||
ZYDIS_ISA_SET_MPX,
|
||||
ZYDIS_ISA_SET_PAUSE,
|
||||
ZYDIS_ISA_SET_PCLMULQDQ,
|
||||
ZYDIS_ISA_SET_PKU,
|
||||
ZYDIS_ISA_SET_PREFETCHWT1,
|
||||
ZYDIS_ISA_SET_PT,
|
||||
ZYDIS_ISA_SET_RDRAND,
|
||||
ZYDIS_ISA_SET_RDSEED,
|
||||
ZYDIS_ISA_SET_RDTSCP,
|
||||
ZYDIS_ISA_SET_RDWRFSGS,
|
||||
ZYDIS_ISA_SET_RTM,
|
||||
ZYDIS_ISA_SET_SGX,
|
||||
ZYDIS_ISA_SET_SHA,
|
||||
ZYDIS_ISA_SET_SMAP,
|
||||
ZYDIS_ISA_SET_SMX,
|
||||
ZYDIS_ISA_SET_SSE,
|
||||
ZYDIS_ISA_SET_SSE2,
|
||||
ZYDIS_ISA_SET_SSE3,
|
||||
ZYDIS_ISA_SET_SSE4,
|
||||
ZYDIS_ISA_SET_SSSE3,
|
||||
ZYDIS_ISA_SET_SVM,
|
||||
ZYDIS_ISA_SET_TBM,
|
||||
ZYDIS_ISA_SET_VMFUNC,
|
||||
ZYDIS_ISA_SET_VTX,
|
||||
ZYDIS_ISA_SET_X87,
|
||||
ZYDIS_ISA_SET_XOP,
|
||||
ZYDIS_ISA_SET_XSAVE,
|
||||
ZYDIS_ISA_SET_XSAVEC,
|
||||
ZYDIS_ISA_SET_XSAVEOPT,
|
||||
ZYDIS_ISA_SET_XSAVES
|
||||
};
|
||||
|
||||
#define ZYDIS_ISA_SET_MAX_VALUE ZYDIS_ISA_SET_XSAVES
|
||||
#define ZYDIS_ISA_SET_MAX_BITS 0x0006
|
|
@ -0,0 +1,99 @@
|
|||
/**
|
||||
* @brief Defines the `ZydisInstructionCategory` datatype.
|
||||
*/
|
||||
typedef uint8_t ZydisInstructionCategory;
|
||||
|
||||
/**
|
||||
* @brief Values that represent `ZydisInstructionCategory` elements.
|
||||
*/
|
||||
enum ZydisInstructionCategories
|
||||
{
|
||||
ZYDIS_CATEGORY_INVALID,
|
||||
ZYDIS_CATEGORY_AES,
|
||||
ZYDIS_CATEGORY_AMD3DNOW,
|
||||
ZYDIS_CATEGORY_AVX,
|
||||
ZYDIS_CATEGORY_AVX2,
|
||||
ZYDIS_CATEGORY_AVX2GATHER,
|
||||
ZYDIS_CATEGORY_AVX512,
|
||||
ZYDIS_CATEGORY_AVX512_4FMAPS,
|
||||
ZYDIS_CATEGORY_AVX512_4VNNIW,
|
||||
ZYDIS_CATEGORY_AVX512_VBMI,
|
||||
ZYDIS_CATEGORY_BDW,
|
||||
ZYDIS_CATEGORY_BINARY,
|
||||
ZYDIS_CATEGORY_BITBYTE,
|
||||
ZYDIS_CATEGORY_BLEND,
|
||||
ZYDIS_CATEGORY_BMI1,
|
||||
ZYDIS_CATEGORY_BMI2,
|
||||
ZYDIS_CATEGORY_BROADCAST,
|
||||
ZYDIS_CATEGORY_CALL,
|
||||
ZYDIS_CATEGORY_CET,
|
||||
ZYDIS_CATEGORY_CLFLUSHOPT,
|
||||
ZYDIS_CATEGORY_CLWB,
|
||||
ZYDIS_CATEGORY_CLZERO,
|
||||
ZYDIS_CATEGORY_CMOV,
|
||||
ZYDIS_CATEGORY_COMPRESS,
|
||||
ZYDIS_CATEGORY_COND_BR,
|
||||
ZYDIS_CATEGORY_CONFLICT,
|
||||
ZYDIS_CATEGORY_CONVERT,
|
||||
ZYDIS_CATEGORY_DATAXFER,
|
||||
ZYDIS_CATEGORY_DECIMAL,
|
||||
ZYDIS_CATEGORY_EXPAND,
|
||||
ZYDIS_CATEGORY_FCMOV,
|
||||
ZYDIS_CATEGORY_FLAGOP,
|
||||
ZYDIS_CATEGORY_FMA4,
|
||||
ZYDIS_CATEGORY_GATHER,
|
||||
ZYDIS_CATEGORY_IFMA,
|
||||
ZYDIS_CATEGORY_INTERRUPT,
|
||||
ZYDIS_CATEGORY_IO,
|
||||
ZYDIS_CATEGORY_IOSTRINGOP,
|
||||
ZYDIS_CATEGORY_KMASK,
|
||||
ZYDIS_CATEGORY_KNC,
|
||||
ZYDIS_CATEGORY_KNCMASK,
|
||||
ZYDIS_CATEGORY_KNCSCALAR,
|
||||
ZYDIS_CATEGORY_LOGICAL,
|
||||
ZYDIS_CATEGORY_LOGICAL_FP,
|
||||
ZYDIS_CATEGORY_LZCNT,
|
||||
ZYDIS_CATEGORY_MISC,
|
||||
ZYDIS_CATEGORY_MMX,
|
||||
ZYDIS_CATEGORY_MPX,
|
||||
ZYDIS_CATEGORY_NOP,
|
||||
ZYDIS_CATEGORY_PCLMULQDQ,
|
||||
ZYDIS_CATEGORY_PKU,
|
||||
ZYDIS_CATEGORY_POP,
|
||||
ZYDIS_CATEGORY_PREFETCH,
|
||||
ZYDIS_CATEGORY_PREFETCHWT1,
|
||||
ZYDIS_CATEGORY_PT,
|
||||
ZYDIS_CATEGORY_PUSH,
|
||||
ZYDIS_CATEGORY_RDRAND,
|
||||
ZYDIS_CATEGORY_RDSEED,
|
||||
ZYDIS_CATEGORY_RDWRFSGS,
|
||||
ZYDIS_CATEGORY_RET,
|
||||
ZYDIS_CATEGORY_ROTATE,
|
||||
ZYDIS_CATEGORY_SCATTER,
|
||||
ZYDIS_CATEGORY_SEGOP,
|
||||
ZYDIS_CATEGORY_SEMAPHORE,
|
||||
ZYDIS_CATEGORY_SETCC,
|
||||
ZYDIS_CATEGORY_SGX,
|
||||
ZYDIS_CATEGORY_SHA,
|
||||
ZYDIS_CATEGORY_SHIFT,
|
||||
ZYDIS_CATEGORY_SMAP,
|
||||
ZYDIS_CATEGORY_SSE,
|
||||
ZYDIS_CATEGORY_STRINGOP,
|
||||
ZYDIS_CATEGORY_STTNI,
|
||||
ZYDIS_CATEGORY_SYSCALL,
|
||||
ZYDIS_CATEGORY_SYSRET,
|
||||
ZYDIS_CATEGORY_SYSTEM,
|
||||
ZYDIS_CATEGORY_TBM,
|
||||
ZYDIS_CATEGORY_UFMA,
|
||||
ZYDIS_CATEGORY_UNCOND_BR,
|
||||
ZYDIS_CATEGORY_VFMA,
|
||||
ZYDIS_CATEGORY_VTX,
|
||||
ZYDIS_CATEGORY_WIDENOP,
|
||||
ZYDIS_CATEGORY_X87_ALU,
|
||||
ZYDIS_CATEGORY_XOP,
|
||||
ZYDIS_CATEGORY_XSAVE,
|
||||
ZYDIS_CATEGORY_XSAVEOPT
|
||||
};
|
||||
|
||||
#define ZYDIS_CATEGORY_MAX_VALUE ZYDIS_CATEGORY_XSAVEOPT
|
||||
#define ZYDIS_CATEGORY_MAX_BITS 0x0007
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,87 @@
|
|||
/***************************************************************************************************
|
||||
|
||||
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.
|
||||
|
||||
***************************************************************************************************/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @brief
|
||||
*/
|
||||
|
||||
#ifndef ZYDIS_METAINFO_H
|
||||
#define ZYDIS_METAINFO_H
|
||||
|
||||
#include <Zydis/Defines.h>
|
||||
#include <Zydis/CommonTypes.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* ============================================================================================== */
|
||||
/* Enums and types */
|
||||
/* ============================================================================================== */
|
||||
|
||||
#include <Zydis/Generated/EnumInstructionCategory.h>
|
||||
#include <Zydis/Generated/EnumISASet.h>
|
||||
#include <Zydis/Generated/EnumISAExt.h>
|
||||
|
||||
/* ============================================================================================== */
|
||||
/* Exported functions */
|
||||
/* ============================================================================================== */
|
||||
|
||||
/**
|
||||
* @brief Returns the specified instruction category string.
|
||||
*
|
||||
* @param category The instruction category.
|
||||
*
|
||||
* @return The instruction category string or @c NULL, if an invalid category was passed.
|
||||
*/
|
||||
ZYDIS_EXPORT const char* ZydisCategoryGetString(ZydisInstructionCategory category);
|
||||
|
||||
/**
|
||||
* @brief Returns the specified isa-set string.
|
||||
*
|
||||
* @param isaSet The isa-set.
|
||||
*
|
||||
* @return The isa-set string or @c NULL, if an invalid isa-set was passed.
|
||||
*/
|
||||
ZYDIS_EXPORT const char* ZydisISASetGetString(ZydisISASet isaSet);
|
||||
|
||||
/**
|
||||
* @brief Returns the specified isa-extension string.
|
||||
*
|
||||
* @param isaExt The isa-extension.
|
||||
*
|
||||
* @return The isa-extension string or @c NULL, if an invalid isa-extension was passed.
|
||||
*/
|
||||
ZYDIS_EXPORT const char* ZydisISAExtGetString(ZydisISAExt isaExt);
|
||||
|
||||
/* ============================================================================================== */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ZYDIS_METAINFO_H */
|
|
@ -43,12 +43,7 @@ extern "C" {
|
|||
/* Enums and types */
|
||||
/* ============================================================================================== */
|
||||
|
||||
/**
|
||||
* @brief Defines the @c ZydisMnemonic datatype.
|
||||
*/
|
||||
typedef uint16_t ZydisMnemonic;
|
||||
|
||||
#include <Zydis/Generated/MnemonicDefines.h>
|
||||
#include <Zydis/Generated/EnumMnemonic.h>
|
||||
|
||||
/* ============================================================================================== */
|
||||
/* Exported functions */
|
||||
|
|
|
@ -142,7 +142,16 @@ enum ZydisRegisters
|
|||
ZYDIS_REGISTER_K4, ZYDIS_REGISTER_K5, ZYDIS_REGISTER_K6, ZYDIS_REGISTER_K7,
|
||||
// Bound registers
|
||||
ZYDIS_REGISTER_BND0, ZYDIS_REGISTER_BND1, ZYDIS_REGISTER_BND2, ZYDIS_REGISTER_BND3,
|
||||
ZYDIS_REGISTER_BNDCFG, ZYDIS_REGISTER_BNDSTATUS
|
||||
ZYDIS_REGISTER_BNDCFG, ZYDIS_REGISTER_BNDSTATUS,
|
||||
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
ZYDIS_REGISTER_MAX_VALUE = ZYDIS_REGISTER_BNDSTATUS,
|
||||
/**
|
||||
* @brief Maximum amount of bits occupied by an integer from this enum.
|
||||
*/
|
||||
ZYDIS_REGISTER_MAX_BITS = 8
|
||||
};
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
@ -227,7 +236,11 @@ enum ZydisRegisterClasses
|
|||
/**
|
||||
* @brief Bound registers.
|
||||
*/
|
||||
ZYDIS_REGCLASS_BOUND
|
||||
ZYDIS_REGCLASS_BOUND,
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
ZYDIS_REGCLASS_MAX_VALUE = ZYDIS_REGCLASS_BOUND
|
||||
};
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
|
|
@ -93,7 +93,11 @@ enum ZydisMachineModes
|
|||
/**
|
||||
* @brief 16 bit real mode.
|
||||
*/
|
||||
ZYDIS_MACHINE_MODE_REAL_16 = 16
|
||||
ZYDIS_MACHINE_MODE_REAL_16 = 16,
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
ZYDIS_MACHINE_MODE_MAX_VALUE = ZYDIS_MACHINE_MODE_LONG_64
|
||||
};
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
@ -113,7 +117,8 @@ enum ZydisAddressWidths
|
|||
ZYDIS_ADDRESS_WIDTH_INVALID = 0,
|
||||
ZYDIS_ADDRESS_WIDTH_16 = 16,
|
||||
ZYDIS_ADDRESS_WIDTH_32 = 32,
|
||||
ZYDIS_ADDRESS_WIDTH_64 = 64
|
||||
ZYDIS_ADDRESS_WIDTH_64 = 64,
|
||||
ZYDIS_ADDRESS_WIDTH_MAX_VALUE = ZYDIS_ADDRESS_WIDTH_64
|
||||
};
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
@ -138,7 +143,8 @@ enum ZydisElementTypes
|
|||
ZYDIS_ELEMENT_TYPE_FLOAT32,
|
||||
ZYDIS_ELEMENT_TYPE_FLOAT64,
|
||||
ZYDIS_ELEMENT_TYPE_FLOAT80,
|
||||
ZYDIS_ELEMENT_TYPE_LONGBCD
|
||||
ZYDIS_ELEMENT_TYPE_LONGBCD,
|
||||
ZYDIS_ELEMENT_TYPE_MAX_VALUE = ZYDIS_ELEMENT_TYPE_LONGBCD
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -179,7 +185,11 @@ enum ZydisOperandTypes
|
|||
/**
|
||||
* @brief The operand is an immediate operand.
|
||||
*/
|
||||
ZYDIS_OPERAND_TYPE_IMMEDIATE
|
||||
ZYDIS_OPERAND_TYPE_IMMEDIATE,
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
ZYDIS_OPERAND_TYPE_MAX_VALUE = ZYDIS_OPERAND_TYPE_IMMEDIATE
|
||||
};
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
@ -230,7 +240,8 @@ enum ZydisOperandEncodings
|
|||
ZYDIS_OPERAND_ENCODING_JIMM64,
|
||||
ZYDIS_OPERAND_ENCODING_JIMM16_32_64,
|
||||
ZYDIS_OPERAND_ENCODING_JIMM32_32_64,
|
||||
ZYDIS_OPERAND_ENCODING_JIMM16_32_32
|
||||
ZYDIS_OPERAND_ENCODING_JIMM16_32_32,
|
||||
ZYDIS_OPERAND_ENCODING_MAX_VALUE = ZYDIS_OPERAND_ENCODING_JIMM16_32_32
|
||||
};
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
@ -259,7 +270,11 @@ enum ZydisOperandVisibilities
|
|||
/**
|
||||
* @brief The operand is part of the opcode, and not typically listed as an operand.
|
||||
*/
|
||||
ZYDIS_OPERAND_VISIBILITY_HIDDEN
|
||||
ZYDIS_OPERAND_VISIBILITY_HIDDEN,
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
ZYDIS_OPERAND_VISIBILITY_MAX_VALUE = ZYDIS_OPERAND_VISIBILITY_HIDDEN
|
||||
};
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
@ -304,7 +319,25 @@ enum ZydisOperandActions
|
|||
/**
|
||||
* @brief The operand is written and conditionally read by the instruction (must write).
|
||||
*/
|
||||
ZYDIS_OPERAND_ACTION_CONDREAD_WRITE
|
||||
ZYDIS_OPERAND_ACTION_CONDREAD_WRITE,
|
||||
|
||||
/**
|
||||
* @brief Mask combining all writing access flags.
|
||||
*/
|
||||
ZYDIS_OPERAND_ACTION_MASK_WRITE = ZYDIS_OPERAND_ACTION_WRITE |
|
||||
ZYDIS_OPERAND_ACTION_READWRITE | ZYDIS_OPERAND_ACTION_CONDWRITE |
|
||||
ZYDIS_OPERAND_ACTION_READ_CONDWRITE | ZYDIS_OPERAND_ACTION_CONDREAD_WRITE,
|
||||
/**
|
||||
* @brief Mask combining all reading access flags.
|
||||
*/
|
||||
ZYDIS_OPERAND_ACTION_MASK_READ = ZYDIS_OPERAND_ACTION_READ | ZYDIS_OPERAND_ACTION_READWRITE |
|
||||
ZYDIS_OPERAND_ACTION_CONDREAD | ZYDIS_OPERAND_ACTION_READ_CONDWRITE |
|
||||
ZYDIS_OPERAND_ACTION_CONDREAD_WRITE,
|
||||
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
ZYDIS_OPERAND_ACTION_MAX_VALUE = ZYDIS_OPERAND_ACTION_CONDREAD_WRITE
|
||||
};
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
@ -345,7 +378,11 @@ enum ZydisInstructionEncodings
|
|||
/**
|
||||
* @brief The instruction uses the MVEX-encoding.
|
||||
*/
|
||||
ZYDIS_INSTRUCTION_ENCODING_MVEX
|
||||
ZYDIS_INSTRUCTION_ENCODING_MVEX,
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
ZYDIS_INSTRUCTION_ENCODING_MAX_VALUE = ZYDIS_INSTRUCTION_ENCODING_MVEX
|
||||
};
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
@ -369,7 +406,8 @@ enum ZydisOpcodeMaps
|
|||
ZYDIS_OPCODE_MAP_0F0F,
|
||||
ZYDIS_OPCODE_MAP_XOP8,
|
||||
ZYDIS_OPCODE_MAP_XOP9,
|
||||
ZYDIS_OPCODE_MAP_XOPA
|
||||
ZYDIS_OPCODE_MAP_XOPA,
|
||||
ZYDIS_OPCODE_MAP_MAX_VALUE = ZYDIS_OPCODE_MAP_XOP9
|
||||
};
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
|
|
@ -59,7 +59,7 @@ enum ZydisStatusCode
|
|||
/**
|
||||
* @brief The operation completed successfully.
|
||||
*/
|
||||
ZYDIS_STATUS_SUCCESS = 0x00000000,
|
||||
ZYDIS_STATUS_SUCCESS = 0x00000000,
|
||||
/**
|
||||
* @brief An invalid parameter was passed to a function.
|
||||
*/
|
||||
|
@ -139,7 +139,10 @@ enum ZydisStatusCode
|
|||
/**
|
||||
* @brief The base value for user-defined status codes.
|
||||
*/
|
||||
ZYDIS_STATUS_USER = 0x10000000
|
||||
ZYDIS_STATUS_USER = 0x10000000
|
||||
|
||||
// Max value entry intentionally omitted since users might
|
||||
// define custom error codes for formatter hooks.
|
||||
};
|
||||
|
||||
/* ============================================================================================== */
|
||||
|
@ -166,7 +169,7 @@ enum ZydisStatusCode
|
|||
{ \
|
||||
return s; \
|
||||
} \
|
||||
} while(0)
|
||||
} while (0)
|
||||
|
||||
/* ============================================================================================== */
|
||||
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
#ifndef ZYDIS_UTILS_H
|
||||
#define ZYDIS_UTILS_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <Zydis/Defines.h>
|
||||
#include <Zydis/Status.h>
|
||||
#include <Zydis/DecoderTypes.h>
|
||||
|
@ -46,32 +45,37 @@ extern "C" {
|
|||
/* ============================================================================================== */
|
||||
|
||||
/**
|
||||
* @brief Calculates the absolute target-address of an relative instruction operand.
|
||||
* @brief Calculates the absolute target-address for the given instruction operand.
|
||||
*
|
||||
* @param instruction A pointer to the @c ZydisDecodedInstruction struct.
|
||||
* @param operand A pointer to the @c ZydisDecodedOperand struct.
|
||||
* @param address A pointer to the memory that receives the absolute target-address.
|
||||
*
|
||||
* @return A zydis status code
|
||||
* @return A zydis status code.
|
||||
*
|
||||
* You should use this function in the following cases:
|
||||
* - `IMM` operands with relative address (e.g. `JMP`, `CALL`, ...)
|
||||
* - `MEM` operands with RIP/EIP-relative address (e.g. `MOV RAX, [RIP+0x12345678]`)
|
||||
* - `MEM` operands with absolute address (e.g. `MOV RAX, [0x12345678]`)
|
||||
* - The displacement needs to get truncated and zero extended
|
||||
*/
|
||||
ZYDIS_EXPORT ZydisStatus ZydisUtilsCalcAbsoluteTargetAddress(
|
||||
const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand,
|
||||
uint64_t* address);
|
||||
ZYDIS_EXPORT ZydisStatus ZydisCalcAbsoluteAddress(const ZydisDecodedInstruction* instruction,
|
||||
const ZydisDecodedOperand* operand, uint64_t* address);
|
||||
|
||||
/* ============================================================================================== */
|
||||
/* Flags */
|
||||
/* ============================================================================================== */
|
||||
|
||||
/**
|
||||
* @brief Returns a mask of CPU-flags matching the given `action`.
|
||||
* @brief Returns a mask of accessed CPU-flags matching the given `action`.
|
||||
*
|
||||
* @param instruction A pointer to the @c ZydisDecodedInstruction struct.
|
||||
* @param action The CPU-flag action.
|
||||
* @param flags A pointer to the variable that receives the flag mask.
|
||||
*
|
||||
* @return A zydis status code
|
||||
* @return A zydis status code.
|
||||
*/
|
||||
ZYDIS_EXPORT ZydisStatus ZydisGetCPUFlagsByAction(const ZydisDecodedInstruction* instruction,
|
||||
ZYDIS_EXPORT ZydisStatus ZydisGetAccessedFlagsByAction(const ZydisDecodedInstruction* instruction,
|
||||
ZydisCPUFlagAction action, ZydisCPUFlagMask* flags);
|
||||
|
||||
/* ============================================================================================== */
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#include <Zydis/DecoderTypes.h>
|
||||
#include <Zydis/Defines.h>
|
||||
#include <Zydis/Formatter.h>
|
||||
#include <Zydis/MetaInfo.h>
|
||||
#include <Zydis/Mnemonic.h>
|
||||
#include <Zydis/Register.h>
|
||||
#include <Zydis/SharedTypes.h>
|
||||
|
|
209
src/Decoder.c
209
src/Decoder.c
|
@ -320,7 +320,7 @@ static ZydisStatus ZydisInputNextBytes(ZydisDecoderContext* context,
|
|||
ZYDIS_ASSERT(instruction);
|
||||
ZYDIS_ASSERT(value);
|
||||
|
||||
if (instruction->length >= ZYDIS_MAX_INSTRUCTION_LENGTH)
|
||||
if (instruction->length + numberOfBytes > ZYDIS_MAX_INSTRUCTION_LENGTH)
|
||||
{
|
||||
return ZYDIS_STATUS_INSTRUCTION_TOO_LONG;
|
||||
}
|
||||
|
@ -592,7 +592,7 @@ static ZydisStatus ZydisDecodeMVEX(ZydisDecoderContext* context,
|
|||
ZYDIS_ASSERT(instruction);
|
||||
ZYDIS_ASSERT(data[0] == 0x62);
|
||||
|
||||
instruction->attributes |= ZYDIS_ATTRIB_HAS_EVEX;
|
||||
instruction->attributes |= ZYDIS_ATTRIB_HAS_MVEX;
|
||||
instruction->raw.mvex.isDecoded = ZYDIS_TRUE;
|
||||
instruction->raw.mvex.data[0] = 0x62;
|
||||
instruction->raw.mvex.data[1] = data[1];
|
||||
|
@ -920,9 +920,21 @@ static uint8_t ZydisCalcRegisterId(ZydisDecoderContext* context,
|
|||
{
|
||||
ZYDIS_ASSERT(instruction->raw.modrm.isDecoded);
|
||||
uint8_t value = instruction->raw.modrm.reg;
|
||||
if (registerClass != ZYDIS_REGCLASS_MASK)
|
||||
switch (registerClass)
|
||||
{
|
||||
value |= (context->cache.R << 3);
|
||||
case ZYDIS_REGCLASS_GPR8:
|
||||
case ZYDIS_REGCLASS_GPR16:
|
||||
case ZYDIS_REGCLASS_GPR32:
|
||||
case ZYDIS_REGCLASS_GPR64:
|
||||
case ZYDIS_REGCLASS_XMM:
|
||||
case ZYDIS_REGCLASS_YMM:
|
||||
case ZYDIS_REGCLASS_ZMM:
|
||||
case ZYDIS_REGCLASS_CONTROL:
|
||||
case ZYDIS_REGCLASS_DEBUG:
|
||||
value |= (context->cache.R << 3);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
// R' only exists for EVEX and MVEX. No encoding check needed
|
||||
switch (registerClass)
|
||||
|
@ -954,9 +966,21 @@ static uint8_t ZydisCalcRegisterId(ZydisDecoderContext* context,
|
|||
{
|
||||
ZYDIS_ASSERT(instruction->raw.modrm.isDecoded);
|
||||
uint8_t value = instruction->raw.modrm.rm;
|
||||
if (registerClass != ZYDIS_REGCLASS_MASK)
|
||||
switch (registerClass)
|
||||
{
|
||||
value |= (context->cache.B << 3);
|
||||
case ZYDIS_REGCLASS_GPR8:
|
||||
case ZYDIS_REGCLASS_GPR16:
|
||||
case ZYDIS_REGCLASS_GPR32:
|
||||
case ZYDIS_REGCLASS_GPR64:
|
||||
case ZYDIS_REGCLASS_XMM:
|
||||
case ZYDIS_REGCLASS_YMM:
|
||||
case ZYDIS_REGCLASS_ZMM:
|
||||
case ZYDIS_REGCLASS_CONTROL:
|
||||
case ZYDIS_REGCLASS_DEBUG:
|
||||
value |= (context->cache.B << 3);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
// We have to check the instruction-encoding, because the extension by X is only valid
|
||||
// for EVEX and MVEX instructions
|
||||
|
@ -1028,8 +1052,6 @@ static uint8_t ZydisCalcRegisterId(ZydisDecoderContext* context,
|
|||
default:
|
||||
ZYDIS_UNREACHABLE;
|
||||
}
|
||||
ZYDIS_UNREACHABLE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1060,7 +1082,8 @@ static void ZydisSetOperandSizeAndElementInfo(ZydisDecoderContext* context,
|
|||
} else
|
||||
{
|
||||
operand->size = (context->decoder->machineMode == 64) ?
|
||||
ZydisRegisterGetWidth64(operand->reg) : ZydisRegisterGetWidth(operand->reg);
|
||||
ZydisRegisterGetWidth64(operand->reg.value) :
|
||||
ZydisRegisterGetWidth(operand->reg.value);
|
||||
}
|
||||
operand->elementType = ZYDIS_ELEMENT_TYPE_INT;
|
||||
operand->elementSize = operand->size;
|
||||
|
@ -1131,7 +1154,7 @@ static void ZydisSetOperandSizeAndElementInfo(ZydisDecoderContext* context,
|
|||
ZYDIS_ASSERT(definition->elementType == ZYDIS_IELEMENT_TYPE_VARIABLE);
|
||||
ZYDIS_ASSERT(instruction->avx.vectorLength == 512);
|
||||
|
||||
switch (instruction->avx.conversionMode)
|
||||
switch (instruction->avx.conversion.mode)
|
||||
{
|
||||
case ZYDIS_CONVERSION_MODE_INVALID:
|
||||
operand->size = 512;
|
||||
|
@ -1283,30 +1306,33 @@ static ZydisStatus ZydisDecodeOperandRegister(ZydisDecodedInstruction* instructi
|
|||
{
|
||||
if ((instruction->attributes & ZYDIS_ATTRIB_HAS_REX) && (registerId >= 4))
|
||||
{
|
||||
operand->reg = ZYDIS_REGISTER_SPL + (registerId - 4);
|
||||
operand->reg.value = ZYDIS_REGISTER_SPL + (registerId - 4);
|
||||
} else
|
||||
{
|
||||
operand->reg = ZYDIS_REGISTER_AL + registerId;
|
||||
operand->reg.value = ZYDIS_REGISTER_AL + registerId;
|
||||
}
|
||||
if (operand->reg > ZYDIS_REGISTER_R15B)
|
||||
if (operand->reg.value > ZYDIS_REGISTER_R15B)
|
||||
{
|
||||
return ZYDIS_STATUS_BAD_REGISTER;
|
||||
}
|
||||
} else
|
||||
{
|
||||
operand->reg = ZydisRegisterEncode(registerClass, registerId);
|
||||
if (!operand->reg)
|
||||
operand->reg.value = ZydisRegisterEncode(registerClass, registerId);
|
||||
if (!operand->reg.value)
|
||||
{
|
||||
return ZYDIS_STATUS_BAD_REGISTER;
|
||||
}
|
||||
if ((operand->reg == ZYDIS_REGISTER_CR1) ||
|
||||
((operand->reg >= ZYDIS_REGISTER_CR5) && (operand->reg <= ZYDIS_REGISTER_CR15) &&
|
||||
(operand->reg != ZYDIS_REGISTER_CR8)))
|
||||
if ((operand->reg.value == ZYDIS_REGISTER_CR1) ||
|
||||
((operand->reg.value >= ZYDIS_REGISTER_CR5) &&
|
||||
(operand->reg.value <= ZYDIS_REGISTER_CR15) &&
|
||||
(operand->reg.value != ZYDIS_REGISTER_CR8)))
|
||||
{
|
||||
return ZYDIS_STATUS_BAD_REGISTER;
|
||||
}
|
||||
if ((operand->reg == ZYDIS_REGISTER_DR4) || (operand->reg == ZYDIS_REGISTER_DR5) ||
|
||||
((operand->reg >= ZYDIS_REGISTER_DR8) && (operand->reg <= ZYDIS_REGISTER_DR15)))
|
||||
if ((operand->reg.value == ZYDIS_REGISTER_DR4) ||
|
||||
(operand->reg.value == ZYDIS_REGISTER_DR5) ||
|
||||
((operand->reg.value >= ZYDIS_REGISTER_DR8) &&
|
||||
(operand->reg.value <= ZYDIS_REGISTER_DR15)))
|
||||
{
|
||||
return ZYDIS_STATUS_BAD_REGISTER;
|
||||
}
|
||||
|
@ -1528,7 +1554,7 @@ static void ZydisDecodeOperandImplicitRegister(ZydisDecoderContext* context,
|
|||
switch (definition->op.reg.type)
|
||||
{
|
||||
case ZYDIS_IMPLREG_TYPE_STATIC:
|
||||
operand->reg = definition->op.reg.reg.reg;
|
||||
operand->reg.value = definition->op.reg.reg.reg;
|
||||
break;
|
||||
case ZYDIS_IMPLREG_TYPE_GPR_OSZ:
|
||||
{
|
||||
|
@ -1538,33 +1564,34 @@ static void ZydisDecodeOperandImplicitRegister(ZydisDecoderContext* context,
|
|||
ZYDIS_REGCLASS_GPR32,
|
||||
ZYDIS_REGCLASS_GPR64
|
||||
};
|
||||
operand->reg = ZydisRegisterEncode(lookup[context->eoszIndex], definition->op.reg.reg.id);
|
||||
operand->reg.value =
|
||||
ZydisRegisterEncode(lookup[context->eoszIndex], definition->op.reg.reg.id);
|
||||
break;
|
||||
}
|
||||
case ZYDIS_IMPLREG_TYPE_GPR_ASZ:
|
||||
operand->reg = ZydisRegisterEncode(
|
||||
operand->reg.value = ZydisRegisterEncode(
|
||||
(instruction->addressWidth == 16) ? ZYDIS_REGCLASS_GPR16 :
|
||||
(instruction->addressWidth == 32) ? ZYDIS_REGCLASS_GPR32 : ZYDIS_REGCLASS_GPR64,
|
||||
definition->op.reg.reg.id);
|
||||
break;
|
||||
case ZYDIS_IMPLREG_TYPE_GPR_SSZ:
|
||||
operand->reg = ZydisRegisterEncode(
|
||||
operand->reg.value = ZydisRegisterEncode(
|
||||
(context->decoder->addressWidth == 16) ? ZYDIS_REGCLASS_GPR16 :
|
||||
(context->decoder->addressWidth == 32) ? ZYDIS_REGCLASS_GPR32 : ZYDIS_REGCLASS_GPR64,
|
||||
definition->op.reg.reg.id);
|
||||
break;
|
||||
case ZYDIS_IMPLREG_TYPE_IP_ASZ:
|
||||
operand->reg =
|
||||
operand->reg.value =
|
||||
(instruction->addressWidth == 16) ? ZYDIS_REGISTER_IP :
|
||||
(instruction->addressWidth == 32) ? ZYDIS_REGISTER_EIP : ZYDIS_REGISTER_RIP;
|
||||
break;
|
||||
case ZYDIS_IMPLREG_TYPE_IP_SSZ:
|
||||
operand->reg =
|
||||
operand->reg.value =
|
||||
(context->decoder->addressWidth == 16) ? ZYDIS_REGISTER_EIP :
|
||||
(context->decoder->addressWidth == 32) ? ZYDIS_REGISTER_EIP : ZYDIS_REGISTER_RIP;
|
||||
break;
|
||||
case ZYDIS_IMPLREG_TYPE_FLAGS_SSZ:
|
||||
operand->reg =
|
||||
operand->reg.value =
|
||||
(context->decoder->addressWidth == 16) ? ZYDIS_REGISTER_FLAGS :
|
||||
(context->decoder->addressWidth == 32) ? ZYDIS_REGISTER_EFLAGS : ZYDIS_REGISTER_RFLAGS;
|
||||
break;
|
||||
|
@ -1697,19 +1724,24 @@ static ZydisStatus ZydisDecodeOperands(ZydisDecoderContext* context,
|
|||
registerClass = ZYDIS_REGCLASS_GPR64;
|
||||
break;
|
||||
case ZYDIS_SEMANTIC_OPTYPE_GPR16_32_64:
|
||||
ZYDIS_ASSERT((instruction->operandWidth == 16) || (instruction->operandWidth == 32) ||
|
||||
(instruction->operandWidth == 64));
|
||||
registerClass =
|
||||
(instruction->operandSize == 16) ? ZYDIS_REGCLASS_GPR16 : (
|
||||
(instruction->operandSize == 32) ? ZYDIS_REGCLASS_GPR32 : ZYDIS_REGCLASS_GPR64);
|
||||
(instruction->operandWidth == 16) ? ZYDIS_REGCLASS_GPR16 : (
|
||||
(instruction->operandWidth == 32) ? ZYDIS_REGCLASS_GPR32 : ZYDIS_REGCLASS_GPR64);
|
||||
break;
|
||||
case ZYDIS_SEMANTIC_OPTYPE_GPR32_32_64:
|
||||
ZYDIS_ASSERT((instruction->operandWidth == 16) || (instruction->operandWidth == 32) ||
|
||||
(instruction->operandWidth == 64));
|
||||
registerClass =
|
||||
(instruction->operandSize == 16) ? ZYDIS_REGCLASS_GPR32 : (
|
||||
(instruction->operandSize == 32) ? ZYDIS_REGCLASS_GPR32: ZYDIS_REGCLASS_GPR64);
|
||||
(instruction->operandWidth == 16) ? ZYDIS_REGCLASS_GPR32 : (
|
||||
(instruction->operandWidth == 32) ? ZYDIS_REGCLASS_GPR32: ZYDIS_REGCLASS_GPR64);
|
||||
break;
|
||||
case ZYDIS_SEMANTIC_OPTYPE_GPR16_32_32:
|
||||
ZYDIS_ASSERT((instruction->operandWidth == 16) || (instruction->operandWidth == 32) ||
|
||||
(instruction->operandWidth == 64));
|
||||
registerClass =
|
||||
(instruction->operandSize == 16) ? ZYDIS_REGCLASS_GPR16 : (
|
||||
(instruction->operandSize == 32) ? ZYDIS_REGCLASS_GPR32 : ZYDIS_REGCLASS_GPR32);
|
||||
(instruction->operandWidth == 16) ? ZYDIS_REGCLASS_GPR16 : ZYDIS_REGCLASS_GPR32;
|
||||
break;
|
||||
case ZYDIS_SEMANTIC_OPTYPE_FPR:
|
||||
registerClass = ZYDIS_REGCLASS_X87;
|
||||
|
@ -1939,8 +1971,8 @@ FinalizeOperand:
|
|||
(instruction->avx.mask.mode == ZYDIS_MASK_MODE_MERGE) &&
|
||||
(instruction->operandCount >= 3) &&
|
||||
(instruction->operands[1].type == ZYDIS_OPERAND_TYPE_REGISTER) &&
|
||||
(instruction->operands[1].reg >= ZYDIS_REGISTER_K1) &&
|
||||
(instruction->operands[1].reg <= ZYDIS_REGISTER_K7))
|
||||
(instruction->operands[1].reg.value >= ZYDIS_REGISTER_K1) &&
|
||||
(instruction->operands[1].reg.value <= ZYDIS_REGISTER_K7))
|
||||
{
|
||||
switch (instruction->operands[0].type)
|
||||
{
|
||||
|
@ -1997,6 +2029,14 @@ static void ZydisSetAttributes(ZydisDecoderContext* context, ZydisDecodedInstruc
|
|||
{
|
||||
instruction->attributes |= ZYDIS_ATTRIB_IS_PRIVILEGED;
|
||||
}
|
||||
if (def->isFarBranch)
|
||||
{
|
||||
ZYDIS_ASSERT((instruction->meta.category == ZYDIS_CATEGORY_CALL) ||
|
||||
(instruction->meta.category == ZYDIS_CATEGORY_COND_BR) ||
|
||||
(instruction->meta.category == ZYDIS_CATEGORY_UNCOND_BR) ||
|
||||
(instruction->meta.category == ZYDIS_CATEGORY_RET));
|
||||
instruction->attributes |= ZYDIS_ATTRIB_IS_FAR_BRANCH;
|
||||
}
|
||||
if (def->acceptsLock)
|
||||
{
|
||||
instruction->attributes |= ZYDIS_ATTRIB_ACCEPTS_LOCK;
|
||||
|
@ -2181,9 +2221,9 @@ static void ZydisSetAccessedFlags(ZydisDecodedInstruction* instruction,
|
|||
const ZydisAccessedFlags* flags;
|
||||
ZydisGetAccessedFlags(definition, &flags);
|
||||
|
||||
ZYDIS_ASSERT(ZYDIS_ARRAY_SIZE(instruction->flags) == ZYDIS_ARRAY_SIZE(flags->action));
|
||||
ZYDIS_ASSERT(ZYDIS_ARRAY_SIZE(instruction->accessedFlags) == ZYDIS_ARRAY_SIZE(flags->action));
|
||||
|
||||
memcpy(&instruction->flags, &flags->action, ZYDIS_ARRAY_SIZE(flags->action));
|
||||
memcpy(&instruction->accessedFlags, &flags->action, ZYDIS_ARRAY_SIZE(flags->action));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2286,7 +2326,7 @@ static void ZydisSetAVXInformation(ZydisDecoderContext* context,
|
|||
(const ZydisInstructionDefinitionEVEX*)definition;
|
||||
|
||||
// Vector length
|
||||
uint8_t vectorLength = vectorLength = context->cache.LL;;
|
||||
uint8_t vectorLength = context->cache.LL;
|
||||
if (def->vectorLength)
|
||||
{
|
||||
vectorLength = def->vectorLength - 1;
|
||||
|
@ -2659,7 +2699,7 @@ static void ZydisSetAVXInformation(ZydisDecoderContext* context,
|
|||
// Noting to do here
|
||||
break;
|
||||
case ZYDIS_EVEX_FUNC_RC:
|
||||
instruction->avx.roundingMode = ZYDIS_ROUNDING_MODE_RN + context->cache.LL;
|
||||
instruction->avx.rounding.mode = ZYDIS_ROUNDING_MODE_RN + context->cache.LL;
|
||||
// Intentional fallthrough
|
||||
case ZYDIS_EVEX_FUNC_SAE:
|
||||
instruction->avx.hasSAE = ZYDIS_TRUE;
|
||||
|
@ -2816,7 +2856,7 @@ static void ZydisSetAVXInformation(ZydisDecoderContext* context,
|
|||
// Nothing to do here
|
||||
break;
|
||||
case ZYDIS_MVEX_FUNC_RC:
|
||||
instruction->avx.roundingMode = ZYDIS_ROUNDING_MODE_RN + instruction->raw.mvex.SSS;
|
||||
instruction->avx.rounding.mode = ZYDIS_ROUNDING_MODE_RN + instruction->raw.mvex.SSS;
|
||||
break;
|
||||
case ZYDIS_MVEX_FUNC_SAE:
|
||||
if (instruction->raw.mvex.SSS >= 4)
|
||||
|
@ -2826,7 +2866,7 @@ static void ZydisSetAVXInformation(ZydisDecoderContext* context,
|
|||
break;
|
||||
case ZYDIS_MVEX_FUNC_SWIZZLE_32:
|
||||
case ZYDIS_MVEX_FUNC_SWIZZLE_64:
|
||||
instruction->avx.swizzleMode = ZYDIS_SWIZZLE_MODE_DCBA + instruction->raw.mvex.SSS;
|
||||
instruction->avx.swizzle.mode = ZYDIS_SWIZZLE_MODE_DCBA + instruction->raw.mvex.SSS;
|
||||
break;
|
||||
case ZYDIS_MVEX_FUNC_SF_32:
|
||||
case ZYDIS_MVEX_FUNC_SF_32_BCST:
|
||||
|
@ -2842,19 +2882,19 @@ static void ZydisSetAVXInformation(ZydisDecoderContext* context,
|
|||
instruction->avx.broadcast.mode = ZYDIS_BROADCAST_MODE_4_TO_16;
|
||||
break;
|
||||
case 3:
|
||||
instruction->avx.conversionMode = ZYDIS_CONVERSION_MODE_FLOAT16;
|
||||
instruction->avx.conversion.mode = ZYDIS_CONVERSION_MODE_FLOAT16;
|
||||
break;
|
||||
case 4:
|
||||
instruction->avx.conversionMode = ZYDIS_CONVERSION_MODE_UINT8;
|
||||
instruction->avx.conversion.mode = ZYDIS_CONVERSION_MODE_UINT8;
|
||||
break;
|
||||
case 5:
|
||||
instruction->avx.conversionMode = ZYDIS_CONVERSION_MODE_SINT8;
|
||||
instruction->avx.conversion.mode = ZYDIS_CONVERSION_MODE_SINT8;
|
||||
break;
|
||||
case 6:
|
||||
instruction->avx.conversionMode = ZYDIS_CONVERSION_MODE_UINT16;
|
||||
instruction->avx.conversion.mode = ZYDIS_CONVERSION_MODE_UINT16;
|
||||
break;
|
||||
case 7:
|
||||
instruction->avx.conversionMode = ZYDIS_CONVERSION_MODE_SINT16;
|
||||
instruction->avx.conversion.mode = ZYDIS_CONVERSION_MODE_SINT16;
|
||||
break;
|
||||
default:
|
||||
ZYDIS_UNREACHABLE;
|
||||
|
@ -2874,16 +2914,16 @@ static void ZydisSetAVXInformation(ZydisDecoderContext* context,
|
|||
instruction->avx.broadcast.mode = ZYDIS_BROADCAST_MODE_4_TO_16;
|
||||
break;
|
||||
case 4:
|
||||
instruction->avx.conversionMode = ZYDIS_CONVERSION_MODE_UINT8;
|
||||
instruction->avx.conversion.mode = ZYDIS_CONVERSION_MODE_UINT8;
|
||||
break;
|
||||
case 5:
|
||||
instruction->avx.conversionMode = ZYDIS_CONVERSION_MODE_SINT8;
|
||||
instruction->avx.conversion.mode = ZYDIS_CONVERSION_MODE_SINT8;
|
||||
break;
|
||||
case 6:
|
||||
instruction->avx.conversionMode = ZYDIS_CONVERSION_MODE_UINT16;
|
||||
instruction->avx.conversion.mode = ZYDIS_CONVERSION_MODE_UINT16;
|
||||
break;
|
||||
case 7:
|
||||
instruction->avx.conversionMode = ZYDIS_CONVERSION_MODE_SINT16;
|
||||
instruction->avx.conversion.mode = ZYDIS_CONVERSION_MODE_SINT16;
|
||||
break;
|
||||
default:
|
||||
ZYDIS_UNREACHABLE;
|
||||
|
@ -2912,19 +2952,19 @@ static void ZydisSetAVXInformation(ZydisDecoderContext* context,
|
|||
case 0:
|
||||
break;
|
||||
case 3:
|
||||
instruction->avx.conversionMode = ZYDIS_CONVERSION_MODE_FLOAT16;
|
||||
instruction->avx.conversion.mode = ZYDIS_CONVERSION_MODE_FLOAT16;
|
||||
break;
|
||||
case 4:
|
||||
instruction->avx.conversionMode = ZYDIS_CONVERSION_MODE_UINT8;
|
||||
instruction->avx.conversion.mode = ZYDIS_CONVERSION_MODE_UINT8;
|
||||
break;
|
||||
case 5:
|
||||
instruction->avx.conversionMode = ZYDIS_CONVERSION_MODE_SINT8;
|
||||
instruction->avx.conversion.mode = ZYDIS_CONVERSION_MODE_SINT8;
|
||||
break;
|
||||
case 6:
|
||||
instruction->avx.conversionMode = ZYDIS_CONVERSION_MODE_UINT16;
|
||||
instruction->avx.conversion.mode = ZYDIS_CONVERSION_MODE_UINT16;
|
||||
break;
|
||||
case 7:
|
||||
instruction->avx.conversionMode = ZYDIS_CONVERSION_MODE_SINT16;
|
||||
instruction->avx.conversion.mode = ZYDIS_CONVERSION_MODE_SINT16;
|
||||
break;
|
||||
default:
|
||||
ZYDIS_UNREACHABLE;
|
||||
|
@ -2940,16 +2980,16 @@ static void ZydisSetAVXInformation(ZydisDecoderContext* context,
|
|||
case 0:
|
||||
break;
|
||||
case 4:
|
||||
instruction->avx.conversionMode = ZYDIS_CONVERSION_MODE_UINT8;
|
||||
instruction->avx.conversion.mode = ZYDIS_CONVERSION_MODE_UINT8;
|
||||
break;
|
||||
case 5:
|
||||
instruction->avx.conversionMode = ZYDIS_CONVERSION_MODE_SINT8;
|
||||
instruction->avx.conversion.mode = ZYDIS_CONVERSION_MODE_SINT8;
|
||||
break;
|
||||
case 6:
|
||||
instruction->avx.conversionMode = ZYDIS_CONVERSION_MODE_UINT16;
|
||||
instruction->avx.conversion.mode = ZYDIS_CONVERSION_MODE_UINT16;
|
||||
break;
|
||||
case 7:
|
||||
instruction->avx.conversionMode = ZYDIS_CONVERSION_MODE_SINT16;
|
||||
instruction->avx.conversion.mode = ZYDIS_CONVERSION_MODE_SINT16;
|
||||
break;
|
||||
default:
|
||||
ZYDIS_UNREACHABLE;
|
||||
|
@ -3154,6 +3194,7 @@ static ZydisStatus ZydisDecodeOptionalInstructionParts(ZydisDecoderContext* cont
|
|||
default:
|
||||
ZYDIS_UNREACHABLE;
|
||||
}
|
||||
break;
|
||||
case 32:
|
||||
case 64:
|
||||
hasSIB =
|
||||
|
@ -3205,7 +3246,7 @@ static ZydisStatus ZydisDecodeOptionalInstructionParts(ZydisDecoderContext* cont
|
|||
if (info->flags & ZYDIS_INSTR_ENC_FLAG_HAS_DISP)
|
||||
{
|
||||
ZYDIS_CHECK(ZydisReadDisplacement(
|
||||
context, instruction, info->disp.size[context->easzIndex]));
|
||||
context, instruction, info->disp.size[context->easzIndex]));
|
||||
}
|
||||
|
||||
if (info->flags & ZYDIS_INSTR_ENC_FLAG_HAS_IMM0)
|
||||
|
@ -3244,7 +3285,7 @@ static void ZydisSetEffectiveOperandSize(ZydisDecoderContext* context,
|
|||
ZYDIS_ASSERT(instruction);
|
||||
ZYDIS_ASSERT(definition);
|
||||
|
||||
static const uint8_t operandSizeMap[7][8] =
|
||||
static const uint8_t operandSizeMap[8][8] =
|
||||
{
|
||||
// Default for most instructions
|
||||
{
|
||||
|
@ -3257,6 +3298,17 @@ static void ZydisSetEffectiveOperandSize(ZydisDecoderContext* context,
|
|||
64, // 64 __ W1
|
||||
64 // 64 66 W1
|
||||
},
|
||||
// Operand size is forced to 8-bit (this is done later to preserve the `eoszIndex`)
|
||||
{
|
||||
16, // 16 __ W0
|
||||
32, // 16 66 W0
|
||||
32, // 32 __ W0
|
||||
16, // 32 66 W0
|
||||
32, // 64 __ W0
|
||||
16, // 64 66 W0
|
||||
64, // 64 __ W1
|
||||
64 // 64 66 W1
|
||||
},
|
||||
// Operand size override 0x66 is ignored
|
||||
{
|
||||
16, // 16 __ W0
|
||||
|
@ -3346,9 +3398,9 @@ static void ZydisSetEffectiveOperandSize(ZydisDecoderContext* context,
|
|||
ZYDIS_ASSERT(definition->operandSizeMap < ZYDIS_ARRAY_SIZE(operandSizeMap));
|
||||
ZYDIS_ASSERT(index < ZYDIS_ARRAY_SIZE(operandSizeMap[definition->operandSizeMap]));
|
||||
|
||||
instruction->operandSize = operandSizeMap[definition->operandSizeMap][index];
|
||||
instruction->operandWidth = operandSizeMap[definition->operandSizeMap][index];
|
||||
|
||||
switch (instruction->operandSize)
|
||||
switch (instruction->operandWidth)
|
||||
{
|
||||
case 16:
|
||||
context->eoszIndex = 0;
|
||||
|
@ -3362,6 +3414,12 @@ static void ZydisSetEffectiveOperandSize(ZydisDecoderContext* context,
|
|||
default:
|
||||
ZYDIS_UNREACHABLE;
|
||||
}
|
||||
|
||||
// TODO: Cleanup code and remove hardcoded condition
|
||||
if (definition->operandSizeMap == 1)
|
||||
{
|
||||
instruction->operandWidth = 8;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -4255,8 +4313,12 @@ static ZydisStatus ZydisDecodeInstruction(ZydisDecoderContext* context,
|
|||
ZYDIS_CHECK(ZydisCheckErrorConditions(context, instruction, definition));
|
||||
|
||||
instruction->mnemonic = definition->mnemonic;
|
||||
instruction->meta.category = definition->category;
|
||||
instruction->meta.isaSet = definition->isaSet;
|
||||
instruction->meta.isaExt = definition->isaExt;
|
||||
instruction->meta.exceptionClass = definition->exceptionClass;
|
||||
|
||||
if (context->decoder->decodeGranularity == ZYDIS_DECODE_GRANULARITY_FULL)
|
||||
if (context->decoder->granularity == ZYDIS_DECODE_GRANULARITY_FULL)
|
||||
{
|
||||
ZydisSetAttributes(context, instruction, definition);
|
||||
switch (instruction->encoding)
|
||||
|
@ -4271,7 +4333,8 @@ static ZydisStatus ZydisDecodeInstruction(ZydisDecoderContext* context,
|
|||
break;
|
||||
}
|
||||
ZYDIS_CHECK(ZydisDecodeOperands(context, instruction, definition));
|
||||
ZydisRegister reg = instruction->operands[instruction->operandCount - 1].reg;
|
||||
ZydisRegister reg =
|
||||
instruction->operands[instruction->operandCount - 1].reg.value;
|
||||
if ((reg == ZYDIS_REGISTER_FLAGS ) || (reg == ZYDIS_REGISTER_EFLAGS) ||
|
||||
(reg == ZYDIS_REGISTER_RFLAGS))
|
||||
{
|
||||
|
@ -4302,12 +4365,12 @@ ZydisStatus ZydisDecoderInit(ZydisDecoder* decoder, ZydisMachineMode machineMode
|
|||
}
|
||||
|
||||
ZydisStatus ZydisDecoderInitEx(ZydisDecoder* decoder, ZydisMachineMode machineMode,
|
||||
ZydisAddressWidth addressWidth, ZydisDecodeGranularity decodeGranularity)
|
||||
ZydisAddressWidth addressWidth, ZydisDecodeGranularity granularity)
|
||||
{
|
||||
if (!decoder || ((machineMode != 16) && (machineMode != 32) && (machineMode != 64)) ||
|
||||
((decodeGranularity != ZYDIS_DECODE_GRANULARITY_DEFAULT) &&
|
||||
(decodeGranularity != ZYDIS_DECODE_GRANULARITY_MINIMAL) &&
|
||||
(decodeGranularity != ZYDIS_DECODE_GRANULARITY_FULL)))
|
||||
((granularity != ZYDIS_DECODE_GRANULARITY_DEFAULT) &&
|
||||
(granularity != ZYDIS_DECODE_GRANULARITY_MINIMAL) &&
|
||||
(granularity != ZYDIS_DECODE_GRANULARITY_FULL)))
|
||||
{
|
||||
return ZYDIS_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
@ -4324,14 +4387,14 @@ ZydisStatus ZydisDecoderInitEx(ZydisDecoder* decoder, ZydisMachineMode machineMo
|
|||
return ZYDIS_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
}
|
||||
if (decodeGranularity == ZYDIS_DECODE_GRANULARITY_DEFAULT)
|
||||
if (granularity == ZYDIS_DECODE_GRANULARITY_DEFAULT)
|
||||
{
|
||||
decodeGranularity = ZYDIS_DECODE_GRANULARITY_FULL;
|
||||
granularity = ZYDIS_DECODE_GRANULARITY_FULL;
|
||||
}
|
||||
|
||||
decoder->machineMode = machineMode;
|
||||
decoder->addressWidth = addressWidth;
|
||||
decoder->decodeGranularity = decodeGranularity;
|
||||
decoder->granularity = granularity;
|
||||
|
||||
return ZYDIS_STATUS_SUCCESS;
|
||||
}
|
||||
|
@ -4357,13 +4420,11 @@ ZydisStatus ZydisDecoderDecodeBuffer(const ZydisDecoder* decoder, const void* bu
|
|||
context.lastSegmentPrefix = 0;
|
||||
context.mandatoryCandidate = 0;
|
||||
|
||||
void* userData = instruction->userData;
|
||||
memset(instruction, 0, sizeof(*instruction));
|
||||
instruction->machineMode = decoder->machineMode;
|
||||
instruction->stackWidth = decoder->addressWidth;
|
||||
instruction->encoding = ZYDIS_INSTRUCTION_ENCODING_DEFAULT;
|
||||
instruction->instrAddress = instructionPointer;
|
||||
instruction->userData = userData;
|
||||
|
||||
ZYDIS_CHECK(ZydisCollectOptionalPrefixes(&context, instruction));
|
||||
ZYDIS_CHECK(ZydisDecodeInstruction(&context, instruction));
|
||||
|
|
|
@ -239,7 +239,7 @@ extern const ZydisDecoderTreeNode filtersMVEXE[][2];
|
|||
/* Physical instruction encodings */
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
||||
#include <Generated/PhysicalEncodings.inc>
|
||||
#include <Generated/InstructionEncodings.inc>
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
/* Decoder tree */
|
||||
|
@ -252,7 +252,7 @@ extern const ZydisDecoderTreeNode filtersMVEXE[][2];
|
|||
#define ZYDIS_DEFINITION(encoding_id, id) \
|
||||
{ ZYDIS_NODETYPE_DEFINITION_MASK | encoding_id, id }
|
||||
|
||||
#include <Generated/InstructionFilters.inc>
|
||||
#include <Generated/DecoderTables.inc>
|
||||
|
||||
#undef ZYDIS_INVALID
|
||||
#undef ZYDIS_FILTER
|
||||
|
@ -335,9 +335,7 @@ const ZydisDecoderTreeNode* ZydisDecoderTreeGetChildNode(const ZydisDecoderTreeN
|
|||
return &filtersMVEXE[parent->value][index];
|
||||
default:
|
||||
ZYDIS_UNREACHABLE;
|
||||
}
|
||||
static const ZydisDecoderTreeNode invalid = { ZYDIS_NODETYPE_INVALID, 0x00000000 };
|
||||
return &invalid;
|
||||
}
|
||||
}
|
||||
|
||||
void ZydisGetInstructionEncodingInfo(const ZydisDecoderTreeNode* node,
|
||||
|
@ -345,8 +343,10 @@ void ZydisGetInstructionEncodingInfo(const ZydisDecoderTreeNode* node,
|
|||
{
|
||||
ZYDIS_ASSERT(node->type & ZYDIS_NODETYPE_DEFINITION_MASK);
|
||||
uint8_t class = (node->type) & 0x7F;
|
||||
ZYDIS_ASSERT(class < ZYDIS_ARRAY_SIZE(physicalEncodings));
|
||||
*info = &physicalEncodings[class];
|
||||
ZYDIS_ASSERT(class < ZYDIS_ARRAY_SIZE(instructionEncodings));
|
||||
*info = &instructionEncodings[class];
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
||||
/* ============================================================================================== */
|
||||
|
|
|
@ -24,8 +24,8 @@
|
|||
|
||||
***************************************************************************************************/
|
||||
|
||||
#ifndef ZYDIS_INSTRUCTIONTABLE_H
|
||||
#define ZYDIS_INSTRUCTIONTABLE_H
|
||||
#ifndef ZYDIS_DECODERDATA_H
|
||||
#define ZYDIS_DECODERDATA_H
|
||||
|
||||
#include <Zydis/Defines.h>
|
||||
#include <Zydis/DecoderTypes.h>
|
||||
|
@ -241,6 +241,8 @@ typedef struct ZydisInstructionEncodingInfo_
|
|||
} imm[2];
|
||||
} ZydisInstructionEncodingInfo;
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
||||
/* ============================================================================================== */
|
||||
/* Functions */
|
||||
/* ============================================================================================== */
|
||||
|
@ -285,4 +287,4 @@ ZYDIS_NO_EXPORT void ZydisGetInstructionEncodingInfo(const ZydisDecoderTreeNode*
|
|||
}
|
||||
#endif
|
||||
|
||||
#endif /* ZYDIS_INSTRUCTIONTABLE_H */
|
||||
#endif /* ZYDIS_DECODERDATA_H */
|
||||
|
|
1425
src/Encoder.c
1425
src/Encoder.c
File diff suppressed because it is too large
Load Diff
|
@ -1,117 +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.
|
||||
|
||||
***************************************************************************************************/
|
||||
|
||||
#include <EncoderData.h>
|
||||
|
||||
/* ============================================================================================== */
|
||||
/* Enums and types */
|
||||
/* ============================================================================================== */
|
||||
|
||||
// MSVC does not like types other than (un-)signed int for bitfields
|
||||
#ifdef ZYDIS_MSVC
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable:4214)
|
||||
#endif
|
||||
|
||||
#pragma pack(push, 1)
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
/* Encodable instructions */
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
* @brief Defines the @c ZydisEncodableInstructions struct.
|
||||
*/
|
||||
typedef struct ZydisEncodableInstructions_
|
||||
{
|
||||
uint8_t count;
|
||||
uint16_t reference;
|
||||
} ZydisEncodableInstructions;
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
#ifdef ZYDIS_MSVC
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
|
||||
/* ============================================================================================== */
|
||||
/* Data tables */
|
||||
/* ============================================================================================== */
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
/* Forward declarations */
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
* @brief Contains an item with a reference to all encodable instructions for every mnemonic.
|
||||
*/
|
||||
extern const ZydisEncodableInstructions mnemonicLookup[];
|
||||
|
||||
/**
|
||||
* @brief Contains the definition-data for all encodable instructions.
|
||||
*/
|
||||
extern const ZydisEncodableInstruction encodableInstructions[];
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
/* Mnemonic lookup table */
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
||||
#include <Generated/EncoderLookup.inc>
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
/* Encodable instructions */
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
||||
#include <Generated/EncodableInstructions.inc>
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
||||
/* ============================================================================================== */
|
||||
/* Functions */
|
||||
/* ============================================================================================== */
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
/* Encodable instructions */
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
||||
uint8_t ZydisGetEncodableInstructions(ZydisMnemonic mnemonic,
|
||||
const ZydisEncodableInstruction** instruction)
|
||||
{
|
||||
if (mnemonic >= ZYDIS_ARRAY_SIZE(mnemonicLookup))
|
||||
{
|
||||
*instruction = NULL;
|
||||
return 0;
|
||||
}
|
||||
const ZydisEncodableInstructions* descriptor = &mnemonicLookup[mnemonic];
|
||||
*instruction = &encodableInstructions[descriptor->reference];
|
||||
return descriptor->count;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
||||
/* ============================================================================================== */
|
|
@ -1,115 +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_ENCODERDATA_H
|
||||
#define ZYDIS_ENCODERDATA_H
|
||||
|
||||
#include <Zydis/Defines.h>
|
||||
#include <Zydis/Mnemonic.h>
|
||||
#include <Zydis/SharedTypes.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* ============================================================================================== */
|
||||
/* Enums and types */
|
||||
/* ============================================================================================== */
|
||||
|
||||
// MSVC does not like types other than (un-)signed int for bitfields
|
||||
#ifdef ZYDIS_MSVC
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable:4214)
|
||||
#endif
|
||||
|
||||
#pragma pack(push, 1)
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
/* Encodable instruction */
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
* @brief Defines the @c ZydisEncodableInstruction struct.
|
||||
*/
|
||||
typedef struct ZydisEncodableInstruction_
|
||||
{
|
||||
uint16_t definitionReference ZYDIS_BITFIELD(13);
|
||||
ZydisInstructionEncoding encoding ZYDIS_BITFIELD( 3);
|
||||
uint8_t opcode ZYDIS_BITFIELD( 8);
|
||||
ZydisOpcodeMap opcodeMap ZYDIS_BITFIELD( 3);
|
||||
uint8_t mode ZYDIS_BITFIELD( 3);
|
||||
uint8_t operandSize ZYDIS_BITFIELD( 3);
|
||||
uint8_t addressSize ZYDIS_BITFIELD( 3);
|
||||
uint8_t modrmMod ZYDIS_BITFIELD( 4);
|
||||
ZydisBool forceModrmReg ZYDIS_BITFIELD( 1);
|
||||
uint8_t modrmReg ZYDIS_BITFIELD( 8);
|
||||
ZydisBool forceModrmRm ZYDIS_BITFIELD( 1);
|
||||
uint8_t modrmRm ZYDIS_BITFIELD( 8);
|
||||
uint8_t mandatoryPrefix ZYDIS_BITFIELD( 3);
|
||||
uint8_t vectorLength ZYDIS_BITFIELD( 2);
|
||||
uint8_t rexW ZYDIS_BITFIELD( 1);
|
||||
uint8_t rexB ZYDIS_BITFIELD( 2);
|
||||
uint8_t evexB ZYDIS_BITFIELD( 1);
|
||||
uint8_t mvexE ZYDIS_BITFIELD( 2);
|
||||
} ZydisEncodableInstruction;
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
#ifdef ZYDIS_MSVC
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
|
||||
/* ============================================================================================== */
|
||||
/* Functions */
|
||||
/* ============================================================================================== */
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
/* Encodable instructions */
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
* @brief Returns all encodable instructions matching the given `mnemonic`.
|
||||
*
|
||||
* @param mnemonic The mnemonic.
|
||||
* @param instruction A pointer to the variable that receives a pointer to the first
|
||||
* `ZydisEncodableInstruction` struct.
|
||||
*
|
||||
* @return The number of encodable instructions for the given mnemonic.
|
||||
*/
|
||||
ZYDIS_NO_EXPORT uint8_t ZydisGetEncodableInstructions(ZydisMnemonic mnemonic,
|
||||
const ZydisEncodableInstruction** instruction);
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
||||
/* ============================================================================================== */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ZYDIS_ENCODERDATA_H */
|
|
@ -0,0 +1,409 @@
|
|||
/***************************************************************************************************
|
||||
|
||||
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 <string.h>
|
||||
#include <ctype.h>
|
||||
#include <FormatHelper.h>
|
||||
|
||||
/* ============================================================================================== */
|
||||
/* 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, size_t bufferLen)
|
||||
{
|
||||
ZYDIS_ASSERT(buffer);
|
||||
ZYDIS_ASSERT(bufferLen);
|
||||
|
||||
const signed char rebase = 'a' - 'A';
|
||||
for (size_t i = 0; i < bufferLen; ++i)
|
||||
{
|
||||
char* c = buffer + i;
|
||||
if ((*c >= 'A') && (*c <= 'Z'))
|
||||
{
|
||||
*c += rebase;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ZydisToUpperCase(char* buffer, size_t bufferLen)
|
||||
{
|
||||
ZYDIS_ASSERT(buffer);
|
||||
ZYDIS_ASSERT(bufferLen);
|
||||
|
||||
const signed char rebase = 'A' - 'a';
|
||||
for (size_t i = 0; i < bufferLen; ++i)
|
||||
{
|
||||
char* c = buffer + i;
|
||||
if ((*c >= 'a') && (*c <= 'z'))
|
||||
{
|
||||
*c += rebase;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef ZYDIS_X86
|
||||
ZydisStatus ZydisPrintDecU32(char** buffer, size_t bufferLen, uint32_t value, uint8_t 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)
|
||||
{
|
||||
uint32_t const old = value;
|
||||
p -= 2;
|
||||
value /= 100;
|
||||
memcpy(p, &decimalLookup[(old - (value * 100)) * 2], sizeof(uint16_t));
|
||||
}
|
||||
p -= 2;
|
||||
memcpy(p, &decimalLookup[value * 2], sizeof(uint16_t));
|
||||
|
||||
size_t n = &temp[ZYDIS_MAXCHARS_DEC_32] - p;
|
||||
if ((bufferLen < (size_t)(n + 1)) || (bufferLen < (size_t)(paddingLength + 1)))
|
||||
{
|
||||
return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE;
|
||||
}
|
||||
|
||||
uintptr_t offset = 0;
|
||||
if (n <= paddingLength)
|
||||
{
|
||||
offset = paddingLength - n + 1;
|
||||
memset(*buffer, '0', offset);
|
||||
}
|
||||
|
||||
memcpy(&(*buffer)[offset], &p[value < 10], n + 1);
|
||||
*buffer += n + offset - (uint8_t)(value < 10);
|
||||
|
||||
return ZYDIS_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
ZydisStatus ZydisPrintHexU32(char** buffer, size_t bufferLen, uint32_t value, uint8_t paddingLength,
|
||||
ZydisBool uppercase, ZydisBool prefix)
|
||||
{
|
||||
ZYDIS_ASSERT(buffer);
|
||||
ZYDIS_ASSERT(bufferLen);
|
||||
|
||||
if (prefix)
|
||||
{
|
||||
ZYDIS_CHECK(ZydisPrintStr(buffer, bufferLen, "0x", ZYDIS_LETTER_CASE_DEFAULT));
|
||||
bufferLen -= 2;
|
||||
}
|
||||
if (bufferLen < (size_t)(paddingLength + 1))
|
||||
{
|
||||
return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE;
|
||||
}
|
||||
|
||||
if (!value)
|
||||
{
|
||||
uint8_t n = (paddingLength ? paddingLength : 1);
|
||||
|
||||
if (bufferLen < (size_t)(n + 1))
|
||||
{
|
||||
return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE;
|
||||
}
|
||||
|
||||
memset(*buffer, '0', n);
|
||||
(*buffer)[n] = '\0';
|
||||
*buffer += n;
|
||||
return ZYDIS_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
uint8_t n = 0;
|
||||
for (int8_t i = ZYDIS_MAXCHARS_HEX_32 - 1; i >= 0; --i)
|
||||
{
|
||||
uint8_t v = (value >> i * 4) & 0x0F;
|
||||
if (!n)
|
||||
{
|
||||
if (!v)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (bufferLen <= (uint8_t)(i + 1))
|
||||
{
|
||||
return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE;
|
||||
}
|
||||
if (paddingLength > i)
|
||||
{
|
||||
n = paddingLength - i - 1;
|
||||
memset(*buffer, '0', n);
|
||||
}
|
||||
}
|
||||
if (uppercase)
|
||||
{
|
||||
(*buffer)[n++] = "0123456789ABCDEF"[v];
|
||||
} else
|
||||
{
|
||||
(*buffer)[n++] = "0123456789abcdef"[v];
|
||||
}
|
||||
}
|
||||
(*buffer)[n] = '\0';
|
||||
|
||||
*buffer += n;
|
||||
|
||||
return ZYDIS_STATUS_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
|
||||
ZydisStatus ZydisPrintDecU64(char** buffer, size_t bufferLen, uint64_t value, uint8_t paddingLength)
|
||||
{
|
||||
ZYDIS_ASSERT(buffer);
|
||||
ZYDIS_ASSERT(bufferLen > 0);
|
||||
|
||||
char temp[ZYDIS_MAXCHARS_DEC_64 + 1];
|
||||
char *p = &temp[ZYDIS_MAXCHARS_DEC_64];
|
||||
*p = '\0';
|
||||
while (value >= 100)
|
||||
{
|
||||
uint64_t const old = value;
|
||||
p -= 2;
|
||||
value /= 100;
|
||||
memcpy(p, &decimalLookup[(old - (value * 100)) * 2], 2);
|
||||
}
|
||||
p -= 2;
|
||||
memcpy(p, &decimalLookup[value * 2], 2);
|
||||
|
||||
size_t n = &temp[ZYDIS_MAXCHARS_DEC_64] - p;
|
||||
if ((bufferLen < (size_t)(n + 1)) || (bufferLen < (size_t)(paddingLength + 1)))
|
||||
{
|
||||
return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE;
|
||||
}
|
||||
|
||||
uintptr_t offset = 0;
|
||||
if (n <= paddingLength)
|
||||
{
|
||||
offset = paddingLength - n + 1;
|
||||
memset(*buffer, '0', offset);
|
||||
}
|
||||
|
||||
memcpy(&(*buffer)[offset], &p[value < 10], n + 1);
|
||||
*buffer += n + offset - (uint8_t)(value < 10);
|
||||
|
||||
return ZYDIS_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
ZydisStatus ZydisPrintHexU64(char** buffer, size_t bufferLen, uint64_t value, uint8_t paddingLength,
|
||||
ZydisBool uppercase, ZydisBool prefix)
|
||||
{
|
||||
ZYDIS_ASSERT(buffer);
|
||||
ZYDIS_ASSERT(bufferLen);
|
||||
|
||||
if (prefix)
|
||||
{
|
||||
ZYDIS_CHECK(ZydisPrintStr(buffer, bufferLen, "0x", ZYDIS_LETTER_CASE_DEFAULT));
|
||||
bufferLen -= 2;
|
||||
}
|
||||
if (bufferLen < (size_t)(paddingLength + 1))
|
||||
{
|
||||
return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE;
|
||||
}
|
||||
|
||||
if (!value)
|
||||
{
|
||||
uint8_t n = (paddingLength ? paddingLength : 1);
|
||||
|
||||
if (bufferLen < (size_t)(n + 1))
|
||||
{
|
||||
return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE;
|
||||
}
|
||||
|
||||
memset(*buffer, '0', n);
|
||||
(*buffer)[n] = '\0';
|
||||
*buffer += n;
|
||||
return ZYDIS_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
uint8_t n = 0;
|
||||
uint8_t c = ((value & 0xFFFFFFFF00000000) ? ZYDIS_MAXCHARS_HEX_64 : ZYDIS_MAXCHARS_HEX_32);
|
||||
for (int8_t i = c - 1; i >= 0; --i)
|
||||
{
|
||||
uint8_t v = (value >> i * 4) & 0x0F;
|
||||
if (!n)
|
||||
{
|
||||
if (!v)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (bufferLen <= (uint8_t)(i + 1))
|
||||
{
|
||||
return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE;
|
||||
}
|
||||
if (paddingLength > i)
|
||||
{
|
||||
n = paddingLength - i - 1;
|
||||
memset(*buffer, '0', n);
|
||||
}
|
||||
}
|
||||
if (uppercase)
|
||||
{
|
||||
(*buffer)[n++] = "0123456789ABCDEF"[v];
|
||||
} else
|
||||
{
|
||||
(*buffer)[n++] = "0123456789abcdef"[v];
|
||||
}
|
||||
}
|
||||
(*buffer)[n] = '\0';
|
||||
|
||||
*buffer += n;
|
||||
|
||||
return ZYDIS_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
/* Public Functions */
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
||||
ZydisStatus ZydisPrintStr(char** buffer, size_t bufferLen, const char* text,
|
||||
ZydisLetterCase letterCase)
|
||||
{
|
||||
ZYDIS_ASSERT(buffer);
|
||||
ZYDIS_ASSERT(bufferLen > 0);
|
||||
ZYDIS_ASSERT(text);
|
||||
|
||||
size_t strLen = strlen(text);
|
||||
if (strLen >= bufferLen)
|
||||
{
|
||||
return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE;
|
||||
}
|
||||
|
||||
memcpy(*buffer, text, strLen + 1);
|
||||
switch (letterCase)
|
||||
{
|
||||
case ZYDIS_LETTER_CASE_DEFAULT:
|
||||
break;
|
||||
case ZYDIS_LETTER_CASE_LOWER:
|
||||
ZydisToLowerCase(*buffer, strLen);
|
||||
break;
|
||||
case ZYDIS_LETTER_CASE_UPPER:
|
||||
ZydisToUpperCase(*buffer, strLen);
|
||||
break;
|
||||
default:
|
||||
ZYDIS_UNREACHABLE;
|
||||
}
|
||||
*buffer += strLen;
|
||||
return ZYDIS_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
ZydisStatus ZydisPrintDecU(char** buffer, size_t bufferLen, uint64_t value, uint8_t paddingLength)
|
||||
{
|
||||
#ifdef ZYDIS_X64
|
||||
return ZydisPrintDecU64(buffer, bufferLen, value, paddingLength);
|
||||
#else
|
||||
if (value & 0xFFFFFFFF00000000)
|
||||
{
|
||||
return ZydisPrintDecU64(buffer, bufferLen, value, paddingLength);
|
||||
} else
|
||||
{
|
||||
return ZydisPrintDecU32(buffer, bufferLen, (uint32_t)value, paddingLength);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
ZydisStatus ZydisPrintDecS(char** buffer, size_t bufferLen, int64_t value, uint8_t paddingLength)
|
||||
{
|
||||
if (value < 0)
|
||||
{
|
||||
ZYDIS_CHECK(ZydisPrintStr(buffer, bufferLen, "-", ZYDIS_LETTER_CASE_DEFAULT));
|
||||
return ZydisPrintDecU(buffer, bufferLen - 1, -value, paddingLength);
|
||||
}
|
||||
return ZydisPrintDecU(buffer, bufferLen, value, paddingLength);
|
||||
}
|
||||
|
||||
ZydisStatus ZydisPrintHexU(char** buffer, size_t bufferLen, uint64_t value, uint8_t paddingLength,
|
||||
ZydisBool uppercase, ZydisBool prefix)
|
||||
{
|
||||
#ifdef ZYDIS_X64
|
||||
return ZydisPrintHexU64(buffer, bufferLen, value, paddingLength, uppercase, prefix);
|
||||
#else
|
||||
if (value & 0xFFFFFFFF00000000)
|
||||
{
|
||||
return ZydisPrintHexU64(buffer, bufferLen, value, paddingLength, uppercase, prefix);
|
||||
} else
|
||||
{
|
||||
return ZydisPrintHexU32(
|
||||
buffer, bufferLen, (uint32_t)value, paddingLength, uppercase, prefix);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
ZydisStatus ZydisPrintHexS(char** buffer, size_t bufferLen, int64_t value, uint8_t paddingLength,
|
||||
ZydisBool uppercase, ZydisBool prefix)
|
||||
{
|
||||
if (value < 0)
|
||||
{
|
||||
if (prefix)
|
||||
{
|
||||
ZYDIS_CHECK(ZydisPrintStr(buffer, bufferLen, "-0x", ZYDIS_LETTER_CASE_DEFAULT));
|
||||
bufferLen -= 3;
|
||||
} else
|
||||
{
|
||||
ZYDIS_CHECK(ZydisPrintStr(buffer, bufferLen, "-", ZYDIS_LETTER_CASE_DEFAULT));
|
||||
--bufferLen;
|
||||
}
|
||||
return ZydisPrintHexU(buffer, bufferLen, -value, paddingLength, uppercase, ZYDIS_FALSE);
|
||||
}
|
||||
return ZydisPrintHexU(buffer, bufferLen, value, paddingLength, uppercase, prefix);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
||||
/* ============================================================================================== */
|
|
@ -0,0 +1,199 @@
|
|||
/***************************************************************************************************
|
||||
|
||||
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 <Zydis/Defines.h>
|
||||
#include <Zydis/Status.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* ============================================================================================== */
|
||||
/* Enums and types */
|
||||
/* ============================================================================================== */
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
/* Letter Case */
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
* @brief Defines the `ZydisLetterCase` datatype.
|
||||
*/
|
||||
typedef uint8_t 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 given @c text to the @c buffer.
|
||||
*
|
||||
* @param buffer A pointer to the string-buffer.
|
||||
* @param bufferLen The length of the string-buffer.
|
||||
* @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, size_t bufferLen, const char* text,
|
||||
ZydisLetterCase letterCase);
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
/* Decimal values */
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
* @brief Formats the given unsigned ordinal @c value to its decimal 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 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(char** buffer, size_t bufferLen, uint64_t value,
|
||||
uint8_t paddingLength);
|
||||
|
||||
/**
|
||||
* @brief Formats the given signed ordinal @c value to its decimal 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 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(char** buffer, size_t bufferLen, int64_t value,
|
||||
uint8_t paddingLength);
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
/* Hexadecimal values */
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
* @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 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 Set @c TRUE to add the "0x" prefix to the hexadecimal value.
|
||||
*
|
||||
* @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(char** buffer, size_t bufferLen, uint64_t value,
|
||||
uint8_t paddingLength, ZydisBool uppercase, ZydisBool prefix);
|
||||
|
||||
/**
|
||||
* @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 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 Set @c TRUE to add the "0x" prefix to the hexadecimal value.
|
||||
*
|
||||
* @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(char** buffer, size_t bufferLen, int64_t value,
|
||||
uint8_t paddingLength, ZydisBool uppercase, ZydisBool prefix);
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
||||
/* ============================================================================================== */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ZYDIS_FORMATHELPER_H */
|
589
src/Formatter.c
589
src/Formatter.c
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,74 @@
|
|||
static const ZydisAccessedFlags accessedFlags[] =
|
||||
{
|
||||
{ { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_UNDEFINED } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_SET_1, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_SET_1, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_SET_1, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
{ { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } }
|
||||
};
|
|
@ -1,75 +0,0 @@
|
|||
static ZydisAccessedFlags accessedFlags[] =
|
||||
{
|
||||
/*00*/ { { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*01*/ { { ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*02*/ { { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*03*/ { { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*04*/ { { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*05*/ { { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*06*/ { { ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*07*/ { { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*08*/ { { ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*09*/ { { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*0A*/ { { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*0B*/ { { ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*0C*/ { { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*0D*/ { { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*0E*/ { { ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*0F*/ { { ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*10*/ { { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*11*/ { { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*12*/ { { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*13*/ { { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*14*/ { { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*15*/ { { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*16*/ { { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*17*/ { { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*18*/ { { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*19*/ { { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*1A*/ { { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*1B*/ { { ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*1C*/ { { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED } },
|
||||
/*1D*/ { { ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED } },
|
||||
/*1E*/ { { ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED } },
|
||||
/*1F*/ { { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED } },
|
||||
/*20*/ { { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED } },
|
||||
/*21*/ { { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED } },
|
||||
/*22*/ { { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*23*/ { { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_UNDEFINED } },
|
||||
/*24*/ { { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED } },
|
||||
/*25*/ { { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*26*/ { { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*27*/ { { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*28*/ { { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*29*/ { { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*2A*/ { { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*2B*/ { { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*2C*/ { { ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*2D*/ { { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*2E*/ { { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*2F*/ { { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*30*/ { { ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*31*/ { { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*32*/ { { ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*33*/ { { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*34*/ { { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*35*/ { { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*36*/ { { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*37*/ { { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*38*/ { { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*39*/ { { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*3A*/ { { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*3B*/ { { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_SET_1, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*3C*/ { { ZYDIS_CPUFLAG_ACTION_SET_1, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*3D*/ { { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_SET_1, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*3E*/ { { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*3F*/ { { ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*40*/ { { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*41*/ { { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_TESTED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*42*/ { { ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*43*/ { { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*44*/ { { ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*45*/ { { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*46*/ { { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_UNDEFINED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_SET_0, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } },
|
||||
/*47*/ { { ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_MODIFIED, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE, ZYDIS_CPUFLAG_ACTION_NONE } }
|
||||
};
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,122 @@
|
|||
static const char* zydisISAExtStrings[] =
|
||||
{
|
||||
"INVALID",
|
||||
"AES",
|
||||
"AMD",
|
||||
"AMD3DNOW",
|
||||
"AVX",
|
||||
"AVX2",
|
||||
"AVX2GATHER",
|
||||
"AVX512BW_128",
|
||||
"AVX512BW_128N",
|
||||
"AVX512BW_256",
|
||||
"AVX512BW_512",
|
||||
"AVX512BW_KOP",
|
||||
"AVX512CD_128",
|
||||
"AVX512CD_256",
|
||||
"AVX512CD_512",
|
||||
"AVX512DQ_128",
|
||||
"AVX512DQ_128N",
|
||||
"AVX512DQ_256",
|
||||
"AVX512DQ_512",
|
||||
"AVX512DQ_KOP",
|
||||
"AVX512DQ_SCALAR",
|
||||
"AVX512ER_512",
|
||||
"AVX512ER_SCALAR",
|
||||
"AVX512F_128",
|
||||
"AVX512F_128N",
|
||||
"AVX512F_256",
|
||||
"AVX512F_512",
|
||||
"AVX512F_KOP",
|
||||
"AVX512F_SCALAR",
|
||||
"AVX512PF_512",
|
||||
"AVX512_4FMAPS_512",
|
||||
"AVX512_4FMAPS_SCALAR",
|
||||
"AVX512_4VNNIW_512",
|
||||
"AVX512_IFMA_128",
|
||||
"AVX512_IFMA_256",
|
||||
"AVX512_IFMA_512",
|
||||
"AVX512_VBMI_128",
|
||||
"AVX512_VBMI_256",
|
||||
"AVX512_VBMI_512",
|
||||
"AVX512_VPOPCNTDQ_512",
|
||||
"AVXAES",
|
||||
"BDW",
|
||||
"BMI1",
|
||||
"BMI2",
|
||||
"CET",
|
||||
"CLFLUSHOPT",
|
||||
"CLFSH",
|
||||
"CLWB",
|
||||
"CLZERO",
|
||||
"CMOV",
|
||||
"CMPXCHG16B",
|
||||
"F16C",
|
||||
"FAT_NOP",
|
||||
"FCMOV",
|
||||
"FMA",
|
||||
"FMA4",
|
||||
"FXSAVE",
|
||||
"FXSAVE64",
|
||||
"I186",
|
||||
"I286PROTECTED",
|
||||
"I286REAL",
|
||||
"I386",
|
||||
"I486",
|
||||
"I486REAL",
|
||||
"I86",
|
||||
"INVPCID",
|
||||
"KNCE",
|
||||
"KNCJKBR",
|
||||
"KNCSTREAM",
|
||||
"KNCV",
|
||||
"KNC_MISC",
|
||||
"KNC_PF_HINT",
|
||||
"LAHF",
|
||||
"LONGMODE",
|
||||
"LZCNT",
|
||||
"MONITOR",
|
||||
"MOVBE",
|
||||
"MPX",
|
||||
"PAUSE",
|
||||
"PCLMULQDQ",
|
||||
"PENTIUMMMX",
|
||||
"PENTIUMREAL",
|
||||
"PKU",
|
||||
"POPCNT",
|
||||
"PPRO",
|
||||
"PREFETCHWT1",
|
||||
"PREFETCH_NOP",
|
||||
"PT",
|
||||
"RDPMC",
|
||||
"RDRAND",
|
||||
"RDSEED",
|
||||
"RDTSCP",
|
||||
"RDWRFSGS",
|
||||
"RTM",
|
||||
"SGX",
|
||||
"SHA",
|
||||
"SMAP",
|
||||
"SMX",
|
||||
"SSE",
|
||||
"SSE2",
|
||||
"SSE2MMX",
|
||||
"SSE3",
|
||||
"SSE3X87",
|
||||
"SSE4",
|
||||
"SSE42",
|
||||
"SSEMXCSR",
|
||||
"SSE_PREFETCH",
|
||||
"SSSE3",
|
||||
"SSSE3MMX",
|
||||
"SVM",
|
||||
"TBM",
|
||||
"VMFUNC",
|
||||
"VTX",
|
||||
"X87",
|
||||
"XOP",
|
||||
"XSAVE",
|
||||
"XSAVEC",
|
||||
"XSAVEOPT",
|
||||
"XSAVES"
|
||||
};
|
|
@ -0,0 +1,63 @@
|
|||
static const char* zydisISASetStrings[] =
|
||||
{
|
||||
"INVALID",
|
||||
"AES",
|
||||
"AMD3DNOW",
|
||||
"AVX",
|
||||
"AVX2",
|
||||
"AVX2GATHER",
|
||||
"AVX512EVEX",
|
||||
"AVX512VEX",
|
||||
"AVXAES",
|
||||
"BASE",
|
||||
"BDW",
|
||||
"BMI1",
|
||||
"BMI2",
|
||||
"CET",
|
||||
"CLFLUSHOPT",
|
||||
"CLFSH",
|
||||
"CLWB",
|
||||
"CLZERO",
|
||||
"F16C",
|
||||
"FMA",
|
||||
"FMA4",
|
||||
"INVPCID",
|
||||
"KNC",
|
||||
"KNCE",
|
||||
"KNCV",
|
||||
"LONGMODE",
|
||||
"LZCNT",
|
||||
"MMX",
|
||||
"MONITOR",
|
||||
"MOVBE",
|
||||
"MPX",
|
||||
"PAUSE",
|
||||
"PCLMULQDQ",
|
||||
"PKU",
|
||||
"PREFETCHWT1",
|
||||
"PT",
|
||||
"RDRAND",
|
||||
"RDSEED",
|
||||
"RDTSCP",
|
||||
"RDWRFSGS",
|
||||
"RTM",
|
||||
"SGX",
|
||||
"SHA",
|
||||
"SMAP",
|
||||
"SMX",
|
||||
"SSE",
|
||||
"SSE2",
|
||||
"SSE3",
|
||||
"SSE4",
|
||||
"SSSE3",
|
||||
"SVM",
|
||||
"TBM",
|
||||
"VMFUNC",
|
||||
"VTX",
|
||||
"X87",
|
||||
"XOP",
|
||||
"XSAVE",
|
||||
"XSAVEC",
|
||||
"XSAVEOPT",
|
||||
"XSAVES"
|
||||
};
|
|
@ -0,0 +1,88 @@
|
|||
static const char* zydisInstructionCategoryStrings[] =
|
||||
{
|
||||
"INVALID",
|
||||
"AES",
|
||||
"AMD3DNOW",
|
||||
"AVX",
|
||||
"AVX2",
|
||||
"AVX2GATHER",
|
||||
"AVX512",
|
||||
"AVX512_4FMAPS",
|
||||
"AVX512_4VNNIW",
|
||||
"AVX512_VBMI",
|
||||
"BDW",
|
||||
"BINARY",
|
||||
"BITBYTE",
|
||||
"BLEND",
|
||||
"BMI1",
|
||||
"BMI2",
|
||||
"BROADCAST",
|
||||
"CALL",
|
||||
"CET",
|
||||
"CLFLUSHOPT",
|
||||
"CLWB",
|
||||
"CLZERO",
|
||||
"CMOV",
|
||||
"COMPRESS",
|
||||
"COND_BR",
|
||||
"CONFLICT",
|
||||
"CONVERT",
|
||||
"DATAXFER",
|
||||
"DECIMAL",
|
||||
"EXPAND",
|
||||
"FCMOV",
|
||||
"FLAGOP",
|
||||
"FMA4",
|
||||
"GATHER",
|
||||
"IFMA",
|
||||
"INTERRUPT",
|
||||
"IO",
|
||||
"IOSTRINGOP",
|
||||
"KMASK",
|
||||
"KNC",
|
||||
"KNCMASK",
|
||||
"KNCSCALAR",
|
||||
"LOGICAL",
|
||||
"LOGICAL_FP",
|
||||
"LZCNT",
|
||||
"MISC",
|
||||
"MMX",
|
||||
"MPX",
|
||||
"NOP",
|
||||
"PCLMULQDQ",
|
||||
"PKU",
|
||||
"POP",
|
||||
"PREFETCH",
|
||||
"PREFETCHWT1",
|
||||
"PT",
|
||||
"PUSH",
|
||||
"RDRAND",
|
||||
"RDSEED",
|
||||
"RDWRFSGS",
|
||||
"RET",
|
||||
"ROTATE",
|
||||
"SCATTER",
|
||||
"SEGOP",
|
||||
"SEMAPHORE",
|
||||
"SETCC",
|
||||
"SGX",
|
||||
"SHA",
|
||||
"SHIFT",
|
||||
"SMAP",
|
||||
"SSE",
|
||||
"STRINGOP",
|
||||
"STTNI",
|
||||
"SYSCALL",
|
||||
"SYSRET",
|
||||
"SYSTEM",
|
||||
"TBM",
|
||||
"UFMA",
|
||||
"UNCOND_BR",
|
||||
"VFMA",
|
||||
"VTX",
|
||||
"WIDENOP",
|
||||
"X87_ALU",
|
||||
"XOP",
|
||||
"XSAVE",
|
||||
"XSAVEOPT"
|
||||
};
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,22 @@
|
|||
static const ZydisInstructionEncodingInfo instructionEncodings[] =
|
||||
{
|
||||
{ 0, { { 0, 0, 0 } }, { { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } },
|
||||
{ ZYDIS_INSTR_ENC_FLAG_HAS_MODRM, { { 0, 0, 0 } }, { { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } },
|
||||
{ ZYDIS_INSTR_ENC_FLAG_HAS_DISP, { { 16, 32, 64 } }, { { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } },
|
||||
{ ZYDIS_INSTR_ENC_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 8, 8, 8 }, ZYDIS_FALSE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } },
|
||||
{ ZYDIS_INSTR_ENC_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 16, 16, 16 }, ZYDIS_FALSE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } },
|
||||
{ ZYDIS_INSTR_ENC_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 16, 32, 64 }, ZYDIS_FALSE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } },
|
||||
{ ZYDIS_INSTR_ENC_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 8, 8, 8 }, ZYDIS_TRUE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } },
|
||||
{ ZYDIS_INSTR_ENC_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 16, 32, 32 }, ZYDIS_TRUE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } },
|
||||
{ ZYDIS_INSTR_ENC_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 8, 8, 8 }, ZYDIS_TRUE, ZYDIS_TRUE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } },
|
||||
{ ZYDIS_INSTR_ENC_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 16, 32, 32 }, ZYDIS_TRUE, ZYDIS_TRUE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } },
|
||||
{ ZYDIS_INSTR_ENC_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 32, 32, 32 }, ZYDIS_TRUE, ZYDIS_TRUE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } },
|
||||
{ ZYDIS_INSTR_ENC_FLAG_HAS_MODRM | ZYDIS_INSTR_ENC_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 8, 8, 8 }, ZYDIS_FALSE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } },
|
||||
{ ZYDIS_INSTR_ENC_FLAG_HAS_MODRM | ZYDIS_INSTR_ENC_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 32, 32, 32 }, ZYDIS_FALSE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } },
|
||||
{ ZYDIS_INSTR_ENC_FLAG_HAS_MODRM | ZYDIS_INSTR_ENC_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 8, 8, 8 }, ZYDIS_TRUE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } },
|
||||
{ ZYDIS_INSTR_ENC_FLAG_HAS_MODRM | ZYDIS_INSTR_ENC_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 16, 32, 32 }, ZYDIS_TRUE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } },
|
||||
{ ZYDIS_INSTR_ENC_FLAG_HAS_MODRM | ZYDIS_INSTR_ENC_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 16, 32, 32 }, ZYDIS_TRUE, ZYDIS_TRUE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } },
|
||||
{ ZYDIS_INSTR_ENC_FLAG_HAS_MODRM | ZYDIS_INSTR_ENC_FLAG_FORCE_REG_FORM, { { 0, 0, 0 } }, { { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } },
|
||||
{ ZYDIS_INSTR_ENC_FLAG_HAS_IMM0 | ZYDIS_INSTR_ENC_FLAG_HAS_IMM1, { { 0, 0, 0 } }, { { { 16, 16, 16 }, ZYDIS_FALSE, ZYDIS_FALSE }, { { 8, 8, 8 }, ZYDIS_FALSE, ZYDIS_FALSE } } },
|
||||
{ ZYDIS_INSTR_ENC_FLAG_HAS_IMM0 | ZYDIS_INSTR_ENC_FLAG_HAS_IMM1, { { 0, 0, 0 } }, { { { 16, 32, 32 }, ZYDIS_TRUE, ZYDIS_TRUE }, { { 16, 16, 16 }, ZYDIS_FALSE, ZYDIS_FALSE } } }
|
||||
};
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,21 +0,0 @@
|
|||
static const ZydisInstructionEncodingInfo physicalEncodings[] =
|
||||
{
|
||||
/*00*/ { 0, { { 0, 0, 0 } }, { { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } },
|
||||
/*01*/ { 0 | ZYDIS_INSTR_ENC_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 8, 8, 8 }, ZYDIS_TRUE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } },
|
||||
/*02*/ { 0 | ZYDIS_INSTR_ENC_FLAG_HAS_MODRM, { { 0, 0, 0 } }, { { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } },
|
||||
/*03*/ { 0 | ZYDIS_INSTR_ENC_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 16, 32, 32 }, ZYDIS_TRUE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } },
|
||||
/*04*/ { 0 | ZYDIS_INSTR_ENC_FLAG_HAS_MODRM | ZYDIS_INSTR_ENC_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 8, 8, 8 }, ZYDIS_TRUE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } },
|
||||
/*05*/ { 0 | ZYDIS_INSTR_ENC_FLAG_HAS_MODRM | ZYDIS_INSTR_ENC_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 16, 32, 32 }, ZYDIS_TRUE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } },
|
||||
/*06*/ { 0 | ZYDIS_INSTR_ENC_FLAG_HAS_MODRM | ZYDIS_INSTR_ENC_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 8, 8, 8 }, ZYDIS_FALSE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } },
|
||||
/*07*/ { 0 | ZYDIS_INSTR_ENC_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 16, 32, 32 }, ZYDIS_TRUE, ZYDIS_TRUE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } },
|
||||
/*08*/ { 0 | ZYDIS_INSTR_ENC_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 32, 32, 32 }, ZYDIS_TRUE, ZYDIS_TRUE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } },
|
||||
/*09*/ { 0 | ZYDIS_INSTR_ENC_FLAG_HAS_IMM0 | ZYDIS_INSTR_ENC_FLAG_HAS_IMM1, { { 0, 0, 0 } }, { { { 16, 32, 32 }, ZYDIS_TRUE, ZYDIS_TRUE }, { { 16, 16, 16 }, ZYDIS_FALSE, ZYDIS_FALSE } } },
|
||||
/*0A*/ { 0 | ZYDIS_INSTR_ENC_FLAG_HAS_IMM0 | ZYDIS_INSTR_ENC_FLAG_HAS_IMM1, { { 0, 0, 0 } }, { { { 16, 16, 16 }, ZYDIS_FALSE, ZYDIS_FALSE }, { { 8, 8, 8 }, ZYDIS_FALSE, ZYDIS_FALSE } } },
|
||||
/*0B*/ { 0 | ZYDIS_INSTR_ENC_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 8, 8, 8 }, ZYDIS_FALSE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } },
|
||||
/*0C*/ { 0 | ZYDIS_INSTR_ENC_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 8, 8, 8 }, ZYDIS_TRUE, ZYDIS_TRUE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } },
|
||||
/*0D*/ { 0 | ZYDIS_INSTR_ENC_FLAG_HAS_DISP, { { 16, 32, 64 } }, { { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } },
|
||||
/*0E*/ { 0 | ZYDIS_INSTR_ENC_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 16, 32, 64 }, ZYDIS_FALSE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } },
|
||||
/*0F*/ { 0 | ZYDIS_INSTR_ENC_FLAG_HAS_MODRM | ZYDIS_INSTR_ENC_FLAG_FORCE_REG_FORM, { { 0, 0, 0 } }, { { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } },
|
||||
/*10*/ { 0 | ZYDIS_INSTR_ENC_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 16, 16, 16 }, ZYDIS_FALSE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } },
|
||||
/*11*/ { 0 | ZYDIS_INSTR_ENC_FLAG_HAS_MODRM | ZYDIS_INSTR_ENC_FLAG_HAS_IMM0, { { 0, 0, 0 } }, { { { 32, 32, 32 }, ZYDIS_FALSE, ZYDIS_FALSE }, { { 0, 0, 0 }, ZYDIS_FALSE, ZYDIS_FALSE } } }
|
||||
};
|
|
@ -0,0 +1,68 @@
|
|||
/***************************************************************************************************
|
||||
|
||||
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.
|
||||
|
||||
***************************************************************************************************/
|
||||
|
||||
#include <Zydis/MetaInfo.h>
|
||||
|
||||
/* ============================================================================================== */
|
||||
/* Enum strings */
|
||||
/* ============================================================================================== */
|
||||
|
||||
#include <Generated/EnumInstructionCategory.inc>
|
||||
#include <Generated/EnumISASet.inc>
|
||||
#include <Generated/EnumISAExt.inc>
|
||||
|
||||
/* ============================================================================================== */
|
||||
/* Exported functions */
|
||||
/* ============================================================================================== */
|
||||
|
||||
const char* ZydisCategoryGetString(ZydisInstructionCategory category)
|
||||
{
|
||||
if (category > ZYDIS_ARRAY_SIZE(zydisInstructionCategoryStrings) - 1)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
return zydisInstructionCategoryStrings[category];
|
||||
}
|
||||
|
||||
const char* ZydisISASetGetString(ZydisISASet isaSet)
|
||||
{
|
||||
if (isaSet > ZYDIS_ARRAY_SIZE(zydisISASetStrings) - 1)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
return zydisISASetStrings[isaSet];
|
||||
}
|
||||
|
||||
const char* ZydisISAExtGetString(ZydisISAExt isaExt)
|
||||
{
|
||||
if (isaExt > ZYDIS_ARRAY_SIZE(zydisISAExtStrings) - 1)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
return zydisISAExtStrings[isaExt];
|
||||
}
|
||||
|
||||
/* ============================================================================================== */
|
|
@ -30,7 +30,7 @@
|
|||
/* Mnemonic strings */
|
||||
/* ============================================================================================== */
|
||||
|
||||
#include <Generated/MnemonicStrings.inc>
|
||||
#include <Generated/EnumMnemonic.inc>
|
||||
|
||||
/* ============================================================================================== */
|
||||
/* Exported functions */
|
||||
|
@ -38,11 +38,11 @@
|
|||
|
||||
const char* ZydisMnemonicGetString(ZydisMnemonic mnemonic)
|
||||
{
|
||||
if (mnemonic > ZYDIS_ARRAY_SIZE(mnemonicStrings) - 1)
|
||||
if (mnemonic > ZYDIS_ARRAY_SIZE(zydisMnemonicStrings) - 1)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
return mnemonicStrings[mnemonic];
|
||||
return zydisMnemonicStrings[mnemonic];
|
||||
}
|
||||
|
||||
/* ============================================================================================== */
|
||||
|
|
|
@ -92,7 +92,7 @@ extern const ZydisInstructionDefinitionMVEX instructionDefinitionsMVEX[];
|
|||
/* Accessed CPU flags */
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
||||
#include <Generated/CPUFlags.inc>
|
||||
#include <Generated/AccessedFlags.inc>
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
||||
|
|
|
@ -541,12 +541,16 @@ enum ZydisMaskPolicies
|
|||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
||||
#define ZYDIS_INSTRUCTION_DEFINITION_BASE \
|
||||
ZydisMnemonic mnemonic ZYDIS_BITFIELD(11); \
|
||||
ZydisMnemonic mnemonic ZYDIS_BITFIELD(ZYDIS_MNEMONIC_MAX_BITS); \
|
||||
uint8_t operandCount ZYDIS_BITFIELD( 4); \
|
||||
uint16_t operandReference ZYDIS_BITFIELD(15); \
|
||||
uint8_t operandSizeMap ZYDIS_BITFIELD( 3); \
|
||||
uint8_t flagsReference ZYDIS_BITFIELD( 7); \
|
||||
ZydisBool acceptsAddressSizeOverride 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); \
|
||||
ZydisExceptionClass exceptionClass ZYDIS_BITFIELD( 6)
|
||||
|
||||
#define ZYDIS_INSTRUCTION_DEFINITION_BASE_VECTOR \
|
||||
ZYDIS_INSTRUCTION_DEFINITION_BASE; \
|
||||
|
@ -568,6 +572,7 @@ typedef struct ZydisInstructionDefinitionDEFAULT_
|
|||
{
|
||||
ZYDIS_INSTRUCTION_DEFINITION_BASE;
|
||||
ZydisBool isPrivileged ZYDIS_BITFIELD( 1);
|
||||
ZydisBool isFarBranch ZYDIS_BITFIELD( 1);
|
||||
ZydisBool acceptsLock ZYDIS_BITFIELD( 1);
|
||||
ZydisBool acceptsREP ZYDIS_BITFIELD( 1);
|
||||
ZydisBool acceptsREPEREPZ ZYDIS_BITFIELD( 1);
|
||||
|
@ -624,7 +629,7 @@ typedef struct ZydisInstructionDefinitionMVEX_
|
|||
|
||||
typedef struct ZydisAccessedFlags_
|
||||
{
|
||||
ZydisCPUFlagAction action[ZYDIS_CPUFLAG_ENUM_COUNT];
|
||||
ZydisCPUFlagAction action[ZYDIS_CPUFLAG_MAX_VALUE + 1];
|
||||
} ZydisAccessedFlags;
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
|
27
src/Utils.c
27
src/Utils.c
|
@ -24,7 +24,6 @@
|
|||
|
||||
***************************************************************************************************/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <Zydis/Utils.h>
|
||||
|
||||
/* ============================================================================================== */
|
||||
|
@ -35,7 +34,7 @@
|
|||
/* Exported functions */
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
||||
ZydisStatus ZydisUtilsCalcAbsoluteTargetAddress(const ZydisDecodedInstruction* instruction,
|
||||
ZydisStatus ZydisCalcAbsoluteAddress(const ZydisDecodedInstruction* instruction,
|
||||
const ZydisDecodedOperand* operand, uint64_t* address)
|
||||
{
|
||||
if (!instruction || !operand || !address)
|
||||
|
@ -60,6 +59,24 @@ ZydisStatus ZydisUtilsCalcAbsoluteTargetAddress(const ZydisDecodedInstruction* i
|
|||
*address = (uint64_t)(instruction->instrPointer + operand->mem.disp.value);
|
||||
return ZYDIS_STATUS_SUCCESS;
|
||||
}
|
||||
if ((operand->mem.base == ZYDIS_REGISTER_NONE) &&
|
||||
(operand->mem.index == ZYDIS_REGISTER_NONE))
|
||||
{
|
||||
switch (instruction->addressWidth)
|
||||
{
|
||||
case 16:
|
||||
*address = (uint64_t)operand->mem.disp.value & 0x000000000000FFFF;
|
||||
return ZYDIS_STATUS_SUCCESS;
|
||||
case 32:
|
||||
*address = (uint64_t)operand->mem.disp.value & 0x00000000FFFFFFFF;
|
||||
return ZYDIS_STATUS_SUCCESS;
|
||||
case 64:
|
||||
*address = (uint64_t)operand->mem.disp.value;
|
||||
return ZYDIS_STATUS_SUCCESS;
|
||||
default:
|
||||
return ZYDIS_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ZYDIS_OPERAND_TYPE_IMMEDIATE:
|
||||
if (operand->imm.isSigned && operand->imm.isRelative)
|
||||
|
@ -98,7 +115,7 @@ ZydisStatus ZydisUtilsCalcAbsoluteTargetAddress(const ZydisDecodedInstruction* i
|
|||
/* Exported functions */
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
||||
ZydisStatus ZydisGetCPUFlagsByAction(const ZydisDecodedInstruction* instruction,
|
||||
ZydisStatus ZydisGetAccessedFlagsByAction(const ZydisDecodedInstruction* instruction,
|
||||
ZydisCPUFlagAction action, ZydisCPUFlagMask* flags)
|
||||
{
|
||||
if (!instruction)
|
||||
|
@ -106,9 +123,9 @@ ZydisStatus ZydisGetCPUFlagsByAction(const ZydisDecodedInstruction* instruction,
|
|||
return ZYDIS_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
*flags = 0;
|
||||
for (uint8_t i = 0; i < ZYDIS_ARRAY_SIZE(instruction->flags); ++i)
|
||||
for (uint8_t i = 0; i < ZYDIS_ARRAY_SIZE(instruction->accessedFlags); ++i)
|
||||
{
|
||||
if (instruction->flags[i].action == action)
|
||||
if (instruction->accessedFlags[i].action == action)
|
||||
{
|
||||
*flags |= (1 << i);
|
||||
}
|
||||
|
|
Binary file not shown.
|
@ -31,6 +31,7 @@
|
|||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <Zydis/Zydis.h>
|
||||
//#include "Zydis/Encoder.h"
|
||||
|
||||
/* ============================================================================================== */
|
||||
/* Entry point */
|
||||
|
@ -38,6 +39,12 @@
|
|||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
if (ZydisGetVersion() != ZYDIS_VERSION)
|
||||
{
|
||||
fputs("Invalid zydis version\n", stderr);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (argc < 1 || argc > 2)
|
||||
{
|
||||
fprintf(stderr, "Usage: %s [input file]\n", (argc > 0 ? argv[0] : "ZydisDisasm"));
|
||||
|
@ -95,16 +102,23 @@ int main(int argc, char** argv)
|
|||
// TODO: Remove
|
||||
// DEBUG CODE START
|
||||
#if 0
|
||||
for (size_t i = 0; i < info.length; ++i)
|
||||
for (size_t i = 0; i < instruction.length; ++i)
|
||||
{
|
||||
printf("%02X ", *(readBuf + readOffs + i));
|
||||
}
|
||||
putchar('\n');
|
||||
|
||||
ZydisEncoderRequest req;
|
||||
ZydisStatus transStatus = ZydisEncoderDecodedInstructionToRequest(
|
||||
&instruction, &req
|
||||
);
|
||||
(void)transStatus;
|
||||
ZYDIS_ASSERT(ZYDIS_SUCCESS(transStatus));
|
||||
|
||||
uint8_t encBuffer[15];
|
||||
size_t encBufferSize = sizeof(encBuffer);
|
||||
ZydisStatus encStatus = ZydisEncoderEncodeInstruction(
|
||||
encBuffer, &encBufferSize, &info
|
||||
encBuffer, &encBufferSize, &req
|
||||
);
|
||||
(void)encStatus;
|
||||
ZYDIS_ASSERT(ZYDIS_SUCCESS(encStatus));
|
||||
|
@ -113,7 +127,7 @@ int main(int argc, char** argv)
|
|||
printf("%02X ", encBuffer[i]);
|
||||
}
|
||||
putchar('\n');
|
||||
ZYDIS_ASSERT(encBufferSize == info.length);
|
||||
ZYDIS_ASSERT(encBufferSize == instruction.length);
|
||||
ZYDIS_ASSERT(!memcmp(encBuffer, readBuf + readOffs, encBufferSize));
|
||||
#endif
|
||||
// DEBUG CODE END
|
||||
|
|
|
@ -168,7 +168,7 @@ void printOperands(ZydisDecodedInstruction* instruction)
|
|||
switch (instruction->operands[i].type)
|
||||
{
|
||||
case ZYDIS_OPERAND_TYPE_REGISTER:
|
||||
printf(" %27s", ZydisRegisterGetString(instruction->operands[i].reg));
|
||||
printf(" %27s", ZydisRegisterGetString(instruction->operands[i].reg.value));
|
||||
break;
|
||||
case ZYDIS_OPERAND_TYPE_MEMORY:
|
||||
printf(" SEG =%20s\n", ZydisRegisterGetString(instruction->operands[i].mem.segment));
|
||||
|
@ -251,30 +251,30 @@ void printFlags(ZydisDecodedInstruction* instruction)
|
|||
fputs("=======================================\n", stdout);
|
||||
printf(" ACTIONS: ");
|
||||
uint8_t c = 0;
|
||||
for (ZydisCPUFlag i = 0; i < ZYDIS_ARRAY_SIZE(instruction->flags); ++i)
|
||||
for (ZydisCPUFlag i = 0; i < ZYDIS_ARRAY_SIZE(instruction->accessedFlags); ++i)
|
||||
{
|
||||
if (instruction->flags[i].action != ZYDIS_CPUFLAG_ACTION_NONE)
|
||||
if (instruction->accessedFlags[i].action != ZYDIS_CPUFLAG_ACTION_NONE)
|
||||
{
|
||||
if (c && (c % 8 == 0))
|
||||
{
|
||||
printf("\n ");
|
||||
}
|
||||
++c;
|
||||
printf("[%-4s: %s] ", flagNames[i], flagActions[instruction->flags[i].action]);
|
||||
printf("[%-4s: %s] ", flagNames[i], flagActions[instruction->accessedFlags[i].action]);
|
||||
}
|
||||
}
|
||||
puts(c ? "" : "none");
|
||||
|
||||
ZydisCPUFlagMask flags, temp;
|
||||
ZydisGetCPUFlagsByAction(instruction, ZYDIS_CPUFLAG_ACTION_TESTED, &flags);
|
||||
ZydisGetAccessedFlagsByAction(instruction, ZYDIS_CPUFLAG_ACTION_TESTED, &flags);
|
||||
printf(" READ: 0x%08" PRIX32 "\n", flags);
|
||||
ZydisGetCPUFlagsByAction(instruction, ZYDIS_CPUFLAG_ACTION_MODIFIED, &flags);
|
||||
ZydisGetCPUFlagsByAction(instruction, ZYDIS_CPUFLAG_ACTION_SET_0, &temp);
|
||||
ZydisGetAccessedFlagsByAction(instruction, ZYDIS_CPUFLAG_ACTION_MODIFIED, &flags);
|
||||
ZydisGetAccessedFlagsByAction(instruction, ZYDIS_CPUFLAG_ACTION_SET_0, &temp);
|
||||
flags |= temp;
|
||||
ZydisGetCPUFlagsByAction(instruction, ZYDIS_CPUFLAG_ACTION_SET_1, &temp);
|
||||
ZydisGetAccessedFlagsByAction(instruction, ZYDIS_CPUFLAG_ACTION_SET_1, &temp);
|
||||
flags |= temp;
|
||||
printf(" WRITTEN: 0x%08" PRIX32 "\n", flags);
|
||||
ZydisGetCPUFlagsByAction(instruction, ZYDIS_CPUFLAG_ACTION_UNDEFINED, &flags);
|
||||
ZydisGetAccessedFlagsByAction(instruction, ZYDIS_CPUFLAG_ACTION_UNDEFINED, &flags);
|
||||
printf(" UNDEFINED: 0x%08" PRIX32 "\n", flags);
|
||||
}
|
||||
|
||||
|
@ -346,19 +346,19 @@ void printAVXInfo(ZydisDecodedInstruction* instruction)
|
|||
switch (instruction->encoding)
|
||||
{
|
||||
case ZYDIS_INSTRUCTION_ENCODING_EVEX:
|
||||
printf("\n ROUNDING: %s", roundingModeStrings[instruction->avx.roundingMode]);
|
||||
printf("\n ROUNDING: %s", roundingModeStrings[instruction->avx.rounding.mode]);
|
||||
printf("\n SAE: %s", instruction->avx.hasSAE ? "Y" : "N");
|
||||
printf("\n MASK: %s [%5s]%s", ZydisRegisterGetString(instruction->avx.mask.reg),
|
||||
maskModeStrings[instruction->avx.mask.mode],
|
||||
instruction->avx.mask.isControlMask ? " (control-mask)" : "");
|
||||
break;
|
||||
case ZYDIS_INSTRUCTION_ENCODING_MVEX:
|
||||
printf("\n ROUNDING: %s", roundingModeStrings[instruction->avx.roundingMode]);
|
||||
printf("\n ROUNDING: %s", roundingModeStrings[instruction->avx.rounding.mode]);
|
||||
printf("\n SAE: %s", instruction->avx.hasSAE ? "Y" : "N");
|
||||
printf("\n MASK: %s [MERGE]", ZydisRegisterGetString(instruction->avx.mask.reg));
|
||||
printf("\n EH: %s", instruction->avx.hasEvictionHint ? "Y" : "N");
|
||||
printf("\n SWIZZLE: %s", swizzleModeStrings[instruction->avx.swizzleMode]);
|
||||
printf("\n CONVERT: %s", conversionModeStrings[instruction->avx.conversionMode]);
|
||||
printf("\n SWIZZLE: %s", swizzleModeStrings[instruction->avx.swizzle.mode]);
|
||||
printf("\n CONVERT: %s", conversionModeStrings[instruction->avx.conversion.mode]);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -391,6 +391,100 @@ void printInstruction(ZydisDecodedInstruction* instruction)
|
|||
"MVEX"
|
||||
};
|
||||
|
||||
static const char* exceptionClassStrings[] =
|
||||
{
|
||||
"NONE",
|
||||
"SSE1",
|
||||
"SSE2",
|
||||
"SSE3",
|
||||
"SSE4",
|
||||
"SSE5",
|
||||
"SSE7",
|
||||
"AVX1",
|
||||
"AVX2",
|
||||
"AVX3",
|
||||
"AVX4",
|
||||
"AVX5",
|
||||
"AVX6",
|
||||
"AVX7",
|
||||
"AVX8",
|
||||
"AVX11",
|
||||
"AVX12",
|
||||
"E1",
|
||||
"E1NF",
|
||||
"E2",
|
||||
"E2NF",
|
||||
"E3",
|
||||
"E3NF",
|
||||
"E4",
|
||||
"E4NF",
|
||||
"E5",
|
||||
"E5NF",
|
||||
"E6",
|
||||
"E6NF",
|
||||
"E7NM",
|
||||
"E7NM128",
|
||||
"E9NF",
|
||||
"E10",
|
||||
"E10NF",
|
||||
"E11",
|
||||
"E11NF",
|
||||
"E12",
|
||||
"E12NP",
|
||||
"K20",
|
||||
"K21"
|
||||
};
|
||||
|
||||
struct
|
||||
{
|
||||
ZydisInstructionAttributes attrMask;
|
||||
const char* str;
|
||||
} attributeMap[] =
|
||||
{
|
||||
{ ZYDIS_ATTRIB_HAS_MODRM, "HAS_MODRM" },
|
||||
{ ZYDIS_ATTRIB_HAS_SIB, "HAS_SIB" },
|
||||
{ ZYDIS_ATTRIB_HAS_REX, "HAS_REX" },
|
||||
{ ZYDIS_ATTRIB_HAS_XOP, "HAS_XOP" },
|
||||
{ ZYDIS_ATTRIB_HAS_VEX, "HAS_VEX" },
|
||||
{ ZYDIS_ATTRIB_HAS_EVEX, "HAS_EVEX" },
|
||||
{ ZYDIS_ATTRIB_HAS_MVEX, "HAS_MVEX" },
|
||||
{ ZYDIS_ATTRIB_IS_RELATIVE, "IS_RELATIVE" },
|
||||
{ ZYDIS_ATTRIB_IS_PRIVILEGED, "IS_PRIVILEGED" },
|
||||
{ ZYDIS_ATTRIB_IS_FAR_BRANCH, "IS_FAR_BRANCH" },
|
||||
{ ZYDIS_ATTRIB_ACCEPTS_LOCK, "ACCEPTS_LOCK" },
|
||||
{ ZYDIS_ATTRIB_ACCEPTS_REP, "ACCEPTS_REP" },
|
||||
{ ZYDIS_ATTRIB_ACCEPTS_REPE, "ACCEPTS_REPE" },
|
||||
{ ZYDIS_ATTRIB_ACCEPTS_REPZ, "ACCEPTS_REPZ" },
|
||||
{ ZYDIS_ATTRIB_ACCEPTS_REPNE, "ACCEPTS_REPNE" },
|
||||
{ ZYDIS_ATTRIB_ACCEPTS_REPNZ, "ACCEPTS_REPNZ" },
|
||||
{ ZYDIS_ATTRIB_ACCEPTS_BOUND, "ACCEPTS_BOUND" },
|
||||
{ ZYDIS_ATTRIB_ACCEPTS_XACQUIRE, "ACCEPTS_XACQUIRE" },
|
||||
{ ZYDIS_ATTRIB_ACCEPTS_XRELEASE, "ACCEPTS_XRELEASE" },
|
||||
{ ZYDIS_ATTRIB_ACCEPTS_HLE_WITHOUT_LOCK, "ACCEPTS_HLE_WITHOUT_LOCK" },
|
||||
{ ZYDIS_ATTRIB_ACCEPTS_BRANCH_HINTS, "ACCEPTS_BRANCH_HINTS" },
|
||||
{ ZYDIS_ATTRIB_ACCEPTS_SEGMENT, "ACCEPTS_SEGMENT" },
|
||||
{ ZYDIS_ATTRIB_HAS_LOCK, "HAS_LOCK" },
|
||||
{ ZYDIS_ATTRIB_HAS_REP, "HAS_REP" },
|
||||
{ ZYDIS_ATTRIB_HAS_REPE, "HAS_REPE" },
|
||||
{ ZYDIS_ATTRIB_HAS_REPZ, "HAS_REPZ" },
|
||||
{ ZYDIS_ATTRIB_HAS_REPNE, "HAS_REPNE" },
|
||||
{ ZYDIS_ATTRIB_HAS_REPNZ, "HAS_REPNZ" },
|
||||
{ ZYDIS_ATTRIB_HAS_BOUND, "HAS_BOUND" },
|
||||
{ ZYDIS_ATTRIB_HAS_XACQUIRE, "HAS_XACQUIRE" },
|
||||
{ ZYDIS_ATTRIB_HAS_XRELEASE, "HAS_XRELEASE" },
|
||||
{ ZYDIS_ATTRIB_HAS_BRANCH_NOT_TAKEN, "HAS_BRANCH_NOT_TAKEN" },
|
||||
{ ZYDIS_ATTRIB_HAS_BRANCH_TAKEN, "HAS_BRANCH_TAKEN" },
|
||||
{ ZYDIS_ATTRIB_HAS_SEGMENT, "HAS_SEGMENT" },
|
||||
{ ZYDIS_ATTRIB_HAS_SEGMENT_CS, "HAS_SEGMENT_CS" },
|
||||
{ ZYDIS_ATTRIB_HAS_SEGMENT_SS, "HAS_SEGMENT_SS" },
|
||||
{ ZYDIS_ATTRIB_HAS_SEGMENT_DS, "HAS_SEGMENT_DS" },
|
||||
{ ZYDIS_ATTRIB_HAS_SEGMENT_ES, "HAS_SEGMENT_ES" },
|
||||
{ ZYDIS_ATTRIB_HAS_SEGMENT_FS, "HAS_SEGMENT_FS" },
|
||||
{ ZYDIS_ATTRIB_HAS_SEGMENT_GS, "HAS_SEGMENT_GS" },
|
||||
{ ZYDIS_ATTRIB_HAS_OPERANDSIZE, "HAS_OPERANDSIZE" },
|
||||
{ ZYDIS_ATTRIB_HAS_ADDRESSSIZE, "HAS_ADDRESSSIZE" }
|
||||
};
|
||||
|
||||
fputs("== [ BASIC ] =====================================================", stdout);
|
||||
fputs("=======================================\n", stdout);
|
||||
printf(" MNEMONIC: %s [ENC: %s, MAP: %s, OPC: %02X]\n",
|
||||
|
@ -400,8 +494,25 @@ void printInstruction(ZydisDecodedInstruction* instruction)
|
|||
instruction->opcode);
|
||||
printf(" LENGTH: %2d\n", instruction->length);
|
||||
printf(" SSZ: %2d\n", instruction->stackWidth);
|
||||
printf(" EOSZ: %2d\n", instruction->operandSize);
|
||||
printf(" EOSZ: %2d\n", instruction->operandWidth);
|
||||
printf(" EASZ: %2d\n", instruction->addressWidth);
|
||||
printf(" CATEGORY: %s\n", ZydisCategoryGetString(instruction->meta.category));
|
||||
printf(" ISA-SET: %s\n", ZydisISASetGetString(instruction->meta.isaSet));
|
||||
printf(" ISA-EXT: %s\n", ZydisISAExtGetString(instruction->meta.isaExt));
|
||||
printf(" EXCEPTIONS: %s\n", exceptionClassStrings[instruction->meta.exceptionClass]);
|
||||
|
||||
if (instruction->attributes)
|
||||
{
|
||||
fputs (" ATTRIBUTES: ", stdout);
|
||||
for (size_t i = 0; i < ZYDIS_ARRAY_SIZE(attributeMap); ++i)
|
||||
{
|
||||
if (instruction->attributes & attributeMap[i].attrMask)
|
||||
{
|
||||
printf("%s ", attributeMap[i].str);
|
||||
}
|
||||
}
|
||||
fputs("\n", stdout);
|
||||
}
|
||||
|
||||
if (instruction->operandCount > 0)
|
||||
{
|
||||
|
@ -410,7 +521,7 @@ void printInstruction(ZydisDecodedInstruction* instruction)
|
|||
}
|
||||
|
||||
if (ZydisRegisterGetClass(
|
||||
instruction->operands[instruction->operandCount - 1].reg) == ZYDIS_REGCLASS_FLAGS)
|
||||
instruction->operands[instruction->operandCount - 1].reg.value) == ZYDIS_REGCLASS_FLAGS)
|
||||
{
|
||||
puts("");
|
||||
printFlags(instruction);
|
||||
|
@ -442,6 +553,12 @@ void printInstruction(ZydisDecodedInstruction* instruction)
|
|||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
if (ZydisGetVersion() != ZYDIS_VERSION)
|
||||
{
|
||||
fputs("Invalid zydis version\n", stderr);
|
||||
return ZYDIS_STATUS_INVALID_OPERATION;
|
||||
}
|
||||
|
||||
if (argc < 3)
|
||||
{
|
||||
fputs("Usage: ZydisInfo -[16|32|64] [hexbytes]\n", stderr);
|
||||
|
|
Loading…
Reference in New Issue