Zydis  v2.0.2
SharedTypes.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_SHAREDTYPES_H
33 #define ZYDIS_SHAREDTYPES_H
34 
35 #include <Zydis/CommonTypes.h>
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
41 /* ============================================================================================== */
42 /* Macros */
43 /* ============================================================================================== */
44 
45 /* ---------------------------------------------------------------------------------------------- */
46 /* Constants */
47 /* ---------------------------------------------------------------------------------------------- */
48 
49 #define ZYDIS_MAX_INSTRUCTION_LENGTH 15
50 #define ZYDIS_MAX_OPERAND_COUNT 10
51 
52 /* ---------------------------------------------------------------------------------------------- */
53 
54 /* ============================================================================================== */
55 /* Enums and types */
56 /* ============================================================================================== */
57 
58 /* ---------------------------------------------------------------------------------------------- */
59 /* Machine mode */
60 /* ---------------------------------------------------------------------------------------------- */
61 
66 
71 {
97 
102 };
103 
104 /* ---------------------------------------------------------------------------------------------- */
105 /* Address width */
106 /* ---------------------------------------------------------------------------------------------- */
107 
112 
117 {
118  ZYDIS_ADDRESS_WIDTH_INVALID = 0, // TODO: Don't manually initialize values
122 
127 };
128 
129 /* ---------------------------------------------------------------------------------------------- */
130 /* Element types */
131 /* ---------------------------------------------------------------------------------------------- */
132 
137 
142 {
152 
157 };
158 
163 
164 /* ---------------------------------------------------------------------------------------------- */
165 /* Operand type */
166 /* ---------------------------------------------------------------------------------------------- */
167 
172 
177 {
198 
203 };
204 
205 /* ---------------------------------------------------------------------------------------------- */
206 /* Operand encoding */
207 /* ---------------------------------------------------------------------------------------------- */
208 
213 
218 {
254 
259 };
260 
261 /* ---------------------------------------------------------------------------------------------- */
262 /* Operand visibility */
263 /* ---------------------------------------------------------------------------------------------- */
264 
269 
274 {
288 
293 };
294 
295 /* ---------------------------------------------------------------------------------------------- */
296 /* Operand action */
297 /* ---------------------------------------------------------------------------------------------- */
298 
303 
308 {
338 
351 
356 };
357 
358 /* ---------------------------------------------------------------------------------------------- */
359 /* Instruction encoding */
360 /* ---------------------------------------------------------------------------------------------- */
361 
366 
371 {
397 
402 };
403 
404 /* ---------------------------------------------------------------------------------------------- */
405 /* Opcode map */
406 /* ---------------------------------------------------------------------------------------------- */
407 
412 
417 {
426 
431 };
432 
433 /* ---------------------------------------------------------------------------------------------- */
434 
435 /* ============================================================================================== */
436 
437 #ifdef __cplusplus
438 }
439 #endif
440 
441 #endif /* ZYDIS_SHAREDTYPES_H */
Includes and defines some default datatypes.
uint8_t ZydisU8
Definition: CommonTypes.h:45
uint16_t ZydisU16
Definition: CommonTypes.h:46
ZydisU8 ZydisAddressWidth
Defines the ZydisAddressWidth datatype.
Definition: SharedTypes.h:111
ZydisOpcodeMaps
Values that represent opcode-maps.
Definition: SharedTypes.h:417
@ ZYDIS_OPCODE_MAP_XOP9
Definition: SharedTypes.h:424
@ ZYDIS_OPCODE_MAP_0F38
Definition: SharedTypes.h:420
@ ZYDIS_OPCODE_MAP_0F
Definition: SharedTypes.h:419
@ ZYDIS_OPCODE_MAP_DEFAULT
Definition: SharedTypes.h:418
@ ZYDIS_OPCODE_MAP_XOP8
Definition: SharedTypes.h:423
@ ZYDIS_OPCODE_MAP_XOPA
Definition: SharedTypes.h:425
@ ZYDIS_OPCODE_MAP_MAX_VALUE
Maximum value of this enum.
Definition: SharedTypes.h:430
@ ZYDIS_OPCODE_MAP_0F3A
Definition: SharedTypes.h:421
@ ZYDIS_OPCODE_MAP_0F0F
Definition: SharedTypes.h:422
ZydisU8 ZydisOperandEncoding
Defines the ZydisOperandEncoding datatype.
Definition: SharedTypes.h:212
ZydisU8 ZydisInstructionEncoding
Defines the ZydisInstructionEncoding datatype.
Definition: SharedTypes.h:365
ZydisOperandActions
Values that represent operand-actions.
Definition: SharedTypes.h:308
@ ZYDIS_OPERAND_ACTION_CONDWRITE
The operand is conditionally written by the instruction (may write).
Definition: SharedTypes.h:329
@ ZYDIS_OPERAND_ACTION_READWRITE
The operand is read and written by the instruction (must write).
Definition: SharedTypes.h:321
@ ZYDIS_OPERAND_ACTION_CONDREAD_WRITE
The operand is written and conditionally read by the instruction (must write).
Definition: SharedTypes.h:337
@ ZYDIS_OPERAND_ACTION_CONDREAD
The operand is conditionally read by the instruction.
Definition: SharedTypes.h:325
@ ZYDIS_OPERAND_ACTION_WRITE
The operand is written by the instruction (must write).
Definition: SharedTypes.h:317
@ ZYDIS_OPERAND_ACTION_MASK_READ
Mask combining all reading access flags.
Definition: SharedTypes.h:348
@ ZYDIS_OPERAND_ACTION_INVALID
Definition: SharedTypes.h:309
@ ZYDIS_OPERAND_ACTION_READ
The operand is read by the instruction.
Definition: SharedTypes.h:313
@ ZYDIS_OPERAND_ACTION_READ_CONDWRITE
The operand is read and conditionally written by the instruction (may write).
Definition: SharedTypes.h:333
@ ZYDIS_OPERAND_ACTION_MAX_VALUE
Maximum value of this enum.
Definition: SharedTypes.h:355
@ ZYDIS_OPERAND_ACTION_MASK_WRITE
Mask combining all writing access flags.
Definition: SharedTypes.h:342
ZydisU16 ZydisElementSize
Defines the ZydisElementSize datatype.
Definition: SharedTypes.h:162
ZydisInstructionEncodings
Values that represent instruction-encodings.
Definition: SharedTypes.h:371
@ ZYDIS_INSTRUCTION_ENCODING_VEX
The instruction uses the VEX-encoding.
Definition: SharedTypes.h:388
@ ZYDIS_INSTRUCTION_ENCODING_3DNOW
The instruction uses the AMD 3DNow-encoding.
Definition: SharedTypes.h:380
@ ZYDIS_INSTRUCTION_ENCODING_MVEX
The instruction uses the MVEX-encoding.
Definition: SharedTypes.h:396
@ ZYDIS_INSTRUCTION_ENCODING_INVALID
Definition: SharedTypes.h:372
@ ZYDIS_INSTRUCTION_ENCODING_DEFAULT
The instruction uses the default encoding.
Definition: SharedTypes.h:376
@ ZYDIS_INSTRUCTION_ENCODING_MAX_VALUE
Maximum value of this enum.
Definition: SharedTypes.h:401
@ ZYDIS_INSTRUCTION_ENCODING_EVEX
The instruction uses the EVEX-encoding.
Definition: SharedTypes.h:392
@ ZYDIS_INSTRUCTION_ENCODING_XOP
The instruction uses the AMD XOP-encoding.
Definition: SharedTypes.h:384
ZydisU8 ZydisElementType
Defines the ZydisElementType datatype.
Definition: SharedTypes.h:136
ZydisElementTypes
Values that represent element-types.
Definition: SharedTypes.h:142
@ ZYDIS_ELEMENT_TYPE_LONGBCD
Definition: SharedTypes.h:151
@ ZYDIS_ELEMENT_TYPE_UINT
Definition: SharedTypes.h:145
@ ZYDIS_ELEMENT_TYPE_FLOAT64
Definition: SharedTypes.h:149
@ ZYDIS_ELEMENT_TYPE_INT
Definition: SharedTypes.h:146
@ ZYDIS_ELEMENT_TYPE_INVALID
Definition: SharedTypes.h:143
@ ZYDIS_ELEMENT_TYPE_STRUCT
Definition: SharedTypes.h:144
@ ZYDIS_ELEMENT_TYPE_FLOAT16
Definition: SharedTypes.h:147
@ ZYDIS_ELEMENT_TYPE_MAX_VALUE
Maximum value of this enum.
Definition: SharedTypes.h:156
@ ZYDIS_ELEMENT_TYPE_FLOAT32
Definition: SharedTypes.h:148
@ ZYDIS_ELEMENT_TYPE_FLOAT80
Definition: SharedTypes.h:150
ZydisU8 ZydisOperandVisibility
Defines the ZydisOperandVisibility datatype.
Definition: SharedTypes.h:268
ZydisAddressWidths
Values that represent address widths.
Definition: SharedTypes.h:117
@ ZYDIS_ADDRESS_WIDTH_INVALID
Definition: SharedTypes.h:118
@ ZYDIS_ADDRESS_WIDTH_16
Definition: SharedTypes.h:119
@ ZYDIS_ADDRESS_WIDTH_32
Definition: SharedTypes.h:120
@ ZYDIS_ADDRESS_WIDTH_MAX_VALUE
Maximum value of this enum.
Definition: SharedTypes.h:126
@ ZYDIS_ADDRESS_WIDTH_64
Definition: SharedTypes.h:121
ZydisOperandEncodings
Values that represent operand-encodings.
Definition: SharedTypes.h:218
@ ZYDIS_OPERAND_ENCODING_MODRM_RM
Definition: SharedTypes.h:221
@ ZYDIS_OPERAND_ENCODING_DISP16_32_64
Definition: SharedTypes.h:230
@ ZYDIS_OPERAND_ENCODING_DISP16
Definition: SharedTypes.h:227
@ ZYDIS_OPERAND_ENCODING_DISP64
Definition: SharedTypes.h:229
@ ZYDIS_OPERAND_ENCODING_JIMM16_32_64
Definition: SharedTypes.h:251
@ ZYDIS_OPERAND_ENCODING_SIMM16_32_64
Definition: SharedTypes.h:244
@ ZYDIS_OPERAND_ENCODING_MAX_VALUE
Maximum value of this enum.
Definition: SharedTypes.h:258
@ ZYDIS_OPERAND_ENCODING_DISP16_32_32
Definition: SharedTypes.h:232
@ ZYDIS_OPERAND_ENCODING_SIMM32
Definition: SharedTypes.h:242
@ ZYDIS_OPERAND_ENCODING_UIMM64
Definition: SharedTypes.h:236
@ ZYDIS_OPERAND_ENCODING_JIMM8
Definition: SharedTypes.h:247
@ ZYDIS_OPERAND_ENCODING_NDSNDD
Definition: SharedTypes.h:223
@ ZYDIS_OPERAND_ENCODING_DISP32_32_64
Definition: SharedTypes.h:231
@ ZYDIS_OPERAND_ENCODING_JIMM16
Definition: SharedTypes.h:248
@ ZYDIS_OPERAND_ENCODING_JIMM32_32_64
Definition: SharedTypes.h:252
@ ZYDIS_OPERAND_ENCODING_IS4
Definition: SharedTypes.h:224
@ ZYDIS_OPERAND_ENCODING_SIMM64
Definition: SharedTypes.h:243
@ ZYDIS_OPERAND_ENCODING_UIMM32
Definition: SharedTypes.h:235
@ ZYDIS_OPERAND_ENCODING_MASK
Definition: SharedTypes.h:225
@ ZYDIS_OPERAND_ENCODING_SIMM16
Definition: SharedTypes.h:241
@ ZYDIS_OPERAND_ENCODING_UIMM32_32_64
Definition: SharedTypes.h:238
@ ZYDIS_OPERAND_ENCODING_UIMM16
Definition: SharedTypes.h:234
@ ZYDIS_OPERAND_ENCODING_UIMM8
Definition: SharedTypes.h:233
@ ZYDIS_OPERAND_ENCODING_DISP32
Definition: SharedTypes.h:228
@ ZYDIS_OPERAND_ENCODING_MODRM_REG
Definition: SharedTypes.h:220
@ ZYDIS_OPERAND_ENCODING_SIMM32_32_64
Definition: SharedTypes.h:245
@ ZYDIS_OPERAND_ENCODING_JIMM64
Definition: SharedTypes.h:250
@ ZYDIS_OPERAND_ENCODING_JIMM32
Definition: SharedTypes.h:249
@ ZYDIS_OPERAND_ENCODING_UIMM16_32_64
Definition: SharedTypes.h:237
@ ZYDIS_OPERAND_ENCODING_JIMM16_32_32
Definition: SharedTypes.h:253
@ ZYDIS_OPERAND_ENCODING_OPCODE
Definition: SharedTypes.h:222
@ ZYDIS_OPERAND_ENCODING_DISP8
Definition: SharedTypes.h:226
@ ZYDIS_OPERAND_ENCODING_NONE
Definition: SharedTypes.h:219
@ ZYDIS_OPERAND_ENCODING_SIMM16_32_32
Definition: SharedTypes.h:246
@ ZYDIS_OPERAND_ENCODING_SIMM8
Definition: SharedTypes.h:240
@ ZYDIS_OPERAND_ENCODING_UIMM16_32_32
Definition: SharedTypes.h:239
ZydisOperandTypes
Values that represent operand-types.
Definition: SharedTypes.h:177
@ ZYDIS_OPERAND_TYPE_IMMEDIATE
The operand is an immediate operand.
Definition: SharedTypes.h:197
@ ZYDIS_OPERAND_TYPE_UNUSED
The operand is not used.
Definition: SharedTypes.h:181
@ ZYDIS_OPERAND_TYPE_MAX_VALUE
Maximum value of this enum.
Definition: SharedTypes.h:202
@ ZYDIS_OPERAND_TYPE_REGISTER
The operand is a register operand.
Definition: SharedTypes.h:185
@ ZYDIS_OPERAND_TYPE_MEMORY
The operand is a memory operand.
Definition: SharedTypes.h:189
@ ZYDIS_OPERAND_TYPE_POINTER
The operand is a pointer operand with a segment:offset lvalue.
Definition: SharedTypes.h:193
ZydisOperandVisibilities
Values that represent operand-visibilities.
Definition: SharedTypes.h:274
@ ZYDIS_OPERAND_VISIBILITY_IMPLICIT
The operand is part of the opcode, but listed as an operand.
Definition: SharedTypes.h:283
@ ZYDIS_OPERAND_VISIBILITY_EXPLICIT
The operand is explicitly encoded in the instruction.
Definition: SharedTypes.h:279
@ ZYDIS_OPERAND_VISIBILITY_INVALID
Definition: SharedTypes.h:275
@ ZYDIS_OPERAND_VISIBILITY_MAX_VALUE
Maximum value of this enum.
Definition: SharedTypes.h:292
@ ZYDIS_OPERAND_VISIBILITY_HIDDEN
The operand is part of the opcode, and not typically listed as an operand.
Definition: SharedTypes.h:287
ZydisU8 ZydisOperandAction
Defines the ZydisOperandAction datatype.
Definition: SharedTypes.h:302
ZydisU8 ZydisOpcodeMap
Defines the ZydisOpcodeMap map.
Definition: SharedTypes.h:411
ZydisU8 ZydisMachineMode
Defines the ZydisMachineMode datatype.
Definition: SharedTypes.h:65
ZydisU8 ZydisOperandType
Defines the ZydisOperandType datatype.
Definition: SharedTypes.h:171
ZydisMachineModes
Values that represent machine modes.
Definition: SharedTypes.h:71
@ ZYDIS_MACHINE_MODE_LONG_COMPAT_16
16 bit protected mode.
Definition: SharedTypes.h:84
@ ZYDIS_MACHINE_MODE_LONG_COMPAT_32
32 bit protected mode.
Definition: SharedTypes.h:80
@ ZYDIS_MACHINE_MODE_REAL_16
16 bit real mode.
Definition: SharedTypes.h:96
@ ZYDIS_MACHINE_MODE_LEGACY_16
16 bit protected mode.
Definition: SharedTypes.h:92
@ ZYDIS_MACHINE_MODE_MAX_VALUE
Maximum value of this enum.
Definition: SharedTypes.h:101
@ ZYDIS_MACHINE_MODE_LEGACY_32
32 bit protected mode.
Definition: SharedTypes.h:88
@ ZYDIS_MACHINE_MODE_LONG_64
64 bit mode.
Definition: SharedTypes.h:76
@ ZYDIS_MACHINE_MODE_INVALID
Definition: SharedTypes.h:72