Zydis  v2.0.0-alpha1
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 
27 #ifndef ZYDIS_H
28 #define ZYDIS_H
29 
30 #include <Zydis/CommonTypes.h>
31 #include <Zydis/Decoder.h>
32 #include <Zydis/DecoderTypes.h>
33 #include <Zydis/Defines.h>
34 #include <Zydis/Formatter.h>
35 #include <Zydis/Mnemonic.h>
36 #include <Zydis/Register.h>
37 #include <Zydis/SharedTypes.h>
38 #include <Zydis/Status.h>
39 #include <Zydis/Utils.h>
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
45 /* ============================================================================================== */
46 /* Macros */
47 /* ============================================================================================== */
48 
49 /* ---------------------------------------------------------------------------------------------- */
50 /* Constants */
51 /* ---------------------------------------------------------------------------------------------- */
52 
56 #define ZYDIS_VERSION (uint64_t)0x0002000000000000
57 
58 /* ---------------------------------------------------------------------------------------------- */
59 /* Helper macros */
60 /* ---------------------------------------------------------------------------------------------- */
61 
67 #define ZYDIS_VERSION_MAJOR(version) (uint16_t)((version & 0xFFFF000000000000) >> 48)
68 
74 #define ZYDIS_VERSION_MINOR(version) (uint16_t)((version & 0x0000FFFF00000000) >> 32)
75 
81 #define ZYDIS_VERSION_PATCH(version) (uint16_t)((version & 0x00000000FFFF0000) >> 16)
82 
88 #define ZYDIS_VERSION_BUILD(version) (uint16_t)(version & 0x000000000000FFFF)
89 
90 /* ---------------------------------------------------------------------------------------------- */
91 
92 /* ============================================================================================== */
93 /* Enums and types */
94 /* ============================================================================================== */
95 
99 typedef uint8_t ZydisFeature;
100 
105 {
110 };
111 
112 /* ============================================================================================== */
113 /* Exported functions */
114 /* ============================================================================================== */
115 
124 ZYDIS_EXPORT uint64_t ZydisGetVersion();
125 
134 
135 /* ============================================================================================== */
136 
137 #ifdef __cplusplus
138 }
139 #endif
140 
141 #endif /* ZYDIS_H */
Includes and defines some default datatypes.
uint8_t ZydisBool
@briefs Defines the ZydisBool datatype.
Definition: CommonTypes.h:63
Defines the basic ZydisDecodedInstruction and ZydisDecodedOperand structs.
Defines decoder/encoder-shared macros and types.
ZYDIS_EXPORT uint64_t ZydisGetVersion()
Returns the zydis version.
ZydisFeatures
Values that represent zydis features.
Definition: Zydis.h:105
@ ZYDIS_FEATURE_EVEX
Definition: Zydis.h:106
@ ZYDIS_FEATURE_MVEX
Definition: Zydis.h:107
@ ZYDIS_FEATURE_FLAGS
Definition: Zydis.h:108
@ ZYDIS_FEATURE_CPUID
Definition: Zydis.h:109
uint8_t ZydisFeature
Defines the ZydisFeature datatype.
Definition: Zydis.h:99
ZYDIS_EXPORT ZydisBool ZydisIsFeatureEnabled(ZydisFeature feature)
Checks, if the specified feature is enabled in the current zydis library instance.