Zydis  v2.0.0
Zydis.h
Go to the documentation of this file.
1 /***************************************************************************************************
2 
3  Zyan Disassembler Library (Zydis)
4 
5  Original Author : Florian Bernd
6 
7  * Permission is hereby granted, free of charge, to any person obtaining a copy
8  * of this software and associated documentation files (the "Software"), to deal
9  * in the Software without restriction, including without limitation the rights
10  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11  * copies of the Software, and to permit persons to whom the Software is
12  * furnished to do so, subject to the following conditions:
13  *
14  * The above copyright notice and this permission notice shall be included in all
15  * copies or substantial portions of the Software.
16  *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23  * SOFTWARE.
24 
25 ***************************************************************************************************/
26 
32 #ifndef ZYDIS_H
33 #define ZYDIS_H
34 
35 #include <Zydis/CommonTypes.h>
36 #ifndef ZYDIS_DISABLE_DECODER
37 #include <Zydis/Decoder.h>
38 #include <Zydis/DecoderTypes.h>
39 #endif
40 #include <Zydis/Defines.h>
41 #ifndef ZYDIS_DISABLE_FORMATTER
42 #include <Zydis/Formatter.h>
43 #endif
44 #include <Zydis/MetaInfo.h>
45 #include <Zydis/Mnemonic.h>
46 #include <Zydis/Register.h>
47 #include <Zydis/SharedTypes.h>
48 #include <Zydis/Status.h>
49 #include <Zydis/String.h>
50 #include <Zydis/Utils.h>
51 
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55 
56 /* ============================================================================================== */
57 /* Macros */
58 /* ============================================================================================== */
59 
60 /* ---------------------------------------------------------------------------------------------- */
61 /* Constants */
62 /* ---------------------------------------------------------------------------------------------- */
63 
67 #define ZYDIS_VERSION (ZydisU64)0x0002000000000000
68 
69 /* ---------------------------------------------------------------------------------------------- */
70 /* Helper macros */
71 /* ---------------------------------------------------------------------------------------------- */
72 
78 #define ZYDIS_VERSION_MAJOR(version) (ZydisU16)((version & 0xFFFF000000000000) >> 48)
79 
85 #define ZYDIS_VERSION_MINOR(version) (ZydisU16)((version & 0x0000FFFF00000000) >> 32)
86 
92 #define ZYDIS_VERSION_PATCH(version) (ZydisU16)((version & 0x00000000FFFF0000) >> 16)
93 
99 #define ZYDIS_VERSION_BUILD(version) (ZydisU16)(version & 0x000000000000FFFF)
100 
101 /* ---------------------------------------------------------------------------------------------- */
102 
103 /* ============================================================================================== */
104 /* Enums and types */
105 /* ============================================================================================== */
106 
111 
116 {
119 };
120 
121 /* ============================================================================================== */
122 /* Exported functions */
123 /* ============================================================================================== */
124 
133 ZYDIS_EXPORT ZydisU64 ZydisGetVersion(void);
134 
143 
144 /* ============================================================================================== */
145 
146 #ifdef __cplusplus
147 }
148 #endif
149 
150 #endif /* ZYDIS_H */
Includes and defines some default datatypes.
uint64_t ZydisU64
Definition: CommonTypes.h:48
uint8_t ZydisU8
Definition: CommonTypes.h:45
ZydisU8 ZydisBool
@briefs Defines the ZydisBool datatype.
Definition: CommonTypes.h:133
Defines the basic ZydisDecodedInstruction and ZydisDecodedOperand structs.
Functions for decoding instructions.
General helper and platform detection macros.
Functions for formatting human-readable instructions.
Mnemonic constant definitions and helper functions.
Utility functions and constants for registers.
Defines decoder/encoder-shared macros and types.
Status code definitions and check macros.
Other utility functions.
ZydisU8 ZydisFeature
Defines the ZydisFeature datatype.
Definition: Zydis.h:110
ZYDIS_EXPORT ZydisU64 ZydisGetVersion(void)
Returns the zydis version.
ZydisFeatures
Values that represent zydis features.
Definition: Zydis.h:116
@ ZYDIS_FEATURE_EVEX
Definition: Zydis.h:117
@ ZYDIS_FEATURE_MVEX
Definition: Zydis.h:118
ZYDIS_EXPORT ZydisBool ZydisIsFeatureEnabled(ZydisFeature feature)
Checks, if the specified feature is enabled in the current zydis library instance.