/***************************************************************************************************12Zyan Disassembler Library (Zydis)34Original Author : Florian Bernd56* Permission is hereby granted, free of charge, to any person obtaining a copy7* of this software and associated documentation files (the "Software"), to deal8* in the Software without restriction, including without limitation the rights9* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell10* copies of the Software, and to permit persons to whom the Software is11* furnished to do so, subject to the following conditions:12*13* The above copyright notice and this permission notice shall be included in all14* copies or substantial portions of the Software.15*16* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR17* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,18* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE19* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER20* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,21* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE22* SOFTWARE.2324***************************************************************************************************/2526/**27* @file28* Master include file. Includes everything else.29*/3031#ifndef ZYDIS_H32#define ZYDIS_H3334#include <Zycore/Defines.h>35#include <Zycore/Types.h>3637#if !defined(ZYDIS_DISABLE_DECODER)38# include <Zydis/Decoder.h>39# include <Zydis/DecoderTypes.h>40#endif4142#if !defined(ZYDIS_DISABLE_ENCODER)43# include <Zydis/Encoder.h>44#endif4546#if !defined(ZYDIS_DISABLE_FORMATTER)47# include <Zydis/Formatter.h>48#endif4950#if !defined(ZYDIS_DISABLE_SEGMENT)51# include <Zydis/Segment.h>52#endif5354#if !defined(ZYDIS_DISABLE_DECODER) && !defined(ZYDIS_DISABLE_FORMATTER)55# include <Zydis/Disassembler.h>56#endif5758#include <Zydis/MetaInfo.h>59#include <Zydis/Mnemonic.h>60#include <Zydis/Register.h>61#include <Zydis/SharedTypes.h>62#include <Zydis/Status.h>63#include <Zydis/Utils.h>6465#ifdef __cplusplus66extern "C" {67#endif6869/**70* @addtogroup version Version71*72* Functions for checking the library version and build options.73*74* @{75*/7677/* ============================================================================================== */78/* Macros */79/* ============================================================================================== */8081/* ---------------------------------------------------------------------------------------------- */82/* Constants */83/* ---------------------------------------------------------------------------------------------- */8485/**86* A macro that defines the zydis version.87*/88#define ZYDIS_VERSION (ZyanU64)0x00040000000000008990/* ---------------------------------------------------------------------------------------------- */91/* Helper macros */92/* ---------------------------------------------------------------------------------------------- */9394/**95* Extracts the major-part of the zydis version.96*97* @param version The zydis version value98*/99#define ZYDIS_VERSION_MAJOR(version) (ZyanU16)(((version) & 0xFFFF000000000000) >> 48)100101/**102* Extracts the minor-part of the zydis version.103*104* @param version The zydis version value105*/106#define ZYDIS_VERSION_MINOR(version) (ZyanU16)(((version) & 0x0000FFFF00000000) >> 32)107108/**109* Extracts the patch-part of the zydis version.110*111* @param version The zydis version value112*/113#define ZYDIS_VERSION_PATCH(version) (ZyanU16)(((version) & 0x00000000FFFF0000) >> 16)114115/**116* Extracts the build-part of the zydis version.117*118* @param version The zydis version value119*/120#define ZYDIS_VERSION_BUILD(version) (ZyanU16)((version) & 0x000000000000FFFF)121122/* ---------------------------------------------------------------------------------------------- */123124/* ============================================================================================== */125/* Enums and types */126/* ============================================================================================== */127128/**129* Defines the `ZydisFeature` enum.130*/131typedef enum ZydisFeature_132{133ZYDIS_FEATURE_DECODER,134ZYDIS_FEATURE_ENCODER,135ZYDIS_FEATURE_FORMATTER,136ZYDIS_FEATURE_AVX512,137ZYDIS_FEATURE_KNC,138ZYDIS_FEATURE_SEGMENT,139140/**141* Maximum value of this enum.142*/143ZYDIS_FEATURE_MAX_VALUE = ZYDIS_FEATURE_KNC,144/**145* The minimum number of bits required to represent all values of this enum.146*/147ZYDIS_FEATURE_REQUIRED_BITS = ZYAN_BITS_TO_REPRESENT(ZYDIS_FEATURE_MAX_VALUE)148} ZydisFeature;149150/* ============================================================================================== */151/* Exported functions */152/* ============================================================================================== */153154/**155* Returns the zydis version.156*157* @return The zydis version.158*159* Use the macros provided in this file to extract the major, minor, patch and build part from the160* returned version value.161*/162ZYDIS_EXPORT ZyanU64 ZydisGetVersion(void);163164/**165* Checks, if the specified feature is enabled in the current zydis library instance.166*167* @param feature The feature.168*169* @return `ZYAN_STATUS_TRUE` if the feature is enabled, `ZYAN_STATUS_FALSE` if not. Another170* zyan status code, if an error occured.171*/172ZYDIS_EXPORT ZyanStatus ZydisIsFeatureEnabled(ZydisFeature feature);173174/* ============================================================================================== */175176/**177* @}178*/179180#ifdef __cplusplus181}182#endif183184#endif /* ZYDIS_H */185186187