mirror of https://github.com/x64dbg/zydis
Merge branch 'develop'
This commit is contained in:
commit
2852492484
|
@ -26,6 +26,9 @@ option(ZYDIS_FEATURE_MVEX
|
|||
option(BUILD_SHARED_LIBS
|
||||
"Build shared libraries"
|
||||
OFF)
|
||||
option(ZYDIS_WHOLE_PROGRAM_OPTIMIZATION
|
||||
"Enable whole program optimization"
|
||||
OFF)
|
||||
option(ZYDIS_NO_LIBC
|
||||
"Don't use any C standard library functions (for exotic build-envs like kernel drivers)"
|
||||
OFF)
|
||||
|
@ -70,6 +73,11 @@ target_include_directories("Zydis"
|
|||
PUBLIC "include" ${PROJECT_BINARY_DIR}
|
||||
PRIVATE "src")
|
||||
target_compile_definitions("Zydis" PRIVATE "_CRT_SECURE_NO_WARNINGS" "ZYDIS_EXPORTS")
|
||||
if (ZYDIS_WHOLE_PROGRAM_OPTIMIZATION AND MSVC)
|
||||
set_target_properties("Zydis" PROPERTIES COMPILE_FLAGS "/GL")
|
||||
set_target_properties("Zydis" PROPERTIES LINK_FLAGS_RELEASE "/LTCG")
|
||||
set_target_properties("Zydis" PROPERTIES STATIC_LIBRARY_FLAGS_RELEASE "/LTCG")
|
||||
endif ()
|
||||
generate_export_header("Zydis" BASE_NAME "ZYDIS" EXPORT_FILE_NAME "ZydisExportConfig.h")
|
||||
|
||||
if (NOT ZYDIS_FEATURE_ENCODER AND NOT ZYDIS_FEATURE_DECODER)
|
||||
|
@ -80,6 +88,13 @@ if (NOT ZYDIS_FEATURE_ENCODER AND NOT ZYDIS_FEATURE_DECODER)
|
|||
)
|
||||
endif ()
|
||||
|
||||
if (ZYDIS_FEATURE_FORMATTER AND NOT ZYDIS_FEATURE_DECODER)
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"\nZYDIS_FEATURE_FORMATTER requires ZYDIS_FEATURE_DECODER to be enabled"
|
||||
)
|
||||
endif ()
|
||||
|
||||
if (NOT ZYDIS_FEATURE_DECODER)
|
||||
target_compile_definitions("Zydis" PUBLIC "ZYDIS_DISABLE_DECODER")
|
||||
endif ()
|
||||
|
@ -97,7 +112,7 @@ if (ZYDIS_NO_LIBC)
|
|||
endif ()
|
||||
|
||||
target_sources("Zydis"
|
||||
PUBLIC
|
||||
PRIVATE
|
||||
"${CMAKE_CURRENT_LIST_DIR}/include/Zydis/CommonTypes.h"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Defines.h"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/include/Zydis/MetaInfo.h"
|
||||
|
@ -110,7 +125,6 @@ target_sources("Zydis"
|
|||
"${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Zydis.h"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Internal/LibC.h"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Internal/SharedData.h"
|
||||
PRIVATE
|
||||
"src/MetaInfo.c"
|
||||
"src/Mnemonic.c"
|
||||
"src/Register.c"
|
||||
|
@ -121,16 +135,19 @@ target_sources("Zydis"
|
|||
|
||||
if (ZYDIS_FEATURE_DECODER)
|
||||
target_sources("Zydis"
|
||||
PUBLIC
|
||||
PRIVATE
|
||||
"${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Decoder.h"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/include/Zydis/DecoderTypes.h"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Formatter.h"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Internal/DecoderData.h"
|
||||
PRIVATE
|
||||
"src/Decoder.c"
|
||||
"src/DecoderData.c"
|
||||
"src/DecoderData.c")
|
||||
if (ZYDIS_FEATURE_FORMATTER)
|
||||
target_sources("Zydis"
|
||||
PRIVATE
|
||||
"${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Formatter.h"
|
||||
"src/Formatter.c")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if (BUILD_SHARED_LIBS AND WIN32)
|
||||
target_sources("Zydis" PRIVATE "src/VersionInfo.rc")
|
||||
|
@ -141,14 +158,17 @@ install(TARGETS "Zydis"
|
|||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
install(DIRECTORY "include" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||
install(FILES
|
||||
"${PROJECT_BINARY_DIR}/ZydisExportConfig.h"
|
||||
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
install(DIRECTORY "include/" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||
|
||||
# =============================================================================================== #
|
||||
# Examples #
|
||||
# =============================================================================================== #
|
||||
|
||||
if (ZYDIS_BUILD_EXAMPLES)
|
||||
if (ZYDIS_FEATURE_DECODER)
|
||||
if (ZYDIS_FEATURE_DECODER AND ZYDIS_FEATURE_FORMATTER)
|
||||
add_executable("FormatterHooks" "examples/FormatterHooks.c")
|
||||
target_link_libraries("FormatterHooks" "Zydis")
|
||||
set_target_properties("FormatterHooks" PROPERTIES FOLDER "Examples/Formatter")
|
||||
|
@ -158,6 +178,10 @@ if (ZYDIS_BUILD_EXAMPLES)
|
|||
target_link_libraries("ZydisFuzzIn" "Zydis")
|
||||
set_target_properties("FormatterHooks" PROPERTIES FOLDER "Examples")
|
||||
target_compile_definitions("ZydisFuzzIn" PRIVATE "_CRT_SECURE_NO_WARNINGS")
|
||||
if (ZYDIS_WHOLE_PROGRAM_OPTIMIZATION AND MSVC)
|
||||
set_target_properties("ZydisFuzzIn" PROPERTIES COMPILE_FLAGS "/GL")
|
||||
set_target_properties("ZydisFuzzIn" PROPERTIES LINK_FLAGS_RELEASE "/LTCG")
|
||||
endif ()
|
||||
if (ZYDIS_FUZZ_AFL_FAST)
|
||||
target_compile_definitions("ZydisFuzzIn" PRIVATE "ZYDIS_FUZZ_AFL_FAST")
|
||||
endif ()
|
||||
|
@ -166,6 +190,10 @@ if (ZYDIS_BUILD_EXAMPLES)
|
|||
target_link_libraries("ZydisPerfTest" "Zydis")
|
||||
set_target_properties("FormatterHooks" PROPERTIES FOLDER "Examples")
|
||||
target_compile_definitions("ZydisPerfTest" PRIVATE "_CRT_SECURE_NO_WARNINGS")
|
||||
if (ZYDIS_WHOLE_PROGRAM_OPTIMIZATION AND MSVC)
|
||||
set_target_properties("ZydisPerfTest" PROPERTIES COMPILE_FLAGS "/GL")
|
||||
set_target_properties("ZydisPerfTest" PROPERTIES LINK_FLAGS_RELEASE "/LTCG")
|
||||
endif ()
|
||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
||||
target_compile_definitions("ZydisPerfTest" PRIVATE "_GNU_SOURCE")
|
||||
find_package(Threads REQUIRED)
|
||||
|
@ -179,15 +207,23 @@ endif ()
|
|||
# =============================================================================================== #
|
||||
|
||||
if (ZYDIS_BUILD_TOOLS)
|
||||
if (ZYDIS_FEATURE_DECODER)
|
||||
if (ZYDIS_FEATURE_DECODER AND ZYDIS_FEATURE_FORMATTER)
|
||||
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_WHOLE_PROGRAM_OPTIMIZATION AND MSVC)
|
||||
set_target_properties("ZydisDisasm" PROPERTIES COMPILE_FLAGS "/GL")
|
||||
set_target_properties("ZydisDisasm" PROPERTIES LINK_FLAGS_RELEASE "/LTCG")
|
||||
endif ()
|
||||
|
||||
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")
|
||||
if (ZYDIS_WHOLE_PROGRAM_OPTIMIZATION AND MSVC)
|
||||
set_target_properties("ZydisInfo" PROPERTIES COMPILE_FLAGS "/GL")
|
||||
set_target_properties("ZydisInfo" PROPERTIES LINK_FLAGS_RELEASE "/LTCG")
|
||||
endif ()
|
||||
endif ()
|
||||
endif ()
|
||||
|
|
4
LICENSE
4
LICENSE
|
@ -1,7 +1,7 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2017 Florian Bernd
|
||||
Copyright (c) 2017 Joel Höner
|
||||
Copyright (c) 2018 Florian Bernd
|
||||
Copyright (c) 2018 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
|
||||
|
|
46
README.md
46
README.md
|
@ -1,31 +1,19 @@
|
|||
![zydis logo](https://mainframe.pw/u/P94JAqY9XSDdPedv.svg?x)
|
||||
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![Gitter](https://badges.gitter.im/zyantific/zyan-disassembler-engine.svg)](https://gitter.im/zyantific/zyan-disassembler-engine?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=body_badge) [![Build status](https://ci.appveyor.com/api/projects/status/2tad27q0b9v6qtga/branch/master?svg=true)](https://ci.appveyor.com/project/athre0z/zydis/branch/master)
|
||||
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![Gitter](https://badges.gitter.im/zyantific/zyan-disassembler-engine.svg)](https://gitter.im/zyantific/zydis?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=body_badge) [![Discord](https://img.shields.io/discord/390136917779415060.svg)](https://discordapp.com/channels/390136917779415060/390138781313007626) [![Build status](https://ci.appveyor.com/api/projects/status/2tad27q0b9v6qtga/branch/master?svg=true)](https://ci.appveyor.com/project/athre0z/zydis/branch/master)
|
||||
|
||||
Fast and lightweight x86/x86-64 disassembler library.
|
||||
|
||||
## Features
|
||||
|
||||
- Supports all x86 and x86-64 (AMD64) instructions.
|
||||
- Supports pretty much all ISA extensions (list incomplete):
|
||||
- FPU (x87), MMX
|
||||
- SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, SSE4A, AESNI
|
||||
- AVX, AVX2, AVX512BW, AVX512CD, AVX512DQ, AVX512ER, AVX512F, AVX512PF, AVX512VL
|
||||
- ADX, BMI1, BMI2, FMA, FMA4
|
||||
- Supports all x86 and x86-64 (AMD64) instructions and [extensions](https://github.com/zyantific/zydis/blob/master/include/Zydis/Generated/EnumISAExt.h)
|
||||
- Optimized for high performance
|
||||
- No dynamic memory allocation ("malloc")
|
||||
- Thread-safe by design
|
||||
- Very small file-size overhead compared to other common disassembler libraries
|
||||
- [Complete doxygen documentation](https://www.zyantific.com/doc/zydis/index.html)
|
||||
- No dependencies on platform specific APIs
|
||||
- Should compile on any platform with a complete libc and CMake
|
||||
- Tested on Windows, macOS and Linux
|
||||
|
||||
## Roadmap
|
||||
|
||||
- Language bindings [v2.0 final]
|
||||
- Tests [v2.0 final]
|
||||
- Graphical editor for the instruction-database [v2.0 final]
|
||||
- Implement CMake feature gates. Currently, everything is always included. [v2.0 final]
|
||||
- Encoding support [v2.1]
|
||||
- Absolutely no dependencies — [not even libc](https://github.com/zyantific/zydis/blob/develop/CMakeLists.txt#L32)
|
||||
- Should compile on any platform with a working C99 compiler
|
||||
- Tested on Windows, macOS, FreeBSD and Linux, both user and kernel mode
|
||||
|
||||
## Quick Example
|
||||
|
||||
|
@ -33,6 +21,7 @@ The following example program uses Zydis to disassemble a given memory buffer an
|
|||
|
||||
```C
|
||||
#include <stdio.h>
|
||||
#include <inttypes.h>
|
||||
#include <Zydis/Zydis.h>
|
||||
|
||||
int main()
|
||||
|
@ -57,12 +46,15 @@ int main()
|
|||
ZydisFormatterInit(&formatter, ZYDIS_FORMATTER_STYLE_INTEL);
|
||||
|
||||
// Loop over the instructions in our buffer.
|
||||
// The IP is chosen arbitrary here in order to better visualize
|
||||
// relative addressing.
|
||||
uint64_t instructionPointer = 0x007FFFFFFF400000;
|
||||
uint8_t* readPointer = data;
|
||||
size_t offset = 0;
|
||||
size_t length = sizeof(data);
|
||||
ZydisDecodedInstruction instruction;
|
||||
while (ZYDIS_SUCCESS(ZydisDecoderDecodeBuffer(
|
||||
&decoder, readPointer, length, instructionPointer, &instruction)))
|
||||
&decoder, data + offset, length - offset,
|
||||
instructionPointer, &instruction)))
|
||||
{
|
||||
// Print current instruction pointer.
|
||||
printf("%016" PRIX64 " ", instructionPointer);
|
||||
|
@ -74,8 +66,7 @@ int main()
|
|||
&formatter, &instruction, buffer, sizeof(buffer));
|
||||
puts(buffer);
|
||||
|
||||
readPointer += instruction.length;
|
||||
length -= instruction.length;
|
||||
offset += instruction.length;
|
||||
instructionPointer += instruction.length;
|
||||
}
|
||||
}
|
||||
|
@ -96,12 +87,13 @@ The above example program generates the following output:
|
|||
007FFFFFFF400013 js 0x007FFFFFFF42DB15
|
||||
```
|
||||
|
||||
## Compilation
|
||||
## Build
|
||||
|
||||
#### Unix
|
||||
|
||||
Zydis builds cleanly on most platforms without any external dependencies. You can use CMake to generate project files for your favorite C99 compiler.
|
||||
|
||||
```bash
|
||||
# Linux and OS X
|
||||
git clone 'https://github.com/zyantific/zydis.git'
|
||||
cd zydis
|
||||
mkdir build && cd build
|
||||
|
@ -109,12 +101,16 @@ cmake ..
|
|||
make
|
||||
```
|
||||
|
||||
#### Windows
|
||||
|
||||
Either use the [Visual Studio 2017 project](https://github.com/zyantific/zydis/tree/master/msvc) or build Zydis using [CMake](https://cmake.org/download/) ([video guide](https://www.youtube.com/watch?v=fywLDK1OAtQ)).
|
||||
|
||||
## `ZydisInfo` tool
|
||||
![ZydisInfo](https://raw.githubusercontent.com/zyantific/zydis/master/assets/screenshots/ZydisInfo.png)
|
||||
|
||||
## Credits
|
||||
- Intel (for open-sourcing [XED](https://github.com/intelxed/xed), allowing for automatic comparision of our tables against theirs, improving both)
|
||||
- LLVM (for providing pretty solid instruction data as well)
|
||||
- [LLVM](https://llvm.org) (for providing pretty solid instruction data as well)
|
||||
- Christian Ludloff (http://sandpile.org, insanely helpful)
|
||||
- [LekoArts](https://www.lekoarts.de/) (for creating the project logo)
|
||||
- Our [contributors on GitHub](https://github.com/zyantific/zydis/graphs/contributors)
|
||||
|
|
|
@ -138,14 +138,14 @@ ZydisFormatterFunc defaultPrintMnemonic;
|
|||
static ZydisStatus ZydisFormatterPrintMnemonic(const ZydisFormatter* formatter,
|
||||
ZydisString* string, const ZydisDecodedInstruction* instruction, ZydisCustomUserData* userData)
|
||||
{
|
||||
// We use the user-data to pass data to the @c ZydisFormatterFormatOperandImm function.
|
||||
// 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)
|
||||
{
|
||||
const uint8_t conditionCode =
|
||||
(uint8_t)instruction->operands[instruction->operandCount - 1].imm.value.u;
|
||||
const ZydisU8 conditionCode =
|
||||
(ZydisU8)instruction->operands[instruction->operandCount - 1].imm.value.u;
|
||||
switch (instruction->mnemonic)
|
||||
{
|
||||
case ZYDIS_MNEMONIC_CMPPS:
|
||||
|
@ -201,9 +201,7 @@ static ZydisStatus ZydisFormatterFormatOperandImm(const ZydisFormatter* formatte
|
|||
// operand, because it got replaced by the alias-mnemonic
|
||||
if (userData->ommitImmediate)
|
||||
{
|
||||
// The formatter will automatically omit the operand, if the buffer remains unchanged
|
||||
// after the callback returns
|
||||
return ZYDIS_STATUS_SUCCESS;
|
||||
return ZYDIS_STATUS_SKIP_OPERAND;
|
||||
}
|
||||
|
||||
// Default immediate formatting
|
||||
|
@ -216,7 +214,8 @@ static ZydisStatus ZydisFormatterFormatOperandImm(const ZydisFormatter* formatte
|
|||
/* Helper functions */
|
||||
/* ============================================================================================== */
|
||||
|
||||
void disassembleBuffer(ZydisDecoder* decoder, uint8_t* data, size_t length, ZydisBool installHooks)
|
||||
void disassembleBuffer(ZydisDecoder* decoder, ZydisU8* data, ZydisUSize length,
|
||||
ZydisBool installHooks)
|
||||
{
|
||||
ZydisFormatter formatter;
|
||||
ZydisFormatterInit(&formatter, ZYDIS_FORMATTER_STYLE_INTEL);
|
||||
|
@ -233,7 +232,7 @@ void disassembleBuffer(ZydisDecoder* decoder, uint8_t* data, size_t length, Zydi
|
|||
(const void**)&defaultFormatOperandImm);
|
||||
}
|
||||
|
||||
uint64_t instructionPointer = 0x007FFFFFFF400000;
|
||||
ZydisU64 instructionPointer = 0x007FFFFFFF400000;
|
||||
|
||||
ZydisDecodedInstruction instruction;
|
||||
ZydisCustomUserData userData;
|
||||
|
@ -263,7 +262,7 @@ int main()
|
|||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
uint8_t data[] =
|
||||
ZydisU8 data[] =
|
||||
{
|
||||
// cmpps xmm1, xmm4, 0x03
|
||||
0x0F, 0xC2, 0xCC, 0x03,
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/***************************************************************************************************
|
||||
|
||||
Zyan Disassembler Engine (Zydis)
|
||||
Zyan Disassembler Library (Zydis)
|
||||
|
||||
Original Author : Joel Höner
|
||||
Original Author : Joel Hoener
|
||||
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/***************************************************************************************************
|
||||
|
||||
Zyan Disassembler Engine (Zydis)
|
||||
Zyan Disassembler Library (Zydis)
|
||||
|
||||
Original Author : Florian Bernd
|
||||
|
||||
|
@ -245,7 +245,7 @@ void generateTestData(FILE* file, uint8_t encoding)
|
|||
{
|
||||
data[i] = rand() % 256;
|
||||
}
|
||||
uint8_t offset = rand() % (ZYDIS_MAX_INSTRUCTION_LENGTH - 2);
|
||||
const uint8_t offset = rand() % (ZYDIS_MAX_INSTRUCTION_LENGTH - 2);
|
||||
switch (encoding)
|
||||
{
|
||||
case 0:
|
||||
|
@ -302,7 +302,7 @@ void generateTestData(FILE* file, uint8_t encoding)
|
|||
fwrite(&instruction.data[0], 1, instruction.length, file);
|
||||
++count;
|
||||
|
||||
uint8_t p = (uint8_t)((double)count / 100000 * 100);
|
||||
const uint8_t p = (uint8_t)((double)count / 100000 * 100);
|
||||
if (last < p)
|
||||
{
|
||||
last = p;
|
||||
|
@ -358,15 +358,16 @@ int main(int argc, char** argv)
|
|||
{
|
||||
time_t t;
|
||||
srand((unsigned)time(&t));
|
||||
}
|
||||
|
||||
} else
|
||||
{
|
||||
adjustProcessAndThreadPriority();
|
||||
}
|
||||
|
||||
for (uint8_t i = 0; i < ZYDIS_ARRAY_SIZE(tests); ++i)
|
||||
{
|
||||
FILE* file;
|
||||
|
||||
size_t len = strlen(directory);
|
||||
const size_t len = strlen(directory);
|
||||
char buf[1024];
|
||||
strncpy(&buf[0], directory, sizeof(buf) - 1);
|
||||
if (generate)
|
||||
|
@ -389,7 +390,7 @@ int main(int argc, char** argv)
|
|||
} else
|
||||
{
|
||||
fseek(file, 0L, SEEK_END);
|
||||
long length = ftell(file);
|
||||
const long length = ftell(file);
|
||||
void* buffer = malloc(length);
|
||||
if (!buffer)
|
||||
{
|
||||
|
@ -414,10 +415,11 @@ int main(int argc, char** argv)
|
|||
|
||||
NextFile1:
|
||||
free(buffer);
|
||||
}
|
||||
|
||||
NextFile2:
|
||||
fclose(file);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
Zyan Disassembler Library (Zydis)
|
||||
|
||||
Original Author : Florian Bernd, Joel Höner
|
||||
Original Author : Florian Bernd, Joel Hoener
|
||||
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
|
@ -124,10 +124,20 @@ enum ZydisDecoderModes
|
|||
* This mode is enabled by default.
|
||||
*/
|
||||
ZYDIS_DECODER_MODE_TZCNT,
|
||||
/**
|
||||
* @brief Enables the WBNOINVD mode.
|
||||
*
|
||||
* The `WBINVD` instruction is interpreted as `WBNOINVD` on ICL chips, if a `F3` prefix is
|
||||
* used.
|
||||
*
|
||||
* This mode is disabled by default.
|
||||
*/
|
||||
ZYDIS_DECODER_MODE_WBNOINVD,
|
||||
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
ZYDIS_DECODER_MODE_MAX_VALUE = ZYDIS_DECODER_MODE_TZCNT
|
||||
ZYDIS_DECODER_MODE_MAX_VALUE = ZYDIS_DECODER_MODE_WBNOINVD
|
||||
};
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
|
|
@ -72,10 +72,14 @@ enum ZydisMemoryOperandTypes
|
|||
ZYDIS_MEMOP_TYPE_AGEN,
|
||||
/**
|
||||
* @brief A memory operand using `SIB` addressing form, where the index register is not used
|
||||
* in address calculation and scale is ignored. No real memory-access is
|
||||
* caused.
|
||||
* in address calculation and scale is ignored. No real memory-access is caused.
|
||||
*/
|
||||
ZYDIS_MEMOP_TYPE_MIB
|
||||
ZYDIS_MEMOP_TYPE_MIB,
|
||||
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
ZYDIS_MEMOP_TYPE_MAX_VALUE = ZYDIS_MEMOP_TYPE_MIB
|
||||
};
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
@ -499,6 +503,7 @@ enum ZydisCPUFlags
|
|||
* @brief FPU condition-code flag 3.
|
||||
*/
|
||||
ZYDIS_CPUFLAG_C3,
|
||||
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
|
@ -521,6 +526,7 @@ enum ZydisCPUFlagActions
|
|||
ZYDIS_CPUFLAG_ACTION_SET_0,
|
||||
ZYDIS_CPUFLAG_ACTION_SET_1,
|
||||
ZYDIS_CPUFLAG_ACTION_UNDEFINED,
|
||||
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
|
@ -582,6 +588,7 @@ enum ZydisExceptionClasses
|
|||
ZYDIS_EXCEPTION_CLASS_E12NP,
|
||||
ZYDIS_EXCEPTION_CLASS_K20,
|
||||
ZYDIS_EXCEPTION_CLASS_K21,
|
||||
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
|
@ -606,6 +613,7 @@ enum ZydisVectorLengths
|
|||
ZYDIS_VECTOR_LENGTH_128 = 128,
|
||||
ZYDIS_VECTOR_LENGTH_256 = 256,
|
||||
ZYDIS_VECTOR_LENGTH_512 = 512,
|
||||
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
|
@ -627,6 +635,11 @@ typedef ZydisU8 ZydisMaskMode;
|
|||
enum ZydisMaskModes
|
||||
{
|
||||
ZYDIS_MASK_MODE_INVALID,
|
||||
|
||||
// TODO: Add `ZYDIS_MASK_MODE_DISABLED` for for `EVEX`/`MVEX` instructions with `K0` mask
|
||||
// TODO: Add `ZYDIS_MASK_MODE_CONTROL` and `ZYDIS_MASK_MODE_CONTROL_ZERO` as replacement for
|
||||
// the `isControlMask` field
|
||||
|
||||
/**
|
||||
* @brief The embedded mask register is used as a merge-mask. This is the default mode for
|
||||
* all EVEX/MVEX-instructions.
|
||||
|
@ -636,6 +649,7 @@ enum ZydisMaskModes
|
|||
* @brief The embedded mask register is used as a zero-mask.
|
||||
*/
|
||||
ZYDIS_MASK_MODE_ZERO,
|
||||
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
|
@ -669,6 +683,7 @@ enum ZydisBroadcastModes
|
|||
ZYDIS_BROADCAST_MODE_4_TO_8,
|
||||
ZYDIS_BROADCAST_MODE_4_TO_16,
|
||||
ZYDIS_BROADCAST_MODE_8_TO_16,
|
||||
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
|
@ -706,6 +721,7 @@ enum ZydisRoundingModes
|
|||
* @brief Round towards zero.
|
||||
*/
|
||||
ZYDIS_ROUNDING_MODE_RZ,
|
||||
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
|
@ -735,6 +751,7 @@ enum ZydisSwizzleModes
|
|||
ZYDIS_SWIZZLE_MODE_BBBB,
|
||||
ZYDIS_SWIZZLE_MODE_CCCC,
|
||||
ZYDIS_SWIZZLE_MODE_DDDD,
|
||||
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
|
@ -761,6 +778,7 @@ enum ZydisConversionModes
|
|||
ZYDIS_CONVERSION_MODE_UINT8,
|
||||
ZYDIS_CONVERSION_MODE_SINT16,
|
||||
ZYDIS_CONVERSION_MODE_UINT16,
|
||||
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
|
@ -856,7 +874,7 @@ typedef struct ZydisDecodedInstruction_
|
|||
*/
|
||||
ZydisVectorLength vectorLength;
|
||||
/**
|
||||
* @brief Info about the embedded writemask-register.
|
||||
* @brief Info about the embedded writemask-register (`EVEX` and `MVEX` only).
|
||||
*/
|
||||
struct
|
||||
{
|
||||
|
@ -901,22 +919,22 @@ typedef struct ZydisDecodedInstruction_
|
|||
ZydisRoundingMode mode;
|
||||
} rounding;
|
||||
/**
|
||||
* @brief Contains info about the AVX register-swizzle (MVEX only).
|
||||
* @brief Contains info about the AVX register-swizzle (`MVEX` only).
|
||||
*/
|
||||
struct
|
||||
{
|
||||
/**
|
||||
* @brief The AVX register-swizzle mode (MVEX only).
|
||||
* @brief The AVX register-swizzle mode (`MVEX` only).
|
||||
*/
|
||||
ZydisSwizzleMode mode;
|
||||
} swizzle;
|
||||
/**
|
||||
* @brief Contains info about the AVX data-conversion (MVEX only).
|
||||
* @brief Contains info about the AVX data-conversion (`MVEX` only).
|
||||
*/
|
||||
struct
|
||||
{
|
||||
/**
|
||||
* @brief The AVX data-conversion mode (MVEX only).
|
||||
* @brief The AVX data-conversion mode (`MVEX` only).
|
||||
*/
|
||||
ZydisConversionMode mode;
|
||||
} conversion;
|
||||
|
@ -925,9 +943,10 @@ typedef struct ZydisDecodedInstruction_
|
|||
*/
|
||||
ZydisBool hasSAE;
|
||||
/**
|
||||
* @brief Signals, if the instruction has a memory eviction-hint (MVEX only).
|
||||
* @brief Signals, if the instruction has a memory eviction-hint (`MVEX` only).
|
||||
*/
|
||||
ZydisBool hasEvictionHint;
|
||||
// TODO: publish EVEX tuple-type and MVEX functionality
|
||||
} avx;
|
||||
/**
|
||||
* @brief Meta info.
|
||||
|
@ -1265,6 +1284,7 @@ typedef struct ZydisDecodedInstruction_
|
|||
* @brief The physical displacement size, in bits.
|
||||
*/
|
||||
ZydisU8 size;
|
||||
// TODO: publish cd8 scale
|
||||
/**
|
||||
* @brief The offset of the displacement data, relative to the beginning of the
|
||||
* instruction, in bytes.
|
||||
|
|
|
@ -183,6 +183,11 @@
|
|||
*/
|
||||
#define ZYDIS_UNUSED_PARAMETER(x) (void)(x)
|
||||
|
||||
/**
|
||||
* @brief Intentional fallthrough.
|
||||
*/
|
||||
#define ZYDIS_FALLTHROUGH
|
||||
|
||||
/**
|
||||
* @brief Calculates the size of an array.
|
||||
*/
|
||||
|
|
|
@ -308,7 +308,7 @@ enum ZydisFormatterHookTypes
|
|||
*/
|
||||
ZYDIS_FORMATTER_HOOK_PRE_INSTRUCTION,
|
||||
/**
|
||||
* @brief This function is invoked before the formatter formatted an instruction.
|
||||
* @brief This function is invoked after the formatter formatted an instruction.
|
||||
*/
|
||||
ZYDIS_FORMATTER_HOOK_POST_INSTRUCTION,
|
||||
/**
|
||||
|
@ -316,7 +316,7 @@ enum ZydisFormatterHookTypes
|
|||
*/
|
||||
ZYDIS_FORMATTER_HOOK_PRE_OPERAND,
|
||||
/**
|
||||
* @brief This function is invoked before the formatter formatted an operand.
|
||||
* @brief This function is invoked after the formatter formatted an operand.
|
||||
*/
|
||||
ZYDIS_FORMATTER_HOOK_POST_OPERAND,
|
||||
|
||||
|
@ -336,7 +336,8 @@ enum ZydisFormatterHookTypes
|
|||
* @brief This function is invoked to format a memory operand.
|
||||
*
|
||||
* Replacing this function might indirectly disable some specific calls to the
|
||||
* `ZYDIS_FORMATTER_HOOK_PRINT_ADDRESS` and `ZYDIS_FORMATTER_HOOK_PRINT_DISP` functions.
|
||||
* `ZYDIS_FORMATTER_HOOK_PRINT_MEMSIZE`, `ZYDIS_FORMATTER_HOOK_PRINT_ADDRESS` and
|
||||
* `ZYDIS_FORMATTER_HOOK_PRINT_DISP` functions.
|
||||
*/
|
||||
ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_MEM,
|
||||
/**
|
||||
|
@ -457,9 +458,6 @@ typedef struct ZydisFormatter_ ZydisFormatter;
|
|||
* Returning a status code other than `ZYDIS_STATUS_SUCCESS` will immediately cause the formatting
|
||||
* process to fail.
|
||||
*
|
||||
* Returning `ZYDIS_STATUS_SUCCESS` in `ZYDIS_FORMATTER_HOOK_PRINT_PREFIXES` without writing to
|
||||
* the string is valid and signals that the corresponding element should not be printed.
|
||||
*
|
||||
* This function type is used for:
|
||||
* - `ZYDIS_FORMATTER_HOOK_PRE_INSTRUCTION`
|
||||
* - `ZYDIS_FORMATTER_HOOK_POST_INSTRUCTION`
|
||||
|
@ -482,16 +480,18 @@ typedef ZydisStatus (*ZydisFormatterFunc)(const ZydisFormatter* formatter,
|
|||
* @return A zydis status code.
|
||||
*
|
||||
* Returning a status code other than `ZYDIS_STATUS_SUCCESS` will immediately cause the formatting
|
||||
* process to fail.
|
||||
* process to fail (see exceptions below).
|
||||
*
|
||||
* Returning `ZYDIS_STATUS_SUCCESS` in one of the `ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_X` hooks
|
||||
* without writing to the string is valid and will cause the formatter to omit the current
|
||||
* Returning `ZYDIS_STATUS_SKIP_OPERAND` is valid for `ZYDIS_FORMATTER_HOOK_PRE_OPERAND`,
|
||||
* `ZYDIS_FORMATTER_HOOK_POST_OPERAND` and all of the `ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_XXX`
|
||||
* callbacks. This will cause the formatter to omit the current operand.
|
||||
*
|
||||
* DEPRECATED:
|
||||
* Returning `ZYDIS_STATUS_SUCCESS` without writing to the string is valid for
|
||||
* `ZYDIS_FORMATTER_HOOK_PRE_OPERAND`, `ZYDIS_FORMATTER_HOOK_POST_OPERAND` and all of the
|
||||
* `ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_XXX`. This will cause the formatter to omit the current
|
||||
* operand.
|
||||
*
|
||||
* Returning `ZYDIS_STATUS_SUCCESS` in `ZYDIS_FORMATTER_HOOK_PRINT_MEMSIZE` or
|
||||
* `ZYDIS_FORMATTER_HOOK_PRINT_DECORATOR` without writing to the string is valid and signals that
|
||||
* the corresponding element should not be printed for the current operand.
|
||||
*
|
||||
* This function type is used for:
|
||||
* - `ZYDIS_FORMATTER_HOOK_PRE_OPERAND`
|
||||
* - `ZYDIS_FORMATTER_HOOK_POST_OPERAND`
|
||||
|
@ -554,21 +554,18 @@ typedef ZydisStatus (*ZydisFormatterAddressFunc)(const ZydisFormatter* formatter
|
|||
* @param string A pointer to the string.
|
||||
* @param instruction A pointer to the `ZydisDecodedInstruction` struct.
|
||||
* @param operand A pointer to the `ZydisDecodedOperand` struct.
|
||||
* @param type The decorator type.
|
||||
* @param decorator The decorator type.
|
||||
* @param userData A pointer to user-defined data.
|
||||
*
|
||||
* @return Returning a status code other than `ZYDIS_STATUS_SUCCESS` will immediately cause the
|
||||
* formatting process to fail.
|
||||
*
|
||||
* Returning `ZYDIS_STATUS_SUCCESS` without writing to the string is valid and will cause the
|
||||
* formatter to omit the current decorator.
|
||||
*
|
||||
* This function type is used for:
|
||||
* - `ZYDIS_FORMATTER_HOOK_PRINT_DECORATOR`
|
||||
*/
|
||||
typedef ZydisStatus (*ZydisFormatterDecoratorFunc)(const ZydisFormatter* formatter,
|
||||
ZydisString* string, const ZydisDecodedInstruction* instruction,
|
||||
const ZydisDecodedOperand* operand, ZydisDecoratorType type, void* userData);
|
||||
const ZydisDecodedOperand* operand, ZydisDecoratorType decorator, void* userData);
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
/* Formatter struct */
|
||||
|
@ -685,6 +682,43 @@ ZYDIS_EXPORT ZydisStatus ZydisFormatterFormatInstruction(const ZydisFormatter* f
|
|||
ZYDIS_EXPORT ZydisStatus ZydisFormatterFormatInstructionEx(const ZydisFormatter* formatter,
|
||||
const ZydisDecodedInstruction* instruction, char* buffer, ZydisUSize bufferLen, void* userData);
|
||||
|
||||
/**
|
||||
* @brief Formats the given operand and writes it into the output buffer.
|
||||
*
|
||||
* @param formatter A pointer to the `ZydisFormatter` instance.
|
||||
* @param instruction A pointer to the `ZydisDecodedInstruction` struct.
|
||||
* @param index The index of the operand to format.
|
||||
* @param buffer A pointer to the output buffer.
|
||||
* @param bufferLen The length of the output buffer.
|
||||
*
|
||||
* @return A zydis status code.
|
||||
*
|
||||
* Use `ZydisFormatterFormatInstruction` or `ZydisFormatterFormatInstructionEx` to format a
|
||||
* complete instruction.
|
||||
*/
|
||||
ZYDIS_EXPORT ZydisStatus ZydisFormatterFormatOperand(const ZydisFormatter* formatter,
|
||||
const ZydisDecodedInstruction* instruction, ZydisU8 index, char* buffer, ZydisUSize bufferLen);
|
||||
|
||||
/**
|
||||
* @brief Formats the given operand and writes it into the output buffer.
|
||||
*
|
||||
* @param formatter A pointer to the `ZydisFormatter` instance.
|
||||
* @param instruction A pointer to the `ZydisDecodedInstruction` struct.
|
||||
* @param index The index of the operand to format.
|
||||
* @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.
|
||||
*
|
||||
* Use `ZydisFormatterFormatInstruction` or `ZydisFormatterFormatInstructionEx` to format a
|
||||
* complete instruction.
|
||||
*/
|
||||
ZYDIS_EXPORT ZydisStatus ZydisFormatterFormatOperandEx(const ZydisFormatter* formatter,
|
||||
const ZydisDecodedInstruction* instruction, ZydisU8 index, char* buffer, ZydisUSize bufferLen,
|
||||
void* userData);
|
||||
|
||||
/* ============================================================================================== */
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -66,8 +66,11 @@ enum ZydisISAExts
|
|||
ZYDIS_ISA_EXT_AVX512_VPCLMULQDQ_128,
|
||||
ZYDIS_ISA_EXT_AVX512_VPCLMULQDQ_256,
|
||||
ZYDIS_ISA_EXT_AVX512_VPCLMULQDQ_512,
|
||||
ZYDIS_ISA_EXT_AVX512_VPOPCNTDQ_128,
|
||||
ZYDIS_ISA_EXT_AVX512_VPOPCNTDQ_256,
|
||||
ZYDIS_ISA_EXT_AVX512_VPOPCNTDQ_512,
|
||||
ZYDIS_ISA_EXT_AVXAES,
|
||||
ZYDIS_ISA_EXT_AVX_GFNI,
|
||||
ZYDIS_ISA_EXT_BMI1,
|
||||
ZYDIS_ISA_EXT_BMI2,
|
||||
ZYDIS_ISA_EXT_CET,
|
||||
|
@ -103,10 +106,12 @@ enum ZydisISAExts
|
|||
ZYDIS_ISA_EXT_LONGMODE,
|
||||
ZYDIS_ISA_EXT_LZCNT,
|
||||
ZYDIS_ISA_EXT_MONITOR,
|
||||
ZYDIS_ISA_EXT_MONITORX,
|
||||
ZYDIS_ISA_EXT_MOVBE,
|
||||
ZYDIS_ISA_EXT_MPX,
|
||||
ZYDIS_ISA_EXT_PAUSE,
|
||||
ZYDIS_ISA_EXT_PCLMULQDQ,
|
||||
ZYDIS_ISA_EXT_PCONFIG,
|
||||
ZYDIS_ISA_EXT_PENTIUMMMX,
|
||||
ZYDIS_ISA_EXT_PENTIUMREAL,
|
||||
ZYDIS_ISA_EXT_PKU,
|
||||
|
@ -123,6 +128,7 @@ enum ZydisISAExts
|
|||
ZYDIS_ISA_EXT_RDWRFSGS,
|
||||
ZYDIS_ISA_EXT_RTM,
|
||||
ZYDIS_ISA_EXT_SGX,
|
||||
ZYDIS_ISA_EXT_SGX_ENCLV,
|
||||
ZYDIS_ISA_EXT_SHA,
|
||||
ZYDIS_ISA_EXT_SMAP,
|
||||
ZYDIS_ISA_EXT_SMX,
|
||||
|
@ -133,6 +139,7 @@ enum ZydisISAExts
|
|||
ZYDIS_ISA_EXT_SSE3X87,
|
||||
ZYDIS_ISA_EXT_SSE4,
|
||||
ZYDIS_ISA_EXT_SSE42,
|
||||
ZYDIS_ISA_EXT_SSE4A,
|
||||
ZYDIS_ISA_EXT_SSEMXCSR,
|
||||
ZYDIS_ISA_EXT_SSE_PREFETCH,
|
||||
ZYDIS_ISA_EXT_SSSE3,
|
||||
|
@ -149,6 +156,13 @@ enum ZydisISAExts
|
|||
ZYDIS_ISA_EXT_XSAVEC,
|
||||
ZYDIS_ISA_EXT_XSAVEOPT,
|
||||
ZYDIS_ISA_EXT_XSAVES,
|
||||
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
ZYDIS_ISA_EXT_MAX_VALUE = ZYDIS_ISA_EXT_XSAVES,
|
||||
/**
|
||||
* @brief Minimum amount of bits required to store a value of this enum.
|
||||
*/
|
||||
ZYDIS_ISA_EXT_MIN_BITS = 0x0008
|
||||
};
|
||||
|
|
|
@ -38,10 +38,12 @@ enum ZydisISASets
|
|||
ZYDIS_ISA_SET_LZCNT,
|
||||
ZYDIS_ISA_SET_MMX,
|
||||
ZYDIS_ISA_SET_MONITOR,
|
||||
ZYDIS_ISA_SET_MONITORX,
|
||||
ZYDIS_ISA_SET_MOVBE,
|
||||
ZYDIS_ISA_SET_MPX,
|
||||
ZYDIS_ISA_SET_PAUSE,
|
||||
ZYDIS_ISA_SET_PCLMULQDQ,
|
||||
ZYDIS_ISA_SET_PCONFIG,
|
||||
ZYDIS_ISA_SET_PKU,
|
||||
ZYDIS_ISA_SET_PREFETCHWT1,
|
||||
ZYDIS_ISA_SET_PT,
|
||||
|
@ -52,6 +54,7 @@ enum ZydisISASets
|
|||
ZYDIS_ISA_SET_RDWRFSGS,
|
||||
ZYDIS_ISA_SET_RTM,
|
||||
ZYDIS_ISA_SET_SGX,
|
||||
ZYDIS_ISA_SET_SGX_ENCLV,
|
||||
ZYDIS_ISA_SET_SHA,
|
||||
ZYDIS_ISA_SET_SMAP,
|
||||
ZYDIS_ISA_SET_SMX,
|
||||
|
@ -59,6 +62,7 @@ enum ZydisISASets
|
|||
ZYDIS_ISA_SET_SSE2,
|
||||
ZYDIS_ISA_SET_SSE3,
|
||||
ZYDIS_ISA_SET_SSE4,
|
||||
ZYDIS_ISA_SET_SSE4A,
|
||||
ZYDIS_ISA_SET_SSSE3,
|
||||
ZYDIS_ISA_SET_SVM,
|
||||
ZYDIS_ISA_SET_TBM,
|
||||
|
@ -72,6 +76,13 @@ enum ZydisISASets
|
|||
ZYDIS_ISA_SET_XSAVEC,
|
||||
ZYDIS_ISA_SET_XSAVEOPT,
|
||||
ZYDIS_ISA_SET_XSAVES,
|
||||
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
ZYDIS_ISA_SET_MAX_VALUE = ZYDIS_ISA_SET_XSAVES,
|
||||
ZYDIS_ISA_SET_MIN_BITS = 0x0006
|
||||
/**
|
||||
* @brief Minimum amount of bits required to store a value of this enum.
|
||||
*/
|
||||
ZYDIS_ISA_SET_MIN_BITS = 0x0007
|
||||
};
|
||||
|
|
|
@ -60,6 +60,7 @@ enum ZydisInstructionCategories
|
|||
ZYDIS_CATEGORY_MPX,
|
||||
ZYDIS_CATEGORY_NOP,
|
||||
ZYDIS_CATEGORY_PCLMULQDQ,
|
||||
ZYDIS_CATEGORY_PCONFIG,
|
||||
ZYDIS_CATEGORY_PKU,
|
||||
ZYDIS_CATEGORY_POP,
|
||||
ZYDIS_CATEGORY_PREFETCH,
|
||||
|
@ -99,6 +100,13 @@ enum ZydisInstructionCategories
|
|||
ZYDIS_CATEGORY_XOP,
|
||||
ZYDIS_CATEGORY_XSAVE,
|
||||
ZYDIS_CATEGORY_XSAVEOPT,
|
||||
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
ZYDIS_CATEGORY_MAX_VALUE = ZYDIS_CATEGORY_XSAVEOPT,
|
||||
/**
|
||||
* @brief Minimum amount of bits required to store a value of this enum.
|
||||
*/
|
||||
ZYDIS_CATEGORY_MIN_BITS = 0x0007
|
||||
};
|
||||
|
|
|
@ -155,10 +155,12 @@ enum ZydisMnemonics
|
|||
ZYDIS_MNEMONIC_EMMS,
|
||||
ZYDIS_MNEMONIC_ENCLS,
|
||||
ZYDIS_MNEMONIC_ENCLU,
|
||||
ZYDIS_MNEMONIC_ENCLV,
|
||||
ZYDIS_MNEMONIC_ENDBR32,
|
||||
ZYDIS_MNEMONIC_ENDBR64,
|
||||
ZYDIS_MNEMONIC_ENTER,
|
||||
ZYDIS_MNEMONIC_EXTRACTPS,
|
||||
ZYDIS_MNEMONIC_EXTRQ,
|
||||
ZYDIS_MNEMONIC_F2XM1,
|
||||
ZYDIS_MNEMONIC_FABS,
|
||||
ZYDIS_MNEMONIC_FADD,
|
||||
|
@ -274,6 +276,7 @@ enum ZydisMnemonics
|
|||
ZYDIS_MNEMONIC_INSB,
|
||||
ZYDIS_MNEMONIC_INSD,
|
||||
ZYDIS_MNEMONIC_INSERTPS,
|
||||
ZYDIS_MNEMONIC_INSERTQ,
|
||||
ZYDIS_MNEMONIC_INSW,
|
||||
ZYDIS_MNEMONIC_INT,
|
||||
ZYDIS_MNEMONIC_INT1,
|
||||
|
@ -416,6 +419,7 @@ enum ZydisMnemonics
|
|||
ZYDIS_MNEMONIC_MINSD,
|
||||
ZYDIS_MNEMONIC_MINSS,
|
||||
ZYDIS_MNEMONIC_MONITOR,
|
||||
ZYDIS_MNEMONIC_MONITORX,
|
||||
ZYDIS_MNEMONIC_MOV,
|
||||
ZYDIS_MNEMONIC_MOVAPD,
|
||||
ZYDIS_MNEMONIC_MOVAPS,
|
||||
|
@ -439,6 +443,8 @@ enum ZydisMnemonics
|
|||
ZYDIS_MNEMONIC_MOVNTPD,
|
||||
ZYDIS_MNEMONIC_MOVNTPS,
|
||||
ZYDIS_MNEMONIC_MOVNTQ,
|
||||
ZYDIS_MNEMONIC_MOVNTSD,
|
||||
ZYDIS_MNEMONIC_MOVNTSS,
|
||||
ZYDIS_MNEMONIC_MOVQ,
|
||||
ZYDIS_MNEMONIC_MOVQ2DQ,
|
||||
ZYDIS_MNEMONIC_MOVSB,
|
||||
|
@ -461,6 +467,7 @@ enum ZydisMnemonics
|
|||
ZYDIS_MNEMONIC_MULSS,
|
||||
ZYDIS_MNEMONIC_MULX,
|
||||
ZYDIS_MNEMONIC_MWAIT,
|
||||
ZYDIS_MNEMONIC_MWAITX,
|
||||
ZYDIS_MNEMONIC_NEG,
|
||||
ZYDIS_MNEMONIC_NOP,
|
||||
ZYDIS_MNEMONIC_NOT,
|
||||
|
@ -508,6 +515,7 @@ enum ZydisMnemonics
|
|||
ZYDIS_MNEMONIC_PCMPGTW,
|
||||
ZYDIS_MNEMONIC_PCMPISTRI,
|
||||
ZYDIS_MNEMONIC_PCMPISTRM,
|
||||
ZYDIS_MNEMONIC_PCONFIG,
|
||||
ZYDIS_MNEMONIC_PDEP,
|
||||
ZYDIS_MNEMONIC_PEXT,
|
||||
ZYDIS_MNEMONIC_PEXTRB,
|
||||
|
@ -1583,6 +1591,13 @@ enum ZydisMnemonics
|
|||
ZYDIS_MNEMONIC_XSAVES64,
|
||||
ZYDIS_MNEMONIC_XSETBV,
|
||||
ZYDIS_MNEMONIC_XTEST,
|
||||
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
ZYDIS_MNEMONIC_MAX_VALUE = ZYDIS_MNEMONIC_XTEST,
|
||||
/**
|
||||
* @brief Minimum amount of bits required to store a value of this enum.
|
||||
*/
|
||||
ZYDIS_MNEMONIC_MIN_BITS = 0x000B
|
||||
};
|
||||
|
|
|
@ -0,0 +1,294 @@
|
|||
/**
|
||||
* @brief Defines the `ZydisRegister` datatype.
|
||||
*/
|
||||
typedef ZydisU8 ZydisRegister;
|
||||
|
||||
/**
|
||||
* @brief Values that represent `ZydisRegister` elements.
|
||||
*/
|
||||
enum ZydisRegisters
|
||||
{
|
||||
ZYDIS_REGISTER_NONE,
|
||||
|
||||
// General purpose registers 8-bit
|
||||
ZYDIS_REGISTER_AL,
|
||||
ZYDIS_REGISTER_CL,
|
||||
ZYDIS_REGISTER_DL,
|
||||
ZYDIS_REGISTER_BL,
|
||||
ZYDIS_REGISTER_AH,
|
||||
ZYDIS_REGISTER_CH,
|
||||
ZYDIS_REGISTER_DH,
|
||||
ZYDIS_REGISTER_BH,
|
||||
ZYDIS_REGISTER_SPL,
|
||||
ZYDIS_REGISTER_BPL,
|
||||
ZYDIS_REGISTER_SIL,
|
||||
ZYDIS_REGISTER_DIL,
|
||||
ZYDIS_REGISTER_R8B,
|
||||
ZYDIS_REGISTER_R9B,
|
||||
ZYDIS_REGISTER_R10B,
|
||||
ZYDIS_REGISTER_R11B,
|
||||
ZYDIS_REGISTER_R12B,
|
||||
ZYDIS_REGISTER_R13B,
|
||||
ZYDIS_REGISTER_R14B,
|
||||
ZYDIS_REGISTER_R15B,
|
||||
// General purpose registers 16-bit
|
||||
ZYDIS_REGISTER_AX,
|
||||
ZYDIS_REGISTER_CX,
|
||||
ZYDIS_REGISTER_DX,
|
||||
ZYDIS_REGISTER_BX,
|
||||
ZYDIS_REGISTER_SP,
|
||||
ZYDIS_REGISTER_BP,
|
||||
ZYDIS_REGISTER_SI,
|
||||
ZYDIS_REGISTER_DI,
|
||||
ZYDIS_REGISTER_R8W,
|
||||
ZYDIS_REGISTER_R9W,
|
||||
ZYDIS_REGISTER_R10W,
|
||||
ZYDIS_REGISTER_R11W,
|
||||
ZYDIS_REGISTER_R12W,
|
||||
ZYDIS_REGISTER_R13W,
|
||||
ZYDIS_REGISTER_R14W,
|
||||
ZYDIS_REGISTER_R15W,
|
||||
// General purpose registers 32-bit
|
||||
ZYDIS_REGISTER_EAX,
|
||||
ZYDIS_REGISTER_ECX,
|
||||
ZYDIS_REGISTER_EDX,
|
||||
ZYDIS_REGISTER_EBX,
|
||||
ZYDIS_REGISTER_ESP,
|
||||
ZYDIS_REGISTER_EBP,
|
||||
ZYDIS_REGISTER_ESI,
|
||||
ZYDIS_REGISTER_EDI,
|
||||
ZYDIS_REGISTER_R8D,
|
||||
ZYDIS_REGISTER_R9D,
|
||||
ZYDIS_REGISTER_R10D,
|
||||
ZYDIS_REGISTER_R11D,
|
||||
ZYDIS_REGISTER_R12D,
|
||||
ZYDIS_REGISTER_R13D,
|
||||
ZYDIS_REGISTER_R14D,
|
||||
ZYDIS_REGISTER_R15D,
|
||||
// General purpose registers 64-bit
|
||||
ZYDIS_REGISTER_RAX,
|
||||
ZYDIS_REGISTER_RCX,
|
||||
ZYDIS_REGISTER_RDX,
|
||||
ZYDIS_REGISTER_RBX,
|
||||
ZYDIS_REGISTER_RSP,
|
||||
ZYDIS_REGISTER_RBP,
|
||||
ZYDIS_REGISTER_RSI,
|
||||
ZYDIS_REGISTER_RDI,
|
||||
ZYDIS_REGISTER_R8,
|
||||
ZYDIS_REGISTER_R9,
|
||||
ZYDIS_REGISTER_R10,
|
||||
ZYDIS_REGISTER_R11,
|
||||
ZYDIS_REGISTER_R12,
|
||||
ZYDIS_REGISTER_R13,
|
||||
ZYDIS_REGISTER_R14,
|
||||
ZYDIS_REGISTER_R15,
|
||||
// Floating point legacy registers
|
||||
ZYDIS_REGISTER_ST0,
|
||||
ZYDIS_REGISTER_ST1,
|
||||
ZYDIS_REGISTER_ST2,
|
||||
ZYDIS_REGISTER_ST3,
|
||||
ZYDIS_REGISTER_ST4,
|
||||
ZYDIS_REGISTER_ST5,
|
||||
ZYDIS_REGISTER_ST6,
|
||||
ZYDIS_REGISTER_ST7,
|
||||
// Floating point multimedia registers
|
||||
ZYDIS_REGISTER_MM0,
|
||||
ZYDIS_REGISTER_MM1,
|
||||
ZYDIS_REGISTER_MM2,
|
||||
ZYDIS_REGISTER_MM3,
|
||||
ZYDIS_REGISTER_MM4,
|
||||
ZYDIS_REGISTER_MM5,
|
||||
ZYDIS_REGISTER_MM6,
|
||||
ZYDIS_REGISTER_MM7,
|
||||
// Floating point vector registers 128-bit
|
||||
ZYDIS_REGISTER_XMM0,
|
||||
ZYDIS_REGISTER_XMM1,
|
||||
ZYDIS_REGISTER_XMM2,
|
||||
ZYDIS_REGISTER_XMM3,
|
||||
ZYDIS_REGISTER_XMM4,
|
||||
ZYDIS_REGISTER_XMM5,
|
||||
ZYDIS_REGISTER_XMM6,
|
||||
ZYDIS_REGISTER_XMM7,
|
||||
ZYDIS_REGISTER_XMM8,
|
||||
ZYDIS_REGISTER_XMM9,
|
||||
ZYDIS_REGISTER_XMM10,
|
||||
ZYDIS_REGISTER_XMM11,
|
||||
ZYDIS_REGISTER_XMM12,
|
||||
ZYDIS_REGISTER_XMM13,
|
||||
ZYDIS_REGISTER_XMM14,
|
||||
ZYDIS_REGISTER_XMM15,
|
||||
ZYDIS_REGISTER_XMM16,
|
||||
ZYDIS_REGISTER_XMM17,
|
||||
ZYDIS_REGISTER_XMM18,
|
||||
ZYDIS_REGISTER_XMM19,
|
||||
ZYDIS_REGISTER_XMM20,
|
||||
ZYDIS_REGISTER_XMM21,
|
||||
ZYDIS_REGISTER_XMM22,
|
||||
ZYDIS_REGISTER_XMM23,
|
||||
ZYDIS_REGISTER_XMM24,
|
||||
ZYDIS_REGISTER_XMM25,
|
||||
ZYDIS_REGISTER_XMM26,
|
||||
ZYDIS_REGISTER_XMM27,
|
||||
ZYDIS_REGISTER_XMM28,
|
||||
ZYDIS_REGISTER_XMM29,
|
||||
ZYDIS_REGISTER_XMM30,
|
||||
ZYDIS_REGISTER_XMM31,
|
||||
// Floating point vector registers 256-bit
|
||||
ZYDIS_REGISTER_YMM0,
|
||||
ZYDIS_REGISTER_YMM1,
|
||||
ZYDIS_REGISTER_YMM2,
|
||||
ZYDIS_REGISTER_YMM3,
|
||||
ZYDIS_REGISTER_YMM4,
|
||||
ZYDIS_REGISTER_YMM5,
|
||||
ZYDIS_REGISTER_YMM6,
|
||||
ZYDIS_REGISTER_YMM7,
|
||||
ZYDIS_REGISTER_YMM8,
|
||||
ZYDIS_REGISTER_YMM9,
|
||||
ZYDIS_REGISTER_YMM10,
|
||||
ZYDIS_REGISTER_YMM11,
|
||||
ZYDIS_REGISTER_YMM12,
|
||||
ZYDIS_REGISTER_YMM13,
|
||||
ZYDIS_REGISTER_YMM14,
|
||||
ZYDIS_REGISTER_YMM15,
|
||||
ZYDIS_REGISTER_YMM16,
|
||||
ZYDIS_REGISTER_YMM17,
|
||||
ZYDIS_REGISTER_YMM18,
|
||||
ZYDIS_REGISTER_YMM19,
|
||||
ZYDIS_REGISTER_YMM20,
|
||||
ZYDIS_REGISTER_YMM21,
|
||||
ZYDIS_REGISTER_YMM22,
|
||||
ZYDIS_REGISTER_YMM23,
|
||||
ZYDIS_REGISTER_YMM24,
|
||||
ZYDIS_REGISTER_YMM25,
|
||||
ZYDIS_REGISTER_YMM26,
|
||||
ZYDIS_REGISTER_YMM27,
|
||||
ZYDIS_REGISTER_YMM28,
|
||||
ZYDIS_REGISTER_YMM29,
|
||||
ZYDIS_REGISTER_YMM30,
|
||||
ZYDIS_REGISTER_YMM31,
|
||||
// Floating point vector registers 512-bit
|
||||
ZYDIS_REGISTER_ZMM0,
|
||||
ZYDIS_REGISTER_ZMM1,
|
||||
ZYDIS_REGISTER_ZMM2,
|
||||
ZYDIS_REGISTER_ZMM3,
|
||||
ZYDIS_REGISTER_ZMM4,
|
||||
ZYDIS_REGISTER_ZMM5,
|
||||
ZYDIS_REGISTER_ZMM6,
|
||||
ZYDIS_REGISTER_ZMM7,
|
||||
ZYDIS_REGISTER_ZMM8,
|
||||
ZYDIS_REGISTER_ZMM9,
|
||||
ZYDIS_REGISTER_ZMM10,
|
||||
ZYDIS_REGISTER_ZMM11,
|
||||
ZYDIS_REGISTER_ZMM12,
|
||||
ZYDIS_REGISTER_ZMM13,
|
||||
ZYDIS_REGISTER_ZMM14,
|
||||
ZYDIS_REGISTER_ZMM15,
|
||||
ZYDIS_REGISTER_ZMM16,
|
||||
ZYDIS_REGISTER_ZMM17,
|
||||
ZYDIS_REGISTER_ZMM18,
|
||||
ZYDIS_REGISTER_ZMM19,
|
||||
ZYDIS_REGISTER_ZMM20,
|
||||
ZYDIS_REGISTER_ZMM21,
|
||||
ZYDIS_REGISTER_ZMM22,
|
||||
ZYDIS_REGISTER_ZMM23,
|
||||
ZYDIS_REGISTER_ZMM24,
|
||||
ZYDIS_REGISTER_ZMM25,
|
||||
ZYDIS_REGISTER_ZMM26,
|
||||
ZYDIS_REGISTER_ZMM27,
|
||||
ZYDIS_REGISTER_ZMM28,
|
||||
ZYDIS_REGISTER_ZMM29,
|
||||
ZYDIS_REGISTER_ZMM30,
|
||||
ZYDIS_REGISTER_ZMM31,
|
||||
// Flags registers
|
||||
ZYDIS_REGISTER_FLAGS,
|
||||
ZYDIS_REGISTER_EFLAGS,
|
||||
ZYDIS_REGISTER_RFLAGS,
|
||||
// Instruction-pointer registers
|
||||
ZYDIS_REGISTER_IP,
|
||||
ZYDIS_REGISTER_EIP,
|
||||
ZYDIS_REGISTER_RIP,
|
||||
// Segment registers
|
||||
ZYDIS_REGISTER_ES,
|
||||
ZYDIS_REGISTER_CS,
|
||||
ZYDIS_REGISTER_SS,
|
||||
ZYDIS_REGISTER_DS,
|
||||
ZYDIS_REGISTER_FS,
|
||||
ZYDIS_REGISTER_GS,
|
||||
// Table registers
|
||||
ZYDIS_REGISTER_GDTR,
|
||||
ZYDIS_REGISTER_LDTR,
|
||||
ZYDIS_REGISTER_IDTR,
|
||||
ZYDIS_REGISTER_TR,
|
||||
// Test registers
|
||||
ZYDIS_REGISTER_TR0,
|
||||
ZYDIS_REGISTER_TR1,
|
||||
ZYDIS_REGISTER_TR2,
|
||||
ZYDIS_REGISTER_TR3,
|
||||
ZYDIS_REGISTER_TR4,
|
||||
ZYDIS_REGISTER_TR5,
|
||||
ZYDIS_REGISTER_TR6,
|
||||
ZYDIS_REGISTER_TR7,
|
||||
// Control registers
|
||||
ZYDIS_REGISTER_CR0,
|
||||
ZYDIS_REGISTER_CR1,
|
||||
ZYDIS_REGISTER_CR2,
|
||||
ZYDIS_REGISTER_CR3,
|
||||
ZYDIS_REGISTER_CR4,
|
||||
ZYDIS_REGISTER_CR5,
|
||||
ZYDIS_REGISTER_CR6,
|
||||
ZYDIS_REGISTER_CR7,
|
||||
ZYDIS_REGISTER_CR8,
|
||||
ZYDIS_REGISTER_CR9,
|
||||
ZYDIS_REGISTER_CR10,
|
||||
ZYDIS_REGISTER_CR11,
|
||||
ZYDIS_REGISTER_CR12,
|
||||
ZYDIS_REGISTER_CR13,
|
||||
ZYDIS_REGISTER_CR14,
|
||||
ZYDIS_REGISTER_CR15,
|
||||
// Debug registers
|
||||
ZYDIS_REGISTER_DR0,
|
||||
ZYDIS_REGISTER_DR1,
|
||||
ZYDIS_REGISTER_DR2,
|
||||
ZYDIS_REGISTER_DR3,
|
||||
ZYDIS_REGISTER_DR4,
|
||||
ZYDIS_REGISTER_DR5,
|
||||
ZYDIS_REGISTER_DR6,
|
||||
ZYDIS_REGISTER_DR7,
|
||||
ZYDIS_REGISTER_DR8,
|
||||
ZYDIS_REGISTER_DR9,
|
||||
ZYDIS_REGISTER_DR10,
|
||||
ZYDIS_REGISTER_DR11,
|
||||
ZYDIS_REGISTER_DR12,
|
||||
ZYDIS_REGISTER_DR13,
|
||||
ZYDIS_REGISTER_DR14,
|
||||
ZYDIS_REGISTER_DR15,
|
||||
// Mask registers
|
||||
ZYDIS_REGISTER_K0,
|
||||
ZYDIS_REGISTER_K1,
|
||||
ZYDIS_REGISTER_K2,
|
||||
ZYDIS_REGISTER_K3,
|
||||
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,
|
||||
// Uncategorized
|
||||
ZYDIS_REGISTER_MXCSR,
|
||||
ZYDIS_REGISTER_PKRU,
|
||||
ZYDIS_REGISTER_XCR0,
|
||||
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
ZYDIS_REGISTER_MAX_VALUE = ZYDIS_REGISTER_XCR0,
|
||||
/**
|
||||
* @brief Minimum amount of bits required to store a value of this enum.
|
||||
*/
|
||||
ZYDIS_REGISTER_MIN_BITS = 0x0008
|
||||
};
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
Zyan Disassembler Library (Zydis)
|
||||
|
||||
Original Author : Joel Höner
|
||||
Original Author : Joel Hoener
|
||||
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
|
@ -189,6 +189,33 @@ enum ZydisImplicitMemBase
|
|||
/* Instruction definition */
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
* @brief Defines the `ZydisRegisterConstraint` datatype.
|
||||
*/
|
||||
typedef ZydisU8 ZydisRegisterConstraint;
|
||||
|
||||
/**
|
||||
* @brief Values that represent register-constraints.
|
||||
*/
|
||||
enum ZydisRegisterConstraints
|
||||
{
|
||||
ZYDIS_REG_CONSTRAINTS_UNUSED,
|
||||
ZYDIS_REG_CONSTRAINTS_NONE,
|
||||
ZYDIS_REG_CONSTRAINTS_GPR,
|
||||
ZYDIS_REG_CONSTRAINTS_SR_DEST,
|
||||
ZYDIS_REG_CONSTRAINTS_SR,
|
||||
ZYDIS_REG_CONSTRAINTS_CR,
|
||||
ZYDIS_REG_CONSTRAINTS_DR,
|
||||
ZYDIS_REG_CONSTRAINTS_MASK,
|
||||
ZYDIS_REG_CONSTRAINTS_BND,
|
||||
ZYDIS_REG_CONSTRAINTS_VSIB,
|
||||
|
||||
ZYDIS_REG_CONSTRAINTS_MAX_VALUE = ZYDIS_REG_CONSTRAINTS_VSIB,
|
||||
ZYDIS_REG_CONSTRAINTS_MIN_BITS = 4
|
||||
};
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
* @brief Defines the @c ZydisInternalVectorLength datatype.
|
||||
*/
|
||||
|
@ -222,7 +249,9 @@ enum ZydisInternalElementSizes
|
|||
ZYDIS_IELEMENT_SIZE_16,
|
||||
ZYDIS_IELEMENT_SIZE_32,
|
||||
ZYDIS_IELEMENT_SIZE_64,
|
||||
ZYDIS_IELEMENT_SIZE_128
|
||||
ZYDIS_IELEMENT_SIZE_128,
|
||||
|
||||
ZYDIS_IELEMENT_SIZE_MAX_VALUE = ZYDIS_IELEMENT_SIZE_128
|
||||
};
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
@ -463,7 +492,9 @@ enum ZydisVEXStaticBroadcasts
|
|||
ZYDIS_VEX_STATIC_BROADCAST_1_TO_8,
|
||||
ZYDIS_VEX_STATIC_BROADCAST_1_TO_16,
|
||||
ZYDIS_VEX_STATIC_BROADCAST_1_TO_32,
|
||||
ZYDIS_VEX_STATIC_BROADCAST_2_TO_4
|
||||
ZYDIS_VEX_STATIC_BROADCAST_2_TO_4,
|
||||
|
||||
ZYDIS_VEX_STATIC_BROADCAST_MAX_VALUE = ZYDIS_VEX_STATIC_BROADCAST_2_TO_4
|
||||
};
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
@ -490,7 +521,9 @@ enum ZydisEVEXStaticBroadcasts
|
|||
ZYDIS_EVEX_STATIC_BROADCAST_2_TO_16,
|
||||
ZYDIS_EVEX_STATIC_BROADCAST_4_TO_8,
|
||||
ZYDIS_EVEX_STATIC_BROADCAST_4_TO_16,
|
||||
ZYDIS_EVEX_STATIC_BROADCAST_8_TO_16
|
||||
ZYDIS_EVEX_STATIC_BROADCAST_8_TO_16,
|
||||
|
||||
ZYDIS_EVEX_STATIC_BROADCAST_MAX_VALUE = ZYDIS_EVEX_STATIC_BROADCAST_8_TO_16
|
||||
};
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
@ -553,30 +586,35 @@ enum ZydisMaskPolicies
|
|||
ZydisInstructionCategory category ZYDIS_BITFIELD(ZYDIS_CATEGORY_MIN_BITS); \
|
||||
ZydisISASet isaSet ZYDIS_BITFIELD(ZYDIS_ISA_SET_MIN_BITS); \
|
||||
ZydisISAExt isaExt ZYDIS_BITFIELD(ZYDIS_ISA_EXT_MIN_BITS); \
|
||||
ZydisExceptionClass exceptionClass ZYDIS_BITFIELD( 6)
|
||||
ZydisExceptionClass exceptionClass ZYDIS_BITFIELD( 6); \
|
||||
ZydisRegisterConstraint constrREG ZYDIS_BITFIELD(ZYDIS_REG_CONSTRAINTS_MIN_BITS); \
|
||||
ZydisRegisterConstraint constrRM ZYDIS_BITFIELD(ZYDIS_REG_CONSTRAINTS_MIN_BITS)
|
||||
|
||||
#define ZYDIS_INSTRUCTION_DEFINITION_BASE_VECTOR \
|
||||
ZYDIS_INSTRUCTION_DEFINITION_BASE; \
|
||||
ZydisBool hasNDSNDDOperand ZYDIS_BITFIELD( 1)
|
||||
ZydisRegisterConstraint constrNDSNDD ZYDIS_BITFIELD(ZYDIS_REG_CONSTRAINTS_MIN_BITS)
|
||||
|
||||
#define ZYDIS_INSTRUCTION_DEFINITION_BASE_VECTOR_EX \
|
||||
#define ZYDIS_INSTRUCTION_DEFINITION_BASE_VECTOR_INTEL \
|
||||
ZYDIS_INSTRUCTION_DEFINITION_BASE_VECTOR; \
|
||||
ZydisBool hasVSIB ZYDIS_BITFIELD( 1)
|
||||
ZydisBool isGather ZYDIS_BITFIELD( 1)
|
||||
|
||||
/**
|
||||
* @brief Defines the @c ZydisInstructionDefinition struct.
|
||||
* @brief Defines the `ZydisInstructionDefinition` struct.
|
||||
*/
|
||||
typedef struct ZydisInstructionDefinition_
|
||||
{
|
||||
ZYDIS_INSTRUCTION_DEFINITION_BASE;
|
||||
} ZydisInstructionDefinition;
|
||||
|
||||
/**
|
||||
* @brief Defines the `ZydisInstructionDefinitionDEFAULT` struct.
|
||||
*/
|
||||
typedef struct ZydisInstructionDefinitionDEFAULT_
|
||||
{
|
||||
ZYDIS_INSTRUCTION_DEFINITION_BASE;
|
||||
ZydisBool isPrivileged ZYDIS_BITFIELD( 1);
|
||||
ZydisBool isFarBranch ZYDIS_BITFIELD( 1);
|
||||
ZydisBool acceptsLock ZYDIS_BITFIELD( 1);
|
||||
ZydisBool acceptsLOCK ZYDIS_BITFIELD( 1);
|
||||
ZydisBool acceptsREP ZYDIS_BITFIELD( 1);
|
||||
ZydisBool acceptsREPEREPZ ZYDIS_BITFIELD( 1);
|
||||
ZydisBool acceptsREPNEREPNZ ZYDIS_BITFIELD( 1);
|
||||
|
@ -588,26 +626,38 @@ typedef struct ZydisInstructionDefinitionDEFAULT_
|
|||
ZydisBool acceptsSegment ZYDIS_BITFIELD( 1);
|
||||
} ZydisInstructionDefinitionDEFAULT;
|
||||
|
||||
/**
|
||||
* @brief Defines the `ZydisInstructionDefinition3DNOW` struct.
|
||||
*/
|
||||
typedef struct ZydisInstructionDefinition3DNOW_
|
||||
{
|
||||
ZYDIS_INSTRUCTION_DEFINITION_BASE;
|
||||
} ZydisInstructionDefinition3DNOW;
|
||||
|
||||
/**
|
||||
* @brief Defines the `ZydisInstructionDefinitionXOP` struct.
|
||||
*/
|
||||
typedef struct ZydisInstructionDefinitionXOP_
|
||||
{
|
||||
ZYDIS_INSTRUCTION_DEFINITION_BASE_VECTOR;
|
||||
} ZydisInstructionDefinitionXOP;
|
||||
|
||||
/**
|
||||
* @brief Defines the `ZydisInstructionDefinitionVEX` struct.
|
||||
*/
|
||||
typedef struct ZydisInstructionDefinitionVEX_
|
||||
{
|
||||
ZYDIS_INSTRUCTION_DEFINITION_BASE_VECTOR;
|
||||
ZYDIS_INSTRUCTION_DEFINITION_BASE_VECTOR_INTEL;
|
||||
ZydisVEXStaticBroadcast broadcast ZYDIS_BITFIELD( 3);
|
||||
} ZydisInstructionDefinitionVEX;
|
||||
|
||||
#ifndef ZYDIS_DISABLE_EVEX
|
||||
/**
|
||||
* @brief Defines the `ZydisInstructionDefinitionEVEX` struct.
|
||||
*/
|
||||
typedef struct ZydisInstructionDefinitionEVEX_
|
||||
{
|
||||
ZYDIS_INSTRUCTION_DEFINITION_BASE_VECTOR_EX;
|
||||
ZYDIS_INSTRUCTION_DEFINITION_BASE_VECTOR_INTEL;
|
||||
ZydisInternalVectorLength vectorLength ZYDIS_BITFIELD( 2);
|
||||
ZydisEVEXTupleType tupleType ZYDIS_BITFIELD( 4);
|
||||
ZydisInternalElementSize elementSize ZYDIS_BITFIELD( 3);
|
||||
|
@ -620,9 +670,12 @@ typedef struct ZydisInstructionDefinitionEVEX_
|
|||
#endif
|
||||
|
||||
#ifndef ZYDIS_DISABLE_MVEX
|
||||
/**
|
||||
* @brief Defines the `ZydisInstructionDefinitionMVEX` struct.
|
||||
*/
|
||||
typedef struct ZydisInstructionDefinitionMVEX_
|
||||
{
|
||||
ZYDIS_INSTRUCTION_DEFINITION_BASE_VECTOR_EX;
|
||||
ZYDIS_INSTRUCTION_DEFINITION_BASE_VECTOR_INTEL;
|
||||
ZydisMVEXFunctionality functionality ZYDIS_BITFIELD( 5);
|
||||
ZydisMaskPolicy maskPolicy ZYDIS_BITFIELD( 2);
|
||||
ZydisBool hasElementGranularity ZYDIS_BITFIELD( 1);
|
||||
|
|
|
@ -48,112 +48,7 @@ extern "C" {
|
|||
/* Registers */
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
* @brief Defines the @c ZydisRegister datatype.
|
||||
*/
|
||||
typedef ZydisU8 ZydisRegister;
|
||||
|
||||
/**
|
||||
* @brief Values that represent zydis registers.
|
||||
*/
|
||||
enum ZydisRegisters
|
||||
{
|
||||
ZYDIS_REGISTER_NONE,
|
||||
|
||||
// General purpose registers 8-bit
|
||||
ZYDIS_REGISTER_AL, ZYDIS_REGISTER_CL, ZYDIS_REGISTER_DL, ZYDIS_REGISTER_BL,
|
||||
ZYDIS_REGISTER_AH, ZYDIS_REGISTER_CH, ZYDIS_REGISTER_DH, ZYDIS_REGISTER_BH,
|
||||
ZYDIS_REGISTER_SPL, ZYDIS_REGISTER_BPL, ZYDIS_REGISTER_SIL, ZYDIS_REGISTER_DIL,
|
||||
ZYDIS_REGISTER_R8B, ZYDIS_REGISTER_R9B, ZYDIS_REGISTER_R10B, ZYDIS_REGISTER_R11B,
|
||||
ZYDIS_REGISTER_R12B, ZYDIS_REGISTER_R13B, ZYDIS_REGISTER_R14B, ZYDIS_REGISTER_R15B,
|
||||
// General purpose registers 16-bit
|
||||
ZYDIS_REGISTER_AX, ZYDIS_REGISTER_CX, ZYDIS_REGISTER_DX, ZYDIS_REGISTER_BX,
|
||||
ZYDIS_REGISTER_SP, ZYDIS_REGISTER_BP, ZYDIS_REGISTER_SI, ZYDIS_REGISTER_DI,
|
||||
ZYDIS_REGISTER_R8W, ZYDIS_REGISTER_R9W, ZYDIS_REGISTER_R10W, ZYDIS_REGISTER_R11W,
|
||||
ZYDIS_REGISTER_R12W, ZYDIS_REGISTER_R13W, ZYDIS_REGISTER_R14W, ZYDIS_REGISTER_R15W,
|
||||
// General purpose registers 32-bit
|
||||
ZYDIS_REGISTER_EAX, ZYDIS_REGISTER_ECX, ZYDIS_REGISTER_EDX, ZYDIS_REGISTER_EBX,
|
||||
ZYDIS_REGISTER_ESP, ZYDIS_REGISTER_EBP, ZYDIS_REGISTER_ESI, ZYDIS_REGISTER_EDI,
|
||||
ZYDIS_REGISTER_R8D, ZYDIS_REGISTER_R9D, ZYDIS_REGISTER_R10D, ZYDIS_REGISTER_R11D,
|
||||
ZYDIS_REGISTER_R12D, ZYDIS_REGISTER_R13D, ZYDIS_REGISTER_R14D, ZYDIS_REGISTER_R15D,
|
||||
// General purpose registers 64-bit
|
||||
ZYDIS_REGISTER_RAX, ZYDIS_REGISTER_RCX, ZYDIS_REGISTER_RDX, ZYDIS_REGISTER_RBX,
|
||||
ZYDIS_REGISTER_RSP, ZYDIS_REGISTER_RBP, ZYDIS_REGISTER_RSI, ZYDIS_REGISTER_RDI,
|
||||
ZYDIS_REGISTER_R8, ZYDIS_REGISTER_R9, ZYDIS_REGISTER_R10, ZYDIS_REGISTER_R11,
|
||||
ZYDIS_REGISTER_R12, ZYDIS_REGISTER_R13, ZYDIS_REGISTER_R14, ZYDIS_REGISTER_R15,
|
||||
// Floating point legacy registers
|
||||
ZYDIS_REGISTER_ST0, ZYDIS_REGISTER_ST1, ZYDIS_REGISTER_ST2, ZYDIS_REGISTER_ST3,
|
||||
ZYDIS_REGISTER_ST4, ZYDIS_REGISTER_ST5, ZYDIS_REGISTER_ST6, ZYDIS_REGISTER_ST7,
|
||||
// Floating point multimedia registers
|
||||
ZYDIS_REGISTER_MM0, ZYDIS_REGISTER_MM1, ZYDIS_REGISTER_MM2, ZYDIS_REGISTER_MM3,
|
||||
ZYDIS_REGISTER_MM4, ZYDIS_REGISTER_MM5, ZYDIS_REGISTER_MM6, ZYDIS_REGISTER_MM7,
|
||||
// Floating point vector registers 128-bit
|
||||
ZYDIS_REGISTER_XMM0, ZYDIS_REGISTER_XMM1, ZYDIS_REGISTER_XMM2, ZYDIS_REGISTER_XMM3,
|
||||
ZYDIS_REGISTER_XMM4, ZYDIS_REGISTER_XMM5, ZYDIS_REGISTER_XMM6, ZYDIS_REGISTER_XMM7,
|
||||
ZYDIS_REGISTER_XMM8, ZYDIS_REGISTER_XMM9, ZYDIS_REGISTER_XMM10, ZYDIS_REGISTER_XMM11,
|
||||
ZYDIS_REGISTER_XMM12, ZYDIS_REGISTER_XMM13, ZYDIS_REGISTER_XMM14, ZYDIS_REGISTER_XMM15,
|
||||
ZYDIS_REGISTER_XMM16, ZYDIS_REGISTER_XMM17, ZYDIS_REGISTER_XMM18, ZYDIS_REGISTER_XMM19,
|
||||
ZYDIS_REGISTER_XMM20, ZYDIS_REGISTER_XMM21, ZYDIS_REGISTER_XMM22, ZYDIS_REGISTER_XMM23,
|
||||
ZYDIS_REGISTER_XMM24, ZYDIS_REGISTER_XMM25, ZYDIS_REGISTER_XMM26, ZYDIS_REGISTER_XMM27,
|
||||
ZYDIS_REGISTER_XMM28, ZYDIS_REGISTER_XMM29, ZYDIS_REGISTER_XMM30, ZYDIS_REGISTER_XMM31,
|
||||
// Floating point vector registers 256-bit
|
||||
ZYDIS_REGISTER_YMM0, ZYDIS_REGISTER_YMM1, ZYDIS_REGISTER_YMM2, ZYDIS_REGISTER_YMM3,
|
||||
ZYDIS_REGISTER_YMM4, ZYDIS_REGISTER_YMM5, ZYDIS_REGISTER_YMM6, ZYDIS_REGISTER_YMM7,
|
||||
ZYDIS_REGISTER_YMM8, ZYDIS_REGISTER_YMM9, ZYDIS_REGISTER_YMM10, ZYDIS_REGISTER_YMM11,
|
||||
ZYDIS_REGISTER_YMM12, ZYDIS_REGISTER_YMM13, ZYDIS_REGISTER_YMM14, ZYDIS_REGISTER_YMM15,
|
||||
ZYDIS_REGISTER_YMM16, ZYDIS_REGISTER_YMM17, ZYDIS_REGISTER_YMM18, ZYDIS_REGISTER_YMM19,
|
||||
ZYDIS_REGISTER_YMM20, ZYDIS_REGISTER_YMM21, ZYDIS_REGISTER_YMM22, ZYDIS_REGISTER_YMM23,
|
||||
ZYDIS_REGISTER_YMM24, ZYDIS_REGISTER_YMM25, ZYDIS_REGISTER_YMM26, ZYDIS_REGISTER_YMM27,
|
||||
ZYDIS_REGISTER_YMM28, ZYDIS_REGISTER_YMM29, ZYDIS_REGISTER_YMM30, ZYDIS_REGISTER_YMM31,
|
||||
// Floating point vector registers 512-bit
|
||||
ZYDIS_REGISTER_ZMM0, ZYDIS_REGISTER_ZMM1, ZYDIS_REGISTER_ZMM2, ZYDIS_REGISTER_ZMM3,
|
||||
ZYDIS_REGISTER_ZMM4, ZYDIS_REGISTER_ZMM5, ZYDIS_REGISTER_ZMM6, ZYDIS_REGISTER_ZMM7,
|
||||
ZYDIS_REGISTER_ZMM8, ZYDIS_REGISTER_ZMM9, ZYDIS_REGISTER_ZMM10, ZYDIS_REGISTER_ZMM11,
|
||||
ZYDIS_REGISTER_ZMM12, ZYDIS_REGISTER_ZMM13, ZYDIS_REGISTER_ZMM14, ZYDIS_REGISTER_ZMM15,
|
||||
ZYDIS_REGISTER_ZMM16, ZYDIS_REGISTER_ZMM17, ZYDIS_REGISTER_ZMM18, ZYDIS_REGISTER_ZMM19,
|
||||
ZYDIS_REGISTER_ZMM20, ZYDIS_REGISTER_ZMM21, ZYDIS_REGISTER_ZMM22, ZYDIS_REGISTER_ZMM23,
|
||||
ZYDIS_REGISTER_ZMM24, ZYDIS_REGISTER_ZMM25, ZYDIS_REGISTER_ZMM26, ZYDIS_REGISTER_ZMM27,
|
||||
ZYDIS_REGISTER_ZMM28, ZYDIS_REGISTER_ZMM29, ZYDIS_REGISTER_ZMM30, ZYDIS_REGISTER_ZMM31,
|
||||
// Flags registers
|
||||
ZYDIS_REGISTER_FLAGS, ZYDIS_REGISTER_EFLAGS, ZYDIS_REGISTER_RFLAGS,
|
||||
// IP registers
|
||||
ZYDIS_REGISTER_IP, ZYDIS_REGISTER_EIP, ZYDIS_REGISTER_RIP,
|
||||
// Segment registers
|
||||
ZYDIS_REGISTER_ES, ZYDIS_REGISTER_CS, ZYDIS_REGISTER_SS, ZYDIS_REGISTER_DS,
|
||||
ZYDIS_REGISTER_FS, ZYDIS_REGISTER_GS,
|
||||
// Table registers
|
||||
ZYDIS_REGISTER_GDTR, ZYDIS_REGISTER_LDTR, ZYDIS_REGISTER_IDTR, ZYDIS_REGISTER_TR,
|
||||
// Test registers
|
||||
ZYDIS_REGISTER_TR0, ZYDIS_REGISTER_TR1, ZYDIS_REGISTER_TR2, ZYDIS_REGISTER_TR3,
|
||||
ZYDIS_REGISTER_TR4, ZYDIS_REGISTER_TR5, ZYDIS_REGISTER_TR6, ZYDIS_REGISTER_TR7,
|
||||
// Control registers
|
||||
ZYDIS_REGISTER_CR0, ZYDIS_REGISTER_CR1, ZYDIS_REGISTER_CR2, ZYDIS_REGISTER_CR3,
|
||||
ZYDIS_REGISTER_CR4, ZYDIS_REGISTER_CR5, ZYDIS_REGISTER_CR6, ZYDIS_REGISTER_CR7,
|
||||
ZYDIS_REGISTER_CR8, ZYDIS_REGISTER_CR9, ZYDIS_REGISTER_CR10, ZYDIS_REGISTER_CR11,
|
||||
ZYDIS_REGISTER_CR12, ZYDIS_REGISTER_CR13, ZYDIS_REGISTER_CR14, ZYDIS_REGISTER_CR15,
|
||||
// Debug registers
|
||||
ZYDIS_REGISTER_DR0, ZYDIS_REGISTER_DR1, ZYDIS_REGISTER_DR2, ZYDIS_REGISTER_DR3,
|
||||
ZYDIS_REGISTER_DR4, ZYDIS_REGISTER_DR5, ZYDIS_REGISTER_DR6, ZYDIS_REGISTER_DR7,
|
||||
ZYDIS_REGISTER_DR8, ZYDIS_REGISTER_DR9, ZYDIS_REGISTER_DR10, ZYDIS_REGISTER_DR11,
|
||||
ZYDIS_REGISTER_DR12, ZYDIS_REGISTER_DR13, ZYDIS_REGISTER_DR14, ZYDIS_REGISTER_DR15,
|
||||
// Mask registers
|
||||
ZYDIS_REGISTER_K0, ZYDIS_REGISTER_K1, ZYDIS_REGISTER_K2, ZYDIS_REGISTER_K3,
|
||||
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,
|
||||
// Misc registers
|
||||
ZYDIS_REGISTER_MXCSR, ZYDIS_REGISTER_PKRU, ZYDIS_REGISTER_XCR0,
|
||||
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
ZYDIS_REGISTER_MAX_VALUE = ZYDIS_REGISTER_XCR0,
|
||||
/**
|
||||
* @brief Minimum amount of bits required to store a value of this enum.
|
||||
*/
|
||||
ZYDIS_REGISTER_MIN_BITS = 0x0008
|
||||
};
|
||||
#include <Zydis/Generated/EnumRegister.h>
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
/* Register classes */
|
||||
|
@ -238,6 +133,7 @@ enum ZydisRegisterClasses
|
|||
* @brief Bound registers.
|
||||
*/
|
||||
ZYDIS_REGCLASS_BOUND,
|
||||
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
|
|
|
@ -94,6 +94,7 @@ enum ZydisMachineModes
|
|||
* @brief 16 bit real mode.
|
||||
*/
|
||||
ZYDIS_MACHINE_MODE_REAL_16,
|
||||
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
|
@ -114,10 +115,14 @@ typedef ZydisU8 ZydisAddressWidth;
|
|||
*/
|
||||
enum ZydisAddressWidths
|
||||
{
|
||||
ZYDIS_ADDRESS_WIDTH_INVALID = 0,
|
||||
ZYDIS_ADDRESS_WIDTH_INVALID = 0, // TODO: Don't manually initialize values
|
||||
ZYDIS_ADDRESS_WIDTH_16 = 16,
|
||||
ZYDIS_ADDRESS_WIDTH_32 = 32,
|
||||
ZYDIS_ADDRESS_WIDTH_64 = 64,
|
||||
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
ZYDIS_ADDRESS_WIDTH_MAX_VALUE = ZYDIS_ADDRESS_WIDTH_64
|
||||
};
|
||||
|
||||
|
@ -144,6 +149,10 @@ enum ZydisElementTypes
|
|||
ZYDIS_ELEMENT_TYPE_FLOAT64,
|
||||
ZYDIS_ELEMENT_TYPE_FLOAT80,
|
||||
ZYDIS_ELEMENT_TYPE_LONGBCD,
|
||||
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
ZYDIS_ELEMENT_TYPE_MAX_VALUE = ZYDIS_ELEMENT_TYPE_LONGBCD
|
||||
};
|
||||
|
||||
|
@ -186,6 +195,7 @@ enum ZydisOperandTypes
|
|||
* @brief The operand is an immediate operand.
|
||||
*/
|
||||
ZYDIS_OPERAND_TYPE_IMMEDIATE,
|
||||
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
|
@ -241,6 +251,10 @@ enum ZydisOperandEncodings
|
|||
ZYDIS_OPERAND_ENCODING_JIMM16_32_64,
|
||||
ZYDIS_OPERAND_ENCODING_JIMM32_32_64,
|
||||
ZYDIS_OPERAND_ENCODING_JIMM16_32_32,
|
||||
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
ZYDIS_OPERAND_ENCODING_MAX_VALUE = ZYDIS_OPERAND_ENCODING_JIMM16_32_32
|
||||
};
|
||||
|
||||
|
@ -271,6 +285,7 @@ enum ZydisOperandVisibilities
|
|||
* @brief The operand is part of the opcode, and not typically listed as an operand.
|
||||
*/
|
||||
ZYDIS_OPERAND_VISIBILITY_HIDDEN,
|
||||
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
|
@ -379,6 +394,7 @@ enum ZydisInstructionEncodings
|
|||
* @brief The instruction uses the MVEX-encoding.
|
||||
*/
|
||||
ZYDIS_INSTRUCTION_ENCODING_MVEX,
|
||||
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
|
@ -407,7 +423,11 @@ enum ZydisOpcodeMaps
|
|||
ZYDIS_OPCODE_MAP_XOP8,
|
||||
ZYDIS_OPCODE_MAP_XOP9,
|
||||
ZYDIS_OPCODE_MAP_XOPA,
|
||||
ZYDIS_OPCODE_MAP_MAX_VALUE = ZYDIS_OPCODE_MAP_XOP9
|
||||
|
||||
/**
|
||||
* @brief Maximum value of this enum.
|
||||
*/
|
||||
ZYDIS_OPCODE_MAP_MAX_VALUE = ZYDIS_OPCODE_MAP_XOPA
|
||||
};
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
|
|
@ -126,6 +126,16 @@ enum ZydisStatusCodes
|
|||
*/
|
||||
ZYDIS_STATUS_INVALID_MASK,
|
||||
|
||||
/* ------------------------------------------------------------------------------------------ */
|
||||
/* Formatter */
|
||||
/* ------------------------------------------------------------------------------------------ */
|
||||
|
||||
/**
|
||||
* @brief Returning this status code in operand-related custom formatter callbacks will cause
|
||||
* the formatter to omit the operand.
|
||||
*/
|
||||
ZYDIS_STATUS_SKIP_OPERAND,
|
||||
|
||||
/* ------------------------------------------------------------------------------------------ */
|
||||
/* Encoder */
|
||||
/* ------------------------------------------------------------------------------------------ */
|
||||
|
@ -141,8 +151,8 @@ enum ZydisStatusCodes
|
|||
*/
|
||||
ZYDIS_STATUS_USER = 0x10000000
|
||||
|
||||
// Max value entry intentionally omitted since users might
|
||||
// define custom error codes for formatter hooks.
|
||||
// Max value entry intentionally omitted since users might define custom error codes for
|
||||
// formatter hooks.
|
||||
};
|
||||
|
||||
/* ============================================================================================== */
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
Zyan Disassembler Library (Zydis)
|
||||
|
||||
Original Author : Florian Bernd, Joel Höner
|
||||
Original Author : Florian Bernd, Joel Hoener
|
||||
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -156,24 +156,11 @@ enum ZydisLetterCases
|
|||
* @brief Initializes a `ZydisString` struct with a C-string.
|
||||
*
|
||||
* @param string The string to initialize.
|
||||
* @param value The C-string constant.
|
||||
* @param text The C-string constant.
|
||||
*
|
||||
* @return A zydis status code.
|
||||
*/
|
||||
ZYDIS_NO_EXPORT ZYDIS_INLINE ZydisStatus ZydisStringInit(ZydisString* string, char* value)
|
||||
{
|
||||
if (!string || !value)
|
||||
{
|
||||
return ZYDIS_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
const ZydisUSize length = ZydisStrLen(value);
|
||||
string->buffer = value;
|
||||
string->length = length;
|
||||
string->capacity = length;
|
||||
|
||||
return ZYDIS_STATUS_SUCCESS;
|
||||
}
|
||||
ZYDIS_EXPORT ZydisStatus ZydisStringInit(ZydisString* string, char* text);
|
||||
|
||||
/**
|
||||
* @brief Finalizes a `ZydisString` struct by adding a terminating zero byte.
|
||||
|
@ -182,23 +169,22 @@ ZYDIS_NO_EXPORT ZYDIS_INLINE ZydisStatus ZydisStringInit(ZydisString* string, ch
|
|||
*
|
||||
* @return A zydis status code.
|
||||
*/
|
||||
ZYDIS_NO_EXPORT ZYDIS_INLINE ZydisStatus ZydisStringFinalize(ZydisString* string)
|
||||
{
|
||||
if (!string)
|
||||
{
|
||||
return ZYDIS_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
if (string->length >= string->capacity)
|
||||
{
|
||||
return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE;
|
||||
}
|
||||
|
||||
string->buffer[string->length] = 0;
|
||||
return ZYDIS_STATUS_SUCCESS;
|
||||
}
|
||||
ZYDIS_EXPORT ZydisStatus ZydisStringFinalize(ZydisString* string);
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
* @brief Appends a `ZydisString` to another `ZydisString`.
|
||||
*
|
||||
* @param string The string to append to.
|
||||
* @param text The string to append.
|
||||
*
|
||||
* @return @c ZYDIS_STATUS_SUCCESS, if the function succeeded, or
|
||||
* @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not
|
||||
* sufficient to append the given @c text.
|
||||
*/
|
||||
ZYDIS_EXPORT ZydisStatus ZydisStringAppend(ZydisString* string, const ZydisString* text);
|
||||
|
||||
/**
|
||||
* @brief Appends a `ZydisString` to another `ZydisString`, converting it to the specified
|
||||
* letter-case.
|
||||
|
@ -211,9 +197,21 @@ ZYDIS_NO_EXPORT ZYDIS_INLINE ZydisStatus ZydisStringFinalize(ZydisString* string
|
|||
* @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not
|
||||
* sufficient to append the given @c text.
|
||||
*/
|
||||
ZYDIS_NO_EXPORT ZydisStatus ZydisStringAppendEx(ZydisString* string, const ZydisString* text,
|
||||
ZYDIS_EXPORT ZydisStatus ZydisStringAppendEx(ZydisString* string, const ZydisString* text,
|
||||
ZydisLetterCase letterCase);
|
||||
|
||||
/**
|
||||
* @brief Appends the given C-string to a `ZydisString`.
|
||||
*
|
||||
* @param string The string to append to.
|
||||
* @param text The C-string to append.
|
||||
*
|
||||
* @return @c ZYDIS_STATUS_SUCCESS, if the function succeeded, or
|
||||
* @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not
|
||||
* sufficient to append the given @c text.
|
||||
*/
|
||||
ZYDIS_EXPORT ZydisStatus ZydisStringAppendC(ZydisString* string, const char* text);
|
||||
|
||||
/**
|
||||
* @brief Appends the given C-string to a `ZydisString`, converting it to the specified
|
||||
* letter-case.
|
||||
|
@ -226,14 +224,21 @@ ZYDIS_NO_EXPORT ZydisStatus ZydisStringAppendEx(ZydisString* string, const Zydis
|
|||
* @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not
|
||||
* sufficient to append the given @c text.
|
||||
*/
|
||||
ZYDIS_NO_EXPORT ZYDIS_INLINE ZydisStatus ZydisStringAppendExC(ZydisString* string,
|
||||
const char* text, ZydisLetterCase letterCase)
|
||||
{
|
||||
ZydisString other;
|
||||
ZYDIS_CHECK(ZydisStringInit(&other, (char*)text));
|
||||
ZYDIS_EXPORT ZydisStatus ZydisStringAppendExC(ZydisString* string, const char* text,
|
||||
ZydisLetterCase letterCase);
|
||||
|
||||
return ZydisStringAppendEx(string, &other, letterCase);
|
||||
}
|
||||
/**
|
||||
* @brief Appends the given 'ZydisStaticString' to a `ZydisString`.
|
||||
*
|
||||
* @param string The string to append to.
|
||||
* @param text The static-string to append.
|
||||
*
|
||||
* @return @c ZYDIS_STATUS_SUCCESS, if the function succeeded, or
|
||||
* @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not
|
||||
* sufficient to append the given @c text.
|
||||
*/
|
||||
ZYDIS_EXPORT ZydisStatus ZydisStringAppendStatic(ZydisString* string,
|
||||
const ZydisStaticString* text, ZydisLetterCase letterCase);
|
||||
|
||||
/**
|
||||
* @brief Appends the given 'ZydisStaticString' to a `ZydisString`, converting it to the
|
||||
|
@ -247,79 +252,8 @@ ZYDIS_NO_EXPORT ZYDIS_INLINE ZydisStatus ZydisStringAppendExC(ZydisString* strin
|
|||
* @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not
|
||||
* sufficient to append the given @c text.
|
||||
*/
|
||||
ZYDIS_NO_EXPORT ZYDIS_INLINE ZydisStatus ZydisStringAppendExStatic(ZydisString* string,
|
||||
const ZydisStaticString* text, ZydisLetterCase letterCase)
|
||||
{
|
||||
if (!text || !text->buffer)
|
||||
{
|
||||
return ZYDIS_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
ZydisString other;
|
||||
other.buffer = (char*)text->buffer;
|
||||
other.length = text->length;
|
||||
|
||||
return ZydisStringAppendEx(string, &other, letterCase);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Appends a `ZydisString` to another `ZydisString`.
|
||||
*
|
||||
* @param string The string to append to.
|
||||
* @param text The string to append.
|
||||
*
|
||||
* @return @c ZYDIS_STATUS_SUCCESS, if the function succeeded, or
|
||||
* @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not
|
||||
* sufficient to append the given @c text.
|
||||
*/
|
||||
ZYDIS_NO_EXPORT ZYDIS_INLINE ZydisStatus ZydisStringAppend(ZydisString* string,
|
||||
const ZydisString* text)
|
||||
{
|
||||
return ZydisStringAppendEx(string, text, ZYDIS_LETTER_CASE_DEFAULT);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Appends the given C-string to a `ZydisString`.
|
||||
*
|
||||
* @param string The string to append to.
|
||||
* @param text The C-string to append.
|
||||
*
|
||||
* @return @c ZYDIS_STATUS_SUCCESS, if the function succeeded, or
|
||||
* @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not
|
||||
* sufficient to append the given @c text.
|
||||
*/
|
||||
ZYDIS_NO_EXPORT ZYDIS_INLINE ZydisStatus ZydisStringAppendC(ZydisString* string, const char* text)
|
||||
{
|
||||
ZydisString other;
|
||||
ZYDIS_CHECK(ZydisStringInit(&other, (char*)text));
|
||||
|
||||
return ZydisStringAppendEx(string, &other, ZYDIS_LETTER_CASE_DEFAULT);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Appends the given 'ZydisStaticString' to a `ZydisString`.
|
||||
*
|
||||
* @param string The string to append to.
|
||||
* @param text The static-string to append.
|
||||
*
|
||||
* @return @c ZYDIS_STATUS_SUCCESS, if the function succeeded, or
|
||||
* @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not
|
||||
* sufficient to append the given @c text.
|
||||
*/
|
||||
ZYDIS_NO_EXPORT ZYDIS_INLINE ZydisStatus ZydisStringAppendStatic(ZydisString* string,
|
||||
const ZydisStaticString* text, ZydisLetterCase letterCase)
|
||||
{
|
||||
if (!text || !text->buffer)
|
||||
{
|
||||
return ZYDIS_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
ZydisString other;
|
||||
other.buffer = (char*)text->buffer;
|
||||
other.length = text->length;
|
||||
|
||||
return ZydisStringAppendEx(string, &other, letterCase);
|
||||
}
|
||||
ZYDIS_EXPORT ZydisStatus ZydisStringAppendExStatic(ZydisString* string,
|
||||
const ZydisStaticString* text, ZydisLetterCase letterCase);
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
/* Formatting */
|
||||
|
@ -327,7 +261,7 @@ ZYDIS_NO_EXPORT ZYDIS_INLINE ZydisStatus ZydisStringAppendStatic(ZydisString* st
|
|||
|
||||
/**
|
||||
* @brief Formats the given unsigned ordinal @c value to its decimal text-representation and
|
||||
* appends it to @c s.
|
||||
* appends it to the @c string.
|
||||
*
|
||||
* @param string A pointer to the string.
|
||||
* @param value The value.
|
||||
|
@ -341,12 +275,12 @@ ZYDIS_NO_EXPORT ZYDIS_INLINE ZydisStatus ZydisStringAppendStatic(ZydisString* st
|
|||
* The string-buffer pointer is increased by the number of chars written, if the call was
|
||||
* successfull.
|
||||
*/
|
||||
ZYDIS_NO_EXPORT ZydisStatus ZydisPrintDecU(ZydisString* string, ZydisU64 value,
|
||||
ZYDIS_EXPORT ZydisStatus ZydisStringAppendDecU(ZydisString* string, ZydisU64 value,
|
||||
ZydisU8 paddingLength);
|
||||
|
||||
/**
|
||||
* @brief Formats the given signed ordinal @c value to its decimal text-representation and
|
||||
* appends it to @c s.
|
||||
* appends it to the @c string.
|
||||
*
|
||||
* @param string A pointer to the string.
|
||||
* @param value The value.
|
||||
|
@ -360,12 +294,12 @@ ZYDIS_NO_EXPORT ZydisStatus ZydisPrintDecU(ZydisString* string, ZydisU64 value,
|
|||
* The string-buffer pointer is increased by the number of chars written, if the call was
|
||||
* successfull.
|
||||
*/
|
||||
ZYDIS_NO_EXPORT ZydisStatus ZydisPrintDecS(ZydisString* string, ZydisI64 value,
|
||||
ZYDIS_EXPORT ZydisStatus ZydisStringAppendDecS(ZydisString* string, ZydisI64 value,
|
||||
ZydisU8 paddingLength);
|
||||
|
||||
/**
|
||||
* @brief Formats the given unsigned ordinal @c value to its hexadecimal text-representation and
|
||||
* appends it to the @c buffer.
|
||||
* appends it to the @c string.
|
||||
*
|
||||
* @param string A pointer to the string.
|
||||
* @param value The value.
|
||||
|
@ -383,13 +317,13 @@ ZYDIS_NO_EXPORT ZydisStatus ZydisPrintDecS(ZydisString* string, ZydisI64 value,
|
|||
* The string-buffer pointer is increased by the number of chars written, if the call was
|
||||
* successfull.
|
||||
*/
|
||||
ZYDIS_NO_EXPORT ZydisStatus ZydisPrintHexU(ZydisString* string, ZydisU64 value,
|
||||
ZYDIS_EXPORT ZydisStatus ZydisStringAppendHexU(ZydisString* string, ZydisU64 value,
|
||||
ZydisU8 paddingLength, ZydisBool uppercase, const ZydisString* prefix,
|
||||
const ZydisString* suffix);
|
||||
|
||||
/**
|
||||
* @brief Formats the given signed ordinal @c value to its hexadecimal text-representation and
|
||||
* appends it to the @c buffer.
|
||||
* appends it to the @c string.
|
||||
*
|
||||
* @param string A pointer to the string.
|
||||
* @param value The value.
|
||||
|
@ -407,7 +341,7 @@ ZYDIS_NO_EXPORT ZydisStatus ZydisPrintHexU(ZydisString* string, ZydisU64 value,
|
|||
* The string-buffer pointer is increased by the number of chars written, if the call was
|
||||
* successfull.
|
||||
*/
|
||||
ZYDIS_NO_EXPORT ZydisStatus ZydisPrintHexS(ZydisString* string, ZydisI64 value,
|
||||
ZYDIS_EXPORT ZydisStatus ZydisStringAppendHexS(ZydisString* string, ZydisI64 value,
|
||||
ZydisU8 paddingLength, ZydisBool uppercase, const ZydisString* prefix,
|
||||
const ZydisString* suffix);
|
||||
|
||||
|
|
|
@ -33,10 +33,14 @@
|
|||
#define ZYDIS_H
|
||||
|
||||
#include <Zydis/CommonTypes.h>
|
||||
#ifndef ZYDIS_DISABLE_DECODER
|
||||
#include <Zydis/Decoder.h>
|
||||
#include <Zydis/DecoderTypes.h>
|
||||
#endif
|
||||
#include <Zydis/Defines.h>
|
||||
#ifndef ZYDIS_DISABLE_FORMATTER
|
||||
#include <Zydis/Formatter.h>
|
||||
#endif
|
||||
#include <Zydis/MetaInfo.h>
|
||||
#include <Zydis/Mnemonic.h>
|
||||
#include <Zydis/Register.h>
|
||||
|
|
661
src/Decoder.c
661
src/Decoder.c
|
@ -139,7 +139,7 @@ typedef struct ZydisDecoderContext_
|
|||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
* @brief Defines the @c ZydisRegisterEncoding struct.
|
||||
* @brief Defines the @c ZydisRegisterEncoding datatype.
|
||||
*/
|
||||
typedef ZydisU8 ZydisRegisterEncoding;
|
||||
|
||||
|
@ -1337,31 +1337,14 @@ static ZydisStatus ZydisDecodeOperandRegister(ZydisDecodedInstruction* instructi
|
|||
{
|
||||
operand->reg.value = ZYDIS_REGISTER_AL + registerId;
|
||||
}
|
||||
if (operand->reg.value > ZYDIS_REGISTER_R15B)
|
||||
{
|
||||
return ZYDIS_STATUS_BAD_REGISTER;
|
||||
}
|
||||
} else
|
||||
{
|
||||
operand->reg.value = ZydisRegisterEncode(registerClass, registerId);
|
||||
if (!operand->reg.value)
|
||||
ZYDIS_ASSERT(operand->reg.value);
|
||||
/*if (!operand->reg.value)
|
||||
{
|
||||
return ZYDIS_STATUS_BAD_REGISTER;
|
||||
}
|
||||
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.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;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
return ZYDIS_STATUS_SUCCESS;
|
||||
|
@ -1649,6 +1632,7 @@ static void ZydisDecodeOperandImplicitMemory(ZydisDecoderContext* context,
|
|||
};
|
||||
|
||||
operand->type = ZYDIS_OPERAND_TYPE_MEMORY;
|
||||
operand->mem.type = ZYDIS_MEMOP_TYPE_MEM;
|
||||
|
||||
switch (definition->op.mem.base)
|
||||
{
|
||||
|
@ -2011,7 +1995,7 @@ FinalizeOperand:
|
|||
|
||||
#if !defined(ZYDIS_DISABLE_EVEX) || !defined(ZYDIS_DISABLE_MVEX)
|
||||
// Fix operand-action for EVEX instructions with merge-mask
|
||||
if (((instruction->encoding == ZYDIS_INSTRUCTION_ENCODING_EVEX) ||
|
||||
/*if (((instruction->encoding == ZYDIS_INSTRUCTION_ENCODING_EVEX) ||
|
||||
(instruction->encoding == ZYDIS_INSTRUCTION_ENCODING_MVEX)) &&
|
||||
(instruction->avx.mask.mode == ZYDIS_MASK_MODE_MERGE) &&
|
||||
(instruction->operandCount >= 3) &&
|
||||
|
@ -2044,6 +2028,28 @@ FinalizeOperand:
|
|||
default:
|
||||
break;
|
||||
}
|
||||
}*/
|
||||
if (instruction->avx.mask.reg && (instruction->avx.mask.mode == ZYDIS_MASK_MODE_MERGE) &&
|
||||
!instruction->avx.mask.isControlMask)
|
||||
{
|
||||
ZYDIS_ASSERT(instruction->operandCount >= 2);
|
||||
switch (instruction->operands[0].action)
|
||||
{
|
||||
case ZYDIS_OPERAND_ACTION_WRITE:
|
||||
if (instruction->operands[0].type == ZYDIS_OPERAND_TYPE_MEMORY)
|
||||
{
|
||||
instruction->operands[0].action = ZYDIS_OPERAND_ACTION_CONDWRITE;
|
||||
} else
|
||||
{
|
||||
instruction->operands[0].action = ZYDIS_OPERAND_ACTION_READ_CONDWRITE;
|
||||
}
|
||||
break;
|
||||
case ZYDIS_OPERAND_ACTION_READWRITE:
|
||||
instruction->operands[0].action = ZYDIS_OPERAND_ACTION_READ_CONDWRITE;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -2083,7 +2089,7 @@ static void ZydisSetAttributes(ZydisDecoderContext* context, ZydisDecodedInstruc
|
|||
(instruction->meta.category == ZYDIS_CATEGORY_RET));
|
||||
instruction->attributes |= ZYDIS_ATTRIB_IS_FAR_BRANCH;
|
||||
}
|
||||
if (def->acceptsLock)
|
||||
if (def->acceptsLOCK)
|
||||
{
|
||||
instruction->attributes |= ZYDIS_ATTRIB_ACCEPTS_LOCK;
|
||||
if (instruction->raw.prefixes.hasF0)
|
||||
|
@ -2341,29 +2347,17 @@ static void ZydisSetAVXInformation(ZydisDecoderContext* context,
|
|||
if (def->broadcast)
|
||||
{
|
||||
instruction->avx.broadcast.isStatic = ZYDIS_TRUE;
|
||||
switch (def->broadcast)
|
||||
static ZydisBroadcastMode broadcasts[ZYDIS_VEX_STATIC_BROADCAST_MAX_VALUE + 1] =
|
||||
{
|
||||
case ZYDIS_VEX_STATIC_BROADCAST_1_TO_2:
|
||||
instruction->avx.broadcast.mode = ZYDIS_BROADCAST_MODE_1_TO_2;
|
||||
break;
|
||||
case ZYDIS_VEX_STATIC_BROADCAST_1_TO_4:
|
||||
instruction->avx.broadcast.mode = ZYDIS_BROADCAST_MODE_1_TO_4;
|
||||
break;
|
||||
case ZYDIS_VEX_STATIC_BROADCAST_1_TO_8:
|
||||
instruction->avx.broadcast.mode = ZYDIS_BROADCAST_MODE_1_TO_8;
|
||||
break;
|
||||
case ZYDIS_VEX_STATIC_BROADCAST_1_TO_16:
|
||||
instruction->avx.broadcast.mode = ZYDIS_BROADCAST_MODE_1_TO_16;
|
||||
break;
|
||||
case ZYDIS_VEX_STATIC_BROADCAST_1_TO_32:
|
||||
instruction->avx.broadcast.mode = ZYDIS_BROADCAST_MODE_1_TO_32;
|
||||
break;
|
||||
case ZYDIS_VEX_STATIC_BROADCAST_2_TO_4:
|
||||
instruction->avx.broadcast.mode = ZYDIS_BROADCAST_MODE_2_TO_4;
|
||||
break;
|
||||
default:
|
||||
ZYDIS_UNREACHABLE;
|
||||
}
|
||||
ZYDIS_BROADCAST_MODE_INVALID,
|
||||
ZYDIS_BROADCAST_MODE_1_TO_2,
|
||||
ZYDIS_BROADCAST_MODE_1_TO_4,
|
||||
ZYDIS_BROADCAST_MODE_1_TO_8,
|
||||
ZYDIS_BROADCAST_MODE_1_TO_16,
|
||||
ZYDIS_BROADCAST_MODE_1_TO_32,
|
||||
ZYDIS_BROADCAST_MODE_2_TO_4
|
||||
};
|
||||
instruction->avx.broadcast.mode = broadcasts[def->broadcast];
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -2395,154 +2389,109 @@ static void ZydisSetAVXInformation(ZydisDecoderContext* context,
|
|||
ZYDIS_ASSERT(def->elementSize);
|
||||
|
||||
// Element size
|
||||
switch (def->elementSize)
|
||||
static const ZydisU8 elementSizes[ZYDIS_IELEMENT_SIZE_MAX_VALUE + 1] =
|
||||
{
|
||||
case ZYDIS_IELEMENT_SIZE_8:
|
||||
context->evex.elementSize = 8;
|
||||
break;
|
||||
case ZYDIS_IELEMENT_SIZE_16:
|
||||
context->evex.elementSize = 16;
|
||||
break;
|
||||
case ZYDIS_IELEMENT_SIZE_32:
|
||||
context->evex.elementSize = 32;
|
||||
break;
|
||||
case ZYDIS_IELEMENT_SIZE_64:
|
||||
context->evex.elementSize = 64;
|
||||
break;
|
||||
case ZYDIS_IELEMENT_SIZE_128:
|
||||
context->evex.elementSize = 128;
|
||||
break;
|
||||
default:
|
||||
ZYDIS_UNREACHABLE;
|
||||
}
|
||||
0, 8, 16, 32, 64, 128
|
||||
};
|
||||
ZYDIS_ASSERT(def->elementSize < ZYDIS_ARRAY_SIZE(elementSizes));
|
||||
context->evex.elementSize = elementSizes[def->elementSize];
|
||||
|
||||
// Compressed disp8 scale and broadcast-factor
|
||||
switch (def->tupleType)
|
||||
{
|
||||
case ZYDIS_TUPLETYPE_FV:
|
||||
switch (instruction->raw.evex.b)
|
||||
{
|
||||
case 0:
|
||||
switch (instruction->avx.vectorLength)
|
||||
const ZydisU8 evex_b = instruction->raw.evex.b;
|
||||
const ZydisU8 evex_w = context->cache.W;
|
||||
ZYDIS_ASSERT(evex_b < 2);
|
||||
ZYDIS_ASSERT(evex_w < 2);
|
||||
ZYDIS_ASSERT(!evex_b || ((!evex_w && context->evex.elementSize == 32) ||
|
||||
( evex_w && context->evex.elementSize == 64)));
|
||||
ZYDIS_ASSERT(!evex_b || def->functionality == ZYDIS_EVEX_FUNC_BC);
|
||||
|
||||
static const ZydisU8 scales[2][2][3] =
|
||||
{
|
||||
case 128:
|
||||
context->cd8scale = 16;
|
||||
break;
|
||||
case 256:
|
||||
context->cd8scale = 32;
|
||||
break;
|
||||
case 512:
|
||||
context->cd8scale = 64;
|
||||
break;
|
||||
default:
|
||||
ZYDIS_UNREACHABLE;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
ZYDIS_ASSERT(def->functionality == ZYDIS_EVEX_FUNC_BC);
|
||||
switch (context->cache.W)
|
||||
/*B0*/ { /*W0*/ { 16, 32, 64 }, /*W1*/ { 16, 32, 64 } },
|
||||
/*B1*/ { /*W0*/ { 4, 4, 4 }, /*W1*/ { 8, 8, 8 } }
|
||||
};
|
||||
static const ZydisBroadcastMode broadcasts[2][2][3] =
|
||||
{
|
||||
case 0:
|
||||
ZYDIS_ASSERT(context->evex.elementSize == 32);
|
||||
context->cd8scale = 4;
|
||||
switch (instruction->avx.vectorLength)
|
||||
/*B0*/
|
||||
{
|
||||
case 128:
|
||||
instruction->avx.broadcast.mode = ZYDIS_BROADCAST_MODE_1_TO_4;
|
||||
break;
|
||||
case 256:
|
||||
instruction->avx.broadcast.mode = ZYDIS_BROADCAST_MODE_1_TO_8;
|
||||
break;
|
||||
case 512:
|
||||
instruction->avx.broadcast.mode = ZYDIS_BROADCAST_MODE_1_TO_16;
|
||||
break;
|
||||
default:
|
||||
ZYDIS_UNREACHABLE;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
ZYDIS_ASSERT(context->evex.elementSize == 64);
|
||||
context->cd8scale = 8;
|
||||
switch (instruction->avx.vectorLength)
|
||||
/*W0*/
|
||||
{
|
||||
case 128:
|
||||
instruction->avx.broadcast.mode = ZYDIS_BROADCAST_MODE_1_TO_2;
|
||||
break;
|
||||
case 256:
|
||||
instruction->avx.broadcast.mode = ZYDIS_BROADCAST_MODE_1_TO_4;
|
||||
break;
|
||||
case 512:
|
||||
instruction->avx.broadcast.mode = ZYDIS_BROADCAST_MODE_1_TO_8;
|
||||
break;
|
||||
default:
|
||||
ZYDIS_UNREACHABLE;
|
||||
ZYDIS_BROADCAST_MODE_INVALID,
|
||||
ZYDIS_BROADCAST_MODE_INVALID,
|
||||
ZYDIS_BROADCAST_MODE_INVALID
|
||||
},
|
||||
/*W1*/
|
||||
{
|
||||
ZYDIS_BROADCAST_MODE_INVALID,
|
||||
ZYDIS_BROADCAST_MODE_INVALID,
|
||||
ZYDIS_BROADCAST_MODE_INVALID
|
||||
}
|
||||
break;
|
||||
default:
|
||||
ZYDIS_UNREACHABLE;
|
||||
},
|
||||
/*B1*/
|
||||
{
|
||||
/*W0*/
|
||||
{
|
||||
ZYDIS_BROADCAST_MODE_1_TO_4,
|
||||
ZYDIS_BROADCAST_MODE_1_TO_8,
|
||||
ZYDIS_BROADCAST_MODE_1_TO_16
|
||||
},
|
||||
/*W1*/
|
||||
{
|
||||
ZYDIS_BROADCAST_MODE_1_TO_2,
|
||||
ZYDIS_BROADCAST_MODE_1_TO_4,
|
||||
ZYDIS_BROADCAST_MODE_1_TO_8
|
||||
}
|
||||
break;
|
||||
default:
|
||||
ZYDIS_UNREACHABLE;
|
||||
}
|
||||
};
|
||||
context->cd8scale = scales[evex_b][evex_w][vectorLength];
|
||||
instruction->avx.broadcast.mode = broadcasts[evex_b][evex_w][vectorLength];
|
||||
break;
|
||||
}
|
||||
case ZYDIS_TUPLETYPE_HV:
|
||||
{
|
||||
const ZydisU8 evex_b = instruction->raw.evex.b;
|
||||
ZYDIS_ASSERT(evex_b < 2);
|
||||
ZYDIS_ASSERT(!context->cache.W);
|
||||
ZYDIS_ASSERT(context->evex.elementSize == 32);
|
||||
switch (instruction->raw.evex.b)
|
||||
ZYDIS_ASSERT(!evex_b || def->functionality == ZYDIS_EVEX_FUNC_BC);
|
||||
|
||||
static const ZydisU8 scales[2][3] =
|
||||
{
|
||||
case 0:
|
||||
switch (instruction->avx.vectorLength)
|
||||
/*B0*/ { 8, 16, 32 },
|
||||
/*B1*/ { 4, 4, 4 }
|
||||
};
|
||||
static const ZydisBroadcastMode broadcasts[2][3] =
|
||||
{
|
||||
case 128:
|
||||
context->cd8scale = 8;
|
||||
break;
|
||||
case 256:
|
||||
context->cd8scale = 16;
|
||||
break;
|
||||
case 512:
|
||||
context->cd8scale = 32;
|
||||
break;
|
||||
default:
|
||||
ZYDIS_UNREACHABLE;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
context->cd8scale = 4;
|
||||
switch (instruction->avx.vectorLength)
|
||||
/*B0*/
|
||||
{
|
||||
case 128:
|
||||
instruction->avx.broadcast.mode = ZYDIS_BROADCAST_MODE_1_TO_2;
|
||||
break;
|
||||
case 256:
|
||||
instruction->avx.broadcast.mode = ZYDIS_BROADCAST_MODE_1_TO_4;
|
||||
break;
|
||||
case 512:
|
||||
instruction->avx.broadcast.mode = ZYDIS_BROADCAST_MODE_1_TO_8;
|
||||
break;
|
||||
default:
|
||||
ZYDIS_UNREACHABLE;
|
||||
ZYDIS_BROADCAST_MODE_INVALID,
|
||||
ZYDIS_BROADCAST_MODE_INVALID,
|
||||
ZYDIS_BROADCAST_MODE_INVALID
|
||||
},
|
||||
/*B1*/
|
||||
{
|
||||
ZYDIS_BROADCAST_MODE_1_TO_2,
|
||||
ZYDIS_BROADCAST_MODE_1_TO_4,
|
||||
ZYDIS_BROADCAST_MODE_1_TO_8
|
||||
}
|
||||
};
|
||||
context->cd8scale = scales[evex_b][vectorLength];
|
||||
instruction->avx.broadcast.mode = broadcasts[evex_b][vectorLength];
|
||||
break;
|
||||
default:
|
||||
ZYDIS_UNREACHABLE;
|
||||
}
|
||||
break;
|
||||
case ZYDIS_TUPLETYPE_FVM:
|
||||
switch (instruction->avx.vectorLength)
|
||||
{
|
||||
case 128:
|
||||
context->cd8scale = 16;
|
||||
static const ZydisU8 scales[3] =
|
||||
{
|
||||
16, 32, 64
|
||||
};
|
||||
context->cd8scale = scales[vectorLength];
|
||||
break;
|
||||
case 256:
|
||||
context->cd8scale = 32;
|
||||
break;
|
||||
case 512:
|
||||
context->cd8scale = 64;
|
||||
break;
|
||||
default:
|
||||
ZYDIS_UNREACHABLE;
|
||||
}
|
||||
break;
|
||||
case ZYDIS_TUPLETYPE_GSCAT:
|
||||
switch (context->cache.W)
|
||||
{
|
||||
|
@ -2556,8 +2505,20 @@ static void ZydisSetAVXInformation(ZydisDecoderContext* context,
|
|||
ZYDIS_UNREACHABLE;
|
||||
}
|
||||
case ZYDIS_TUPLETYPE_T1S:
|
||||
context->cd8scale = context->evex.elementSize / 8;
|
||||
{
|
||||
static const ZydisU8 scales[6] =
|
||||
{
|
||||
/* */ 0,
|
||||
/* 8*/ 1,
|
||||
/* 16*/ 2,
|
||||
/* 32*/ 4,
|
||||
/* 64*/ 8,
|
||||
/*128*/ 16,
|
||||
};
|
||||
ZYDIS_ASSERT(def->elementSize < ZYDIS_ARRAY_SIZE(scales));
|
||||
context->cd8scale = scales[def->elementSize];
|
||||
break;
|
||||
};
|
||||
case ZYDIS_TUPLETYPE_T1F:
|
||||
switch (context->evex.elementSize)
|
||||
{
|
||||
|
@ -2618,72 +2579,44 @@ static void ZydisSetAVXInformation(ZydisDecoderContext* context,
|
|||
context->cd8scale = 32;
|
||||
break;
|
||||
case ZYDIS_TUPLETYPE_HVM:
|
||||
switch (instruction->avx.vectorLength)
|
||||
{
|
||||
case 128:
|
||||
context->cd8scale = 8;
|
||||
static const ZydisU8 scales[3] =
|
||||
{
|
||||
8, 16, 32
|
||||
};
|
||||
context->cd8scale = scales[vectorLength];
|
||||
break;
|
||||
case 256:
|
||||
context->cd8scale = 16;
|
||||
break;
|
||||
case 512:
|
||||
context->cd8scale = 32;
|
||||
break;
|
||||
default:
|
||||
ZYDIS_UNREACHABLE;
|
||||
}
|
||||
break;
|
||||
case ZYDIS_TUPLETYPE_QVM:
|
||||
switch (instruction->avx.vectorLength)
|
||||
{
|
||||
case 128:
|
||||
context->cd8scale = 4;
|
||||
static const ZydisU8 scales[3] =
|
||||
{
|
||||
4, 8, 16
|
||||
};
|
||||
context->cd8scale = scales[vectorLength];
|
||||
break;
|
||||
case 256:
|
||||
context->cd8scale = 8;
|
||||
break;
|
||||
case 512:
|
||||
context->cd8scale = 16;
|
||||
break;
|
||||
default:
|
||||
ZYDIS_UNREACHABLE;
|
||||
}
|
||||
break;
|
||||
case ZYDIS_TUPLETYPE_OVM:
|
||||
switch (instruction->avx.vectorLength)
|
||||
{
|
||||
case 128:
|
||||
context->cd8scale = 2;
|
||||
static const ZydisU8 scales[3] =
|
||||
{
|
||||
2, 4, 8
|
||||
};
|
||||
context->cd8scale = scales[vectorLength];
|
||||
break;
|
||||
case 256:
|
||||
context->cd8scale = 4;
|
||||
break;
|
||||
case 512:
|
||||
context->cd8scale = 8;
|
||||
break;
|
||||
default:
|
||||
ZYDIS_UNREACHABLE;
|
||||
}
|
||||
break;
|
||||
case ZYDIS_TUPLETYPE_M128:
|
||||
context->cd8scale = 16;
|
||||
break;
|
||||
case ZYDIS_TUPLETYPE_DUP:
|
||||
switch (instruction->avx.vectorLength)
|
||||
{
|
||||
case 128:
|
||||
context->cd8scale = 8;
|
||||
static const ZydisU8 scales[3] =
|
||||
{
|
||||
8, 32, 64
|
||||
};
|
||||
context->cd8scale = scales[vectorLength];
|
||||
break;
|
||||
case 256:
|
||||
context->cd8scale = 32;
|
||||
break;
|
||||
case 512:
|
||||
context->cd8scale = 64;
|
||||
break;
|
||||
default:
|
||||
ZYDIS_UNREACHABLE;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
ZYDIS_UNREACHABLE;
|
||||
}
|
||||
|
@ -2697,47 +2630,24 @@ static void ZydisSetAVXInformation(ZydisDecoderContext* context,
|
|||
{
|
||||
ZYDIS_ASSERT(!instruction->avx.broadcast.mode);
|
||||
instruction->avx.broadcast.isStatic = ZYDIS_TRUE;
|
||||
switch (def->broadcast)
|
||||
static const ZydisBroadcastMode broadcasts[ZYDIS_EVEX_STATIC_BROADCAST_MAX_VALUE + 1] =
|
||||
{
|
||||
case ZYDIS_EVEX_STATIC_BROADCAST_1_TO_2:
|
||||
instruction->avx.broadcast.mode = ZYDIS_BROADCAST_MODE_1_TO_2;
|
||||
break;
|
||||
case ZYDIS_EVEX_STATIC_BROADCAST_1_TO_4:
|
||||
instruction->avx.broadcast.mode = ZYDIS_BROADCAST_MODE_1_TO_4;
|
||||
break;
|
||||
case ZYDIS_EVEX_STATIC_BROADCAST_1_TO_8:
|
||||
instruction->avx.broadcast.mode = ZYDIS_BROADCAST_MODE_1_TO_8;
|
||||
break;
|
||||
case ZYDIS_EVEX_STATIC_BROADCAST_1_TO_16:
|
||||
instruction->avx.broadcast.mode = ZYDIS_BROADCAST_MODE_1_TO_16;
|
||||
break;
|
||||
case ZYDIS_EVEX_STATIC_BROADCAST_1_TO_32:
|
||||
instruction->avx.broadcast.mode = ZYDIS_BROADCAST_MODE_1_TO_32;
|
||||
break;
|
||||
case ZYDIS_EVEX_STATIC_BROADCAST_1_TO_64:
|
||||
instruction->avx.broadcast.mode = ZYDIS_BROADCAST_MODE_1_TO_64;
|
||||
break;
|
||||
case ZYDIS_EVEX_STATIC_BROADCAST_2_TO_4:
|
||||
instruction->avx.broadcast.mode = ZYDIS_BROADCAST_MODE_2_TO_4;
|
||||
break;
|
||||
case ZYDIS_EVEX_STATIC_BROADCAST_2_TO_8:
|
||||
instruction->avx.broadcast.mode = ZYDIS_BROADCAST_MODE_2_TO_8;
|
||||
break;
|
||||
case ZYDIS_EVEX_STATIC_BROADCAST_2_TO_16:
|
||||
instruction->avx.broadcast.mode = ZYDIS_BROADCAST_MODE_2_TO_16;
|
||||
break;
|
||||
case ZYDIS_EVEX_STATIC_BROADCAST_4_TO_8:
|
||||
instruction->avx.broadcast.mode = ZYDIS_BROADCAST_MODE_4_TO_8;
|
||||
break;
|
||||
case ZYDIS_EVEX_STATIC_BROADCAST_4_TO_16:
|
||||
instruction->avx.broadcast.mode = ZYDIS_BROADCAST_MODE_4_TO_16;
|
||||
break;
|
||||
case ZYDIS_EVEX_STATIC_BROADCAST_8_TO_16:
|
||||
instruction->avx.broadcast.mode = ZYDIS_BROADCAST_MODE_8_TO_16;
|
||||
break;
|
||||
default:
|
||||
ZYDIS_UNREACHABLE;
|
||||
}
|
||||
ZYDIS_BROADCAST_MODE_INVALID,
|
||||
ZYDIS_BROADCAST_MODE_1_TO_2,
|
||||
ZYDIS_BROADCAST_MODE_1_TO_4,
|
||||
ZYDIS_BROADCAST_MODE_1_TO_8,
|
||||
ZYDIS_BROADCAST_MODE_1_TO_16,
|
||||
ZYDIS_BROADCAST_MODE_1_TO_32,
|
||||
ZYDIS_BROADCAST_MODE_1_TO_64,
|
||||
ZYDIS_BROADCAST_MODE_2_TO_4,
|
||||
ZYDIS_BROADCAST_MODE_2_TO_8,
|
||||
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_ASSERT(def->broadcast < ZYDIS_ARRAY_SIZE(broadcasts));
|
||||
instruction->avx.broadcast.mode = broadcasts[def->broadcast];
|
||||
}
|
||||
|
||||
// Rounding mode and SAE
|
||||
|
@ -3494,7 +3404,7 @@ static void ZydisSetEffectiveAddressWidth(ZydisDecoderContext* context,
|
|||
ZYDIS_ASSERT(context);
|
||||
ZYDIS_ASSERT(instruction);
|
||||
|
||||
ZydisBool hasOverride = definition->acceptsAddressSizeOverride &&
|
||||
const ZydisBool hasOverride = definition->acceptsAddressSizeOverride &&
|
||||
(instruction->attributes & ZYDIS_ATTRIB_HAS_ADDRESSSIZE);
|
||||
|
||||
switch (context->decoder->addressWidth)
|
||||
|
@ -3542,7 +3452,7 @@ static ZydisStatus ZydisNodeHandlerXOP(ZydisDecodedInstruction* instruction, Zyd
|
|||
break;
|
||||
case ZYDIS_INSTRUCTION_ENCODING_XOP:
|
||||
ZYDIS_ASSERT(instruction->raw.xop.isDecoded);
|
||||
*index = (instruction->raw.xop.m_mmmm - 0x08) + 1;
|
||||
*index = (instruction->raw.xop.m_mmmm - 0x08) + (instruction->raw.xop.pp * 3) + 1;
|
||||
break;
|
||||
default:
|
||||
ZYDIS_UNREACHABLE;
|
||||
|
@ -3627,6 +3537,10 @@ static ZydisStatus ZydisNodeHandlerOpcode(ZydisDecoderContext* context,
|
|||
{
|
||||
return ZYDIS_STATUS_ILLEGAL_REX;
|
||||
}
|
||||
if (instruction->raw.prefixes.hasF0)
|
||||
{
|
||||
return ZYDIS_STATUS_ILLEGAL_LOCK;
|
||||
}
|
||||
if (context->mandatoryCandidate)
|
||||
{
|
||||
return ZYDIS_STATUS_ILLEGAL_LEGACY_PFX;
|
||||
|
@ -3725,6 +3639,10 @@ static ZydisStatus ZydisNodeHandlerOpcode(ZydisDecoderContext* context,
|
|||
{
|
||||
return ZYDIS_STATUS_ILLEGAL_REX;
|
||||
}
|
||||
if (instruction->raw.prefixes.hasF0)
|
||||
{
|
||||
return ZYDIS_STATUS_ILLEGAL_LOCK;
|
||||
}
|
||||
if (context->mandatoryCandidate)
|
||||
{
|
||||
return ZYDIS_STATUS_ILLEGAL_LEGACY_PFX;
|
||||
|
@ -3748,6 +3666,10 @@ static ZydisStatus ZydisNodeHandlerOpcode(ZydisDecoderContext* context,
|
|||
switch (instruction->opcode)
|
||||
{
|
||||
case 0x0F:
|
||||
if (instruction->raw.prefixes.hasF0)
|
||||
{
|
||||
return ZYDIS_STATUS_ILLEGAL_LOCK;
|
||||
}
|
||||
instruction->encoding = ZYDIS_INSTRUCTION_ENCODING_3DNOW;
|
||||
instruction->opcodeMap = ZYDIS_OPCODE_MAP_0F0F;
|
||||
break;
|
||||
|
@ -4094,29 +4016,38 @@ static ZydisStatus ZydisNodeHandlerMvexE(ZydisDecodedInstruction* instruction, Z
|
|||
*
|
||||
* @return A zydis status code.
|
||||
*
|
||||
* This function is called directly after a valid instruction-definition was found.
|
||||
* This function is called immediately after a valid instruction-definition was found.
|
||||
*/
|
||||
static ZydisStatus ZydisCheckErrorConditions(ZydisDecoderContext* context,
|
||||
ZydisDecodedInstruction* instruction, const ZydisInstructionDefinition* definition)
|
||||
{
|
||||
ZydisBool acceptsLock = ZYDIS_FALSE;
|
||||
ZydisBool hasNDSNDDOperand = ZYDIS_FALSE;
|
||||
const ZydisRegisterConstraint constrREG = definition->constrREG;
|
||||
const ZydisRegisterConstraint constrRM = definition->constrRM;
|
||||
// We set this to `NONE` instead of `UNUSED` to save up some unnecessary runtime checks
|
||||
ZydisRegisterConstraint constrNDSNDD = ZYDIS_REG_CONSTRAINTS_NONE;
|
||||
ZydisBool hasVSIB = ZYDIS_FALSE;
|
||||
ZydisBool isGather = ZYDIS_FALSE;
|
||||
#if !defined(ZYDIS_DISABLE_EVEX) || !defined(ZYDIS_DISABLE_MVEX)
|
||||
ZydisMaskPolicy maskPolicy = ZYDIS_MASK_POLICY_INVALID;
|
||||
#endif
|
||||
|
||||
switch (instruction->encoding)
|
||||
{
|
||||
case ZYDIS_INSTRUCTION_ENCODING_DEFAULT:
|
||||
{
|
||||
const ZydisInstructionDefinitionDEFAULT* def =
|
||||
(const ZydisInstructionDefinitionDEFAULT*)definition;
|
||||
|
||||
if (def->requiresProtectedMode &&
|
||||
(context->decoder->machineMode == ZYDIS_MACHINE_MODE_REAL_16))
|
||||
{
|
||||
return ZYDIS_STATUS_DECODING_ERROR;
|
||||
}
|
||||
acceptsLock = def->acceptsLock;
|
||||
|
||||
if (instruction->raw.prefixes.hasF0 && !def->acceptsLOCK)
|
||||
{
|
||||
return ZYDIS_STATUS_ILLEGAL_LOCK;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ZYDIS_INSTRUCTION_ENCODING_3DNOW:
|
||||
|
@ -4127,14 +4058,15 @@ static ZydisStatus ZydisCheckErrorConditions(ZydisDecoderContext* context,
|
|||
{
|
||||
const ZydisInstructionDefinitionXOP* def =
|
||||
(const ZydisInstructionDefinitionXOP*)definition;
|
||||
hasNDSNDDOperand = def->hasNDSNDDOperand;
|
||||
constrNDSNDD = def->constrNDSNDD;
|
||||
break;
|
||||
}
|
||||
case ZYDIS_INSTRUCTION_ENCODING_VEX:
|
||||
{
|
||||
const ZydisInstructionDefinitionVEX* def =
|
||||
(const ZydisInstructionDefinitionVEX*)definition;
|
||||
hasNDSNDDOperand = def->hasNDSNDDOperand;
|
||||
constrNDSNDD = def->constrNDSNDD;
|
||||
isGather = def->isGather;
|
||||
break;
|
||||
}
|
||||
case ZYDIS_INSTRUCTION_ENCODING_EVEX:
|
||||
|
@ -4142,8 +4074,8 @@ static ZydisStatus ZydisCheckErrorConditions(ZydisDecoderContext* context,
|
|||
#ifndef ZYDIS_DISABLE_EVEX
|
||||
const ZydisInstructionDefinitionEVEX* def =
|
||||
(const ZydisInstructionDefinitionEVEX*)definition;
|
||||
hasNDSNDDOperand = def->hasNDSNDDOperand;
|
||||
hasVSIB = def->hasVSIB;
|
||||
constrNDSNDD = def->constrNDSNDD;
|
||||
isGather = def->isGather;
|
||||
maskPolicy = def->maskPolicy;
|
||||
|
||||
// Check for invalid zero-mask
|
||||
|
@ -4161,8 +4093,8 @@ static ZydisStatus ZydisCheckErrorConditions(ZydisDecoderContext* context,
|
|||
#ifndef ZYDIS_DISABLE_MVEX
|
||||
const ZydisInstructionDefinitionMVEX* def =
|
||||
(const ZydisInstructionDefinitionMVEX*)definition;
|
||||
hasNDSNDDOperand = def->hasNDSNDDOperand;
|
||||
hasVSIB = def->hasVSIB;
|
||||
constrNDSNDD = def->constrNDSNDD;
|
||||
isGather = def->isGather;
|
||||
maskPolicy = def->maskPolicy;
|
||||
|
||||
// Check for invalid MVEX.SSS values
|
||||
|
@ -4236,22 +4168,188 @@ static ZydisStatus ZydisCheckErrorConditions(ZydisDecoderContext* context,
|
|||
ZYDIS_UNREACHABLE;
|
||||
}
|
||||
|
||||
// Check for illegal LOCK-prefix
|
||||
if (instruction->raw.prefixes.hasF0 && !acceptsLock)
|
||||
// Validate register constraints
|
||||
switch (constrREG)
|
||||
{
|
||||
return ZYDIS_STATUS_ILLEGAL_LOCK;
|
||||
case ZYDIS_REG_CONSTRAINTS_UNUSED:
|
||||
case ZYDIS_REG_CONSTRAINTS_NONE:
|
||||
break;
|
||||
case ZYDIS_REG_CONSTRAINTS_GPR:
|
||||
if ((context->decoder->machineMode == ZYDIS_MACHINE_MODE_LONG_64) && context->cache.R2)
|
||||
{
|
||||
return ZYDIS_STATUS_BAD_REGISTER;
|
||||
}
|
||||
break;
|
||||
case ZYDIS_REG_CONSTRAINTS_SR_DEST:
|
||||
// `ZYDIS_REGISTER_CR` is not allowed as `MOV` target
|
||||
if (instruction->raw.modrm.reg == 1)
|
||||
{
|
||||
return ZYDIS_STATUS_BAD_REGISTER;
|
||||
}
|
||||
ZYDIS_FALLTHROUGH;
|
||||
case ZYDIS_REG_CONSTRAINTS_SR:
|
||||
{
|
||||
if (instruction->raw.modrm.reg > 5)
|
||||
{
|
||||
return ZYDIS_STATUS_BAD_REGISTER;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ZYDIS_REG_CONSTRAINTS_CR:
|
||||
{
|
||||
// Attempts to reference CR1, CR5, CR6, CR7, and CR9–CR15 result in undefined opcode (#UD)
|
||||
// exceptions.
|
||||
const ZydisU8 value = instruction->raw.modrm.reg | (context->cache.R << 3);
|
||||
static const ZydisU8 lookup[16] =
|
||||
{
|
||||
1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0
|
||||
};
|
||||
ZYDIS_ASSERT(value < ZYDIS_ARRAY_SIZE(lookup));
|
||||
if (!lookup[value])
|
||||
{
|
||||
return ZYDIS_STATUS_BAD_REGISTER;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ZYDIS_REG_CONSTRAINTS_DR:
|
||||
// Attempts to reference DR8–DR15 result in undefined opcode (#UD) exceptions. DR4 and DR5
|
||||
// are only valid, if the debug extension (DE) flag in CR4 is set. As we can't check this,
|
||||
// we just allow them.
|
||||
if (context->cache.R)
|
||||
{
|
||||
return ZYDIS_STATUS_BAD_REGISTER;
|
||||
}
|
||||
break;
|
||||
case ZYDIS_REG_CONSTRAINTS_MASK:
|
||||
if ((context->decoder->machineMode == ZYDIS_MACHINE_MODE_LONG_64) &&
|
||||
(context->cache.R || context->cache.R2))
|
||||
{
|
||||
return ZYDIS_STATUS_BAD_REGISTER;
|
||||
}
|
||||
break;
|
||||
case ZYDIS_REG_CONSTRAINTS_BND:
|
||||
ZYDIS_ASSERT(!context->cache.R2);
|
||||
if (context->cache.R || instruction->raw.modrm.reg > 3)
|
||||
{
|
||||
return ZYDIS_STATUS_BAD_REGISTER;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
ZYDIS_UNREACHABLE;
|
||||
}
|
||||
switch (constrRM)
|
||||
{
|
||||
case ZYDIS_REG_CONSTRAINTS_UNUSED:
|
||||
case ZYDIS_REG_CONSTRAINTS_NONE:
|
||||
break;
|
||||
case ZYDIS_REG_CONSTRAINTS_SR_DEST:
|
||||
// `ZYDIS_REGISTER_CR` is not allowed as `MOV` target
|
||||
if (instruction->raw.modrm.rm == 1)
|
||||
{
|
||||
return ZYDIS_STATUS_BAD_REGISTER;
|
||||
}
|
||||
ZYDIS_FALLTHROUGH;
|
||||
case ZYDIS_REG_CONSTRAINTS_SR:
|
||||
{
|
||||
if (instruction->raw.modrm.rm > 6)
|
||||
{
|
||||
return ZYDIS_STATUS_BAD_REGISTER;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ZYDIS_REG_CONSTRAINTS_MASK:
|
||||
break;
|
||||
case ZYDIS_REG_CONSTRAINTS_BND:
|
||||
ZYDIS_ASSERT(!context->cache.X);
|
||||
if (context->cache.B || instruction->raw.modrm.rm > 3)
|
||||
{
|
||||
return ZYDIS_STATUS_BAD_REGISTER;
|
||||
}
|
||||
break;
|
||||
case ZYDIS_REG_CONSTRAINTS_VSIB:
|
||||
hasVSIB = ZYDIS_TRUE;
|
||||
break;
|
||||
default:
|
||||
ZYDIS_UNREACHABLE;
|
||||
}
|
||||
switch (constrNDSNDD)
|
||||
{
|
||||
case ZYDIS_REG_CONSTRAINTS_UNUSED:
|
||||
// `.vvvv` is not allowed, if the instruction does not encode a NDS/NDD operand
|
||||
if (context->cache.v_vvvv & 0x0F)
|
||||
{
|
||||
return ZYDIS_STATUS_BAD_REGISTER;
|
||||
}
|
||||
// `.v'` is not allowed, if the instruction does not encode a NDS/NDD or VSIB operand
|
||||
if (!hasVSIB && context->cache.V2)
|
||||
{
|
||||
return ZYDIS_STATUS_BAD_REGISTER;
|
||||
}
|
||||
break;
|
||||
case ZYDIS_REG_CONSTRAINTS_NONE:
|
||||
ZYDIS_ASSERT(!hasVSIB || ((instruction->encoding != ZYDIS_INSTRUCTION_ENCODING_EVEX) &&
|
||||
(instruction->encoding != ZYDIS_INSTRUCTION_ENCODING_MVEX)));
|
||||
break;
|
||||
case ZYDIS_REG_CONSTRAINTS_GPR:
|
||||
// `.v'` is invalid for GPR-registers
|
||||
if (context->cache.V2)
|
||||
{
|
||||
return ZYDIS_STATUS_BAD_REGISTER;
|
||||
}
|
||||
break;
|
||||
case ZYDIS_REG_CONSTRAINTS_MASK:
|
||||
if ((context->decoder->machineMode == ZYDIS_MACHINE_MODE_LONG_64) &&
|
||||
(context->cache.v_vvvv > 7))
|
||||
{
|
||||
return ZYDIS_STATUS_BAD_REGISTER;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
ZYDIS_UNREACHABLE;
|
||||
}
|
||||
|
||||
// Check for invalid `XOP/VEX/EVEX/MVEX.vvvv` value
|
||||
if (!hasNDSNDDOperand && (context->cache.v_vvvv & 0x0F))
|
||||
// Check gather/scatter registers
|
||||
if (isGather)
|
||||
{
|
||||
return ZYDIS_STATUS_DECODING_ERROR;
|
||||
}
|
||||
ZYDIS_ASSERT(hasVSIB);
|
||||
ZYDIS_ASSERT(instruction->raw.modrm.mod != 3);
|
||||
ZYDIS_ASSERT(instruction->raw.modrm.rm == 4);
|
||||
const ZydisU8 dest = instruction->raw.modrm.reg | (context->cache.R << 3) |
|
||||
(context->cache.R2 << 4);
|
||||
const ZydisU8 index = instruction->raw.sib.index | (context->cache.X << 3) |
|
||||
(context->cache.V2 << 4);
|
||||
ZydisU8 mask = 0xFF;
|
||||
|
||||
// Check for invalid `EVEX/MVEX.v'` value
|
||||
if (!hasNDSNDDOperand && !hasVSIB && context->cache.V2)
|
||||
switch (instruction->encoding)
|
||||
{
|
||||
return ZYDIS_STATUS_DECODING_ERROR;
|
||||
case ZYDIS_INSTRUCTION_ENCODING_VEX:
|
||||
ZYDIS_ASSERT((constrREG == ZYDIS_REG_CONSTRAINTS_NONE) &&
|
||||
(constrRM == ZYDIS_REG_CONSTRAINTS_VSIB) &&
|
||||
(constrNDSNDD == ZYDIS_REG_CONSTRAINTS_NONE));
|
||||
if (context->decoder->machineMode == ZYDIS_MACHINE_MODE_LONG_64)
|
||||
{
|
||||
mask = context->cache.v_vvvv;
|
||||
} else
|
||||
{
|
||||
// Ignore the high-register bits in 16- and 32-bit mode
|
||||
mask = context->cache.v_vvvv & 0x07;
|
||||
}
|
||||
break;
|
||||
case ZYDIS_INSTRUCTION_ENCODING_EVEX:
|
||||
case ZYDIS_INSTRUCTION_ENCODING_MVEX:
|
||||
ZYDIS_ASSERT((constrREG == ZYDIS_REG_CONSTRAINTS_NONE) &&
|
||||
(constrRM == ZYDIS_REG_CONSTRAINTS_VSIB) &&
|
||||
(constrNDSNDD == ZYDIS_REG_CONSTRAINTS_UNUSED));
|
||||
break;
|
||||
default:
|
||||
ZYDIS_UNREACHABLE;
|
||||
}
|
||||
// If any pair of the index, mask, or destination registers are the same, the instruction
|
||||
// results a UD fault.
|
||||
if (dest == index || dest == mask || index == mask)
|
||||
{
|
||||
return ZYDIS_STATUS_BAD_REGISTER;
|
||||
}
|
||||
}
|
||||
|
||||
#if !defined(ZYDIS_DISABLE_EVEX) || !defined(ZYDIS_DISABLE_MVEX)
|
||||
|
@ -4407,13 +4505,13 @@ static ZydisStatus ZydisDecodeInstruction(ZydisDecoderContext* context,
|
|||
{
|
||||
const ZydisInstructionDefinition* definition;
|
||||
ZydisGetInstructionDefinition(instruction->encoding, node->value, &definition);
|
||||
ZYDIS_CHECK(ZydisCheckErrorConditions(context, instruction, definition));
|
||||
ZydisSetEffectiveOperandSize(context, instruction, definition);
|
||||
ZydisSetEffectiveAddressWidth(context, instruction, definition);
|
||||
|
||||
const ZydisInstructionEncodingInfo* info;
|
||||
ZydisGetInstructionEncodingInfo(node, &info);
|
||||
ZYDIS_CHECK(ZydisDecodeOptionalInstructionParts(context, instruction, info));
|
||||
ZYDIS_CHECK(ZydisCheckErrorConditions(context, instruction, definition));
|
||||
|
||||
if (instruction->encoding == ZYDIS_INSTRUCTION_ENCODING_3DNOW)
|
||||
{
|
||||
|
@ -4491,7 +4589,8 @@ ZydisStatus ZydisDecoderInit(ZydisDecoder* decoder, ZydisMachineMode machineMode
|
|||
ZYDIS_TRUE , // ZYDIS_DECODER_MODE_MPX
|
||||
ZYDIS_TRUE , // ZYDIS_DECODER_MODE_CET
|
||||
ZYDIS_TRUE , // ZYDIS_DECODER_MODE_LZCNT
|
||||
ZYDIS_TRUE // ZYDIS_DECODER_MODE_TZCNT
|
||||
ZYDIS_TRUE , // ZYDIS_DECODER_MODE_TZCNT
|
||||
ZYDIS_FALSE // ZYDIS_DECODER_MODE_WBNOINVD
|
||||
};
|
||||
|
||||
if (!decoder ||
|
||||
|
@ -4562,10 +4661,6 @@ ZydisStatus ZydisDecoderDecodeBuffer(const ZydisDecoder* decoder, const void* bu
|
|||
ZYDIS_CHECK(ZydisCollectOptionalPrefixes(&context, instruction));
|
||||
ZYDIS_CHECK(ZydisDecodeInstruction(&context, instruction));
|
||||
|
||||
// TODO: The index, dest and mask regs for AVX2 gathers must be different.
|
||||
|
||||
// TODO: More EVEX UD conditions (page 81)
|
||||
|
||||
return ZYDIS_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
@ -38,12 +38,21 @@
|
|||
* @brief Contains all XOP-map filters.
|
||||
*
|
||||
* Index values:
|
||||
* 0 = POP instruction (default encoding)
|
||||
* 1 = xop8
|
||||
* 2 = xop9
|
||||
* 3 = xopA
|
||||
* 00 = POP instruction (default encoding)
|
||||
* 01 = XOP8
|
||||
* 02 = XOP9
|
||||
* 03 = XOPA
|
||||
* 04 = 66_XOP8
|
||||
* 05 = 66_XOP9
|
||||
* 06 = 66_XOPA
|
||||
* 07 = F3_XOP8
|
||||
* 08 = F3_XOP9
|
||||
* 09 = F3_XOPA
|
||||
* 0A = F2_XOP8
|
||||
* 0B = F2_XOP9
|
||||
* 0C = F2_XOPA
|
||||
*/
|
||||
extern const ZydisDecoderTreeNode filtersXOP[][4];
|
||||
extern const ZydisDecoderTreeNode filtersXOP[][13];
|
||||
|
||||
/**
|
||||
* @brief Contains all VEX-map filters.
|
||||
|
@ -284,7 +293,7 @@ const ZydisDecoderTreeNode* ZydisDecoderTreeGetChildNode(const ZydisDecoderTreeN
|
|||
switch (parent->type)
|
||||
{
|
||||
case ZYDIS_NODETYPE_FILTER_XOP:
|
||||
ZYDIS_ASSERT(index < 4);
|
||||
ZYDIS_ASSERT(index < 13);
|
||||
return &filtersXOP[parent->value][index];
|
||||
case ZYDIS_NODETYPE_FILTER_VEX:
|
||||
ZYDIS_ASSERT(index < 17);
|
||||
|
|
246
src/Formatter.c
246
src/Formatter.c
|
@ -2,7 +2,7 @@
|
|||
|
||||
Zyan Disassembler Library (Zydis)
|
||||
|
||||
Original Author : Florian Bernd, Joel Höner
|
||||
Original Author : Florian Bernd, Joel Hoener
|
||||
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -71,6 +71,7 @@ static ZydisStatus ZydisFormatInstrIntel(const ZydisFormatter* formatter, ZydisS
|
|||
ZYDIS_CHECK(formatter->funcPrintPrefixes(formatter, string, instruction, userData));
|
||||
ZYDIS_CHECK(formatter->funcPrintMnemonic(formatter, string, instruction, userData));
|
||||
|
||||
const ZydisUSize strLenMnemonic = string->length;
|
||||
for (ZydisU8 i = 0; i < instruction->operandCount; ++i)
|
||||
{
|
||||
if (instruction->operands[i].visibility == ZYDIS_OPERAND_VISIBILITY_HIDDEN)
|
||||
|
@ -79,7 +80,7 @@ static ZydisStatus ZydisFormatInstrIntel(const ZydisFormatter* formatter, ZydisS
|
|||
}
|
||||
|
||||
const ZydisUSize strLenRestore = string->length;
|
||||
if (i == 0)
|
||||
if (string->length == strLenMnemonic)
|
||||
{
|
||||
ZYDIS_CHECK(ZydisStringAppendC(string, " "));
|
||||
} else
|
||||
|
@ -87,46 +88,79 @@ static ZydisStatus ZydisFormatInstrIntel(const ZydisFormatter* formatter, ZydisS
|
|||
ZYDIS_CHECK(ZydisStringAppendC(string, ", "));
|
||||
}
|
||||
|
||||
if (formatter->funcPreOperand)
|
||||
const ZydisUSize strLenPreOperand = string->length;
|
||||
|
||||
// Print embedded-mask registers as decorator instead of a regular operand
|
||||
if ((i == 1) && (instruction->operands[i].type == ZYDIS_OPERAND_TYPE_REGISTER) &&
|
||||
(instruction->operands[i].encoding == ZYDIS_OPERAND_ENCODING_MASK))
|
||||
{
|
||||
formatter->funcPreOperand(formatter, string, instruction, &instruction->operands[i],
|
||||
userData);
|
||||
goto SkipOperand;
|
||||
}
|
||||
|
||||
ZydisStatus status;
|
||||
if (formatter->funcPreOperand)
|
||||
{
|
||||
status = formatter->funcPreOperand(formatter, string, instruction,
|
||||
&instruction->operands[i], userData);
|
||||
if (status == ZYDIS_STATUS_SKIP_OPERAND)
|
||||
{
|
||||
goto SkipOperand;
|
||||
}
|
||||
if (status != ZYDIS_STATUS_SUCCESS)
|
||||
{
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
const ZydisUSize strLenPreOperand = string->length;
|
||||
switch (instruction->operands[i].type)
|
||||
{
|
||||
case ZYDIS_OPERAND_TYPE_REGISTER:
|
||||
ZYDIS_CHECK(formatter->funcFormatOperandReg(formatter, string, instruction,
|
||||
&instruction->operands[i], userData));
|
||||
status = formatter->funcFormatOperandReg(formatter, string, instruction,
|
||||
&instruction->operands[i], userData);
|
||||
break;
|
||||
case ZYDIS_OPERAND_TYPE_MEMORY:
|
||||
{
|
||||
ZYDIS_CHECK(formatter->funcPrintMemSize(formatter, string, instruction,
|
||||
&instruction->operands[i], userData));
|
||||
const ZydisUSize strLenTemp = string->length;
|
||||
ZYDIS_CHECK(formatter->funcFormatOperandMem(formatter, string, instruction,
|
||||
&instruction->operands[i], userData));
|
||||
if (strLenTemp == string->length)
|
||||
{
|
||||
string->length = strLenPreOperand;
|
||||
}
|
||||
status = formatter->funcFormatOperandMem(formatter, string, instruction,
|
||||
&instruction->operands[i], userData);
|
||||
break;
|
||||
}
|
||||
case ZYDIS_OPERAND_TYPE_POINTER:
|
||||
ZYDIS_CHECK(formatter->funcFormatOperandPtr(formatter, string, instruction,
|
||||
&instruction->operands[i], userData));
|
||||
status = formatter->funcFormatOperandPtr(formatter, string, instruction,
|
||||
&instruction->operands[i], userData);
|
||||
break;
|
||||
case ZYDIS_OPERAND_TYPE_IMMEDIATE:
|
||||
ZYDIS_CHECK(formatter->funcFormatOperandImm(formatter, string, instruction,
|
||||
&instruction->operands[i], userData));
|
||||
status = formatter->funcFormatOperandImm(formatter, string, instruction,
|
||||
&instruction->operands[i], userData);
|
||||
break;
|
||||
default:
|
||||
return ZYDIS_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
if (status == ZYDIS_STATUS_SKIP_OPERAND)
|
||||
{
|
||||
goto SkipOperand;
|
||||
}
|
||||
if (status != ZYDIS_STATUS_SUCCESS)
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
if (formatter->funcPostOperand)
|
||||
{
|
||||
status = formatter->funcPostOperand(formatter, string, instruction,
|
||||
&instruction->operands[i], userData);
|
||||
if (status == ZYDIS_STATUS_SKIP_OPERAND)
|
||||
{
|
||||
goto SkipOperand;
|
||||
}
|
||||
if (status != ZYDIS_STATUS_SUCCESS)
|
||||
{
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
if (strLenPreOperand == string->length)
|
||||
{
|
||||
SkipOperand:
|
||||
// Omit whole operand, if the string did not change during the formatting-callback
|
||||
string->length = strLenRestore;
|
||||
|
||||
|
@ -139,12 +173,6 @@ static ZydisStatus ZydisFormatInstrIntel(const ZydisFormatter* formatter, ZydisS
|
|||
continue;
|
||||
}
|
||||
|
||||
if (formatter->funcPostOperand)
|
||||
{
|
||||
formatter->funcPostOperand(formatter, string, instruction, &instruction->operands[i],
|
||||
userData);
|
||||
}
|
||||
|
||||
if ((instruction->encoding == ZYDIS_INSTRUCTION_ENCODING_EVEX) ||
|
||||
(instruction->encoding == ZYDIS_INSTRUCTION_ENCODING_MVEX))
|
||||
{
|
||||
|
@ -195,12 +223,6 @@ static ZydisStatus ZydisFormatOperandRegIntel(const ZydisFormatter* formatter, Z
|
|||
return ZYDIS_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
// We want to print embedded-mask registers as decorator instead of a regular operand
|
||||
if ((operand->id == 1) && (operand->encoding == ZYDIS_OPERAND_ENCODING_MASK))
|
||||
{
|
||||
return ZYDIS_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
return formatter->funcPrintRegister(formatter, string, instruction, operand,
|
||||
operand->reg.value, userData);
|
||||
}
|
||||
|
@ -213,6 +235,8 @@ static ZydisStatus ZydisFormatOperandMemIntel(const ZydisFormatter* formatter, Z
|
|||
return ZYDIS_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
ZYDIS_CHECK(formatter->funcPrintMemSize(formatter, string, instruction, operand, userData));
|
||||
|
||||
switch (operand->mem.segment)
|
||||
{
|
||||
case ZYDIS_REGISTER_ES:
|
||||
|
@ -222,6 +246,7 @@ static ZydisStatus ZydisFormatOperandMemIntel(const ZydisFormatter* formatter, Z
|
|||
ZYDIS_CHECK(formatter->funcPrintRegister(formatter, string, instruction, operand,
|
||||
operand->mem.segment, userData));
|
||||
ZYDIS_CHECK(ZydisStringAppendC(string, ":"));
|
||||
break;
|
||||
case ZYDIS_REGISTER_SS:
|
||||
if ((formatter->forceMemorySegment) ||
|
||||
(instruction->attributes & ZYDIS_ATTRIB_HAS_SEGMENT_SS))
|
||||
|
@ -287,7 +312,7 @@ static ZydisStatus ZydisFormatOperandMemIntel(const ZydisFormatter* formatter, Z
|
|||
if (operand->mem.scale)
|
||||
{
|
||||
ZYDIS_CHECK(ZydisStringAppendC(string, "*"));
|
||||
ZYDIS_CHECK(ZydisPrintDecU(string, operand->mem.scale, 0));
|
||||
ZYDIS_CHECK(ZydisStringAppendDecU(string, operand->mem.scale, 0));
|
||||
}
|
||||
}
|
||||
ZYDIS_CHECK(formatter->funcPrintDisp(formatter, string, instruction, operand, userData));
|
||||
|
@ -307,10 +332,10 @@ static ZydisStatus ZydisFormatOperandPtrIntel(const ZydisFormatter* formatter, Z
|
|||
return ZYDIS_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
ZYDIS_CHECK(ZydisPrintHexU(string, operand->ptr.segment, 4,
|
||||
ZYDIS_CHECK(ZydisStringAppendHexU(string, operand->ptr.segment, 4,
|
||||
formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix));
|
||||
ZYDIS_CHECK(ZydisStringAppendC(string, ":"));
|
||||
return ZydisPrintHexU(string, operand->ptr.offset, 8,
|
||||
return ZydisStringAppendHexU(string, operand->ptr.offset, 8,
|
||||
formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix);
|
||||
}
|
||||
|
||||
|
@ -346,11 +371,11 @@ static ZydisStatus ZydisFormatOperandImmIntel(const ZydisFormatter* formatter, Z
|
|||
|
||||
if (printSignedHEX)
|
||||
{
|
||||
return ZydisPrintHexS(string, (ZydisI32)operand->imm.value.s,
|
||||
return ZydisStringAppendHexS(string, (ZydisI32)operand->imm.value.s,
|
||||
formatter->hexPaddingAddress, formatter->hexUppercase, formatter->hexPrefix,
|
||||
formatter->hexSuffix);
|
||||
}
|
||||
return ZydisPrintHexU(string, operand->imm.value.u,
|
||||
return ZydisStringAppendHexU(string, operand->imm.value.u,
|
||||
formatter->hexPaddingAddress, formatter->hexUppercase, formatter->hexPrefix,
|
||||
formatter->hexSuffix);
|
||||
}
|
||||
|
@ -422,13 +447,13 @@ static ZydisStatus ZydisPrintAddrIntel(const ZydisFormatter* formatter, ZydisStr
|
|||
switch (instruction->stackWidth)
|
||||
{
|
||||
case 16:
|
||||
return ZydisPrintHexU(string, (ZydisU16)address, 4,
|
||||
return ZydisStringAppendHexU(string, (ZydisU16)address, 4,
|
||||
formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix);
|
||||
case 32:
|
||||
return ZydisPrintHexU(string, (ZydisU32)address, 8,
|
||||
return ZydisStringAppendHexU(string, (ZydisU32)address, 8,
|
||||
formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix);
|
||||
case 64:
|
||||
return ZydisPrintHexU(string, address, 16,
|
||||
return ZydisStringAppendHexU(string, address, 16,
|
||||
formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix);
|
||||
default:
|
||||
return ZYDIS_STATUS_INVALID_PARAMETER;
|
||||
|
@ -455,7 +480,7 @@ static ZydisStatus ZydisPrintDispIntel(const ZydisFormatter* formatter, ZydisStr
|
|||
(operand->mem.base != ZYDIS_REGISTER_NONE) ||
|
||||
(operand->mem.index != ZYDIS_REGISTER_NONE)))
|
||||
{
|
||||
return ZydisPrintHexS(string, operand->mem.disp.value, formatter->hexPaddingDisp,
|
||||
return ZydisStringAppendHexS(string, operand->mem.disp.value, formatter->hexPaddingDisp,
|
||||
formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix);
|
||||
}
|
||||
if ((operand->mem.base != ZYDIS_REGISTER_NONE) ||
|
||||
|
@ -463,8 +488,9 @@ static ZydisStatus ZydisPrintDispIntel(const ZydisFormatter* formatter, ZydisStr
|
|||
{
|
||||
ZYDIS_CHECK(ZydisStringAppendC(string, "+"));
|
||||
}
|
||||
return ZydisPrintHexU(string, (ZydisU64)operand->mem.disp.value, formatter->hexPaddingDisp,
|
||||
formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix);
|
||||
return ZydisStringAppendHexU(string, (ZydisU64)operand->mem.disp.value,
|
||||
formatter->hexPaddingDisp, formatter->hexUppercase, formatter->hexPrefix,
|
||||
formatter->hexSuffix);
|
||||
}
|
||||
return ZYDIS_STATUS_SUCCESS;
|
||||
}
|
||||
|
@ -490,16 +516,19 @@ static ZydisStatus ZydisPrintImmIntel(const ZydisFormatter* formatter, ZydisStri
|
|||
switch (operand->size)
|
||||
{
|
||||
case 8:
|
||||
return ZydisPrintHexS(string, (ZydisI8)operand->imm.value.s, formatter->formatImm,
|
||||
formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix);
|
||||
return ZydisStringAppendHexS(string, (ZydisI8)operand->imm.value.s,
|
||||
formatter->formatImm, formatter->hexUppercase, formatter->hexPrefix,
|
||||
formatter->hexSuffix);
|
||||
case 16:
|
||||
return ZydisPrintHexS(string, (ZydisI16)operand->imm.value.s, formatter->formatImm,
|
||||
formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix);
|
||||
return ZydisStringAppendHexS(string, (ZydisI16)operand->imm.value.s,
|
||||
formatter->formatImm, formatter->hexUppercase, formatter->hexPrefix,
|
||||
formatter->hexSuffix);
|
||||
case 32:
|
||||
return ZydisPrintHexS(string, (ZydisI32)operand->imm.value.s, formatter->formatImm,
|
||||
formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix);
|
||||
return ZydisStringAppendHexS(string, (ZydisI32)operand->imm.value.s,
|
||||
formatter->formatImm, formatter->hexUppercase, formatter->hexPrefix,
|
||||
formatter->hexSuffix);
|
||||
case 64:
|
||||
return ZydisPrintHexS(string, operand->imm.value.s, formatter->formatImm,
|
||||
return ZydisStringAppendHexS(string, operand->imm.value.s, formatter->formatImm,
|
||||
formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix);
|
||||
default:
|
||||
return ZYDIS_STATUS_INVALID_PARAMETER;
|
||||
|
@ -508,16 +537,16 @@ static ZydisStatus ZydisPrintImmIntel(const ZydisFormatter* formatter, ZydisStri
|
|||
switch (instruction->operandWidth)
|
||||
{
|
||||
case 8:
|
||||
return ZydisPrintHexU(string, (ZydisU8)operand->imm.value.u, formatter->formatImm,
|
||||
return ZydisStringAppendHexU(string, (ZydisU8)operand->imm.value.u, formatter->formatImm,
|
||||
formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix);
|
||||
case 16:
|
||||
return ZydisPrintHexU(string, (ZydisU16)operand->imm.value.u, formatter->formatImm,
|
||||
return ZydisStringAppendHexU(string, (ZydisU16)operand->imm.value.u, formatter->formatImm,
|
||||
formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix);
|
||||
case 32:
|
||||
return ZydisPrintHexU(string, (ZydisU32)operand->imm.value.u, formatter->formatImm,
|
||||
return ZydisStringAppendHexU(string, (ZydisU32)operand->imm.value.u, formatter->formatImm,
|
||||
formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix);
|
||||
case 64:
|
||||
return ZydisPrintHexU(string, operand->imm.value.u, formatter->formatImm,
|
||||
return ZydisStringAppendHexU(string, operand->imm.value.u, formatter->formatImm,
|
||||
formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix);
|
||||
default:
|
||||
return ZYDIS_STATUS_INVALID_PARAMETER;
|
||||
|
@ -691,6 +720,7 @@ static ZydisStatus ZydisPrintDecoratorIntel(const ZydisFormatter* formatter, Zyd
|
|||
{
|
||||
case ZYDIS_DECORATOR_TYPE_MASK:
|
||||
{
|
||||
#if !defined(ZYDIS_DISABLE_EVEX) || !defined(ZYDIS_DISABLE_MVEX)
|
||||
if (instruction->avx.mask.reg != ZYDIS_REGISTER_K0)
|
||||
{
|
||||
ZYDIS_CHECK(ZydisStringAppendC(string, " {"));
|
||||
|
@ -702,9 +732,11 @@ static ZydisStatus ZydisPrintDecoratorIntel(const ZydisFormatter* formatter, Zyd
|
|||
ZYDIS_CHECK(ZydisStringAppendC(string, " {z}"));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case ZYDIS_DECORATOR_TYPE_BC:
|
||||
#if !defined(ZYDIS_DISABLE_EVEX)
|
||||
if (!instruction->avx.broadcast.isStatic)
|
||||
{
|
||||
switch (instruction->avx.broadcast.mode)
|
||||
|
@ -733,8 +765,10 @@ static ZydisStatus ZydisPrintDecoratorIntel(const ZydisFormatter* formatter, Zyd
|
|||
return ZYDIS_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case ZYDIS_DECORATOR_TYPE_RC:
|
||||
#if !defined(ZYDIS_DISABLE_EVEX)
|
||||
if (instruction->avx.hasSAE)
|
||||
{
|
||||
switch (instruction->avx.rounding.mode)
|
||||
|
@ -778,14 +812,18 @@ static ZydisStatus ZydisPrintDecoratorIntel(const ZydisFormatter* formatter, Zyd
|
|||
return ZYDIS_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case ZYDIS_DECORATOR_TYPE_SAE:
|
||||
#if !defined(ZYDIS_DISABLE_EVEX)
|
||||
if (instruction->avx.hasSAE && !instruction->avx.rounding.mode)
|
||||
{
|
||||
ZYDIS_CHECK(ZydisStringAppendC(string, " {sae}"));
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case ZYDIS_DECORATOR_TYPE_SWIZZLE:
|
||||
#if !defined(ZYDIS_DISABLE_MVEX)
|
||||
switch (instruction->avx.swizzle.mode)
|
||||
{
|
||||
case ZYDIS_SWIZZLE_MODE_INVALID:
|
||||
|
@ -816,8 +854,10 @@ static ZydisStatus ZydisPrintDecoratorIntel(const ZydisFormatter* formatter, Zyd
|
|||
default:
|
||||
return ZYDIS_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case ZYDIS_DECORATOR_TYPE_CONVERSION:
|
||||
#if !defined(ZYDIS_DISABLE_MVEX)
|
||||
switch (instruction->avx.conversion.mode)
|
||||
{
|
||||
case ZYDIS_CONVERSION_MODE_INVALID:
|
||||
|
@ -840,12 +880,15 @@ static ZydisStatus ZydisPrintDecoratorIntel(const ZydisFormatter* formatter, Zyd
|
|||
default:
|
||||
return ZYDIS_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case ZYDIS_DECORATOR_TYPE_EH:
|
||||
#if !defined(ZYDIS_DISABLE_MVEX)
|
||||
if (instruction->avx.hasEvictionHint)
|
||||
{
|
||||
ZYDIS_CHECK(ZydisStringAppendC(string, " {eh}"));
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
return ZYDIS_STATUS_INVALID_PARAMETER;
|
||||
|
@ -886,6 +929,10 @@ ZydisStatus ZydisFormatterInit(ZydisFormatter* formatter, ZydisFormatterStyle st
|
|||
switch (style)
|
||||
{
|
||||
case ZYDIS_FORMATTER_STYLE_INTEL:
|
||||
formatter->funcPreInstruction = ZYDIS_NULL;
|
||||
formatter->funcPostInstruction = ZYDIS_NULL;
|
||||
formatter->funcPreOperand = ZYDIS_NULL;
|
||||
formatter->funcPostOperand = ZYDIS_NULL;
|
||||
formatter->funcFormatInstruction = &ZydisFormatInstrIntel;
|
||||
formatter->funcFormatOperandReg = &ZydisFormatOperandRegIntel;
|
||||
formatter->funcFormatOperandMem = &ZydisFormatOperandMemIntel;
|
||||
|
@ -1150,6 +1197,95 @@ ZydisStatus ZydisFormatterFormatInstructionEx(const ZydisFormatter* formatter,
|
|||
|
||||
buffer[string.length] = 0;
|
||||
|
||||
if (status == ZYDIS_STATUS_SKIP_OPERAND)
|
||||
{
|
||||
return ZYDIS_STATUS_SUCCESS;
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
ZydisStatus ZydisFormatterFormatOperand(const ZydisFormatter* formatter,
|
||||
const ZydisDecodedInstruction* instruction, ZydisU8 index, char* buffer, ZydisUSize bufferLen)
|
||||
{
|
||||
return ZydisFormatterFormatOperandEx(
|
||||
formatter, instruction, index, buffer, bufferLen, ZYDIS_NULL);
|
||||
}
|
||||
|
||||
ZydisStatus ZydisFormatterFormatOperandEx(const ZydisFormatter* formatter,
|
||||
const ZydisDecodedInstruction* instruction, ZydisU8 index, char* buffer, ZydisUSize bufferLen,
|
||||
void* userData)
|
||||
{
|
||||
if (!formatter || !instruction || index >= instruction->operandCount || !buffer ||
|
||||
(bufferLen == 0))
|
||||
{
|
||||
return ZYDIS_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
ZydisString string;
|
||||
string.buffer = buffer;
|
||||
string.length = 0;
|
||||
string.capacity = bufferLen - 1;
|
||||
|
||||
ZydisStatus status;
|
||||
const ZydisDecodedOperand* operand = &instruction->operands[index];
|
||||
|
||||
if (formatter->funcPreOperand)
|
||||
{
|
||||
status = formatter->funcPreOperand(formatter, &string, instruction, operand, userData);
|
||||
// We ignore `ZYDIS_STATUS_SKIP_OPERAND` as it does not make any sense to skip the only
|
||||
// operand printed by this function
|
||||
if ((status != ZYDIS_STATUS_SUCCESS) && (status != ZYDIS_STATUS_SKIP_OPERAND))
|
||||
{
|
||||
goto FinalizeString;
|
||||
}
|
||||
}
|
||||
|
||||
switch (operand->type)
|
||||
{
|
||||
case ZYDIS_OPERAND_TYPE_REGISTER:
|
||||
status = formatter->funcFormatOperandReg(formatter, &string, instruction, operand,
|
||||
userData);
|
||||
break;
|
||||
case ZYDIS_OPERAND_TYPE_MEMORY:
|
||||
status = formatter->funcFormatOperandMem(formatter, &string, instruction, operand,
|
||||
userData);
|
||||
break;
|
||||
case ZYDIS_OPERAND_TYPE_IMMEDIATE:
|
||||
status = formatter->funcFormatOperandImm(formatter, &string, instruction, operand,
|
||||
userData);
|
||||
break;
|
||||
case ZYDIS_OPERAND_TYPE_POINTER:
|
||||
status = formatter->funcFormatOperandPtr(formatter, &string, instruction, operand,
|
||||
userData);
|
||||
break;
|
||||
default:
|
||||
status = ZYDIS_STATUS_INVALID_PARAMETER;
|
||||
break;
|
||||
}
|
||||
// Ignore `ZYDIS_STATUS_SKIP_OPERAND`
|
||||
if (status == ZYDIS_STATUS_SKIP_OPERAND)
|
||||
{
|
||||
status = ZYDIS_STATUS_SUCCESS;
|
||||
}
|
||||
if (!ZYDIS_SUCCESS(status))
|
||||
{
|
||||
goto FinalizeString;
|
||||
}
|
||||
|
||||
// TODO: Print AVX512/KNC decorator
|
||||
|
||||
if (formatter->funcPostOperand)
|
||||
{
|
||||
status = formatter->funcPostOperand(formatter, &string, instruction, operand, userData);
|
||||
// Ignore `ZYDIS_STATUS_SKIP_OPERAND`
|
||||
if (status == ZYDIS_STATUS_SKIP_OPERAND)
|
||||
{
|
||||
status = ZYDIS_STATUS_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
FinalizeString:
|
||||
buffer[string.length] = 0;
|
||||
return status;
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -58,8 +58,11 @@ static const char* zydisISAExtStrings[] =
|
|||
"AVX512_VPCLMULQDQ_128",
|
||||
"AVX512_VPCLMULQDQ_256",
|
||||
"AVX512_VPCLMULQDQ_512",
|
||||
"AVX512_VPOPCNTDQ_128",
|
||||
"AVX512_VPOPCNTDQ_256",
|
||||
"AVX512_VPOPCNTDQ_512",
|
||||
"AVXAES",
|
||||
"AVX_GFNI",
|
||||
"BMI1",
|
||||
"BMI2",
|
||||
"CET",
|
||||
|
@ -95,10 +98,12 @@ static const char* zydisISAExtStrings[] =
|
|||
"LONGMODE",
|
||||
"LZCNT",
|
||||
"MONITOR",
|
||||
"MONITORX",
|
||||
"MOVBE",
|
||||
"MPX",
|
||||
"PAUSE",
|
||||
"PCLMULQDQ",
|
||||
"PCONFIG",
|
||||
"PENTIUMMMX",
|
||||
"PENTIUMREAL",
|
||||
"PKU",
|
||||
|
@ -115,6 +120,7 @@ static const char* zydisISAExtStrings[] =
|
|||
"RDWRFSGS",
|
||||
"RTM",
|
||||
"SGX",
|
||||
"SGX_ENCLV",
|
||||
"SHA",
|
||||
"SMAP",
|
||||
"SMX",
|
||||
|
@ -125,6 +131,7 @@ static const char* zydisISAExtStrings[] =
|
|||
"SSE3X87",
|
||||
"SSE4",
|
||||
"SSE42",
|
||||
"SSE4A",
|
||||
"SSEMXCSR",
|
||||
"SSE_PREFETCH",
|
||||
"SSSE3",
|
||||
|
|
|
@ -30,10 +30,12 @@ static const char* zydisISASetStrings[] =
|
|||
"LZCNT",
|
||||
"MMX",
|
||||
"MONITOR",
|
||||
"MONITORX",
|
||||
"MOVBE",
|
||||
"MPX",
|
||||
"PAUSE",
|
||||
"PCLMULQDQ",
|
||||
"PCONFIG",
|
||||
"PKU",
|
||||
"PREFETCHWT1",
|
||||
"PT",
|
||||
|
@ -44,6 +46,7 @@ static const char* zydisISASetStrings[] =
|
|||
"RDWRFSGS",
|
||||
"RTM",
|
||||
"SGX",
|
||||
"SGX_ENCLV",
|
||||
"SHA",
|
||||
"SMAP",
|
||||
"SMX",
|
||||
|
@ -51,6 +54,7 @@ static const char* zydisISASetStrings[] =
|
|||
"SSE2",
|
||||
"SSE3",
|
||||
"SSE4",
|
||||
"SSE4A",
|
||||
"SSSE3",
|
||||
"SVM",
|
||||
"TBM",
|
||||
|
|
|
@ -52,6 +52,7 @@ static const char* zydisInstructionCategoryStrings[] =
|
|||
"MPX",
|
||||
"NOP",
|
||||
"PCLMULQDQ",
|
||||
"PCONFIG",
|
||||
"PKU",
|
||||
"POP",
|
||||
"PREFETCH",
|
||||
|
|
|
@ -147,10 +147,12 @@ static const ZydisStaticString zydisMnemonicStrings[] =
|
|||
ZYDIS_MAKE_STATIC_STRING("emms"),
|
||||
ZYDIS_MAKE_STATIC_STRING("encls"),
|
||||
ZYDIS_MAKE_STATIC_STRING("enclu"),
|
||||
ZYDIS_MAKE_STATIC_STRING("enclv"),
|
||||
ZYDIS_MAKE_STATIC_STRING("endbr32"),
|
||||
ZYDIS_MAKE_STATIC_STRING("endbr64"),
|
||||
ZYDIS_MAKE_STATIC_STRING("enter"),
|
||||
ZYDIS_MAKE_STATIC_STRING("extractps"),
|
||||
ZYDIS_MAKE_STATIC_STRING("extrq"),
|
||||
ZYDIS_MAKE_STATIC_STRING("f2xm1"),
|
||||
ZYDIS_MAKE_STATIC_STRING("fabs"),
|
||||
ZYDIS_MAKE_STATIC_STRING("fadd"),
|
||||
|
@ -266,6 +268,7 @@ static const ZydisStaticString zydisMnemonicStrings[] =
|
|||
ZYDIS_MAKE_STATIC_STRING("insb"),
|
||||
ZYDIS_MAKE_STATIC_STRING("insd"),
|
||||
ZYDIS_MAKE_STATIC_STRING("insertps"),
|
||||
ZYDIS_MAKE_STATIC_STRING("insertq"),
|
||||
ZYDIS_MAKE_STATIC_STRING("insw"),
|
||||
ZYDIS_MAKE_STATIC_STRING("int"),
|
||||
ZYDIS_MAKE_STATIC_STRING("int1"),
|
||||
|
@ -408,6 +411,7 @@ static const ZydisStaticString zydisMnemonicStrings[] =
|
|||
ZYDIS_MAKE_STATIC_STRING("minsd"),
|
||||
ZYDIS_MAKE_STATIC_STRING("minss"),
|
||||
ZYDIS_MAKE_STATIC_STRING("monitor"),
|
||||
ZYDIS_MAKE_STATIC_STRING("monitorx"),
|
||||
ZYDIS_MAKE_STATIC_STRING("mov"),
|
||||
ZYDIS_MAKE_STATIC_STRING("movapd"),
|
||||
ZYDIS_MAKE_STATIC_STRING("movaps"),
|
||||
|
@ -431,6 +435,8 @@ static const ZydisStaticString zydisMnemonicStrings[] =
|
|||
ZYDIS_MAKE_STATIC_STRING("movntpd"),
|
||||
ZYDIS_MAKE_STATIC_STRING("movntps"),
|
||||
ZYDIS_MAKE_STATIC_STRING("movntq"),
|
||||
ZYDIS_MAKE_STATIC_STRING("movntsd"),
|
||||
ZYDIS_MAKE_STATIC_STRING("movntss"),
|
||||
ZYDIS_MAKE_STATIC_STRING("movq"),
|
||||
ZYDIS_MAKE_STATIC_STRING("movq2dq"),
|
||||
ZYDIS_MAKE_STATIC_STRING("movsb"),
|
||||
|
@ -453,6 +459,7 @@ static const ZydisStaticString zydisMnemonicStrings[] =
|
|||
ZYDIS_MAKE_STATIC_STRING("mulss"),
|
||||
ZYDIS_MAKE_STATIC_STRING("mulx"),
|
||||
ZYDIS_MAKE_STATIC_STRING("mwait"),
|
||||
ZYDIS_MAKE_STATIC_STRING("mwaitx"),
|
||||
ZYDIS_MAKE_STATIC_STRING("neg"),
|
||||
ZYDIS_MAKE_STATIC_STRING("nop"),
|
||||
ZYDIS_MAKE_STATIC_STRING("not"),
|
||||
|
@ -500,6 +507,7 @@ static const ZydisStaticString zydisMnemonicStrings[] =
|
|||
ZYDIS_MAKE_STATIC_STRING("pcmpgtw"),
|
||||
ZYDIS_MAKE_STATIC_STRING("pcmpistri"),
|
||||
ZYDIS_MAKE_STATIC_STRING("pcmpistrm"),
|
||||
ZYDIS_MAKE_STATIC_STRING("pconfig"),
|
||||
ZYDIS_MAKE_STATIC_STRING("pdep"),
|
||||
ZYDIS_MAKE_STATIC_STRING("pext"),
|
||||
ZYDIS_MAKE_STATIC_STRING("pextrb"),
|
||||
|
|
|
@ -0,0 +1,277 @@
|
|||
static const ZydisStaticString zydisRegisterStrings[] =
|
||||
{
|
||||
ZYDIS_MAKE_STATIC_STRING("none"),
|
||||
|
||||
// General purpose registers 8-bit
|
||||
ZYDIS_MAKE_STATIC_STRING("al"),
|
||||
ZYDIS_MAKE_STATIC_STRING("cl"),
|
||||
ZYDIS_MAKE_STATIC_STRING("dl"),
|
||||
ZYDIS_MAKE_STATIC_STRING("bl"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ah"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ch"),
|
||||
ZYDIS_MAKE_STATIC_STRING("dh"),
|
||||
ZYDIS_MAKE_STATIC_STRING("bh"),
|
||||
ZYDIS_MAKE_STATIC_STRING("spl"),
|
||||
ZYDIS_MAKE_STATIC_STRING("bpl"),
|
||||
ZYDIS_MAKE_STATIC_STRING("sil"),
|
||||
ZYDIS_MAKE_STATIC_STRING("dil"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r8b"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r9b"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r10b"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r11b"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r12b"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r13b"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r14b"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r15b"),
|
||||
// General purpose registers 16-bit
|
||||
ZYDIS_MAKE_STATIC_STRING("ax"),
|
||||
ZYDIS_MAKE_STATIC_STRING("cx"),
|
||||
ZYDIS_MAKE_STATIC_STRING("dx"),
|
||||
ZYDIS_MAKE_STATIC_STRING("bx"),
|
||||
ZYDIS_MAKE_STATIC_STRING("sp"),
|
||||
ZYDIS_MAKE_STATIC_STRING("bp"),
|
||||
ZYDIS_MAKE_STATIC_STRING("si"),
|
||||
ZYDIS_MAKE_STATIC_STRING("di"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r8w"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r9w"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r10w"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r11w"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r12w"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r13w"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r14w"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r15w"),
|
||||
// General purpose registers 32-bit
|
||||
ZYDIS_MAKE_STATIC_STRING("eax"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ecx"),
|
||||
ZYDIS_MAKE_STATIC_STRING("edx"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ebx"),
|
||||
ZYDIS_MAKE_STATIC_STRING("esp"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ebp"),
|
||||
ZYDIS_MAKE_STATIC_STRING("esi"),
|
||||
ZYDIS_MAKE_STATIC_STRING("edi"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r8d"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r9d"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r10d"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r11d"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r12d"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r13d"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r14d"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r15d"),
|
||||
// General purpose registers 64-bit
|
||||
ZYDIS_MAKE_STATIC_STRING("rax"),
|
||||
ZYDIS_MAKE_STATIC_STRING("rcx"),
|
||||
ZYDIS_MAKE_STATIC_STRING("rdx"),
|
||||
ZYDIS_MAKE_STATIC_STRING("rbx"),
|
||||
ZYDIS_MAKE_STATIC_STRING("rsp"),
|
||||
ZYDIS_MAKE_STATIC_STRING("rbp"),
|
||||
ZYDIS_MAKE_STATIC_STRING("rsi"),
|
||||
ZYDIS_MAKE_STATIC_STRING("rdi"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r8"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r9"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r10"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r11"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r12"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r13"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r14"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r15"),
|
||||
// Floating point legacy registers
|
||||
ZYDIS_MAKE_STATIC_STRING("st0"),
|
||||
ZYDIS_MAKE_STATIC_STRING("st1"),
|
||||
ZYDIS_MAKE_STATIC_STRING("st2"),
|
||||
ZYDIS_MAKE_STATIC_STRING("st3"),
|
||||
ZYDIS_MAKE_STATIC_STRING("st4"),
|
||||
ZYDIS_MAKE_STATIC_STRING("st5"),
|
||||
ZYDIS_MAKE_STATIC_STRING("st6"),
|
||||
ZYDIS_MAKE_STATIC_STRING("st7"),
|
||||
// Floating point multimedia registers
|
||||
ZYDIS_MAKE_STATIC_STRING("mm0"),
|
||||
ZYDIS_MAKE_STATIC_STRING("mm1"),
|
||||
ZYDIS_MAKE_STATIC_STRING("mm2"),
|
||||
ZYDIS_MAKE_STATIC_STRING("mm3"),
|
||||
ZYDIS_MAKE_STATIC_STRING("mm4"),
|
||||
ZYDIS_MAKE_STATIC_STRING("mm5"),
|
||||
ZYDIS_MAKE_STATIC_STRING("mm6"),
|
||||
ZYDIS_MAKE_STATIC_STRING("mm7"),
|
||||
// Floating point vector registers 128-bit
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm0"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm1"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm2"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm3"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm4"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm5"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm6"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm7"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm8"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm9"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm10"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm11"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm12"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm13"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm14"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm15"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm16"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm17"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm18"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm19"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm20"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm21"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm22"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm23"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm24"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm25"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm26"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm27"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm28"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm29"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm30"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm31"),
|
||||
// Floating point vector registers 256-bit
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm0"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm1"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm2"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm3"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm4"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm5"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm6"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm7"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm8"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm9"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm10"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm11"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm12"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm13"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm14"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm15"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm16"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm17"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm18"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm19"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm20"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm21"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm22"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm23"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm24"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm25"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm26"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm27"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm28"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm29"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm30"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm31"),
|
||||
// Floating point vector registers 512-bit
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm0"),
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm1"),
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm2"),
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm3"),
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm4"),
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm5"),
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm6"),
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm7"),
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm8"),
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm9"),
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm10"),
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm11"),
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm12"),
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm13"),
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm14"),
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm15"),
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm16"),
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm17"),
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm18"),
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm19"),
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm20"),
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm21"),
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm22"),
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm23"),
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm24"),
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm25"),
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm26"),
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm27"),
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm28"),
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm29"),
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm30"),
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm31"),
|
||||
// Flags registers
|
||||
ZYDIS_MAKE_STATIC_STRING("flags"),
|
||||
ZYDIS_MAKE_STATIC_STRING("eflags"),
|
||||
ZYDIS_MAKE_STATIC_STRING("rflags"),
|
||||
// Instruction-pointer registers
|
||||
ZYDIS_MAKE_STATIC_STRING("ip"),
|
||||
ZYDIS_MAKE_STATIC_STRING("eip"),
|
||||
ZYDIS_MAKE_STATIC_STRING("rip"),
|
||||
// Segment registers
|
||||
ZYDIS_MAKE_STATIC_STRING("es"),
|
||||
ZYDIS_MAKE_STATIC_STRING("cs"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ss"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ds"),
|
||||
ZYDIS_MAKE_STATIC_STRING("fs"),
|
||||
ZYDIS_MAKE_STATIC_STRING("gs"),
|
||||
// Table registers
|
||||
ZYDIS_MAKE_STATIC_STRING("gdtr"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ldtr"),
|
||||
ZYDIS_MAKE_STATIC_STRING("idtr"),
|
||||
ZYDIS_MAKE_STATIC_STRING("tr"),
|
||||
// Test registers
|
||||
ZYDIS_MAKE_STATIC_STRING("tr0"),
|
||||
ZYDIS_MAKE_STATIC_STRING("tr1"),
|
||||
ZYDIS_MAKE_STATIC_STRING("tr2"),
|
||||
ZYDIS_MAKE_STATIC_STRING("tr3"),
|
||||
ZYDIS_MAKE_STATIC_STRING("tr4"),
|
||||
ZYDIS_MAKE_STATIC_STRING("tr5"),
|
||||
ZYDIS_MAKE_STATIC_STRING("tr6"),
|
||||
ZYDIS_MAKE_STATIC_STRING("tr7"),
|
||||
// Control registers
|
||||
ZYDIS_MAKE_STATIC_STRING("cr0"),
|
||||
ZYDIS_MAKE_STATIC_STRING("cr1"),
|
||||
ZYDIS_MAKE_STATIC_STRING("cr2"),
|
||||
ZYDIS_MAKE_STATIC_STRING("cr3"),
|
||||
ZYDIS_MAKE_STATIC_STRING("cr4"),
|
||||
ZYDIS_MAKE_STATIC_STRING("cr5"),
|
||||
ZYDIS_MAKE_STATIC_STRING("cr6"),
|
||||
ZYDIS_MAKE_STATIC_STRING("cr7"),
|
||||
ZYDIS_MAKE_STATIC_STRING("cr8"),
|
||||
ZYDIS_MAKE_STATIC_STRING("cr9"),
|
||||
ZYDIS_MAKE_STATIC_STRING("cr10"),
|
||||
ZYDIS_MAKE_STATIC_STRING("cr11"),
|
||||
ZYDIS_MAKE_STATIC_STRING("cr12"),
|
||||
ZYDIS_MAKE_STATIC_STRING("cr13"),
|
||||
ZYDIS_MAKE_STATIC_STRING("cr14"),
|
||||
ZYDIS_MAKE_STATIC_STRING("cr15"),
|
||||
// Debug registers
|
||||
ZYDIS_MAKE_STATIC_STRING("dr0"),
|
||||
ZYDIS_MAKE_STATIC_STRING("dr1"),
|
||||
ZYDIS_MAKE_STATIC_STRING("dr2"),
|
||||
ZYDIS_MAKE_STATIC_STRING("dr3"),
|
||||
ZYDIS_MAKE_STATIC_STRING("dr4"),
|
||||
ZYDIS_MAKE_STATIC_STRING("dr5"),
|
||||
ZYDIS_MAKE_STATIC_STRING("dr6"),
|
||||
ZYDIS_MAKE_STATIC_STRING("dr7"),
|
||||
ZYDIS_MAKE_STATIC_STRING("dr8"),
|
||||
ZYDIS_MAKE_STATIC_STRING("dr9"),
|
||||
ZYDIS_MAKE_STATIC_STRING("dr10"),
|
||||
ZYDIS_MAKE_STATIC_STRING("dr11"),
|
||||
ZYDIS_MAKE_STATIC_STRING("dr12"),
|
||||
ZYDIS_MAKE_STATIC_STRING("dr13"),
|
||||
ZYDIS_MAKE_STATIC_STRING("dr14"),
|
||||
ZYDIS_MAKE_STATIC_STRING("dr15"),
|
||||
// Mask registers
|
||||
ZYDIS_MAKE_STATIC_STRING("k0"),
|
||||
ZYDIS_MAKE_STATIC_STRING("k1"),
|
||||
ZYDIS_MAKE_STATIC_STRING("k2"),
|
||||
ZYDIS_MAKE_STATIC_STRING("k3"),
|
||||
ZYDIS_MAKE_STATIC_STRING("k4"),
|
||||
ZYDIS_MAKE_STATIC_STRING("k5"),
|
||||
ZYDIS_MAKE_STATIC_STRING("k6"),
|
||||
ZYDIS_MAKE_STATIC_STRING("k7"),
|
||||
// Bound registers
|
||||
ZYDIS_MAKE_STATIC_STRING("bnd0"),
|
||||
ZYDIS_MAKE_STATIC_STRING("bnd1"),
|
||||
ZYDIS_MAKE_STATIC_STRING("bnd2"),
|
||||
ZYDIS_MAKE_STATIC_STRING("bnd3"),
|
||||
ZYDIS_MAKE_STATIC_STRING("bndcfg"),
|
||||
ZYDIS_MAKE_STATIC_STRING("bndstatus"),
|
||||
// Uncategorized
|
||||
ZYDIS_MAKE_STATIC_STRING("mxcsr"),
|
||||
ZYDIS_MAKE_STATIC_STRING("pkru"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xcr0")
|
||||
};
|
File diff suppressed because it is too large
Load Diff
|
@ -18,5 +18,6 @@ static const ZydisInstructionEncodingInfo instructionEncodings[] =
|
|||
{ 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 } } }
|
||||
{ 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 } } },
|
||||
{ ZYDIS_INSTR_ENC_FLAG_HAS_MODRM | ZYDIS_INSTR_ENC_FLAG_HAS_IMM0 | ZYDIS_INSTR_ENC_FLAG_HAS_IMM1, { { 0, 0, 0 } }, { { { 8, 8, 8 }, ZYDIS_FALSE, ZYDIS_FALSE }, { { 8, 8, 8 }, ZYDIS_FALSE, ZYDIS_FALSE } } }
|
||||
};
|
||||
|
|
|
@ -141,6 +141,11 @@ const ZydisOperandDefinition operandDefinitions[] =
|
|||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_WRITE, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_INT32, { .reg = { ZYDIS_IMPLREG_TYPE_STATIC, { .reg = ZYDIS_REGISTER_XMM0 } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_WRITE, { 0, 0, 0 }, ZYDIS_IELEMENT_TYPE_INVALID, { .reg = { ZYDIS_IMPLREG_TYPE_FLAGS_SSZ, { .id = 0x3F } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_READWRITE, { 4, 4, 4 }, ZYDIS_IELEMENT_TYPE_UINT32, { .reg = { ZYDIS_IMPLREG_TYPE_STATIC, { .reg = ZYDIS_REGISTER_EAX } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_CONDREAD_WRITE, { 4, 4, 4 }, ZYDIS_IELEMENT_TYPE_UINT32, { .reg = { ZYDIS_IMPLREG_TYPE_STATIC, { .reg = ZYDIS_REGISTER_EBX } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_CONDREAD_WRITE, { 4, 4, 4 }, ZYDIS_IELEMENT_TYPE_UINT32, { .reg = { ZYDIS_IMPLREG_TYPE_STATIC, { .reg = ZYDIS_REGISTER_ECX } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_CONDREAD_WRITE, { 4, 4, 4 }, ZYDIS_IELEMENT_TYPE_UINT32, { .reg = { ZYDIS_IMPLREG_TYPE_STATIC, { .reg = ZYDIS_REGISTER_EDX } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_WRITE, { 0, 0, 0 }, ZYDIS_IELEMENT_TYPE_INVALID, { .reg = { ZYDIS_IMPLREG_TYPE_FLAGS_SSZ, { .id = 0x3F } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_FLOAT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_FLOAT64, { .encoding = ZYDIS_OPERAND_ENCODING_NDSNDD } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_FLOAT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
|
@ -1165,6 +1170,10 @@ const ZydisOperandDefinition operandDefinitions[] =
|
|||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_CONDREAD_WRITE, { 0, 0, 0 }, ZYDIS_IELEMENT_TYPE_INVALID, { .reg = { ZYDIS_IMPLREG_TYPE_STATIC, { .reg = ZYDIS_REGISTER_RBX } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_CONDREAD_WRITE, { 0, 0, 0 }, ZYDIS_IELEMENT_TYPE_INVALID, { .reg = { ZYDIS_IMPLREG_TYPE_STATIC, { .reg = ZYDIS_REGISTER_RCX } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_CONDREAD_WRITE, { 0, 0, 0 }, ZYDIS_IELEMENT_TYPE_INVALID, { .reg = { ZYDIS_IMPLREG_TYPE_STATIC, { .reg = ZYDIS_REGISTER_RDX } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_READ, { 4, 4, 4 }, ZYDIS_IELEMENT_TYPE_UINT32, { .reg = { ZYDIS_IMPLREG_TYPE_STATIC, { .reg = ZYDIS_REGISTER_EAX } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_CONDREAD_WRITE, { 8, 8, 8 }, ZYDIS_IELEMENT_TYPE_UINT64, { .reg = { ZYDIS_IMPLREG_TYPE_STATIC, { .reg = ZYDIS_REGISTER_RBX } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_CONDREAD_WRITE, { 8, 8, 8 }, ZYDIS_IELEMENT_TYPE_UINT64, { .reg = { ZYDIS_IMPLREG_TYPE_STATIC, { .reg = ZYDIS_REGISTER_RCX } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_CONDREAD_WRITE, { 8, 8, 8 }, ZYDIS_IELEMENT_TYPE_UINT64, { .reg = { ZYDIS_IMPLREG_TYPE_STATIC, { .reg = ZYDIS_REGISTER_RDX } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_GPR16_32_64, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 0, 0, 0 }, ZYDIS_IELEMENT_TYPE_INVALID, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_GPR16_32_64, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 0, 0, 0 }, ZYDIS_IELEMENT_TYPE_INVALID, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 2, 4, 4 }, ZYDIS_IELEMENT_TYPE_INT, { .encoding = ZYDIS_OPERAND_ENCODING_SIMM16_32_32 } },
|
||||
|
@ -1205,17 +1214,21 @@ const ZydisOperandDefinition operandDefinitions[] =
|
|||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_READ, { 0, 0, 0 }, ZYDIS_IELEMENT_TYPE_INVALID, { .reg = { ZYDIS_IMPLREG_TYPE_STATIC, { .reg = ZYDIS_REGISTER_DX } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_READ_CONDWRITE, { 0, 0, 0 }, ZYDIS_IELEMENT_TYPE_INVALID, { .reg = { ZYDIS_IMPLREG_TYPE_GPR_ASZ, { .id = 0x1 } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_READ, { 0, 0, 0 }, ZYDIS_IELEMENT_TYPE_INVALID, { .reg = { ZYDIS_IMPLREG_TYPE_FLAGS_SSZ, { .id = 0x3F } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 8, 8, 8 }, ZYDIS_IELEMENT_TYPE_INT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 8, 8, 8 }, ZYDIS_IELEMENT_TYPE_INT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_MEM, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_CONDWRITE, { 2, 2, 2 }, ZYDIS_IELEMENT_TYPE_INT16, { .mem = { 1, ZYDIS_IMPLMEM_BASE_ADI } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_READ, { 0, 0, 0 }, ZYDIS_IELEMENT_TYPE_INVALID, { .reg = { ZYDIS_IMPLREG_TYPE_STATIC, { .reg = ZYDIS_REGISTER_DX } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_READ_CONDWRITE, { 0, 0, 0 }, ZYDIS_IELEMENT_TYPE_INVALID, { .reg = { ZYDIS_IMPLREG_TYPE_GPR_ASZ, { .id = 0x1 } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_READ, { 0, 0, 0 }, ZYDIS_IELEMENT_TYPE_INVALID, { .reg = { ZYDIS_IMPLREG_TYPE_FLAGS_SSZ, { .id = 0x3F } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_WRITE, { 0, 0, 0 }, ZYDIS_IELEMENT_TYPE_INVALID, { .reg = { ZYDIS_IMPLREG_TYPE_IP_SSZ, { .id = 0x3F } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_READWRITE, { 0, 0, 0 }, ZYDIS_IELEMENT_TYPE_INVALID, { .reg = { ZYDIS_IMPLREG_TYPE_GPR_SSZ, { .id = 0x4 } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_MEM, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_READ, { 6, 12, 24 }, ZYDIS_IELEMENT_TYPE_INT, { .mem = { 0, ZYDIS_IMPLMEM_BASE_ASP } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_MEM, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_READ, { 10, 20, 40 }, ZYDIS_IELEMENT_TYPE_INT, { .mem = { 0, ZYDIS_IMPLMEM_BASE_ASP } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_WRITE, { 0, 0, 0 }, ZYDIS_IELEMENT_TYPE_INVALID, { .reg = { ZYDIS_IMPLREG_TYPE_FLAGS_SSZ, { .id = 0x3F } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_WRITE, { 0, 0, 0 }, ZYDIS_IELEMENT_TYPE_INVALID, { .reg = { ZYDIS_IMPLREG_TYPE_STATIC, { .reg = ZYDIS_REGISTER_RIP } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_READWRITE, { 0, 0, 0 }, ZYDIS_IELEMENT_TYPE_INVALID, { .reg = { ZYDIS_IMPLREG_TYPE_GPR_SSZ, { .id = 0x4 } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_MEM, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_READ, { 6, 12, 24 }, ZYDIS_IELEMENT_TYPE_INT, { .mem = { 0, ZYDIS_IMPLMEM_BASE_ASP } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_MEM, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_READ, { 10, 20, 40 }, ZYDIS_IELEMENT_TYPE_INT, { .mem = { 0, ZYDIS_IMPLMEM_BASE_ASP } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_WRITE, { 0, 0, 0 }, ZYDIS_IELEMENT_TYPE_INVALID, { .reg = { ZYDIS_IMPLREG_TYPE_FLAGS_SSZ, { .id = 0x3F } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_CONDWRITE, { 0, 0, 0 }, ZYDIS_IELEMENT_TYPE_INVALID, { .reg = { ZYDIS_IMPLREG_TYPE_STATIC, { .reg = ZYDIS_REGISTER_AL } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_MEM, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_CONDREAD, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT8, { .mem = { 4, ZYDIS_IMPLMEM_BASE_ASI } } },
|
||||
|
@ -1341,6 +1354,10 @@ const ZydisOperandDefinition operandDefinitions[] =
|
|||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_READ, { 0, 0, 0 }, ZYDIS_IELEMENT_TYPE_INVALID, { .reg = { ZYDIS_IMPLREG_TYPE_STATIC, { .reg = ZYDIS_REGISTER_EDX } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_READ, { 0, 0, 0 }, ZYDIS_IELEMENT_TYPE_INVALID, { .reg = { ZYDIS_IMPLREG_TYPE_STATIC, { .reg = ZYDIS_REGISTER_EAX } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_READ, { 0, 0, 0 }, ZYDIS_IELEMENT_TYPE_INVALID, { .reg = { ZYDIS_IMPLREG_TYPE_STATIC, { .reg = ZYDIS_REGISTER_XCR0 } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_MEM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READWRITE, { 576, 576, 576 }, ZYDIS_IELEMENT_TYPE_STRUCT, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_READ, { 0, 0, 0 }, ZYDIS_IELEMENT_TYPE_INVALID, { .reg = { ZYDIS_IMPLREG_TYPE_STATIC, { .reg = ZYDIS_REGISTER_EDX } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_READ, { 0, 0, 0 }, ZYDIS_IELEMENT_TYPE_INVALID, { .reg = { ZYDIS_IMPLREG_TYPE_STATIC, { .reg = ZYDIS_REGISTER_EAX } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_READ, { 0, 0, 0 }, ZYDIS_IELEMENT_TYPE_INVALID, { .reg = { ZYDIS_IMPLREG_TYPE_STATIC, { .reg = ZYDIS_REGISTER_XCR0 } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_MEM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 576, 576, 576 }, ZYDIS_IELEMENT_TYPE_STRUCT, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_READ, { 0, 0, 0 }, ZYDIS_IELEMENT_TYPE_INVALID, { .reg = { ZYDIS_IMPLREG_TYPE_STATIC, { .reg = ZYDIS_REGISTER_EDX } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_READ, { 0, 0, 0 }, ZYDIS_IELEMENT_TYPE_INVALID, { .reg = { ZYDIS_IMPLREG_TYPE_STATIC, { .reg = ZYDIS_REGISTER_EAX } } } },
|
||||
|
@ -1408,27 +1425,27 @@ const ZydisOperandDefinition operandDefinitions[] =
|
|||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_INT8, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_INT8, { .encoding = ZYDIS_OPERAND_ENCODING_NDSNDD } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_INT8, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_INT8, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_INT8, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_INT8, { .encoding = ZYDIS_OPERAND_ENCODING_NDSNDD } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_MEM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_INT8, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_INT8, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_INT32, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_INT32, { .encoding = ZYDIS_OPERAND_ENCODING_NDSNDD } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_INT32, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_INT32, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_INT32, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_INT32, { .encoding = ZYDIS_OPERAND_ENCODING_NDSNDD } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_MEM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_INT32, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_INT32, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_INT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_INT64, { .encoding = ZYDIS_OPERAND_ENCODING_NDSNDD } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_INT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_INT64, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_INT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_INT64, { .encoding = ZYDIS_OPERAND_ENCODING_NDSNDD } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_MEM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_INT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_INT64, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_NDSNDD } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
|
@ -1440,35 +1457,35 @@ const ZydisOperandDefinition operandDefinitions[] =
|
|||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT32, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT32, { .encoding = ZYDIS_OPERAND_ENCODING_NDSNDD } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT32, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT32, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT32, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT32, { .encoding = ZYDIS_OPERAND_ENCODING_NDSNDD } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_MEM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT32, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT32, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT64, { .encoding = ZYDIS_OPERAND_ENCODING_NDSNDD } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT64, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT64, { .encoding = ZYDIS_OPERAND_ENCODING_NDSNDD } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_MEM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT64, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT16, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT16, { .encoding = ZYDIS_OPERAND_ENCODING_NDSNDD } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT16, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT16, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT16, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT16, { .encoding = ZYDIS_OPERAND_ENCODING_NDSNDD } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_MEM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT16, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT16, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_INT16, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_INT16, { .encoding = ZYDIS_OPERAND_ENCODING_NDSNDD } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_INT16, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_INT16, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_INT16, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_INT16, { .encoding = ZYDIS_OPERAND_ENCODING_NDSNDD } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_MEM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_INT16, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_INT16, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_INT32, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_INT32, { .encoding = ZYDIS_OPERAND_ENCODING_NDSNDD } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_INT32, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
|
@ -1509,19 +1526,19 @@ const ZydisOperandDefinition operandDefinitions[] =
|
|||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_INT16, { .encoding = ZYDIS_OPERAND_ENCODING_NDSNDD } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_INT16, { .encoding = ZYDIS_OPERAND_ENCODING_IS4 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_MEM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_INT16, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_GPR32, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READWRITE, { 4, 4, 4 }, ZYDIS_IELEMENT_TYPE_INT32, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_GPR32, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 4, 4, 4 }, ZYDIS_IELEMENT_TYPE_INT32, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_GPR32, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 4, 4, 4 }, ZYDIS_IELEMENT_TYPE_INT32, { .encoding = ZYDIS_OPERAND_ENCODING_NDSNDD } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_GPR32, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 4, 4, 4 }, ZYDIS_IELEMENT_TYPE_INT32, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_WRITE, { 0, 0, 0 }, ZYDIS_IELEMENT_TYPE_INVALID, { .reg = { ZYDIS_IMPLREG_TYPE_FLAGS_SSZ, { .id = 0x3F } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_GPR64, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READWRITE, { 8, 8, 8 }, ZYDIS_IELEMENT_TYPE_INT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_GPR64, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 8, 8, 8 }, ZYDIS_IELEMENT_TYPE_INT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_GPR64, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 8, 8, 8 }, ZYDIS_IELEMENT_TYPE_INT64, { .encoding = ZYDIS_OPERAND_ENCODING_NDSNDD } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_GPR64, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 8, 8, 8 }, ZYDIS_IELEMENT_TYPE_INT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_WRITE, { 0, 0, 0 }, ZYDIS_IELEMENT_TYPE_INVALID, { .reg = { ZYDIS_IMPLREG_TYPE_FLAGS_SSZ, { .id = 0x3F } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_GPR32, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READWRITE, { 4, 4, 4 }, ZYDIS_IELEMENT_TYPE_INT32, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_GPR32, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 4, 4, 4 }, ZYDIS_IELEMENT_TYPE_INT32, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_GPR32, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 4, 4, 4 }, ZYDIS_IELEMENT_TYPE_INT32, { .encoding = ZYDIS_OPERAND_ENCODING_NDSNDD } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_MEM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 4, 4, 4 }, ZYDIS_IELEMENT_TYPE_INT32, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_WRITE, { 0, 0, 0 }, ZYDIS_IELEMENT_TYPE_INVALID, { .reg = { ZYDIS_IMPLREG_TYPE_FLAGS_SSZ, { .id = 0x3F } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_GPR64, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READWRITE, { 8, 8, 8 }, ZYDIS_IELEMENT_TYPE_INT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_GPR64, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 8, 8, 8 }, ZYDIS_IELEMENT_TYPE_INT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_GPR64, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 8, 8, 8 }, ZYDIS_IELEMENT_TYPE_INT64, { .encoding = ZYDIS_OPERAND_ENCODING_NDSNDD } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_MEM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 8, 8, 8 }, ZYDIS_IELEMENT_TYPE_INT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_WRITE, { 0, 0, 0 }, ZYDIS_IELEMENT_TYPE_INVALID, { .reg = { ZYDIS_IMPLREG_TYPE_FLAGS_SSZ, { .id = 0x3F } } } },
|
||||
|
@ -1669,6 +1686,22 @@ const ZydisOperandDefinition operandDefinitions[] =
|
|||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_FLOAT32, { .encoding = ZYDIS_OPERAND_ENCODING_NDSNDD } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_FLOAT32, { .encoding = ZYDIS_OPERAND_ENCODING_IS4 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_MEM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 4, 4, 4 }, ZYDIS_IELEMENT_TYPE_FLOAT32, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_NDSNDD } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_YMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 32, 32, 32 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_YMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 32, 32, 32 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_NDSNDD } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_YMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 32, 32, 32 }, ZYDIS_IELEMENT_TYPE_UINT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_NDSNDD } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_MEM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_YMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 32, 32, 32 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_YMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 32, 32, 32 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_NDSNDD } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_MEM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 32, 32, 32 }, ZYDIS_IELEMENT_TYPE_UINT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_YMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 32, 32, 32 }, ZYDIS_IELEMENT_TYPE_FLOAT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_YMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 32, 32, 32 }, ZYDIS_IELEMENT_TYPE_FLOAT64, { .encoding = ZYDIS_OPERAND_ENCODING_NDSNDD } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_FLOAT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
|
@ -1709,18 +1742,10 @@ const ZydisOperandDefinition operandDefinitions[] =
|
|||
{ ZYDIS_SEMANTIC_OPTYPE_YMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 32, 32, 32 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_NDSNDD } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_MEM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 32, 32, 32 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT32, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT32, { .encoding = ZYDIS_OPERAND_ENCODING_NDSNDD } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT32, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_YMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 32, 32, 32 }, ZYDIS_IELEMENT_TYPE_UINT32, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_YMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 32, 32, 32 }, ZYDIS_IELEMENT_TYPE_UINT32, { .encoding = ZYDIS_OPERAND_ENCODING_NDSNDD } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_YMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 32, 32, 32 }, ZYDIS_IELEMENT_TYPE_UINT32, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT32, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT32, { .encoding = ZYDIS_OPERAND_ENCODING_NDSNDD } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_MEM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT32, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_YMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 32, 32, 32 }, ZYDIS_IELEMENT_TYPE_UINT32, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_YMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 32, 32, 32 }, ZYDIS_IELEMENT_TYPE_UINT32, { .encoding = ZYDIS_OPERAND_ENCODING_NDSNDD } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_MEM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 32, 32, 32 }, ZYDIS_IELEMENT_TYPE_UINT32, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
|
@ -1741,18 +1766,10 @@ const ZydisOperandDefinition operandDefinitions[] =
|
|||
{ ZYDIS_SEMANTIC_OPTYPE_YMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 32, 32, 32 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_NDSNDD } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_MEM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 32, 32, 32 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_YMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 32, 32, 32 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_IS4 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT16, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT16, { .encoding = ZYDIS_OPERAND_ENCODING_NDSNDD } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT16, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_YMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 32, 32, 32 }, ZYDIS_IELEMENT_TYPE_UINT16, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_YMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 32, 32, 32 }, ZYDIS_IELEMENT_TYPE_UINT16, { .encoding = ZYDIS_OPERAND_ENCODING_NDSNDD } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_YMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 32, 32, 32 }, ZYDIS_IELEMENT_TYPE_UINT16, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT16, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT16, { .encoding = ZYDIS_OPERAND_ENCODING_NDSNDD } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_MEM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT16, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_YMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 32, 32, 32 }, ZYDIS_IELEMENT_TYPE_UINT16, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_YMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 32, 32, 32 }, ZYDIS_IELEMENT_TYPE_UINT16, { .encoding = ZYDIS_OPERAND_ENCODING_NDSNDD } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_MEM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 32, 32, 32 }, ZYDIS_IELEMENT_TYPE_UINT16, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
|
@ -2926,6 +2943,9 @@ const ZydisOperandDefinition operandDefinitions[] =
|
|||
{ ZYDIS_SEMANTIC_OPTYPE_MEM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 4, 4, 4 }, ZYDIS_IELEMENT_TYPE_INT32, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_FLOAT32, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 8, 8, 8 }, ZYDIS_IELEMENT_TYPE_INT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_IMPLICIT, ZYDIS_OPERAND_ACTION_READWRITE, { 10, 10, 10 }, ZYDIS_IELEMENT_TYPE_FLOAT80, { .reg = { ZYDIS_IMPLREG_TYPE_STATIC, { .reg = ZYDIS_REGISTER_ST0 } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_FPR, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 10, 10, 10 }, ZYDIS_IELEMENT_TYPE_FLOAT80, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_WRITE, { 0, 0, 0 }, ZYDIS_IELEMENT_TYPE_INVALID, { .reg = { ZYDIS_IMPLREG_TYPE_FLAGS_SSZ, { .id = 0x3F } } } },
|
||||
|
@ -3413,9 +3433,6 @@ const ZydisOperandDefinition operandDefinitions[] =
|
|||
{ ZYDIS_SEMANTIC_OPTYPE_MEM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_FLOAT32, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 8, 8, 8 }, ZYDIS_IELEMENT_TYPE_INT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 8, 8, 8 }, ZYDIS_IELEMENT_TYPE_INT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 8, 8, 8 }, ZYDIS_IELEMENT_TYPE_INT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_MEM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 8, 8, 8 }, ZYDIS_IELEMENT_TYPE_INT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 4, 4, 4 }, ZYDIS_IELEMENT_TYPE_INT32, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
|
@ -3540,22 +3557,16 @@ const ZydisOperandDefinition operandDefinitions[] =
|
|||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_NDSNDD } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT32, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT32, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT32, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT32, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_MEM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT32, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT32, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT32, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT32, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT32, { .encoding = ZYDIS_OPERAND_ENCODING_NDSNDD } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT32, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_MEM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT32, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT32, { .encoding = ZYDIS_OPERAND_ENCODING_NDSNDD } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT64, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_MEM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT64, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT8, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT64, { .encoding = ZYDIS_OPERAND_ENCODING_NDSNDD } },
|
||||
|
@ -3564,12 +3575,6 @@ const ZydisOperandDefinition operandDefinitions[] =
|
|||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT64, { .encoding = ZYDIS_OPERAND_ENCODING_NDSNDD } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT16, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT16, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT16, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT16, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_MEM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT16, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 1, 1, 1 }, ZYDIS_IELEMENT_TYPE_UINT16, { .encoding = ZYDIS_OPERAND_ENCODING_UIMM8 } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT16, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT16, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT16, { .encoding = ZYDIS_OPERAND_ENCODING_NDSNDD } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT16, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_MEM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT16, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
|
@ -5634,6 +5639,8 @@ const ZydisOperandDefinition operandDefinitions[] =
|
|||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_WRITE, { 0, 0, 0 }, ZYDIS_IELEMENT_TYPE_INVALID, { .reg = { ZYDIS_IMPLREG_TYPE_FLAGS_SSZ, { .id = 0x3F } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_MEM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READWRITE, { 2, 4, 8 }, ZYDIS_IELEMENT_TYPE_INT, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_WRITE, { 0, 0, 0 }, ZYDIS_IELEMENT_TYPE_INVALID, { .reg = { ZYDIS_IMPLREG_TYPE_FLAGS_SSZ, { .id = 0x3F } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 8, 8, 8 }, ZYDIS_IELEMENT_TYPE_INT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_INT32, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_READWRITE, { 10, 10, 10 }, ZYDIS_IELEMENT_TYPE_FLOAT80, { .reg = { ZYDIS_IMPLREG_TYPE_STATIC, { .reg = ZYDIS_REGISTER_ST0 } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_WRITE, { 0, 0, 0 }, ZYDIS_IELEMENT_TYPE_INVALID, { .reg = { ZYDIS_IMPLREG_TYPE_FLAGS_SSZ, { .id = 0x3F } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_WRITE, { 10, 10, 10 }, ZYDIS_IELEMENT_TYPE_FLOAT80, { .reg = { ZYDIS_IMPLREG_TYPE_STATIC, { .reg = ZYDIS_REGISTER_ST0 } } } },
|
||||
|
@ -5812,6 +5819,8 @@ const ZydisOperandDefinition operandDefinitions[] =
|
|||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_FLOAT32, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_MEM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 8, 8, 8 }, ZYDIS_IELEMENT_TYPE_INT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_MMX, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 8, 8, 8 }, ZYDIS_IELEMENT_TYPE_INT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_MEM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 8, 8, 8 }, ZYDIS_IELEMENT_TYPE_INT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 8, 8, 8 }, ZYDIS_IELEMENT_TYPE_INT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_MMX, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 8, 8, 8 }, ZYDIS_IELEMENT_TYPE_INT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_GPR64, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 0, 0, 0 }, ZYDIS_IELEMENT_TYPE_INVALID, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_MMX, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 8, 8, 8 }, ZYDIS_IELEMENT_TYPE_INT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
|
@ -5824,8 +5833,6 @@ const ZydisOperandDefinition operandDefinitions[] =
|
|||
{ ZYDIS_SEMANTIC_OPTYPE_MMX, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 8, 8, 8 }, ZYDIS_IELEMENT_TYPE_INT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_GPR64, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 0, 0, 0 }, ZYDIS_IELEMENT_TYPE_INVALID, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 8, 8, 8 }, ZYDIS_IELEMENT_TYPE_INT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_MEM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 8, 8, 8 }, ZYDIS_IELEMENT_TYPE_INT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 8, 8, 8 }, ZYDIS_IELEMENT_TYPE_INT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_MMX, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 8, 8, 8 }, ZYDIS_IELEMENT_TYPE_INT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_MMX, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 8, 8, 8 }, ZYDIS_IELEMENT_TYPE_INT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_INT32, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
|
@ -6064,10 +6071,10 @@ const ZydisOperandDefinition operandDefinitions[] =
|
|||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_READ, { 0, 0, 0 }, ZYDIS_IELEMENT_TYPE_INVALID, { .reg = { ZYDIS_IMPLREG_TYPE_STATIC, { .reg = ZYDIS_REGISTER_TR } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_MEM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 2, 2, 2 }, ZYDIS_IELEMENT_TYPE_INT16, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_READ, { 0, 0, 0 }, ZYDIS_IELEMENT_TYPE_INVALID, { .reg = { ZYDIS_IMPLREG_TYPE_STATIC, { .reg = ZYDIS_REGISTER_TR } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_WRITE, { 0, 0, 0 }, ZYDIS_IELEMENT_TYPE_INVALID, { .reg = { ZYDIS_IMPLREG_TYPE_STATIC, { .reg = ZYDIS_REGISTER_EIP } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_WRITE, { 0, 0, 0 }, ZYDIS_IELEMENT_TYPE_INVALID, { .reg = { ZYDIS_IMPLREG_TYPE_FLAGS_SSZ, { .id = 0x3F } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_WRITE, { 0, 0, 0 }, ZYDIS_IELEMENT_TYPE_INVALID, { .reg = { ZYDIS_IMPLREG_TYPE_STATIC, { .reg = ZYDIS_REGISTER_RIP } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_WRITE, { 0, 0, 0 }, ZYDIS_IELEMENT_TYPE_INVALID, { .reg = { ZYDIS_IMPLREG_TYPE_FLAGS_SSZ, { .id = 0x3F } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_WRITE, { 0, 0, 0 }, ZYDIS_IELEMENT_TYPE_INVALID, { .reg = { ZYDIS_IMPLREG_TYPE_STATIC, { .reg = ZYDIS_REGISTER_EIP } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_IMPLICIT_REG, ZYDIS_OPERAND_VISIBILITY_HIDDEN, ZYDIS_OPERAND_ACTION_WRITE, { 0, 0, 0 }, ZYDIS_IELEMENT_TYPE_INVALID, { .reg = { ZYDIS_IMPLREG_TYPE_FLAGS_SSZ, { .id = 0x3F } } } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READWRITE, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_FLOAT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 8, 8, 8 }, ZYDIS_IELEMENT_TYPE_INT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READWRITE, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_FLOAT64, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
|
|
164
src/Register.c
164
src/Register.c
|
@ -30,157 +30,7 @@
|
|||
/* Register strings */
|
||||
/* ============================================================================================== */
|
||||
|
||||
static const ZydisStaticString registerStrings[] =
|
||||
{
|
||||
ZYDIS_MAKE_STATIC_STRING("none"),
|
||||
// General purpose registers 8-bit
|
||||
ZYDIS_MAKE_STATIC_STRING("al"), ZYDIS_MAKE_STATIC_STRING("cl"),
|
||||
ZYDIS_MAKE_STATIC_STRING("dl"), ZYDIS_MAKE_STATIC_STRING("bl"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ah"), ZYDIS_MAKE_STATIC_STRING("ch"),
|
||||
ZYDIS_MAKE_STATIC_STRING("dh"), ZYDIS_MAKE_STATIC_STRING("bh"),
|
||||
ZYDIS_MAKE_STATIC_STRING("spl"), ZYDIS_MAKE_STATIC_STRING("bpl"),
|
||||
ZYDIS_MAKE_STATIC_STRING("sil"), ZYDIS_MAKE_STATIC_STRING("dil"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r8b"), ZYDIS_MAKE_STATIC_STRING("r9b"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r10b"), ZYDIS_MAKE_STATIC_STRING("r11b"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r12b"), ZYDIS_MAKE_STATIC_STRING("r13b"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r14b"), ZYDIS_MAKE_STATIC_STRING("r15b"),
|
||||
// General purpose registers 16-bit
|
||||
ZYDIS_MAKE_STATIC_STRING("ax"), ZYDIS_MAKE_STATIC_STRING("cx"),
|
||||
ZYDIS_MAKE_STATIC_STRING("dx"), ZYDIS_MAKE_STATIC_STRING("bx"),
|
||||
ZYDIS_MAKE_STATIC_STRING("sp"), ZYDIS_MAKE_STATIC_STRING("bp"),
|
||||
ZYDIS_MAKE_STATIC_STRING("si"), ZYDIS_MAKE_STATIC_STRING("di"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r8w"), ZYDIS_MAKE_STATIC_STRING("r9w"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r10w"), ZYDIS_MAKE_STATIC_STRING("r11w"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r12w"), ZYDIS_MAKE_STATIC_STRING("r13w"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r14w"), ZYDIS_MAKE_STATIC_STRING("r15w"),
|
||||
// General purpose registers 32-bit
|
||||
ZYDIS_MAKE_STATIC_STRING("eax"), ZYDIS_MAKE_STATIC_STRING("ecx"),
|
||||
ZYDIS_MAKE_STATIC_STRING("edx"), ZYDIS_MAKE_STATIC_STRING("ebx"),
|
||||
ZYDIS_MAKE_STATIC_STRING("esp"), ZYDIS_MAKE_STATIC_STRING("ebp"),
|
||||
ZYDIS_MAKE_STATIC_STRING("esi"), ZYDIS_MAKE_STATIC_STRING("edi"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r8d"), ZYDIS_MAKE_STATIC_STRING("r9d"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r10d"), ZYDIS_MAKE_STATIC_STRING("r11d"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r12d"), ZYDIS_MAKE_STATIC_STRING("r13d"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r14d"), ZYDIS_MAKE_STATIC_STRING("r15d"),
|
||||
// General purpose registers 64-bi
|
||||
ZYDIS_MAKE_STATIC_STRING("rax"), ZYDIS_MAKE_STATIC_STRING("rcx"),
|
||||
ZYDIS_MAKE_STATIC_STRING("rdx"), ZYDIS_MAKE_STATIC_STRING("rbx"),
|
||||
ZYDIS_MAKE_STATIC_STRING("rsp"), ZYDIS_MAKE_STATIC_STRING("rbp"),
|
||||
ZYDIS_MAKE_STATIC_STRING("rsi"), ZYDIS_MAKE_STATIC_STRING("rdi"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r8"), ZYDIS_MAKE_STATIC_STRING("r9"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r10"), ZYDIS_MAKE_STATIC_STRING("r11"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r12"), ZYDIS_MAKE_STATIC_STRING("r13"),
|
||||
ZYDIS_MAKE_STATIC_STRING("r14"), ZYDIS_MAKE_STATIC_STRING("r15"),
|
||||
// Floating point legacy registers
|
||||
ZYDIS_MAKE_STATIC_STRING("st0"), ZYDIS_MAKE_STATIC_STRING("st1"),
|
||||
ZYDIS_MAKE_STATIC_STRING("st2"), ZYDIS_MAKE_STATIC_STRING("st3"),
|
||||
ZYDIS_MAKE_STATIC_STRING("st4"), ZYDIS_MAKE_STATIC_STRING("st5"),
|
||||
ZYDIS_MAKE_STATIC_STRING("st6"), ZYDIS_MAKE_STATIC_STRING("st7"),
|
||||
// Floating point multimedia registers
|
||||
ZYDIS_MAKE_STATIC_STRING("mm0"), ZYDIS_MAKE_STATIC_STRING("mm1"),
|
||||
ZYDIS_MAKE_STATIC_STRING("mm2"), ZYDIS_MAKE_STATIC_STRING("mm3"),
|
||||
ZYDIS_MAKE_STATIC_STRING("mm4"), ZYDIS_MAKE_STATIC_STRING("mm5"),
|
||||
ZYDIS_MAKE_STATIC_STRING("mm6"), ZYDIS_MAKE_STATIC_STRING("mm7"),
|
||||
// Floating point vector registers 128-bit
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm0"), ZYDIS_MAKE_STATIC_STRING("xmm1"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm2"), ZYDIS_MAKE_STATIC_STRING("xmm3"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm4"), ZYDIS_MAKE_STATIC_STRING("xmm5"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm6"), ZYDIS_MAKE_STATIC_STRING("xmm7"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm8"), ZYDIS_MAKE_STATIC_STRING("xmm9"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm10"), ZYDIS_MAKE_STATIC_STRING("xmm11"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm12"), ZYDIS_MAKE_STATIC_STRING("xmm13"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm14"), ZYDIS_MAKE_STATIC_STRING("xmm15"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm16"), ZYDIS_MAKE_STATIC_STRING("xmm17"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm18"), ZYDIS_MAKE_STATIC_STRING("xmm19"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm20"), ZYDIS_MAKE_STATIC_STRING("xmm21"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm22"), ZYDIS_MAKE_STATIC_STRING("xmm23"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm24"), ZYDIS_MAKE_STATIC_STRING("xmm25"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm26"), ZYDIS_MAKE_STATIC_STRING("xmm27"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm28"), ZYDIS_MAKE_STATIC_STRING("xmm29"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xmm30"), ZYDIS_MAKE_STATIC_STRING("xmm31"),
|
||||
// Floating point vector registers 256-bit
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm0"), ZYDIS_MAKE_STATIC_STRING("ymm1"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm2"), ZYDIS_MAKE_STATIC_STRING("ymm3"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm4"), ZYDIS_MAKE_STATIC_STRING("ymm5"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm6"), ZYDIS_MAKE_STATIC_STRING("ymm7"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm8"), ZYDIS_MAKE_STATIC_STRING("ymm9"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm10"), ZYDIS_MAKE_STATIC_STRING("ymm11"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm12"), ZYDIS_MAKE_STATIC_STRING("ymm13"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm14"), ZYDIS_MAKE_STATIC_STRING("ymm15"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm16"), ZYDIS_MAKE_STATIC_STRING("ymm17"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm18"), ZYDIS_MAKE_STATIC_STRING("ymm19"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm20"), ZYDIS_MAKE_STATIC_STRING("ymm21"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm22"), ZYDIS_MAKE_STATIC_STRING("ymm23"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm24"), ZYDIS_MAKE_STATIC_STRING("ymm25"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm26"), ZYDIS_MAKE_STATIC_STRING("ymm27"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm28"), ZYDIS_MAKE_STATIC_STRING("ymm29"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ymm30"), ZYDIS_MAKE_STATIC_STRING("ymm31"),
|
||||
// Floating point vector registers 512-bit
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm0"), ZYDIS_MAKE_STATIC_STRING("zmm1"),
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm2"), ZYDIS_MAKE_STATIC_STRING("zmm3"),
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm4"), ZYDIS_MAKE_STATIC_STRING("zmm5"),
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm6"), ZYDIS_MAKE_STATIC_STRING("zmm7"),
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm8"), ZYDIS_MAKE_STATIC_STRING("zmm9"),
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm10"), ZYDIS_MAKE_STATIC_STRING("zmm11"),
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm12"), ZYDIS_MAKE_STATIC_STRING("zmm13"),
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm14"), ZYDIS_MAKE_STATIC_STRING("zmm15"),
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm16"), ZYDIS_MAKE_STATIC_STRING("zmm17"),
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm18"), ZYDIS_MAKE_STATIC_STRING("zmm19"),
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm20"), ZYDIS_MAKE_STATIC_STRING("zmm21"),
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm22"), ZYDIS_MAKE_STATIC_STRING("zmm23"),
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm24"), ZYDIS_MAKE_STATIC_STRING("zmm25"),
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm26"), ZYDIS_MAKE_STATIC_STRING("zmm27"),
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm28"), ZYDIS_MAKE_STATIC_STRING("zmm29"),
|
||||
ZYDIS_MAKE_STATIC_STRING("zmm30"), ZYDIS_MAKE_STATIC_STRING("zmm31"),
|
||||
// Flags registers
|
||||
ZYDIS_MAKE_STATIC_STRING("flags"), ZYDIS_MAKE_STATIC_STRING("eflags"),
|
||||
ZYDIS_MAKE_STATIC_STRING("rflags"),
|
||||
// Instruction-pointer registers
|
||||
ZYDIS_MAKE_STATIC_STRING("ip"), ZYDIS_MAKE_STATIC_STRING("eip"),
|
||||
ZYDIS_MAKE_STATIC_STRING("rip"),
|
||||
// Segment registers
|
||||
ZYDIS_MAKE_STATIC_STRING("es"), ZYDIS_MAKE_STATIC_STRING("cs"),
|
||||
ZYDIS_MAKE_STATIC_STRING("ss"), ZYDIS_MAKE_STATIC_STRING("ds"),
|
||||
ZYDIS_MAKE_STATIC_STRING("fs"), ZYDIS_MAKE_STATIC_STRING("gs"),
|
||||
// Table registers
|
||||
ZYDIS_MAKE_STATIC_STRING("gdtr"), ZYDIS_MAKE_STATIC_STRING("ldtr"),
|
||||
ZYDIS_MAKE_STATIC_STRING("idtr"), ZYDIS_MAKE_STATIC_STRING("tr"),
|
||||
// Test registers
|
||||
ZYDIS_MAKE_STATIC_STRING("tr0"), ZYDIS_MAKE_STATIC_STRING("tr1"),
|
||||
ZYDIS_MAKE_STATIC_STRING("tr2"), ZYDIS_MAKE_STATIC_STRING("tr3"),
|
||||
ZYDIS_MAKE_STATIC_STRING("tr4"), ZYDIS_MAKE_STATIC_STRING("tr5"),
|
||||
ZYDIS_MAKE_STATIC_STRING("tr6"), ZYDIS_MAKE_STATIC_STRING("tr7"),
|
||||
// Control registers
|
||||
ZYDIS_MAKE_STATIC_STRING("cr0"), ZYDIS_MAKE_STATIC_STRING("cr1"),
|
||||
ZYDIS_MAKE_STATIC_STRING("cr2"), ZYDIS_MAKE_STATIC_STRING("cr3"),
|
||||
ZYDIS_MAKE_STATIC_STRING("cr4"), ZYDIS_MAKE_STATIC_STRING("cr5"),
|
||||
ZYDIS_MAKE_STATIC_STRING("cr6"), ZYDIS_MAKE_STATIC_STRING("cr7"),
|
||||
ZYDIS_MAKE_STATIC_STRING("cr8"), ZYDIS_MAKE_STATIC_STRING("cr9"),
|
||||
ZYDIS_MAKE_STATIC_STRING("cr10"), ZYDIS_MAKE_STATIC_STRING("cr11"),
|
||||
ZYDIS_MAKE_STATIC_STRING("cr12"), ZYDIS_MAKE_STATIC_STRING("cr13"),
|
||||
ZYDIS_MAKE_STATIC_STRING("cr14"), ZYDIS_MAKE_STATIC_STRING("cr15"),
|
||||
// Debug registers
|
||||
ZYDIS_MAKE_STATIC_STRING("dr0"), ZYDIS_MAKE_STATIC_STRING("dr1"),
|
||||
ZYDIS_MAKE_STATIC_STRING("dr2"), ZYDIS_MAKE_STATIC_STRING("dr3"),
|
||||
ZYDIS_MAKE_STATIC_STRING("dr4"), ZYDIS_MAKE_STATIC_STRING("dr5"),
|
||||
ZYDIS_MAKE_STATIC_STRING("dr6"), ZYDIS_MAKE_STATIC_STRING("dr7"),
|
||||
ZYDIS_MAKE_STATIC_STRING("dr8"), ZYDIS_MAKE_STATIC_STRING("dr9"),
|
||||
ZYDIS_MAKE_STATIC_STRING("dr10"), ZYDIS_MAKE_STATIC_STRING("dr11"),
|
||||
ZYDIS_MAKE_STATIC_STRING("dr12"), ZYDIS_MAKE_STATIC_STRING("dr13"),
|
||||
ZYDIS_MAKE_STATIC_STRING("dr14"), ZYDIS_MAKE_STATIC_STRING("dr15"),
|
||||
// Mask registers
|
||||
ZYDIS_MAKE_STATIC_STRING("k0"), ZYDIS_MAKE_STATIC_STRING("k1"),
|
||||
ZYDIS_MAKE_STATIC_STRING("k2"), ZYDIS_MAKE_STATIC_STRING("k3"),
|
||||
ZYDIS_MAKE_STATIC_STRING("k4"), ZYDIS_MAKE_STATIC_STRING("k5"),
|
||||
ZYDIS_MAKE_STATIC_STRING("k6"), ZYDIS_MAKE_STATIC_STRING("k7"),
|
||||
// Bound registers
|
||||
ZYDIS_MAKE_STATIC_STRING("bnd0"), ZYDIS_MAKE_STATIC_STRING("bnd1"),
|
||||
ZYDIS_MAKE_STATIC_STRING("bnd2"), ZYDIS_MAKE_STATIC_STRING("bnd3"),
|
||||
ZYDIS_MAKE_STATIC_STRING("bndcfg"), ZYDIS_MAKE_STATIC_STRING("bndstatus"),
|
||||
// Misc registers
|
||||
ZYDIS_MAKE_STATIC_STRING("mxcsr"), ZYDIS_MAKE_STATIC_STRING("pkru"),
|
||||
ZYDIS_MAKE_STATIC_STRING("xcr0")
|
||||
};
|
||||
#include <Generated/EnumRegister.inc>
|
||||
|
||||
/* ============================================================================================== */
|
||||
/* Register-class mapping */
|
||||
|
@ -207,8 +57,8 @@ static const struct ZydisRegisterMapItem registerMap[] =
|
|||
{ ZYDIS_REGCLASS_XMM , ZYDIS_REGISTER_XMM0 , ZYDIS_REGISTER_XMM31 , 128 , 128 },
|
||||
{ ZYDIS_REGCLASS_YMM , ZYDIS_REGISTER_YMM0 , ZYDIS_REGISTER_YMM31 , 256 , 256 },
|
||||
{ ZYDIS_REGCLASS_ZMM , ZYDIS_REGISTER_ZMM0 , ZYDIS_REGISTER_ZMM31 , 512 , 512 },
|
||||
{ ZYDIS_REGCLASS_FLAGS , ZYDIS_REGISTER_RFLAGS , ZYDIS_REGISTER_FLAGS , 0 , 0 },
|
||||
{ ZYDIS_REGCLASS_IP , ZYDIS_REGISTER_RIP , ZYDIS_REGISTER_IP , 0 , 0 },
|
||||
{ ZYDIS_REGCLASS_FLAGS , ZYDIS_REGISTER_FLAGS , ZYDIS_REGISTER_RFLAGS , 0 , 0 },
|
||||
{ ZYDIS_REGCLASS_IP , ZYDIS_REGISTER_IP , ZYDIS_REGISTER_RIP , 0 , 0 },
|
||||
{ ZYDIS_REGCLASS_SEGMENT , ZYDIS_REGISTER_ES , ZYDIS_REGISTER_GS , 16 , 16 },
|
||||
{ ZYDIS_REGCLASS_TEST , ZYDIS_REGISTER_TR0 , ZYDIS_REGISTER_TR7 , 32 , 32 },
|
||||
{ ZYDIS_REGCLASS_CONTROL , ZYDIS_REGISTER_CR0 , ZYDIS_REGISTER_CR15 , 32 , 64 },
|
||||
|
@ -333,20 +183,20 @@ ZydisRegisterWidth ZydisRegisterGetWidth64(ZydisRegister reg)
|
|||
|
||||
const char* ZydisRegisterGetString(ZydisRegister reg)
|
||||
{
|
||||
if (reg >= ZYDIS_ARRAY_SIZE(registerStrings))
|
||||
if (reg >= ZYDIS_ARRAY_SIZE(zydisRegisterStrings))
|
||||
{
|
||||
return ZYDIS_NULL;
|
||||
}
|
||||
return registerStrings[reg].buffer;
|
||||
return zydisRegisterStrings[reg].buffer;
|
||||
}
|
||||
|
||||
const ZydisStaticString* ZydisRegisterGetStaticString(ZydisRegister reg)
|
||||
{
|
||||
if (reg >= ZYDIS_ARRAY_SIZE(registerStrings))
|
||||
if (reg >= ZYDIS_ARRAY_SIZE(zydisRegisterStrings))
|
||||
{
|
||||
return ZYDIS_NULL;
|
||||
}
|
||||
return ®isterStrings[reg];
|
||||
return &zydisRegisterStrings[reg];
|
||||
}
|
||||
|
||||
/* ============================================================================================== */
|
||||
|
|
122
src/String.c
122
src/String.c
|
@ -2,7 +2,7 @@
|
|||
|
||||
Zyan Disassembler Library (Zydis)
|
||||
|
||||
Original Author : Florian Bernd, Joel Höner
|
||||
Original Author : Florian Bernd, Joel Hoener
|
||||
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -66,7 +66,7 @@ static const char* decimalLookup =
|
|||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
||||
#if defined(ZYDIS_X86) || defined(ZYDIS_ARM)
|
||||
ZydisStatus ZydisPrintDecU32(ZydisString* string, ZydisU32 value, ZydisU8 paddingLength)
|
||||
ZydisStatus ZydisStringAppendDecU32(ZydisString* string, ZydisU32 value, ZydisU8 paddingLength)
|
||||
{
|
||||
ZYDIS_ASSERT(string);
|
||||
ZYDIS_ASSERT(string->buffer);
|
||||
|
@ -103,7 +103,7 @@ ZydisStatus ZydisPrintDecU32(ZydisString* string, ZydisU32 value, ZydisU8 paddin
|
|||
return ZYDIS_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
ZydisStatus ZydisPrintHexU32(ZydisString* string, ZydisU32 value, ZydisU8 paddingLength,
|
||||
ZydisStatus ZydisStringAppendHexU32(ZydisString* string, ZydisU32 value, ZydisU8 paddingLength,
|
||||
ZydisBool uppercase, const ZydisString* prefix, const ZydisString* suffix)
|
||||
{
|
||||
ZYDIS_ASSERT(string);
|
||||
|
@ -176,7 +176,7 @@ ZydisStatus ZydisPrintHexU32(ZydisString* string, ZydisU32 value, ZydisU8 paddin
|
|||
}
|
||||
#endif
|
||||
|
||||
ZydisStatus ZydisPrintDecU64(ZydisString* string, ZydisU64 value, ZydisU8 paddingLength)
|
||||
ZydisStatus ZydisStringAppendDecU64(ZydisString* string, ZydisU64 value, ZydisU8 paddingLength)
|
||||
{
|
||||
ZYDIS_ASSERT(string);
|
||||
ZYDIS_ASSERT(string->buffer);
|
||||
|
@ -213,7 +213,7 @@ ZydisStatus ZydisPrintDecU64(ZydisString* string, ZydisU64 value, ZydisU8 paddin
|
|||
return ZYDIS_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
ZydisStatus ZydisPrintHexU64(ZydisString* string, ZydisU64 value, ZydisU8 paddingLength,
|
||||
ZydisStatus ZydisStringAppendHexU64(ZydisString* string, ZydisU64 value, ZydisU8 paddingLength,
|
||||
ZydisBool uppercase, const ZydisString* prefix, const ZydisString* suffix)
|
||||
{
|
||||
ZYDIS_ASSERT(string);
|
||||
|
@ -297,6 +297,43 @@ ZydisStatus ZydisPrintHexU64(ZydisString* string, ZydisU64 value, ZydisU8 paddin
|
|||
/* Basic Operations */
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
||||
ZydisStatus ZydisStringInit(ZydisString* string, char* text)
|
||||
{
|
||||
if (!string || !text)
|
||||
{
|
||||
return ZYDIS_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
const ZydisUSize length = ZydisStrLen(text);
|
||||
string->buffer = text;
|
||||
string->length = length;
|
||||
string->capacity = length;
|
||||
|
||||
return ZYDIS_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
ZydisStatus ZydisStringFinalize(ZydisString* string)
|
||||
{
|
||||
if (!string)
|
||||
{
|
||||
return ZYDIS_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
if (string->length >= string->capacity)
|
||||
{
|
||||
return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE;
|
||||
}
|
||||
|
||||
string->buffer[string->length] = 0;
|
||||
return ZYDIS_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
||||
ZydisStatus ZydisStringAppend(ZydisString* string, const ZydisString* text)
|
||||
{
|
||||
return ZydisStringAppendEx(string, text, ZYDIS_LETTER_CASE_DEFAULT);
|
||||
}
|
||||
|
||||
ZydisStatus ZydisStringAppendEx(ZydisString* string, const ZydisString* text,
|
||||
ZydisLetterCase letterCase)
|
||||
{
|
||||
|
@ -351,52 +388,99 @@ ZydisStatus ZydisStringAppendEx(ZydisString* string, const ZydisString* text,
|
|||
return ZYDIS_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
ZydisStatus ZydisStringAppendC(ZydisString* string, const char* text)
|
||||
{
|
||||
ZydisString other;
|
||||
ZYDIS_CHECK(ZydisStringInit(&other, (char*)text));
|
||||
|
||||
return ZydisStringAppendEx(string, &other, ZYDIS_LETTER_CASE_DEFAULT);
|
||||
}
|
||||
|
||||
ZydisStatus ZydisStringAppendExC(ZydisString* string, const char* text, ZydisLetterCase letterCase)
|
||||
{
|
||||
ZydisString other;
|
||||
ZYDIS_CHECK(ZydisStringInit(&other, (char*)text));
|
||||
|
||||
return ZydisStringAppendEx(string, &other, letterCase);
|
||||
}
|
||||
|
||||
ZydisStatus ZydisStringAppendStatic(ZydisString* string, const ZydisStaticString* text,
|
||||
ZydisLetterCase letterCase)
|
||||
{
|
||||
if (!text || !text->buffer)
|
||||
{
|
||||
return ZYDIS_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
ZydisString other;
|
||||
other.buffer = (char*)text->buffer;
|
||||
other.length = text->length;
|
||||
|
||||
return ZydisStringAppendEx(string, &other, letterCase);
|
||||
}
|
||||
|
||||
ZydisStatus ZydisStringAppendExStatic(ZydisString* string, const ZydisStaticString* text,
|
||||
ZydisLetterCase letterCase)
|
||||
{
|
||||
if (!text || !text->buffer)
|
||||
{
|
||||
return ZYDIS_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
ZydisString other;
|
||||
other.buffer = (char*)text->buffer;
|
||||
other.length = text->length;
|
||||
|
||||
return ZydisStringAppendEx(string, &other, letterCase);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
/* Formatting */
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
||||
ZydisStatus ZydisPrintDecU(ZydisString* string, ZydisU64 value, ZydisU8 paddingLength)
|
||||
ZydisStatus ZydisStringAppendDecU(ZydisString* string, ZydisU64 value, ZydisU8 paddingLength)
|
||||
{
|
||||
#if defined(ZYDIS_X64) || defined(ZYDIS_AARCH64)
|
||||
return ZydisPrintDecU64(string, value, paddingLength);
|
||||
return ZydisStringAppendDecU64(string, value, paddingLength);
|
||||
#else
|
||||
if (value & 0xFFFFFFFF00000000)
|
||||
{
|
||||
return ZydisPrintDecU64(string, value, paddingLength);
|
||||
return ZydisStringAppendDecU64(string, value, paddingLength);
|
||||
} else
|
||||
{
|
||||
return ZydisPrintDecU32(string, (ZydisU32)value, paddingLength);
|
||||
return ZydisStringAppendDecU32(string, (ZydisU32)value, paddingLength);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
ZydisStatus ZydisPrintDecS(ZydisString* string, ZydisI64 value, ZydisU8 paddingLength)
|
||||
ZydisStatus ZydisStringAppendDecS(ZydisString* string, ZydisI64 value, ZydisU8 paddingLength)
|
||||
{
|
||||
if (value < 0)
|
||||
{
|
||||
ZYDIS_CHECK(ZydisStringAppendC(string, "-"));
|
||||
return ZydisPrintDecU(string, -value, paddingLength);
|
||||
return ZydisStringAppendDecU(string, -value, paddingLength);
|
||||
}
|
||||
return ZydisPrintDecU(string, value, paddingLength);
|
||||
return ZydisStringAppendDecU(string, value, paddingLength);
|
||||
}
|
||||
|
||||
ZydisStatus ZydisPrintHexU(ZydisString* string, ZydisU64 value, ZydisU8 paddingLength,
|
||||
ZydisStatus ZydisStringAppendHexU(ZydisString* string, ZydisU64 value, ZydisU8 paddingLength,
|
||||
ZydisBool uppercase, const ZydisString* prefix, const ZydisString* suffix)
|
||||
{
|
||||
#if defined(ZYDIS_X64) || defined(ZYDIS_AARCH64)
|
||||
return ZydisPrintHexU64(string, value, paddingLength, uppercase, prefix, suffix);
|
||||
return ZydisStringAppendHexU64(string, value, paddingLength, uppercase, prefix, suffix);
|
||||
#else
|
||||
if (value & 0xFFFFFFFF00000000)
|
||||
{
|
||||
return ZydisPrintHexU64(string, value, paddingLength, uppercase, prefix, suffix);
|
||||
return ZydisStringAppendHexU64(string, value, paddingLength, uppercase, prefix, suffix);
|
||||
} else
|
||||
{
|
||||
return ZydisPrintHexU32(string, (ZydisU32)value, paddingLength, uppercase, prefix, suffix);
|
||||
return ZydisStringAppendHexU32(
|
||||
string, (ZydisU32)value, paddingLength, uppercase, prefix, suffix);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
ZydisStatus ZydisPrintHexS(ZydisString* string, ZydisI64 value, ZydisU8 paddingLength,
|
||||
ZydisStatus ZydisStringAppendHexS(ZydisString* string, ZydisI64 value, ZydisU8 paddingLength,
|
||||
ZydisBool uppercase, const ZydisString* prefix, const ZydisString* suffix)
|
||||
{
|
||||
if (value < 0)
|
||||
|
@ -406,9 +490,9 @@ ZydisStatus ZydisPrintHexS(ZydisString* string, ZydisI64 value, ZydisU8 paddingL
|
|||
{
|
||||
ZYDIS_CHECK(ZydisStringAppend(string, prefix));
|
||||
}
|
||||
return ZydisPrintHexU(string, -value, paddingLength, uppercase, ZYDIS_NULL, suffix);
|
||||
return ZydisStringAppendHexU(string, -value, paddingLength, uppercase, ZYDIS_NULL, suffix);
|
||||
}
|
||||
return ZydisPrintHexU(string, value, paddingLength, uppercase, prefix, suffix);
|
||||
return ZydisStringAppendHexU(string, value, paddingLength, uppercase, prefix, suffix);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
|
|
@ -50,7 +50,7 @@ ZydisStatus ZydisCalcAbsoluteAddress(const ZydisDecodedInstruction* instruction,
|
|||
}
|
||||
if (operand->mem.base == ZYDIS_REGISTER_EIP)
|
||||
{
|
||||
*address = (ZydisU64)((ZydisU32)instruction->instrAddress + instruction->length +
|
||||
*address = ((ZydisU32)instruction->instrAddress + instruction->length +
|
||||
(ZydisU32)operand->mem.disp.value);
|
||||
return ZYDIS_STATUS_SUCCESS;
|
||||
}
|
||||
|
|
Binary file not shown.
|
@ -1,8 +1,8 @@
|
|||
/***************************************************************************************************
|
||||
|
||||
Zyan Disassembler Engine (Zydis)
|
||||
Zyan Disassembler Library (Zydis)
|
||||
|
||||
Original Author : Florian Bernd, Joel Höner
|
||||
Original Author : Florian Bernd, Joel Hoener
|
||||
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
Loading…
Reference in New Issue