mirror of https://github.com/x64dbg/zydis
Fixed CMake file
This commit is contained in:
parent
7c9a6db6af
commit
52dd9fac89
|
@ -1,4 +1,5 @@
|
||||||
cmake_minimum_required(VERSION 2.8.12)
|
cmake_minimum_required(VERSION 2.8.12)
|
||||||
|
cmake_policy(SET CMP0054 NEW)
|
||||||
include(GenerateExportHeader)
|
include(GenerateExportHeader)
|
||||||
|
|
||||||
project(Zydis)
|
project(Zydis)
|
||||||
|
@ -12,28 +13,25 @@ option(BUILD_EXAMPLES "Build examples" TRUE)
|
||||||
option(BUILD_TOOLS "Build tools")
|
option(BUILD_TOOLS "Build tools")
|
||||||
|
|
||||||
if (NOT CONFIGURED_ONCE)
|
if (NOT CONFIGURED_ONCE)
|
||||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR
|
if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR
|
||||||
"${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
"${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
|
||||||
set(compiler_specific "-std=c99 -pedantic -Wextra -Werror")
|
set(compiler_specific "-std=c99 -pedantic -Wextra -Werror")
|
||||||
elseif (MSVC)
|
elseif (MSVC)
|
||||||
set(compiler_specific "/WX /W4 /D_CRT_SECURE_NO_WARNINGS /TC")
|
set(compiler_specific "/WX /W4 /D_CRT_SECURE_NO_WARNINGS /TC")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${compiler_specific} ${compiler_specific_cxx}"
|
|
||||||
CACHE STRING "Flags used by the compiler during all build types." FORCE)
|
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${compiler_specific}"
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${compiler_specific}"
|
||||||
CACHE STRING "Flags used by the compiler during all build types." FORCE)
|
CACHE STRING "Flags used by the compiler during all build types." FORCE)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
# CMake always orders MSVC to build with a shared CRT. Hack CMake variables in order
|
# CMake always orders MSVC to build with a shared CRT. Hack CMake variables in order
|
||||||
# to generate with a statically linked CRT when we build as a static library.
|
# to generate with a statically linked CRT when we build as a static library.
|
||||||
if (MSVC AND NOT FORCE_SHARED_CRT)
|
if (("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC") AND NOT FORCE_SHARED_CRT)
|
||||||
foreach(flag_var
|
foreach(flag_var
|
||||||
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
|
CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
|
||||||
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
|
CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO)
|
||||||
if(${flag_var} MATCHES "/MD")
|
if(${flag_var} MATCHES "/MD")
|
||||||
string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
|
string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
|
||||||
endif(${flag_var} MATCHES "/MD")
|
endif ()
|
||||||
endforeach(flag_var)
|
endforeach(flag_var)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
@ -66,7 +64,7 @@ if (BUILD_SHARED_LIBS AND WIN32)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
add_library("Zydis" ${headers} ${sources})
|
add_library("Zydis" ${headers} ${sources})
|
||||||
set_target_properties("Zydis" PROPERTIES COMPILE_DEFINITIONS "Zydis_EXPORTS")
|
set_target_properties("Zydis" PROPERTIES COMPILE_DEFINITIONS "ZYDIS_EXPORTS")
|
||||||
generate_export_header(
|
generate_export_header(
|
||||||
"Zydis"
|
"Zydis"
|
||||||
BASE_NAME "ZYDIS"
|
BASE_NAME "ZYDIS"
|
||||||
|
|
|
@ -13,7 +13,11 @@ Fast and lightweight x86/x86-64 disassembler library.
|
||||||
- ADX, BMI1, BMI2, FMA, FMA4
|
- ADX, BMI1, BMI2, FMA, FMA4
|
||||||
- ..
|
- ..
|
||||||
- Optimized for high performance
|
- Optimized for high performance
|
||||||
- Very small overhead compared to other common disassembler libraries
|
- No dynamic memory allocation
|
||||||
|
- Perfect for kernel-mode drivers and embedded devices
|
||||||
|
- Very small file-size overhead compared to other common disassembler libraries
|
||||||
|
- Language bindings
|
||||||
|
- C++, Delphi, Python, ..
|
||||||
- Complete doxygen documentation
|
- Complete doxygen documentation
|
||||||
|
|
||||||
## Quick Example ##
|
## Quick Example ##
|
||||||
|
|
|
@ -104,7 +104,7 @@ typedef struct ZydisInstructionDecoder_
|
||||||
*
|
*
|
||||||
* @return A zydis status code.
|
* @return A zydis status code.
|
||||||
*/
|
*/
|
||||||
ZYDIS_DLLEXTERN ZydisStatus ZydisDecoderInitInstructionDecoder(ZydisInstructionDecoder* decoder,
|
ZYDIS_EXPORT ZydisStatus ZydisDecoderInitInstructionDecoder(ZydisInstructionDecoder* decoder,
|
||||||
ZydisDisassemblerMode disassemblerMode, ZydisCustomInput* input);
|
ZydisDisassemblerMode disassemblerMode, ZydisCustomInput* input);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -117,7 +117,7 @@ ZYDIS_DLLEXTERN ZydisStatus ZydisDecoderInitInstructionDecoder(ZydisInstructionD
|
||||||
*
|
*
|
||||||
* @return A zydis status code.
|
* @return A zydis status code.
|
||||||
*/
|
*/
|
||||||
ZYDIS_DLLEXTERN ZydisStatus ZydisDecoderInitInstructionDecoderEx(ZydisInstructionDecoder* decoder,
|
ZYDIS_EXPORT ZydisStatus ZydisDecoderInitInstructionDecoderEx(ZydisInstructionDecoder* decoder,
|
||||||
ZydisDisassemblerMode disassemblerMode, ZydisCustomInput* input, ZydisDecoderFlags flags);
|
ZydisDisassemblerMode disassemblerMode, ZydisCustomInput* input, ZydisDecoderFlags flags);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -129,7 +129,7 @@ ZYDIS_DLLEXTERN ZydisStatus ZydisDecoderInitInstructionDecoderEx(ZydisInstructio
|
||||||
*
|
*
|
||||||
* @return A zydis status code.
|
* @return A zydis status code.
|
||||||
*/
|
*/
|
||||||
ZYDIS_DLLEXTERN ZydisStatus ZydisDecoderGetDisassemblerMode(const ZydisInstructionDecoder* decoder,
|
ZYDIS_EXPORT ZydisStatus ZydisDecoderGetDisassemblerMode(const ZydisInstructionDecoder* decoder,
|
||||||
ZydisDisassemblerMode* disassemblerMode);
|
ZydisDisassemblerMode* disassemblerMode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -140,7 +140,7 @@ ZYDIS_DLLEXTERN ZydisStatus ZydisDecoderGetDisassemblerMode(const ZydisInstructi
|
||||||
*
|
*
|
||||||
* @return A zydis status code.
|
* @return A zydis status code.
|
||||||
*/
|
*/
|
||||||
ZYDIS_DLLEXTERN ZydisStatus ZydisDecoderSetDisassemblerMode(ZydisInstructionDecoder* decoder,
|
ZYDIS_EXPORT ZydisStatus ZydisDecoderSetDisassemblerMode(ZydisInstructionDecoder* decoder,
|
||||||
ZydisDisassemblerMode disassemblerMode);
|
ZydisDisassemblerMode disassemblerMode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -152,7 +152,7 @@ ZYDIS_DLLEXTERN ZydisStatus ZydisDecoderSetDisassemblerMode(ZydisInstructionDeco
|
||||||
*
|
*
|
||||||
* @return A zydis status code.
|
* @return A zydis status code.
|
||||||
*/
|
*/
|
||||||
ZYDIS_DLLEXTERN ZydisStatus ZydisDecoderGetDecoderInput(const ZydisInstructionDecoder* decoder,
|
ZYDIS_EXPORT ZydisStatus ZydisDecoderGetDecoderInput(const ZydisInstructionDecoder* decoder,
|
||||||
ZydisCustomInput** input);
|
ZydisCustomInput** input);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -163,7 +163,7 @@ ZYDIS_DLLEXTERN ZydisStatus ZydisDecoderGetDecoderInput(const ZydisInstructionDe
|
||||||
*
|
*
|
||||||
* @return A zydis status code.
|
* @return A zydis status code.
|
||||||
*/
|
*/
|
||||||
ZYDIS_DLLEXTERN ZydisStatus ZydisDecoderSetDecoderInput(ZydisInstructionDecoder* decoder,
|
ZYDIS_EXPORT ZydisStatus ZydisDecoderSetDecoderInput(ZydisInstructionDecoder* decoder,
|
||||||
ZydisCustomInput* input);
|
ZydisCustomInput* input);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -174,7 +174,7 @@ ZYDIS_DLLEXTERN ZydisStatus ZydisDecoderSetDecoderInput(ZydisInstructionDecoder*
|
||||||
*
|
*
|
||||||
* @return A zydis status code.
|
* @return A zydis status code.
|
||||||
*/
|
*/
|
||||||
ZYDIS_DLLEXTERN ZydisStatus ZydisDecoderGetDecoderFlags(const ZydisInstructionDecoder* decoder,
|
ZYDIS_EXPORT ZydisStatus ZydisDecoderGetDecoderFlags(const ZydisInstructionDecoder* decoder,
|
||||||
ZydisDecoderFlags* flags);
|
ZydisDecoderFlags* flags);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -185,7 +185,7 @@ ZYDIS_DLLEXTERN ZydisStatus ZydisDecoderGetDecoderFlags(const ZydisInstructionDe
|
||||||
*
|
*
|
||||||
* @return A zydis status code.
|
* @return A zydis status code.
|
||||||
*/
|
*/
|
||||||
ZYDIS_DLLEXTERN ZydisStatus ZydisDecoderSetDecoderFlags(ZydisInstructionDecoder* decoder,
|
ZYDIS_EXPORT ZydisStatus ZydisDecoderSetDecoderFlags(ZydisInstructionDecoder* decoder,
|
||||||
ZydisDecoderFlags flags);
|
ZydisDecoderFlags flags);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -198,7 +198,7 @@ ZYDIS_DLLEXTERN ZydisStatus ZydisDecoderSetDecoderFlags(ZydisInstructionDecoder*
|
||||||
*
|
*
|
||||||
* @return A zydis status code.
|
* @return A zydis status code.
|
||||||
*/
|
*/
|
||||||
ZYDIS_DLLEXTERN ZydisStatus ZydisDecoderGetInstructionPointer(
|
ZYDIS_EXPORT ZydisStatus ZydisDecoderGetInstructionPointer(
|
||||||
const ZydisInstructionDecoder* decoder, uint64_t* instructionPointer);
|
const ZydisInstructionDecoder* decoder, uint64_t* instructionPointer);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -209,7 +209,7 @@ ZYDIS_DLLEXTERN ZydisStatus ZydisDecoderGetInstructionPointer(
|
||||||
*
|
*
|
||||||
* @return A zydis status code.
|
* @return A zydis status code.
|
||||||
*/
|
*/
|
||||||
ZYDIS_DLLEXTERN ZydisStatus ZydisDecoderSetInstructionPointer(ZydisInstructionDecoder* decoder,
|
ZYDIS_EXPORT ZydisStatus ZydisDecoderSetInstructionPointer(ZydisInstructionDecoder* decoder,
|
||||||
uint64_t instructionPointer);
|
uint64_t instructionPointer);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -221,7 +221,7 @@ ZYDIS_DLLEXTERN ZydisStatus ZydisDecoderSetInstructionPointer(ZydisInstructionDe
|
||||||
*
|
*
|
||||||
* @return A zydis status code.
|
* @return A zydis status code.
|
||||||
*/
|
*/
|
||||||
ZYDIS_DLLEXTERN ZydisStatus ZydisDecoderDecodeNextInstruction(ZydisInstructionDecoder* decoder,
|
ZYDIS_EXPORT ZydisStatus ZydisDecoderDecodeNextInstruction(ZydisInstructionDecoder* decoder,
|
||||||
ZydisInstructionInfo* info);
|
ZydisInstructionInfo* info);
|
||||||
|
|
||||||
/* ============================================================================================== */
|
/* ============================================================================================== */
|
||||||
|
|
|
@ -27,6 +27,8 @@
|
||||||
#ifndef ZYDIS_DEFINES_H
|
#ifndef ZYDIS_DEFINES_H
|
||||||
#define ZYDIS_DEFINES_H
|
#define ZYDIS_DEFINES_H
|
||||||
|
|
||||||
|
#include <ZydisExportConfig.h>
|
||||||
|
|
||||||
/* ============================================================================================== */
|
/* ============================================================================================== */
|
||||||
/* Compiler detection */
|
/* Compiler detection */
|
||||||
/* ============================================================================================== */
|
/* ============================================================================================== */
|
||||||
|
@ -110,20 +112,6 @@
|
||||||
# define ZYDIS_INLINE static inline
|
# define ZYDIS_INLINE static inline
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* ============================================================================================== */
|
|
||||||
/* Dynamic linkage macros */
|
|
||||||
/* ============================================================================================== */
|
|
||||||
|
|
||||||
#if defined(ZYDIS_MSVC) && defined(ZYDIS_DYNAMIC)
|
|
||||||
# ifdef ZYDIS_EXPORTS
|
|
||||||
# define ZYDIS_DLLEXTERN __declspec(dllexport)
|
|
||||||
# else
|
|
||||||
# define ZYDIS_DLLEXTERN __declspec(dllimport)
|
|
||||||
# endif
|
|
||||||
#else
|
|
||||||
# define ZYDIS_DLLEXTERN
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* ============================================================================================== */
|
/* ============================================================================================== */
|
||||||
/* Debugging macros */
|
/* Debugging macros */
|
||||||
/* ============================================================================================== */
|
/* ============================================================================================== */
|
||||||
|
|
|
@ -192,7 +192,7 @@ typedef struct ZydisInstructionFormatter_
|
||||||
*
|
*
|
||||||
* @return A zydis status code.
|
* @return A zydis status code.
|
||||||
*/
|
*/
|
||||||
ZYDIS_DLLEXTERN ZydisStatus ZydisFormatterInitInstructionFormatter(
|
ZYDIS_EXPORT ZydisStatus ZydisFormatterInitInstructionFormatter(
|
||||||
ZydisInstructionFormatter* formatter, ZydisFormatterStyle style);
|
ZydisInstructionFormatter* formatter, ZydisFormatterStyle style);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -204,7 +204,7 @@ ZYDIS_DLLEXTERN ZydisStatus ZydisFormatterInitInstructionFormatter(
|
||||||
*
|
*
|
||||||
* @return A zydis status code.
|
* @return A zydis status code.
|
||||||
*/
|
*/
|
||||||
ZYDIS_DLLEXTERN ZydisStatus ZydisFormatterInitInstructionFormatterEx(
|
ZYDIS_EXPORT ZydisStatus ZydisFormatterInitInstructionFormatterEx(
|
||||||
ZydisInstructionFormatter* formatter, ZydisFormatterStyle style, ZydisFormatterFlags flags);
|
ZydisInstructionFormatter* formatter, ZydisFormatterStyle style, ZydisFormatterFlags flags);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -216,7 +216,7 @@ ZYDIS_DLLEXTERN ZydisStatus ZydisFormatterInitInstructionFormatterEx(
|
||||||
*
|
*
|
||||||
* @return A zydis status code.
|
* @return A zydis status code.
|
||||||
*/
|
*/
|
||||||
ZYDIS_DLLEXTERN ZydisStatus ZydisFormatterGetSymbolResolver(
|
ZYDIS_EXPORT ZydisStatus ZydisFormatterGetSymbolResolver(
|
||||||
const ZydisInstructionFormatter* formatter, ZydisCustomSymbolResolver** symbolResolver);
|
const ZydisInstructionFormatter* formatter, ZydisCustomSymbolResolver** symbolResolver);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -227,7 +227,7 @@ ZYDIS_DLLEXTERN ZydisStatus ZydisFormatterGetSymbolResolver(
|
||||||
*
|
*
|
||||||
* @return The ZydisStatus.
|
* @return The ZydisStatus.
|
||||||
*/
|
*/
|
||||||
ZYDIS_DLLEXTERN ZydisStatus ZydisFormatterSetSymbolResolver(
|
ZYDIS_EXPORT ZydisStatus ZydisFormatterSetSymbolResolver(
|
||||||
ZydisInstructionFormatter* formatter, ZydisCustomSymbolResolver* symbolResolver);
|
ZydisInstructionFormatter* formatter, ZydisCustomSymbolResolver* symbolResolver);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -240,7 +240,7 @@ ZYDIS_DLLEXTERN ZydisStatus ZydisFormatterSetSymbolResolver(
|
||||||
*
|
*
|
||||||
* @return A zydis status code.
|
* @return A zydis status code.
|
||||||
*/
|
*/
|
||||||
ZYDIS_DLLEXTERN ZydisStatus ZydisFormatterFormatInstruction(
|
ZYDIS_EXPORT ZydisStatus ZydisFormatterFormatInstruction(
|
||||||
ZydisInstructionFormatter* formatter, const ZydisInstructionInfo* info, char* buffer,
|
ZydisInstructionFormatter* formatter, const ZydisInstructionInfo* info, char* buffer,
|
||||||
size_t bufferLen);
|
size_t bufferLen);
|
||||||
|
|
||||||
|
|
|
@ -116,7 +116,7 @@ typedef struct ZydisMemoryInput_
|
||||||
*
|
*
|
||||||
* @return A zydis status code.
|
* @return A zydis status code.
|
||||||
*/
|
*/
|
||||||
ZYDIS_DLLEXTERN ZydisStatus ZydisInputInitMemoryInput(ZydisMemoryInput* input, const void* buffer,
|
ZYDIS_EXPORT ZydisStatus ZydisInputInitMemoryInput(ZydisMemoryInput* input, const void* buffer,
|
||||||
uint64_t length);
|
uint64_t length);
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------------------------------- */
|
||||||
|
@ -159,7 +159,7 @@ typedef struct ZydisFileInput_
|
||||||
*
|
*
|
||||||
* @return A zydis status code.
|
* @return A zydis status code.
|
||||||
*/
|
*/
|
||||||
ZYDIS_DLLEXTERN ZydisStatus ZydisInputInitFileInput(ZydisFileInput* input, FILE* file);
|
ZYDIS_EXPORT ZydisStatus ZydisInputInitFileInput(ZydisFileInput* input, FILE* file);
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ enum ZydisInstructionMnemonics
|
||||||
*
|
*
|
||||||
* @return The instruction mnemonic string or @c NULL, if an invalid mnemonic was passed.
|
* @return The instruction mnemonic string or @c NULL, if an invalid mnemonic was passed.
|
||||||
*/
|
*/
|
||||||
ZYDIS_DLLEXTERN const char* ZydisMnemonicGetString(ZydisInstructionMnemonic mnemonic);
|
ZYDIS_EXPORT const char* ZydisMnemonicGetString(ZydisInstructionMnemonic mnemonic);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Replaces the string representation of the given mnemonic with a new value.
|
* @brief Replaces the string representation of the given mnemonic with a new value.
|
||||||
|
@ -73,7 +73,7 @@ ZYDIS_DLLEXTERN const char* ZydisMnemonicGetString(ZydisInstructionMnemonic mnem
|
||||||
*
|
*
|
||||||
* @return A zydis status code.
|
* @return A zydis status code.
|
||||||
*/
|
*/
|
||||||
ZYDIS_DLLEXTERN ZydisStatus ZydisMnemonicReplaceString(ZydisInstructionMnemonic mnemonic,
|
ZYDIS_EXPORT ZydisStatus ZydisMnemonicReplaceString(ZydisInstructionMnemonic mnemonic,
|
||||||
const char* mnemonicString);
|
const char* mnemonicString);
|
||||||
|
|
||||||
/* ============================================================================================== */
|
/* ============================================================================================== */
|
||||||
|
|
|
@ -194,7 +194,7 @@ enum ZydisRegisterSizes
|
||||||
*
|
*
|
||||||
* @return The register specified by the @c registerClass and the @c id.
|
* @return The register specified by the @c registerClass and the @c id.
|
||||||
*/
|
*/
|
||||||
ZYDIS_DLLEXTERN ZydisRegister ZydisRegisterGetById(ZydisRegisterClass registerClass, uint8_t id);
|
ZYDIS_EXPORT ZydisRegister ZydisRegisterGetById(ZydisRegisterClass registerClass, uint8_t id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Returns the specified register string.
|
* @brief Returns the specified register string.
|
||||||
|
@ -203,7 +203,7 @@ ZYDIS_DLLEXTERN ZydisRegister ZydisRegisterGetById(ZydisRegisterClass registerCl
|
||||||
*
|
*
|
||||||
* @return The register string or @c NULL, if an invalid register was passed.
|
* @return The register string or @c NULL, if an invalid register was passed.
|
||||||
*/
|
*/
|
||||||
ZYDIS_DLLEXTERN const char* ZydisRegisterGetString(ZydisRegister reg);
|
ZYDIS_EXPORT const char* ZydisRegisterGetString(ZydisRegister reg);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Returns the register-class of the specified register.
|
* @brief Returns the register-class of the specified register.
|
||||||
|
@ -212,7 +212,7 @@ ZYDIS_DLLEXTERN const char* ZydisRegisterGetString(ZydisRegister reg);
|
||||||
*
|
*
|
||||||
* @return The register-class of the specified register.
|
* @return The register-class of the specified register.
|
||||||
*/
|
*/
|
||||||
ZYDIS_DLLEXTERN ZydisRegisterClass ZydisRegisterGetClass(ZydisRegister reg);
|
ZYDIS_EXPORT ZydisRegisterClass ZydisRegisterGetClass(ZydisRegister reg);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Returns the size of the specified register.
|
* @brief Returns the size of the specified register.
|
||||||
|
@ -221,7 +221,7 @@ ZYDIS_DLLEXTERN ZydisRegisterClass ZydisRegisterGetClass(ZydisRegister reg);
|
||||||
*
|
*
|
||||||
* @return The size of the specified register.
|
* @return The size of the specified register.
|
||||||
*/
|
*/
|
||||||
ZYDIS_DLLEXTERN ZydisRegisterSize ZydisRegisterGetSize(ZydisRegister reg);
|
ZYDIS_EXPORT ZydisRegisterSize ZydisRegisterGetSize(ZydisRegister reg);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Checks if the specified register is a general purpose register.
|
* @brief Checks if the specified register is a general purpose register.
|
||||||
|
@ -230,7 +230,7 @@ ZYDIS_DLLEXTERN ZydisRegisterSize ZydisRegisterGetSize(ZydisRegister reg);
|
||||||
*
|
*
|
||||||
* @return True, if the specified register is a general purpose register.
|
* @return True, if the specified register is a general purpose register.
|
||||||
*/
|
*/
|
||||||
ZYDIS_DLLEXTERN bool ZydisRegisterIsGPR(ZydisRegister reg);
|
ZYDIS_EXPORT bool ZydisRegisterIsGPR(ZydisRegister reg);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Checks if the specified register is a 8-bit general purpose register.
|
* @brief Checks if the specified register is a 8-bit general purpose register.
|
||||||
|
@ -239,7 +239,7 @@ ZYDIS_DLLEXTERN bool ZydisRegisterIsGPR(ZydisRegister reg);
|
||||||
*
|
*
|
||||||
* @return True, if the specified register is a 8-bit general purpose register.
|
* @return True, if the specified register is a 8-bit general purpose register.
|
||||||
*/
|
*/
|
||||||
ZYDIS_DLLEXTERN bool ZydisRegisterIsGPR8(ZydisRegister reg);
|
ZYDIS_EXPORT bool ZydisRegisterIsGPR8(ZydisRegister reg);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Checks if the specified register is a 16-bit general purpose register.
|
* @brief Checks if the specified register is a 16-bit general purpose register.
|
||||||
|
@ -248,7 +248,7 @@ ZYDIS_DLLEXTERN bool ZydisRegisterIsGPR8(ZydisRegister reg);
|
||||||
*
|
*
|
||||||
* @return True, if the specified register is a 16-bit general purpose register.
|
* @return True, if the specified register is a 16-bit general purpose register.
|
||||||
*/
|
*/
|
||||||
ZYDIS_DLLEXTERN bool ZydisRegisterIsGPR16(ZydisRegister reg);
|
ZYDIS_EXPORT bool ZydisRegisterIsGPR16(ZydisRegister reg);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Checks if the specified register is a 32-bit general purpose register.
|
* @brief Checks if the specified register is a 32-bit general purpose register.
|
||||||
|
@ -257,7 +257,7 @@ ZYDIS_DLLEXTERN bool ZydisRegisterIsGPR16(ZydisRegister reg);
|
||||||
*
|
*
|
||||||
* @return True, if the specified register is a 32-bit general purpose register.
|
* @return True, if the specified register is a 32-bit general purpose register.
|
||||||
*/
|
*/
|
||||||
ZYDIS_DLLEXTERN bool ZydisRegisterIsGPR32(ZydisRegister reg);
|
ZYDIS_EXPORT bool ZydisRegisterIsGPR32(ZydisRegister reg);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Checks if the specified register is a 64-bit general purpose register.
|
* @brief Checks if the specified register is a 64-bit general purpose register.
|
||||||
|
@ -266,7 +266,7 @@ ZYDIS_DLLEXTERN bool ZydisRegisterIsGPR32(ZydisRegister reg);
|
||||||
*
|
*
|
||||||
* @return True, if the specified register is a 64-bit general purpose register.
|
* @return True, if the specified register is a 64-bit general purpose register.
|
||||||
*/
|
*/
|
||||||
ZYDIS_DLLEXTERN bool ZydisRegisterIsGPR64(ZydisRegister reg);
|
ZYDIS_EXPORT bool ZydisRegisterIsGPR64(ZydisRegister reg);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Checks if the specified register is a legacy floating-point register.
|
* @brief Checks if the specified register is a legacy floating-point register.
|
||||||
|
@ -275,7 +275,7 @@ ZYDIS_DLLEXTERN bool ZydisRegisterIsGPR64(ZydisRegister reg);
|
||||||
*
|
*
|
||||||
* @return True, if the specified register is a legacy floating-point register.
|
* @return True, if the specified register is a legacy floating-point register.
|
||||||
*/
|
*/
|
||||||
ZYDIS_DLLEXTERN bool ZydisRegisterIsFPRegister(ZydisRegister reg);
|
ZYDIS_EXPORT bool ZydisRegisterIsFPRegister(ZydisRegister reg);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Checks if the specified register is a multi-media register.
|
* @brief Checks if the specified register is a multi-media register.
|
||||||
|
@ -284,7 +284,7 @@ ZYDIS_DLLEXTERN bool ZydisRegisterIsFPRegister(ZydisRegister reg);
|
||||||
*
|
*
|
||||||
* @return True, if the specified register is a multi-media register.
|
* @return True, if the specified register is a multi-media register.
|
||||||
*/
|
*/
|
||||||
ZYDIS_DLLEXTERN bool ZydisRegisterIsMMRegister(ZydisRegister reg);
|
ZYDIS_EXPORT bool ZydisRegisterIsMMRegister(ZydisRegister reg);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Checks if the specified register is a vector register.
|
* @brief Checks if the specified register is a vector register.
|
||||||
|
@ -293,7 +293,7 @@ ZYDIS_DLLEXTERN bool ZydisRegisterIsMMRegister(ZydisRegister reg);
|
||||||
*
|
*
|
||||||
* @return True, if the specified register is a vector register.
|
* @return True, if the specified register is a vector register.
|
||||||
*/
|
*/
|
||||||
ZYDIS_DLLEXTERN bool ZydisRegisterIsVR(ZydisRegister reg);
|
ZYDIS_EXPORT bool ZydisRegisterIsVR(ZydisRegister reg);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Checks if the specified register is a 128-bit vector register.
|
* @brief Checks if the specified register is a 128-bit vector register.
|
||||||
|
@ -302,7 +302,7 @@ ZYDIS_DLLEXTERN bool ZydisRegisterIsVR(ZydisRegister reg);
|
||||||
*
|
*
|
||||||
* @return True, if the specified register is a 128-bit vector register.
|
* @return True, if the specified register is a 128-bit vector register.
|
||||||
*/
|
*/
|
||||||
ZYDIS_DLLEXTERN bool ZydisRegisterIsVR128(ZydisRegister reg);
|
ZYDIS_EXPORT bool ZydisRegisterIsVR128(ZydisRegister reg);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Checks if the specified register is a 256-bit vector register.
|
* @brief Checks if the specified register is a 256-bit vector register.
|
||||||
|
@ -311,7 +311,7 @@ ZYDIS_DLLEXTERN bool ZydisRegisterIsVR128(ZydisRegister reg);
|
||||||
*
|
*
|
||||||
* @return True, if the specified register is a 256-bit vector register.
|
* @return True, if the specified register is a 256-bit vector register.
|
||||||
*/
|
*/
|
||||||
ZYDIS_DLLEXTERN bool ZydisRegisterIsVR256(ZydisRegister reg);
|
ZYDIS_EXPORT bool ZydisRegisterIsVR256(ZydisRegister reg);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Checks if the specified register is a 512-bit vector register.
|
* @brief Checks if the specified register is a 512-bit vector register.
|
||||||
|
@ -320,7 +320,7 @@ ZYDIS_DLLEXTERN bool ZydisRegisterIsVR256(ZydisRegister reg);
|
||||||
*
|
*
|
||||||
* @return True, if the specified register is a 512-bit vector register.
|
* @return True, if the specified register is a 512-bit vector register.
|
||||||
*/
|
*/
|
||||||
ZYDIS_DLLEXTERN bool ZydisRegisterIsVR512(ZydisRegister reg);
|
ZYDIS_EXPORT bool ZydisRegisterIsVR512(ZydisRegister reg);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Checks if the specified register is a flags register.
|
* @brief Checks if the specified register is a flags register.
|
||||||
|
@ -329,7 +329,7 @@ ZYDIS_DLLEXTERN bool ZydisRegisterIsVR512(ZydisRegister reg);
|
||||||
*
|
*
|
||||||
* @return True, if the specified register is a flags register.
|
* @return True, if the specified register is a flags register.
|
||||||
*/
|
*/
|
||||||
ZYDIS_DLLEXTERN bool ZydisRegisterIsFlagsRegister(ZydisRegister reg);
|
ZYDIS_EXPORT bool ZydisRegisterIsFlagsRegister(ZydisRegister reg);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Checks if the specified register is an instruction-pointer register.
|
* @brief Checks if the specified register is an instruction-pointer register.
|
||||||
|
@ -338,7 +338,7 @@ ZYDIS_DLLEXTERN bool ZydisRegisterIsFlagsRegister(ZydisRegister reg);
|
||||||
*
|
*
|
||||||
* @return True, if the specified register is a instruction-pointer register.
|
* @return True, if the specified register is a instruction-pointer register.
|
||||||
*/
|
*/
|
||||||
ZYDIS_DLLEXTERN bool ZydisRegisterIsIPRegister(ZydisRegister reg);
|
ZYDIS_EXPORT bool ZydisRegisterIsIPRegister(ZydisRegister reg);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Checks if the specified register is a segment register.
|
* @brief Checks if the specified register is a segment register.
|
||||||
|
@ -347,7 +347,7 @@ ZYDIS_DLLEXTERN bool ZydisRegisterIsIPRegister(ZydisRegister reg);
|
||||||
*
|
*
|
||||||
* @return True, if the specified register is a segment register.
|
* @return True, if the specified register is a segment register.
|
||||||
*/
|
*/
|
||||||
ZYDIS_DLLEXTERN bool ZydisRegisterIsSegmentRegister(ZydisRegister reg);
|
ZYDIS_EXPORT bool ZydisRegisterIsSegmentRegister(ZydisRegister reg);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Checks if the specified register is a control register.
|
* @brief Checks if the specified register is a control register.
|
||||||
|
@ -356,7 +356,7 @@ ZYDIS_DLLEXTERN bool ZydisRegisterIsSegmentRegister(ZydisRegister reg);
|
||||||
*
|
*
|
||||||
* @return True, if the specified register is a control register.
|
* @return True, if the specified register is a control register.
|
||||||
*/
|
*/
|
||||||
ZYDIS_DLLEXTERN bool ZydisRegisterIsCR(ZydisRegister reg);
|
ZYDIS_EXPORT bool ZydisRegisterIsCR(ZydisRegister reg);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Checks if the specified register is a debug register.
|
* @brief Checks if the specified register is a debug register.
|
||||||
|
@ -365,7 +365,7 @@ ZYDIS_DLLEXTERN bool ZydisRegisterIsCR(ZydisRegister reg);
|
||||||
*
|
*
|
||||||
* @return True, if the specified register is a debug register.
|
* @return True, if the specified register is a debug register.
|
||||||
*/
|
*/
|
||||||
ZYDIS_DLLEXTERN bool ZydisRegisterIsDR(ZydisRegister reg);
|
ZYDIS_EXPORT bool ZydisRegisterIsDR(ZydisRegister reg);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Checks if the specified register is a mask register.
|
* @brief Checks if the specified register is a mask register.
|
||||||
|
@ -374,7 +374,7 @@ ZYDIS_DLLEXTERN bool ZydisRegisterIsDR(ZydisRegister reg);
|
||||||
*
|
*
|
||||||
* @return True, if the specified register is a mask register.
|
* @return True, if the specified register is a mask register.
|
||||||
*/
|
*/
|
||||||
ZYDIS_DLLEXTERN bool ZydisRegisterIsMaskRegister(ZydisRegister reg);
|
ZYDIS_EXPORT bool ZydisRegisterIsMaskRegister(ZydisRegister reg);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Checks if the specified register is a bound register.
|
* @brief Checks if the specified register is a bound register.
|
||||||
|
@ -383,7 +383,7 @@ ZYDIS_DLLEXTERN bool ZydisRegisterIsMaskRegister(ZydisRegister reg);
|
||||||
*
|
*
|
||||||
* @return True, if the specified register is a bound register.
|
* @return True, if the specified register is a bound register.
|
||||||
*/
|
*/
|
||||||
ZYDIS_DLLEXTERN bool ZydisRegisterIsBoundsRegister(ZydisRegister reg);
|
ZYDIS_EXPORT bool ZydisRegisterIsBoundsRegister(ZydisRegister reg);
|
||||||
|
|
||||||
/* ============================================================================================== */
|
/* ============================================================================================== */
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,7 @@ extern "C" {
|
||||||
*
|
*
|
||||||
* This function should return the name of the symbol found at the given @c address and an
|
* This function should return the name of the symbol found at the given @c address and an
|
||||||
* optional @c offset.
|
* optional @c offset.
|
||||||
|
* If no symbol was found at the given @c address, the return value should be @c NULL.
|
||||||
*/
|
*/
|
||||||
typedef const char* (*ZydisResolverResolveSymbolFunc)(void* context,
|
typedef const char* (*ZydisResolverResolveSymbolFunc)(void* context,
|
||||||
const ZydisInstructionInfo* info, const ZydisOperandInfo* operand, uint64_t address,
|
const ZydisInstructionInfo* info, const ZydisOperandInfo* operand, uint64_t address,
|
||||||
|
|
|
@ -53,7 +53,7 @@ extern "C" {
|
||||||
*
|
*
|
||||||
* @return A zydis status code
|
* @return A zydis status code
|
||||||
*/
|
*/
|
||||||
ZYDIS_DLLEXTERN ZydisStatus ZydisUtilsCalcAbsoluteTargetAddress(const ZydisInstructionInfo* info,
|
ZYDIS_EXPORT ZydisStatus ZydisUtilsCalcAbsoluteTargetAddress(const ZydisInstructionInfo* info,
|
||||||
const ZydisOperandInfo* operand, uint64_t* address);
|
const ZydisOperandInfo* operand, uint64_t* address);
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------------------------------- */
|
||||||
|
|
|
@ -99,7 +99,7 @@ extern "C" {
|
||||||
* Use the macros provided in this file to extract the major, minor, patch and build part from the
|
* Use the macros provided in this file to extract the major, minor, patch and build part from the
|
||||||
* returned version value.
|
* returned version value.
|
||||||
*/
|
*/
|
||||||
ZYDIS_DLLEXTERN uint64_t ZydisGetVersion();
|
ZYDIS_EXPORT uint64_t ZydisGetVersion();
|
||||||
|
|
||||||
/* ============================================================================================== */
|
/* ============================================================================================== */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue