Merge branch 'develop'

This commit is contained in:
Joel Höner 2017-12-12 14:19:39 +01:00
commit 14c9cb9a41
No known key found for this signature in database
GPG Key ID: 414998BD0973F77E
69 changed files with 20877 additions and 15757 deletions

10
.gitignore vendored
View File

@ -81,6 +81,16 @@ CTestTestfile.cmake
.DS_Store .DS_Store
build* build*
# MSVC
.vs .vs
*.vcxproj.user
*.suo
*.sdf
*.opensdf
*.VC.db
*.VC.opendb
msvc/**/obj/
msvc/**/bin/
doc/html doc/html

View File

@ -10,34 +10,34 @@ project(Zydis VERSION 2.0)
# Features # Features
option(ZYDIS_FEATURE_DECODER option(ZYDIS_FEATURE_DECODER
"Enable instruction decoding and formtting functionality" "Enable instruction decoding functionality"
ON)
option(ZYDIS_FEATURE_FORMATTER
"Enable instruction formatting functionality"
ON) ON)
#option(ZYDIS_FEATURE_ENCODER
# "Enable instruction encoding functionality"
# OFF)
option(ZYDIS_FEATURE_EVEX option(ZYDIS_FEATURE_EVEX
"Enable support for EVEX instructions" "Enable support for EVEX instructions"
ON) ON)
option(ZYDIS_FEATURE_MVEX option(ZYDIS_FEATURE_MVEX
"Enable support for MVEX instructions" "Enable support for MVEX instructions"
ON) ON)
option(ZYDIS_FEATURE_FLAGS
"Include information about affected flags"
ON)
option(ZYDIS_FEATURE_CPUID
"Include information about CPUID feature-flags"
OFF)
# Build configuration # Build configuration
option(BUILD_SHARED_LIBS option(BUILD_SHARED_LIBS
"Build shared libraries" "Build shared libraries"
OFF) OFF)
option(ZYDIS_NO_LIBC
"Don't use any C standard library functions (for exotic build-envs like kernel drivers)"
OFF)
option(ZYDIS_BUILD_EXAMPLES option(ZYDIS_BUILD_EXAMPLES
"Build examples" "Build examples"
ON) ON)
option(ZYDIS_BUILD_TOOLS option(ZYDIS_BUILD_TOOLS
"Build tools" "Build tools"
ON) ON)
option(ZYDIS_FUZZ_AFL_FAST
"Enables AFL persistent mode and reduces prints in ZydisFuzzIn"
OFF)
option(ZYDIS_DEV_MODE option(ZYDIS_DEV_MODE
"Enable developer mode (-Wall, -Werror, ...)" "Enable developer mode (-Wall, -Werror, ...)"
OFF) OFF)
@ -80,24 +80,21 @@ if (NOT ZYDIS_FEATURE_ENCODER AND NOT ZYDIS_FEATURE_DECODER)
) )
endif () endif ()
if (ZYDIS_FEATURE_EVEX) if (NOT ZYDIS_FEATURE_DECODER)
target_compile_definitions("Zydis" PUBLIC "ZYDIS_ENABLE_FEATURE_EVEX") target_compile_definitions("Zydis" PUBLIC "ZYDIS_DISABLE_DECODER")
endif () endif ()
if (ZYDIS_FEATURE_MVEX) if (NOT ZYDIS_FEATURE_FORMATTER)
target_compile_definitions("Zydis" PUBLIC "ZYDIS_ENABLE_FEATURE_MVEX") target_compile_definitions("Zydis" PUBLIC "ZYDIS_DISABLE_FORMATTER")
endif () endif ()
if (ZYDIS_FEATURE_FLAGS) if (NOT ZYDIS_FEATURE_EVEX)
target_compile_definitions("Zydis" PUBLIC "ZYDIS_ENABLE_FEATURE_FLAGS") target_compile_definitions("Zydis" PUBLIC "ZYDIS_DISABLE_EVEX")
endif () endif ()
if (ZYDIS_FEATURE_CPUID) if (NOT ZYDIS_FEATURE_MVEX)
target_compile_definitions("Zydis" PUBLIC "ZYDIS_ENABLE_FEATURE_CPUID") target_compile_definitions("Zydis" PUBLIC "ZYDIS_DISABLE_MVEX")
endif () endif ()
if (ZYDIS_FEATURE_DECODER) if (ZYDIS_NO_LIBC)
target_compile_definitions("Zydis" PUBLIC "ZYDIS_ENABLE_FEATURE_DECODER") target_compile_definitions("Zydis" PUBLIC "ZYDIS_NO_LIBC")
endif () endif ()
#if (ZYDIS_FEATURE_ENCODER)
# target_compile_definitions("Zydis" PUBLIC "ZYDIS_ENABLE_FEATURE_ENCODER")
#endif ()
target_sources("Zydis" target_sources("Zydis"
PUBLIC PUBLIC
@ -108,14 +105,17 @@ target_sources("Zydis"
"${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Register.h" "${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Register.h"
"${CMAKE_CURRENT_LIST_DIR}/include/Zydis/SharedTypes.h" "${CMAKE_CURRENT_LIST_DIR}/include/Zydis/SharedTypes.h"
"${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Status.h" "${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Status.h"
"${CMAKE_CURRENT_LIST_DIR}/include/Zydis/String.h"
"${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Utils.h" "${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Utils.h"
"${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Zydis.h" "${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Zydis.h"
"${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Internal/LibC.h"
"${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Internal/SharedData.h"
PRIVATE PRIVATE
"src/MetaInfo.c" "src/MetaInfo.c"
"src/Mnemonic.c" "src/Mnemonic.c"
"src/Register.c" "src/Register.c"
"src/SharedData.h"
"src/SharedData.c" "src/SharedData.c"
"src/String.c"
"src/Utils.c" "src/Utils.c"
"src/Zydis.c") "src/Zydis.c")
@ -125,25 +125,13 @@ if (ZYDIS_FEATURE_DECODER)
"${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Decoder.h" "${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Decoder.h"
"${CMAKE_CURRENT_LIST_DIR}/include/Zydis/DecoderTypes.h" "${CMAKE_CURRENT_LIST_DIR}/include/Zydis/DecoderTypes.h"
"${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Formatter.h" "${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Formatter.h"
"${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Internal/DecoderData.h"
PRIVATE PRIVATE
"src/DecoderData.h"
"src/FormatHelper.h"
"src/Decoder.c" "src/Decoder.c"
"src/DecoderData.c" "src/DecoderData.c"
"src/Formatter.c" "src/Formatter.c")
"src/FormatHelper.c")
endif () endif ()
#if (ZYDIS_FEATURE_ENCODER)
# target_sources("Zydis"
# PUBLIC
# "${CMAKE_CURRENT_LIST_DIR}/include/Zydis/Encoder.h"
# PRIVATE
# "src/EncoderData.h"
# "src/Encoder.c"
# "src/EncoderData.c")
#endif ()
if (BUILD_SHARED_LIBS AND WIN32) if (BUILD_SHARED_LIBS AND WIN32)
target_sources("Zydis" PRIVATE "src/VersionInfo.rc") target_sources("Zydis" PRIVATE "src/VersionInfo.rc")
endif () endif ()
@ -161,9 +149,7 @@ install(DIRECTORY "include" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
if (ZYDIS_BUILD_EXAMPLES) if (ZYDIS_BUILD_EXAMPLES)
if (ZYDIS_FEATURE_DECODER) if (ZYDIS_FEATURE_DECODER)
add_executable("FormatterHooks" add_executable("FormatterHooks" "examples/FormatterHooks.c")
"examples/FormatterHooks.c"
"examples/FormatHelper.h")
target_link_libraries("FormatterHooks" "Zydis") target_link_libraries("FormatterHooks" "Zydis")
set_target_properties("FormatterHooks" PROPERTIES FOLDER "Examples/Formatter") set_target_properties("FormatterHooks" PROPERTIES FOLDER "Examples/Formatter")
target_compile_definitions("FormatterHooks" PRIVATE "_CRT_SECURE_NO_WARNINGS") target_compile_definitions("FormatterHooks" PRIVATE "_CRT_SECURE_NO_WARNINGS")
@ -172,6 +158,9 @@ if (ZYDIS_BUILD_EXAMPLES)
target_link_libraries("ZydisFuzzIn" "Zydis") target_link_libraries("ZydisFuzzIn" "Zydis")
set_target_properties("FormatterHooks" PROPERTIES FOLDER "Examples") set_target_properties("FormatterHooks" PROPERTIES FOLDER "Examples")
target_compile_definitions("ZydisFuzzIn" PRIVATE "_CRT_SECURE_NO_WARNINGS") target_compile_definitions("ZydisFuzzIn" PRIVATE "_CRT_SECURE_NO_WARNINGS")
if (ZYDIS_FUZZ_AFL_FAST)
target_compile_definitions("ZydisFuzzIn" PRIVATE "ZYDIS_FUZZ_AFL_FAST")
endif ()
add_executable("ZydisPerfTest" "examples/ZydisPerfTest.c") add_executable("ZydisPerfTest" "examples/ZydisPerfTest.c")
target_link_libraries("ZydisPerfTest" "Zydis") target_link_libraries("ZydisPerfTest" "Zydis")

View File

@ -1,5 +1,5 @@
# Zyan Disassembler Engine (Zydis) ![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) [![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)
Fast and lightweight x86/x86-64 disassembler library. Fast and lightweight x86/x86-64 disassembler library.
@ -116,6 +116,7 @@ make
- Intel (for open-sourcing XED, allowing for automatic comparision of our tables against theirs, improving both) - Intel (for open-sourcing XED, allowing for automatic comparision of our tables against theirs, improving both)
- LLVM (for providing pretty solid instruction data as well) - LLVM (for providing pretty solid instruction data as well)
- Christian Ludloff (http://sandpile.org, insanely helpful) - 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) - Our [contributors on GitHub](https://github.com/zyantific/zydis/graphs/contributors)
## License ## License

View File

@ -1,286 +0,0 @@
/**
*
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#include "pin.H"
#include "xed-interface.h"
#include <iostream>
#include <iomanip>
#include <fstream>
#include <set>
#include <Zydis/Zydis.h>
/* ========================================================================== */
/* TLS struct */
/* ========================================================================== */
struct ThreadData
{
CONTEXT ctx;
ZydisInstructionDecoder decoder;
ThreadData()
{
ZydisDecoderInitInstructionDecoderEx(
&decoder, ZYDIS_DISASSEMBLER_MODE_64BIT, NULL, 0
);
}
};
/* ========================================================================== */
/* Global variables */
/* ========================================================================== */
TLS_KEY tls_key;
std::ostream* out = &cerr;
PIN_LOCK unique_iforms_lock;
std::set<xed_iform_enum_t> unique_iforms;
/* ========================================================================== */
/* Tables */
/* ========================================================================== */
struct RegMapping
{
REG pin;
ZydisRegister zy;
};
RegMapping reg_mapping[] = {
// 64-bit GP register
{REG_RAX, ZYDIS_REGISTER_RAX},
{REG_RBX, ZYDIS_REGISTER_RBX},
{REG_RCX, ZYDIS_REGISTER_RCX},
{REG_RDX, ZYDIS_REGISTER_RDX},
{REG_RSP, ZYDIS_REGISTER_RSP},
{REG_RBP, ZYDIS_REGISTER_RBP},
{REG_RSI, ZYDIS_REGISTER_RSI},
{REG_RDI, ZYDIS_REGISTER_RDI},
{REG_R8, ZYDIS_REGISTER_R8 },
{REG_R9, ZYDIS_REGISTER_R9 },
{REG_R10, ZYDIS_REGISTER_R10},
{REG_R11, ZYDIS_REGISTER_R11},
{REG_R12, ZYDIS_REGISTER_R12},
{REG_R13, ZYDIS_REGISTER_R13},
{REG_R14, ZYDIS_REGISTER_R14},
{REG_R15, ZYDIS_REGISTER_R15},
// Segment registers
{REG_SEG_ES, ZYDIS_REGISTER_ES},
{REG_SEG_SS, ZYDIS_REGISTER_SS},
{REG_SEG_SS, ZYDIS_REGISTER_SS},
{REG_SEG_CS, ZYDIS_REGISTER_CS},
{REG_SEG_DS, ZYDIS_REGISTER_DS},
{REG_SEG_FS, ZYDIS_REGISTER_FS},
{REG_SEG_GS, ZYDIS_REGISTER_GS},
// Mask registers
{REG_K0, ZYDIS_REGISTER_K0},
{REG_K1, ZYDIS_REGISTER_K1},
{REG_K2, ZYDIS_REGISTER_K2},
{REG_K3, ZYDIS_REGISTER_K3},
{REG_K4, ZYDIS_REGISTER_K4},
{REG_K5, ZYDIS_REGISTER_K5},
{REG_K6, ZYDIS_REGISTER_K6},
{REG_K7, ZYDIS_REGISTER_K7},
// TODO: XMM, YMM, ZMM, ST, TR
// Special registers
{REG_MXCSR, ZYDIS_REGISTER_MXCSR},
};
/* ========================================================================== */
/* Command line switches */
/* ========================================================================== */
KNOB<string> knob_out_file(
KNOB_MODE_WRITEONCE, "pintool", "o", "", "Output file name"
);
KNOB<bool> know_unique_iform(
KNOB_MODE_WRITEONCE, "pintool", "unique_iform", "0",
"Only instrument one instruction per iform"
);
KNOB<bool> omit_op_checks(
KNOB_MODE_WRITEONCE, "pintool", "omit_op_checks", "0",
"Skip verification of operand write assumptions"
);
KNOB<bool> omit_flag_checks(
KNOB_MODE_WRITEONCE, "pintool", "omit_flag_checks", "1",
"Skip verification of flag write assumptions"
);
/* ========================================================================== */
/* Instrumentation callbacks */
/* ========================================================================== */
VOID PIN_FAST_ANALYSIS_CALL pre_ins_cb(THREADID tid, const CONTEXT* ctx)
{
ThreadData *tls = static_cast<ThreadData*>(PIN_GetThreadData(tls_key, tid));
PIN_SaveContext(ctx, &tls->ctx);
}
VOID PIN_FAST_ANALYSIS_CALL post_ins_cb(THREADID tid, const CONTEXT* post_ctx)
{
ThreadData *tls = static_cast<ThreadData*>(PIN_GetThreadData(tls_key, tid));
// Get IPs.
ADDRINT pre_ip = PIN_GetContextReg(&tls->ctx, REG_INST_PTR);
ADDRINT post_ip = PIN_GetContextReg(post_ctx, REG_INST_PTR);
// If the IP didn't change, we're probably dealing with a rep.
// Skip instruction until last execution where fallthrough kicks in.
ADDRINT ip_diff = post_ip - pre_ip;
if (!ip_diff) return;
// Disassemble previously executed instruction.
ZydisMemoryInput input;
ZydisInputInitMemoryInput(&input, (void*)pre_ip, 15);
ZydisDecoderSetInput(&tls->decoder, (ZydisCustomInput*)&input);
ZydisInstructionInfo insn_info;
ZydisStatus decode_status = ZydisDecoderDecodeNextInstruction(
&tls->decoder, &insn_info
);
// Can we decode it?
if (!ZYDIS_SUCCESS(decode_status)) {
*out << "Decoding failure" << endl;
goto error;
}
// Does the length look like what we expected?
if (insn_info.length != ip_diff) {
*out << "Instruction length mismatch (expected "
<< dec << ip_diff << ", got " << (int)insn_info.length
<< ')' << endl;
goto error;
}
// Analyze operand effects.
if (!omit_op_checks) {
for (const RegMapping* map = reg_mapping
; map < reg_mapping + sizeof reg_mapping / sizeof reg_mapping[0]
; ++map) {
ADDRINT pre_reg_val = PIN_GetContextReg(&tls->ctx, map->pin);
ADDRINT post_reg_val = PIN_GetContextReg(post_ctx, map->pin);
// Did the instruction touch this register?
if (pre_reg_val != post_reg_val) {
*out << "Reg value changed ("
<< ZydisRegisterGetString(map->zy)
<< ")!" << endl;
}
}
}
// Analyze flag effects.
if (!omit_flag_checks) {
ADDRINT prev_flags = PIN_GetContextReg(&tls->ctx, REG_GFLAGS);
ADDRINT new_flags = PIN_GetContextReg(post_ctx, REG_GFLAGS);
ADDRINT changed_flags = prev_flags ^ new_flags;
if (changed_flags) {
// TODO: implement once flag infos are available.
}
}
return;
error:
// Always print raw bytes on error.
*out << "Raw bytes: ";
for (size_t i = 0; i < 15; ++i) {
*out << setfill('0') << setw(2) << hex
<< (int)((uint8_t*)pre_ip)[i] << ' ';
}
*out << endl;
}
VOID instruction(INS ins, VOID *v)
{
if (!INS_HasFallThrough(ins)) return;
xed_decoded_inst_t* xed = INS_XedDec(ins);
xed_iform_enum_t iform = xed_decoded_inst_get_iform_enum(xed);
if (know_unique_iform.Value()) {
PIN_GetLock(&unique_iforms_lock, 0);
if (unique_iforms.find(iform) != unique_iforms.end()) {
PIN_ReleaseLock(&unique_iforms_lock);
return;
}
unique_iforms.insert(iform);
*out << iform << endl;
PIN_ReleaseLock(&unique_iforms_lock);
}
INS_InsertCall(
ins, IPOINT_BEFORE, (AFUNPTR)&pre_ins_cb,
IARG_FAST_ANALYSIS_CALL, IARG_THREAD_ID, IARG_CONST_CONTEXT,
IARG_END
);
INS_InsertCall(
ins, IPOINT_AFTER, (AFUNPTR)&post_ins_cb,
IARG_FAST_ANALYSIS_CALL, IARG_THREAD_ID, IARG_CONST_CONTEXT,
IARG_END
);
}
VOID thread_start(THREADID tid, CONTEXT *ctx, INT32 flags, VOID* v)
{
ThreadData* tls = new ThreadData;
PIN_SetThreadData(tls_key, tls, tid);
}
int main(int argc, char *argv[])
{
if (PIN_Init(argc, argv)) {
cerr << KNOB_BASE::StringKnobSummary() << endl;
return 1;
}
// Open output file.
string file_name = knob_out_file.Value();
if (!file_name.empty()) {
out = new std::ofstream(file_name.c_str());
}
// Init TLS.
tls_key = PIN_CreateThreadDataKey(0);
PIN_InitLock(&unique_iforms_lock);
// Register hooks.
PIN_AddThreadStartFunction(&thread_start, NULL);
INS_AddInstrumentFunction(&instruction, NULL);
// Start the program, never returns.
PIN_StartProgram();
return 0;
}
/* ========================================================================== */

View File

@ -1,21 +0,0 @@
##############################################################
#
# DO NOT EDIT THIS FILE!
#
##############################################################
# If the tool is built out of the kit, PIN_ROOT must be specified in the make invocation and point to the kit root.
ifdef PIN_ROOT
CONFIG_ROOT := $(PIN_ROOT)/source/tools/Config
else
CONFIG_ROOT := ../Config
endif
include $(CONFIG_ROOT)/makefile.config
include makefile.rules
include $(TOOLS_ROOT)/Config/makefile.default.rules
##############################################################
#
# DO NOT EDIT THIS FILE!
#
##############################################################

View File

@ -1,89 +0,0 @@
##############################################################
#
# This file includes all the test targets as well as all the
# non-default build rules and test recipes.
#
##############################################################
##############################################################
#
# Test targets
#
##############################################################
###### Place all generic definitions here ######
# This defines tests which run tools of the same name. This is simply for convenience to avoid
# defining the test name twice (once in TOOL_ROOTS and again in TEST_ROOTS).
# Tests defined here should not be defined in TOOL_ROOTS and TEST_ROOTS.
TEST_TOOL_ROOTS := ZydisTestTool
OBJECT_ROOTS += \
zydis/src/Decoder \
zydis/src/Formatter \
zydis/src/Input \
zydis/src/InstructionDetails \
zydis/src/InstructionTable \
zydis/src/Mnemonic \
zydis/src/Register \
zydis/src/Utils \
zydis/src/Zydis
# This defines the tests to be run that were not already defined in TEST_TOOL_ROOTS.
TEST_ROOTS :=
# This defines the tools which will be run during the the tests, and were not already defined in
# TEST_TOOL_ROOTS.
TOOL_ROOTS :=
# This defines the static analysis tools which will be run during the the tests. They should not
# be defined in TEST_TOOL_ROOTS. If a test with the same name exists, it should be defined in
# TEST_ROOTS.
# Note: Static analysis tools are in fact executables linked with the Pin Static Analysis Library.
# This library provides a subset of the Pin APIs which allows the tool to perform static analysis
# of an application or dll. Pin itself is not used when this tool runs.
SA_TOOL_ROOTS :=
# This defines all the applications that will be run during the tests.
APP_ROOTS :=
# This defines any additional object files that need to be compiled.
OBJECT_ROOTS :=
# This defines any additional dlls (shared objects), other than the pintools, that need to be compiled.
DLL_ROOTS :=
# This defines any static libraries (archives), that need to be built.
LIB_ROOTS :=
###### Define the sanity subset ######
# This defines the list of tests that should run in sanity. It should include all the tests listed in
# TEST_TOOL_ROOTS and TEST_ROOTS excluding only unstable tests.
SANITY_SUBSET := $(TEST_TOOL_ROOTS) $(TEST_ROOTS)
##############################################################
#
# Test recipes
#
##############################################################
# This section contains recipes for tests other than the default.
# See makefile.default.rules for the default test rules.
# All tests in this section should adhere to the naming convention: <testname>.test
##############################################################
#
# Build rules
#
##############################################################
ADDITIONAL_INCLUDES := -Izydis/include -I.
TOOL_CFLAGS += $(ADDITIONAL_INCLUDES)
TOOL_CXXFLAGS += $(ADDITIONAL_INCLUDES)
$(OBJDIR)ZydisTestTool$(PINTOOL_SUFFIX): $(OBJDIR)ZydisTestTool$(OBJ_SUFFIX) $(OBJDIR)zydis/src/Decoder$(OBJ_SUFFIX) $(OBJDIR)zydis/src/Formatter$(OBJ_SUFFIX) $(OBJDIR)zydis/src/Input$(OBJ_SUFFIX) $(OBJDIR)zydis/src/InstructionDetails$(OBJ_SUFFIX) $(OBJDIR)zydis/src/InstructionTable$(OBJ_SUFFIX) $(OBJDIR)zydis/src/Mnemonic$(OBJ_SUFFIX) $(OBJDIR)zydis/src/Register$(OBJ_SUFFIX) $(OBJDIR)zydis/src/Utils$(OBJ_SUFFIX) $(OBJDIR)zydis/src/Zydis$(OBJ_SUFFIX)
$(LINKER) $(TOOL_LDFLAGS) $(LINK_EXE)$@ $^ $(TOOL_LPATHS) $(TOOL_LIBS)

View File

@ -1,174 +0,0 @@
/***************************************************************************************************
Zyan Disassembler Engine (Zydis)
Original Author : Florian Bernd
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
***************************************************************************************************/
#ifndef ZYDIS_FORMATHELPER_H
#define ZYDIS_FORMATHELPER_H
#include <assert.h>
#include <stdarg.h>
#include <stdint.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include <Zydis/Defines.h>
#include <Zydis/Status.h>
/* ============================================================================================== */
/* Format helper functions */
/* ============================================================================================== */
/* ---------------------------------------------------------------------------------------------- */
/* Enums and types */
/* ---------------------------------------------------------------------------------------------- */
/**
* @brief Defines the @c ZydisStringBufferAppendMode datatype.
*/
typedef uint8_t ZydisStringBufferAppendMode;
/**
* @brief Values that represent zydis string-buffer append-modes.
*/
enum ZydisStringBufferAppendModes
{
/**
* @brief Appends the string as it is.
*/
ZYDIS_STRBUF_APPEND_MODE_DEFAULT,
/**
* @brief Converts the string to lowercase characters.
*/
ZYDIS_STRBUF_APPEND_MODE_LOWERCASE,
/**
* @brief Converts the string to uppercase characters.
*/
ZYDIS_STRBUF_APPEND_MODE_UPPERCASE
};
/* ---------------------------------------------------------------------------------------------- */
/**
* @brief Appends the @c text to the given @c buffer and increases the string-buffer pointer by
* the number of chars written.
*
* @param buffer A pointer to the string-buffer.
* @param bufferLen The length of the string-buffer.
* @param mode The append-mode.
* @param text The text to append.
*
* @return @c ZYDIS_STATUS_SUCCESS, if the function succeeded, or
* @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not
* sufficient to append the given @c text.
*/
ZYDIS_INLINE ZydisStatus ZydisStringBufferAppend(char** buffer, size_t bufferLen,
ZydisStringBufferAppendMode mode, const char* text)
{
ZYDIS_ASSERT(buffer);
ZYDIS_ASSERT(bufferLen != 0);
ZYDIS_ASSERT(text);
size_t strLen = strlen(text);
if (strLen >= bufferLen)
{
return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE;
}
strncpy(*buffer, text, strLen + 1);
switch (mode)
{
case ZYDIS_STRBUF_APPEND_MODE_LOWERCASE:
for (size_t i = 0; i < strLen; ++i)
{
(*buffer[i]) = (char)tolower((*buffer)[i]);
}
break;
case ZYDIS_STRBUF_APPEND_MODE_UPPERCASE:
for (size_t i = 0; i < strLen; ++i)
{
(*buffer)[i] = (char)toupper((*buffer)[i]);
}
break;
default:
break;
}
*buffer += strLen;
return ZYDIS_STATUS_SUCCESS;
}
/**
* @brief Appends formatted text to the given @c buffer and increases the string-buffer pointer
* by the number of chars written.
*
* @param buffer A pointer to the string-buffer.
* @param bufferLen The length of the string-buffer.
* @param mode The append-mode.
* @param format The format string.
*
* @return @c ZYDIS_STATUS_SUCCESS, if the function succeeded, or
* @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not
* sufficient to append the given text.
*/
ZYDIS_INLINE ZydisStatus ZydisStringBufferAppendFormat(char** buffer, size_t bufferLen,
ZydisStringBufferAppendMode mode, const char* format, ...)
{
ZYDIS_ASSERT(buffer);
ZYDIS_ASSERT(bufferLen != 0);
ZYDIS_ASSERT(format);
va_list arglist;
va_start(arglist, format);
int w = vsnprintf(*buffer, bufferLen, format, arglist);
if ((w < 0) || ((size_t)w >= bufferLen))
{
va_end(arglist);
return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE;
}
switch (mode)
{
case ZYDIS_STRBUF_APPEND_MODE_LOWERCASE:
for (size_t i = 0; i < (size_t)w; ++i)
{
(*buffer)[i] = (char)tolower((*buffer)[i]);
}
break;
case ZYDIS_STRBUF_APPEND_MODE_UPPERCASE:
for (size_t i = 0; i < (size_t)w; ++i)
{
(*buffer)[i] = (char)toupper((*buffer)[i]);
}
break;
default:
break;
}
*buffer += (size_t)w;
va_end(arglist);
return ZYDIS_STATUS_SUCCESS;
}
/* ---------------------------------------------------------------------------------------------- */
/* ============================================================================================== */
#endif /* ZYDIS_FORMATHELPER_H */

View File

@ -33,10 +33,46 @@
* the condition encoded in the immediate operand). * the condition encoded in the immediate operand).
*/ */
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <inttypes.h> #include <inttypes.h>
#include <Zydis/Zydis.h> #include <Zydis/Zydis.h>
#include "FormatHelper.h"
#include <stdlib.h> /* ============================================================================================== */
/* Helper functions */
/* ============================================================================================== */
/**
* @brief Appends formatted text to the given `string`.
*
* @param string A pointer to the string.
* @param format The format string.
*
* @return @c ZYDIS_STATUS_SUCCESS, if the function succeeded, or
* @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not
* sufficient to append the given text.
*/
ZYDIS_INLINE ZydisStatus ZydisStringAppendFormatC(ZydisString* string, const char* format, ...)
{
if (!string || !string->buffer || !format)
{
return ZYDIS_STATUS_INVALID_PARAMETER;
}
va_list arglist;
va_start(arglist, format);
const int w = vsnprintf(string->buffer + string->length, string->capacity - string->length,
format, arglist);
if ((w < 0) || ((size_t)w > string->capacity - string->length))
{
va_end(arglist);
return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE;
}
string->length += w;
va_end(arglist);
return ZYDIS_STATUS_SUCCESS;
}
/* ============================================================================================== */ /* ============================================================================================== */
/* Static data */ /* Static data */
@ -97,11 +133,10 @@ typedef struct ZydisCustomUserData_
/* Hook callbacks */ /* Hook callbacks */
/* ============================================================================================== */ /* ============================================================================================== */
ZydisFormatterFormatFunc defaultPrintMnemonic; ZydisFormatterFunc defaultPrintMnemonic;
static ZydisStatus ZydisFormatterPrintMnemonic(const ZydisFormatter* formatter, static ZydisStatus ZydisFormatterPrintMnemonic(const ZydisFormatter* formatter,
char** buffer, size_t bufferLen, const ZydisDecodedInstruction* instruction, ZydisString* string, const ZydisDecodedInstruction* instruction, ZydisCustomUserData* userData)
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; userData->ommitImmediate = ZYDIS_TRUE;
@ -109,40 +144,36 @@ static ZydisStatus ZydisFormatterPrintMnemonic(const ZydisFormatter* formatter,
// Rewrite the instruction-mnemonic for the given instructions // Rewrite the instruction-mnemonic for the given instructions
if (instruction->operands[instruction->operandCount - 1].type == ZYDIS_OPERAND_TYPE_IMMEDIATE) if (instruction->operands[instruction->operandCount - 1].type == ZYDIS_OPERAND_TYPE_IMMEDIATE)
{ {
uint8_t conditionCode = const uint8_t conditionCode =
(uint8_t)instruction->operands[instruction->operandCount - 1].imm.value.u; (uint8_t)instruction->operands[instruction->operandCount - 1].imm.value.u;
switch (instruction->mnemonic) switch (instruction->mnemonic)
{ {
case ZYDIS_MNEMONIC_CMPPS: case ZYDIS_MNEMONIC_CMPPS:
if (conditionCode < 0x08) if (conditionCode < 0x08)
{ {
return ZydisStringBufferAppendFormat(buffer, bufferLen, return ZydisStringAppendFormatC(
ZYDIS_STRBUF_APPEND_MODE_DEFAULT, "cmp%sps", string, "cmp%sps", conditionCodeStrings[conditionCode]);
conditionCodeStrings[conditionCode]);
} }
break; break;
case ZYDIS_MNEMONIC_CMPPD: case ZYDIS_MNEMONIC_CMPPD:
if (conditionCode < 0x08) if (conditionCode < 0x08)
{ {
return ZydisStringBufferAppendFormat(buffer, bufferLen, return ZydisStringAppendFormatC(
ZYDIS_STRBUF_APPEND_MODE_DEFAULT, "cmp%spd", string, "cmp%spd", conditionCodeStrings[conditionCode]);
conditionCodeStrings[conditionCode]);
} }
break; break;
case ZYDIS_MNEMONIC_VCMPPS: case ZYDIS_MNEMONIC_VCMPPS:
if (conditionCode < 0x20) if (conditionCode < 0x20)
{ {
return ZydisStringBufferAppendFormat(buffer, bufferLen, return ZydisStringAppendFormatC(
ZYDIS_STRBUF_APPEND_MODE_DEFAULT, "vcmp%sps", string, "vcmp%sps", conditionCodeStrings[conditionCode]);
conditionCodeStrings[conditionCode]);
} }
break; break;
case ZYDIS_MNEMONIC_VCMPPD: case ZYDIS_MNEMONIC_VCMPPD:
if (conditionCode < 0x20) if (conditionCode < 0x20)
{ {
return ZydisStringBufferAppendFormat(buffer, bufferLen, return ZydisStringAppendFormatC(
ZYDIS_STRBUF_APPEND_MODE_DEFAULT, "vcmp%spd", string, "vcmp%spd", conditionCodeStrings[conditionCode]);
conditionCodeStrings[conditionCode]);
} }
break; break;
default: default:
@ -155,15 +186,15 @@ static ZydisStatus ZydisFormatterPrintMnemonic(const ZydisFormatter* formatter,
userData->ommitImmediate = ZYDIS_FALSE; userData->ommitImmediate = ZYDIS_FALSE;
// Default mnemonic printing // Default mnemonic printing
return defaultPrintMnemonic(formatter, buffer, bufferLen, instruction, userData); return defaultPrintMnemonic(formatter, string, instruction, userData);
} }
/* ---------------------------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------------------------- */
ZydisFormatterFormatOperandFunc defaultFormatOperandImm; ZydisFormatterOperandFunc defaultFormatOperandImm;
static ZydisStatus ZydisFormatterFormatOperandImm(const ZydisFormatter* formatter, static ZydisStatus ZydisFormatterFormatOperandImm(const ZydisFormatter* formatter,
char** buffer, size_t bufferLen, const ZydisDecodedInstruction* instruction, ZydisString* string, const ZydisDecodedInstruction* instruction,
const ZydisDecodedOperand* operand, ZydisCustomUserData* userData) const ZydisDecodedOperand* operand, ZydisCustomUserData* userData)
{ {
// The @c ZydisFormatterFormatMnemonic sinals us to omit the immediate (condition-code) // The @c ZydisFormatterFormatMnemonic sinals us to omit the immediate (condition-code)
@ -176,7 +207,7 @@ static ZydisStatus ZydisFormatterFormatOperandImm(const ZydisFormatter* formatte
} }
// Default immediate formatting // Default immediate formatting
return defaultFormatOperandImm(formatter, buffer, bufferLen, instruction, operand, userData); return defaultFormatOperandImm(formatter, string, instruction, operand, userData);
} }
/* ---------------------------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------------------------- */
@ -188,16 +219,16 @@ static ZydisStatus ZydisFormatterFormatOperandImm(const ZydisFormatter* formatte
void disassembleBuffer(ZydisDecoder* decoder, uint8_t* data, size_t length, ZydisBool installHooks) void disassembleBuffer(ZydisDecoder* decoder, uint8_t* data, size_t length, ZydisBool installHooks)
{ {
ZydisFormatter formatter; ZydisFormatter formatter;
ZydisFormatterInitEx(&formatter, ZYDIS_FORMATTER_STYLE_INTEL, ZydisFormatterInit(&formatter, ZYDIS_FORMATTER_STYLE_INTEL);
ZYDIS_FMTFLAG_FORCE_SEGMENTS | ZYDIS_FMTFLAG_FORCE_OPERANDSIZE, ZydisFormatterSetProperty(&formatter, ZYDIS_FORMATTER_PROP_FORCE_MEMSEG, ZYDIS_TRUE);
ZYDIS_FORMATTER_ADDR_ABSOLUTE, ZYDIS_FORMATTER_DISP_DEFAULT, ZYDIS_FORMATTER_IMM_DEFAULT); ZydisFormatterSetProperty(&formatter, ZYDIS_FORMATTER_PROP_FORCE_MEMSIZE, ZYDIS_TRUE);
if (installHooks) if (installHooks)
{ {
defaultPrintMnemonic = (ZydisFormatterFormatFunc)&ZydisFormatterPrintMnemonic; defaultPrintMnemonic = (ZydisFormatterFunc)&ZydisFormatterPrintMnemonic;
ZydisFormatterSetHook(&formatter, ZYDIS_FORMATTER_HOOK_PRINT_MNEMONIC, ZydisFormatterSetHook(&formatter, ZYDIS_FORMATTER_HOOK_PRINT_MNEMONIC,
(const void**)&defaultPrintMnemonic); (const void**)&defaultPrintMnemonic);
defaultFormatOperandImm = (ZydisFormatterFormatOperandFunc)&ZydisFormatterFormatOperandImm; defaultFormatOperandImm = (ZydisFormatterOperandFunc)&ZydisFormatterFormatOperandImm;
ZydisFormatterSetHook(&formatter, ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_IMM, ZydisFormatterSetHook(&formatter, ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_IMM,
(const void**)&defaultFormatOperandImm); (const void**)&defaultFormatOperandImm);
} }

View File

@ -39,21 +39,22 @@
#include <stdlib.h> #include <stdlib.h>
#include <Zydis/Zydis.h> #include <Zydis/Zydis.h>
typedef struct ZydisFuzzControlBlock_ { typedef struct ZydisFuzzControlBlock_
{
ZydisMachineMode machineMode; ZydisMachineMode machineMode;
ZydisAddressWidth addressWidth; ZydisAddressWidth addressWidth;
ZydisDecodeGranularity granularity; ZydisBool decoderMode[ZYDIS_DECODER_MODE_MAX_VALUE + 1];
ZydisFormatterStyle formatterStyle; ZydisFormatterStyle formatterStyle;
ZydisFormatterFlags formatterFlags; uintptr_t formatterProperties[ZYDIS_FORMATTER_PROP_MAX_VALUE + 1];
ZydisFormatterAddressFormat formatterAddrFormat; char* string[16];
ZydisFormatterDisplacementFormat formatterDispFormat;
ZydisFormatterImmediateFormat formatterImmFormat;
} ZydisFuzzControlBlock; } ZydisFuzzControlBlock;
/* ============================================================================================== */ /* ============================================================================================== */
/* Entry point */ /* Entry point */
/* ============================================================================================== */ /* ============================================================================================== */
int doIteration();
int main() int main()
{ {
if (ZydisGetVersion() != ZYDIS_VERSION) if (ZydisGetVersion() != ZYDIS_VERSION)
@ -62,29 +63,76 @@ int main()
return EXIT_FAILURE; return EXIT_FAILURE;
} }
#ifdef ZYDIS_FUZZ_AFL_FAST
int finalRet;
while (__AFL_LOOP(1000))
{
finalRet = doIteration();
}
return finalRet;
#else
return doIteration();
#endif
}
#ifdef ZYDIS_FUZZ_AFL_FAST
# define ZYDIS_MAYBE_FPUTS(x, y)
#else
# define ZYDIS_MAYBE_FPUTS(x, y) fputs(x, y)
#endif
int doIteration()
{
ZydisFuzzControlBlock controlBlock; ZydisFuzzControlBlock controlBlock;
if (fread(&controlBlock, 1, sizeof(controlBlock), stdin) != sizeof(controlBlock)) if (fread(&controlBlock, 1, sizeof(controlBlock), stdin) != sizeof(controlBlock))
{ {
fputs("not enough bytes to fuzz\n", stderr); ZYDIS_MAYBE_FPUTS("not enough bytes to fuzz\n", stderr);
return EXIT_FAILURE; return EXIT_FAILURE;
} }
controlBlock.string[ZYDIS_ARRAY_SIZE(controlBlock.string) - 1] = 0;
ZydisDecoder decoder; ZydisDecoder decoder;
if (!ZYDIS_SUCCESS(ZydisDecoderInitEx(&decoder, controlBlock.machineMode, if (!ZYDIS_SUCCESS(
controlBlock.addressWidth, controlBlock.granularity))) ZydisDecoderInit(&decoder, controlBlock.machineMode, controlBlock.addressWidth)))
{ {
fputs("Failed to initialize decoder\n", stderr); ZYDIS_MAYBE_FPUTS("Failed to initialize decoder\n", stderr);
return EXIT_FAILURE; return EXIT_FAILURE;
} }
for (ZydisDecoderMode mode = 0; mode <= ZYDIS_DECODER_MODE_MAX_VALUE; ++mode)
{
if (!ZYDIS_SUCCESS(
ZydisDecoderEnableMode(&decoder, mode, controlBlock.decoderMode[mode] ? 1 : 0)))
{
ZYDIS_MAYBE_FPUTS("Failed to adjust decoder-mode\n", stderr);
return EXIT_FAILURE;
}
}
ZydisFormatter formatter; ZydisFormatter formatter;
if (!ZYDIS_SUCCESS(ZydisFormatterInitEx(&formatter, controlBlock.formatterStyle, if (!ZYDIS_SUCCESS(ZydisFormatterInit(&formatter, controlBlock.formatterStyle)))
controlBlock.formatterFlags, controlBlock.formatterAddrFormat,
controlBlock.formatterDispFormat, controlBlock.formatterImmFormat)))
{ {
fputs("failed to initialize instruction-formatter\n", stderr); ZYDIS_MAYBE_FPUTS("Failed to initialize instruction-formatter\n", stderr);
return EXIT_FAILURE; return EXIT_FAILURE;
} }
for (ZydisFormatterProperty prop = 0; prop <= ZYDIS_FORMATTER_PROP_MAX_VALUE; ++prop)
{
switch (prop)
{
case ZYDIS_FORMATTER_PROP_HEX_PREFIX:
case ZYDIS_FORMATTER_PROP_HEX_SUFFIX:
controlBlock.formatterProperties[prop] =
controlBlock.formatterProperties[prop] ? (uintptr_t)&controlBlock.string : 0;
break;
default:
break;
}
if (!ZYDIS_SUCCESS(ZydisFormatterSetProperty(&formatter, prop,
controlBlock.formatterProperties[prop])))
{
ZYDIS_MAYBE_FPUTS("Failed to set formatter-attribute\n", stderr);
return EXIT_FAILURE;
}
}
uint8_t readBuf[ZYDIS_MAX_INSTRUCTION_LENGTH * 1024]; uint8_t readBuf[ZYDIS_MAX_INSTRUCTION_LENGTH * 1024];
size_t numBytesRead; size_t numBytesRead;
@ -116,7 +164,7 @@ int main()
} }
} while (numBytesRead == sizeof(readBuf)); } while (numBytesRead == sizeof(readBuf));
return 0; return EXIT_SUCCESS;
} }
/* ============================================================================================== */ /* ============================================================================================== */

View File

@ -32,6 +32,7 @@
#include <errno.h> #include <errno.h>
#include <time.h> #include <time.h>
#include <Zydis/Zydis.h> #include <Zydis/Zydis.h>
#include <inttypes.h>
#if defined(ZYDIS_WINDOWS) #if defined(ZYDIS_WINDOWS)
# include <Windows.h> # include <Windows.h>
@ -152,26 +153,32 @@ void adjustProcessAndThreadPriority()
/* Internal functions */ /* Internal functions */
/* ============================================================================================== */ /* ============================================================================================== */
uint64_t processBuffer(const char* buffer, size_t length, ZydisDecodeGranularity granularity, uint64_t processBuffer(const char* buffer, size_t length, ZydisBool minimalMode, ZydisBool format)
ZydisBool format)
{ {
ZydisDecoder decoder; ZydisDecoder decoder;
if (!ZYDIS_SUCCESS(ZydisDecoderInitEx(&decoder, if (!ZYDIS_SUCCESS(
ZYDIS_MACHINE_MODE_LONG_64, ZYDIS_ADDRESS_WIDTH_64, granularity))) ZydisDecoderInit(&decoder, ZYDIS_MACHINE_MODE_LONG_64, ZYDIS_ADDRESS_WIDTH_64)))
{ {
fputs("Failed to initialize decoder\n", stderr); fputs("Failed to initialize decoder\n", stderr);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
if (!ZYDIS_SUCCESS(
ZydisDecoderEnableMode(&decoder, ZYDIS_DECODER_MODE_MINIMAL, minimalMode)))
{
fputs("Failed to adjust decoder-mode\n", stderr);
exit(EXIT_FAILURE);
}
ZydisFormatter formatter; ZydisFormatter formatter;
if (format) if (format)
{ {
if (!ZYDIS_SUCCESS(ZydisFormatterInitEx(&formatter, ZYDIS_FORMATTER_STYLE_INTEL, if (!ZYDIS_SUCCESS(ZydisFormatterInit(&formatter, ZYDIS_FORMATTER_STYLE_INTEL)) ||
ZYDIS_FMTFLAG_FORCE_SEGMENTS | ZYDIS_FMTFLAG_FORCE_OPERANDSIZE, !ZYDIS_SUCCESS(ZydisFormatterSetProperty(&formatter,
ZYDIS_FORMATTER_ADDR_ABSOLUTE, ZYDIS_FORMATTER_DISP_DEFAULT, ZYDIS_FORMATTER_PROP_FORCE_MEMSEG, ZYDIS_TRUE)) ||
ZYDIS_FORMATTER_IMM_DEFAULT))) !ZYDIS_SUCCESS(ZydisFormatterSetProperty(&formatter,
ZYDIS_FORMATTER_PROP_FORCE_MEMSIZE, ZYDIS_TRUE)))
{ {
fputs("Failed to initialized instruction-formatter\n", stderr); fputs("Failed to initialize instruction-formatter\n", stderr);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
} }
@ -202,21 +209,20 @@ uint64_t processBuffer(const char* buffer, size_t length, ZydisDecodeGranularity
return count; return count;
} }
void testPerformance(const char* buffer, size_t length, ZydisDecodeGranularity granularity, void testPerformance(const char* buffer, size_t length, ZydisBool minimalMode, ZydisBool format)
ZydisBool format)
{ {
// Cache warmup // Cache warmup
processBuffer(buffer, length, granularity, format); processBuffer(buffer, length, minimalMode, format);
// Testing // Testing
uint64_t count = 0; uint64_t count = 0;
StartCounter(); StartCounter();
for (uint8_t j = 0; j < 100; ++j) for (uint8_t j = 0; j < 100; ++j)
{ {
count += processBuffer(buffer, length, granularity, format); count += processBuffer(buffer, length, minimalMode, format);
} }
printf("Granularity %d, Formatting %d, Instructions: %6.2fM, Time: %8.2f msec\n", printf("Minimal-Mode %d, Formatting %d, Instructions: %6.2fM, Time: %8.2f msec\n",
granularity, format, (double)count / 1000000, GetCounter()); minimalMode, format, (double)count / 1000000, GetCounter());
} }
void generateTestData(FILE* file, uint8_t encoding) void generateTestData(FILE* file, uint8_t encoding)
@ -393,7 +399,7 @@ int main(int argc, char** argv)
} }
rewind(file); rewind(file);
if (fread(buffer, 1, length, file) != length) if (fread(buffer, 1, length, file) != (size_t)length)
{ {
fprintf(stderr, fprintf(stderr,
"Could not read %" PRIu64 " bytes from file \"%s\"", (uint64_t)length, &buf[0]); "Could not read %" PRIu64 " bytes from file \"%s\"", (uint64_t)length, &buf[0]);
@ -401,9 +407,9 @@ int main(int argc, char** argv)
} }
printf("Testing %s ...\n", tests[i].encoding); printf("Testing %s ...\n", tests[i].encoding);
testPerformance(buffer, length, ZYDIS_DECODE_GRANULARITY_MINIMAL, ZYDIS_FALSE); testPerformance(buffer, length, ZYDIS_TRUE , ZYDIS_FALSE);
testPerformance(buffer, length, ZYDIS_DECODE_GRANULARITY_FULL , ZYDIS_FALSE); testPerformance(buffer, length, ZYDIS_FALSE, ZYDIS_FALSE);
testPerformance(buffer, length, ZYDIS_DECODE_GRANULARITY_FULL , ZYDIS_TRUE ); testPerformance(buffer, length, ZYDIS_FALSE, ZYDIS_TRUE );
puts(""); puts("");
NextFile1: NextFile1:

188
examples/ZydisWinKernel.c Normal file
View File

@ -0,0 +1,188 @@
/***************************************************************************************************
Zyan Disassembler Engine (Zydis)
Original Author : Matthijs Lavrijsen
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
***************************************************************************************************/
/**
* @file
* @brief Windows kernel mode driver sample.
*
* This is a Windows kernel mode driver. It links against the kernel mode-compatible version of Zydis.
* The driver finds its own entry point and decodes and prints the disassembly of this function.
* To view the log, either attach a kernel debugger or use a tool like Sysinternals DebugView.
*/
#include <wdm.h>
#include <ntimage.h>
#include <stdio.h>
#include <stdarg.h>
#include "Zydis/Zydis.h"
/* ============================================================================================== */
/* Forward declarations */
/* ============================================================================================== */
NTKERNELAPI
PVOID
NTAPI
RtlPcToFileHeader(
_In_ PVOID PcValue,
_Out_ PVOID *BaseOfImage
);
NTKERNELAPI
PIMAGE_NT_HEADERS
NTAPI
RtlImageNtHeader(
_In_ PVOID ImageBase
);
#if defined(ZYDIS_CLANG) || defined(ZYDIS_GNUC)
__attribute__((section("INIT")))
#endif
DRIVER_INITIALIZE
DriverEntry;
#if defined(ALLOC_PRAGMA) && !(defined(ZYDIS_CLANG) || defined(ZYDIS_GNUC))
#pragma alloc_text(INIT, DriverEntry)
#endif
/* ============================================================================================== */
/* Helper functions */
/* ============================================================================================== */
VOID
Print(
_In_ PCCH Format,
_In_ ...
)
{
CHAR message[512];
va_list argList;
va_start(argList, Format);
const int n = _vsnprintf_s(message, sizeof(message), sizeof(message) - 1, Format, argList);
message[n] = '\0';
vDbgPrintExWithPrefix("[ZYDIS] ", DPFLTR_IHVDRIVER_ID, DPFLTR_ERROR_LEVEL, message, argList);
va_end(argList);
}
/* ============================================================================================== */
/* Entry point */
/* ============================================================================================== */
_Use_decl_annotations_
NTSTATUS
DriverEntry(
_In_ PDRIVER_OBJECT DriverObject,
_In_ PUNICODE_STRING RegistryPath
)
{
PAGED_CODE();
UNREFERENCED_PARAMETER(RegistryPath);
if (ZydisGetVersion() != ZYDIS_VERSION)
{
Print("Invalid zydis version\n");
return STATUS_UNKNOWN_REVISION;
}
// Get the driver's image base and PE headers
ULONG_PTR imageBase;
RtlPcToFileHeader((PVOID)DriverObject->DriverInit, (PVOID*)&imageBase);
if (imageBase == 0)
return STATUS_DRIVER_ENTRYPOINT_NOT_FOUND;
PIMAGE_NT_HEADERS ntHeaders = RtlImageNtHeader((PVOID)imageBase);
if (imageBase == 0)
return STATUS_INVALID_IMAGE_FORMAT;
// Get the section headers of the INIT section
PIMAGE_SECTION_HEADER section = IMAGE_FIRST_SECTION(ntHeaders);
PIMAGE_SECTION_HEADER initSection = NULL;
for (ULONG i = 0; i < ntHeaders->FileHeader.NumberOfSections; ++i)
{
if (memcmp(section->Name, "INIT", sizeof("INIT") - 1) == 0)
{
initSection = section;
break;
}
section++;
}
if (initSection == NULL)
return STATUS_NOT_FOUND;
// Get the RVAs of the entry point and import directory. If the import directory lies within the INIT section,
// stop disassembling when its address is reached. Otherwise, disassemble until the end of the INIT section.
const ULONG entryPointRva = (ULONG)((ULONG_PTR)DriverObject->DriverInit - imageBase);
const ULONG importDirRva = ntHeaders->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress;
SIZE_T length = initSection->VirtualAddress + initSection->SizeOfRawData - entryPointRva;
if (importDirRva > entryPointRva && importDirRva > initSection->VirtualAddress &&
importDirRva < initSection->VirtualAddress + initSection->SizeOfRawData)
length = importDirRva - entryPointRva;
Print("Driver image base: 0x%p, size: 0x%X\n", imageBase, ntHeaders->OptionalHeader.SizeOfImage);
Print("Entry point RVA: 0x%X (0x%p)\n", entryPointRva, DriverObject->DriverInit);
// Initialize Zydis decoder and formatter
ZydisDecoder decoder;
#ifdef _M_AMD64
if (!ZYDIS_SUCCESS(ZydisDecoderInit(&decoder, ZYDIS_MACHINE_MODE_LONG_64, ZYDIS_ADDRESS_WIDTH_64)))
#else
if (!ZYDIS_SUCCESS(ZydisDecoderInit(&decoder, ZYDIS_MACHINE_MODE_LONG_COMPAT_32, ZYDIS_ADDRESS_WIDTH_32)))
#endif
return STATUS_DRIVER_INTERNAL_ERROR;
ZydisFormatter formatter;
if (!ZYDIS_SUCCESS(ZydisFormatterInit(&formatter, ZYDIS_FORMATTER_STYLE_INTEL)))
return STATUS_DRIVER_INTERNAL_ERROR;
SIZE_T readOffset = 0;
ZydisDecodedInstruction instruction;
ZydisStatus status;
CHAR printBuffer[128];
// Start the decode loop
while ((status = ZydisDecoderDecodeBuffer(&decoder, (PVOID)(imageBase + entryPointRva + readOffset),
length - readOffset, (ULONG_PTR)(imageBase + entryPointRva + readOffset), &instruction)) != ZYDIS_STATUS_NO_MORE_DATA)
{
NT_ASSERT(ZYDIS_SUCCESS(status));
if (!ZYDIS_SUCCESS(status))
{
readOffset++;
continue;
}
// Format and print the instruction
ZydisFormatterFormatInstruction(
&formatter, &instruction, printBuffer, sizeof(printBuffer));
Print("+%-4X 0x%-16llX\t\t%s\n", readOffset, instruction.instrAddress, printBuffer);
readOffset += instruction.length;
}
// Return an error status so that the driver does not have to be unloaded after running.
return STATUS_UNSUCCESSFUL;
}
/* ============================================================================================== */

View File

@ -35,49 +35,90 @@
#include <Zydis/Defines.h> #include <Zydis/Defines.h>
/* ============================================================================================== */ /* ============================================================================================== */
/* Integral types */ /* Integer types */
/* ============================================================================================== */ /* ============================================================================================== */
// Fixed width integer types. #if !defined(ZYDIS_NO_LIBC)
#if defined(ZYDIS_WINKERNEL) // If is LibC present, we use stdint types.
# if !defined(ZYDIS_MSVC)
# error "Windows kernel drivers are only supported with MSVC"
# endif
typedef unsigned __int8 uint8_t;
typedef unsigned __int16 uint16_t;
typedef unsigned __int32 uint32_t;
typedef unsigned __int64 uint64_t;
typedef __int8 int8_t;
typedef __int16 int16_t;
typedef __int32 int32_t;
typedef __int64 int64_t;
# define UINT8_MAX (255)
# define UINT16_MAX (65535U)
# define UINT32_MAX (4294967295UL)
# define UINT64_MAX (18446744073709551615ULL)
# define INT8_MAX (127)
# define INT8_MIN (-128)
# define INT16_MAX (32767)
# define INT16_MIN (-32767-1)
# define INT32_MIN (-2147483647L-1)
# define INT32_MAX (2147483647L)
# define INT64_MIN (-9223372036854775807LL-1)
# define INT64_MAX (9223372036854775807LL)
# define PRIX8 "hhX"
# define PRIX16 "hX"
# define PRIX32 "X"
# define PRIX64 "llX"
#else
# include <stdint.h> # include <stdint.h>
# include <inttypes.h> # include <stddef.h>
typedef uint8_t ZydisU8;
typedef uint16_t ZydisU16;
typedef uint32_t ZydisU32;
typedef uint64_t ZydisU64;
typedef int8_t ZydisI8;
typedef int16_t ZydisI16;
typedef int32_t ZydisI32;
typedef int64_t ZydisI64;
typedef size_t ZydisUSize;
typedef ptrdiff_t ZydisISize;
typedef uintptr_t ZydisUPointer;
typedef intptr_t ZydisIPointer;
#else
// No LibC, use compiler built-in types / macros.
# if defined(ZYDIS_MSVC)
typedef unsigned __int8 ZydisU8;
typedef unsigned __int16 ZydisU16;
typedef unsigned __int32 ZydisU32;
typedef unsigned __int64 ZydisU64;
typedef signed __int8 ZydisI8;
typedef signed __int16 ZydisI16;
typedef signed __int32 ZydisI32;
typedef signed __int64 ZydisI64;
# if _WIN64
typedef ZydisU64 ZydisUSize;
typedef ZydisI64 ZydisISize;
typedef ZydisU64 ZydisUPointer;
typedef ZydisI64 ZydisIPointer;
# else
typedef ZydisU32 ZydisUSize;
typedef ZydisI32 ZydisISize;
typedef ZydisU32 ZydisUPointer;
typedef ZydisI32 ZydisIPointer;
# endif
# elif defined(ZYDIS_GNUC)
typedef __UINT8_TYPE__ ZydisU8;
typedef __UINT16_TYPE__ ZydisU16;
typedef __UINT32_TYPE__ ZydisU32;
typedef __UINT64_TYPE__ ZydisU64;
typedef __INT8_TYPE__ ZydisI8;
typedef __INT16_TYPE__ ZydisI16;
typedef __INT32_TYPE__ ZydisI32;
typedef __INT64_TYPE__ ZydisI64;
typedef __SIZE_TYPE__ ZydisUSize;
typedef __PTRDIFF_TYPE__ ZydisISize;
typedef __UINTPTR_TYPE__ ZydisUPointer;
typedef __INTPTR_TYPE__ ZydisIPointer;
# else
# error "Unsupported compiler for no-libc mode."
# endif
#endif #endif
// size_t, ptrdiff_t // Verify size assumptions.
#include <stddef.h> ZYDIS_STATIC_ASSERT(sizeof(ZydisU8 ) == 1 );
ZYDIS_STATIC_ASSERT(sizeof(ZydisU16 ) == 2 );
ZYDIS_STATIC_ASSERT(sizeof(ZydisU32 ) == 4 );
ZYDIS_STATIC_ASSERT(sizeof(ZydisU64 ) == 8 );
ZYDIS_STATIC_ASSERT(sizeof(ZydisI8 ) == 1 );
ZYDIS_STATIC_ASSERT(sizeof(ZydisI16 ) == 2 );
ZYDIS_STATIC_ASSERT(sizeof(ZydisI32 ) == 4 );
ZYDIS_STATIC_ASSERT(sizeof(ZydisI64 ) == 8 );
ZYDIS_STATIC_ASSERT(sizeof(ZydisUSize ) == sizeof(void*)); // TODO: This one is incorrect!
ZYDIS_STATIC_ASSERT(sizeof(ZydisISize ) == sizeof(void*)); // TODO: This one is incorrect!
ZYDIS_STATIC_ASSERT(sizeof(ZydisUPointer) == sizeof(void*));
ZYDIS_STATIC_ASSERT(sizeof(ZydisIPointer) == sizeof(void*));
#ifdef __cplusplus // Verify signedness assumptions (relies on size checks above).
extern "C" { ZYDIS_STATIC_ASSERT((ZydisI8 )-1 >> 1 < (ZydisI8 )((ZydisU8 )-1 >> 1));
#endif ZYDIS_STATIC_ASSERT((ZydisI16)-1 >> 1 < (ZydisI16)((ZydisU16)-1 >> 1));
ZYDIS_STATIC_ASSERT((ZydisI32)-1 >> 1 < (ZydisI32)((ZydisU32)-1 >> 1));
ZYDIS_STATIC_ASSERT((ZydisI64)-1 >> 1 < (ZydisI64)((ZydisU64)-1 >> 1));
/* ============================================================================================== */
/* NULL */
/* ============================================================================================== */
#define ZYDIS_NULL ((void*)0)
/* ============================================================================================== */ /* ============================================================================================== */
/* Boolean */ /* Boolean */
@ -89,12 +130,8 @@ extern "C" {
/** /**
* @briefs Defines the @c ZydisBool datatype. * @briefs Defines the @c ZydisBool datatype.
*/ */
typedef uint8_t ZydisBool; typedef ZydisU8 ZydisBool;
/* ============================================================================================== */ /* ============================================================================================== */
#ifdef __cplusplus
}
#endif
#endif /* ZYDIS_COMMONTYPES_H */ #endif /* ZYDIS_COMMONTYPES_H */

View File

@ -45,22 +45,22 @@ extern "C" {
/* Enums and types */ /* Enums and types */
/* ============================================================================================== */ /* ============================================================================================== */
/** /* ---------------------------------------------------------------------------------------------- */
* @brief Defines the @c ZydisDecodeGranularity datatype. /* Decoder mode */
*/ /* ---------------------------------------------------------------------------------------------- */
typedef uint8_t ZydisDecodeGranularity;
/** /**
* @brief Decoder modes defining how granular the instruction should be decoded. * @brief Defines the @c ZydisDecoderMode datatype.
*/ */
enum ZydisDecodeGranularities typedef ZydisU8 ZydisDecoderMode;
/**
* @brief Values that represent decoder-modes.
*/
enum ZydisDecoderModes
{ {
/** /**
* @brief Defaults to `ZYDIS_DECODE_GRANULARITY_FULL`. * @brief Enables minimal instruction decoding without semantic analysis.
*/
ZYDIS_DECODE_GRANULARITY_DEFAULT,
/**
* @brief Minimal instruction decoding without semantic analysis.
* *
* This mode provides access to the mnemonic, the instruction-length, the effective * This mode provides access to the mnemonic, the instruction-length, the effective
* operand-size, the effective address-width, some attributes (e.g. `ZYDIS_ATTRIB_IS_RELATIVE`) * operand-size, the effective address-width, some attributes (e.g. `ZYDIS_ATTRIB_IS_RELATIVE`)
@ -68,18 +68,72 @@ enum ZydisDecodeGranularities
* *
* Operands, most attributes and other specific information (like AVX info) are not * Operands, most attributes and other specific information (like AVX info) are not
* accessible in this mode. * accessible in this mode.
*
* This mode is NOT enabled by default.
*/ */
ZYDIS_DECODE_GRANULARITY_MINIMAL, ZYDIS_DECODER_MODE_MINIMAL,
/** /**
* @brief Full physical and semantic instruction-decoding. * @brief Enables the AMD-branch mode.
*
* Intel ignores the operand-size override-prefix (`0x66`) for all branches with 32-bit
* immediates and forces the operand-size of the instruction to 64-bit in 64-bit mode.
* In AMD-branch mode `0x66` is not ignored and changes the operand-size and the size of the
* immediate to 16-bit.
*
* This mode is NOT enabled by default.
*/ */
ZYDIS_DECODE_GRANULARITY_FULL, ZYDIS_DECODER_MODE_AMD_BRANCHES,
/**
* @brief Enables KNC compatibility-mode.
*
* KNC and KNL+ chips are sharing opcodes and encodings for some mask-related instructions.
* Enable this mode to use the old KNC specifications (different mnemonics, operands, ..).
*
* This mode is NOT enabled by default.
*/
ZYDIS_DECODER_MODE_KNC,
/**
* @brief Enables the MPX mode.
*
* The MPX isa-extension reuses (overrides) some of the widenop instruction opcodes.
*
* This mode is enabled by default.
*/
ZYDIS_DECODER_MODE_MPX,
/**
* @brief Enables the CET mode.
*
* The CET isa-extension reuses (overrides) some of the widenop instruction opcodes.
*
* This mode is enabled by default.
*/
ZYDIS_DECODER_MODE_CET,
/**
* @brief Enables the LZCNT mode.
*
* The LZCNT isa-extension reuses (overrides) some of the widenop instruction opcodes.
*
* This mode is enabled by default.
*/
ZYDIS_DECODER_MODE_LZCNT,
/**
* @brief Enables the TZCNT mode.
*
* The TZCNT isa-extension reuses (overrides) some of the widenop instruction opcodes.
*
* This mode is enabled by default.
*/
ZYDIS_DECODER_MODE_TZCNT,
/** /**
* @brief Maximum value of this enum. * @brief Maximum value of this enum.
*/ */
ZYDIS_DECODE_GRANULARITY_MAX_VALUE = ZYDIS_DECODE_GRANULARITY_FULL, ZYDIS_DECODER_MODE_MAX_VALUE = ZYDIS_DECODER_MODE_TZCNT
}; };
/* ---------------------------------------------------------------------------------------------- */
/* Decoder struct */
/* ---------------------------------------------------------------------------------------------- */
/** /**
* @brief Defines the @c ZydisDecoder struct. * @brief Defines the @c ZydisDecoder struct.
*/ */
@ -87,7 +141,7 @@ typedef struct ZydisDecoder_
{ {
ZydisMachineMode machineMode; ZydisMachineMode machineMode;
ZydisAddressWidth addressWidth; ZydisAddressWidth addressWidth;
ZydisDecodeGranularity granularity; ZydisBool decoderMode[ZYDIS_DECODER_MODE_MAX_VALUE + 1];
} ZydisDecoder; } ZydisDecoder;
/* ---------------------------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------------------------- */
@ -109,17 +163,16 @@ ZYDIS_EXPORT ZydisStatus ZydisDecoderInit(ZydisDecoder* decoder, ZydisMachineMod
ZydisAddressWidth addressWidth); ZydisAddressWidth addressWidth);
/** /**
* @brief Initializes the given @c ZydisDecoder instance. * @brief Enables or disables the specified decoder-mode.
* *
* @param decoder A pointer to the @c ZydisDecoder instance. * @param decoder A pointer to the @c ZydisDecoder instance.
* @param machineMode The machine mode. * @param mode The decoder mode.
* @param addressWidth The address width. * @param enabled `ZYDIS_TRUE` to enable, or `ZYDIS_FALSE` to disable the specified decoder-mode.
* @param granularity The decode granularity.
* *
* @return A zydis status code. * @return A zydis status code.
*/ */
ZYDIS_EXPORT ZydisStatus ZydisDecoderInitEx(ZydisDecoder* decoder, ZydisMachineMode machineMode, ZYDIS_EXPORT ZydisStatus ZydisDecoderEnableMode(ZydisDecoder* decoder, ZydisDecoderMode mode,
ZydisAddressWidth addressWidth, ZydisDecodeGranularity granularity); ZydisBool enabled);
/** /**
* @brief Decodes the instruction in the given input @c buffer. * @brief Decodes the instruction in the given input @c buffer.
@ -134,7 +187,7 @@ ZYDIS_EXPORT ZydisStatus ZydisDecoderInitEx(ZydisDecoder* decoder, ZydisMachineM
* @return A zydis status code. * @return A zydis status code.
*/ */
ZYDIS_EXPORT ZydisStatus ZydisDecoderDecodeBuffer(const ZydisDecoder* decoder, ZYDIS_EXPORT ZydisStatus ZydisDecoderDecodeBuffer(const ZydisDecoder* decoder,
const void* buffer, size_t bufferLen, uint64_t instructionPointer, const void* buffer, ZydisUSize bufferLen, ZydisU64 instructionPointer,
ZydisDecodedInstruction* instruction); ZydisDecodedInstruction* instruction);
/* ============================================================================================== */ /* ============================================================================================== */

View File

@ -46,6 +46,42 @@ extern "C" {
/* Decoded operand */ /* Decoded operand */
/* ============================================================================================== */ /* ============================================================================================== */
/* ---------------------------------------------------------------------------------------------- */
/* Memory type */
/* ---------------------------------------------------------------------------------------------- */
/**
* @brief Defines the @c ZydisMemoryOperandType datatype.
*/
typedef ZydisU8 ZydisMemoryOperandType;
/**
* @brief Values that represent memory-operand types.
*/
enum ZydisMemoryOperandTypes
{
ZYDIS_MEMOP_TYPE_INVALID,
/**
* @brief Normal memory operand.
*/
ZYDIS_MEMOP_TYPE_MEM,
/**
* @brief The memory operand is only used for address-generation. No real memory-access is
* caused.
*/
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.
*/
ZYDIS_MEMOP_TYPE_MIB
};
/* ---------------------------------------------------------------------------------------------- */
/* Decoded operand */
/* ---------------------------------------------------------------------------------------------- */
/** /**
* @brief Defines the @c ZydisDecodedOperand struct. * @brief Defines the @c ZydisDecodedOperand struct.
*/ */
@ -54,7 +90,7 @@ typedef struct ZydisDecodedOperand_
/** /**
* @brief The operand-id. * @brief The operand-id.
*/ */
uint8_t id; ZydisU8 id;
/** /**
* @brief The type of the operand. * @brief The type of the operand.
*/ */
@ -74,7 +110,7 @@ typedef struct ZydisDecodedOperand_
/** /**
* @brief The logical size of the operand (in bits). * @brief The logical size of the operand (in bits).
*/ */
uint16_t size; ZydisU16 size;
/** /**
* @brief The element-type. * @brief The element-type.
*/ */
@ -86,7 +122,7 @@ typedef struct ZydisDecodedOperand_
/** /**
* @brief The number of elements. * @brief The number of elements.
*/ */
uint16_t elementCount; ZydisU16 elementCount;
/** /**
* @brief Extended info for register-operands. * @brief Extended info for register-operands.
*/ */
@ -104,9 +140,9 @@ typedef struct ZydisDecodedOperand_
struct struct
{ {
/** /**
* @brief Signals, if the memory operand is only used for address generation. * @brief The type of the memory operand.
*/ */
ZydisBool isAddressGenOnly; ZydisMemoryOperandType type;
/** /**
* @brief The segment register. * @brief The segment register.
*/ */
@ -122,7 +158,7 @@ typedef struct ZydisDecodedOperand_
/** /**
* @brief The scale factor. * @brief The scale factor.
*/ */
uint8_t scale; ZydisU8 scale;
/** /**
* @brief Extended info for memory-operands with displacement. * @brief Extended info for memory-operands with displacement.
*/ */
@ -135,7 +171,7 @@ typedef struct ZydisDecodedOperand_
/** /**
* @brief The displacement value * @brief The displacement value
*/ */
int64_t value; ZydisI64 value;
} disp; } disp;
} mem; } mem;
/** /**
@ -143,8 +179,8 @@ typedef struct ZydisDecodedOperand_
*/ */
struct struct
{ {
uint16_t segment; ZydisU16 segment;
uint32_t offset; ZydisU32 offset;
} ptr; } ptr;
/** /**
* @brief Extended info for immediate-operands. * @brief Extended info for immediate-operands.
@ -165,12 +201,14 @@ typedef struct ZydisDecodedOperand_
*/ */
union union
{ {
uint64_t u; ZydisU64 u;
int64_t s; ZydisI64 s;
} value; } value;
} imm; } imm;
} ZydisDecodedOperand; } ZydisDecodedOperand;
/* ---------------------------------------------------------------------------------------------- */
/* ============================================================================================== */ /* ============================================================================================== */
/* Decoded instruction */ /* Decoded instruction */
/* ============================================================================================== */ /* ============================================================================================== */
@ -182,7 +220,7 @@ typedef struct ZydisDecodedOperand_
/** /**
* @brief Defines the @c ZydisInstructionAttributes datatype. * @brief Defines the @c ZydisInstructionAttributes datatype.
*/ */
typedef uint64_t ZydisInstructionAttributes; typedef ZydisU64 ZydisInstructionAttributes;
/** /**
* @brief The instruction has the ModRM byte. * @brief The instruction has the ModRM byte.
@ -365,12 +403,12 @@ typedef uint64_t ZydisInstructionAttributes;
/** /**
* @brief Defines the @c ZydisCPUFlag datatype. * @brief Defines the @c ZydisCPUFlag datatype.
*/ */
typedef uint8_t ZydisCPUFlag; typedef ZydisU8 ZydisCPUFlag;
/** /**
* @brief Defines the @c ZydisCPUFlagMask datatype. * @brief Defines the @c ZydisCPUFlagMask datatype.
*/ */
typedef uint32_t ZydisCPUFlagMask; typedef ZydisU32 ZydisCPUFlagMask;
/** /**
* @brief Values that represent CPU-flags. * @brief Values that represent CPU-flags.
@ -470,7 +508,7 @@ enum ZydisCPUFlags
/** /**
* @brief Defines the @c ZydisCPUFlagAction datatype. * @brief Defines the @c ZydisCPUFlagAction datatype.
*/ */
typedef uint8_t ZydisCPUFlagAction; typedef ZydisU8 ZydisCPUFlagAction;
/** /**
* @brief Values that represent CPU-flag actions. * @brief Values that represent CPU-flag actions.
@ -496,7 +534,7 @@ enum ZydisCPUFlagActions
/** /**
* @brief Defines the @c ZydisExceptionClass datatype. * @brief Defines the @c ZydisExceptionClass datatype.
*/ */
typedef uint8_t ZydisExceptionClass; typedef ZydisU8 ZydisExceptionClass;
/** /**
* @brief Values that represent exception-classes. * @brief Values that represent exception-classes.
@ -557,7 +595,7 @@ enum ZydisExceptionClasses
/** /**
* @brief Defines the @c ZydisVectorLength datatype. * @brief Defines the @c ZydisVectorLength datatype.
*/ */
typedef uint16_t ZydisVectorLength; typedef ZydisU16 ZydisVectorLength;
/** /**
* @brief Values that represent vector-lengths. * @brief Values that represent vector-lengths.
@ -581,7 +619,7 @@ enum ZydisVectorLengths
/** /**
* @brief Defines the @c ZydisMaskMode datatype. * @brief Defines the @c ZydisMaskMode datatype.
*/ */
typedef uint8_t ZydisMaskMode; typedef ZydisU8 ZydisMaskMode;
/** /**
* @brief Values that represent AVX mask-modes. * @brief Values that represent AVX mask-modes.
@ -611,7 +649,7 @@ enum ZydisMaskModes
/** /**
* @brief Defines the @c ZydisBroadcastMode datatype. * @brief Defines the @c ZydisBroadcastMode datatype.
*/ */
typedef uint8_t ZydisBroadcastMode; typedef ZydisU8 ZydisBroadcastMode;
/** /**
* @brief Values that represent AVX broadcast-modes. * @brief Values that represent AVX broadcast-modes.
@ -644,7 +682,7 @@ enum ZydisBroadcastModes
/** /**
* @brief Defines the @c ZydisRoundingMode datatype. * @brief Defines the @c ZydisRoundingMode datatype.
*/ */
typedef uint8_t ZydisRoundingMode; typedef ZydisU8 ZydisRoundingMode;
/** /**
* @brief Values that represent AVX rounding-modes. * @brief Values that represent AVX rounding-modes.
@ -681,7 +719,7 @@ enum ZydisRoundingModes
/** /**
* @brief Defines the @c ZydisSwizzleMode datatype. * @brief Defines the @c ZydisSwizzleMode datatype.
*/ */
typedef uint8_t ZydisSwizzleMode; typedef ZydisU8 ZydisSwizzleMode;
/** /**
* @brief Values that represent swizzle-modes. * @brief Values that represent swizzle-modes.
@ -710,7 +748,7 @@ enum ZydisSwizzleModes
/** /**
* @brief Defines the @c ZydisConversionMode datatype. * @brief Defines the @c ZydisConversionMode datatype.
*/ */
typedef uint8_t ZydisConversionMode; typedef ZydisU8 ZydisConversionMode;
/** /**
* @brief Values that represent conversion-modes. * @brief Values that represent conversion-modes.
@ -749,11 +787,11 @@ typedef struct ZydisDecodedInstruction_
/** /**
* @brief The length of the decoded instruction. * @brief The length of the decoded instruction.
*/ */
uint8_t length; ZydisU8 length;
/** /**
* @brief The raw bytes of the decoded instruction. * @brief The raw bytes of the decoded instruction.
*/ */
uint8_t data[ZYDIS_MAX_INSTRUCTION_LENGTH]; ZydisU8 data[ZYDIS_MAX_INSTRUCTION_LENGTH];
/** /**
* @brief The instruction-encoding (default, 3DNow, VEX, EVEX, XOP). * @brief The instruction-encoding (default, 3DNow, VEX, EVEX, XOP).
*/ */
@ -765,23 +803,23 @@ typedef struct ZydisDecodedInstruction_
/** /**
* @brief The instruction-opcode. * @brief The instruction-opcode.
*/ */
uint8_t opcode; ZydisU8 opcode;
/** /**
* @brief The stack width. * @brief The stack width.
*/ */
uint8_t stackWidth; ZydisU8 stackWidth;
/** /**
* @brief The effective operand width. * @brief The effective operand width.
*/ */
uint8_t operandWidth; ZydisU8 operandWidth;
/** /**
* @brief The effective address width. * @brief The effective address width.
*/ */
uint8_t addressWidth; ZydisU8 addressWidth;
/** /**
* @brief The number of instruction-operands. * @brief The number of instruction-operands.
*/ */
uint8_t operandCount; ZydisU8 operandCount;
/** /**
* @brief Detailed info for all instruction operands. * @brief Detailed info for all instruction operands.
*/ */
@ -791,17 +829,10 @@ typedef struct ZydisDecodedInstruction_
*/ */
ZydisInstructionAttributes attributes; ZydisInstructionAttributes attributes;
/** /**
* @brief The instruction address points at the current instruction (relative to the * @brief The instruction address points at the current instruction (based on the initial
* initial instruction pointer). * instruction pointer).
*/ */
uint64_t instrAddress; ZydisU64 instrAddress;
/**
* @brief The instruction pointer points at the address of the next instruction (relative
* to the initial instruction pointer).
*
* This field is used to properly format relative instructions.
*/
uint64_t instrPointer;
/** /**
* @brief Information about accessed CPU flags. * @brief Information about accessed CPU flags.
*/ */
@ -931,19 +962,19 @@ typedef struct ZydisDecodedInstruction_
*/ */
struct struct
{ {
uint8_t data[ZYDIS_MAX_INSTRUCTION_LENGTH - 1]; ZydisU8 data[ZYDIS_MAX_INSTRUCTION_LENGTH - 1];
uint8_t count; ZydisU8 count;
uint8_t hasF0; ZydisU8 hasF0;
uint8_t hasF3; ZydisU8 hasF3;
uint8_t hasF2; ZydisU8 hasF2;
uint8_t has2E; ZydisU8 has2E;
uint8_t has36; ZydisU8 has36;
uint8_t has3E; ZydisU8 has3E;
uint8_t has26; ZydisU8 has26;
uint8_t has64; ZydisU8 has64;
uint8_t has65; ZydisU8 has65;
uint8_t has66; ZydisU8 has66;
uint8_t has67; ZydisU8 has67;
} prefixes; } prefixes;
/** /**
* @brief Detailed info about the REX-prefix. * @brief Detailed info about the REX-prefix.
@ -957,23 +988,23 @@ typedef struct ZydisDecodedInstruction_
/** /**
* @brief The raw bytes of the prefix. * @brief The raw bytes of the prefix.
*/ */
uint8_t data[1]; ZydisU8 data[1];
/** /**
* @brief 64-bit operand-size promotion. * @brief 64-bit operand-size promotion.
*/ */
uint8_t W; ZydisU8 W;
/** /**
* @brief Extension of the ModRM.reg field. * @brief Extension of the ModRM.reg field.
*/ */
uint8_t R; ZydisU8 R;
/** /**
* @brief Extension of the SIB.index field. * @brief Extension of the SIB.index field.
*/ */
uint8_t X; ZydisU8 X;
/** /**
* @brief Extension of the ModRM.rm, SIB.base, or opcode.reg field. * @brief Extension of the ModRM.rm, SIB.base, or opcode.reg field.
*/ */
uint8_t B; ZydisU8 B;
} rex; } rex;
/** /**
* @brief Detailed info about the XOP-prefix. * @brief Detailed info about the XOP-prefix.
@ -987,39 +1018,39 @@ typedef struct ZydisDecodedInstruction_
/** /**
* @brief The raw bytes of the prefix. * @brief The raw bytes of the prefix.
*/ */
uint8_t data[3]; ZydisU8 data[3];
/** /**
* @brief Extension of the ModRM.reg field (inverted). * @brief Extension of the ModRM.reg field (inverted).
*/ */
uint8_t R; ZydisU8 R;
/** /**
* @brief Extension of the SIB.index field (inverted). * @brief Extension of the SIB.index field (inverted).
*/ */
uint8_t X; ZydisU8 X;
/** /**
* @brief Extension of the ModRM.rm, SIB.base, or opcode.reg field (inverted). * @brief Extension of the ModRM.rm, SIB.base, or opcode.reg field (inverted).
*/ */
uint8_t B; ZydisU8 B;
/** /**
* @brief Opcode-map specifier. * @brief Opcode-map specifier.
*/ */
uint8_t m_mmmm; ZydisU8 m_mmmm;
/** /**
* @brief 64-bit operand-size promotion or opcode-extension. * @brief 64-bit operand-size promotion or opcode-extension.
*/ */
uint8_t W; ZydisU8 W;
/** /**
* @brief NDS register specifier (inverted). * @brief NDS register specifier (inverted).
*/ */
uint8_t vvvv; ZydisU8 vvvv;
/** /**
* @brief Vector-length specifier. * @brief Vector-length specifier.
*/ */
uint8_t L; ZydisU8 L;
/** /**
* @brief Compressed legacy prefix. * @brief Compressed legacy prefix.
*/ */
uint8_t pp; ZydisU8 pp;
} xop; } xop;
/** /**
* @brief Detailed info about the VEX-prefix. * @brief Detailed info about the VEX-prefix.
@ -1033,39 +1064,39 @@ typedef struct ZydisDecodedInstruction_
/** /**
* @brief The raw bytes of the prefix. * @brief The raw bytes of the prefix.
*/ */
uint8_t data[3]; ZydisU8 data[3];
/** /**
* @brief Extension of the ModRM.reg field (inverted). * @brief Extension of the ModRM.reg field (inverted).
*/ */
uint8_t R; ZydisU8 R;
/** /**
* @brief Extension of the SIB.index field (inverted). * @brief Extension of the SIB.index field (inverted).
*/ */
uint8_t X; ZydisU8 X;
/** /**
* @brief Extension of the ModRM.rm, SIB.base, or opcode.reg field (inverted). * @brief Extension of the ModRM.rm, SIB.base, or opcode.reg field (inverted).
*/ */
uint8_t B; ZydisU8 B;
/** /**
* @brief Opcode-map specifier. * @brief Opcode-map specifier.
*/ */
uint8_t m_mmmm; ZydisU8 m_mmmm;
/** /**
* @brief 64-bit operand-size promotion or opcode-extension. * @brief 64-bit operand-size promotion or opcode-extension.
*/ */
uint8_t W; ZydisU8 W;
/** /**
* @brief NDS register specifier (inverted). * @brief NDS register specifier (inverted).
*/ */
uint8_t vvvv; ZydisU8 vvvv;
/** /**
* @brief Vector-length specifier. * @brief Vector-length specifier.
*/ */
uint8_t L; ZydisU8 L;
/** /**
* @brief Compressed legacy prefix. * @brief Compressed legacy prefix.
*/ */
uint8_t pp; ZydisU8 pp;
} vex; } vex;
/** /**
* @brief Detailed info about the EVEX-prefix. * @brief Detailed info about the EVEX-prefix.
@ -1079,63 +1110,63 @@ typedef struct ZydisDecodedInstruction_
/** /**
* @brief The raw bytes of the prefix. * @brief The raw bytes of the prefix.
*/ */
uint8_t data[4]; ZydisU8 data[4];
/** /**
* @brief Extension of the ModRM.reg field (inverted). * @brief Extension of the ModRM.reg field (inverted).
*/ */
uint8_t R; ZydisU8 R;
/** /**
* @brief Extension of the SIB.index/vidx field (inverted). * @brief Extension of the SIB.index/vidx field (inverted).
*/ */
uint8_t X; ZydisU8 X;
/** /**
* @brief Extension of the ModRM.rm or SIB.base field (inverted). * @brief Extension of the ModRM.rm or SIB.base field (inverted).
*/ */
uint8_t B; ZydisU8 B;
/** /**
* @brief High-16 register specifier modifier (inverted). * @brief High-16 register specifier modifier (inverted).
*/ */
uint8_t R2; ZydisU8 R2;
/** /**
* @brief Opcode-map specifier. * @brief Opcode-map specifier.
*/ */
uint8_t mm; ZydisU8 mm;
/** /**
* @brief 64-bit operand-size promotion or opcode-extension. * @brief 64-bit operand-size promotion or opcode-extension.
*/ */
uint8_t W; ZydisU8 W;
/** /**
* @brief NDS register specifier (inverted). * @brief NDS register specifier (inverted).
*/ */
uint8_t vvvv; ZydisU8 vvvv;
/** /**
* @brief Compressed legacy prefix. * @brief Compressed legacy prefix.
*/ */
uint8_t pp; ZydisU8 pp;
/** /**
* @brief Zeroing/Merging. * @brief Zeroing/Merging.
*/ */
uint8_t z; ZydisU8 z;
/** /**
* @brief Vector-length specifier or rounding-control (most significant bit). * @brief Vector-length specifier or rounding-control (most significant bit).
*/ */
uint8_t L2; ZydisU8 L2;
/** /**
* @brief Vector-length specifier or rounding-control (least significant bit). * @brief Vector-length specifier or rounding-control (least significant bit).
*/ */
uint8_t L; ZydisU8 L;
/** /**
* @brief Broadcast/RC/SAE Context. * @brief Broadcast/RC/SAE Context.
*/ */
uint8_t b; ZydisU8 b;
/** /**
* @brief High-16 NDS/VIDX register specifier. * @brief High-16 NDS/VIDX register specifier.
*/ */
uint8_t V2; ZydisU8 V2;
/** /**
* @brief Embedded opmask register specifier. * @brief Embedded opmask register specifier.
*/ */
uint8_t aaa; ZydisU8 aaa;
} evex; } evex;
/** /**
* @brief Detailed info about the MVEX-prefix. * @brief Detailed info about the MVEX-prefix.
@ -1149,55 +1180,55 @@ typedef struct ZydisDecodedInstruction_
/** /**
* @brief The raw bytes of the prefix. * @brief The raw bytes of the prefix.
*/ */
uint8_t data[4]; ZydisU8 data[4];
/** /**
* @brief Extension of the ModRM.reg field (inverted). * @brief Extension of the ModRM.reg field (inverted).
*/ */
uint8_t R; ZydisU8 R;
/** /**
* @brief Extension of the SIB.index/vidx field (inverted). * @brief Extension of the SIB.index/vidx field (inverted).
*/ */
uint8_t X; ZydisU8 X;
/** /**
* @brief Extension of the ModRM.rm or SIB.base field (inverted). * @brief Extension of the ModRM.rm or SIB.base field (inverted).
*/ */
uint8_t B; ZydisU8 B;
/** /**
* @brief High-16 register specifier modifier (inverted). * @brief High-16 register specifier modifier (inverted).
*/ */
uint8_t R2; ZydisU8 R2;
/** /**
* @brief Opcode-map specifier. * @brief Opcode-map specifier.
*/ */
uint8_t mmmm; ZydisU8 mmmm;
/** /**
* @brief 64-bit operand-size promotion or opcode-extension. * @brief 64-bit operand-size promotion or opcode-extension.
*/ */
uint8_t W; ZydisU8 W;
/** /**
* @brief NDS register specifier (inverted). * @brief NDS register specifier (inverted).
*/ */
uint8_t vvvv; ZydisU8 vvvv;
/** /**
* @brief Compressed legacy prefix. * @brief Compressed legacy prefix.
*/ */
uint8_t pp; ZydisU8 pp;
/** /**
* @brief Non-temporal/eviction hint. * @brief Non-temporal/eviction hint.
*/ */
uint8_t E; ZydisU8 E;
/** /**
* @brief Swizzle/broadcast/up-convert/down-convert/static-rounding controls. * @brief Swizzle/broadcast/up-convert/down-convert/static-rounding controls.
*/ */
uint8_t SSS; ZydisU8 SSS;
/** /**
* @brief High-16 NDS/VIDX register specifier. * @brief High-16 NDS/VIDX register specifier.
*/ */
uint8_t V2; ZydisU8 V2;
/** /**
* @brief Embedded opmask register specifier. * @brief Embedded opmask register specifier.
*/ */
uint8_t kkk; ZydisU8 kkk;
} mvex; } mvex;
/** /**
* @brief Detailed info about the ModRM-byte. * @brief Detailed info about the ModRM-byte.
@ -1205,10 +1236,10 @@ typedef struct ZydisDecodedInstruction_
struct struct
{ {
ZydisBool isDecoded; ZydisBool isDecoded;
uint8_t data[1]; ZydisU8 data[1];
uint8_t mod; ZydisU8 mod;
uint8_t reg; ZydisU8 reg;
uint8_t rm; ZydisU8 rm;
} modrm; } modrm;
/** /**
* @brief Detailed info about the SIB-byte. * @brief Detailed info about the SIB-byte.
@ -1216,10 +1247,10 @@ typedef struct ZydisDecodedInstruction_
struct struct
{ {
ZydisBool isDecoded; ZydisBool isDecoded;
uint8_t data[1]; ZydisU8 data[1];
uint8_t scale; ZydisU8 scale;
uint8_t index; ZydisU8 index;
uint8_t base; ZydisU8 base;
} sib; } sib;
/** /**
* @brief Detailed info about displacement-bytes. * @brief Detailed info about displacement-bytes.
@ -1229,16 +1260,16 @@ typedef struct ZydisDecodedInstruction_
/** /**
* @brief The displacement value * @brief The displacement value
*/ */
int64_t value; ZydisI64 value;
/** /**
* @brief The physical displacement size, in bits. * @brief The physical displacement size, in bits.
*/ */
uint8_t size; ZydisU8 size;
/** /**
* @brief The offset of the displacement data, relative to the beginning of the * @brief The offset of the displacement data, relative to the beginning of the
* instruction, in bytes. * instruction, in bytes.
*/ */
uint8_t offset; ZydisU8 offset;
} disp; } disp;
/** /**
* @brief Detailed info about immediate-bytes. * @brief Detailed info about immediate-bytes.
@ -1259,18 +1290,18 @@ typedef struct ZydisDecodedInstruction_
*/ */
union union
{ {
uint64_t u; ZydisU64 u;
int64_t s; ZydisI64 s;
} value; } value;
/** /**
* @brief The physical immediate size, in bits. * @brief The physical immediate size, in bits.
*/ */
uint8_t size; ZydisU8 size;
/** /**
* @brief The offset of the immediate data, relative to the beginning of the * @brief The offset of the immediate data, relative to the beginning of the
* instruction, in bytes. * instruction, in bytes.
*/ */
uint8_t offset; ZydisU8 offset;
} imm[2]; } imm[2];
} raw; } raw;
} ZydisDecodedInstruction; } ZydisDecodedInstruction;

View File

@ -72,17 +72,21 @@
#elif defined(__posix) #elif defined(__posix)
# define ZYDIS_POSIX # define ZYDIS_POSIX
#else #else
# error "Unsupported platform detected" # define ZYDIS_UNKNOWN_PLATFORM
#endif #endif
/* ============================================================================================== */ /* ============================================================================================== */
/* Architecture detection */ /* Architecture detection */
/* ============================================================================================== */ /* ============================================================================================== */
#if defined (_M_AMD64) || defined (__x86_64__) #if defined(_M_AMD64) || defined(__x86_64__)
# define ZYDIS_X64 # define ZYDIS_X64
#elif defined (_M_IX86) || defined (__i386__) #elif defined(_M_IX86) || defined(__i386__)
# define ZYDIS_X86 # define ZYDIS_X86
#elif defined(_M_ARM64) || defined(__aarch64__)
# define ZYDIS_AARCH64
#elif defined(_M_ARM) || defined(_M_ARMT) || defined(__arm__) || defined(__thumb__)
# define ZYDIS_ARM
#else #else
# error "Unsupported architecture detected" # error "Unsupported architecture detected"
#endif #endif
@ -104,7 +108,7 @@
# define ZYDIS_DEBUG # define ZYDIS_DEBUG
# endif # endif
#else #else
# error "Unsupported compiler detected" # define ZYDIS_RELEASE
#endif #endif
/* ============================================================================================== */ /* ============================================================================================== */
@ -121,7 +125,7 @@
/* Debugging and optimization macros */ /* Debugging and optimization macros */
/* ============================================================================================== */ /* ============================================================================================== */
#if defined(ZYDIS_WINKERNEL) #if defined(ZYDIS_NO_LIBC)
# define ZYDIS_ASSERT(condition) # define ZYDIS_ASSERT(condition)
#else #else
# include <assert.h> # include <assert.h>
@ -133,7 +137,7 @@
# if __has_builtin(__builtin_unreachable) # if __has_builtin(__builtin_unreachable)
# define ZYDIS_UNREACHABLE __builtin_unreachable() # define ZYDIS_UNREACHABLE __builtin_unreachable()
# else # else
# define ZYDIS_UNREACHABLE # define ZYDIS_UNREACHABLE for(;;)
# endif # endif
# elif defined(ZYDIS_GCC) && ((__GNUC__ == 4 && __GNUC_MINOR__ > 4) || __GNUC__ > 4) # elif defined(ZYDIS_GCC) && ((__GNUC__ == 4 && __GNUC_MINOR__ > 4) || __GNUC__ > 4)
# define ZYDIS_UNREACHABLE __builtin_unreachable() # define ZYDIS_UNREACHABLE __builtin_unreachable()
@ -147,10 +151,10 @@
# elif defined(ZYDIS_MSVC) # elif defined(ZYDIS_MSVC)
# define ZYDIS_UNREACHABLE __assume(0) # define ZYDIS_UNREACHABLE __assume(0)
# else # else
# define ZYDIS_UNREACHABLE # define ZYDIS_UNREACHABLE for(;;)
# endif # endif
#elif defined(ZYDIS_WINKERNEL) #elif defined(ZYDIS_NO_LIBC)
# define ZYDIS_UNREACHABLE # define ZYDIS_UNREACHABLE for(;;)
#else #else
# include <stdlib.h> # include <stdlib.h>
# define ZYDIS_UNREACHABLE { assert(0); abort(); } # define ZYDIS_UNREACHABLE { assert(0); abort(); }
@ -160,11 +164,25 @@
/* Utils */ /* Utils */
/* ============================================================================================== */ /* ============================================================================================== */
/**
* @brief Compiler-time assertion.
*/
#if __STDC_VERSION__ >= 201112L
# define ZYDIS_STATIC_ASSERT(x) _Static_assert(x, #x)
#else
# define ZYDIS_STATIC_ASSERT(x) typedef int ZYDIS_SASSERT_IMPL[(x) ? 1 : -1]
#endif
/** /**
* @brief Declares a bitfield. * @brief Declares a bitfield.
*/ */
#define ZYDIS_BITFIELD(x) : x #define ZYDIS_BITFIELD(x) : x
/**
* @brief Marks the specified parameter as unused.
*/
#define ZYDIS_UNUSED_PARAMETER(x) (void)(x)
/** /**
* @brief Calculates the size of an array. * @brief Calculates the size of an array.
*/ */

View File

@ -35,6 +35,7 @@
#include <Zydis/DecoderTypes.h> #include <Zydis/DecoderTypes.h>
#include <Zydis/Defines.h> #include <Zydis/Defines.h>
#include <Zydis/Status.h> #include <Zydis/Status.h>
#include <Zydis/String.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@ -44,10 +45,14 @@ extern "C" {
/* Enums and types */ /* Enums and types */
/* ============================================================================================== */ /* ============================================================================================== */
/* ---------------------------------------------------------------------------------------------- */
/* Formatter style */
/* ---------------------------------------------------------------------------------------------- */
/** /**
* @brief Defines the @c ZydisFormatterStyle datatype. * @brief Defines the `ZydisFormatterStyle` datatype.
*/ */
typedef uint8_t ZydisFormatterStyle; typedef ZydisU8 ZydisFormatterStyle;
/** /**
* @brief Values that represent formatter-styles. * @brief Values that represent formatter-styles.
@ -58,6 +63,7 @@ enum ZydisFormatterStyles
* @brief Generates intel-style disassembly. * @brief Generates intel-style disassembly.
*/ */
ZYDIS_FORMATTER_STYLE_INTEL, ZYDIS_FORMATTER_STYLE_INTEL,
/** /**
* @brief Maximum value of this enum. * @brief Maximum value of this enum.
*/ */
@ -65,155 +71,232 @@ enum ZydisFormatterStyles
}; };
/* ---------------------------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------------------------- */
/* Attributes */
/**
* @brief Defines the @c ZydisFormatFlags datatype.
*/
typedef uint32_t ZydisFormatterFlags;
/**
* @brief Formats the instruction in uppercase instead of lowercase.
*/
#define ZYDIS_FMTFLAG_UPPERCASE 0x00000001 // (1 << 0)
/**
* @brief Forces the formatter to always print the segment register of memory-operands, instead
* of ommiting implicit DS/SS segments.
*/
#define ZYDIS_FMTFLAG_FORCE_SEGMENTS 0x00000002 // (1 << 1)
/**
* @brief Forces the formatter to always print the size of memory-operands.
*/
#define ZYDIS_FMTFLAG_FORCE_OPERANDSIZE 0x00000004 // (1 << 2)
/* ---------------------------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------------------------- */
/** /**
* @brief Defines the @c ZydisFormatterAddressFormat datatype. * @brief Defines the `ZydisFormatterProperty` datatype.
*/ */
typedef uint8_t ZydisFormatterAddressFormat; typedef ZydisU8 ZydisFormatterProperty;
/**
* @brief Values that represent formatter-properties.
*/
enum ZydisFormatterProperties
{
/**
* @brief Controls the letter-case.
*
* Pass `ZYDIS_TRUE` as value to format in uppercase and `ZYDIS_FALSE` to format in lowercase.
*
* The default value is `ZYDIS_FALSE`.
*/
ZYDIS_FORMATTER_PROP_UPPERCASE,
/**
* @brief Controls the printing of segment prefixes.
*
* Pass `ZYDIS_TRUE` as value to force the formatter to always print the segment register of
* memory-operands or `ZYDIS_FALSE` to ommit implicit DS/SS segments.
*
* The default value is `ZYDIS_FALSE`.
*/
ZYDIS_FORMATTER_PROP_FORCE_MEMSEG,
/**
* @brief Controls the printing of memory-operand sizes.
*
* Pass `ZYDIS_TRUE` as value to force the formatter to always print the size of memory-operands
* or `ZYDIS_FALSE` to only print it on demand.
*
* The default value is `ZYDIS_FALSE`.
*/
ZYDIS_FORMATTER_PROP_FORCE_MEMSIZE,
/**
* @brief Controls the format of addresses.
*
* The default value is `ZYDIS_ADDR_FORMAT_ABSOLUTE`.
*/
ZYDIS_FORMATTER_PROP_ADDR_FORMAT,
/**
* @brief Controls the format of displacement values.
*
* The default value is `ZYDIS_DISP_FORMAT_HEX_SIGNED`.
*/
ZYDIS_FORMATTER_PROP_DISP_FORMAT,
/**
* @brief Controls the format of immediate values.
*
* The default value is `ZYDIS_IMM_FORMAT_HEX_UNSIGNED`.
*/
ZYDIS_FORMATTER_PROP_IMM_FORMAT,
/**
* @brief Controls the letter-case of hexadecimal values.
*
* Pass `ZYDIS_TRUE` as value to format in uppercase and `ZYDIS_FALSE` to format in lowercase.
*
* The default value is `ZYDIS_TRUE`.
*/
ZYDIS_FORMATTER_PROP_HEX_UPPERCASE,
/**
* @brief Sets the prefix for hexadecimal values.
*
* The default value is `"0x"`.
*/
ZYDIS_FORMATTER_PROP_HEX_PREFIX,
/**
* @brief Sets the suffix for hexadecimal values.
*
* The default value is `NULL`.
*/
ZYDIS_FORMATTER_PROP_HEX_SUFFIX,
/**
* @brief Controls the padding (minimum number of chars) of hexadecimal address values.
*
* The default value is `2`.
*/
ZYDIS_FORMATTER_PROP_HEX_PADDING_ADDR,
/**
* @brief Controls the padding (minimum number of chars) of hexadecimal displacement values.
*
* The default value is `2`.
*/
ZYDIS_FORMATTER_PROP_HEX_PADDING_DISP,
/**
* @brief Controls the padding (minimum number of chars) of hexadecimal immediate values.
*
* The default value is `2`.
*/
ZYDIS_FORMATTER_PROP_HEX_PADDING_IMM,
/**
* @brief Maximum value of this enum.
*/
ZYDIS_FORMATTER_PROP_MAX_VALUE = ZYDIS_FORMATTER_PROP_HEX_PADDING_IMM
};
/* ---------------------------------------------------------------------------------------------- */
/* Address format */
/* ---------------------------------------------------------------------------------------------- */
/** /**
* @brief Values that represent address-formats. * @brief Values that represent address-formats.
*/ */
enum ZydisFormatterAddressFormats enum ZydisAddressFormat
{ {
/**
* @brief Currently defaults to @c ZYDIS_FORMATTER_ADDR_ABSOLUTE.
*/
ZYDIS_FORMATTER_ADDR_DEFAULT,
/** /**
* @brief Displays absolute addresses instead of relative ones. * @brief Displays absolute addresses instead of relative ones.
*
* Using this value will cause the formatter to invoke `ZYDIS_FORMATTER_HOOK_PRINT_ADDRESS`
* for every address.
*/ */
ZYDIS_FORMATTER_ADDR_ABSOLUTE, ZYDIS_ADDR_FORMAT_ABSOLUTE,
/** /**
* @brief Uses signed hexadecimal values to display relative addresses. * @brief Uses signed hexadecimal values to display relative addresses.
* *
* Using this value will cause the formatter to either invoke
* `ZYDIS_FORMATTER_HOOK_PRINT_DISP` or `ZYDIS_FORMATTER_HOOK_PRINT_IMM` to format addresses.
*
* Examples: * Examples:
* "JMP 0x20" * - `"JMP 0x20"`
* "JMP -0x20" * - `"JMP -0x20"`
*/ */
ZYDIS_FORMATTER_ADDR_RELATIVE_SIGNED, ZYDIS_ADDR_FORMAT_RELATIVE_SIGNED,
/** /**
* @brief Uses unsigned hexadecimal values to display relative addresses. * @brief Uses unsigned hexadecimal values to display relative addresses.
* *
* Using this value will cause the formatter to either invoke
* `ZYDIS_FORMATTER_HOOK_PRINT_DISP` or `ZYDIS_FORMATTER_HOOK_PRINT_IMM` to format addresses.
*
* Examples: * Examples:
* "JMP 0x20" * - `"JMP 0x20"`
* "JMP 0xE0" * - `"JMP 0xE0"`
*/ */
ZYDIS_FORMATTER_ADDR_RELATIVE_UNSIGNED, ZYDIS_ADDR_FORMAT_RELATIVE_UNSIGNED,
/** /**
* @brief Maximum value of this enum. * @brief Maximum value of this enum.
*/ */
ZYDIS_FORMATTER_ADDR_MAX_VALUE = ZYDIS_FORMATTER_ADDR_RELATIVE_UNSIGNED ZYDIS_ADDR_FORMAT_MAX_VALUE = ZYDIS_ADDR_FORMAT_RELATIVE_UNSIGNED
}; };
/* ---------------------------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------------------------- */
/* Displacement format */
/** /* ---------------------------------------------------------------------------------------------- */
* @brief Defines the @c ZydisFormatterDisplacementFormat datatype.
*/
typedef uint8_t ZydisFormatterDisplacementFormat;
/** /**
* @brief Values that represent displacement-formats. * @brief Values that represent displacement-formats.
*/ */
enum ZydisFormatterDisplacementFormats enum ZydisDisplacementFormat
{ {
/**
* @brief Currently defaults to @c ZYDIS_FORMATTER_DISP_HEX_SIGNED.
*/
ZYDIS_FORMATTER_DISP_DEFAULT,
/** /**
* @brief Formats displacements as signed hexadecimal values. * @brief Formats displacements as signed hexadecimal values.
* *
* Examples: * Examples:
* "MOV EAX, DWORD PTR SS:[ESP+0x400]" * - `"MOV EAX, DWORD PTR SS:[ESP+0x400]"`
* "MOV EAX, DWORD PTR SS:[ESP-0x400]" * - `"MOV EAX, DWORD PTR SS:[ESP-0x400]"`
*/ */
ZYDIS_FORMATTER_DISP_HEX_SIGNED, ZYDIS_DISP_FORMAT_HEX_SIGNED,
/** /**
* @brief Formats displacements as unsigned hexadecimal values. * @brief Formats displacements as unsigned hexadecimal values.
* *
* Examples: * Examples:
* "MOV EAX, DWORD PTR SS:[ESP+0x400]" * - `"MOV EAX, DWORD PTR SS:[ESP+0x400]"`
* "MOV EAX, DWORD PTR SS:[ESP+0xFFFFFC00]" * - `"MOV EAX, DWORD PTR SS:[ESP+0xFFFFFC00]"`
*/ */
ZYDIS_FORMATTER_DISP_HEX_UNSIGNED, ZYDIS_DISP_FORMAT_HEX_UNSIGNED,
/** /**
* @brief Maximum value of this enum. * @brief Maximum value of this enum.
*/ */
ZYDIS_FORMATTER_DISP_MAX_VALUE = ZYDIS_FORMATTER_DISP_HEX_UNSIGNED ZYDIS_DISP_FORMAT_MAX_VALUE = ZYDIS_DISP_FORMAT_HEX_UNSIGNED
}; };
/* ---------------------------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------------------------- */
/* Immediate format */
/** /* ---------------------------------------------------------------------------------------------- */
* @brief Defines the @c ZydisFormatterImmediateFormat datatype.
*/
typedef uint8_t ZydisFormatterImmediateFormat;
/** /**
* @brief Values that represent formatter immediate-formats. * @brief Values that represent formatter immediate-formats.
*/ */
enum ZydisFormatterImmediateFormats enum ZydisImmediateFormat
{ {
/**
* @brief Currently defaults to @c ZYDIS_FORMATTER_IMM_HEX_UNSIGNED.
*/
ZYDIS_FORMATTER_IMM_DEFAULT,
/** /**
* @brief Automatically chooses the most suitable formatting-mode based on the operands * @brief Automatically chooses the most suitable formatting-mode based on the operands
* @c ZydisOperandInfo.imm.isSigned attribute. * `ZydisOperandInfo.imm.isSigned` attribute.
*/ */
ZYDIS_FORMATTER_IMM_HEX_AUTO, ZYDIS_IMM_FORMAT_HEX_AUTO,
/** /**
* @brief Formats immediates as signed hexadecimal values. * @brief Formats immediates as signed hexadecimal values.
* *
* Examples: * Examples:
* "MOV EAX, 0x400" * - `"MOV EAX, 0x400"`
* "MOV EAX, -0x400" * - `"MOV EAX, -0x400"`
*/ */
ZYDIS_FORMATTER_IMM_HEX_SIGNED, ZYDIS_IMM_FORMAT_HEX_SIGNED,
/** /**
* @brief Formats immediates as unsigned hexadecimal values. * @brief Formats immediates as unsigned hexadecimal values.
* *
* Examples: * Examples:
* "MOV EAX, 0x400" * - `"MOV EAX, 0x400"`
* "MOV EAX, 0xFFFFFC00" * - `"MOV EAX, 0xFFFFFC00"`
*/ */
ZYDIS_FORMATTER_IMM_HEX_UNSIGNED, ZYDIS_IMM_FORMAT_HEX_UNSIGNED,
/** /**
* @brief Maximum value of this enum. * @brief Maximum value of this enum.
*/ */
ZYDIS_FORMATTER_IMM_MAX_VALUE = ZYDIS_FORMATTER_IMM_HEX_UNSIGNED ZYDIS_IMM_FORMAT_MAX_VALUE = ZYDIS_IMM_FORMAT_HEX_UNSIGNED
}; };
/* ---------------------------------------------------------------------------------------------- */
/* Hooks */
/* ---------------------------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------------------------- */
/** /**
* @brief Defines the @c ZydisFormatterHookType datatype. * @brief Defines the `ZydisFormatterHookType` datatype.
*/ */
typedef uint8_t ZydisFormatterHookType; typedef ZydisU8 ZydisFormatterHookType;
/** /**
* @brief Values that represent formatter hook-types. * @brief Values that represent formatter hook-types.
@ -221,91 +304,100 @@ typedef uint8_t ZydisFormatterHookType;
enum ZydisFormatterHookTypes enum ZydisFormatterHookTypes
{ {
/** /**
* @brief This function is called before the formatter starts formatting an instruction. * @brief This function is invoked before the formatter formats an instruction.
*/ */
ZYDIS_FORMATTER_HOOK_PRE, ZYDIS_FORMATTER_HOOK_PRE_INSTRUCTION,
/** /**
* @brief This function is called before the formatter finished formatting an instruction. * @brief This function is invoked before the formatter formatted an instruction.
*/ */
ZYDIS_FORMATTER_HOOK_POST, ZYDIS_FORMATTER_HOOK_POST_INSTRUCTION,
/** /**
* @brief This function refers to the main formatting function, that internally calls all * @brief This function is invoked before the formatter formats an operand.
* other function except the ones that are hooked by @c ZYDIS_FORMATTER_HOOK_PRE and */
* @c ZYDIS_FORMATTER_HOOK_POST. ZYDIS_FORMATTER_HOOK_PRE_OPERAND,
/**
* @brief This function is invoked before the formatter formatted an operand.
*/
ZYDIS_FORMATTER_HOOK_POST_OPERAND,
/**
* @brief This function refers to the main formatting function.
* *
* Replacing this function allows for complete custom formatting, but indirectly disables all * Replacing this function allows for complete custom formatting, but indirectly disables all
* other hooks except for @c ZYDIS_FORMATTER_HOOK_PRE and @c ZYDIS_FORMATTER_HOOK_POST. * other hooks except for `ZYDIS_FORMATTER_HOOK_PRE_INSTRUCTION` and
* `ZYDIS_FORMATTER_HOOK_POST_INSTRUCTION`.
*/ */
ZYDIS_FORMATTER_HOOK_FORMAT_INSTRUCTION, ZYDIS_FORMATTER_HOOK_FORMAT_INSTRUCTION,
/** /**
* @brief This function is called to print the instruction prefixes. * @brief This function is invoked to format a register operand.
*/
ZYDIS_FORMATTER_HOOK_PRINT_PREFIXES,
/**
* @brief This function is called to print the instruction mnemonic.
*/
ZYDIS_FORMATTER_HOOK_PRINT_MNEMONIC,
/**
* @brief This function is called to format an register operand.
*/ */
ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_REG, ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_REG,
/** /**
* @brief This function is called to format an memory operand. * @brief This function is invoked to format a memory operand.
* *
* Replacing this function might indirectly disable some specific calls to the * Replacing this function might indirectly disable some specific calls to the
* @c ZYDIS_FORMATTER_PRINT_ADDRESS and @c ZYDIS_FORMATTER_HOOK_PRINT_DISPLACEMENT functions. * `ZYDIS_FORMATTER_HOOK_PRINT_ADDRESS` and `ZYDIS_FORMATTER_HOOK_PRINT_DISP` functions.
*/ */
ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_MEM, ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_MEM,
/** /**
* @brief This function is called to format an pointer operand. * @brief This function is invoked to format a pointer operand.
*/ */
ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_PTR, ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_PTR,
/** /**
* @brief This function is called to format an immediate operand. * @brief This function is invoked to format an immediate operand.
* *
* Replacing this function might indirectly disable some specific calls to the * Replacing this function might indirectly disable some specific calls to the
* @c ZYDIS_FORMATTER_PRINT_ADDRESS and @c ZYDIS_FORMATTER_HOOK_PRINT_IMMEDIATE functions. * `ZYDIS_FORMATTER_HOOK_PRINT_ADDRESS` and `ZYDIS_FORMATTER_HOOK_PRINT_IMM` functions.
*/ */
ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_IMM, ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_IMM,
/** /**
* @brief This function is called right before formatting an memory operand to print the * @brief This function is invoked to print the instruction mnemonic.
* optional size-specifier.
*/ */
ZYDIS_FORMATTER_HOOK_PRINT_OPERANDSIZE, ZYDIS_FORMATTER_HOOK_PRINT_MNEMONIC,
/** /**
* @brief This function is called right before formatting an memory operand to print the * @brief This function is invoked to print a register.
* optional segment-register.
*/ */
ZYDIS_FORMATTER_HOOK_PRINT_SEGMENT, ZYDIS_FORMATTER_HOOK_PRINT_REGISTER,
/** /**
* @brief This function is called right after formatting an operand to print the optional * @brief This function is invoked to print an absolute address.
* EVEX/MVEX operand-decorator.
*/
ZYDIS_FORMATTER_HOOK_PRINT_DECORATOR,
/**
* @brief This function is called to print an absolute address.
*/ */
ZYDIS_FORMATTER_HOOK_PRINT_ADDRESS, ZYDIS_FORMATTER_HOOK_PRINT_ADDRESS,
/** /**
* @brief This function is called to print a memory displacement value. * @brief This function is invoked to print a memory displacement value.
*/ */
ZYDIS_FORMATTER_HOOK_PRINT_DISPLACEMENT, ZYDIS_FORMATTER_HOOK_PRINT_DISP,
/** /**
* @brief This function is called to print an immediate value. * @brief This function is invoked to print an immediate value.
*/ */
ZYDIS_FORMATTER_HOOK_PRINT_IMMEDIATE, ZYDIS_FORMATTER_HOOK_PRINT_IMM,
/**
* @brief This function is invoked to print the size of a memory operand.
*/
ZYDIS_FORMATTER_HOOK_PRINT_MEMSIZE,
/**
* @brief This function is invoked to print the instruction prefixes.
*/
ZYDIS_FORMATTER_HOOK_PRINT_PREFIXES,
/**
* @brief This function is invoked after formatting an operand to print a `EVEX`/`MVEX`
* decorator.
*/
ZYDIS_FORMATTER_HOOK_PRINT_DECORATOR,
/** /**
* @brief Maximum value of this enum. * @brief Maximum value of this enum.
*/ */
ZYDIS_FORMATTER_HOOK_MAX_VALUE = ZYDIS_FORMATTER_HOOK_PRINT_IMMEDIATE ZYDIS_FORMATTER_HOOK_MAX_VALUE = ZYDIS_FORMATTER_HOOK_PRINT_DECORATOR
}; };
/* ---------------------------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------------------------- */
/** /**
* @brief Defines the @c ZydisDecoratorType datatype. * @brief Defines the `ZydisDecoratorType` datatype.
*/ */
typedef uint8_t ZydisDecoratorType; typedef ZydisU8 ZydisDecoratorType;
/** /**
* @brief Values that represent decorator-types. * @brief Values that represent decorator-types.
@ -313,179 +405,223 @@ typedef uint8_t ZydisDecoratorType;
enum ZydisDecoratorTypes enum ZydisDecoratorTypes
{ {
ZYDIS_DECORATOR_TYPE_INVALID, ZYDIS_DECORATOR_TYPE_INVALID,
/**
* @brief The embedded-mask decorator.
*/
ZYDIS_DECORATOR_TYPE_MASK, ZYDIS_DECORATOR_TYPE_MASK,
ZYDIS_DECORATOR_TYPE_BROADCAST, /**
ZYDIS_DECORATOR_TYPE_ROUNDING_CONTROL, * @brief The broadcast decorator.
*/
ZYDIS_DECORATOR_TYPE_BC,
/**
* @brief The rounding-control decorator.
*/
ZYDIS_DECORATOR_TYPE_RC,
/**
* @brief The suppress-all-exceptions decorator.
*/
ZYDIS_DECORATOR_TYPE_SAE, ZYDIS_DECORATOR_TYPE_SAE,
/**
* @brief The register-swizzle decorator.
*/
ZYDIS_DECORATOR_TYPE_SWIZZLE, ZYDIS_DECORATOR_TYPE_SWIZZLE,
/**
* @brief The conversion decorator.
*/
ZYDIS_DECORATOR_TYPE_CONVERSION, ZYDIS_DECORATOR_TYPE_CONVERSION,
ZYDIS_DECORATOR_TYPE_EVICTION_HINT, /**
* @brief The eviction-hint decorator.
*/
ZYDIS_DECORATOR_TYPE_EH,
/** /**
* @brief Maximum value of this enum. * @brief Maximum value of this enum.
*/ */
ZYDIS_DECORATOR_TYPE_MAX_VALUE = ZYDIS_DECORATOR_TYPE_EVICTION_HINT ZYDIS_DECORATOR_TYPE_MAX_VALUE = ZYDIS_DECORATOR_TYPE_EH
}; };
/* ---------------------------------------------------------------------------------------------- */
typedef struct ZydisFormatter_ ZydisFormatter; typedef struct ZydisFormatter_ ZydisFormatter;
/** /**
* @brief Defines the @c ZydisFormatterNotifyFunc function pointer. * @brief Defines the `ZydisFormatterFunc` function pointer.
* *
* @param formatter A pointer to the @c ZydisFormatter instance. * @param formatter A pointer to the `ZydisFormatter` instance.
* @param instruction A pointer to the @c ZydisDecodedInstruction struct. * @param string A pointer to the string.
* @param instruction A pointer to the `ZydisDecodedInstruction` struct.
* @param userData A pointer to user-defined data. * @param userData A pointer to user-defined data.
* *
* @return Returning a status code other than @c ZYDIS_STATUS_SUCCESS will immediately cause the * @return A zydis status code.
* formatting process to fail.
* *
* This function type is used for the @c ZYDIS_FORMATTER_HOOK_PRE and * Returning a status code other than `ZYDIS_STATUS_SUCCESS` will immediately cause the formatting
* @c ZYDIS_FORMATTER_HOOK_POST hook-types. * process to fail.
*
* Returning `ZYDIS_STATUS_SUCCESS` in `ZYDIS_FORMATTER_HOOK_PRINT_PREFIXES` without writing to
* the string is valid and signals that the corresponding element should not be printed.
*
* This function type is used for:
* - `ZYDIS_FORMATTER_HOOK_PRE_INSTRUCTION`
* - `ZYDIS_FORMATTER_HOOK_POST_INSTRUCTION`
* - `ZYDIS_FORMATTER_HOOK_FORMAT_INSTRUCTION`
* - `ZYDIS_FORMATTER_HOOK_PRINT_MNEMONIC`
* - `ZYDIS_FORMATTER_HOOK_PRINT_PREFIXES`
*/ */
typedef ZydisStatus (*ZydisFormatterNotifyFunc)(const ZydisFormatter* formatter, typedef ZydisStatus (*ZydisFormatterFunc)(const ZydisFormatter* formatter,
const ZydisDecodedInstruction* instruction, void* userData); ZydisString* string, const ZydisDecodedInstruction* instruction, void* userData);
/** /**
* @brief Defines the @c ZydisFormatterFormatFunc function pointer. * @brief Defines the `ZydisFormatterOperandFunc` function pointer.
* *
* @param formatter A pointer to the @c ZydisFormatter instance. * @param formatter A pointer to the `ZydisFormatter` instance.
* @param buffer A pointer to the string-buffer. * @param string A pointer to the string.
* @param bufferLen The length of the string-buffer. * @param instruction A pointer to the `ZydisDecodedInstruction` struct.
* @param instruction A pointer to the @c ZydisDecodedInstruction struct. * @param operand A pointer to the `ZydisDecodedOperand` struct.
* @param userData A pointer to user-defined data. * @param userData A pointer to user-defined data.
* *
* @return Returning a status code other than @c ZYDIS_STATUS_SUCCESS will immediately cause the * @return A zydis status code.
* formatting process to fail.
* *
* After appending text to the @c buffer you MUST increase the buffer-pointer by the size of the * Returning a status code other than `ZYDIS_STATUS_SUCCESS` will immediately cause the formatting
* number of chars written. Not increasing the buffer-pointer will cause unexpected behavior. * process to fail.
* *
* This function type is used for the @c ZYDIS_FORMATTER_HOOK_FORMAT_INSTRUCTION, * Returning `ZYDIS_STATUS_SUCCESS` in one of the `ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_X` hooks
* @c ZYDIS_FORMATTER_HOOK_PRINT_PREFIXES and @c ZYDIS_FORMATTER_HOOK_PRINT_MNEMONIC hook-types. * without writing to the string is valid and will cause the formatter to omit the current
*/
typedef ZydisStatus (*ZydisFormatterFormatFunc)(const ZydisFormatter* formatter,
char** buffer, size_t bufferLen, const ZydisDecodedInstruction* instruction, void* userData);
/**
* @brief Defines the @c ZydisFormatterFormatOperandFunc function pointer.
*
* @param formatter A pointer to the @c ZydisFormatter instance.
* @param buffer A pointer to the string-buffer.
* @param bufferLen The length of the string-buffer.
* @param instruction A pointer to the @c ZydisDecodedInstruction struct.
* @param operand A pointer to the @c ZydisDecodedOperand struct.
* @param userData A pointer to user-defined data.
*
* @return Returning a status code other than @c ZYDIS_STATUS_SUCCESS will immediately cause the
* formatting process to fail.
*
* After appending text to the @c buffer you MUST increase the buffer-pointer by the size of the
* number of chars written.
*
* Returning @c ZYDIS_STATUS_SUCCESS in one of the @c ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_X hooks
* without increasing the buffer-pointer is valid and will cause the formatter to omit the current
* operand. * operand.
* *
* Returning @c ZYDIS_STATUS_SUCCESS in @c ZYDIS_FORMATTER_HOOK_PRINT_OPERANDSIZE, * Returning `ZYDIS_STATUS_SUCCESS` in `ZYDIS_FORMATTER_HOOK_PRINT_MEMSIZE` or
* @c ZYDIS_FORMATTER_HOOK_PRINT_SEGMENT or @c ZYDIS_FORMATTER_HOOK_PRINT_DECORATOR without * `ZYDIS_FORMATTER_HOOK_PRINT_DECORATOR` without writing to the string is valid and signals that
* increasing the buffer-pointer is valid and signals that the corresponding element should not be * the corresponding element should not be printed for the current operand.
* printed for the current operand.
* *
* Not increasing the buffer-pointer for any other hook-type will cause unexpected behavior. * This function type is used for:
* * - `ZYDIS_FORMATTER_HOOK_PRE_OPERAND`
* This function type is used for the @c ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_REG, * - `ZYDIS_FORMATTER_HOOK_POST_OPERAND`
* @c ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_MEM, @c ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_PTR, * - `ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_REG`
* @c ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_IMM, @c ZYDIS_FORMATTER_HOOK_PRINT_OPERANDSIZE, * - `ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_MEM`
* @c ZYDIS_FORMATTER_HOOK_PRINT_SEGMENT, @c ZYDIS_FORMATTER_HOOK_PRINT_DECORATOR, * - `ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_PTR`
* @c ZYDIS_FORMATTER_HOOK_PRINT_DISPLACEMENT and @c ZYDIS_FORMATTER_HOOK_PRINT_IMMEDIATE * - `ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_IMM`
* hook-types. * - `ZYDIS_FORMATTER_HOOK_PRINT_DISP`
* - `ZYDIS_FORMATTER_HOOK_PRINT_IMM`
* - `ZYDIS_FORMATTER_HOOK_PRINT_MEMSIZE`
*/ */
typedef ZydisStatus (*ZydisFormatterFormatOperandFunc)(const ZydisFormatter* formatter, typedef ZydisStatus (*ZydisFormatterOperandFunc)(const ZydisFormatter* formatter,
char** buffer, size_t bufferLen, const ZydisDecodedInstruction* instruction, ZydisString* string, const ZydisDecodedInstruction* instruction,
const ZydisDecodedOperand* operand, void* userData); const ZydisDecodedOperand* operand, void* userData);
/** /**
* @brief Defines the @c ZydisFormatterFormatAddressFunc function pointer. * @brief Defines the `ZydisFormatterRegisterFunc` function pointer.
* *
* @param formatter A pointer to the @c ZydisFormatter instance. * @param formatter A pointer to the `ZydisFormatter` instance.
* @param buffer A pointer to the string-buffer. * @param string A pointer to the string.
* @param bufferLen The length of the string-buffer. * @param instruction A pointer to the `ZydisDecodedInstruction` struct.
* @param instruction A pointer to the @c ZydisDecodedInstruction struct. * @param operand A pointer to the `ZydisDecodedOperand` struct.
* @param operand A pointer to the @c ZydisDecodedOperand struct. * @param reg The register.
* @param userData A pointer to user-defined data. * @param userData A pointer to user-defined data.
* *
* @return Returning a status code other than @c ZYDIS_STATUS_SUCCESS will immediately cause the * @return Returning a status code other than `ZYDIS_STATUS_SUCCESS` will immediately cause the
* formatting process to fail. * formatting process to fail.
* *
* After appending text to the @c buffer you MUST increase the buffer-pointer by the size of the * This function type is used for:
* number of chars written. * - `ZYDIS_FORMATTER_HOOK_PRINT_REGISTER`.
* Not increasing the buffer-pointer will cause unexpected behavior.
*
* This function type is used for the @c ZYDIS_FORMATTER_HOOK_PRINT_ADDRESS hook-type.
*/ */
typedef ZydisStatus (*ZydisFormatterFormatAddressFunc)(const ZydisFormatter* formatter, typedef ZydisStatus (*ZydisFormatterRegisterFunc)(const ZydisFormatter* formatter,
char** buffer, size_t bufferLen, const ZydisDecodedInstruction* instruction, ZydisString* string, const ZydisDecodedInstruction* instruction,
const ZydisDecodedOperand* operand, uint64_t address, void* userData); const ZydisDecodedOperand* operand, ZydisRegister reg, void* userData);
/**
* @brief Defines the `ZydisFormatterAddressFunc` function pointer.
*
* @param formatter A pointer to the `ZydisFormatter` instance.
* @param string A pointer to the string.
* @param instruction A pointer to the `ZydisDecodedInstruction` struct.
* @param operand A pointer to the `ZydisDecodedOperand` struct.
* @param address The address.
* @param userData A pointer to user-defined data.
*
* @return Returning a status code other than `ZYDIS_STATUS_SUCCESS` will immediately cause the
* formatting process to fail.
*
* This function type is used for:
* - `ZYDIS_FORMATTER_HOOK_PRINT_ADDRESS`
*/
typedef ZydisStatus (*ZydisFormatterAddressFunc)(const ZydisFormatter* formatter,
ZydisString* string, const ZydisDecodedInstruction* instruction,
const ZydisDecodedOperand* operand, ZydisU64 address, void* userData);
/** /**
* @brief Defines the @c ZydisFormatterFormatDecoratorFunc function pointer. * @brief Defines the `ZydisFormatterDecoratorFunc` function pointer.
* *
* @param formatter A pointer to the @c ZydisFormatter instance. * @param formatter A pointer to the `ZydisFormatter` instance.
* @param buffer A pointer to the string-buffer. * @param string A pointer to the string.
* @param bufferLen The length of the string-buffer. * @param instruction A pointer to the `ZydisDecodedInstruction` struct.
* @param instruction A pointer to the @c ZydisDecodedInstruction struct. * @param operand A pointer to the `ZydisDecodedOperand` struct.
* @param operand A pointer to the @c ZydisDecodedOperand struct.
* @param type The decorator type. * @param type The decorator type.
* @param userData A pointer to user-defined data. * @param userData A pointer to user-defined data.
* *
* @return Returning a status code other than @c ZYDIS_STATUS_SUCCESS will immediately cause the * @return Returning a status code other than `ZYDIS_STATUS_SUCCESS` will immediately cause the
* formatting process to fail. * formatting process to fail.
* *
* After appending text to the @c buffer you MUST increase the buffer-pointer by the size of the * Returning `ZYDIS_STATUS_SUCCESS` without writing to the string is valid and will cause the
* number of chars written. * formatter to omit the current decorator.
* *
* Returning @c ZYDIS_STATUS_SUCCESS without increasing the buffer-pointer is valid and will cause * This function type is used for:
* the formatter to omit the current decorator. * - `ZYDIS_FORMATTER_HOOK_PRINT_DECORATOR`
*
* This function type is used for the @c ZYDIS_FORMATTER_HOOK_PRINT_DECORATOR hook-type.
*/ */
typedef ZydisStatus (*ZydisFormatterFormatDecoratorFunc)(const ZydisFormatter* formatter, typedef ZydisStatus (*ZydisFormatterDecoratorFunc)(const ZydisFormatter* formatter,
char** buffer, size_t bufferLen, const ZydisDecodedInstruction* instruction, ZydisString* string, const ZydisDecodedInstruction* instruction,
const ZydisDecodedOperand* operand, ZydisDecoratorType type, void* userData); const ZydisDecodedOperand* operand, ZydisDecoratorType type, void* userData);
/* ---------------------------------------------------------------------------------------------- */
/* Formatter struct */
/* ---------------------------------------------------------------------------------------------- */
/** /**
* @brief Defines the @c ZydisFormatter struct. * @brief Defines the `ZydisFormatter` struct.
*/ */
struct ZydisFormatter_ struct ZydisFormatter_
{ {
ZydisFormatterFlags flags; ZydisLetterCase letterCase;
ZydisFormatterAddressFormat addressFormat; ZydisBool forceMemorySegment;
ZydisFormatterDisplacementFormat displacementFormat; ZydisBool forceMemorySize;
ZydisFormatterImmediateFormat immediateFormat; ZydisU8 formatAddress;
ZydisFormatterNotifyFunc funcPre; ZydisU8 formatDisp;
ZydisFormatterNotifyFunc funcPost; ZydisU8 formatImm;
ZydisFormatterFormatFunc funcFormatInstruction; ZydisBool hexUppercase;
ZydisFormatterFormatFunc funcPrintPrefixes; ZydisString* hexPrefix;
ZydisFormatterFormatFunc funcPrintMnemonic; ZydisString hexPrefixData;
ZydisFormatterFormatOperandFunc funcFormatOperandReg; ZydisString* hexSuffix;
ZydisFormatterFormatOperandFunc funcFormatOperandMem; ZydisString hexSuffixData;
ZydisFormatterFormatOperandFunc funcFormatOperandPtr; ZydisU8 hexPaddingAddress;
ZydisFormatterFormatOperandFunc funcFormatOperandImm; ZydisU8 hexPaddingDisp;
ZydisFormatterFormatOperandFunc funcPrintOperandSize; ZydisU8 hexPaddingImm;
ZydisFormatterFormatOperandFunc funcPrintSegment; ZydisFormatterFunc funcPreInstruction;
ZydisFormatterFormatDecoratorFunc funcPrintDecorator; ZydisFormatterFunc funcPostInstruction;
ZydisFormatterFormatAddressFunc funcPrintAddress; ZydisFormatterOperandFunc funcPreOperand;
ZydisFormatterFormatOperandFunc funcPrintDisplacement; ZydisFormatterOperandFunc funcPostOperand;
ZydisFormatterFormatOperandFunc funcPrintImmediate; ZydisFormatterFunc funcFormatInstruction;
ZydisFormatterOperandFunc funcFormatOperandReg;
ZydisFormatterOperandFunc funcFormatOperandMem;
ZydisFormatterOperandFunc funcFormatOperandPtr;
ZydisFormatterOperandFunc funcFormatOperandImm;
ZydisFormatterFunc funcPrintMnemonic;
ZydisFormatterRegisterFunc funcPrintRegister;
ZydisFormatterAddressFunc funcPrintAddress;
ZydisFormatterOperandFunc funcPrintDisp;
ZydisFormatterOperandFunc funcPrintImm;
ZydisFormatterOperandFunc funcPrintMemSize;
ZydisFormatterFunc funcPrintPrefixes;
ZydisFormatterDecoratorFunc funcPrintDecorator;
}; };
/* ---------------------------------------------------------------------------------------------- */
/* ============================================================================================== */ /* ============================================================================================== */
/* Exported functions */ /* Exported functions */
/* ============================================================================================== */ /* ============================================================================================== */
/** /**
* @brief Initializes the given @c ZydisFormatter instance. * @brief Initializes the given `ZydisFormatter` instance.
* *
* @param formatter A pointer to the @c ZydisFormatter instance. * @param formatter A pointer to the `ZydisFormatter` instance.
* @param style The formatter style. * @param style The formatter style.
* *
* @return A zydis status code. * @return A zydis status code.
@ -493,26 +629,22 @@ struct ZydisFormatter_
ZYDIS_EXPORT ZydisStatus ZydisFormatterInit(ZydisFormatter* formatter, ZydisFormatterStyle style); ZYDIS_EXPORT ZydisStatus ZydisFormatterInit(ZydisFormatter* formatter, ZydisFormatterStyle style);
/** /**
* @brief Initializes the given @c ZydisFormatter instance. * @brief Sets the value of the specified formatter `attribute`.
* *
* @param formatter A pointer to the @c ZydisFormatter instance. * @param formatter A pointer to the `ZydisFormatter` instance.
* @param style The formatter style. * @param property The id of the formatter-property.
* @param addressFormat The address format. * @param value The new value.
* @param displacementFormat The displacement format.
* @param immmediateFormat The immediate format.
* *
* @return A zydis status code. * @return A zydis status code.
*/ */
ZYDIS_EXPORT ZydisStatus ZydisFormatterInitEx(ZydisFormatter* formatter, ZydisFormatterStyle style, ZYDIS_EXPORT ZydisStatus ZydisFormatterSetProperty(ZydisFormatter* formatter,
ZydisFormatterFlags flags, ZydisFormatterAddressFormat addressFormat, ZydisFormatterProperty property, ZydisUPointer value);
ZydisFormatterDisplacementFormat displacementFormat,
ZydisFormatterImmediateFormat immmediateFormat);
/** /**
* @brief Replaces a formatter function with a custom callback and/or retrieves the currently * @brief Replaces a formatter function with a custom callback and/or retrieves the currently
* used function. * used function.
* *
* @param formatter A pointer to the @c ZydisFormatter instance. * @param formatter A pointer to the `ZydisFormatter` instance.
* @param hook The formatter hook-type. * @param hook The formatter hook-type.
* @param callback A pointer to a variable that contains the pointer of the callback function * @param callback A pointer to a variable that contains the pointer of the callback function
* and receives the pointer of the currently used function. * and receives the pointer of the currently used function.
@ -528,21 +660,21 @@ ZYDIS_EXPORT ZydisStatus ZydisFormatterSetHook(ZydisFormatter* formatter,
/** /**
* @brief Formats the given instruction and writes it into the output buffer. * @brief Formats the given instruction and writes it into the output buffer.
* *
* @param formatter A pointer to the @c ZydisFormatter instance. * @param formatter A pointer to the `ZydisFormatter` instance.
* @param instruction A pointer to the @c ZydisDecodedInstruction struct. * @param instruction A pointer to the `ZydisDecodedInstruction` struct.
* @param buffer A pointer to the output buffer. * @param buffer A pointer to the output buffer.
* @param bufferLen The length of the output buffer. * @param bufferLen The length of the output buffer.
* *
* @return A zydis status code. * @return A zydis status code.
*/ */
ZYDIS_EXPORT ZydisStatus ZydisFormatterFormatInstruction(const ZydisFormatter* formatter, ZYDIS_EXPORT ZydisStatus ZydisFormatterFormatInstruction(const ZydisFormatter* formatter,
ZydisDecodedInstruction* instruction, char* buffer, size_t bufferLen); const ZydisDecodedInstruction* instruction, char* buffer, ZydisUSize bufferLen);
/** /**
* @brief Formats the given instruction and writes it into the output buffer. * @brief Formats the given instruction and writes it into the output buffer.
* *
* @param formatter A pointer to the @c ZydisFormatter instance. * @param formatter A pointer to the `ZydisFormatter` instance.
* @param instruction A pointer to the @c ZydisDecodedInstruction struct. * @param instruction A pointer to the `ZydisDecodedInstruction` struct.
* @param buffer A pointer to the output buffer. * @param buffer A pointer to the output buffer.
* @param bufferLen The length of 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 * @param userData A pointer to user-defined data which can be used in custom formatter
@ -551,7 +683,7 @@ ZYDIS_EXPORT ZydisStatus ZydisFormatterFormatInstruction(const ZydisFormatter* f
* @return A zydis status code. * @return A zydis status code.
*/ */
ZYDIS_EXPORT ZydisStatus ZydisFormatterFormatInstructionEx(const ZydisFormatter* formatter, ZYDIS_EXPORT ZydisStatus ZydisFormatterFormatInstructionEx(const ZydisFormatter* formatter,
ZydisDecodedInstruction* instruction, char* buffer, size_t bufferLen, void* userData); const ZydisDecodedInstruction* instruction, char* buffer, ZydisUSize bufferLen, void* userData);
/* ============================================================================================== */ /* ============================================================================================== */

View File

@ -1,7 +1,7 @@
/** /**
* @brief Defines the `ZydisISAExt` datatype. * @brief Defines the `ZydisISAExt` datatype.
*/ */
typedef uint8_t ZydisISAExt; typedef ZydisU8 ZydisISAExt;
/** /**
* @brief Values that represent `ZydisISAExt` elements. * @brief Values that represent `ZydisISAExt` elements.
@ -9,6 +9,7 @@ typedef uint8_t ZydisISAExt;
enum ZydisISAExts enum ZydisISAExts
{ {
ZYDIS_ISA_EXT_INVALID, ZYDIS_ISA_EXT_INVALID,
ZYDIS_ISA_EXT_ADOX_ADCX,
ZYDIS_ISA_EXT_AES, ZYDIS_ISA_EXT_AES,
ZYDIS_ISA_EXT_AMD, ZYDIS_ISA_EXT_AMD,
ZYDIS_ISA_EXT_AMD3DNOW, ZYDIS_ISA_EXT_AMD3DNOW,
@ -41,15 +42,32 @@ enum ZydisISAExts
ZYDIS_ISA_EXT_AVX512_4FMAPS_512, ZYDIS_ISA_EXT_AVX512_4FMAPS_512,
ZYDIS_ISA_EXT_AVX512_4FMAPS_SCALAR, ZYDIS_ISA_EXT_AVX512_4FMAPS_SCALAR,
ZYDIS_ISA_EXT_AVX512_4VNNIW_512, ZYDIS_ISA_EXT_AVX512_4VNNIW_512,
ZYDIS_ISA_EXT_AVX512_BITALG_128,
ZYDIS_ISA_EXT_AVX512_BITALG_256,
ZYDIS_ISA_EXT_AVX512_BITALG_512,
ZYDIS_ISA_EXT_AVX512_GFNI_128,
ZYDIS_ISA_EXT_AVX512_GFNI_256,
ZYDIS_ISA_EXT_AVX512_GFNI_512,
ZYDIS_ISA_EXT_AVX512_IFMA_128, ZYDIS_ISA_EXT_AVX512_IFMA_128,
ZYDIS_ISA_EXT_AVX512_IFMA_256, ZYDIS_ISA_EXT_AVX512_IFMA_256,
ZYDIS_ISA_EXT_AVX512_IFMA_512, ZYDIS_ISA_EXT_AVX512_IFMA_512,
ZYDIS_ISA_EXT_AVX512_VAES_128,
ZYDIS_ISA_EXT_AVX512_VAES_256,
ZYDIS_ISA_EXT_AVX512_VAES_512,
ZYDIS_ISA_EXT_AVX512_VBMI2_128,
ZYDIS_ISA_EXT_AVX512_VBMI2_256,
ZYDIS_ISA_EXT_AVX512_VBMI2_512,
ZYDIS_ISA_EXT_AVX512_VBMI_128, ZYDIS_ISA_EXT_AVX512_VBMI_128,
ZYDIS_ISA_EXT_AVX512_VBMI_256, ZYDIS_ISA_EXT_AVX512_VBMI_256,
ZYDIS_ISA_EXT_AVX512_VBMI_512, ZYDIS_ISA_EXT_AVX512_VBMI_512,
ZYDIS_ISA_EXT_AVX512_VNNI_128,
ZYDIS_ISA_EXT_AVX512_VNNI_256,
ZYDIS_ISA_EXT_AVX512_VNNI_512,
ZYDIS_ISA_EXT_AVX512_VPCLMULQDQ_128,
ZYDIS_ISA_EXT_AVX512_VPCLMULQDQ_256,
ZYDIS_ISA_EXT_AVX512_VPCLMULQDQ_512,
ZYDIS_ISA_EXT_AVX512_VPOPCNTDQ_512, ZYDIS_ISA_EXT_AVX512_VPOPCNTDQ_512,
ZYDIS_ISA_EXT_AVXAES, ZYDIS_ISA_EXT_AVXAES,
ZYDIS_ISA_EXT_BDW,
ZYDIS_ISA_EXT_BMI1, ZYDIS_ISA_EXT_BMI1,
ZYDIS_ISA_EXT_BMI2, ZYDIS_ISA_EXT_BMI2,
ZYDIS_ISA_EXT_CET, ZYDIS_ISA_EXT_CET,
@ -66,6 +84,7 @@ enum ZydisISAExts
ZYDIS_ISA_EXT_FMA4, ZYDIS_ISA_EXT_FMA4,
ZYDIS_ISA_EXT_FXSAVE, ZYDIS_ISA_EXT_FXSAVE,
ZYDIS_ISA_EXT_FXSAVE64, ZYDIS_ISA_EXT_FXSAVE64,
ZYDIS_ISA_EXT_GFNI,
ZYDIS_ISA_EXT_I186, ZYDIS_ISA_EXT_I186,
ZYDIS_ISA_EXT_I286PROTECTED, ZYDIS_ISA_EXT_I286PROTECTED,
ZYDIS_ISA_EXT_I286REAL, ZYDIS_ISA_EXT_I286REAL,
@ -96,6 +115,7 @@ enum ZydisISAExts
ZYDIS_ISA_EXT_PREFETCHWT1, ZYDIS_ISA_EXT_PREFETCHWT1,
ZYDIS_ISA_EXT_PREFETCH_NOP, ZYDIS_ISA_EXT_PREFETCH_NOP,
ZYDIS_ISA_EXT_PT, ZYDIS_ISA_EXT_PT,
ZYDIS_ISA_EXT_RDPID,
ZYDIS_ISA_EXT_RDPMC, ZYDIS_ISA_EXT_RDPMC,
ZYDIS_ISA_EXT_RDRAND, ZYDIS_ISA_EXT_RDRAND,
ZYDIS_ISA_EXT_RDSEED, ZYDIS_ISA_EXT_RDSEED,
@ -119,15 +139,16 @@ enum ZydisISAExts
ZYDIS_ISA_EXT_SSSE3MMX, ZYDIS_ISA_EXT_SSSE3MMX,
ZYDIS_ISA_EXT_SVM, ZYDIS_ISA_EXT_SVM,
ZYDIS_ISA_EXT_TBM, ZYDIS_ISA_EXT_TBM,
ZYDIS_ISA_EXT_VAES,
ZYDIS_ISA_EXT_VMFUNC, ZYDIS_ISA_EXT_VMFUNC,
ZYDIS_ISA_EXT_VPCLMULQDQ,
ZYDIS_ISA_EXT_VTX, ZYDIS_ISA_EXT_VTX,
ZYDIS_ISA_EXT_X87, ZYDIS_ISA_EXT_X87,
ZYDIS_ISA_EXT_XOP, ZYDIS_ISA_EXT_XOP,
ZYDIS_ISA_EXT_XSAVE, ZYDIS_ISA_EXT_XSAVE,
ZYDIS_ISA_EXT_XSAVEC, ZYDIS_ISA_EXT_XSAVEC,
ZYDIS_ISA_EXT_XSAVEOPT, ZYDIS_ISA_EXT_XSAVEOPT,
ZYDIS_ISA_EXT_XSAVES ZYDIS_ISA_EXT_XSAVES,
ZYDIS_ISA_EXT_MAX_VALUE = ZYDIS_ISA_EXT_XSAVES,
ZYDIS_ISA_EXT_MIN_BITS = 0x0008
}; };
#define ZYDIS_ISA_EXT_MAX_VALUE ZYDIS_ISA_EXT_XSAVES
#define ZYDIS_ISA_EXT_MAX_BITS 0x0007

View File

@ -1,7 +1,7 @@
/** /**
* @brief Defines the `ZydisISASet` datatype. * @brief Defines the `ZydisISASet` datatype.
*/ */
typedef uint8_t ZydisISASet; typedef ZydisU8 ZydisISASet;
/** /**
* @brief Values that represent `ZydisISASet` elements. * @brief Values that represent `ZydisISASet` elements.
@ -9,6 +9,7 @@ typedef uint8_t ZydisISASet;
enum ZydisISASets enum ZydisISASets
{ {
ZYDIS_ISA_SET_INVALID, ZYDIS_ISA_SET_INVALID,
ZYDIS_ISA_SET_ADOX_ADCX,
ZYDIS_ISA_SET_AES, ZYDIS_ISA_SET_AES,
ZYDIS_ISA_SET_AMD3DNOW, ZYDIS_ISA_SET_AMD3DNOW,
ZYDIS_ISA_SET_AVX, ZYDIS_ISA_SET_AVX,
@ -18,7 +19,6 @@ enum ZydisISASets
ZYDIS_ISA_SET_AVX512VEX, ZYDIS_ISA_SET_AVX512VEX,
ZYDIS_ISA_SET_AVXAES, ZYDIS_ISA_SET_AVXAES,
ZYDIS_ISA_SET_BASE, ZYDIS_ISA_SET_BASE,
ZYDIS_ISA_SET_BDW,
ZYDIS_ISA_SET_BMI1, ZYDIS_ISA_SET_BMI1,
ZYDIS_ISA_SET_BMI2, ZYDIS_ISA_SET_BMI2,
ZYDIS_ISA_SET_CET, ZYDIS_ISA_SET_CET,
@ -29,6 +29,7 @@ enum ZydisISASets
ZYDIS_ISA_SET_F16C, ZYDIS_ISA_SET_F16C,
ZYDIS_ISA_SET_FMA, ZYDIS_ISA_SET_FMA,
ZYDIS_ISA_SET_FMA4, ZYDIS_ISA_SET_FMA4,
ZYDIS_ISA_SET_GFNI,
ZYDIS_ISA_SET_INVPCID, ZYDIS_ISA_SET_INVPCID,
ZYDIS_ISA_SET_KNC, ZYDIS_ISA_SET_KNC,
ZYDIS_ISA_SET_KNCE, ZYDIS_ISA_SET_KNCE,
@ -44,6 +45,7 @@ enum ZydisISASets
ZYDIS_ISA_SET_PKU, ZYDIS_ISA_SET_PKU,
ZYDIS_ISA_SET_PREFETCHWT1, ZYDIS_ISA_SET_PREFETCHWT1,
ZYDIS_ISA_SET_PT, ZYDIS_ISA_SET_PT,
ZYDIS_ISA_SET_RDPID,
ZYDIS_ISA_SET_RDRAND, ZYDIS_ISA_SET_RDRAND,
ZYDIS_ISA_SET_RDSEED, ZYDIS_ISA_SET_RDSEED,
ZYDIS_ISA_SET_RDTSCP, ZYDIS_ISA_SET_RDTSCP,
@ -60,15 +62,16 @@ enum ZydisISASets
ZYDIS_ISA_SET_SSSE3, ZYDIS_ISA_SET_SSSE3,
ZYDIS_ISA_SET_SVM, ZYDIS_ISA_SET_SVM,
ZYDIS_ISA_SET_TBM, ZYDIS_ISA_SET_TBM,
ZYDIS_ISA_SET_VAES,
ZYDIS_ISA_SET_VMFUNC, ZYDIS_ISA_SET_VMFUNC,
ZYDIS_ISA_SET_VPCLMULQDQ,
ZYDIS_ISA_SET_VTX, ZYDIS_ISA_SET_VTX,
ZYDIS_ISA_SET_X87, ZYDIS_ISA_SET_X87,
ZYDIS_ISA_SET_XOP, ZYDIS_ISA_SET_XOP,
ZYDIS_ISA_SET_XSAVE, ZYDIS_ISA_SET_XSAVE,
ZYDIS_ISA_SET_XSAVEC, ZYDIS_ISA_SET_XSAVEC,
ZYDIS_ISA_SET_XSAVEOPT, ZYDIS_ISA_SET_XSAVEOPT,
ZYDIS_ISA_SET_XSAVES ZYDIS_ISA_SET_XSAVES,
ZYDIS_ISA_SET_MAX_VALUE = ZYDIS_ISA_SET_XSAVES,
ZYDIS_ISA_SET_MIN_BITS = 0x0006
}; };
#define ZYDIS_ISA_SET_MAX_VALUE ZYDIS_ISA_SET_XSAVES
#define ZYDIS_ISA_SET_MAX_BITS 0x0006

View File

@ -1,7 +1,7 @@
/** /**
* @brief Defines the `ZydisInstructionCategory` datatype. * @brief Defines the `ZydisInstructionCategory` datatype.
*/ */
typedef uint8_t ZydisInstructionCategory; typedef ZydisU8 ZydisInstructionCategory;
/** /**
* @brief Values that represent `ZydisInstructionCategory` elements. * @brief Values that represent `ZydisInstructionCategory` elements.
@ -9,6 +9,7 @@ typedef uint8_t ZydisInstructionCategory;
enum ZydisInstructionCategories enum ZydisInstructionCategories
{ {
ZYDIS_CATEGORY_INVALID, ZYDIS_CATEGORY_INVALID,
ZYDIS_CATEGORY_ADOX_ADCX,
ZYDIS_CATEGORY_AES, ZYDIS_CATEGORY_AES,
ZYDIS_CATEGORY_AMD3DNOW, ZYDIS_CATEGORY_AMD3DNOW,
ZYDIS_CATEGORY_AVX, ZYDIS_CATEGORY_AVX,
@ -17,8 +18,8 @@ enum ZydisInstructionCategories
ZYDIS_CATEGORY_AVX512, ZYDIS_CATEGORY_AVX512,
ZYDIS_CATEGORY_AVX512_4FMAPS, ZYDIS_CATEGORY_AVX512_4FMAPS,
ZYDIS_CATEGORY_AVX512_4VNNIW, ZYDIS_CATEGORY_AVX512_4VNNIW,
ZYDIS_CATEGORY_AVX512_BITALG,
ZYDIS_CATEGORY_AVX512_VBMI, ZYDIS_CATEGORY_AVX512_VBMI,
ZYDIS_CATEGORY_BDW,
ZYDIS_CATEGORY_BINARY, ZYDIS_CATEGORY_BINARY,
ZYDIS_CATEGORY_BITBYTE, ZYDIS_CATEGORY_BITBYTE,
ZYDIS_CATEGORY_BLEND, ZYDIS_CATEGORY_BLEND,
@ -42,6 +43,7 @@ enum ZydisInstructionCategories
ZYDIS_CATEGORY_FLAGOP, ZYDIS_CATEGORY_FLAGOP,
ZYDIS_CATEGORY_FMA4, ZYDIS_CATEGORY_FMA4,
ZYDIS_CATEGORY_GATHER, ZYDIS_CATEGORY_GATHER,
ZYDIS_CATEGORY_GFNI,
ZYDIS_CATEGORY_IFMA, ZYDIS_CATEGORY_IFMA,
ZYDIS_CATEGORY_INTERRUPT, ZYDIS_CATEGORY_INTERRUPT,
ZYDIS_CATEGORY_IO, ZYDIS_CATEGORY_IO,
@ -64,6 +66,7 @@ enum ZydisInstructionCategories
ZYDIS_CATEGORY_PREFETCHWT1, ZYDIS_CATEGORY_PREFETCHWT1,
ZYDIS_CATEGORY_PT, ZYDIS_CATEGORY_PT,
ZYDIS_CATEGORY_PUSH, ZYDIS_CATEGORY_PUSH,
ZYDIS_CATEGORY_RDPID,
ZYDIS_CATEGORY_RDRAND, ZYDIS_CATEGORY_RDRAND,
ZYDIS_CATEGORY_RDSEED, ZYDIS_CATEGORY_RDSEED,
ZYDIS_CATEGORY_RDWRFSGS, ZYDIS_CATEGORY_RDWRFSGS,
@ -86,14 +89,16 @@ enum ZydisInstructionCategories
ZYDIS_CATEGORY_TBM, ZYDIS_CATEGORY_TBM,
ZYDIS_CATEGORY_UFMA, ZYDIS_CATEGORY_UFMA,
ZYDIS_CATEGORY_UNCOND_BR, ZYDIS_CATEGORY_UNCOND_BR,
ZYDIS_CATEGORY_VAES,
ZYDIS_CATEGORY_VBMI2,
ZYDIS_CATEGORY_VFMA, ZYDIS_CATEGORY_VFMA,
ZYDIS_CATEGORY_VPCLMULQDQ,
ZYDIS_CATEGORY_VTX, ZYDIS_CATEGORY_VTX,
ZYDIS_CATEGORY_WIDENOP, ZYDIS_CATEGORY_WIDENOP,
ZYDIS_CATEGORY_X87_ALU, ZYDIS_CATEGORY_X87_ALU,
ZYDIS_CATEGORY_XOP, ZYDIS_CATEGORY_XOP,
ZYDIS_CATEGORY_XSAVE, ZYDIS_CATEGORY_XSAVE,
ZYDIS_CATEGORY_XSAVEOPT ZYDIS_CATEGORY_XSAVEOPT,
ZYDIS_CATEGORY_MAX_VALUE = ZYDIS_CATEGORY_XSAVEOPT,
ZYDIS_CATEGORY_MIN_BITS = 0x0007
}; };
#define ZYDIS_CATEGORY_MAX_VALUE ZYDIS_CATEGORY_XSAVEOPT
#define ZYDIS_CATEGORY_MAX_BITS 0x0007

View File

@ -1,7 +1,7 @@
/** /**
* @brief Defines the `ZydisMnemonic` datatype. * @brief Defines the `ZydisMnemonic` datatype.
*/ */
typedef uint16_t ZydisMnemonic; typedef ZydisU16 ZydisMnemonic;
/** /**
* @brief Values that represent `ZydisMnemonic` elements. * @brief Values that represent `ZydisMnemonic` elements.
@ -257,6 +257,9 @@ enum ZydisMnemonics
ZYDIS_MNEMONIC_FYL2X, ZYDIS_MNEMONIC_FYL2X,
ZYDIS_MNEMONIC_FYL2XP1, ZYDIS_MNEMONIC_FYL2XP1,
ZYDIS_MNEMONIC_GETSEC, ZYDIS_MNEMONIC_GETSEC,
ZYDIS_MNEMONIC_GF2P8AFFINEINVQB,
ZYDIS_MNEMONIC_GF2P8AFFINEQB,
ZYDIS_MNEMONIC_GF2P8MULB,
ZYDIS_MNEMONIC_HADDPD, ZYDIS_MNEMONIC_HADDPD,
ZYDIS_MNEMONIC_HADDPS, ZYDIS_MNEMONIC_HADDPS,
ZYDIS_MNEMONIC_HLT, ZYDIS_MNEMONIC_HLT,
@ -341,6 +344,7 @@ enum ZydisMnemonics
ZYDIS_MNEMONIC_KORB, ZYDIS_MNEMONIC_KORB,
ZYDIS_MNEMONIC_KORD, ZYDIS_MNEMONIC_KORD,
ZYDIS_MNEMONIC_KORQ, ZYDIS_MNEMONIC_KORQ,
ZYDIS_MNEMONIC_KORTEST,
ZYDIS_MNEMONIC_KORTESTB, ZYDIS_MNEMONIC_KORTESTB,
ZYDIS_MNEMONIC_KORTESTD, ZYDIS_MNEMONIC_KORTESTD,
ZYDIS_MNEMONIC_KORTESTQ, ZYDIS_MNEMONIC_KORTESTQ,
@ -585,7 +589,7 @@ enum ZydisMnemonics
ZYDIS_MNEMONIC_POPFD, ZYDIS_MNEMONIC_POPFD,
ZYDIS_MNEMONIC_POPFQ, ZYDIS_MNEMONIC_POPFQ,
ZYDIS_MNEMONIC_POR, ZYDIS_MNEMONIC_POR,
ZYDIS_MNEMONIC_PREFETCH_EXCLUSIVE, ZYDIS_MNEMONIC_PREFETCH,
ZYDIS_MNEMONIC_PREFETCHNTA, ZYDIS_MNEMONIC_PREFETCHNTA,
ZYDIS_MNEMONIC_PREFETCHT0, ZYDIS_MNEMONIC_PREFETCHT0,
ZYDIS_MNEMONIC_PREFETCHT1, ZYDIS_MNEMONIC_PREFETCHT1,
@ -644,6 +648,7 @@ enum ZydisMnemonics
ZYDIS_MNEMONIC_RDFSBASE, ZYDIS_MNEMONIC_RDFSBASE,
ZYDIS_MNEMONIC_RDGSBASE, ZYDIS_MNEMONIC_RDGSBASE,
ZYDIS_MNEMONIC_RDMSR, ZYDIS_MNEMONIC_RDMSR,
ZYDIS_MNEMONIC_RDPID,
ZYDIS_MNEMONIC_RDPKRU, ZYDIS_MNEMONIC_RDPKRU,
ZYDIS_MNEMONIC_RDPMC, ZYDIS_MNEMONIC_RDPMC,
ZYDIS_MNEMONIC_RDRAND, ZYDIS_MNEMONIC_RDRAND,
@ -996,6 +1001,9 @@ enum ZydisMnemonics
ZYDIS_MNEMONIC_VGETMANTPS, ZYDIS_MNEMONIC_VGETMANTPS,
ZYDIS_MNEMONIC_VGETMANTSD, ZYDIS_MNEMONIC_VGETMANTSD,
ZYDIS_MNEMONIC_VGETMANTSS, ZYDIS_MNEMONIC_VGETMANTSS,
ZYDIS_MNEMONIC_VGF2P8AFFINEINVQB,
ZYDIS_MNEMONIC_VGF2P8AFFINEQB,
ZYDIS_MNEMONIC_VGF2P8MULB,
ZYDIS_MNEMONIC_VGMAXABSPS, ZYDIS_MNEMONIC_VGMAXABSPS,
ZYDIS_MNEMONIC_VGMAXPD, ZYDIS_MNEMONIC_VGMAXPD,
ZYDIS_MNEMONIC_VGMAXPS, ZYDIS_MNEMONIC_VGMAXPS,
@ -1171,8 +1179,10 @@ enum ZydisMnemonics
ZYDIS_MNEMONIC_VPCMPW, ZYDIS_MNEMONIC_VPCMPW,
ZYDIS_MNEMONIC_VPCOMB, ZYDIS_MNEMONIC_VPCOMB,
ZYDIS_MNEMONIC_VPCOMD, ZYDIS_MNEMONIC_VPCOMD,
ZYDIS_MNEMONIC_VPCOMPRESSB,
ZYDIS_MNEMONIC_VPCOMPRESSD, ZYDIS_MNEMONIC_VPCOMPRESSD,
ZYDIS_MNEMONIC_VPCOMPRESSQ, ZYDIS_MNEMONIC_VPCOMPRESSQ,
ZYDIS_MNEMONIC_VPCOMPRESSW,
ZYDIS_MNEMONIC_VPCOMQ, ZYDIS_MNEMONIC_VPCOMQ,
ZYDIS_MNEMONIC_VPCOMUB, ZYDIS_MNEMONIC_VPCOMUB,
ZYDIS_MNEMONIC_VPCOMUD, ZYDIS_MNEMONIC_VPCOMUD,
@ -1181,6 +1191,10 @@ enum ZydisMnemonics
ZYDIS_MNEMONIC_VPCOMW, ZYDIS_MNEMONIC_VPCOMW,
ZYDIS_MNEMONIC_VPCONFLICTD, ZYDIS_MNEMONIC_VPCONFLICTD,
ZYDIS_MNEMONIC_VPCONFLICTQ, ZYDIS_MNEMONIC_VPCONFLICTQ,
ZYDIS_MNEMONIC_VPDPBUSD,
ZYDIS_MNEMONIC_VPDPBUSDS,
ZYDIS_MNEMONIC_VPDPWSSD,
ZYDIS_MNEMONIC_VPDPWSSDS,
ZYDIS_MNEMONIC_VPERM2F128, ZYDIS_MNEMONIC_VPERM2F128,
ZYDIS_MNEMONIC_VPERM2I128, ZYDIS_MNEMONIC_VPERM2I128,
ZYDIS_MNEMONIC_VPERMB, ZYDIS_MNEMONIC_VPERMB,
@ -1206,8 +1220,10 @@ enum ZydisMnemonics
ZYDIS_MNEMONIC_VPERMT2Q, ZYDIS_MNEMONIC_VPERMT2Q,
ZYDIS_MNEMONIC_VPERMT2W, ZYDIS_MNEMONIC_VPERMT2W,
ZYDIS_MNEMONIC_VPERMW, ZYDIS_MNEMONIC_VPERMW,
ZYDIS_MNEMONIC_VPEXPANDB,
ZYDIS_MNEMONIC_VPEXPANDD, ZYDIS_MNEMONIC_VPEXPANDD,
ZYDIS_MNEMONIC_VPEXPANDQ, ZYDIS_MNEMONIC_VPEXPANDQ,
ZYDIS_MNEMONIC_VPEXPANDW,
ZYDIS_MNEMONIC_VPEXTRB, ZYDIS_MNEMONIC_VPEXTRB,
ZYDIS_MNEMONIC_VPEXTRD, ZYDIS_MNEMONIC_VPEXTRD,
ZYDIS_MNEMONIC_VPEXTRQ, ZYDIS_MNEMONIC_VPEXTRQ,
@ -1330,8 +1346,10 @@ enum ZydisMnemonics
ZYDIS_MNEMONIC_VPMULLW, ZYDIS_MNEMONIC_VPMULLW,
ZYDIS_MNEMONIC_VPMULTISHIFTQB, ZYDIS_MNEMONIC_VPMULTISHIFTQB,
ZYDIS_MNEMONIC_VPMULUDQ, ZYDIS_MNEMONIC_VPMULUDQ,
ZYDIS_MNEMONIC_VPOPCNTB,
ZYDIS_MNEMONIC_VPOPCNTD, ZYDIS_MNEMONIC_VPOPCNTD,
ZYDIS_MNEMONIC_VPOPCNTQ, ZYDIS_MNEMONIC_VPOPCNTQ,
ZYDIS_MNEMONIC_VPOPCNTW,
ZYDIS_MNEMONIC_VPOR, ZYDIS_MNEMONIC_VPOR,
ZYDIS_MNEMONIC_VPORD, ZYDIS_MNEMONIC_VPORD,
ZYDIS_MNEMONIC_VPORQ, ZYDIS_MNEMONIC_VPORQ,
@ -1369,9 +1387,22 @@ enum ZydisMnemonics
ZYDIS_MNEMONIC_VPSHAW, ZYDIS_MNEMONIC_VPSHAW,
ZYDIS_MNEMONIC_VPSHLB, ZYDIS_MNEMONIC_VPSHLB,
ZYDIS_MNEMONIC_VPSHLD, ZYDIS_MNEMONIC_VPSHLD,
ZYDIS_MNEMONIC_VPSHLDD,
ZYDIS_MNEMONIC_VPSHLDQ,
ZYDIS_MNEMONIC_VPSHLDVD,
ZYDIS_MNEMONIC_VPSHLDVQ,
ZYDIS_MNEMONIC_VPSHLDVW,
ZYDIS_MNEMONIC_VPSHLDW,
ZYDIS_MNEMONIC_VPSHLQ, ZYDIS_MNEMONIC_VPSHLQ,
ZYDIS_MNEMONIC_VPSHLW, ZYDIS_MNEMONIC_VPSHLW,
ZYDIS_MNEMONIC_VPSHRDD,
ZYDIS_MNEMONIC_VPSHRDQ,
ZYDIS_MNEMONIC_VPSHRDVD,
ZYDIS_MNEMONIC_VPSHRDVQ,
ZYDIS_MNEMONIC_VPSHRDVW,
ZYDIS_MNEMONIC_VPSHRDW,
ZYDIS_MNEMONIC_VPSHUFB, ZYDIS_MNEMONIC_VPSHUFB,
ZYDIS_MNEMONIC_VPSHUFBITQMB,
ZYDIS_MNEMONIC_VPSHUFD, ZYDIS_MNEMONIC_VPSHUFD,
ZYDIS_MNEMONIC_VPSHUFHW, ZYDIS_MNEMONIC_VPSHUFHW,
ZYDIS_MNEMONIC_VPSHUFLW, ZYDIS_MNEMONIC_VPSHUFLW,
@ -1551,8 +1582,7 @@ enum ZydisMnemonics
ZYDIS_MNEMONIC_XSAVES, ZYDIS_MNEMONIC_XSAVES,
ZYDIS_MNEMONIC_XSAVES64, ZYDIS_MNEMONIC_XSAVES64,
ZYDIS_MNEMONIC_XSETBV, ZYDIS_MNEMONIC_XSETBV,
ZYDIS_MNEMONIC_XTEST ZYDIS_MNEMONIC_XTEST,
ZYDIS_MNEMONIC_MAX_VALUE = ZYDIS_MNEMONIC_XTEST,
ZYDIS_MNEMONIC_MIN_BITS = 0x000B
}; };
#define ZYDIS_MNEMONIC_MAX_VALUE ZYDIS_MNEMONIC_XTEST
#define ZYDIS_MNEMONIC_MAX_BITS 0x000B

View File

@ -24,8 +24,8 @@
***************************************************************************************************/ ***************************************************************************************************/
#ifndef ZYDIS_DECODERDATA_H #ifndef ZYDIS_INTERNAL_DECODERDATA_H
#define ZYDIS_DECODERDATA_H #define ZYDIS_INTERNAL_DECODERDATA_H
#include <Zydis/Defines.h> #include <Zydis/Defines.h>
#include <Zydis/DecoderTypes.h> #include <Zydis/DecoderTypes.h>
@ -53,7 +53,7 @@ extern "C" {
/** /**
* @brief Defines the @c ZydisDecoderTreeNodeType datatype. * @brief Defines the @c ZydisDecoderTreeNodeType datatype.
*/ */
typedef uint8_t ZydisDecoderTreeNodeType; typedef ZydisU8 ZydisDecoderTreeNodeType;
/** /**
* @brief Values that represent zydis decoder tree node types. * @brief Values that represent zydis decoder tree node types.
@ -136,7 +136,31 @@ enum ZydisDecoderTreeNodeTypes
/** /**
* @brief Reference to an MVEX.E filter. * @brief Reference to an MVEX.E filter.
*/ */
ZYDIS_NODETYPE_FILTER_MVEX_E = 0x12 ZYDIS_NODETYPE_FILTER_MVEX_E = 0x12,
/**
* @brief Reference to a AMD-mode filter.
*/
ZYDIS_NODETYPE_FILTER_MODE_AMD = 0x13,
/**
* @brief Reference to a KNC-mode filter.
*/
ZYDIS_NODETYPE_FILTER_MODE_KNC = 0x14,
/**
* @brief Reference to a MPX-mode filter.
*/
ZYDIS_NODETYPE_FILTER_MODE_MPX = 0x15,
/**
* @brief Reference to a CET-mode filter.
*/
ZYDIS_NODETYPE_FILTER_MODE_CET = 0x16,
/**
* @brief Reference to a LZCNT-mode filter.
*/
ZYDIS_NODETYPE_FILTER_MODE_LZCNT = 0x17,
/**
* @brief Reference to a TZCNT-mode filter.
*/
ZYDIS_NODETYPE_FILTER_MODE_TZCNT = 0x18
}; };
/* ---------------------------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------------------------- */
@ -144,7 +168,7 @@ enum ZydisDecoderTreeNodeTypes
/** /**
* @brief Defines the @c ZydisDecoderTreeNodeValue datatype. * @brief Defines the @c ZydisDecoderTreeNodeValue datatype.
*/ */
typedef uint16_t ZydisDecoderTreeNodeValue; typedef ZydisU16 ZydisDecoderTreeNodeValue;
/* ---------------------------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------------------------- */
@ -172,7 +196,7 @@ typedef struct ZydisDecoderTreeNode_
/** /**
* @brief Defines the @c ZydisInstructionEncodingFlags datatype. * @brief Defines the @c ZydisInstructionEncodingFlags datatype.
*/ */
typedef uint8_t ZydisInstructionEncodingFlags; typedef ZydisU8 ZydisInstructionEncodingFlags;
/** /**
* @brief The instruction has an optional modrm byte. * @brief The instruction has an optional modrm byte.
@ -219,7 +243,7 @@ typedef struct ZydisInstructionEncodingInfo_
/** /**
* @brief The size of the displacement value. * @brief The size of the displacement value.
*/ */
uint8_t size[3]; ZydisU8 size[3];
} disp; } disp;
/** /**
* @brief Immediate info. * @brief Immediate info.
@ -229,7 +253,7 @@ typedef struct ZydisInstructionEncodingInfo_
/** /**
* @brief The size of the immediate value. * @brief The size of the immediate value.
*/ */
uint8_t size[3]; ZydisU8 size[3];
/** /**
* @brief Signals, if the value is signed. * @brief Signals, if the value is signed.
*/ */
@ -256,7 +280,7 @@ typedef struct ZydisInstructionEncodingInfo_
* *
* @return The root node of the instruction tree. * @return The root node of the instruction tree.
*/ */
ZYDIS_NO_EXPORT const ZydisDecoderTreeNode* ZydisDecoderTreeGetRootNode(); ZYDIS_NO_EXPORT const ZydisDecoderTreeNode* ZydisDecoderTreeGetRootNode(void);
/** /**
* @brief Returns the child node of @c parent specified by @c index. * @brief Returns the child node of @c parent specified by @c index.
@ -267,7 +291,7 @@ ZYDIS_NO_EXPORT const ZydisDecoderTreeNode* ZydisDecoderTreeGetRootNode();
* @return The specified child node. * @return The specified child node.
*/ */
ZYDIS_NO_EXPORT const ZydisDecoderTreeNode* ZydisDecoderTreeGetChildNode( ZYDIS_NO_EXPORT const ZydisDecoderTreeNode* ZydisDecoderTreeGetChildNode(
const ZydisDecoderTreeNode* parent, uint16_t index); const ZydisDecoderTreeNode* parent, ZydisU16 index);
/** /**
* @brief Returns information about optional instruction parts (like modrm, displacement or * @brief Returns information about optional instruction parts (like modrm, displacement or
@ -287,4 +311,4 @@ ZYDIS_NO_EXPORT void ZydisGetInstructionEncodingInfo(const ZydisDecoderTreeNode*
} }
#endif #endif
#endif /* ZYDIS_DECODERDATA_H */ #endif /* ZYDIS_INTERNAL_DECODERDATA_H */

View File

@ -0,0 +1,82 @@
/***************************************************************************************************
Zyan Disassembler Library (Zydis)
Original Author : Joel Höner
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
***************************************************************************************************/
#ifndef ZYDIS_INTERNAL_LIBC_H
#define ZYDIS_INTERNAL_LIBC_H
#include <Zydis/Defines.h>
#ifndef ZYDIS_NO_LIBC
/* ============================================================================================== */
/* LibC is available */
/* ============================================================================================== */
# include <string.h>
# define ZydisMemoryCopy memcpy
# define ZydisMemorySet memset
# define ZydisStrLen strlen
#else
/* ============================================================================================== */
/* No LibC available, use our own functions */
/* ============================================================================================== */
/*
* These implementations are by no means optimized and will be outperformed by pretty much any
* libc implementation out there. We do not aim towards providing competetive implementations here,
* but towards providing a last resort fallback for environments without a working libc.
*/
ZYDIS_INLINE void* ZydisMemorySet(void* ptr, int value, ZydisUSize num)
{
ZydisU8 c = value & 0xff;
for (ZydisUSize i = 0; i < num; ++i) ((ZydisU8*)ptr)[i] = c;
return ptr;
}
ZYDIS_INLINE void* ZydisMemoryCopy(void* dst, const void* src, ZydisUSize num)
{
for (ZydisUSize i = 0; i < num; ++i)
{
((ZydisU8*)dst)[i] = ((const ZydisU8*)src)[i];
}
return dst;
}
ZYDIS_INLINE ZydisUSize ZydisStrLen(const char* str)
{
const char *s;
for (s = str; *s; ++s);
return s - str;
}
/* ============================================================================================== */
#endif
#endif /* ZYDIS_INTERNAL_LIBC_H */

View File

@ -24,8 +24,8 @@
***************************************************************************************************/ ***************************************************************************************************/
#ifndef ZYDIS_SHAREDDATA_H #ifndef ZYDIS_INTERNAL_SHAREDDATA_H
#define ZYDIS_SHAREDDATA_H #define ZYDIS_INTERNAL_SHAREDDATA_H
#include <Zydis/Defines.h> #include <Zydis/Defines.h>
#include <Zydis/Mnemonic.h> #include <Zydis/Mnemonic.h>
@ -56,7 +56,7 @@ extern "C" {
/** /**
* @brief Defines the @c ZydisSemanticOperandType datatype. * @brief Defines the @c ZydisSemanticOperandType datatype.
*/ */
typedef uint8_t ZydisSemanticOperandType; typedef ZydisU8 ZydisSemanticOperandType;
/** /**
* @brief Values that represent semantic operand-types. * @brief Values that represent semantic operand-types.
@ -92,13 +92,14 @@ enum ZydisSemanticOperandTypes
ZYDIS_SEMANTIC_OPTYPE_REL, ZYDIS_SEMANTIC_OPTYPE_REL,
ZYDIS_SEMANTIC_OPTYPE_PTR, ZYDIS_SEMANTIC_OPTYPE_PTR,
ZYDIS_SEMANTIC_OPTYPE_AGEN, ZYDIS_SEMANTIC_OPTYPE_AGEN,
ZYDIS_SEMANTIC_OPTYPE_MOFFS ZYDIS_SEMANTIC_OPTYPE_MOFFS,
ZYDIS_SEMANTIC_OPTYPE_MIB
}; };
/** /**
* @brief Defines the @c ZydisInternalElementType datatype. * @brief Defines the @c ZydisInternalElementType datatype.
*/ */
typedef uint8_t ZydisInternalElementType; typedef ZydisU8 ZydisInternalElementType;
/** /**
* @brief Values that represent internal element-types. * @brief Values that represent internal element-types.
@ -136,25 +137,24 @@ typedef struct ZydisOperandDefinition_
ZydisSemanticOperandType type ZYDIS_BITFIELD(5); ZydisSemanticOperandType type ZYDIS_BITFIELD(5);
ZydisOperandVisibility visibility ZYDIS_BITFIELD(2); ZydisOperandVisibility visibility ZYDIS_BITFIELD(2);
ZydisOperandAction action ZYDIS_BITFIELD(3); ZydisOperandAction action ZYDIS_BITFIELD(3);
uint16_t size[3]; ZydisU16 size[3];
ZydisInternalElementType elementType ZYDIS_BITFIELD(5); ZydisInternalElementType elementType ZYDIS_BITFIELD(5);
union union
{ {
ZydisOperandEncoding encoding; ZydisOperandEncoding encoding;
struct struct
{ {
uint8_t type ZYDIS_BITFIELD(3); ZydisU8 type ZYDIS_BITFIELD(3);
union union
{ {
ZydisRegister reg; ZydisRegister reg ZYDIS_BITFIELD(ZYDIS_REGISTER_MIN_BITS);
uint8_t id ZYDIS_BITFIELD(6); ZydisU8 id ZYDIS_BITFIELD(6);
} reg; } reg;
} reg; } reg;
struct struct
{ {
uint8_t seg ZYDIS_BITFIELD(3); ZydisU8 seg ZYDIS_BITFIELD(3);
uint8_t base ZYDIS_BITFIELD(3); ZydisU8 base ZYDIS_BITFIELD(3);
ZydisOperandAction baseAction ZYDIS_BITFIELD(3);
} mem; } mem;
} op; } op;
} ZydisOperandDefinition; } ZydisOperandDefinition;
@ -179,6 +179,7 @@ enum ZydisImplicitRegisterType
enum ZydisImplicitMemBase enum ZydisImplicitMemBase
{ {
ZYDIS_IMPLMEM_BASE_ABX, ZYDIS_IMPLMEM_BASE_ABX,
ZYDIS_IMPLMEM_BASE_ASP,
ZYDIS_IMPLMEM_BASE_ABP, ZYDIS_IMPLMEM_BASE_ABP,
ZYDIS_IMPLMEM_BASE_ASI, ZYDIS_IMPLMEM_BASE_ASI,
ZYDIS_IMPLMEM_BASE_ADI ZYDIS_IMPLMEM_BASE_ADI
@ -191,7 +192,7 @@ enum ZydisImplicitMemBase
/** /**
* @brief Defines the @c ZydisInternalVectorLength datatype. * @brief Defines the @c ZydisInternalVectorLength datatype.
*/ */
typedef uint8_t ZydisInternalVectorLength; typedef ZydisU8 ZydisInternalVectorLength;
/** /**
* @brief Values that represent internal vector-lengths. * @brief Values that represent internal vector-lengths.
@ -209,7 +210,7 @@ enum ZydisInternalVectorLengths
/** /**
* @brief Defines the @c ZydisInternalElementSize datatype. * @brief Defines the @c ZydisInternalElementSize datatype.
*/ */
typedef uint8_t ZydisInternalElementSize; typedef ZydisU8 ZydisInternalElementSize;
/** /**
* @brief Values that represent internal element-sizes. * @brief Values that represent internal element-sizes.
@ -220,7 +221,8 @@ enum ZydisInternalElementSizes
ZYDIS_IELEMENT_SIZE_8, ZYDIS_IELEMENT_SIZE_8,
ZYDIS_IELEMENT_SIZE_16, ZYDIS_IELEMENT_SIZE_16,
ZYDIS_IELEMENT_SIZE_32, ZYDIS_IELEMENT_SIZE_32,
ZYDIS_IELEMENT_SIZE_64 ZYDIS_IELEMENT_SIZE_64,
ZYDIS_IELEMENT_SIZE_128
}; };
/* ---------------------------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------------------------- */
@ -228,7 +230,7 @@ enum ZydisInternalElementSizes
/** /**
* @brief Defines the @c ZydisEVEXFunctionality datatype. * @brief Defines the @c ZydisEVEXFunctionality datatype.
*/ */
typedef uint8_t ZydisEVEXFunctionality; typedef ZydisU8 ZydisEVEXFunctionality;
/** /**
* @brief Values that represent EVEX-functionalities. * @brief Values that represent EVEX-functionalities.
@ -255,7 +257,7 @@ enum ZydisEVEXFunctionalities
/** /**
* @brief Defines the @c ZydisEVEXTupleType datatype. * @brief Defines the @c ZydisEVEXTupleType datatype.
*/ */
typedef uint8_t ZydisEVEXTupleType; typedef ZydisU8 ZydisEVEXTupleType;
/** /**
* @brief Values that represent EVEX tuple-types. * @brief Values that represent EVEX tuple-types.
@ -330,7 +332,7 @@ enum ZydisEVEXTupleTypes
/** /**
* @brief Defines the @c ZydisMVEXFunctionality datatype. * @brief Defines the @c ZydisMVEXFunctionality datatype.
*/ */
typedef uint8_t ZydisMVEXFunctionality; typedef ZydisU8 ZydisMVEXFunctionality;
/** /**
* @brief Values that represent MVEX-functionalities. * @brief Values that represent MVEX-functionalities.
@ -448,7 +450,7 @@ enum ZydisMVEXFunctionalities
/** /**
* @brief Defines the @c ZydisVEXStaticBroadcast datatype. * @brief Defines the @c ZydisVEXStaticBroadcast datatype.
*/ */
typedef uint8_t ZydisVEXStaticBroadcast; typedef ZydisU8 ZydisVEXStaticBroadcast;
/** /**
* @brief Values that represent static VEX-broadcasts. * @brief Values that represent static VEX-broadcasts.
@ -469,7 +471,7 @@ enum ZydisVEXStaticBroadcasts
/** /**
* @brief Defines the @c ZydisEVEXStaticBroadcast datatype. * @brief Defines the @c ZydisEVEXStaticBroadcast datatype.
*/ */
typedef uint8_t ZydisEVEXStaticBroadcast; typedef ZydisU8 ZydisEVEXStaticBroadcast;
/** /**
* @brief Values that represent static EVEX-broadcasts. * @brief Values that represent static EVEX-broadcasts.
@ -496,7 +498,7 @@ enum ZydisEVEXStaticBroadcasts
/** /**
* @brief Defines the @c ZydisMVEXStaticBroadcast datatype. * @brief Defines the @c ZydisMVEXStaticBroadcast datatype.
*/ */
typedef uint8_t ZydisMVEXStaticBroadcast; typedef ZydisU8 ZydisMVEXStaticBroadcast;
/** /**
* @brief Values that represent static MVEX-broadcasts. * @brief Values that represent static MVEX-broadcasts.
@ -515,7 +517,7 @@ enum ZydisMVEXStaticBroadcasts
/** /**
* @brief Defines the @c ZydisMaskPolicy datatype. * @brief Defines the @c ZydisMaskPolicy datatype.
*/ */
typedef uint8_t ZydisMaskPolicy; typedef ZydisU8 ZydisMaskPolicy;
/** /**
* @brief Values that represent AVX mask policies. * @brief Values that represent AVX mask policies.
@ -541,15 +543,16 @@ enum ZydisMaskPolicies
/* ---------------------------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------------------------- */
#define ZYDIS_INSTRUCTION_DEFINITION_BASE \ #define ZYDIS_INSTRUCTION_DEFINITION_BASE \
ZydisMnemonic mnemonic ZYDIS_BITFIELD(ZYDIS_MNEMONIC_MAX_BITS); \ ZydisMnemonic mnemonic ZYDIS_BITFIELD(ZYDIS_MNEMONIC_MIN_BITS); \
uint8_t operandCount ZYDIS_BITFIELD( 4); \ ZydisU8 operandCount ZYDIS_BITFIELD( 4); \
uint16_t operandReference ZYDIS_BITFIELD(15); \ ZydisU16 operandReference ZYDIS_BITFIELD(15); \
uint8_t operandSizeMap ZYDIS_BITFIELD( 3); \ ZydisU8 operandSizeMap ZYDIS_BITFIELD( 3); \
uint8_t flagsReference ZYDIS_BITFIELD( 7); \ ZydisU8 flagsReference ZYDIS_BITFIELD( 7); \
ZydisBool requiresProtectedMode ZYDIS_BITFIELD( 1); \
ZydisBool acceptsAddressSizeOverride ZYDIS_BITFIELD( 1); \ ZydisBool acceptsAddressSizeOverride ZYDIS_BITFIELD( 1); \
ZydisInstructionCategory category ZYDIS_BITFIELD(ZYDIS_CATEGORY_MAX_BITS); \ ZydisInstructionCategory category ZYDIS_BITFIELD(ZYDIS_CATEGORY_MIN_BITS); \
ZydisISASet isaSet ZYDIS_BITFIELD(ZYDIS_ISA_SET_MAX_BITS); \ ZydisISASet isaSet ZYDIS_BITFIELD(ZYDIS_ISA_SET_MIN_BITS); \
ZydisISAExt isaExt ZYDIS_BITFIELD(ZYDIS_ISA_EXT_MAX_BITS); \ ZydisISAExt isaExt ZYDIS_BITFIELD(ZYDIS_ISA_EXT_MIN_BITS); \
ZydisExceptionClass exceptionClass ZYDIS_BITFIELD( 6) ZydisExceptionClass exceptionClass ZYDIS_BITFIELD( 6)
#define ZYDIS_INSTRUCTION_DEFINITION_BASE_VECTOR \ #define ZYDIS_INSTRUCTION_DEFINITION_BASE_VECTOR \
@ -601,19 +604,22 @@ typedef struct ZydisInstructionDefinitionVEX_
ZydisVEXStaticBroadcast broadcast ZYDIS_BITFIELD( 3); ZydisVEXStaticBroadcast broadcast ZYDIS_BITFIELD( 3);
} ZydisInstructionDefinitionVEX; } ZydisInstructionDefinitionVEX;
#ifndef ZYDIS_DISABLE_EVEX
typedef struct ZydisInstructionDefinitionEVEX_ typedef struct ZydisInstructionDefinitionEVEX_
{ {
ZYDIS_INSTRUCTION_DEFINITION_BASE_VECTOR_EX; ZYDIS_INSTRUCTION_DEFINITION_BASE_VECTOR_EX;
ZydisInternalVectorLength vectorLength ZYDIS_BITFIELD( 2); ZydisInternalVectorLength vectorLength ZYDIS_BITFIELD( 2);
ZydisEVEXTupleType tupleType ZYDIS_BITFIELD( 4); ZydisEVEXTupleType tupleType ZYDIS_BITFIELD( 4);
ZydisInternalElementSize elementSize ZYDIS_BITFIELD( 4); ZydisInternalElementSize elementSize ZYDIS_BITFIELD( 3);
ZydisEVEXFunctionality functionality ZYDIS_BITFIELD( 2); ZydisEVEXFunctionality functionality ZYDIS_BITFIELD( 2);
ZydisMaskPolicy maskPolicy ZYDIS_BITFIELD( 2); ZydisMaskPolicy maskPolicy ZYDIS_BITFIELD( 2);
ZydisBool acceptsZeroMask ZYDIS_BITFIELD( 1); ZydisBool acceptsZeroMask ZYDIS_BITFIELD( 1);
ZydisBool isControlMask ZYDIS_BITFIELD( 1); ZydisBool isControlMask ZYDIS_BITFIELD( 1);
ZydisEVEXStaticBroadcast broadcast ZYDIS_BITFIELD( 4); ZydisEVEXStaticBroadcast broadcast ZYDIS_BITFIELD( 4);
} ZydisInstructionDefinitionEVEX; } ZydisInstructionDefinitionEVEX;
#endif
#ifndef ZYDIS_DISABLE_MVEX
typedef struct ZydisInstructionDefinitionMVEX_ typedef struct ZydisInstructionDefinitionMVEX_
{ {
ZYDIS_INSTRUCTION_DEFINITION_BASE_VECTOR_EX; ZYDIS_INSTRUCTION_DEFINITION_BASE_VECTOR_EX;
@ -622,6 +628,7 @@ typedef struct ZydisInstructionDefinitionMVEX_
ZydisBool hasElementGranularity ZYDIS_BITFIELD( 1); ZydisBool hasElementGranularity ZYDIS_BITFIELD( 1);
ZydisMVEXStaticBroadcast broadcast ZYDIS_BITFIELD( 3); ZydisMVEXStaticBroadcast broadcast ZYDIS_BITFIELD( 3);
} ZydisInstructionDefinitionMVEX; } ZydisInstructionDefinitionMVEX;
#endif
/* ---------------------------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------------------------- */
/* Accessed CPU flags */ /* Accessed CPU flags */
@ -657,7 +664,7 @@ typedef struct ZydisAccessedFlags_
* definition. * definition.
*/ */
ZYDIS_NO_EXPORT void ZydisGetInstructionDefinition(ZydisInstructionEncoding encoding, ZYDIS_NO_EXPORT void ZydisGetInstructionDefinition(ZydisInstructionEncoding encoding,
uint16_t id, const ZydisInstructionDefinition** definition); ZydisU16 id, const ZydisInstructionDefinition** definition);
/* ---------------------------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------------------------- */
/* Operand definition */ /* Operand definition */
@ -672,7 +679,7 @@ ZYDIS_NO_EXPORT void ZydisGetInstructionDefinition(ZydisInstructionEncoding enco
* *
* @return The number of operands for the given instruction-definition. * @return The number of operands for the given instruction-definition.
*/ */
ZYDIS_NO_EXPORT uint8_t ZydisGetOperandDefinitions(const ZydisInstructionDefinition* definition, ZYDIS_NO_EXPORT ZydisU8 ZydisGetOperandDefinitions(const ZydisInstructionDefinition* definition,
const ZydisOperandDefinition** operand); const ZydisOperandDefinition** operand);
/* ---------------------------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------------------------- */
@ -710,4 +717,4 @@ ZYDIS_NO_EXPORT void ZydisGetAccessedFlags(const ZydisInstructionDefinition* def
} }
#endif #endif
#endif /* ZYDIS_SHAREDDATA_H */ #endif /* ZYDIS_INTERNAL_SHAREDDATA_H */

View File

@ -32,8 +32,8 @@
#ifndef ZYDIS_MNEMONIC_H #ifndef ZYDIS_MNEMONIC_H
#define ZYDIS_MNEMONIC_H #define ZYDIS_MNEMONIC_H
#include <Zydis/Defines.h>
#include <Zydis/CommonTypes.h> #include <Zydis/CommonTypes.h>
#include <Zydis/String.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@ -58,6 +58,17 @@ extern "C" {
*/ */
ZYDIS_EXPORT const char* ZydisMnemonicGetString(ZydisMnemonic mnemonic); ZYDIS_EXPORT const char* ZydisMnemonicGetString(ZydisMnemonic mnemonic);
/**
* @brief Returns the specified instruction mnemonic as `ZydisStaticString`.
*
* @param mnemonic The mnemonic.
*
* @return The instruction mnemonic string or @c NULL, if an invalid mnemonic was passed.
*
* The `buffer` of the returned struct is guaranteed to be zero-terminated in this special case.
*/
ZYDIS_EXPORT const ZydisStaticString* ZydisMnemonicGetStaticString(ZydisMnemonic mnemonic);
/* ============================================================================================== */ /* ============================================================================================== */
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -34,7 +34,7 @@
#include <Zydis/Defines.h> #include <Zydis/Defines.h>
#include <Zydis/CommonTypes.h> #include <Zydis/CommonTypes.h>
#include <Zydis/Status.h> #include <Zydis/String.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@ -51,7 +51,7 @@ extern "C" {
/** /**
* @brief Defines the @c ZydisRegister datatype. * @brief Defines the @c ZydisRegister datatype.
*/ */
typedef uint8_t ZydisRegister; typedef ZydisU8 ZydisRegister;
/** /**
* @brief Values that represent zydis registers. * @brief Values that represent zydis registers.
@ -59,6 +59,7 @@ typedef uint8_t ZydisRegister;
enum ZydisRegisters enum ZydisRegisters
{ {
ZYDIS_REGISTER_NONE, ZYDIS_REGISTER_NONE,
// General purpose registers 8-bit // General purpose registers 8-bit
ZYDIS_REGISTER_AL, ZYDIS_REGISTER_CL, ZYDIS_REGISTER_DL, ZYDIS_REGISTER_BL, 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_AH, ZYDIS_REGISTER_CH, ZYDIS_REGISTER_DH, ZYDIS_REGISTER_BH,
@ -86,24 +87,6 @@ enum ZydisRegisters
// Floating point multimedia registers // Floating point multimedia registers
ZYDIS_REGISTER_MM0, ZYDIS_REGISTER_MM1, ZYDIS_REGISTER_MM2, ZYDIS_REGISTER_MM3, ZYDIS_REGISTER_MM0, ZYDIS_REGISTER_MM1, ZYDIS_REGISTER_MM2, ZYDIS_REGISTER_MM3,
ZYDIS_REGISTER_MM4, ZYDIS_REGISTER_MM5, ZYDIS_REGISTER_MM6, ZYDIS_REGISTER_MM7, ZYDIS_REGISTER_MM4, ZYDIS_REGISTER_MM5, ZYDIS_REGISTER_MM6, ZYDIS_REGISTER_MM7,
// Floating point vector registers 512-bit
ZYDIS_REGISTER_ZMM0, ZYDIS_REGISTER_ZMM1, ZYDIS_REGISTER_ZMM2, ZYDIS_REGISTER_ZMM3,
ZYDIS_REGISTER_ZMM4, ZYDIS_REGISTER_ZMM5, ZYDIS_REGISTER_ZMM6, ZYDIS_REGISTER_ZMM7,
ZYDIS_REGISTER_ZMM8, ZYDIS_REGISTER_ZMM9, ZYDIS_REGISTER_ZMM10, ZYDIS_REGISTER_ZMM11,
ZYDIS_REGISTER_ZMM12, ZYDIS_REGISTER_ZMM13, ZYDIS_REGISTER_ZMM14, ZYDIS_REGISTER_ZMM15,
ZYDIS_REGISTER_ZMM16, ZYDIS_REGISTER_ZMM17, ZYDIS_REGISTER_ZMM18, ZYDIS_REGISTER_ZMM19,
ZYDIS_REGISTER_ZMM20, ZYDIS_REGISTER_ZMM21, ZYDIS_REGISTER_ZMM22, ZYDIS_REGISTER_ZMM23,
ZYDIS_REGISTER_ZMM24, ZYDIS_REGISTER_ZMM25, ZYDIS_REGISTER_ZMM26, ZYDIS_REGISTER_ZMM27,
ZYDIS_REGISTER_ZMM28, ZYDIS_REGISTER_ZMM29, ZYDIS_REGISTER_ZMM30, ZYDIS_REGISTER_ZMM31,
// Floating point vector registers 256-bit
ZYDIS_REGISTER_YMM0, ZYDIS_REGISTER_YMM1, ZYDIS_REGISTER_YMM2, ZYDIS_REGISTER_YMM3,
ZYDIS_REGISTER_YMM4, ZYDIS_REGISTER_YMM5, ZYDIS_REGISTER_YMM6, ZYDIS_REGISTER_YMM7,
ZYDIS_REGISTER_YMM8, ZYDIS_REGISTER_YMM9, ZYDIS_REGISTER_YMM10, ZYDIS_REGISTER_YMM11,
ZYDIS_REGISTER_YMM12, ZYDIS_REGISTER_YMM13, ZYDIS_REGISTER_YMM14, ZYDIS_REGISTER_YMM15,
ZYDIS_REGISTER_YMM16, ZYDIS_REGISTER_YMM17, ZYDIS_REGISTER_YMM18, ZYDIS_REGISTER_YMM19,
ZYDIS_REGISTER_YMM20, ZYDIS_REGISTER_YMM21, ZYDIS_REGISTER_YMM22, ZYDIS_REGISTER_YMM23,
ZYDIS_REGISTER_YMM24, ZYDIS_REGISTER_YMM25, ZYDIS_REGISTER_YMM26, ZYDIS_REGISTER_YMM27,
ZYDIS_REGISTER_YMM28, ZYDIS_REGISTER_YMM29, ZYDIS_REGISTER_YMM30, ZYDIS_REGISTER_YMM31,
// Floating point vector registers 128-bit // Floating point vector registers 128-bit
ZYDIS_REGISTER_XMM0, ZYDIS_REGISTER_XMM1, ZYDIS_REGISTER_XMM2, ZYDIS_REGISTER_XMM3, 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_XMM4, ZYDIS_REGISTER_XMM5, ZYDIS_REGISTER_XMM6, ZYDIS_REGISTER_XMM7,
@ -113,12 +96,28 @@ enum ZydisRegisters
ZYDIS_REGISTER_XMM20, ZYDIS_REGISTER_XMM21, ZYDIS_REGISTER_XMM22, ZYDIS_REGISTER_XMM23, ZYDIS_REGISTER_XMM20, ZYDIS_REGISTER_XMM21, ZYDIS_REGISTER_XMM22, ZYDIS_REGISTER_XMM23,
ZYDIS_REGISTER_XMM24, ZYDIS_REGISTER_XMM25, ZYDIS_REGISTER_XMM26, ZYDIS_REGISTER_XMM27, ZYDIS_REGISTER_XMM24, ZYDIS_REGISTER_XMM25, ZYDIS_REGISTER_XMM26, ZYDIS_REGISTER_XMM27,
ZYDIS_REGISTER_XMM28, ZYDIS_REGISTER_XMM29, ZYDIS_REGISTER_XMM30, ZYDIS_REGISTER_XMM31, 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 // Flags registers
ZYDIS_REGISTER_RFLAGS, ZYDIS_REGISTER_EFLAGS, ZYDIS_REGISTER_FLAGS, ZYDIS_REGISTER_FLAGS, ZYDIS_REGISTER_EFLAGS, ZYDIS_REGISTER_RFLAGS,
// Instruction-pointer registers // IP registers
ZYDIS_REGISTER_RIP, ZYDIS_REGISTER_EIP, ZYDIS_REGISTER_IP, ZYDIS_REGISTER_IP, ZYDIS_REGISTER_EIP, ZYDIS_REGISTER_RIP,
// Special registers
ZYDIS_REGISTER_MXCSR, ZYDIS_REGISTER_PKRU, ZYDIS_REGISTER_XCR0,
// Segment registers // Segment registers
ZYDIS_REGISTER_ES, ZYDIS_REGISTER_CS, ZYDIS_REGISTER_SS, ZYDIS_REGISTER_DS, ZYDIS_REGISTER_ES, ZYDIS_REGISTER_CS, ZYDIS_REGISTER_SS, ZYDIS_REGISTER_DS,
ZYDIS_REGISTER_FS, ZYDIS_REGISTER_GS, ZYDIS_REGISTER_FS, ZYDIS_REGISTER_GS,
@ -143,15 +142,17 @@ enum ZydisRegisters
// Bound registers // Bound registers
ZYDIS_REGISTER_BND0, ZYDIS_REGISTER_BND1, ZYDIS_REGISTER_BND2, ZYDIS_REGISTER_BND3, ZYDIS_REGISTER_BND0, ZYDIS_REGISTER_BND1, ZYDIS_REGISTER_BND2, ZYDIS_REGISTER_BND3,
ZYDIS_REGISTER_BNDCFG, ZYDIS_REGISTER_BNDSTATUS, ZYDIS_REGISTER_BNDCFG, ZYDIS_REGISTER_BNDSTATUS,
// Misc registers
ZYDIS_REGISTER_MXCSR, ZYDIS_REGISTER_PKRU, ZYDIS_REGISTER_XCR0,
/** /**
* @brief Maximum value of this enum. * @brief Maximum value of this enum.
*/ */
ZYDIS_REGISTER_MAX_VALUE = ZYDIS_REGISTER_BNDSTATUS, ZYDIS_REGISTER_MAX_VALUE = ZYDIS_REGISTER_XCR0,
/** /**
* @brief Maximum amount of bits occupied by an integer from this enum. * @brief Minimum amount of bits required to store a value of this enum.
*/ */
ZYDIS_REGISTER_MAX_BITS = 8 ZYDIS_REGISTER_MIN_BITS = 0x0008
}; };
/* ---------------------------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------------------------- */
@ -161,7 +162,7 @@ enum ZydisRegisters
/** /**
* @brief Defines the @c ZydisRegisterClass datatype. * @brief Defines the @c ZydisRegisterClass datatype.
*/ */
typedef uint8_t ZydisRegisterClass; typedef ZydisU8 ZydisRegisterClass;
/** /**
* @brief Values that represent zydis register-classes. * @brief Values that represent zydis register-classes.
@ -250,7 +251,7 @@ enum ZydisRegisterClasses
/** /**
* @brief Defines the @c ZydisRegisterWidth datatype. * @brief Defines the @c ZydisRegisterWidth datatype.
*/ */
typedef uint16_t ZydisRegisterWidth; typedef ZydisU16 ZydisRegisterWidth;
/* ---------------------------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------------------------- */
@ -267,7 +268,7 @@ typedef uint16_t ZydisRegisterWidth;
* @return The register specified by the @c registerClass and the @c id or @c ZYDIS_REGISTER_NONE, * @return The register specified by the @c registerClass and the @c id or @c ZYDIS_REGISTER_NONE,
* if an invalid parameter was passed. * if an invalid parameter was passed.
*/ */
ZYDIS_EXPORT ZydisRegister ZydisRegisterEncode(ZydisRegisterClass registerClass, uint8_t id); ZYDIS_EXPORT ZydisRegister ZydisRegisterEncode(ZydisRegisterClass registerClass, ZydisU8 id);
/** /**
* @brief Returns the id of the specified register. * @brief Returns the id of the specified register.
@ -276,7 +277,7 @@ ZYDIS_EXPORT ZydisRegister ZydisRegisterEncode(ZydisRegisterClass registerClass,
* *
* @return The id of the specified register, or -1 if an invalid parameter was passed. * @return The id of the specified register, or -1 if an invalid parameter was passed.
*/ */
ZYDIS_EXPORT int16_t ZydisRegisterGetId(ZydisRegister reg); ZYDIS_EXPORT ZydisI16 ZydisRegisterGetId(ZydisRegister reg);
/** /**
* @brief Returns the register-class of the specified register. * @brief Returns the register-class of the specified register.
@ -314,6 +315,17 @@ ZYDIS_EXPORT ZydisRegisterWidth ZydisRegisterGetWidth64(ZydisRegister reg);
*/ */
ZYDIS_EXPORT const char* ZydisRegisterGetString(ZydisRegister reg); ZYDIS_EXPORT const char* ZydisRegisterGetString(ZydisRegister reg);
/**
* @brief Returns the specified register string as `ZydisStaticString`.
*
* @param reg The register.
*
* @return The register string or @c NULL, if an invalid register was passed.
*
* The `buffer` of the returned struct is guaranteed to be zero-terminated in this special case.
*/
ZYDIS_EXPORT const ZydisStaticString* ZydisRegisterGetStaticString(ZydisRegister reg);
/* ============================================================================================== */ /* ============================================================================================== */
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -47,7 +47,7 @@ extern "C" {
/* ---------------------------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------------------------- */
#define ZYDIS_MAX_INSTRUCTION_LENGTH 15 #define ZYDIS_MAX_INSTRUCTION_LENGTH 15
#define ZYDIS_MAX_OPERAND_COUNT 9 #define ZYDIS_MAX_OPERAND_COUNT 10
/* ---------------------------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------------------------- */
@ -62,42 +62,42 @@ extern "C" {
/** /**
* @brief Defines the @c ZydisMachineMode datatype. * @brief Defines the @c ZydisMachineMode datatype.
*/ */
typedef uint8_t ZydisMachineMode; typedef ZydisU8 ZydisMachineMode;
/** /**
* @brief Values that represent machine modes. * @brief Values that represent machine modes.
*/ */
enum ZydisMachineModes enum ZydisMachineModes
{ {
ZYDIS_MACHINE_MODE_INVALID = 0, ZYDIS_MACHINE_MODE_INVALID,
/** /**
* @brief 64 bit mode. * @brief 64 bit mode.
*/ */
ZYDIS_MACHINE_MODE_LONG_64 = 64, ZYDIS_MACHINE_MODE_LONG_64,
/** /**
* @brief 32 bit protected mode. * @brief 32 bit protected mode.
*/ */
ZYDIS_MACHINE_MODE_LONG_COMPAT_32 = 32, ZYDIS_MACHINE_MODE_LONG_COMPAT_32,
/** /**
* @brief 16 bit protected mode. * @brief 16 bit protected mode.
*/ */
ZYDIS_MACHINE_MODE_LONG_COMPAT_16 = 16, ZYDIS_MACHINE_MODE_LONG_COMPAT_16,
/** /**
* @brief 32 bit protected mode. * @brief 32 bit protected mode.
*/ */
ZYDIS_MACHINE_MODE_LEGACY_32 = 32, ZYDIS_MACHINE_MODE_LEGACY_32,
/** /**
* @brief 16 bit protected mode. * @brief 16 bit protected mode.
*/ */
ZYDIS_MACHINE_MODE_LEGACY_16 = 16, ZYDIS_MACHINE_MODE_LEGACY_16,
/** /**
* @brief 16 bit real mode. * @brief 16 bit real mode.
*/ */
ZYDIS_MACHINE_MODE_REAL_16 = 16, ZYDIS_MACHINE_MODE_REAL_16,
/** /**
* @brief Maximum value of this enum. * @brief Maximum value of this enum.
*/ */
ZYDIS_MACHINE_MODE_MAX_VALUE = ZYDIS_MACHINE_MODE_LONG_64 ZYDIS_MACHINE_MODE_MAX_VALUE = ZYDIS_MACHINE_MODE_REAL_16
}; };
/* ---------------------------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------------------------- */
@ -107,7 +107,7 @@ enum ZydisMachineModes
/** /**
* @brief Defines the @c ZydisAddressWidth datatype. * @brief Defines the @c ZydisAddressWidth datatype.
*/ */
typedef uint8_t ZydisAddressWidth; typedef ZydisU8 ZydisAddressWidth;
/** /**
* @brief Values that represent address widths. * @brief Values that represent address widths.
@ -128,7 +128,7 @@ enum ZydisAddressWidths
/** /**
* @brief Defines the @c ZydisElementType datatype. * @brief Defines the @c ZydisElementType datatype.
*/ */
typedef uint8_t ZydisElementType; typedef ZydisU8 ZydisElementType;
/** /**
* @brief Values that represent element-types. * @brief Values that represent element-types.
@ -150,7 +150,7 @@ enum ZydisElementTypes
/** /**
* @brief Defines the @c ZydisElementSize datatype. * @brief Defines the @c ZydisElementSize datatype.
*/ */
typedef uint16_t ZydisElementSize; typedef ZydisU16 ZydisElementSize;
/* ---------------------------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------------------------- */
/* Operand type */ /* Operand type */
@ -159,7 +159,7 @@ typedef uint16_t ZydisElementSize;
/** /**
* @brief Defines the @c ZydisOperandType datatype. * @brief Defines the @c ZydisOperandType datatype.
*/ */
typedef uint8_t ZydisOperandType; typedef ZydisU8 ZydisOperandType;
/** /**
* @brief Values that represent operand-types. * @brief Values that represent operand-types.
@ -199,7 +199,7 @@ enum ZydisOperandTypes
/** /**
* @brief Defines the @c ZydisOperandEncoding datatype. * @brief Defines the @c ZydisOperandEncoding datatype.
*/ */
typedef uint8_t ZydisOperandEncoding; typedef ZydisU8 ZydisOperandEncoding;
/** /**
* @brief Values that represent operand-encodings. * @brief Values that represent operand-encodings.
@ -251,7 +251,7 @@ enum ZydisOperandEncodings
/** /**
* @brief Defines the @c ZydisOperandVisibility datatype. * @brief Defines the @c ZydisOperandVisibility datatype.
*/ */
typedef uint8_t ZydisOperandVisibility; typedef ZydisU8 ZydisOperandVisibility;
/** /**
* @brief Values that represent operand-visibilities. * @brief Values that represent operand-visibilities.
@ -284,7 +284,7 @@ enum ZydisOperandVisibilities
/** /**
* @brief Defines the @c ZydisOperandAction datatype. * @brief Defines the @c ZydisOperandAction datatype.
*/ */
typedef uint8_t ZydisOperandAction; typedef ZydisU8 ZydisOperandAction;
/** /**
* @brief Values that represent operand-actions. * @brief Values that represent operand-actions.
@ -347,7 +347,7 @@ enum ZydisOperandActions
/** /**
* @brief Defines the @c ZydisInstructionEncoding datatype. * @brief Defines the @c ZydisInstructionEncoding datatype.
*/ */
typedef uint8_t ZydisInstructionEncoding; typedef ZydisU8 ZydisInstructionEncoding;
/** /**
* @brief Values that represent instruction-encodings. * @brief Values that represent instruction-encodings.
@ -392,7 +392,7 @@ enum ZydisInstructionEncodings
/** /**
* @brief Defines the @c ZydisOpcodeMap map. * @brief Defines the @c ZydisOpcodeMap map.
*/ */
typedef uint8_t ZydisOpcodeMap; typedef ZydisU8 ZydisOpcodeMap;
/** /**
* @brief Values that represent opcode-maps. * @brief Values that represent opcode-maps.

View File

@ -45,12 +45,12 @@ extern "C" {
/** /**
* @brief Defines the @c ZydisStatus datatype. * @brief Defines the @c ZydisStatus datatype.
*/ */
typedef uint32_t ZydisStatus; typedef ZydisU32 ZydisStatus;
/** /**
* @brief Values that represent a zydis status-codes. * @brief Values that represent a zydis status-codes.
*/ */
enum ZydisStatusCode enum ZydisStatusCodes
{ {
/* ------------------------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------------------------ */
/* General */ /* General */
@ -164,10 +164,10 @@ enum ZydisStatusCode
#define ZYDIS_CHECK(status) \ #define ZYDIS_CHECK(status) \
do \ do \
{ \ { \
ZydisStatus s = status; \ ZydisStatus status_038560234 = status; \
if (!ZYDIS_SUCCESS(s)) \ if (!ZYDIS_SUCCESS(status_038560234)) \
{ \ { \
return s; \ return status_038560234; \
} \ } \
} while (0) } while (0)

418
include/Zydis/String.h Normal file
View File

@ -0,0 +1,418 @@
/***************************************************************************************************
Zyan Disassembler Library (Zydis)
Original Author : Florian Bernd, Joel Höner
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
***************************************************************************************************/
#ifndef ZYDIS_STRING_H
#define ZYDIS_STRING_H
#include <Zydis/CommonTypes.h>
#include <Zydis/Status.h>
#include <Zydis/Internal/LibC.h>
/* ============================================================================================== */
/* Enums and types */
/* ============================================================================================== */
/* ---------------------------------------------------------------------------------------------- */
/* String */
/* ---------------------------------------------------------------------------------------------- */
/**
* @brief Defines the `ZydisString` struct.
*/
typedef struct ZydisString_
{
/**
* @brief The buffer that contains the actual string (0-termination is optional!).
*/
char *buffer;
/**
* @brief The length of the string (without 0-termination).
*/
ZydisUSize length;
/**
* @brief The total buffer capacity.
*/
ZydisUSize capacity;
} ZydisString;
/* ---------------------------------------------------------------------------------------------- */
/* Static string */
/* ---------------------------------------------------------------------------------------------- */
#pragma pack(push, 1)
/**
* @brief Defines the `ZydisStaticString` struct.
*
* This more compact struct is mainly used for internal string-tables to save up some bytes.
*/
typedef struct ZydisStaticString_
{
/**
* @brief The buffer that contains the actual string (0-termination is optional!).
*/
const char* buffer;
/**
* @brief The length of the string (without 0-termination).
*/
ZydisU8 length;
} ZydisStaticString;
#pragma pack(pop)
/* ---------------------------------------------------------------------------------------------- */
/* Letter Case */
/* ---------------------------------------------------------------------------------------------- */
/**
* @brief Defines the `ZydisLetterCase` datatype.
*/
typedef ZydisU8 ZydisLetterCase;
/**
* @brief Values that represent letter cases.
*/
enum ZydisLetterCases
{
/**
* @brief Uses the given text "as is".
*/
ZYDIS_LETTER_CASE_DEFAULT,
/**
* @brief Converts the given text to lowercase letters.
*/
ZYDIS_LETTER_CASE_LOWER,
/**
* @brief Converts the given text to uppercase letters.
*/
ZYDIS_LETTER_CASE_UPPER,
/**
* @brief Maximum value of this enum.
*/
ZYDIS_LETTER_CASE_MAX_VALUE = ZYDIS_LETTER_CASE_UPPER
};
/* ---------------------------------------------------------------------------------------------- */
/* ============================================================================================== */
/* Macros */
/* ============================================================================================== */
/* ---------------------------------------------------------------------------------------------- */
/* Helper Macros */
/* ---------------------------------------------------------------------------------------------- */
/**
* @brief Creates a `ZydisString` struct from a static C-string.
*
* @param string The C-string constant.
*/
#define ZYDIS_MAKE_STRING(string) \
{ (char*)string, sizeof(string) - 1, sizeof(string) - 1 }
/**
* @brief Creates a `ZydisStaticString` from a static C-string.
*
* @param string The C-string constant.
*/
#define ZYDIS_MAKE_STATIC_STRING(string) \
{ string, sizeof(string) - 1 }
/* ---------------------------------------------------------------------------------------------- */
/* ============================================================================================== */
/* Functions */
/* ============================================================================================== */
/* ---------------------------------------------------------------------------------------------- */
/* Basic Operations */
/* ---------------------------------------------------------------------------------------------- */
/**
* @brief Initializes a `ZydisString` struct with a C-string.
*
* @param string The string to initialize.
* @param value The C-string constant.
*
* @return A zydis status code.
*/
ZYDIS_NO_EXPORT ZYDIS_INLINE ZydisStatus ZydisStringInit(ZydisString* string, char* value)
{
if (!string || !value)
{
return ZYDIS_STATUS_INVALID_PARAMETER;
}
const ZydisUSize length = ZydisStrLen(value);
string->buffer = value;
string->length = length;
string->capacity = length;
return ZYDIS_STATUS_SUCCESS;
}
/**
* @brief Finalizes a `ZydisString` struct by adding a terminating zero byte.
*
* @param string The string to finalize.
*
* @return A zydis status code.
*/
ZYDIS_NO_EXPORT ZYDIS_INLINE ZydisStatus ZydisStringFinalize(ZydisString* string)
{
if (!string)
{
return ZYDIS_STATUS_INVALID_PARAMETER;
}
if (string->length >= string->capacity)
{
return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE;
}
string->buffer[string->length] = 0;
return ZYDIS_STATUS_SUCCESS;
}
/* ---------------------------------------------------------------------------------------------- */
/**
* @brief Appends a `ZydisString` to another `ZydisString`, converting it to the specified
* letter-case.
*
* @param string The string to append to.
* @param text The string to append.
* @param letterCase The letter case to use.
*
* @return @c ZYDIS_STATUS_SUCCESS, if the function succeeded, or
* @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not
* sufficient to append the given @c text.
*/
ZYDIS_NO_EXPORT ZydisStatus ZydisStringAppendEx(ZydisString* string, const ZydisString* text,
ZydisLetterCase letterCase);
/**
* @brief Appends the given C-string to a `ZydisString`, converting it to the specified
* letter-case.
*
* @param string The string to append to.
* @param text The C-string to append.
* @param letterCase The letter case to use.
*
* @return @c ZYDIS_STATUS_SUCCESS, if the function succeeded, or
* @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not
* sufficient to append the given @c text.
*/
ZYDIS_NO_EXPORT ZYDIS_INLINE ZydisStatus ZydisStringAppendExC(ZydisString* string,
const char* text, ZydisLetterCase letterCase)
{
ZydisString other;
ZYDIS_CHECK(ZydisStringInit(&other, (char*)text));
return ZydisStringAppendEx(string, &other, letterCase);
}
/**
* @brief Appends the given 'ZydisStaticString' to a `ZydisString`, converting it to the
* specified letter-case.
*
* @param string The string to append to.
* @param text The static-string to append.
* @param letterCase The letter case to use.
*
* @return @c ZYDIS_STATUS_SUCCESS, if the function succeeded, or
* @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not
* sufficient to append the given @c text.
*/
ZYDIS_NO_EXPORT ZYDIS_INLINE ZydisStatus 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);
}
/* ---------------------------------------------------------------------------------------------- */
/* Formatting */
/* ---------------------------------------------------------------------------------------------- */
/**
* @brief Formats the given unsigned ordinal @c value to its decimal text-representation and
* appends it to @c s.
*
* @param string A pointer to the string.
* @param value The value.
* @param paddingLength Padds the converted value with leading zeros, if the number of chars is
* less than the @c paddingLength.
*
* @return @c ZYDIS_STATUS_SUCCESS, if the function succeeded, or
* @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not
* sufficient to append the given @c value.
*
* The string-buffer pointer is increased by the number of chars written, if the call was
* successfull.
*/
ZYDIS_NO_EXPORT ZydisStatus ZydisPrintDecU(ZydisString* string, ZydisU64 value,
ZydisU8 paddingLength);
/**
* @brief Formats the given signed ordinal @c value to its decimal text-representation and
* appends it to @c s.
*
* @param string A pointer to the string.
* @param value The value.
* @param paddingLength Padds the converted value with leading zeros, if the number of chars is
* less than the @c paddingLength (the sign char is ignored).
*
* @return @c ZYDIS_STATUS_SUCCESS, if the function succeeded, or
* @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not
* sufficient to append the given @c value.
*
* The string-buffer pointer is increased by the number of chars written, if the call was
* successfull.
*/
ZYDIS_NO_EXPORT ZydisStatus ZydisPrintDecS(ZydisString* string, ZydisI64 value,
ZydisU8 paddingLength);
/**
* @brief Formats the given unsigned ordinal @c value to its hexadecimal text-representation and
* appends it to the @c buffer.
*
* @param string A pointer to the string.
* @param value The value.
* @param paddingLength Padds the converted value with leading zeros, if the number of chars is
* less than the @c paddingLength.
* @param uppercase Set @c TRUE to print the hexadecimal value in uppercase letters instead
* of lowercase ones.
* @param prefix The string to use as prefix or `NULL`, if not needed.
* @param suffix The string to use as suffix or `NULL`, if not needed.
*
* @return @c ZYDIS_STATUS_SUCCESS, if the function succeeded, or
* @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not
* sufficient to append the given @c value.
*
* The string-buffer pointer is increased by the number of chars written, if the call was
* successfull.
*/
ZYDIS_NO_EXPORT ZydisStatus ZydisPrintHexU(ZydisString* string, ZydisU64 value,
ZydisU8 paddingLength, ZydisBool uppercase, const ZydisString* prefix,
const ZydisString* suffix);
/**
* @brief Formats the given signed ordinal @c value to its hexadecimal text-representation and
* appends it to the @c buffer.
*
* @param string A pointer to the string.
* @param value The value.
* @param paddingLength Padds the converted value with leading zeros, if the number of chars is
* less than the @c paddingLength (the sign char is ignored).
* @param uppercase Set @c TRUE to print the hexadecimal value in uppercase letters instead
* of lowercase ones.
* @param prefix The string to use as prefix or `NULL`, if not needed.
* @param suffix The string to use as suffix or `NULL`, if not needed.
*
* @return @c ZYDIS_STATUS_SUCCESS, if the function succeeded, or
* @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not
* sufficient to append the given @c value.
*
* The string-buffer pointer is increased by the number of chars written, if the call was
* successfull.
*/
ZYDIS_NO_EXPORT ZydisStatus ZydisPrintHexS(ZydisString* string, ZydisI64 value,
ZydisU8 paddingLength, ZydisBool uppercase, const ZydisString* prefix,
const ZydisString* suffix);
/* ---------------------------------------------------------------------------------------------- */
/* ============================================================================================== */
#endif // ZYDIS_STRING_H

View File

@ -60,7 +60,7 @@ extern "C" {
* - The displacement needs to get truncated and zero extended * - The displacement needs to get truncated and zero extended
*/ */
ZYDIS_EXPORT ZydisStatus ZydisCalcAbsoluteAddress(const ZydisDecodedInstruction* instruction, ZYDIS_EXPORT ZydisStatus ZydisCalcAbsoluteAddress(const ZydisDecodedInstruction* instruction,
const ZydisDecodedOperand* operand, uint64_t* address); const ZydisDecodedOperand* operand, ZydisU64* address);
/* ============================================================================================== */ /* ============================================================================================== */
/* Flags */ /* Flags */

View File

@ -42,6 +42,7 @@
#include <Zydis/Register.h> #include <Zydis/Register.h>
#include <Zydis/SharedTypes.h> #include <Zydis/SharedTypes.h>
#include <Zydis/Status.h> #include <Zydis/Status.h>
#include <Zydis/String.h>
#include <Zydis/Utils.h> #include <Zydis/Utils.h>
#ifdef __cplusplus #ifdef __cplusplus
@ -59,7 +60,7 @@ extern "C" {
/** /**
* @brief A macro that defines the zydis version. * @brief A macro that defines the zydis version.
*/ */
#define ZYDIS_VERSION (uint64_t)0x0002000000000000 #define ZYDIS_VERSION (ZydisU64)0x0002000000000000
/* ---------------------------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------------------------- */
/* Helper macros */ /* Helper macros */
@ -70,28 +71,28 @@ extern "C" {
* *
* @param version The zydis version value * @param version The zydis version value
*/ */
#define ZYDIS_VERSION_MAJOR(version) (uint16_t)((version & 0xFFFF000000000000) >> 48) #define ZYDIS_VERSION_MAJOR(version) (ZydisU16)((version & 0xFFFF000000000000) >> 48)
/** /**
* @brief Extracts the minor-part of the zydis version. * @brief Extracts the minor-part of the zydis version.
* *
* @param version The zydis version value * @param version The zydis version value
*/ */
#define ZYDIS_VERSION_MINOR(version) (uint16_t)((version & 0x0000FFFF00000000) >> 32) #define ZYDIS_VERSION_MINOR(version) (ZydisU16)((version & 0x0000FFFF00000000) >> 32)
/** /**
* @brief Extracts the patch-part of the zydis version. * @brief Extracts the patch-part of the zydis version.
* *
* @param version The zydis version value * @param version The zydis version value
*/ */
#define ZYDIS_VERSION_PATCH(version) (uint16_t)((version & 0x00000000FFFF0000) >> 16) #define ZYDIS_VERSION_PATCH(version) (ZydisU16)((version & 0x00000000FFFF0000) >> 16)
/** /**
* @brief Extracts the build-part of the zydis version. * @brief Extracts the build-part of the zydis version.
* *
* @param version The zydis version value * @param version The zydis version value
*/ */
#define ZYDIS_VERSION_BUILD(version) (uint16_t)(version & 0x000000000000FFFF) #define ZYDIS_VERSION_BUILD(version) (ZydisU16)(version & 0x000000000000FFFF)
/* ---------------------------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------------------------- */
@ -102,7 +103,7 @@ extern "C" {
/** /**
* @brief Defines the @c ZydisFeature datatype. * @brief Defines the @c ZydisFeature datatype.
*/ */
typedef uint8_t ZydisFeature; typedef ZydisU8 ZydisFeature;
/** /**
* @brief Values that represent zydis features. * @brief Values that represent zydis features.
@ -111,8 +112,6 @@ enum ZydisFeatures
{ {
ZYDIS_FEATURE_EVEX, ZYDIS_FEATURE_EVEX,
ZYDIS_FEATURE_MVEX, ZYDIS_FEATURE_MVEX,
ZYDIS_FEATURE_FLAGS,
ZYDIS_FEATURE_CPUID
}; };
/* ============================================================================================== */ /* ============================================================================================== */
@ -127,7 +126,7 @@ enum ZydisFeatures
* 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_EXPORT uint64_t ZydisGetVersion(); ZYDIS_EXPORT ZydisU64 ZydisGetVersion(void);
/** /**
* @brief Checks, if the specified feature is enabled in the current zydis library instance. * @brief Checks, if the specified feature is enabled in the current zydis library instance.

15
msvc/README.md Normal file
View File

@ -0,0 +1,15 @@
## Readme
This directory contains MSVC project files to build Zydis and the included tools and examples.
There are three build configurations, each with 32/64 bit and debug/release versions:
- Static (default)
- Dynamic
- Kernel mode
In order to build the kernel mode configuration you must have the Microsoft WDK installed, available at https://developer.microsoft.com/en-us/windows/hardware/windows-driver-kit.
The kernel mode configuration only builds `Zydis` and the `ZydisWinKernel` driver sample. The other configurations build all projects except for `ZydisWinKernel`.
NOTE: If you already have the WDK installed, make sure it is updated to at least the Windows 10 1709 version (10.0.16299.0) in order to prevent issues opening the solution file. This is due to a bug in older WDK toolsets.
All Zydis features are enabled by default. In order to disable specific features you can define preprocessor directives such as `ZYDIS_DISABLE_FORMATTER`. Refer to `CMakeLists.txt` for the full list of feature switches.

212
msvc/Zydis.sln Normal file
View File

@ -0,0 +1,212 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27004.2009
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{4F5048C7-CB90-437E-AB21-32258F9650B6}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{292A9E1E-C557-4570-ABE1-8EEC0E1B79C4}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FormatterHooks", "examples\FormatterHooks.vcxproj", "{8085CF70-11D1-3E7B-B648-C910396BB4A7}"
ProjectSection(ProjectDependencies) = postProject
{88A23124-5640-35A0-B890-311D7A67A7D2} = {88A23124-5640-35A0-B890-311D7A67A7D2}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZydisFuzzIn", "examples\ZydisFuzzIn.vcxproj", "{A0C9A331-13CC-3762-9D26-9F82C6518CAA}"
ProjectSection(ProjectDependencies) = postProject
{88A23124-5640-35A0-B890-311D7A67A7D2} = {88A23124-5640-35A0-B890-311D7A67A7D2}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZydisPerfTest", "examples\ZydisPerfTest.vcxproj", "{91EF3E98-CD57-3870-A399-A0D98D193F80}"
ProjectSection(ProjectDependencies) = postProject
{88A23124-5640-35A0-B890-311D7A67A7D2} = {88A23124-5640-35A0-B890-311D7A67A7D2}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZydisDisasm", "tools\ZydisDisasm.vcxproj", "{805CBF3F-3DDC-3141-AD7C-3B452FBEBCD2}"
ProjectSection(ProjectDependencies) = postProject
{88A23124-5640-35A0-B890-311D7A67A7D2} = {88A23124-5640-35A0-B890-311D7A67A7D2}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZydisInfo", "tools\ZydisInfo.vcxproj", "{BC04B6A7-D80C-3FED-97AC-BCC8370D6A7E}"
ProjectSection(ProjectDependencies) = postProject
{88A23124-5640-35A0-B890-311D7A67A7D2} = {88A23124-5640-35A0-B890-311D7A67A7D2}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Zydis", "zydis\Zydis.vcxproj", "{88A23124-5640-35A0-B890-311D7A67A7D2}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZydisWinKernel", "examples\ZydisWinKernel.vcxproj", "{45BD58A5-1711-417F-99E7-B640C56F8009}"
ProjectSection(ProjectDependencies) = postProject
{88A23124-5640-35A0-B890-311D7A67A7D2} = {88A23124-5640-35A0-B890-311D7A67A7D2}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug DLL|Win32 = Debug DLL|Win32
Debug DLL|x64 = Debug DLL|x64
Debug Kernel|Win32 = Debug Kernel|Win32
Debug Kernel|x64 = Debug Kernel|x64
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release DLL|Win32 = Release DLL|Win32
Release DLL|x64 = Release DLL|x64
Release Kernel|Win32 = Release Kernel|Win32
Release Kernel|x64 = Release Kernel|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8085CF70-11D1-3E7B-B648-C910396BB4A7}.Debug DLL|Win32.ActiveCfg = Debug DLL|Win32
{8085CF70-11D1-3E7B-B648-C910396BB4A7}.Debug DLL|Win32.Build.0 = Debug DLL|Win32
{8085CF70-11D1-3E7B-B648-C910396BB4A7}.Debug DLL|x64.ActiveCfg = Debug DLL|x64
{8085CF70-11D1-3E7B-B648-C910396BB4A7}.Debug DLL|x64.Build.0 = Debug DLL|x64
{8085CF70-11D1-3E7B-B648-C910396BB4A7}.Debug Kernel|Win32.ActiveCfg = Debug|Win32
{8085CF70-11D1-3E7B-B648-C910396BB4A7}.Debug Kernel|x64.ActiveCfg = Debug|x64
{8085CF70-11D1-3E7B-B648-C910396BB4A7}.Debug|Win32.ActiveCfg = Debug|Win32
{8085CF70-11D1-3E7B-B648-C910396BB4A7}.Debug|Win32.Build.0 = Debug|Win32
{8085CF70-11D1-3E7B-B648-C910396BB4A7}.Debug|x64.ActiveCfg = Debug|x64
{8085CF70-11D1-3E7B-B648-C910396BB4A7}.Debug|x64.Build.0 = Debug|x64
{8085CF70-11D1-3E7B-B648-C910396BB4A7}.Release DLL|Win32.ActiveCfg = Release DLL|Win32
{8085CF70-11D1-3E7B-B648-C910396BB4A7}.Release DLL|Win32.Build.0 = Release DLL|Win32
{8085CF70-11D1-3E7B-B648-C910396BB4A7}.Release DLL|x64.ActiveCfg = Release DLL|x64
{8085CF70-11D1-3E7B-B648-C910396BB4A7}.Release DLL|x64.Build.0 = Release DLL|x64
{8085CF70-11D1-3E7B-B648-C910396BB4A7}.Release Kernel|Win32.ActiveCfg = Release|Win32
{8085CF70-11D1-3E7B-B648-C910396BB4A7}.Release Kernel|x64.ActiveCfg = Release|x64
{8085CF70-11D1-3E7B-B648-C910396BB4A7}.Release|Win32.ActiveCfg = Release|Win32
{8085CF70-11D1-3E7B-B648-C910396BB4A7}.Release|Win32.Build.0 = Release|Win32
{8085CF70-11D1-3E7B-B648-C910396BB4A7}.Release|x64.ActiveCfg = Release|x64
{8085CF70-11D1-3E7B-B648-C910396BB4A7}.Release|x64.Build.0 = Release|x64
{A0C9A331-13CC-3762-9D26-9F82C6518CAA}.Debug DLL|Win32.ActiveCfg = Debug DLL|Win32
{A0C9A331-13CC-3762-9D26-9F82C6518CAA}.Debug DLL|Win32.Build.0 = Debug DLL|Win32
{A0C9A331-13CC-3762-9D26-9F82C6518CAA}.Debug DLL|x64.ActiveCfg = Debug DLL|x64
{A0C9A331-13CC-3762-9D26-9F82C6518CAA}.Debug DLL|x64.Build.0 = Debug DLL|x64
{A0C9A331-13CC-3762-9D26-9F82C6518CAA}.Debug Kernel|Win32.ActiveCfg = Debug|Win32
{A0C9A331-13CC-3762-9D26-9F82C6518CAA}.Debug Kernel|x64.ActiveCfg = Debug|x64
{A0C9A331-13CC-3762-9D26-9F82C6518CAA}.Debug|Win32.ActiveCfg = Debug|Win32
{A0C9A331-13CC-3762-9D26-9F82C6518CAA}.Debug|Win32.Build.0 = Debug|Win32
{A0C9A331-13CC-3762-9D26-9F82C6518CAA}.Debug|x64.ActiveCfg = Debug|x64
{A0C9A331-13CC-3762-9D26-9F82C6518CAA}.Debug|x64.Build.0 = Debug|x64
{A0C9A331-13CC-3762-9D26-9F82C6518CAA}.Release DLL|Win32.ActiveCfg = Release DLL|Win32
{A0C9A331-13CC-3762-9D26-9F82C6518CAA}.Release DLL|Win32.Build.0 = Release DLL|Win32
{A0C9A331-13CC-3762-9D26-9F82C6518CAA}.Release DLL|x64.ActiveCfg = Release DLL|x64
{A0C9A331-13CC-3762-9D26-9F82C6518CAA}.Release DLL|x64.Build.0 = Release DLL|x64
{A0C9A331-13CC-3762-9D26-9F82C6518CAA}.Release Kernel|Win32.ActiveCfg = Release|Win32
{A0C9A331-13CC-3762-9D26-9F82C6518CAA}.Release Kernel|x64.ActiveCfg = Release|x64
{A0C9A331-13CC-3762-9D26-9F82C6518CAA}.Release|Win32.ActiveCfg = Release|Win32
{A0C9A331-13CC-3762-9D26-9F82C6518CAA}.Release|Win32.Build.0 = Release|Win32
{A0C9A331-13CC-3762-9D26-9F82C6518CAA}.Release|x64.ActiveCfg = Release|x64
{A0C9A331-13CC-3762-9D26-9F82C6518CAA}.Release|x64.Build.0 = Release|x64
{91EF3E98-CD57-3870-A399-A0D98D193F80}.Debug DLL|Win32.ActiveCfg = Debug DLL|Win32
{91EF3E98-CD57-3870-A399-A0D98D193F80}.Debug DLL|Win32.Build.0 = Debug DLL|Win32
{91EF3E98-CD57-3870-A399-A0D98D193F80}.Debug DLL|x64.ActiveCfg = Debug DLL|x64
{91EF3E98-CD57-3870-A399-A0D98D193F80}.Debug DLL|x64.Build.0 = Debug DLL|x64
{91EF3E98-CD57-3870-A399-A0D98D193F80}.Debug Kernel|Win32.ActiveCfg = Debug|Win32
{91EF3E98-CD57-3870-A399-A0D98D193F80}.Debug Kernel|x64.ActiveCfg = Debug|x64
{91EF3E98-CD57-3870-A399-A0D98D193F80}.Debug|Win32.ActiveCfg = Debug|Win32
{91EF3E98-CD57-3870-A399-A0D98D193F80}.Debug|Win32.Build.0 = Debug|Win32
{91EF3E98-CD57-3870-A399-A0D98D193F80}.Debug|x64.ActiveCfg = Debug|x64
{91EF3E98-CD57-3870-A399-A0D98D193F80}.Debug|x64.Build.0 = Debug|x64
{91EF3E98-CD57-3870-A399-A0D98D193F80}.Release DLL|Win32.ActiveCfg = Release DLL|Win32
{91EF3E98-CD57-3870-A399-A0D98D193F80}.Release DLL|Win32.Build.0 = Release DLL|Win32
{91EF3E98-CD57-3870-A399-A0D98D193F80}.Release DLL|x64.ActiveCfg = Release DLL|x64
{91EF3E98-CD57-3870-A399-A0D98D193F80}.Release DLL|x64.Build.0 = Release DLL|x64
{91EF3E98-CD57-3870-A399-A0D98D193F80}.Release Kernel|Win32.ActiveCfg = Release|Win32
{91EF3E98-CD57-3870-A399-A0D98D193F80}.Release Kernel|x64.ActiveCfg = Release|x64
{91EF3E98-CD57-3870-A399-A0D98D193F80}.Release|Win32.ActiveCfg = Release|Win32
{91EF3E98-CD57-3870-A399-A0D98D193F80}.Release|Win32.Build.0 = Release|Win32
{91EF3E98-CD57-3870-A399-A0D98D193F80}.Release|x64.ActiveCfg = Release|x64
{91EF3E98-CD57-3870-A399-A0D98D193F80}.Release|x64.Build.0 = Release|x64
{805CBF3F-3DDC-3141-AD7C-3B452FBEBCD2}.Debug DLL|Win32.ActiveCfg = Debug DLL|Win32
{805CBF3F-3DDC-3141-AD7C-3B452FBEBCD2}.Debug DLL|Win32.Build.0 = Debug DLL|Win32
{805CBF3F-3DDC-3141-AD7C-3B452FBEBCD2}.Debug DLL|x64.ActiveCfg = Debug DLL|x64
{805CBF3F-3DDC-3141-AD7C-3B452FBEBCD2}.Debug DLL|x64.Build.0 = Debug DLL|x64
{805CBF3F-3DDC-3141-AD7C-3B452FBEBCD2}.Debug Kernel|Win32.ActiveCfg = Debug|Win32
{805CBF3F-3DDC-3141-AD7C-3B452FBEBCD2}.Debug Kernel|x64.ActiveCfg = Debug|x64
{805CBF3F-3DDC-3141-AD7C-3B452FBEBCD2}.Debug|Win32.ActiveCfg = Debug|Win32
{805CBF3F-3DDC-3141-AD7C-3B452FBEBCD2}.Debug|Win32.Build.0 = Debug|Win32
{805CBF3F-3DDC-3141-AD7C-3B452FBEBCD2}.Debug|x64.ActiveCfg = Debug|x64
{805CBF3F-3DDC-3141-AD7C-3B452FBEBCD2}.Debug|x64.Build.0 = Debug|x64
{805CBF3F-3DDC-3141-AD7C-3B452FBEBCD2}.Release DLL|Win32.ActiveCfg = Release DLL|Win32
{805CBF3F-3DDC-3141-AD7C-3B452FBEBCD2}.Release DLL|Win32.Build.0 = Release DLL|Win32
{805CBF3F-3DDC-3141-AD7C-3B452FBEBCD2}.Release DLL|x64.ActiveCfg = Release DLL|x64
{805CBF3F-3DDC-3141-AD7C-3B452FBEBCD2}.Release DLL|x64.Build.0 = Release DLL|x64
{805CBF3F-3DDC-3141-AD7C-3B452FBEBCD2}.Release Kernel|Win32.ActiveCfg = Release|Win32
{805CBF3F-3DDC-3141-AD7C-3B452FBEBCD2}.Release Kernel|x64.ActiveCfg = Release|x64
{805CBF3F-3DDC-3141-AD7C-3B452FBEBCD2}.Release|Win32.ActiveCfg = Release|Win32
{805CBF3F-3DDC-3141-AD7C-3B452FBEBCD2}.Release|Win32.Build.0 = Release|Win32
{805CBF3F-3DDC-3141-AD7C-3B452FBEBCD2}.Release|x64.ActiveCfg = Release|x64
{805CBF3F-3DDC-3141-AD7C-3B452FBEBCD2}.Release|x64.Build.0 = Release|x64
{BC04B6A7-D80C-3FED-97AC-BCC8370D6A7E}.Debug DLL|Win32.ActiveCfg = Debug DLL|Win32
{BC04B6A7-D80C-3FED-97AC-BCC8370D6A7E}.Debug DLL|Win32.Build.0 = Debug DLL|Win32
{BC04B6A7-D80C-3FED-97AC-BCC8370D6A7E}.Debug DLL|x64.ActiveCfg = Debug DLL|x64
{BC04B6A7-D80C-3FED-97AC-BCC8370D6A7E}.Debug DLL|x64.Build.0 = Debug DLL|x64
{BC04B6A7-D80C-3FED-97AC-BCC8370D6A7E}.Debug Kernel|Win32.ActiveCfg = Debug|Win32
{BC04B6A7-D80C-3FED-97AC-BCC8370D6A7E}.Debug Kernel|x64.ActiveCfg = Debug|x64
{BC04B6A7-D80C-3FED-97AC-BCC8370D6A7E}.Debug|Win32.ActiveCfg = Debug|Win32
{BC04B6A7-D80C-3FED-97AC-BCC8370D6A7E}.Debug|Win32.Build.0 = Debug|Win32
{BC04B6A7-D80C-3FED-97AC-BCC8370D6A7E}.Debug|x64.ActiveCfg = Debug|x64
{BC04B6A7-D80C-3FED-97AC-BCC8370D6A7E}.Debug|x64.Build.0 = Debug|x64
{BC04B6A7-D80C-3FED-97AC-BCC8370D6A7E}.Release DLL|Win32.ActiveCfg = Release DLL|Win32
{BC04B6A7-D80C-3FED-97AC-BCC8370D6A7E}.Release DLL|Win32.Build.0 = Release DLL|Win32
{BC04B6A7-D80C-3FED-97AC-BCC8370D6A7E}.Release DLL|x64.ActiveCfg = Release DLL|x64
{BC04B6A7-D80C-3FED-97AC-BCC8370D6A7E}.Release DLL|x64.Build.0 = Release DLL|x64
{BC04B6A7-D80C-3FED-97AC-BCC8370D6A7E}.Release Kernel|Win32.ActiveCfg = Release|Win32
{BC04B6A7-D80C-3FED-97AC-BCC8370D6A7E}.Release Kernel|x64.ActiveCfg = Release|x64
{BC04B6A7-D80C-3FED-97AC-BCC8370D6A7E}.Release|Win32.ActiveCfg = Release|Win32
{BC04B6A7-D80C-3FED-97AC-BCC8370D6A7E}.Release|Win32.Build.0 = Release|Win32
{BC04B6A7-D80C-3FED-97AC-BCC8370D6A7E}.Release|x64.ActiveCfg = Release|x64
{BC04B6A7-D80C-3FED-97AC-BCC8370D6A7E}.Release|x64.Build.0 = Release|x64
{88A23124-5640-35A0-B890-311D7A67A7D2}.Debug DLL|Win32.ActiveCfg = Debug DLL|Win32
{88A23124-5640-35A0-B890-311D7A67A7D2}.Debug DLL|Win32.Build.0 = Debug DLL|Win32
{88A23124-5640-35A0-B890-311D7A67A7D2}.Debug DLL|x64.ActiveCfg = Debug DLL|x64
{88A23124-5640-35A0-B890-311D7A67A7D2}.Debug DLL|x64.Build.0 = Debug DLL|x64
{88A23124-5640-35A0-B890-311D7A67A7D2}.Debug Kernel|Win32.ActiveCfg = Debug Kernel|Win32
{88A23124-5640-35A0-B890-311D7A67A7D2}.Debug Kernel|Win32.Build.0 = Debug Kernel|Win32
{88A23124-5640-35A0-B890-311D7A67A7D2}.Debug Kernel|x64.ActiveCfg = Debug Kernel|x64
{88A23124-5640-35A0-B890-311D7A67A7D2}.Debug Kernel|x64.Build.0 = Debug Kernel|x64
{88A23124-5640-35A0-B890-311D7A67A7D2}.Debug|Win32.ActiveCfg = Debug|Win32
{88A23124-5640-35A0-B890-311D7A67A7D2}.Debug|Win32.Build.0 = Debug|Win32
{88A23124-5640-35A0-B890-311D7A67A7D2}.Debug|x64.ActiveCfg = Debug|x64
{88A23124-5640-35A0-B890-311D7A67A7D2}.Debug|x64.Build.0 = Debug|x64
{88A23124-5640-35A0-B890-311D7A67A7D2}.Release DLL|Win32.ActiveCfg = Release DLL|Win32
{88A23124-5640-35A0-B890-311D7A67A7D2}.Release DLL|Win32.Build.0 = Release DLL|Win32
{88A23124-5640-35A0-B890-311D7A67A7D2}.Release DLL|x64.ActiveCfg = Release DLL|x64
{88A23124-5640-35A0-B890-311D7A67A7D2}.Release DLL|x64.Build.0 = Release DLL|x64
{88A23124-5640-35A0-B890-311D7A67A7D2}.Release Kernel|Win32.ActiveCfg = Release Kernel|Win32
{88A23124-5640-35A0-B890-311D7A67A7D2}.Release Kernel|Win32.Build.0 = Release Kernel|Win32
{88A23124-5640-35A0-B890-311D7A67A7D2}.Release Kernel|x64.ActiveCfg = Release Kernel|x64
{88A23124-5640-35A0-B890-311D7A67A7D2}.Release Kernel|x64.Build.0 = Release Kernel|x64
{88A23124-5640-35A0-B890-311D7A67A7D2}.Release|Win32.ActiveCfg = Release|Win32
{88A23124-5640-35A0-B890-311D7A67A7D2}.Release|Win32.Build.0 = Release|Win32
{88A23124-5640-35A0-B890-311D7A67A7D2}.Release|x64.ActiveCfg = Release|x64
{88A23124-5640-35A0-B890-311D7A67A7D2}.Release|x64.Build.0 = Release|x64
{45BD58A5-1711-417F-99E7-B640C56F8009}.Debug DLL|Win32.ActiveCfg = Debug|Win32
{45BD58A5-1711-417F-99E7-B640C56F8009}.Debug DLL|x64.ActiveCfg = Debug|x64
{45BD58A5-1711-417F-99E7-B640C56F8009}.Debug Kernel|Win32.ActiveCfg = Debug|Win32
{45BD58A5-1711-417F-99E7-B640C56F8009}.Debug Kernel|Win32.Build.0 = Debug|Win32
{45BD58A5-1711-417F-99E7-B640C56F8009}.Debug Kernel|x64.ActiveCfg = Debug|x64
{45BD58A5-1711-417F-99E7-B640C56F8009}.Debug Kernel|x64.Build.0 = Debug|x64
{45BD58A5-1711-417F-99E7-B640C56F8009}.Debug|Win32.ActiveCfg = Debug|Win32
{45BD58A5-1711-417F-99E7-B640C56F8009}.Debug|x64.ActiveCfg = Debug|x64
{45BD58A5-1711-417F-99E7-B640C56F8009}.Release DLL|Win32.ActiveCfg = Release|Win32
{45BD58A5-1711-417F-99E7-B640C56F8009}.Release DLL|x64.ActiveCfg = Release|x64
{45BD58A5-1711-417F-99E7-B640C56F8009}.Release Kernel|Win32.ActiveCfg = Release|Win32
{45BD58A5-1711-417F-99E7-B640C56F8009}.Release Kernel|Win32.Build.0 = Release|Win32
{45BD58A5-1711-417F-99E7-B640C56F8009}.Release Kernel|x64.ActiveCfg = Release|x64
{45BD58A5-1711-417F-99E7-B640C56F8009}.Release Kernel|x64.Build.0 = Release|x64
{45BD58A5-1711-417F-99E7-B640C56F8009}.Release|Win32.ActiveCfg = Release|Win32
{45BD58A5-1711-417F-99E7-B640C56F8009}.Release|x64.ActiveCfg = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{8085CF70-11D1-3E7B-B648-C910396BB4A7} = {4F5048C7-CB90-437E-AB21-32258F9650B6}
{A0C9A331-13CC-3762-9D26-9F82C6518CAA} = {4F5048C7-CB90-437E-AB21-32258F9650B6}
{91EF3E98-CD57-3870-A399-A0D98D193F80} = {4F5048C7-CB90-437E-AB21-32258F9650B6}
{805CBF3F-3DDC-3141-AD7C-3B452FBEBCD2} = {292A9E1E-C557-4570-ABE1-8EEC0E1B79C4}
{BC04B6A7-D80C-3FED-97AC-BCC8370D6A7E} = {292A9E1E-C557-4570-ABE1-8EEC0E1B79C4}
{45BD58A5-1711-417F-99E7-B640C56F8009} = {4F5048C7-CB90-437E-AB21-32258F9650B6}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F578E55A-EB10-4D4A-9F4E-C74DCB58DE73}
EndGlobalSection
EndGlobal

42
msvc/ZydisExportConfig.h Normal file
View File

@ -0,0 +1,42 @@
#ifndef ZYDIS_EXPORT_H
#define ZYDIS_EXPORT_H
#ifdef ZYDIS_STATIC_DEFINE
# define ZYDIS_EXPORT
# define ZYDIS_NO_EXPORT
#else
# ifndef ZYDIS_EXPORT
# ifdef Zydis_EXPORTS
/* We are building this library */
# define ZYDIS_EXPORT __declspec(dllexport)
# else
/* We are using this library */
# define ZYDIS_EXPORT __declspec(dllimport)
# endif
# endif
# ifndef ZYDIS_NO_EXPORT
# define ZYDIS_NO_EXPORT
# endif
#endif
#ifndef ZYDIS_DEPRECATED
# define ZYDIS_DEPRECATED __declspec(deprecated)
#endif
#ifndef ZYDIS_DEPRECATED_EXPORT
# define ZYDIS_DEPRECATED_EXPORT ZYDIS_EXPORT ZYDIS_DEPRECATED
#endif
#ifndef ZYDIS_DEPRECATED_NO_EXPORT
# define ZYDIS_DEPRECATED_NO_EXPORT ZYDIS_NO_EXPORT ZYDIS_DEPRECATED
#endif
#if 0 /* DEFINE_NO_DEPRECATED */
# ifndef ZYDIS_NO_DEPRECATED
# define ZYDIS_NO_DEPRECATED
# endif
#endif
#endif

View File

@ -0,0 +1,422 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug DLL|Win32">
<Configuration>Debug DLL</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug DLL|x64">
<Configuration>Debug DLL</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release DLL|Win32">
<Configuration>Release DLL</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release DLL|x64">
<Configuration>Release DLL</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{8085CF70-11D1-3E7B-B648-C910396BB4A7}</ProjectGuid>
<WindowsTargetPlatformVersion>$(LatestTargetPlatformVersion)</WindowsTargetPlatformVersion>
<Keyword>Win32Proj</Keyword>
<ProjectName>FormatterHooks</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)bin\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'">$(SolutionDir)bin\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'">obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'">false</LinkIncremental>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'">false</GenerateManifest>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)bin\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">$(SolutionDir)bin\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'">false</LinkIncremental>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'">false</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)bin\</OutDir>
<IntDir>obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'">
<OutDir>$(SolutionDir)bin\</OutDir>
<IntDir>obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)bin\</OutDir>
<IntDir>obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'">
<OutDir>$(SolutionDir)bin\</OutDir>
<IntDir>obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'">
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/Gw</AdditionalOptions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ExceptionHandling>false</ExceptionHandling>
<InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<Optimization>Disabled</Optimization>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>ZYDIS_STATIC_DEFINE;WIN32;_WINDOWS;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/NOCOFFGRPINFO</AdditionalOptions>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<SetChecksum>true</SetChecksum>
<SubSystem>Console</SubSystem>
<Version>5.2</Version>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<MinimumRequiredVersion>5.02</MinimumRequiredVersion>
<AdditionalDependencies>Zydis.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/Gw</AdditionalOptions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ExceptionHandling>false</ExceptionHandling>
<InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<Optimization>Disabled</Optimization>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>Zydis_EXPORTS;WIN32;_WINDOWS;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/NOCOFFGRPINFO</AdditionalOptions>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<SetChecksum>true</SetChecksum>
<SubSystem>Console</SubSystem>
<Version>5.2</Version>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<MinimumRequiredVersion>5.02</MinimumRequiredVersion>
<AdditionalDependencies>Zydis.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/Gw</AdditionalOptions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ExceptionHandling>false</ExceptionHandling>
<InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<Optimization>Disabled</Optimization>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>ZYDIS_STATIC_DEFINE;WIN32;_WINDOWS;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/NOCOFFGRPINFO</AdditionalOptions>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<SetChecksum>true</SetChecksum>
<SubSystem>Console</SubSystem>
<Version>5.1</Version>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<MinimumRequiredVersion>5.01</MinimumRequiredVersion>
<AdditionalDependencies>Zydis.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/Gw</AdditionalOptions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ExceptionHandling>false</ExceptionHandling>
<InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<Optimization>Disabled</Optimization>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>Zydis_EXPORTS;WIN32;_WINDOWS;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/NOCOFFGRPINFO</AdditionalOptions>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<SetChecksum>true</SetChecksum>
<SubSystem>Console</SubSystem>
<Version>5.1</Version>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<MinimumRequiredVersion>5.01</MinimumRequiredVersion>
<AdditionalDependencies>Zydis.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/Gw</AdditionalOptions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ExceptionHandling>false</ExceptionHandling>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<StringPooling>true</StringPooling>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>ZYDIS_STATIC_DEFINE;WIN32;_WINDOWS;NDEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<OmitFramePointers>true</OmitFramePointers>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/NOCOFFGRPINFO</AdditionalOptions>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<SetChecksum>true</SetChecksum>
<SubSystem>Console</SubSystem>
<Version>5.2</Version>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<MinimumRequiredVersion>5.02</MinimumRequiredVersion>
<AdditionalDependencies>Zydis.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/Gw</AdditionalOptions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ExceptionHandling>false</ExceptionHandling>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<StringPooling>true</StringPooling>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>Zydis_EXPORTS;WIN32;_WINDOWS;NDEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<OmitFramePointers>true</OmitFramePointers>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/NOCOFFGRPINFO</AdditionalOptions>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<SetChecksum>true</SetChecksum>
<SubSystem>Console</SubSystem>
<Version>5.2</Version>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<MinimumRequiredVersion>5.02</MinimumRequiredVersion>
<AdditionalDependencies>Zydis.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/Gw</AdditionalOptions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ExceptionHandling>false</ExceptionHandling>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<StringPooling>true</StringPooling>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>ZYDIS_STATIC_DEFINE;WIN32;_WINDOWS;NDEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<OmitFramePointers>true</OmitFramePointers>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/NOCOFFGRPINFO</AdditionalOptions>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<SetChecksum>true</SetChecksum>
<SubSystem>Console</SubSystem>
<Version>5.1</Version>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<MinimumRequiredVersion>5.01</MinimumRequiredVersion>
<AdditionalDependencies>Zydis.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/Gw</AdditionalOptions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ExceptionHandling>false</ExceptionHandling>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<StringPooling>true</StringPooling>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>Zydis_EXPORTS;WIN32;_WINDOWS;NDEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<OmitFramePointers>true</OmitFramePointers>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/NOCOFFGRPINFO</AdditionalOptions>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<SetChecksum>true</SetChecksum>
<SubSystem>Console</SubSystem>
<Version>5.1</Version>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<MinimumRequiredVersion>5.01</MinimumRequiredVersion>
<AdditionalDependencies>Zydis.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\examples\FormatterHooks.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\include\Zydis\CommonTypes.h" />
<ClInclude Include="..\..\include\Zydis\Defines.h" />
<ClInclude Include="..\..\include\Zydis\MetaInfo.h" />
<ClInclude Include="..\..\include\Zydis\Mnemonic.h" />
<ClInclude Include="..\..\include\Zydis\Register.h" />
<ClInclude Include="..\..\include\Zydis\SharedTypes.h" />
<ClInclude Include="..\..\include\Zydis\Status.h" />
<ClInclude Include="..\..\include\Zydis\String.h" />
<ClInclude Include="..\..\include\Zydis\Utils.h" />
<ClInclude Include="..\..\include\Zydis\Zydis.h" />
<ClInclude Include="..\..\include\Zydis\Decoder.h" />
<ClInclude Include="..\..\include\Zydis\DecoderTypes.h" />
<ClInclude Include="..\..\include\Zydis\Formatter.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{664BBE0B-918F-3B41-8D06-1875B10A7BE5}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{54CFF9CE-5525-3FCE-8ECE-9A26FB686F56}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\examples\FormatterHooks.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\include\Zydis\CommonTypes.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Defines.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\MetaInfo.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Mnemonic.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Register.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\SharedTypes.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Status.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\String.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Utils.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Zydis.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Decoder.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\DecoderTypes.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Formatter.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@ -0,0 +1,422 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug DLL|Win32">
<Configuration>Debug DLL</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug DLL|x64">
<Configuration>Debug DLL</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release DLL|Win32">
<Configuration>Release DLL</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release DLL|x64">
<Configuration>Release DLL</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{A0C9A331-13CC-3762-9D26-9F82C6518CAA}</ProjectGuid>
<WindowsTargetPlatformVersion>$(LatestTargetPlatformVersion)</WindowsTargetPlatformVersion>
<Keyword>Win32Proj</Keyword>
<ProjectName>ZydisFuzzIn</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)bin\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'">$(SolutionDir)bin\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'">obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'">false</LinkIncremental>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'">false</GenerateManifest>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)bin\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">$(SolutionDir)bin\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'">false</LinkIncremental>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'">false</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)bin\</OutDir>
<IntDir>obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'">
<OutDir>$(SolutionDir)bin\</OutDir>
<IntDir>obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)bin\</OutDir>
<IntDir>obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'">
<OutDir>$(SolutionDir)bin\</OutDir>
<IntDir>obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'">
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/Gw</AdditionalOptions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ExceptionHandling>false</ExceptionHandling>
<InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<Optimization>Disabled</Optimization>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>ZYDIS_STATIC_DEFINE;WIN32;_WINDOWS;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/NOCOFFGRPINFO</AdditionalOptions>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<SetChecksum>true</SetChecksum>
<SubSystem>Console</SubSystem>
<Version>5.2</Version>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<MinimumRequiredVersion>5.02</MinimumRequiredVersion>
<AdditionalDependencies>Zydis.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/Gw</AdditionalOptions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ExceptionHandling>false</ExceptionHandling>
<InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<Optimization>Disabled</Optimization>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>Zydis_EXPORTS;WIN32;_WINDOWS;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/NOCOFFGRPINFO</AdditionalOptions>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<SetChecksum>true</SetChecksum>
<SubSystem>Console</SubSystem>
<Version>5.2</Version>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<MinimumRequiredVersion>5.02</MinimumRequiredVersion>
<AdditionalDependencies>Zydis.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/Gw</AdditionalOptions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ExceptionHandling>false</ExceptionHandling>
<InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<Optimization>Disabled</Optimization>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>ZYDIS_STATIC_DEFINE;WIN32;_WINDOWS;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/NOCOFFGRPINFO</AdditionalOptions>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<SetChecksum>true</SetChecksum>
<SubSystem>Console</SubSystem>
<Version>5.1</Version>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<MinimumRequiredVersion>5.01</MinimumRequiredVersion>
<AdditionalDependencies>Zydis.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/Gw</AdditionalOptions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ExceptionHandling>false</ExceptionHandling>
<InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<Optimization>Disabled</Optimization>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>Zydis_EXPORTS;WIN32;_WINDOWS;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/NOCOFFGRPINFO</AdditionalOptions>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<SetChecksum>true</SetChecksum>
<SubSystem>Console</SubSystem>
<Version>5.1</Version>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<MinimumRequiredVersion>5.01</MinimumRequiredVersion>
<AdditionalDependencies>Zydis.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/Gw</AdditionalOptions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ExceptionHandling>false</ExceptionHandling>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<StringPooling>true</StringPooling>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>ZYDIS_STATIC_DEFINE;WIN32;_WINDOWS;NDEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<OmitFramePointers>true</OmitFramePointers>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/NOCOFFGRPINFO</AdditionalOptions>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<SetChecksum>true</SetChecksum>
<SubSystem>Console</SubSystem>
<Version>5.2</Version>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<MinimumRequiredVersion>5.02</MinimumRequiredVersion>
<AdditionalDependencies>Zydis.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/Gw</AdditionalOptions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ExceptionHandling>false</ExceptionHandling>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<StringPooling>true</StringPooling>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>Zydis_EXPORTS;WIN32;_WINDOWS;NDEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<OmitFramePointers>true</OmitFramePointers>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/NOCOFFGRPINFO</AdditionalOptions>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<SetChecksum>true</SetChecksum>
<SubSystem>Console</SubSystem>
<Version>5.2</Version>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<MinimumRequiredVersion>5.02</MinimumRequiredVersion>
<AdditionalDependencies>Zydis.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/Gw</AdditionalOptions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ExceptionHandling>false</ExceptionHandling>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<StringPooling>true</StringPooling>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>ZYDIS_STATIC_DEFINE;WIN32;_WINDOWS;NDEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<OmitFramePointers>true</OmitFramePointers>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/NOCOFFGRPINFO</AdditionalOptions>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<SetChecksum>true</SetChecksum>
<SubSystem>Console</SubSystem>
<Version>5.1</Version>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<MinimumRequiredVersion>5.01</MinimumRequiredVersion>
<AdditionalDependencies>Zydis.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/Gw</AdditionalOptions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ExceptionHandling>false</ExceptionHandling>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<StringPooling>true</StringPooling>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>Zydis_EXPORTS;WIN32;_WINDOWS;NDEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<OmitFramePointers>true</OmitFramePointers>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/NOCOFFGRPINFO</AdditionalOptions>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<SetChecksum>true</SetChecksum>
<SubSystem>Console</SubSystem>
<Version>5.1</Version>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<MinimumRequiredVersion>5.01</MinimumRequiredVersion>
<AdditionalDependencies>Zydis.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\examples\ZydisFuzzIn.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\include\Zydis\CommonTypes.h" />
<ClInclude Include="..\..\include\Zydis\Defines.h" />
<ClInclude Include="..\..\include\Zydis\MetaInfo.h" />
<ClInclude Include="..\..\include\Zydis\Mnemonic.h" />
<ClInclude Include="..\..\include\Zydis\Register.h" />
<ClInclude Include="..\..\include\Zydis\SharedTypes.h" />
<ClInclude Include="..\..\include\Zydis\Status.h" />
<ClInclude Include="..\..\include\Zydis\String.h" />
<ClInclude Include="..\..\include\Zydis\Utils.h" />
<ClInclude Include="..\..\include\Zydis\Zydis.h" />
<ClInclude Include="..\..\include\Zydis\Decoder.h" />
<ClInclude Include="..\..\include\Zydis\DecoderTypes.h" />
<ClInclude Include="..\..\include\Zydis\Formatter.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{664BBE0B-918F-3B41-8D06-1875B10A7BE5}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{54CFF9CE-5525-3FCE-8ECE-9A26FB686F56}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\examples\ZydisFuzzIn.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\include\Zydis\CommonTypes.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Defines.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\MetaInfo.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Mnemonic.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Register.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\SharedTypes.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Status.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\String.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Utils.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Zydis.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Decoder.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\DecoderTypes.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Formatter.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@ -0,0 +1,422 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug DLL|Win32">
<Configuration>Debug DLL</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug DLL|x64">
<Configuration>Debug DLL</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release DLL|Win32">
<Configuration>Release DLL</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release DLL|x64">
<Configuration>Release DLL</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{91EF3E98-CD57-3870-A399-A0D98D193F80}</ProjectGuid>
<WindowsTargetPlatformVersion>$(LatestTargetPlatformVersion)</WindowsTargetPlatformVersion>
<Keyword>Win32Proj</Keyword>
<ProjectName>ZydisPerfTest</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)bin\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'">$(SolutionDir)bin\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'">obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'">false</LinkIncremental>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'">false</GenerateManifest>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)bin\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">$(SolutionDir)bin\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'">false</LinkIncremental>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'">false</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)bin\</OutDir>
<IntDir>obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'">
<OutDir>$(SolutionDir)bin\</OutDir>
<IntDir>obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)bin\</OutDir>
<IntDir>obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'">
<OutDir>$(SolutionDir)bin\</OutDir>
<IntDir>obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'">
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/Gw</AdditionalOptions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ExceptionHandling>false</ExceptionHandling>
<InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<Optimization>Disabled</Optimization>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>ZYDIS_STATIC_DEFINE;WIN32;_WINDOWS;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/NOCOFFGRPINFO</AdditionalOptions>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<SetChecksum>true</SetChecksum>
<SubSystem>Console</SubSystem>
<Version>5.2</Version>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<MinimumRequiredVersion>5.02</MinimumRequiredVersion>
<AdditionalDependencies>Zydis.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/Gw</AdditionalOptions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ExceptionHandling>false</ExceptionHandling>
<InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<Optimization>Disabled</Optimization>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>Zydis_EXPORTS;WIN32;_WINDOWS;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/NOCOFFGRPINFO</AdditionalOptions>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<SetChecksum>true</SetChecksum>
<SubSystem>Console</SubSystem>
<Version>5.2</Version>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<MinimumRequiredVersion>5.02</MinimumRequiredVersion>
<AdditionalDependencies>Zydis.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/Gw</AdditionalOptions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ExceptionHandling>false</ExceptionHandling>
<InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<Optimization>Disabled</Optimization>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>ZYDIS_STATIC_DEFINE;WIN32;_WINDOWS;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/NOCOFFGRPINFO</AdditionalOptions>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<SetChecksum>true</SetChecksum>
<SubSystem>Console</SubSystem>
<Version>5.1</Version>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<MinimumRequiredVersion>5.01</MinimumRequiredVersion>
<AdditionalDependencies>Zydis.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/Gw</AdditionalOptions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ExceptionHandling>false</ExceptionHandling>
<InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<Optimization>Disabled</Optimization>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>Zydis_EXPORTS;WIN32;_WINDOWS;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/NOCOFFGRPINFO</AdditionalOptions>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<SetChecksum>true</SetChecksum>
<SubSystem>Console</SubSystem>
<Version>5.1</Version>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<MinimumRequiredVersion>5.01</MinimumRequiredVersion>
<AdditionalDependencies>Zydis.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/Gw</AdditionalOptions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ExceptionHandling>false</ExceptionHandling>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<StringPooling>true</StringPooling>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>ZYDIS_STATIC_DEFINE;WIN32;_WINDOWS;NDEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<OmitFramePointers>true</OmitFramePointers>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/NOCOFFGRPINFO</AdditionalOptions>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<SetChecksum>true</SetChecksum>
<SubSystem>Console</SubSystem>
<Version>5.2</Version>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<MinimumRequiredVersion>5.02</MinimumRequiredVersion>
<AdditionalDependencies>Zydis.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/Gw</AdditionalOptions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ExceptionHandling>false</ExceptionHandling>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<StringPooling>true</StringPooling>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>Zydis_EXPORTS;WIN32;_WINDOWS;NDEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<OmitFramePointers>true</OmitFramePointers>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/NOCOFFGRPINFO</AdditionalOptions>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<SetChecksum>true</SetChecksum>
<SubSystem>Console</SubSystem>
<Version>5.2</Version>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<MinimumRequiredVersion>5.02</MinimumRequiredVersion>
<AdditionalDependencies>Zydis.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/Gw</AdditionalOptions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ExceptionHandling>false</ExceptionHandling>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<StringPooling>true</StringPooling>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>ZYDIS_STATIC_DEFINE;WIN32;_WINDOWS;NDEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<OmitFramePointers>true</OmitFramePointers>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/NOCOFFGRPINFO</AdditionalOptions>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<SetChecksum>true</SetChecksum>
<SubSystem>Console</SubSystem>
<Version>5.1</Version>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<MinimumRequiredVersion>5.01</MinimumRequiredVersion>
<AdditionalDependencies>Zydis.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/Gw</AdditionalOptions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ExceptionHandling>false</ExceptionHandling>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<StringPooling>true</StringPooling>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>Zydis_EXPORTS;WIN32;_WINDOWS;NDEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<OmitFramePointers>true</OmitFramePointers>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/NOCOFFGRPINFO</AdditionalOptions>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<SetChecksum>true</SetChecksum>
<SubSystem>Console</SubSystem>
<Version>5.1</Version>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<MinimumRequiredVersion>5.01</MinimumRequiredVersion>
<AdditionalDependencies>Zydis.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\examples\ZydisPerfTest.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\include\Zydis\CommonTypes.h" />
<ClInclude Include="..\..\include\Zydis\Defines.h" />
<ClInclude Include="..\..\include\Zydis\MetaInfo.h" />
<ClInclude Include="..\..\include\Zydis\Mnemonic.h" />
<ClInclude Include="..\..\include\Zydis\Register.h" />
<ClInclude Include="..\..\include\Zydis\SharedTypes.h" />
<ClInclude Include="..\..\include\Zydis\Status.h" />
<ClInclude Include="..\..\include\Zydis\String.h" />
<ClInclude Include="..\..\include\Zydis\Utils.h" />
<ClInclude Include="..\..\include\Zydis\Zydis.h" />
<ClInclude Include="..\..\include\Zydis\Decoder.h" />
<ClInclude Include="..\..\include\Zydis\DecoderTypes.h" />
<ClInclude Include="..\..\include\Zydis\Formatter.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{664BBE0B-918F-3B41-8D06-1875B10A7BE5}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{54CFF9CE-5525-3FCE-8ECE-9A26FB686F56}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\examples\ZydisPerfTest.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\include\Zydis\CommonTypes.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Defines.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\MetaInfo.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Mnemonic.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Register.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\SharedTypes.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Status.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\String.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Utils.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Zydis.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Decoder.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\DecoderTypes.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Formatter.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@ -0,0 +1,227 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{45BD58A5-1711-417f-99E7-B640C56F8009}</ProjectGuid>
<TemplateGuid>{1bc93793-694f-48fe-9372-81e2b05556fd}</TemplateGuid>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
<Configuration>Release</Configuration>
<Platform Condition="'$(Platform)' == ''">x64</Platform>
<RootNamespace>$(MSBuildProjectName)</RootNamespace>
<WindowsTargetPlatformVersion>$(LatestTargetPlatformVersion)</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<TargetVersion>Windows7</TargetVersion>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
<ConfigurationType>Driver</ConfigurationType>
<DriverType>WDM</DriverType>
<SupportsPackaging>false</SupportsPackaging>
<DriverTargetPlatform>Desktop</DriverTargetPlatform>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<TargetVersion>Windows7</TargetVersion>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
<ConfigurationType>Driver</ConfigurationType>
<DriverType>WDM</DriverType>
<SupportsPackaging>false</SupportsPackaging>
<WholeProgramOptimization>true</WholeProgramOptimization>
<DriverTargetPlatform>Desktop</DriverTargetPlatform>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<TargetVersion>Windows7</TargetVersion>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
<ConfigurationType>Driver</ConfigurationType>
<DriverType>WDM</DriverType>
<SupportsPackaging>false</SupportsPackaging>
<DriverTargetPlatform>Desktop</DriverTargetPlatform>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<TargetVersion>Windows7</TargetVersion>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
<ConfigurationType>Driver</ConfigurationType>
<DriverType>WDM</DriverType>
<SupportsPackaging>false</SupportsPackaging>
<WholeProgramOptimization>true</WholeProgramOptimization>
<DriverTargetPlatform>Desktop</DriverTargetPlatform>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Label="PropertySheets">
<DisableProductionSignDebugWarnings>true</DisableProductionSignDebugWarnings>
</PropertyGroup>
<PropertyGroup />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
<TimeStampServer />
<OutDir>$(SolutionDir)bin\</OutDir>
<IntDir>obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<EnableInf2cat>false</EnableInf2cat>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
<TimeStampServer />
<OutDir>$(SolutionDir)bin\</OutDir>
<IntDir>obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<EnableInf2cat>false</EnableInf2cat>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
<TimeStampServer />
<OutDir>$(SolutionDir)bin\</OutDir>
<IntDir>obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<EnableInf2cat>false</EnableInf2cat>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
<TimeStampServer />
<OutDir>$(SolutionDir)bin\</OutDir>
<IntDir>obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<EnableInf2cat>false</EnableInf2cat>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PreprocessorDefinitions>ZYDIS_NO_LIBC;ZYDIS_STATIC_DEFINE;POOL_NX_OPTIN;_X86_=1;i386=1;STD_CALL;DBG;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalOptions>/Gw /kernel</AdditionalOptions>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<ControlFlowGuard>false</ControlFlowGuard>
</ClCompile>
<Link>
<AdditionalOptions>/NOCOFFGRPINFO %(AdditionalOptions)</AdditionalOptions>
<Profile>false</Profile>
<RandomizedBaseAddress>true</RandomizedBaseAddress>
<DataExecutionPrevention>true</DataExecutionPrevention>
<AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<Version>6.1</Version>
<AdditionalDependencies>Zydis.lib;%(AdditionalDependencies);$(KernelBufferOverflowLib);$(DDK_LIB_PATH)ntoskrnl.lib;$(DDK_LIB_PATH)hal.lib;$(DDK_LIB_PATH)wmilib.lib</AdditionalDependencies>
<EntryPointSymbol>DriverEntry@8</EntryPointSymbol>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>ZYDIS_NO_LIBC;ZYDIS_STATIC_DEFINE;POOL_NX_OPTIN;_X86_=1;i386=1;STD_CALL;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalOptions>/Gw /kernel</AdditionalOptions>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<OmitFramePointers>true</OmitFramePointers>
<IntrinsicFunctions>true</IntrinsicFunctions>
<ControlFlowGuard>false</ControlFlowGuard>
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
</ClCompile>
<Link>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<EntryPointSymbol>DriverEntry@8</EntryPointSymbol>
<AdditionalOptions>/NOCOFFGRPINFO %(AdditionalOptions)</AdditionalOptions>
<Profile>false</Profile>
<RandomizedBaseAddress>true</RandomizedBaseAddress>
<DataExecutionPrevention>true</DataExecutionPrevention>
<AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>Zydis.lib;%(AdditionalDependencies);$(DDK_LIB_PATH)ntoskrnl.lib;$(DDK_LIB_PATH)hal.lib;$(DDK_LIB_PATH)wmilib.lib</AdditionalDependencies>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<Version>6.1</Version>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PreprocessorDefinitions>ZYDIS_NO_LIBC;ZYDIS_STATIC_DEFINE;POOL_NX_OPTIN;_WIN64;_AMD64_;AMD64;DBG;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalOptions>/Gw /kernel</AdditionalOptions>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<ControlFlowGuard>false</ControlFlowGuard>
</ClCompile>
<Link>
<AdditionalOptions>/NOCOFFGRPINFO %(AdditionalOptions)</AdditionalOptions>
<Profile>false</Profile>
<RandomizedBaseAddress>true</RandomizedBaseAddress>
<DataExecutionPrevention>true</DataExecutionPrevention>
<AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<Version>6.1</Version>
<AdditionalDependencies>Zydis.lib;%(AdditionalDependencies);$(KernelBufferOverflowLib);$(DDK_LIB_PATH)ntoskrnl.lib;$(DDK_LIB_PATH)hal.lib;$(DDK_LIB_PATH)wmilib.lib</AdditionalDependencies>
<EntryPointSymbol>DriverEntry</EntryPointSymbol>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PreprocessorDefinitions>ZYDIS_NO_LIBC;ZYDIS_STATIC_DEFINE;POOL_NX_OPTIN;_WIN64;_AMD64_;AMD64;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalOptions>/Gw /kernel</AdditionalOptions>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<OmitFramePointers>true</OmitFramePointers>
<IntrinsicFunctions>true</IntrinsicFunctions>
<ControlFlowGuard>false</ControlFlowGuard>
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
</ClCompile>
<Link>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<EntryPointSymbol>DriverEntry</EntryPointSymbol>
<AdditionalOptions>/NOCOFFGRPINFO %(AdditionalOptions)</AdditionalOptions>
<Profile>false</Profile>
<RandomizedBaseAddress>true</RandomizedBaseAddress>
<DataExecutionPrevention>true</DataExecutionPrevention>
<AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>Zydis.lib;%(AdditionalDependencies);$(DDK_LIB_PATH)ntoskrnl.lib;$(DDK_LIB_PATH)hal.lib;$(DDK_LIB_PATH)wmilib.lib</AdditionalDependencies>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<Version>6.1</Version>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<Inf Exclude="@(Inf)" Include="*.inf" />
<FilesToPackage Include="$(TargetPath)" Condition="'$(ConfigurationType)'=='Driver' or '$(ConfigurationType)'=='DynamicLibrary'" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\examples\ZydisWinKernel.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\include\Zydis\CommonTypes.h" />
<ClInclude Include="..\..\include\Zydis\Defines.h" />
<ClInclude Include="..\..\include\Zydis\MetaInfo.h" />
<ClInclude Include="..\..\include\Zydis\Mnemonic.h" />
<ClInclude Include="..\..\include\Zydis\Register.h" />
<ClInclude Include="..\..\include\Zydis\SharedTypes.h" />
<ClInclude Include="..\..\include\Zydis\Status.h" />
<ClInclude Include="..\..\include\Zydis\String.h" />
<ClInclude Include="..\..\include\Zydis\Utils.h" />
<ClInclude Include="..\..\include\Zydis\Zydis.h" />
<ClInclude Include="..\..\include\Zydis\Decoder.h" />
<ClInclude Include="..\..\include\Zydis\DecoderTypes.h" />
<ClInclude Include="..\..\include\Zydis\Formatter.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{664BBE0B-918F-3B41-8D06-1875B10A7BE5}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{54CFF9CE-5525-3FCE-8ECE-9A26FB686F56}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\include\Zydis\CommonTypes.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Defines.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\MetaInfo.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Mnemonic.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Register.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\SharedTypes.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Status.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\String.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Utils.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Zydis.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Decoder.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\DecoderTypes.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Formatter.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\examples\ZydisWinKernel.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@ -0,0 +1,422 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug DLL|Win32">
<Configuration>Debug DLL</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug DLL|x64">
<Configuration>Debug DLL</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release DLL|Win32">
<Configuration>Release DLL</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release DLL|x64">
<Configuration>Release DLL</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{805CBF3F-3DDC-3141-AD7C-3B452FBEBCD2}</ProjectGuid>
<WindowsTargetPlatformVersion>$(LatestTargetPlatformVersion)</WindowsTargetPlatformVersion>
<Keyword>Win32Proj</Keyword>
<ProjectName>ZydisDisasm</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)bin\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'">$(SolutionDir)bin\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'">obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'">false</LinkIncremental>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'">false</GenerateManifest>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)bin\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">$(SolutionDir)bin\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'">false</LinkIncremental>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'">false</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)bin\</OutDir>
<IntDir>obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'">
<OutDir>$(SolutionDir)bin\</OutDir>
<IntDir>obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)bin\</OutDir>
<IntDir>obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'">
<OutDir>$(SolutionDir)bin\</OutDir>
<IntDir>obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'">
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/Gw</AdditionalOptions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ExceptionHandling>false</ExceptionHandling>
<InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<Optimization>Disabled</Optimization>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>ZYDIS_STATIC_DEFINE;WIN32;_WINDOWS;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/NOCOFFGRPINFO</AdditionalOptions>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<SetChecksum>true</SetChecksum>
<SubSystem>Console</SubSystem>
<Version>5.2</Version>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<MinimumRequiredVersion>5.02</MinimumRequiredVersion>
<AdditionalDependencies>Zydis.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/Gw</AdditionalOptions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ExceptionHandling>false</ExceptionHandling>
<InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<Optimization>Disabled</Optimization>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>Zydis_EXPORTS;WIN32;_WINDOWS;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/NOCOFFGRPINFO</AdditionalOptions>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<SetChecksum>true</SetChecksum>
<SubSystem>Console</SubSystem>
<Version>5.2</Version>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<MinimumRequiredVersion>5.02</MinimumRequiredVersion>
<AdditionalDependencies>Zydis.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/Gw</AdditionalOptions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ExceptionHandling>false</ExceptionHandling>
<InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<Optimization>Disabled</Optimization>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>ZYDIS_STATIC_DEFINE;WIN32;_WINDOWS;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/NOCOFFGRPINFO</AdditionalOptions>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<SetChecksum>true</SetChecksum>
<SubSystem>Console</SubSystem>
<Version>5.1</Version>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<MinimumRequiredVersion>5.01</MinimumRequiredVersion>
<AdditionalDependencies>Zydis.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/Gw</AdditionalOptions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ExceptionHandling>false</ExceptionHandling>
<InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<Optimization>Disabled</Optimization>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>Zydis_EXPORTS;WIN32;_WINDOWS;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/NOCOFFGRPINFO</AdditionalOptions>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<SetChecksum>true</SetChecksum>
<SubSystem>Console</SubSystem>
<Version>5.1</Version>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<MinimumRequiredVersion>5.01</MinimumRequiredVersion>
<AdditionalDependencies>Zydis.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/Gw</AdditionalOptions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ExceptionHandling>false</ExceptionHandling>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<StringPooling>true</StringPooling>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>ZYDIS_STATIC_DEFINE;WIN32;_WINDOWS;NDEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<OmitFramePointers>true</OmitFramePointers>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/NOCOFFGRPINFO</AdditionalOptions>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<SetChecksum>true</SetChecksum>
<SubSystem>Console</SubSystem>
<Version>5.2</Version>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<MinimumRequiredVersion>5.02</MinimumRequiredVersion>
<AdditionalDependencies>Zydis.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/Gw</AdditionalOptions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ExceptionHandling>false</ExceptionHandling>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<StringPooling>true</StringPooling>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>Zydis_EXPORTS;WIN32;_WINDOWS;NDEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<OmitFramePointers>true</OmitFramePointers>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/NOCOFFGRPINFO</AdditionalOptions>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<SetChecksum>true</SetChecksum>
<SubSystem>Console</SubSystem>
<Version>5.2</Version>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<MinimumRequiredVersion>5.02</MinimumRequiredVersion>
<AdditionalDependencies>Zydis.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/Gw</AdditionalOptions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ExceptionHandling>false</ExceptionHandling>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<StringPooling>true</StringPooling>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>ZYDIS_STATIC_DEFINE;WIN32;_WINDOWS;NDEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<OmitFramePointers>true</OmitFramePointers>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/NOCOFFGRPINFO</AdditionalOptions>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<SetChecksum>true</SetChecksum>
<SubSystem>Console</SubSystem>
<Version>5.1</Version>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<MinimumRequiredVersion>5.01</MinimumRequiredVersion>
<AdditionalDependencies>Zydis.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/Gw</AdditionalOptions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ExceptionHandling>false</ExceptionHandling>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<StringPooling>true</StringPooling>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>Zydis_EXPORTS;WIN32;_WINDOWS;NDEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<OmitFramePointers>true</OmitFramePointers>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/NOCOFFGRPINFO</AdditionalOptions>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<SetChecksum>true</SetChecksum>
<SubSystem>Console</SubSystem>
<Version>5.1</Version>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<MinimumRequiredVersion>5.01</MinimumRequiredVersion>
<AdditionalDependencies>Zydis.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\tools\ZydisDisasm.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\include\Zydis\CommonTypes.h" />
<ClInclude Include="..\..\include\Zydis\Defines.h" />
<ClInclude Include="..\..\include\Zydis\MetaInfo.h" />
<ClInclude Include="..\..\include\Zydis\Mnemonic.h" />
<ClInclude Include="..\..\include\Zydis\Register.h" />
<ClInclude Include="..\..\include\Zydis\SharedTypes.h" />
<ClInclude Include="..\..\include\Zydis\Status.h" />
<ClInclude Include="..\..\include\Zydis\String.h" />
<ClInclude Include="..\..\include\Zydis\Utils.h" />
<ClInclude Include="..\..\include\Zydis\Zydis.h" />
<ClInclude Include="..\..\include\Zydis\Decoder.h" />
<ClInclude Include="..\..\include\Zydis\DecoderTypes.h" />
<ClInclude Include="..\..\include\Zydis\Formatter.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{664BBE0B-918F-3B41-8D06-1875B10A7BE5}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{54CFF9CE-5525-3FCE-8ECE-9A26FB686F56}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\tools\ZydisDisasm.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\include\Zydis\CommonTypes.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Defines.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\MetaInfo.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Mnemonic.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Register.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\SharedTypes.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Status.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\String.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Utils.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Zydis.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Decoder.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\DecoderTypes.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Formatter.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@ -0,0 +1,422 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug DLL|Win32">
<Configuration>Debug DLL</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug DLL|x64">
<Configuration>Debug DLL</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release DLL|Win32">
<Configuration>Release DLL</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release DLL|x64">
<Configuration>Release DLL</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{BC04B6A7-D80C-3FED-97AC-BCC8370D6A7E}</ProjectGuid>
<WindowsTargetPlatformVersion>$(LatestTargetPlatformVersion)</WindowsTargetPlatformVersion>
<Keyword>Win32Proj</Keyword>
<ProjectName>ZydisInfo</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)bin\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'">$(SolutionDir)bin\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'">obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'">false</LinkIncremental>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'">false</GenerateManifest>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)bin\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">$(SolutionDir)bin\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'">false</LinkIncremental>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'">false</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)bin\</OutDir>
<IntDir>obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'">
<OutDir>$(SolutionDir)bin\</OutDir>
<IntDir>obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)bin\</OutDir>
<IntDir>obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'">
<OutDir>$(SolutionDir)bin\</OutDir>
<IntDir>obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'">
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/Gw</AdditionalOptions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ExceptionHandling>false</ExceptionHandling>
<InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<Optimization>Disabled</Optimization>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>ZYDIS_STATIC_DEFINE;WIN32;_WINDOWS;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/NOCOFFGRPINFO</AdditionalOptions>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<SetChecksum>true</SetChecksum>
<SubSystem>Console</SubSystem>
<Version>5.2</Version>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<MinimumRequiredVersion>5.02</MinimumRequiredVersion>
<AdditionalDependencies>Zydis.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/Gw</AdditionalOptions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ExceptionHandling>false</ExceptionHandling>
<InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<Optimization>Disabled</Optimization>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>Zydis_EXPORTS;WIN32;_WINDOWS;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/NOCOFFGRPINFO</AdditionalOptions>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<SetChecksum>true</SetChecksum>
<SubSystem>Console</SubSystem>
<Version>5.2</Version>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<MinimumRequiredVersion>5.02</MinimumRequiredVersion>
<AdditionalDependencies>Zydis.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/Gw</AdditionalOptions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ExceptionHandling>false</ExceptionHandling>
<InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<Optimization>Disabled</Optimization>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>ZYDIS_STATIC_DEFINE;WIN32;_WINDOWS;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/NOCOFFGRPINFO</AdditionalOptions>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<SetChecksum>true</SetChecksum>
<SubSystem>Console</SubSystem>
<Version>5.1</Version>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<MinimumRequiredVersion>5.01</MinimumRequiredVersion>
<AdditionalDependencies>Zydis.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/Gw</AdditionalOptions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ExceptionHandling>false</ExceptionHandling>
<InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<Optimization>Disabled</Optimization>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>Zydis_EXPORTS;WIN32;_WINDOWS;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/NOCOFFGRPINFO</AdditionalOptions>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<SetChecksum>true</SetChecksum>
<SubSystem>Console</SubSystem>
<Version>5.1</Version>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<MinimumRequiredVersion>5.01</MinimumRequiredVersion>
<AdditionalDependencies>Zydis.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/Gw</AdditionalOptions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ExceptionHandling>false</ExceptionHandling>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<StringPooling>true</StringPooling>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>ZYDIS_STATIC_DEFINE;WIN32;_WINDOWS;NDEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<OmitFramePointers>true</OmitFramePointers>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/NOCOFFGRPINFO</AdditionalOptions>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<SetChecksum>true</SetChecksum>
<SubSystem>Console</SubSystem>
<Version>5.2</Version>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<MinimumRequiredVersion>5.02</MinimumRequiredVersion>
<AdditionalDependencies>Zydis.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/Gw</AdditionalOptions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ExceptionHandling>false</ExceptionHandling>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<StringPooling>true</StringPooling>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>Zydis_EXPORTS;WIN32;_WINDOWS;NDEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<OmitFramePointers>true</OmitFramePointers>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/NOCOFFGRPINFO</AdditionalOptions>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<SetChecksum>true</SetChecksum>
<SubSystem>Console</SubSystem>
<Version>5.2</Version>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<MinimumRequiredVersion>5.02</MinimumRequiredVersion>
<AdditionalDependencies>Zydis.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/Gw</AdditionalOptions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ExceptionHandling>false</ExceptionHandling>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<StringPooling>true</StringPooling>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>ZYDIS_STATIC_DEFINE;WIN32;_WINDOWS;NDEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<OmitFramePointers>true</OmitFramePointers>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/NOCOFFGRPINFO</AdditionalOptions>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<SetChecksum>true</SetChecksum>
<SubSystem>Console</SubSystem>
<Version>5.1</Version>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<MinimumRequiredVersion>5.01</MinimumRequiredVersion>
<AdditionalDependencies>Zydis.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/Gw</AdditionalOptions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ExceptionHandling>false</ExceptionHandling>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<StringPooling>true</StringPooling>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>Zydis_EXPORTS;WIN32;_WINDOWS;NDEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<OmitFramePointers>true</OmitFramePointers>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/NOCOFFGRPINFO</AdditionalOptions>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<SetChecksum>true</SetChecksum>
<SubSystem>Console</SubSystem>
<Version>5.1</Version>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<MinimumRequiredVersion>5.01</MinimumRequiredVersion>
<AdditionalDependencies>Zydis.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\tools\ZydisInfo.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\include\Zydis\CommonTypes.h" />
<ClInclude Include="..\..\include\Zydis\Defines.h" />
<ClInclude Include="..\..\include\Zydis\MetaInfo.h" />
<ClInclude Include="..\..\include\Zydis\Mnemonic.h" />
<ClInclude Include="..\..\include\Zydis\Register.h" />
<ClInclude Include="..\..\include\Zydis\SharedTypes.h" />
<ClInclude Include="..\..\include\Zydis\Status.h" />
<ClInclude Include="..\..\include\Zydis\String.h" />
<ClInclude Include="..\..\include\Zydis\Utils.h" />
<ClInclude Include="..\..\include\Zydis\Zydis.h" />
<ClInclude Include="..\..\include\Zydis\Decoder.h" />
<ClInclude Include="..\..\include\Zydis\DecoderTypes.h" />
<ClInclude Include="..\..\include\Zydis\Formatter.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{664BBE0B-918F-3B41-8D06-1875B10A7BE5}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{54CFF9CE-5525-3FCE-8ECE-9A26FB686F56}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\tools\ZydisInfo.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\include\Zydis\CommonTypes.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Defines.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\MetaInfo.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Mnemonic.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Register.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\SharedTypes.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Status.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\String.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Utils.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Zydis.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Decoder.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\DecoderTypes.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Formatter.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

552
msvc/zydis/Zydis.vcxproj Normal file
View File

@ -0,0 +1,552 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug DLL|Win32">
<Configuration>Debug DLL</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug DLL|x64">
<Configuration>Debug DLL</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug Kernel|Win32">
<Configuration>Debug Kernel</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug Kernel|x64">
<Configuration>Debug Kernel</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release DLL|Win32">
<Configuration>Release DLL</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release DLL|x64">
<Configuration>Release DLL</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release Kernel|Win32">
<Configuration>Release Kernel</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release Kernel|x64">
<Configuration>Release Kernel</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{88A23124-5640-35A0-B890-311D7A67A7D2}</ProjectGuid>
<TemplateGuid>{0a049372-4c4d-4ea0-a64e-dc6ad88ceca1}</TemplateGuid>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
<Configuration>Release</Configuration>
<Platform Condition="'$(Platform)' == ''">x64</Platform>
<RootNamespace>$(MSBuildProjectName)</RootNamespace>
<Keyword>Win32Proj</Keyword>
<WindowsTargetPlatformVersion>$(LatestTargetPlatformVersion)</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Kernel|Win32'" Label="Configuration">
<TargetVersion>Windows7</TargetVersion>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
<ConfigurationType>StaticLibrary</ConfigurationType>
<DriverTargetPlatform>Desktop</DriverTargetPlatform>
<DriverType>WDM</DriverType>
<SupportsPackaging>false</SupportsPackaging>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Kernel|Win32'" Label="Configuration">
<TargetVersion>Windows7</TargetVersion>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
<ConfigurationType>StaticLibrary</ConfigurationType>
<DriverTargetPlatform>Desktop</DriverTargetPlatform>
<DriverType>WDM</DriverType>
<SupportsPackaging>false</SupportsPackaging>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'" Label="Configuration">
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Kernel|x64'" Label="Configuration">
<TargetVersion>Windows7</TargetVersion>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
<ConfigurationType>StaticLibrary</ConfigurationType>
<DriverTargetPlatform>Desktop</DriverTargetPlatform>
<DriverType>WDM</DriverType>
<SupportsPackaging>false</SupportsPackaging>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Kernel|x64'" Label="Configuration">
<TargetVersion>Windows7</TargetVersion>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
<ConfigurationType>StaticLibrary</ConfigurationType>
<DriverTargetPlatform>Desktop</DriverTargetPlatform>
<DriverType>WDM</DriverType>
<SupportsPackaging>false</SupportsPackaging>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'" Label="Configuration">
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)bin\</OutDir>
<IntDir>obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Kernel|Win32'">
<OutDir>$(SolutionDir)bin\</OutDir>
<IntDir>obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<EnableInf2cat>false</EnableInf2cat>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'">
<OutDir>$(SolutionDir)bin\</OutDir>
<IntDir>obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<LinkIncremental>false</LinkIncremental>
<GenerateManifest>false</GenerateManifest>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)bin\</OutDir>
<IntDir>obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Kernel|Win32'">
<OutDir>$(SolutionDir)bin\</OutDir>
<IntDir>obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<EnableInf2cat>false</EnableInf2cat>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'">
<OutDir>$(SolutionDir)bin\</OutDir>
<IntDir>obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<LinkIncremental>false</LinkIncremental>
<GenerateManifest>false</GenerateManifest>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>$(SolutionDir)bin\</OutDir>
<IntDir>obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Kernel|x64'">
<OutDir>$(SolutionDir)bin\</OutDir>
<IntDir>obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<EnableInf2cat>false</EnableInf2cat>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'">
<OutDir>$(SolutionDir)bin\</OutDir>
<IntDir>obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<LinkIncremental>false</LinkIncremental>
<GenerateManifest>false</GenerateManifest>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(SolutionDir)bin\</OutDir>
<IntDir>obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Kernel|x64'">
<OutDir>$(SolutionDir)bin\</OutDir>
<IntDir>obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<EnableInf2cat>false</EnableInf2cat>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">
<OutDir>$(SolutionDir)bin\</OutDir>
<IntDir>obj\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<LinkIncremental>false</LinkIncremental>
<GenerateManifest>false</GenerateManifest>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PreprocessorDefinitions>ZYDIS_STATIC_DEFINE;ZYDIS_EXPORTS;_LIB;WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalOptions>/Gw </AdditionalOptions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir)../src;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<Optimization>Disabled</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<OmitDefaultLibName>true</OmitDefaultLibName>
<WarningLevel>Level3</WarningLevel>
<ExceptionHandling>false</ExceptionHandling>
<MinimalRebuild>false</MinimalRebuild>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
</ClCompile>
<Lib>
<SubSystem>Console</SubSystem>
<MinimumRequiredVersion>5.01</MinimumRequiredVersion>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Kernel|Win32'">
<ClCompile>
<PreprocessorDefinitions>ZYDIS_NO_LIBC;ZYDIS_STATIC_DEFINE;ZYDIS_EXPORTS;_LIB;WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;WINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP;WINAPI_PARTITION_DESKTOP=1;WINAPI_PARTITION_SYSTEM=1;WINAPI_PARTITION_APP=1;WINAPI_PARTITION_PC_APP=1;_X86_=1;i386=1;STD_CALL;DBG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalOptions>/Gw /kernel</AdditionalOptions>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir)../src;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<Optimization>Disabled</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<OmitDefaultLibName>true</OmitDefaultLibName>
</ClCompile>
<Lib>
<SubSystem>Native</SubSystem>
<MinimumRequiredVersion>$(SUBSYSTEM_NATVER)</MinimumRequiredVersion>
<TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'">
<ClCompile>
<PreprocessorDefinitions>Zydis_EXPORTS;ZYDIS_EXPORTS;_DLL;WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalOptions>/Gw </AdditionalOptions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir)../src;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<Optimization>Disabled</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<WarningLevel>Level3</WarningLevel>
<ExceptionHandling>false</ExceptionHandling>
<MinimalRebuild>false</MinimalRebuild>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>Zydis_EXPORTS;ZYDIS_EXPORTS;_DLL;WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir)../src;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
<Version>5.1</Version>
<GenerateDebugInformation>true</GenerateDebugInformation>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<MinimumRequiredVersion>5.01</MinimumRequiredVersion>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<SetChecksum>true</SetChecksum>
<AdditionalOptions>/NOCOFFGRPINFO %(AdditionalOptions)</AdditionalOptions>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>ZYDIS_STATIC_DEFINE;ZYDIS_EXPORTS;_LIB;WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
<AdditionalOptions>/Gw </AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir)../src;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<OmitFramePointers>true</OmitFramePointers>
<OmitDefaultLibName>true</OmitDefaultLibName>
<WarningLevel>Level3</WarningLevel>
<StringPooling>true</StringPooling>
<ExceptionHandling>false</ExceptionHandling>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
</ClCompile>
<Lib>
<SubSystem>Console</SubSystem>
<MinimumRequiredVersion>5.01</MinimumRequiredVersion>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Kernel|Win32'">
<ClCompile>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>ZYDIS_NO_LIBC;ZYDIS_STATIC_DEFINE;ZYDIS_EXPORTS;_LIB;WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;WINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP;WINAPI_PARTITION_DESKTOP=1;WINAPI_PARTITION_SYSTEM=1;WINAPI_PARTITION_APP=1;WINAPI_PARTITION_PC_APP=1;_X86_=1;i386=1;STD_CALL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
<AdditionalOptions>/Gw /kernel</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir)../src;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<OmitFramePointers>true</OmitFramePointers>
<OmitDefaultLibName>true</OmitDefaultLibName>
</ClCompile>
<Lib>
<SubSystem>Native</SubSystem>
<MinimumRequiredVersion>$(SUBSYSTEM_NATVER)</MinimumRequiredVersion>
<TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'">
<ClCompile>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>Zydis_EXPORTS;ZYDIS_EXPORTS;_DLL;WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
<AdditionalOptions>/Gw </AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir)../src;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<OmitFramePointers>true</OmitFramePointers>
<WarningLevel>Level3</WarningLevel>
<StringPooling>true</StringPooling>
<ExceptionHandling>false</ExceptionHandling>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>Zydis_EXPORTS;ZYDIS_EXPORTS;_DLL;WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir)../src;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
<Version>5.1</Version>
<GenerateDebugInformation>true</GenerateDebugInformation>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<MinimumRequiredVersion>5.01</MinimumRequiredVersion>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<SetChecksum>true</SetChecksum>
<AdditionalOptions>/NOCOFFGRPINFO %(AdditionalOptions)</AdditionalOptions>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PreprocessorDefinitions>ZYDIS_STATIC_DEFINE;ZYDIS_EXPORTS;_LIB;WIN32;_WIN64;_DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalOptions>/Gw </AdditionalOptions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir)../src;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<Optimization>Disabled</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<OmitDefaultLibName>true</OmitDefaultLibName>
<WarningLevel>Level3</WarningLevel>
<ExceptionHandling>false</ExceptionHandling>
<MinimalRebuild>false</MinimalRebuild>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
</ClCompile>
<Lib>
<SubSystem>Console</SubSystem>
<MinimumRequiredVersion>5.02</MinimumRequiredVersion>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Kernel|x64'">
<ClCompile>
<PreprocessorDefinitions>ZYDIS_NO_LIBC;ZYDIS_STATIC_DEFINE;ZYDIS_EXPORTS;_LIB;WIN32;_WIN64;_DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;WINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP;WINAPI_PARTITION_DESKTOP=1;WINAPI_PARTITION_SYSTEM=1;WINAPI_PARTITION_APP=1;WINAPI_PARTITION_PC_APP=1;_AMD64_;AMD64;DBG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalOptions>/Gw /kernel</AdditionalOptions>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir)../src;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<Optimization>Disabled</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<OmitDefaultLibName>true</OmitDefaultLibName>
</ClCompile>
<Lib>
<SubSystem>Native</SubSystem>
<MinimumRequiredVersion>$(SUBSYSTEM_NATVER)</MinimumRequiredVersion>
<TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'">
<ClCompile>
<PreprocessorDefinitions>Zydis_EXPORTS;ZYDIS_EXPORTS;_DLL;WIN32;_WIN64;_DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalOptions>/Gw </AdditionalOptions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir)../src;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<Optimization>Disabled</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<WarningLevel>Level3</WarningLevel>
<ExceptionHandling>false</ExceptionHandling>
<MinimalRebuild>false</MinimalRebuild>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>Zydis_EXPORTS;ZYDIS_EXPORTS;_DLL;WIN32;_WIN64;_DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir)../src;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
<Version>5.2</Version>
<GenerateDebugInformation>true</GenerateDebugInformation>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<MinimumRequiredVersion>5.02</MinimumRequiredVersion>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<SetChecksum>true</SetChecksum>
<AdditionalOptions>/NOCOFFGRPINFO %(AdditionalOptions)</AdditionalOptions>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>ZYDIS_STATIC_DEFINE;ZYDIS_EXPORTS;_LIB;WIN32;_WIN64;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
<AdditionalOptions>/Gw </AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir)../src;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<OmitFramePointers>true</OmitFramePointers>
<OmitDefaultLibName>true</OmitDefaultLibName>
<WarningLevel>Level3</WarningLevel>
<StringPooling>true</StringPooling>
<ExceptionHandling>false</ExceptionHandling>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
</ClCompile>
<Lib>
<SubSystem>Console</SubSystem>
<MinimumRequiredVersion>5.02</MinimumRequiredVersion>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Kernel|x64'">
<ClCompile>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>ZYDIS_NO_LIBC;ZYDIS_STATIC_DEFINE;ZYDIS_EXPORTS;_LIB;WIN32;_WIN64;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;WINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP;WINAPI_PARTITION_DESKTOP=1;WINAPI_PARTITION_SYSTEM=1;WINAPI_PARTITION_APP=1;WINAPI_PARTITION_PC_APP=1;_AMD64_;AMD64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
<AdditionalOptions>/Gw /kernel</AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir)../src;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<OmitFramePointers>true</OmitFramePointers>
<OmitDefaultLibName>true</OmitDefaultLibName>
</ClCompile>
<Lib>
<SubSystem>Native</SubSystem>
<MinimumRequiredVersion>$(SUBSYSTEM_NATVER)</MinimumRequiredVersion>
<TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">
<ClCompile>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>Zydis_EXPORTS;ZYDIS_EXPORTS;_DLL;WIN32;_WIN64;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DiagnosticsFormat>Caret</DiagnosticsFormat>
<AdditionalOptions>/Gw </AdditionalOptions>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir)../src;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<OmitFramePointers>true</OmitFramePointers>
<WarningLevel>Level3</WarningLevel>
<StringPooling>true</StringPooling>
<ExceptionHandling>false</ExceptionHandling>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>Zydis_EXPORTS;ZYDIS_EXPORTS;_DLL;WIN32;_WIN64;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)../include;$(SolutionDir)../src;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
<Version>5.2</Version>
<GenerateDebugInformation>true</GenerateDebugInformation>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<MinimumRequiredVersion>5.02</MinimumRequiredVersion>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<SetChecksum>true</SetChecksum>
<AdditionalOptions>/NOCOFFGRPINFO %(AdditionalOptions)</AdditionalOptions>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\src\MetaInfo.c" />
<ClCompile Include="..\..\src\Mnemonic.c" />
<ClCompile Include="..\..\src\Register.c" />
<ClCompile Include="..\..\src\SharedData.c" />
<ClCompile Include="..\..\src\String.c" />
<ClCompile Include="..\..\src\Utils.c" />
<ClCompile Include="..\..\src\Zydis.c" />
<ClCompile Include="..\..\src\Decoder.c" />
<ClCompile Include="..\..\src\DecoderData.c" />
<ClCompile Include="..\..\src\Formatter.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\include\Zydis\CommonTypes.h" />
<ClInclude Include="..\..\include\Zydis\Defines.h" />
<ClInclude Include="..\..\include\Zydis\MetaInfo.h" />
<ClInclude Include="..\..\include\Zydis\Mnemonic.h" />
<ClInclude Include="..\..\include\Zydis\Register.h" />
<ClInclude Include="..\..\include\Zydis\SharedTypes.h" />
<ClInclude Include="..\..\include\Zydis\Status.h" />
<ClInclude Include="..\..\include\Zydis\String.h" />
<ClInclude Include="..\..\include\Zydis\Utils.h" />
<ClInclude Include="..\..\include\Zydis\Zydis.h" />
<ClInclude Include="..\..\include\Zydis\Decoder.h" />
<ClInclude Include="..\..\include\Zydis\DecoderTypes.h" />
<ClInclude Include="..\..\include\Zydis\Formatter.h" />
<ClInclude Include="..\..\include\Zydis\Internal\LibC.h" />
<ClInclude Include="..\..\include\Zydis\Internal\SharedData.h" />
<ClInclude Include="..\..\include\Zydis\Internal\DecoderData.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\src\VersionInfo.rc">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Kernel|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Kernel|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Kernel|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Kernel|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ResourceCompile>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,107 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{664BBE0B-918F-3B41-8D06-1875B10A7BE5}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{54CFF9CE-5525-3FCE-8ECE-9A26FB686F56}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{97DEB7A2-7CAF-45B9-B945-FA454AAAC4FB}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="Header Files\Internal">
<UniqueIdentifier>{CEA317BE-1F0E-40DD-A546-67659EB71E9A}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\Decoder.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\DecoderData.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\Formatter.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\MetaInfo.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\Mnemonic.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\Register.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\SharedData.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\String.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\Utils.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\Zydis.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\include\Zydis\CommonTypes.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Decoder.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\DecoderTypes.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Defines.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Formatter.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\MetaInfo.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Mnemonic.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Register.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\SharedTypes.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Status.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\String.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Utils.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Zydis.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Internal\LibC.h">
<Filter>Header Files\Internal</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Internal\SharedData.h">
<Filter>Header Files\Internal</Filter>
</ClInclude>
<ClInclude Include="..\..\include\Zydis\Internal\DecoderData.h">
<Filter>Header Files\Internal</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\src\VersionInfo.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
</Project>

File diff suppressed because it is too large Load Diff

View File

@ -24,7 +24,7 @@
***************************************************************************************************/ ***************************************************************************************************/
#include <DecoderData.h> #include <Zydis/Internal/DecoderData.h>
/* ============================================================================================== */ /* ============================================================================================== */
/* Data tables */ /* Data tables */
@ -221,19 +221,23 @@ extern const ZydisDecoderTreeNode filtersREXW[][2];
*/ */
extern const ZydisDecoderTreeNode filtersREXB[][2]; extern const ZydisDecoderTreeNode filtersREXB[][2];
#ifndef ZYDIS_DISABLE_EVEX
/** /**
* @brief Contains all EVEX.b filters. * @brief Contains all EVEX.b filters.
* *
* Indexed by the numeric value of the EVEX.b field. * Indexed by the numeric value of the EVEX.b field.
*/ */
extern const ZydisDecoderTreeNode filtersEVEXB[][2]; extern const ZydisDecoderTreeNode filtersEVEXB[][2];
#endif
#ifndef ZYDIS_DISABLE_MVEX
/** /**
* @brief Contains all MVEX.E filters. * @brief Contains all MVEX.E filters.
* *
* Indexed by the numeric value of the MVEX.E field. * Indexed by the numeric value of the MVEX.E field.
*/ */
extern const ZydisDecoderTreeNode filtersMVEXE[][2]; extern const ZydisDecoderTreeNode filtersMVEXE[][2];
#endif
/* ---------------------------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------------------------- */
/* Physical instruction encodings */ /* Physical instruction encodings */
@ -268,14 +272,14 @@ extern const ZydisDecoderTreeNode filtersMVEXE[][2];
/* Decoder tree */ /* Decoder tree */
/* ---------------------------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------------------------- */
const ZydisDecoderTreeNode* ZydisDecoderTreeGetRootNode() const ZydisDecoderTreeNode* ZydisDecoderTreeGetRootNode(void)
{ {
static const ZydisDecoderTreeNode root = { ZYDIS_NODETYPE_FILTER_OPCODE, 0x00000000 }; static const ZydisDecoderTreeNode root = { ZYDIS_NODETYPE_FILTER_OPCODE, 0x0000 };
return &root; return &root;
} }
const ZydisDecoderTreeNode* ZydisDecoderTreeGetChildNode(const ZydisDecoderTreeNode* parent, const ZydisDecoderTreeNode* ZydisDecoderTreeGetChildNode(const ZydisDecoderTreeNode* parent,
uint16_t index) ZydisU16 index)
{ {
switch (parent->type) switch (parent->type)
{ {
@ -327,12 +331,34 @@ const ZydisDecoderTreeNode* ZydisDecoderTreeGetChildNode(const ZydisDecoderTreeN
case ZYDIS_NODETYPE_FILTER_REX_B: case ZYDIS_NODETYPE_FILTER_REX_B:
ZYDIS_ASSERT(index < 2); ZYDIS_ASSERT(index < 2);
return &filtersREXB[parent->value][index]; return &filtersREXB[parent->value][index];
#ifndef ZYDIS_DISABLE_EVEX
case ZYDIS_NODETYPE_FILTER_EVEX_B: case ZYDIS_NODETYPE_FILTER_EVEX_B:
ZYDIS_ASSERT(index < 2); ZYDIS_ASSERT(index < 2);
return &filtersEVEXB[parent->value][index]; return &filtersEVEXB[parent->value][index];
#endif
#ifndef ZYDIS_DISABLE_MVEX
case ZYDIS_NODETYPE_FILTER_MVEX_E: case ZYDIS_NODETYPE_FILTER_MVEX_E:
ZYDIS_ASSERT(index < 2); ZYDIS_ASSERT(index < 2);
return &filtersMVEXE[parent->value][index]; return &filtersMVEXE[parent->value][index];
#endif
case ZYDIS_NODETYPE_FILTER_MODE_AMD:
ZYDIS_ASSERT(index < 2);
return &filtersModeAMD[parent->value][index];
case ZYDIS_NODETYPE_FILTER_MODE_KNC:
ZYDIS_ASSERT(index < 2);
return &filtersModeKNC[parent->value][index];
case ZYDIS_NODETYPE_FILTER_MODE_MPX:
ZYDIS_ASSERT(index < 2);
return &filtersModeMPX[parent->value][index];
case ZYDIS_NODETYPE_FILTER_MODE_CET:
ZYDIS_ASSERT(index < 2);
return &filtersModeCET[parent->value][index];
case ZYDIS_NODETYPE_FILTER_MODE_LZCNT:
ZYDIS_ASSERT(index < 2);
return &filtersModeLZCNT[parent->value][index];
case ZYDIS_NODETYPE_FILTER_MODE_TZCNT:
ZYDIS_ASSERT(index < 2);
return &filtersModeTZCNT[parent->value][index];
default: default:
ZYDIS_UNREACHABLE; ZYDIS_UNREACHABLE;
} }
@ -342,7 +368,7 @@ void ZydisGetInstructionEncodingInfo(const ZydisDecoderTreeNode* node,
const ZydisInstructionEncodingInfo** info) const ZydisInstructionEncodingInfo** info)
{ {
ZYDIS_ASSERT(node->type & ZYDIS_NODETYPE_DEFINITION_MASK); ZYDIS_ASSERT(node->type & ZYDIS_NODETYPE_DEFINITION_MASK);
uint8_t class = (node->type) & 0x7F; const ZydisU8 class = (node->type) & 0x7F;
ZYDIS_ASSERT(class < ZYDIS_ARRAY_SIZE(instructionEncodings)); ZYDIS_ASSERT(class < ZYDIS_ARRAY_SIZE(instructionEncodings));
*info = &instructionEncodings[class]; *info = &instructionEncodings[class];
} }

View File

@ -1,409 +0,0 @@
/***************************************************************************************************
Zyan Disassembler Library (Zydis)
Original Author : Florian Bernd, Joel Höner
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
***************************************************************************************************/
#include <string.h>
#include <ctype.h>
#include <FormatHelper.h>
/* ============================================================================================== */
/* Constants */
/* ============================================================================================== */
/* ---------------------------------------------------------------------------------------------- */
/* Defines */
/* ---------------------------------------------------------------------------------------------- */
#define ZYDIS_MAXCHARS_DEC_32 10
#define ZYDIS_MAXCHARS_DEC_64 20
#define ZYDIS_MAXCHARS_HEX_32 8
#define ZYDIS_MAXCHARS_HEX_64 16
/* ---------------------------------------------------------------------------------------------- */
/* Lookup Tables */
/* ---------------------------------------------------------------------------------------------- */
static const char* decimalLookup =
"00010203040506070809"
"10111213141516171819"
"20212223242526272829"
"30313233343536373839"
"40414243444546474849"
"50515253545556575859"
"60616263646566676869"
"70717273747576777879"
"80818283848586878889"
"90919293949596979899";
/* ---------------------------------------------------------------------------------------------- */
/* ============================================================================================== */
/* Functions */
/* ============================================================================================== */
/* ---------------------------------------------------------------------------------------------- */
/* Internal Functions */
/* ---------------------------------------------------------------------------------------------- */
void ZydisToLowerCase(char* buffer, size_t bufferLen)
{
ZYDIS_ASSERT(buffer);
ZYDIS_ASSERT(bufferLen);
const signed char rebase = 'a' - 'A';
for (size_t i = 0; i < bufferLen; ++i)
{
char* c = buffer + i;
if ((*c >= 'A') && (*c <= 'Z'))
{
*c += rebase;
}
}
}
void ZydisToUpperCase(char* buffer, size_t bufferLen)
{
ZYDIS_ASSERT(buffer);
ZYDIS_ASSERT(bufferLen);
const signed char rebase = 'A' - 'a';
for (size_t i = 0; i < bufferLen; ++i)
{
char* c = buffer + i;
if ((*c >= 'a') && (*c <= 'z'))
{
*c += rebase;
}
}
}
#ifdef ZYDIS_X86
ZydisStatus ZydisPrintDecU32(char** buffer, size_t bufferLen, uint32_t value, uint8_t paddingLength)
{
ZYDIS_ASSERT(buffer);
ZYDIS_ASSERT(bufferLen > 0);
char temp[ZYDIS_MAXCHARS_DEC_32 + 1];
char *p = &temp[ZYDIS_MAXCHARS_DEC_32];
*p = '\0';
while (value >= 100)
{
uint32_t const old = value;
p -= 2;
value /= 100;
memcpy(p, &decimalLookup[(old - (value * 100)) * 2], sizeof(uint16_t));
}
p -= 2;
memcpy(p, &decimalLookup[value * 2], sizeof(uint16_t));
size_t n = &temp[ZYDIS_MAXCHARS_DEC_32] - p;
if ((bufferLen < (size_t)(n + 1)) || (bufferLen < (size_t)(paddingLength + 1)))
{
return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE;
}
uintptr_t offset = 0;
if (n <= paddingLength)
{
offset = paddingLength - n + 1;
memset(*buffer, '0', offset);
}
memcpy(&(*buffer)[offset], &p[value < 10], n + 1);
*buffer += n + offset - (uint8_t)(value < 10);
return ZYDIS_STATUS_SUCCESS;
}
ZydisStatus ZydisPrintHexU32(char** buffer, size_t bufferLen, uint32_t value, uint8_t paddingLength,
ZydisBool uppercase, ZydisBool prefix)
{
ZYDIS_ASSERT(buffer);
ZYDIS_ASSERT(bufferLen);
if (prefix)
{
ZYDIS_CHECK(ZydisPrintStr(buffer, bufferLen, "0x", ZYDIS_LETTER_CASE_DEFAULT));
bufferLen -= 2;
}
if (bufferLen < (size_t)(paddingLength + 1))
{
return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE;
}
if (!value)
{
uint8_t n = (paddingLength ? paddingLength : 1);
if (bufferLen < (size_t)(n + 1))
{
return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE;
}
memset(*buffer, '0', n);
(*buffer)[n] = '\0';
*buffer += n;
return ZYDIS_STATUS_SUCCESS;
}
uint8_t n = 0;
for (int8_t i = ZYDIS_MAXCHARS_HEX_32 - 1; i >= 0; --i)
{
uint8_t v = (value >> i * 4) & 0x0F;
if (!n)
{
if (!v)
{
continue;
}
if (bufferLen <= (uint8_t)(i + 1))
{
return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE;
}
if (paddingLength > i)
{
n = paddingLength - i - 1;
memset(*buffer, '0', n);
}
}
if (uppercase)
{
(*buffer)[n++] = "0123456789ABCDEF"[v];
} else
{
(*buffer)[n++] = "0123456789abcdef"[v];
}
}
(*buffer)[n] = '\0';
*buffer += n;
return ZYDIS_STATUS_SUCCESS;
}
#endif
ZydisStatus ZydisPrintDecU64(char** buffer, size_t bufferLen, uint64_t value, uint8_t paddingLength)
{
ZYDIS_ASSERT(buffer);
ZYDIS_ASSERT(bufferLen > 0);
char temp[ZYDIS_MAXCHARS_DEC_64 + 1];
char *p = &temp[ZYDIS_MAXCHARS_DEC_64];
*p = '\0';
while (value >= 100)
{
uint64_t const old = value;
p -= 2;
value /= 100;
memcpy(p, &decimalLookup[(old - (value * 100)) * 2], 2);
}
p -= 2;
memcpy(p, &decimalLookup[value * 2], 2);
size_t n = &temp[ZYDIS_MAXCHARS_DEC_64] - p;
if ((bufferLen < (size_t)(n + 1)) || (bufferLen < (size_t)(paddingLength + 1)))
{
return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE;
}
uintptr_t offset = 0;
if (n <= paddingLength)
{
offset = paddingLength - n + 1;
memset(*buffer, '0', offset);
}
memcpy(&(*buffer)[offset], &p[value < 10], n + 1);
*buffer += n + offset - (uint8_t)(value < 10);
return ZYDIS_STATUS_SUCCESS;
}
ZydisStatus ZydisPrintHexU64(char** buffer, size_t bufferLen, uint64_t value, uint8_t paddingLength,
ZydisBool uppercase, ZydisBool prefix)
{
ZYDIS_ASSERT(buffer);
ZYDIS_ASSERT(bufferLen);
if (prefix)
{
ZYDIS_CHECK(ZydisPrintStr(buffer, bufferLen, "0x", ZYDIS_LETTER_CASE_DEFAULT));
bufferLen -= 2;
}
if (bufferLen < (size_t)(paddingLength + 1))
{
return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE;
}
if (!value)
{
uint8_t n = (paddingLength ? paddingLength : 1);
if (bufferLen < (size_t)(n + 1))
{
return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE;
}
memset(*buffer, '0', n);
(*buffer)[n] = '\0';
*buffer += n;
return ZYDIS_STATUS_SUCCESS;
}
uint8_t n = 0;
uint8_t c = ((value & 0xFFFFFFFF00000000) ? ZYDIS_MAXCHARS_HEX_64 : ZYDIS_MAXCHARS_HEX_32);
for (int8_t i = c - 1; i >= 0; --i)
{
uint8_t v = (value >> i * 4) & 0x0F;
if (!n)
{
if (!v)
{
continue;
}
if (bufferLen <= (uint8_t)(i + 1))
{
return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE;
}
if (paddingLength > i)
{
n = paddingLength - i - 1;
memset(*buffer, '0', n);
}
}
if (uppercase)
{
(*buffer)[n++] = "0123456789ABCDEF"[v];
} else
{
(*buffer)[n++] = "0123456789abcdef"[v];
}
}
(*buffer)[n] = '\0';
*buffer += n;
return ZYDIS_STATUS_SUCCESS;
}
/* ---------------------------------------------------------------------------------------------- */
/* Public Functions */
/* ---------------------------------------------------------------------------------------------- */
ZydisStatus ZydisPrintStr(char** buffer, size_t bufferLen, const char* text,
ZydisLetterCase letterCase)
{
ZYDIS_ASSERT(buffer);
ZYDIS_ASSERT(bufferLen > 0);
ZYDIS_ASSERT(text);
size_t strLen = strlen(text);
if (strLen >= bufferLen)
{
return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE;
}
memcpy(*buffer, text, strLen + 1);
switch (letterCase)
{
case ZYDIS_LETTER_CASE_DEFAULT:
break;
case ZYDIS_LETTER_CASE_LOWER:
ZydisToLowerCase(*buffer, strLen);
break;
case ZYDIS_LETTER_CASE_UPPER:
ZydisToUpperCase(*buffer, strLen);
break;
default:
ZYDIS_UNREACHABLE;
}
*buffer += strLen;
return ZYDIS_STATUS_SUCCESS;
}
ZydisStatus ZydisPrintDecU(char** buffer, size_t bufferLen, uint64_t value, uint8_t paddingLength)
{
#ifdef ZYDIS_X64
return ZydisPrintDecU64(buffer, bufferLen, value, paddingLength);
#else
if (value & 0xFFFFFFFF00000000)
{
return ZydisPrintDecU64(buffer, bufferLen, value, paddingLength);
} else
{
return ZydisPrintDecU32(buffer, bufferLen, (uint32_t)value, paddingLength);
}
#endif
}
ZydisStatus ZydisPrintDecS(char** buffer, size_t bufferLen, int64_t value, uint8_t paddingLength)
{
if (value < 0)
{
ZYDIS_CHECK(ZydisPrintStr(buffer, bufferLen, "-", ZYDIS_LETTER_CASE_DEFAULT));
return ZydisPrintDecU(buffer, bufferLen - 1, -value, paddingLength);
}
return ZydisPrintDecU(buffer, bufferLen, value, paddingLength);
}
ZydisStatus ZydisPrintHexU(char** buffer, size_t bufferLen, uint64_t value, uint8_t paddingLength,
ZydisBool uppercase, ZydisBool prefix)
{
#ifdef ZYDIS_X64
return ZydisPrintHexU64(buffer, bufferLen, value, paddingLength, uppercase, prefix);
#else
if (value & 0xFFFFFFFF00000000)
{
return ZydisPrintHexU64(buffer, bufferLen, value, paddingLength, uppercase, prefix);
} else
{
return ZydisPrintHexU32(
buffer, bufferLen, (uint32_t)value, paddingLength, uppercase, prefix);
}
#endif
}
ZydisStatus ZydisPrintHexS(char** buffer, size_t bufferLen, int64_t value, uint8_t paddingLength,
ZydisBool uppercase, ZydisBool prefix)
{
if (value < 0)
{
if (prefix)
{
ZYDIS_CHECK(ZydisPrintStr(buffer, bufferLen, "-0x", ZYDIS_LETTER_CASE_DEFAULT));
bufferLen -= 3;
} else
{
ZYDIS_CHECK(ZydisPrintStr(buffer, bufferLen, "-", ZYDIS_LETTER_CASE_DEFAULT));
--bufferLen;
}
return ZydisPrintHexU(buffer, bufferLen, -value, paddingLength, uppercase, ZYDIS_FALSE);
}
return ZydisPrintHexU(buffer, bufferLen, value, paddingLength, uppercase, prefix);
}
/* ---------------------------------------------------------------------------------------------- */
/* ============================================================================================== */

View File

@ -1,199 +0,0 @@
/***************************************************************************************************
Zyan Disassembler Library (Zydis)
Original Author : Florian Bernd, Joel Höner
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
***************************************************************************************************/
#ifndef ZYDIS_FORMATHELPER_H
#define ZYDIS_FORMATHELPER_H
#include <Zydis/Defines.h>
#include <Zydis/Status.h>
#ifdef __cplusplus
extern "C" {
#endif
/* ============================================================================================== */
/* Enums and types */
/* ============================================================================================== */
/* ---------------------------------------------------------------------------------------------- */
/* Letter Case */
/* ---------------------------------------------------------------------------------------------- */
/**
* @brief Defines the `ZydisLetterCase` datatype.
*/
typedef uint8_t ZydisLetterCase;
/**
* @brief Values that represent letter cases.
*/
enum ZydisLetterCases
{
/**
* @brief Prints the given text "as it is".
*/
ZYDIS_LETTER_CASE_DEFAULT,
/**
* @brief Prints the given text in lowercase letters.
*/
ZYDIS_LETTER_CASE_LOWER,
/**
* @brief Prints the given text in uppercase letters.
*/
ZYDIS_LETTER_CASE_UPPER
};
/* ---------------------------------------------------------------------------------------------- */
/* ============================================================================================== */
/* Functions */
/* ============================================================================================== */
/* ---------------------------------------------------------------------------------------------- */
/* String */
/* ---------------------------------------------------------------------------------------------- */
/**
* @brief Appends the given @c text to the @c buffer.
*
* @param buffer A pointer to the string-buffer.
* @param bufferLen The length of the string-buffer.
* @param text The text to append.
* @param letterCase The desired letter-case.
*
* @return @c ZYDIS_STATUS_SUCCESS, if the function succeeded, or
* @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not
* sufficient to append the given @c text.
*
* The string-buffer pointer is increased by the number of chars written, if the call was
* successfull.
*/
ZYDIS_NO_EXPORT ZydisStatus ZydisPrintStr(char** buffer, size_t bufferLen, const char* text,
ZydisLetterCase letterCase);
/* ---------------------------------------------------------------------------------------------- */
/* Decimal values */
/* ---------------------------------------------------------------------------------------------- */
/**
* @brief Formats the given unsigned ordinal @c value to its decimal text-representation and
* appends it to the @c buffer.
*
* @param buffer A pointer to the string-buffer.
* @param bufferLen The length of the string-buffer.
* @param value The value.
* @param paddingLength Padds the converted value with leading zeros, if the number of chars is
* less than the @c paddingLength.
*
* @return @c ZYDIS_STATUS_SUCCESS, if the function succeeded, or
* @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not
* sufficient to append the given @c value.
*
* The string-buffer pointer is increased by the number of chars written, if the call was
* successfull.
*/
ZYDIS_NO_EXPORT ZydisStatus ZydisPrintDecU(char** buffer, size_t bufferLen, uint64_t value,
uint8_t paddingLength);
/**
* @brief Formats the given signed ordinal @c value to its decimal text-representation and
* appends it to the @c buffer.
*
* @param buffer A pointer to the string-buffer.
* @param bufferLen The length of the string-buffer.
* @param value The value.
* @param paddingLength Padds the converted value with leading zeros, if the number of chars is
* less than the @c paddingLength (the sign char is ignored).
*
* @return @c ZYDIS_STATUS_SUCCESS, if the function succeeded, or
* @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not
* sufficient to append the given @c value.
*
* The string-buffer pointer is increased by the number of chars written, if the call was
* successfull.
*/
ZYDIS_NO_EXPORT ZydisStatus ZydisPrintDecS(char** buffer, size_t bufferLen, int64_t value,
uint8_t paddingLength);
/* ---------------------------------------------------------------------------------------------- */
/* Hexadecimal values */
/* ---------------------------------------------------------------------------------------------- */
/**
* @brief Formats the given unsigned ordinal @c value to its hexadecimal text-representation and
* appends it to the @c buffer.
*
* @param buffer A pointer to the string-buffer.
* @param bufferLen The length of the string-buffer.
* @param value The value.
* @param paddingLength Padds the converted value with leading zeros, if the number of chars is
* less than the @c paddingLength.
* @param uppercase Set @c TRUE to print the hexadecimal value in uppercase letters instead
* of lowercase ones.
* @param prefix Set @c TRUE to add the "0x" prefix to the hexadecimal value.
*
* @return @c ZYDIS_STATUS_SUCCESS, if the function succeeded, or
* @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not
* sufficient to append the given @c value.
*
* The string-buffer pointer is increased by the number of chars written, if the call was
* successfull.
*/
ZYDIS_NO_EXPORT ZydisStatus ZydisPrintHexU(char** buffer, size_t bufferLen, uint64_t value,
uint8_t paddingLength, ZydisBool uppercase, ZydisBool prefix);
/**
* @brief Formats the given signed ordinal @c value to its hexadecimal text-representation and
* appends it to the @c buffer.
*
* @param buffer A pointer to the string-buffer.
* @param bufferLen The length of the string-buffer.
* @param value The value.
* @param paddingLength Padds the converted value with leading zeros, if the number of chars is
* less than the @c paddingLength (the sign char is ignored).
* @param uppercase Set @c TRUE to print the hexadecimal value in uppercase letters instead
* of lowercase ones.
* @param prefix Set @c TRUE to add the "0x" prefix to the hexadecimal value.
*
* @return @c ZYDIS_STATUS_SUCCESS, if the function succeeded, or
* @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not
* sufficient to append the given @c value.
*
* The string-buffer pointer is increased by the number of chars written, if the call was
* successfull.
*/
ZYDIS_NO_EXPORT ZydisStatus ZydisPrintHexS(char** buffer, size_t bufferLen, int64_t value,
uint8_t paddingLength, ZydisBool uppercase, ZydisBool prefix);
/* ---------------------------------------------------------------------------------------------- */
/* ============================================================================================== */
#ifdef __cplusplus
}
#endif
#endif /* ZYDIS_FORMATHELPER_H */

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,7 @@
static const char* zydisISAExtStrings[] = static const char* zydisISAExtStrings[] =
{ {
"INVALID", "INVALID",
"ADOX_ADCX",
"AES", "AES",
"AMD", "AMD",
"AMD3DNOW", "AMD3DNOW",
@ -33,15 +34,32 @@ static const char* zydisISAExtStrings[] =
"AVX512_4FMAPS_512", "AVX512_4FMAPS_512",
"AVX512_4FMAPS_SCALAR", "AVX512_4FMAPS_SCALAR",
"AVX512_4VNNIW_512", "AVX512_4VNNIW_512",
"AVX512_BITALG_128",
"AVX512_BITALG_256",
"AVX512_BITALG_512",
"AVX512_GFNI_128",
"AVX512_GFNI_256",
"AVX512_GFNI_512",
"AVX512_IFMA_128", "AVX512_IFMA_128",
"AVX512_IFMA_256", "AVX512_IFMA_256",
"AVX512_IFMA_512", "AVX512_IFMA_512",
"AVX512_VAES_128",
"AVX512_VAES_256",
"AVX512_VAES_512",
"AVX512_VBMI2_128",
"AVX512_VBMI2_256",
"AVX512_VBMI2_512",
"AVX512_VBMI_128", "AVX512_VBMI_128",
"AVX512_VBMI_256", "AVX512_VBMI_256",
"AVX512_VBMI_512", "AVX512_VBMI_512",
"AVX512_VNNI_128",
"AVX512_VNNI_256",
"AVX512_VNNI_512",
"AVX512_VPCLMULQDQ_128",
"AVX512_VPCLMULQDQ_256",
"AVX512_VPCLMULQDQ_512",
"AVX512_VPOPCNTDQ_512", "AVX512_VPOPCNTDQ_512",
"AVXAES", "AVXAES",
"BDW",
"BMI1", "BMI1",
"BMI2", "BMI2",
"CET", "CET",
@ -58,6 +76,7 @@ static const char* zydisISAExtStrings[] =
"FMA4", "FMA4",
"FXSAVE", "FXSAVE",
"FXSAVE64", "FXSAVE64",
"GFNI",
"I186", "I186",
"I286PROTECTED", "I286PROTECTED",
"I286REAL", "I286REAL",
@ -88,6 +107,7 @@ static const char* zydisISAExtStrings[] =
"PREFETCHWT1", "PREFETCHWT1",
"PREFETCH_NOP", "PREFETCH_NOP",
"PT", "PT",
"RDPID",
"RDPMC", "RDPMC",
"RDRAND", "RDRAND",
"RDSEED", "RDSEED",
@ -111,7 +131,9 @@ static const char* zydisISAExtStrings[] =
"SSSE3MMX", "SSSE3MMX",
"SVM", "SVM",
"TBM", "TBM",
"VAES",
"VMFUNC", "VMFUNC",
"VPCLMULQDQ",
"VTX", "VTX",
"X87", "X87",
"XOP", "XOP",

View File

@ -1,6 +1,7 @@
static const char* zydisISASetStrings[] = static const char* zydisISASetStrings[] =
{ {
"INVALID", "INVALID",
"ADOX_ADCX",
"AES", "AES",
"AMD3DNOW", "AMD3DNOW",
"AVX", "AVX",
@ -10,7 +11,6 @@ static const char* zydisISASetStrings[] =
"AVX512VEX", "AVX512VEX",
"AVXAES", "AVXAES",
"BASE", "BASE",
"BDW",
"BMI1", "BMI1",
"BMI2", "BMI2",
"CET", "CET",
@ -21,6 +21,7 @@ static const char* zydisISASetStrings[] =
"F16C", "F16C",
"FMA", "FMA",
"FMA4", "FMA4",
"GFNI",
"INVPCID", "INVPCID",
"KNC", "KNC",
"KNCE", "KNCE",
@ -36,6 +37,7 @@ static const char* zydisISASetStrings[] =
"PKU", "PKU",
"PREFETCHWT1", "PREFETCHWT1",
"PT", "PT",
"RDPID",
"RDRAND", "RDRAND",
"RDSEED", "RDSEED",
"RDTSCP", "RDTSCP",
@ -52,7 +54,9 @@ static const char* zydisISASetStrings[] =
"SSSE3", "SSSE3",
"SVM", "SVM",
"TBM", "TBM",
"VAES",
"VMFUNC", "VMFUNC",
"VPCLMULQDQ",
"VTX", "VTX",
"X87", "X87",
"XOP", "XOP",

View File

@ -1,6 +1,7 @@
static const char* zydisInstructionCategoryStrings[] = static const char* zydisInstructionCategoryStrings[] =
{ {
"INVALID", "INVALID",
"ADOX_ADCX",
"AES", "AES",
"AMD3DNOW", "AMD3DNOW",
"AVX", "AVX",
@ -9,8 +10,8 @@ static const char* zydisInstructionCategoryStrings[] =
"AVX512", "AVX512",
"AVX512_4FMAPS", "AVX512_4FMAPS",
"AVX512_4VNNIW", "AVX512_4VNNIW",
"AVX512_BITALG",
"AVX512_VBMI", "AVX512_VBMI",
"BDW",
"BINARY", "BINARY",
"BITBYTE", "BITBYTE",
"BLEND", "BLEND",
@ -34,6 +35,7 @@ static const char* zydisInstructionCategoryStrings[] =
"FLAGOP", "FLAGOP",
"FMA4", "FMA4",
"GATHER", "GATHER",
"GFNI",
"IFMA", "IFMA",
"INTERRUPT", "INTERRUPT",
"IO", "IO",
@ -56,6 +58,7 @@ static const char* zydisInstructionCategoryStrings[] =
"PREFETCHWT1", "PREFETCHWT1",
"PT", "PT",
"PUSH", "PUSH",
"RDPID",
"RDRAND", "RDRAND",
"RDSEED", "RDSEED",
"RDWRFSGS", "RDWRFSGS",
@ -78,7 +81,10 @@ static const char* zydisInstructionCategoryStrings[] =
"TBM", "TBM",
"UFMA", "UFMA",
"UNCOND_BR", "UNCOND_BR",
"VAES",
"VBMI2",
"VFMA", "VFMA",
"VPCLMULQDQ",
"VTX", "VTX",
"WIDENOP", "WIDENOP",
"X87_ALU", "X87_ALU",

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -40,27 +40,27 @@
const char* ZydisCategoryGetString(ZydisInstructionCategory category) const char* ZydisCategoryGetString(ZydisInstructionCategory category)
{ {
if (category > ZYDIS_ARRAY_SIZE(zydisInstructionCategoryStrings) - 1) if (category >= ZYDIS_ARRAY_SIZE(zydisInstructionCategoryStrings))
{ {
return NULL; return ZYDIS_NULL;
} }
return zydisInstructionCategoryStrings[category]; return zydisInstructionCategoryStrings[category];
} }
const char* ZydisISASetGetString(ZydisISASet isaSet) const char* ZydisISASetGetString(ZydisISASet isaSet)
{ {
if (isaSet > ZYDIS_ARRAY_SIZE(zydisISASetStrings) - 1) if (isaSet >= ZYDIS_ARRAY_SIZE(zydisISASetStrings))
{ {
return NULL; return ZYDIS_NULL;
} }
return zydisISASetStrings[isaSet]; return zydisISASetStrings[isaSet];
} }
const char* ZydisISAExtGetString(ZydisISAExt isaExt) const char* ZydisISAExtGetString(ZydisISAExt isaExt)
{ {
if (isaExt > ZYDIS_ARRAY_SIZE(zydisISAExtStrings) - 1) if (isaExt >= ZYDIS_ARRAY_SIZE(zydisISAExtStrings))
{ {
return NULL; return ZYDIS_NULL;
} }
return zydisISAExtStrings[isaExt]; return zydisISAExtStrings[isaExt];
} }

View File

@ -25,11 +25,6 @@
***************************************************************************************************/ ***************************************************************************************************/
#include <Zydis/Mnemonic.h> #include <Zydis/Mnemonic.h>
/* ============================================================================================== */
/* Mnemonic strings */
/* ============================================================================================== */
#include <Generated/EnumMnemonic.inc> #include <Generated/EnumMnemonic.inc>
/* ============================================================================================== */ /* ============================================================================================== */
@ -38,11 +33,20 @@
const char* ZydisMnemonicGetString(ZydisMnemonic mnemonic) const char* ZydisMnemonicGetString(ZydisMnemonic mnemonic)
{ {
if (mnemonic > ZYDIS_ARRAY_SIZE(zydisMnemonicStrings) - 1) if (mnemonic >= ZYDIS_ARRAY_SIZE(zydisMnemonicStrings))
{ {
return NULL; return ZYDIS_NULL;
} }
return zydisMnemonicStrings[mnemonic]; return (const char*)zydisMnemonicStrings[mnemonic].buffer;
}
const ZydisStaticString* ZydisMnemonicGetStaticString(ZydisMnemonic mnemonic)
{
if (mnemonic >= ZYDIS_ARRAY_SIZE(zydisMnemonicStrings))
{
return ZYDIS_NULL;
}
return &zydisMnemonicStrings[mnemonic];
} }
/* ============================================================================================== */ /* ============================================================================================== */

View File

@ -30,91 +30,156 @@
/* Register strings */ /* Register strings */
/* ============================================================================================== */ /* ============================================================================================== */
const char* registerStrings[] = static const ZydisStaticString registerStrings[] =
{ {
"none", ZYDIS_MAKE_STATIC_STRING("none"),
// General purpose registers 8-bit // General purpose registers 8-bit
"al", "cl", "dl", "bl", ZYDIS_MAKE_STATIC_STRING("al"), ZYDIS_MAKE_STATIC_STRING("cl"),
"ah", "ch", "dh", "bh", ZYDIS_MAKE_STATIC_STRING("dl"), ZYDIS_MAKE_STATIC_STRING("bl"),
"spl", "bpl", "sil", "dil", ZYDIS_MAKE_STATIC_STRING("ah"), ZYDIS_MAKE_STATIC_STRING("ch"),
"r8b", "r9b", "r10b", "r11b", ZYDIS_MAKE_STATIC_STRING("dh"), ZYDIS_MAKE_STATIC_STRING("bh"),
"r12b", "r13b", "r14b", "r15b", 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 // General purpose registers 16-bit
"ax", "cx", "dx", "bx", ZYDIS_MAKE_STATIC_STRING("ax"), ZYDIS_MAKE_STATIC_STRING("cx"),
"sp", "bp", "si", "di", ZYDIS_MAKE_STATIC_STRING("dx"), ZYDIS_MAKE_STATIC_STRING("bx"),
"r8w", "r9w", "r10w", "r11w", ZYDIS_MAKE_STATIC_STRING("sp"), ZYDIS_MAKE_STATIC_STRING("bp"),
"r12w", "r13w", "r14w", "r15w", 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 // General purpose registers 32-bit
"eax", "ecx", "edx", "ebx", ZYDIS_MAKE_STATIC_STRING("eax"), ZYDIS_MAKE_STATIC_STRING("ecx"),
"esp", "ebp", "esi", "edi", ZYDIS_MAKE_STATIC_STRING("edx"), ZYDIS_MAKE_STATIC_STRING("ebx"),
"r8d", "r9d", "r10d", "r11d", ZYDIS_MAKE_STATIC_STRING("esp"), ZYDIS_MAKE_STATIC_STRING("ebp"),
"r12d", "r13d", "r14d", "r15d", ZYDIS_MAKE_STATIC_STRING("esi"), ZYDIS_MAKE_STATIC_STRING("edi"),
// General purpose registers 64-bit ZYDIS_MAKE_STATIC_STRING("r8d"), ZYDIS_MAKE_STATIC_STRING("r9d"),
"rax", "rcx", "rdx", "rbx", ZYDIS_MAKE_STATIC_STRING("r10d"), ZYDIS_MAKE_STATIC_STRING("r11d"),
"rsp", "rbp", "rsi", "rdi", ZYDIS_MAKE_STATIC_STRING("r12d"), ZYDIS_MAKE_STATIC_STRING("r13d"),
"r8", "r9", "r10", "r11", ZYDIS_MAKE_STATIC_STRING("r14d"), ZYDIS_MAKE_STATIC_STRING("r15d"),
"r12", "r13", "r14", "r15", // 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 // Floating point legacy registers
"st0", "st1", "st2", "st3", ZYDIS_MAKE_STATIC_STRING("st0"), ZYDIS_MAKE_STATIC_STRING("st1"),
"st4", "st5", "st6", "st7", 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 // Floating point multimedia registers
"mm0", "mm1", "mm2", "mm3", ZYDIS_MAKE_STATIC_STRING("mm0"), ZYDIS_MAKE_STATIC_STRING("mm1"),
"mm4", "mm5", "mm6", "mm7", ZYDIS_MAKE_STATIC_STRING("mm2"), ZYDIS_MAKE_STATIC_STRING("mm3"),
// Floating point vector registers 512-bit ZYDIS_MAKE_STATIC_STRING("mm4"), ZYDIS_MAKE_STATIC_STRING("mm5"),
"zmm0", "zmm1", "zmm2", "zmm3", ZYDIS_MAKE_STATIC_STRING("mm6"), ZYDIS_MAKE_STATIC_STRING("mm7"),
"zmm4", "zmm5", "zmm6", "zmm7",
"zmm8", "zmm9", "zmm10", "zmm11",
"zmm12", "zmm13", "zmm14", "zmm15",
"zmm16", "zmm17", "zmm18", "zmm19",
"zmm20", "zmm21", "zmm22", "zmm23",
"zmm24", "zmm25", "zmm26", "zmm27",
"zmm28", "zmm29", "zmm30", "zmm31",
// Floating point vector registers 256-bit
"ymm0", "ymm1", "ymm2", "ymm3",
"ymm4", "ymm5", "ymm6", "ymm7",
"ymm8", "ymm9", "ymm10", "ymm11",
"ymm12", "ymm13", "ymm14", "ymm15",
"ymm16", "ymm17", "ymm18", "ymm19",
"ymm20", "ymm21", "ymm22", "ymm23",
"ymm24", "ymm25", "ymm26", "ymm27",
"ymm28", "ymm29", "ymm30", "ymm31",
// Floating point vector registers 128-bit // Floating point vector registers 128-bit
"xmm0", "xmm1", "xmm2", "xmm3", ZYDIS_MAKE_STATIC_STRING("xmm0"), ZYDIS_MAKE_STATIC_STRING("xmm1"),
"xmm4", "xmm5", "xmm6", "xmm7", ZYDIS_MAKE_STATIC_STRING("xmm2"), ZYDIS_MAKE_STATIC_STRING("xmm3"),
"xmm8", "xmm9", "xmm10", "xmm11", ZYDIS_MAKE_STATIC_STRING("xmm4"), ZYDIS_MAKE_STATIC_STRING("xmm5"),
"xmm12", "xmm13", "xmm14", "xmm15", ZYDIS_MAKE_STATIC_STRING("xmm6"), ZYDIS_MAKE_STATIC_STRING("xmm7"),
"xmm16", "xmm17", "xmm18", "xmm19", ZYDIS_MAKE_STATIC_STRING("xmm8"), ZYDIS_MAKE_STATIC_STRING("xmm9"),
"xmm20", "xmm21", "xmm22", "xmm23", ZYDIS_MAKE_STATIC_STRING("xmm10"), ZYDIS_MAKE_STATIC_STRING("xmm11"),
"xmm24", "xmm25", "xmm26", "xmm27", ZYDIS_MAKE_STATIC_STRING("xmm12"), ZYDIS_MAKE_STATIC_STRING("xmm13"),
"xmm28", "xmm29", "xmm30", "xmm31", ZYDIS_MAKE_STATIC_STRING("xmm14"), ZYDIS_MAKE_STATIC_STRING("xmm15"),
// Special registers ZYDIS_MAKE_STATIC_STRING("xmm16"), ZYDIS_MAKE_STATIC_STRING("xmm17"),
"rflags", "eflags", "flags", "rip", ZYDIS_MAKE_STATIC_STRING("xmm18"), ZYDIS_MAKE_STATIC_STRING("xmm19"),
"eip", "ip", "mxcsr", "pkru", ZYDIS_MAKE_STATIC_STRING("xmm20"), ZYDIS_MAKE_STATIC_STRING("xmm21"),
"xcr0", 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 // Segment registers
"es", "cs", "ss", "ds", ZYDIS_MAKE_STATIC_STRING("es"), ZYDIS_MAKE_STATIC_STRING("cs"),
"fs", "gs", ZYDIS_MAKE_STATIC_STRING("ss"), ZYDIS_MAKE_STATIC_STRING("ds"),
ZYDIS_MAKE_STATIC_STRING("fs"), ZYDIS_MAKE_STATIC_STRING("gs"),
// Table registers // Table registers
"gdtr", "ldtr", "idtr", "tr", ZYDIS_MAKE_STATIC_STRING("gdtr"), ZYDIS_MAKE_STATIC_STRING("ldtr"),
ZYDIS_MAKE_STATIC_STRING("idtr"), ZYDIS_MAKE_STATIC_STRING("tr"),
// Test registers // Test registers
"tr0", "tr1", "tr2", "tr3", ZYDIS_MAKE_STATIC_STRING("tr0"), ZYDIS_MAKE_STATIC_STRING("tr1"),
"tr4", "tr5", "tr6", "tr7", 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 // Control registers
"cr0", "cr1", "cr2", "cr3", ZYDIS_MAKE_STATIC_STRING("cr0"), ZYDIS_MAKE_STATIC_STRING("cr1"),
"cr4", "cr5", "cr6", "cr7", ZYDIS_MAKE_STATIC_STRING("cr2"), ZYDIS_MAKE_STATIC_STRING("cr3"),
"cr8", "cr9", "cr10", "cr11", ZYDIS_MAKE_STATIC_STRING("cr4"), ZYDIS_MAKE_STATIC_STRING("cr5"),
"cr12", "cr13", "cr14", "cr15", 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 // Debug registers
"dr0", "dr1", "dr2", "dr3", ZYDIS_MAKE_STATIC_STRING("dr0"), ZYDIS_MAKE_STATIC_STRING("dr1"),
"dr4", "dr5", "dr6", "dr7", ZYDIS_MAKE_STATIC_STRING("dr2"), ZYDIS_MAKE_STATIC_STRING("dr3"),
"dr8", "dr9", "dr10", "dr11", ZYDIS_MAKE_STATIC_STRING("dr4"), ZYDIS_MAKE_STATIC_STRING("dr5"),
"dr12", "dr13", "dr14", "dr15", 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 // Mask registers
"k0", "k1", "k2", "k3", ZYDIS_MAKE_STATIC_STRING("k0"), ZYDIS_MAKE_STATIC_STRING("k1"),
"k4", "k5", "k6", "k7", ZYDIS_MAKE_STATIC_STRING("k2"), ZYDIS_MAKE_STATIC_STRING("k3"),
// Bounds registers ZYDIS_MAKE_STATIC_STRING("k4"), ZYDIS_MAKE_STATIC_STRING("k5"),
"bnd0", "bnd1", "bnd2", "bnd3", ZYDIS_MAKE_STATIC_STRING("k6"), ZYDIS_MAKE_STATIC_STRING("k7"),
"bndcfg", "bndstatus" // 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")
}; };
/* ============================================================================================== */ /* ============================================================================================== */
@ -152,13 +217,13 @@ static const struct ZydisRegisterMapItem registerMap[] =
{ ZYDIS_REGCLASS_BOUND , ZYDIS_REGISTER_BND0 , ZYDIS_REGISTER_BND3 , 128 , 128 } { ZYDIS_REGCLASS_BOUND , ZYDIS_REGISTER_BND0 , ZYDIS_REGISTER_BND3 , 128 , 128 }
}; };
static const uint8_t registerMapCount = sizeof(registerMap) / sizeof(struct ZydisRegisterMapItem); static const ZydisU8 registerMapCount = sizeof(registerMap) / sizeof(struct ZydisRegisterMapItem);
/* ============================================================================================== */ /* ============================================================================================== */
/* Exported functions */ /* Exported functions */
/* ============================================================================================== */ /* ============================================================================================== */
ZydisRegister ZydisRegisterEncode(ZydisRegisterClass registerClass, uint8_t id) ZydisRegister ZydisRegisterEncode(ZydisRegisterClass registerClass, ZydisU8 id)
{ {
switch (registerClass) switch (registerClass)
{ {
@ -176,7 +241,7 @@ ZydisRegister ZydisRegisterEncode(ZydisRegisterClass registerClass, uint8_t id)
return ZYDIS_REGISTER_NONE; return ZYDIS_REGISTER_NONE;
} }
int16_t ZydisRegisterGetId(ZydisRegister reg) ZydisI16 ZydisRegisterGetId(ZydisRegister reg)
{ {
for (unsigned i = 0; i < registerMapCount; ++i) for (unsigned i = 0; i < registerMapCount; ++i)
{ {
@ -268,11 +333,20 @@ ZydisRegisterWidth ZydisRegisterGetWidth64(ZydisRegister reg)
const char* ZydisRegisterGetString(ZydisRegister reg) const char* ZydisRegisterGetString(ZydisRegister reg)
{ {
if (reg > (sizeof(registerStrings) / sizeof(registerStrings[0])) - 1) if (reg >= ZYDIS_ARRAY_SIZE(registerStrings))
{ {
return NULL; return ZYDIS_NULL;
} }
return registerStrings[reg]; return registerStrings[reg].buffer;
}
const ZydisStaticString* ZydisRegisterGetStaticString(ZydisRegister reg)
{
if (reg >= ZYDIS_ARRAY_SIZE(registerStrings))
{
return ZYDIS_NULL;
}
return &registerStrings[reg];
} }
/* ============================================================================================== */ /* ============================================================================================== */

View File

@ -24,7 +24,7 @@
***************************************************************************************************/ ***************************************************************************************************/
#include <SharedData.h> #include <Zydis/Internal/SharedData.h>
/* ============================================================================================== */ /* ============================================================================================== */
/* Data tables */ /* Data tables */
@ -61,15 +61,19 @@ extern const ZydisInstructionDefinitionXOP instructionDefinitionsXOP[];
*/ */
extern const ZydisInstructionDefinitionVEX instructionDefinitionsVEX[]; extern const ZydisInstructionDefinitionVEX instructionDefinitionsVEX[];
#ifndef ZYDIS_DISABLE_EVEX
/** /**
* @brief Contains all instruction-definitions with @c EVEX encoding. * @brief Contains all instruction-definitions with @c EVEX encoding.
*/ */
extern const ZydisInstructionDefinitionEVEX instructionDefinitionsEVEX[]; extern const ZydisInstructionDefinitionEVEX instructionDefinitionsEVEX[];
#endif
#ifndef ZYDIS_DISABLE_MVEX
/** /**
* @brief Contains all instruction-definitions with @c MVEX encoding. * @brief Contains all instruction-definitions with @c MVEX encoding.
*/ */
extern const ZydisInstructionDefinitionMVEX instructionDefinitionsMVEX[]; extern const ZydisInstructionDefinitionMVEX instructionDefinitionsMVEX[];
#endif
/* ---------------------------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------------------------- */
/* Instruction definitions */ /* Instruction definitions */
@ -104,7 +108,7 @@ extern const ZydisInstructionDefinitionMVEX instructionDefinitionsMVEX[];
/* Instruction definition */ /* Instruction definition */
/* ---------------------------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------------------------- */
void ZydisGetInstructionDefinition(ZydisInstructionEncoding encoding, uint16_t id, void ZydisGetInstructionDefinition(ZydisInstructionEncoding encoding, ZydisU16 id,
const ZydisInstructionDefinition** definition) const ZydisInstructionDefinition** definition)
{ {
switch (encoding) switch (encoding)
@ -121,12 +125,16 @@ void ZydisGetInstructionDefinition(ZydisInstructionEncoding encoding, uint16_t i
case ZYDIS_INSTRUCTION_ENCODING_VEX: case ZYDIS_INSTRUCTION_ENCODING_VEX:
*definition = (ZydisInstructionDefinition*)&instructionDefinitionsVEX[id]; *definition = (ZydisInstructionDefinition*)&instructionDefinitionsVEX[id];
break; break;
#ifndef ZYDIS_DISABLE_EVEX
case ZYDIS_INSTRUCTION_ENCODING_EVEX: case ZYDIS_INSTRUCTION_ENCODING_EVEX:
*definition = (ZydisInstructionDefinition*)&instructionDefinitionsEVEX[id]; *definition = (ZydisInstructionDefinition*)&instructionDefinitionsEVEX[id];
break; break;
#endif
#ifndef ZYDIS_DISABLE_MVEX
case ZYDIS_INSTRUCTION_ENCODING_MVEX: case ZYDIS_INSTRUCTION_ENCODING_MVEX:
*definition = (ZydisInstructionDefinition*)&instructionDefinitionsMVEX[id]; *definition = (ZydisInstructionDefinition*)&instructionDefinitionsMVEX[id];
break; break;
#endif
default: default:
ZYDIS_UNREACHABLE; ZYDIS_UNREACHABLE;
} }
@ -136,12 +144,12 @@ void ZydisGetInstructionDefinition(ZydisInstructionEncoding encoding, uint16_t i
/* Operand definition */ /* Operand definition */
/* ---------------------------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------------------------- */
uint8_t ZydisGetOperandDefinitions(const ZydisInstructionDefinition* definition, ZydisU8 ZydisGetOperandDefinitions(const ZydisInstructionDefinition* definition,
const ZydisOperandDefinition** operand) const ZydisOperandDefinition** operand)
{ {
if (definition->operandCount == 0) if (definition->operandCount == 0)
{ {
*operand = NULL; *operand = ZYDIS_NULL;
return 0; return 0;
} }
ZYDIS_ASSERT(definition->operandReference != 0xFFFF); ZYDIS_ASSERT(definition->operandReference != 0xFFFF);

416
src/String.c Normal file
View File

@ -0,0 +1,416 @@
/***************************************************************************************************
Zyan Disassembler Library (Zydis)
Original Author : Florian Bernd, Joel Höner
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
***************************************************************************************************/
#include <Zydis/String.h>
/* ============================================================================================== */
/* Constants */
/* ============================================================================================== */
/* ---------------------------------------------------------------------------------------------- */
/* Defines */
/* ---------------------------------------------------------------------------------------------- */
#define ZYDIS_MAXCHARS_DEC_32 10
#define ZYDIS_MAXCHARS_DEC_64 20
#define ZYDIS_MAXCHARS_HEX_32 8
#define ZYDIS_MAXCHARS_HEX_64 16
/* ---------------------------------------------------------------------------------------------- */
/* Lookup Tables */
/* ---------------------------------------------------------------------------------------------- */
static const char* decimalLookup =
"00010203040506070809"
"10111213141516171819"
"20212223242526272829"
"30313233343536373839"
"40414243444546474849"
"50515253545556575859"
"60616263646566676869"
"70717273747576777879"
"80818283848586878889"
"90919293949596979899";
/* ---------------------------------------------------------------------------------------------- */
/* ============================================================================================== */
/* Internal Functions */
/* ============================================================================================== */
/* ---------------------------------------------------------------------------------------------- */
/* Formatting */
/* ---------------------------------------------------------------------------------------------- */
#if defined(ZYDIS_X86) || defined(ZYDIS_ARM)
ZydisStatus ZydisPrintDecU32(ZydisString* string, ZydisU32 value, ZydisU8 paddingLength)
{
ZYDIS_ASSERT(string);
ZYDIS_ASSERT(string->buffer);
char temp[ZYDIS_MAXCHARS_DEC_32 + 1];
char *p = &temp[ZYDIS_MAXCHARS_DEC_32];
while (value >= 100)
{
ZydisU32 const old = value;
p -= 2;
value /= 100;
ZydisMemoryCopy(p, &decimalLookup[(old - (value * 100)) * 2], sizeof(ZydisU16));
}
p -= 2;
ZydisMemoryCopy(p, &decimalLookup[value * 2], sizeof(ZydisU16));
const ZydisUSize n = &temp[ZYDIS_MAXCHARS_DEC_32] - p;
if ((string->capacity - string->length < (ZydisUSize)(n + 1)) ||
(string->capacity - string->length < (ZydisUSize)(paddingLength + 1)))
{
return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE;
}
ZydisUSize offset = 0;
if (n <= paddingLength)
{
offset = paddingLength - n + 1;
ZydisMemorySet(string->buffer + string->length, '0', offset);
}
ZydisMemoryCopy(string->buffer + string->length + offset, &p[value < 10], n + 1);
string->length += n + offset - (ZydisU8)(value < 10);
return ZYDIS_STATUS_SUCCESS;
}
ZydisStatus ZydisPrintHexU32(ZydisString* string, ZydisU32 value, ZydisU8 paddingLength,
ZydisBool uppercase, const ZydisString* prefix, const ZydisString* suffix)
{
ZYDIS_ASSERT(string);
ZYDIS_ASSERT(string->buffer);
if (prefix)
{
ZYDIS_CHECK(ZydisStringAppend(string, prefix));
}
char* buffer = string->buffer + string->length;
const ZydisUSize remaining = string->capacity - string->length;
if (remaining < (ZydisUSize)paddingLength)
{
return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE;
}
if (!value)
{
const ZydisU8 n = (paddingLength ? paddingLength : 1);
if (remaining < (ZydisUSize)n)
{
return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE;
}
ZydisMemorySet(buffer, '0', n);
string->length += n;
return ZYDIS_STATUS_SUCCESS;
}
ZydisU8 n = 0;
for (ZydisI8 i = ZYDIS_MAXCHARS_HEX_32 - 1; i >= 0; --i)
{
const ZydisU8 v = (value >> i * 4) & 0x0F;
if (!n)
{
if (!v)
{
continue;
}
if (remaining <= (ZydisU8)(i + 1)) // TODO: +1?
{
return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE;
}
if (paddingLength > i)
{
n = paddingLength - i - 1;
ZydisMemorySet(buffer, '0', n);
}
}
if (uppercase)
{
buffer[n++] = "0123456789ABCDEF"[v];
} else
{
buffer[n++] = "0123456789abcdef"[v];
}
}
string->length += n;
if (suffix)
{
ZYDIS_CHECK(ZydisStringAppend(string, suffix));
}
return ZYDIS_STATUS_SUCCESS;
}
#endif
ZydisStatus ZydisPrintDecU64(ZydisString* string, ZydisU64 value, ZydisU8 paddingLength)
{
ZYDIS_ASSERT(string);
ZYDIS_ASSERT(string->buffer);
char temp[ZYDIS_MAXCHARS_DEC_64 + 1];
char *p = &temp[ZYDIS_MAXCHARS_DEC_64];
while (value >= 100)
{
ZydisU64 const old = value;
p -= 2;
value /= 100;
ZydisMemoryCopy(p, &decimalLookup[(old - (value * 100)) * 2], 2);
}
p -= 2;
ZydisMemoryCopy(p, &decimalLookup[value * 2], sizeof(ZydisU16));
const ZydisUSize n = &temp[ZYDIS_MAXCHARS_DEC_64] - p;
if ((string->capacity - string->length < (ZydisUSize)(n + 1)) ||
(string->capacity - string->length < (ZydisUSize)(paddingLength + 1)))
{
return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE;
}
ZydisUSize offset = 0;
if (n <= paddingLength)
{
offset = paddingLength - n + 1;
ZydisMemorySet(string->buffer + string->length, '0', offset);
}
ZydisMemoryCopy(string->buffer + string->length + offset, &p[value < 10], n + 1);
string->length += n + offset - (ZydisU8)(value < 10);
return ZYDIS_STATUS_SUCCESS;
}
ZydisStatus ZydisPrintHexU64(ZydisString* string, ZydisU64 value, ZydisU8 paddingLength,
ZydisBool uppercase, const ZydisString* prefix, const ZydisString* suffix)
{
ZYDIS_ASSERT(string);
ZYDIS_ASSERT(string->buffer);
if (prefix)
{
ZYDIS_CHECK(ZydisStringAppend(string, prefix));
}
char* buffer = string->buffer + string->length;
const ZydisUSize remaining = string->capacity - string->length;
if (remaining < (ZydisUSize)paddingLength)
{
return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE;
}
if (!value)
{
const ZydisU8 n = (paddingLength ? paddingLength : 1);
if (remaining < (ZydisUSize)n)
{
return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE;
}
ZydisMemorySet(buffer, '0', n);
string->length += n;
return ZYDIS_STATUS_SUCCESS;
}
ZydisU8 n = 0;
const ZydisU8 c =
((value & 0xFFFFFFFF00000000) ? ZYDIS_MAXCHARS_HEX_64 : ZYDIS_MAXCHARS_HEX_32);
for (ZydisI8 i = c - 1; i >= 0; --i)
{
const ZydisU8 v = (value >> i * 4) & 0x0F;
if (!n)
{
if (!v)
{
continue;
}
if (remaining <= (ZydisU8)(i + 1)) // TODO: +1?
{
return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE;
}
if (paddingLength > i)
{
n = paddingLength - i - 1;
ZydisMemorySet(buffer, '0', n);
}
}
if (uppercase)
{
buffer[n++] = "0123456789ABCDEF"[v];
} else
{
buffer[n++] = "0123456789abcdef"[v];
}
}
string->length += n;
if (suffix)
{
ZYDIS_CHECK(ZydisStringAppend(string, suffix));
}
return ZYDIS_STATUS_SUCCESS;
}
/* ---------------------------------------------------------------------------------------------- */
/* ============================================================================================== */
/* Public Functions */
/* ============================================================================================== */
/* ---------------------------------------------------------------------------------------------- */
/* Basic Operations */
/* ---------------------------------------------------------------------------------------------- */
ZydisStatus ZydisStringAppendEx(ZydisString* string, const ZydisString* text,
ZydisLetterCase letterCase)
{
if (!string || !text)
{
return ZYDIS_STATUS_INVALID_PARAMETER;
}
if (string->length + text->length >= string->capacity)
{
return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE;
}
ZydisMemoryCopy(string->buffer + string->length, text->buffer, text->length);
switch (letterCase)
{
case ZYDIS_LETTER_CASE_DEFAULT:
break;
case ZYDIS_LETTER_CASE_LOWER:
{
const signed char rebase = 'a' - 'A';
char* c = string->buffer + string->length;
for (ZydisUSize i = 0; i < text->length; ++i)
{
if ((*c >= 'A') && (*c <= 'Z'))
{
*c += rebase;
}
++c;
}
break;
}
case ZYDIS_LETTER_CASE_UPPER:
{
const signed char rebase = 'A' - 'a';
char* c = string->buffer + string->length;
for (ZydisUSize i = 0; i < text->length; ++i)
{
if ((*c >= 'a') && (*c <= 'z'))
{
*c += rebase;
}
++c;
}
break;
}
default:
return ZYDIS_STATUS_INVALID_PARAMETER;
}
string->length += text->length;
return ZYDIS_STATUS_SUCCESS;
}
/* ---------------------------------------------------------------------------------------------- */
/* Formatting */
/* ---------------------------------------------------------------------------------------------- */
ZydisStatus ZydisPrintDecU(ZydisString* string, ZydisU64 value, ZydisU8 paddingLength)
{
#if defined(ZYDIS_X64) || defined(ZYDIS_AARCH64)
return ZydisPrintDecU64(string, value, paddingLength);
#else
if (value & 0xFFFFFFFF00000000)
{
return ZydisPrintDecU64(string, value, paddingLength);
} else
{
return ZydisPrintDecU32(string, (ZydisU32)value, paddingLength);
}
#endif
}
ZydisStatus ZydisPrintDecS(ZydisString* string, ZydisI64 value, ZydisU8 paddingLength)
{
if (value < 0)
{
ZYDIS_CHECK(ZydisStringAppendC(string, "-"));
return ZydisPrintDecU(string, -value, paddingLength);
}
return ZydisPrintDecU(string, value, paddingLength);
}
ZydisStatus ZydisPrintHexU(ZydisString* string, ZydisU64 value, ZydisU8 paddingLength,
ZydisBool uppercase, const ZydisString* prefix, const ZydisString* suffix)
{
#if defined(ZYDIS_X64) || defined(ZYDIS_AARCH64)
return ZydisPrintHexU64(string, value, paddingLength, uppercase, prefix, suffix);
#else
if (value & 0xFFFFFFFF00000000)
{
return ZydisPrintHexU64(string, value, paddingLength, uppercase, prefix, suffix);
} else
{
return ZydisPrintHexU32(string, (ZydisU32)value, paddingLength, uppercase, prefix, suffix);
}
#endif
}
ZydisStatus ZydisPrintHexS(ZydisString* string, ZydisI64 value, ZydisU8 paddingLength,
ZydisBool uppercase, const ZydisString* prefix, const ZydisString* suffix)
{
if (value < 0)
{
ZYDIS_CHECK(ZydisStringAppendC(string, "-"));
if (prefix)
{
ZYDIS_CHECK(ZydisStringAppend(string, prefix));
}
return ZydisPrintHexU(string, -value, paddingLength, uppercase, ZYDIS_NULL, suffix);
}
return ZydisPrintHexU(string, value, paddingLength, uppercase, prefix, suffix);
}
/* ---------------------------------------------------------------------------------------------- */
/* ============================================================================================== */

View File

@ -35,7 +35,7 @@
/* ---------------------------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------------------------- */
ZydisStatus ZydisCalcAbsoluteAddress(const ZydisDecodedInstruction* instruction, ZydisStatus ZydisCalcAbsoluteAddress(const ZydisDecodedInstruction* instruction,
const ZydisDecodedOperand* operand, uint64_t* address) const ZydisDecodedOperand* operand, ZydisU64* address)
{ {
if (!instruction || !operand || !address) if (!instruction || !operand || !address)
{ {
@ -50,13 +50,14 @@ ZydisStatus ZydisCalcAbsoluteAddress(const ZydisDecodedInstruction* instruction,
} }
if (operand->mem.base == ZYDIS_REGISTER_EIP) if (operand->mem.base == ZYDIS_REGISTER_EIP)
{ {
*address = *address = (ZydisU64)((ZydisU32)instruction->instrAddress + instruction->length +
(uint64_t)((uint32_t)instruction->instrPointer + (uint32_t)operand->mem.disp.value); (ZydisU32)operand->mem.disp.value);
return ZYDIS_STATUS_SUCCESS; return ZYDIS_STATUS_SUCCESS;
} }
if (operand->mem.base == ZYDIS_REGISTER_RIP) if (operand->mem.base == ZYDIS_REGISTER_RIP)
{ {
*address = (uint64_t)(instruction->instrPointer + operand->mem.disp.value); *address = (ZydisU64)(instruction->instrAddress + instruction->length +
operand->mem.disp.value);
return ZYDIS_STATUS_SUCCESS; return ZYDIS_STATUS_SUCCESS;
} }
if ((operand->mem.base == ZYDIS_REGISTER_NONE) && if ((operand->mem.base == ZYDIS_REGISTER_NONE) &&
@ -65,13 +66,13 @@ ZydisStatus ZydisCalcAbsoluteAddress(const ZydisDecodedInstruction* instruction,
switch (instruction->addressWidth) switch (instruction->addressWidth)
{ {
case 16: case 16:
*address = (uint64_t)operand->mem.disp.value & 0x000000000000FFFF; *address = (ZydisU64)operand->mem.disp.value & 0x000000000000FFFF;
return ZYDIS_STATUS_SUCCESS; return ZYDIS_STATUS_SUCCESS;
case 32: case 32:
*address = (uint64_t)operand->mem.disp.value & 0x00000000FFFFFFFF; *address = (ZydisU64)operand->mem.disp.value & 0x00000000FFFFFFFF;
return ZYDIS_STATUS_SUCCESS; return ZYDIS_STATUS_SUCCESS;
case 64: case 64:
*address = (uint64_t)operand->mem.disp.value; *address = (ZydisU64)operand->mem.disp.value;
return ZYDIS_STATUS_SUCCESS; return ZYDIS_STATUS_SUCCESS;
default: default:
return ZYDIS_STATUS_INVALID_PARAMETER; return ZYDIS_STATUS_INVALID_PARAMETER;
@ -81,17 +82,21 @@ ZydisStatus ZydisCalcAbsoluteAddress(const ZydisDecodedInstruction* instruction,
case ZYDIS_OPERAND_TYPE_IMMEDIATE: case ZYDIS_OPERAND_TYPE_IMMEDIATE:
if (operand->imm.isSigned && operand->imm.isRelative) if (operand->imm.isSigned && operand->imm.isRelative)
{ {
*address = (uint64_t)((int64_t)instruction->instrPointer + operand->imm.value.s); *address = (ZydisU64)((ZydisI64)instruction->instrAddress + instruction->length +
operand->imm.value.s);
switch (instruction->machineMode) switch (instruction->machineMode)
{ {
case 16: case ZYDIS_MACHINE_MODE_LONG_COMPAT_16:
case 32: case ZYDIS_MACHINE_MODE_LEGACY_16:
case ZYDIS_MACHINE_MODE_REAL_16:
case ZYDIS_MACHINE_MODE_LONG_COMPAT_32:
case ZYDIS_MACHINE_MODE_LEGACY_32:
if (operand->size == 16) if (operand->size == 16)
{ {
*address &= 0xFFFF; *address &= 0xFFFF;
} }
break; break;
case 64: case ZYDIS_MACHINE_MODE_LONG_64:
break; break;
default: default:
return ZYDIS_STATUS_INVALID_PARAMETER; return ZYDIS_STATUS_INVALID_PARAMETER;
@ -123,7 +128,7 @@ ZydisStatus ZydisGetAccessedFlagsByAction(const ZydisDecodedInstruction* instruc
return ZYDIS_STATUS_INVALID_PARAMETER; return ZYDIS_STATUS_INVALID_PARAMETER;
} }
*flags = 0; *flags = 0;
for (uint8_t i = 0; i < ZYDIS_ARRAY_SIZE(instruction->accessedFlags); ++i) for (ZydisU8 i = 0; i < ZYDIS_ARRAY_SIZE(instruction->accessedFlags); ++i)
{ {
if (instruction->accessedFlags[i].action == action) if (instruction->accessedFlags[i].action == action)
{ {

View File

@ -30,7 +30,7 @@
/* Exported functions */ /* Exported functions */
/* ============================================================================================== */ /* ============================================================================================== */
uint64_t ZydisGetVersion() ZydisU64 ZydisGetVersion(void)
{ {
return ZYDIS_VERSION; return ZYDIS_VERSION;
} }
@ -40,33 +40,22 @@ ZydisBool ZydisIsFeatureEnabled(ZydisFeature feature)
switch (feature) switch (feature)
{ {
case ZYDIS_FEATURE_EVEX: case ZYDIS_FEATURE_EVEX:
#ifdef ZYDIS_ENABLE_FEATURE_EVEX #ifndef ZYDIS_DISABLE_EVEX
return ZYDIS_TRUE; return ZYDIS_TRUE;
#else #else
return ZYDIS_FALSE; return ZYDIS_FALSE;
#endif #endif
case ZYDIS_FEATURE_MVEX: case ZYDIS_FEATURE_MVEX:
#ifdef ZYDIS_ENABLE_FEATURE_MVEX #ifndef ZYDIS_DISABLE_MVEX
return ZYDIS_TRUE;
#else
return ZYDIS_FALSE;
#endif
case ZYDIS_FEATURE_FLAGS:
#ifdef ZYDIS_ENABLE_FEATURE_FLAGS
return ZYDIS_TRUE;
#else
return ZYDIS_FALSE;
#endif
case ZYDIS_FEATURE_CPUID:
#ifdef ZYDIS_ENABLE_FEATURE_CPUID
return ZYDIS_TRUE; return ZYDIS_TRUE;
#else #else
return ZYDIS_FALSE; return ZYDIS_FALSE;
#endif #endif
default: default:
break; return ZYDIS_FALSE;
} }
return ZYDIS_FALSE;
} }
/* ============================================================================================== */ /* ============================================================================================== */

View File

@ -67,9 +67,11 @@ int main(int argc, char** argv)
} }
ZydisFormatter formatter; ZydisFormatter formatter;
if (!ZYDIS_SUCCESS(ZydisFormatterInitEx(&formatter, ZYDIS_FORMATTER_STYLE_INTEL, if (!ZYDIS_SUCCESS(ZydisFormatterInit(&formatter, ZYDIS_FORMATTER_STYLE_INTEL)) ||
ZYDIS_FMTFLAG_FORCE_SEGMENTS | ZYDIS_FMTFLAG_FORCE_OPERANDSIZE, !ZYDIS_SUCCESS(ZydisFormatterSetProperty(&formatter,
ZYDIS_FORMATTER_ADDR_ABSOLUTE, ZYDIS_FORMATTER_DISP_DEFAULT, ZYDIS_FORMATTER_IMM_DEFAULT))) ZYDIS_FORMATTER_PROP_FORCE_MEMSEG, ZYDIS_TRUE)) ||
!ZYDIS_SUCCESS(ZydisFormatterSetProperty(&formatter,
ZYDIS_FORMATTER_PROP_FORCE_MEMSIZE, ZYDIS_TRUE)))
{ {
fputs("Failed to initialized instruction-formatter\n", stderr); fputs("Failed to initialized instruction-formatter\n", stderr);
return EXIT_FAILURE; return EXIT_FAILURE;

View File

@ -26,9 +26,11 @@
/** /**
* @file * @file
* @brief TODO * @brief Disassembles a given hex-buffer and prints detailed information about the decoded
* instruction, the operands and additional attributes.
*/ */
#include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <inttypes.h> #include <inttypes.h>
#include <string.h> #include <string.h>
@ -155,6 +157,13 @@ void printOperands(ZydisDecodedInstruction* instruction)
"JIMM32_32_64", "JIMM32_32_64",
"JIMM16_32_32" "JIMM16_32_32"
}; };
static const char* memopTypes[] =
{
"INVALID",
"MEM",
"AGEN",
"MIB"
};
printf("%2d %9s %10s %6s %12s %5d %4d %6d %8s", printf("%2d %9s %10s %6s %12s %5d %4d %6d %8s",
i, i,
operandTypes[instruction->operands[i].type], operandTypes[instruction->operands[i].type],
@ -171,7 +180,9 @@ void printOperands(ZydisDecodedInstruction* instruction)
printf(" %27s", ZydisRegisterGetString(instruction->operands[i].reg.value)); printf(" %27s", ZydisRegisterGetString(instruction->operands[i].reg.value));
break; break;
case ZYDIS_OPERAND_TYPE_MEMORY: case ZYDIS_OPERAND_TYPE_MEMORY:
printf(" SEG =%20s\n", ZydisRegisterGetString(instruction->operands[i].mem.segment)); printf(" TYPE =%20s\n", memopTypes[instruction->operands[i].mem.type]);
printf(" %84s =%20s\n",
"SEG ", ZydisRegisterGetString(instruction->operands[i].mem.segment));
printf(" %84s =%20s\n", printf(" %84s =%20s\n",
"BASE ", ZydisRegisterGetString(instruction->operands[i].mem.base)); "BASE ", ZydisRegisterGetString(instruction->operands[i].mem.base));
printf(" %84s =%20s\n", printf(" %84s =%20s\n",
@ -536,10 +547,17 @@ void printInstruction(ZydisDecodedInstruction* instruction)
printAVXInfo(instruction); printAVXInfo(instruction);
} }
ZydisStatus status;
ZydisFormatter formatter; ZydisFormatter formatter;
ZydisFormatterInitEx(&formatter, ZYDIS_FORMATTER_STYLE_INTEL, if (!ZYDIS_SUCCESS((status = ZydisFormatterInit(&formatter, ZYDIS_FORMATTER_STYLE_INTEL))) ||
ZYDIS_FMTFLAG_FORCE_SEGMENTS | ZYDIS_FMTFLAG_FORCE_OPERANDSIZE, !ZYDIS_SUCCESS((status = ZydisFormatterSetProperty(&formatter,
ZYDIS_FORMATTER_ADDR_ABSOLUTE, ZYDIS_FORMATTER_DISP_DEFAULT, ZYDIS_FORMATTER_IMM_DEFAULT); ZYDIS_FORMATTER_PROP_FORCE_MEMSEG, ZYDIS_TRUE))) ||
!ZYDIS_SUCCESS((status = ZydisFormatterSetProperty(&formatter,
ZYDIS_FORMATTER_PROP_FORCE_MEMSIZE, ZYDIS_TRUE))))
{
fputs("Failed to initialize instruction-formatter\n", stderr);
exit(status);
}
char buffer[256]; char buffer[256];
ZydisFormatterFormatInstruction(&formatter, instruction, &buffer[0], sizeof(buffer)); ZydisFormatterFormatInstruction(&formatter, instruction, &buffer[0], sizeof(buffer));
fputs("\n== [ DISASM ] =====================================================", stdout); fputs("\n== [ DISASM ] =====================================================", stdout);
@ -561,11 +579,15 @@ int main(int argc, char** argv)
if (argc < 3) if (argc < 3)
{ {
fputs("Usage: ZydisInfo -[16|32|64] [hexbytes]\n", stderr); fputs("Usage: ZydisInfo -[real|16|32|64] [hexbytes]\n", stderr);
return ZYDIS_STATUS_INVALID_PARAMETER; return ZYDIS_STATUS_INVALID_PARAMETER;
} }
ZydisDecoder decoder; ZydisDecoder decoder;
if (!strcmp(argv[1], "-real"))
{
ZydisDecoderInit(&decoder, ZYDIS_MACHINE_MODE_REAL_16, ZYDIS_ADDRESS_WIDTH_16);
} else
if (!strcmp(argv[1], "-16")) if (!strcmp(argv[1], "-16"))
{ {
ZydisDecoderInit(&decoder, ZYDIS_MACHINE_MODE_LONG_COMPAT_16, ZYDIS_ADDRESS_WIDTH_16); ZydisDecoderInit(&decoder, ZYDIS_MACHINE_MODE_LONG_COMPAT_16, ZYDIS_ADDRESS_WIDTH_16);
@ -579,7 +601,7 @@ int main(int argc, char** argv)
ZydisDecoderInit(&decoder, ZYDIS_MACHINE_MODE_LONG_64, ZYDIS_ADDRESS_WIDTH_64); ZydisDecoderInit(&decoder, ZYDIS_MACHINE_MODE_LONG_64, ZYDIS_ADDRESS_WIDTH_64);
} else } else
{ {
fputs("Usage: ZydisInfo -[16|32|64] [hexbytes]\n", stderr); fputs("Usage: ZydisInfo -[real|16|32|64] [hexbytes]\n", stderr);
return ZYDIS_STATUS_INVALID_PARAMETER; return ZYDIS_STATUS_INVALID_PARAMETER;
} }