32 #ifndef ZYDIS_SHAREDTYPES_H 33 #define ZYDIS_SHAREDTYPES_H 35 #include <Zycore/Types.h> 49 #define ZYDIS_MAX_INSTRUCTION_LENGTH 15 50 #define ZYDIS_MAX_OPERAND_COUNT 10 // TODO: Auto generate 51 #define ZYDIS_MAX_OPERAND_COUNT_VISIBLE 5 // TODO: Auto generate 112 ZYDIS_STACK_WIDTH_16,
113 ZYDIS_STACK_WIDTH_32,
114 ZYDIS_STACK_WIDTH_64,
135 ZYDIS_ELEMENT_TYPE_INVALID,
233 ZYAN_STATIC_ASSERT(ZYAN_BITS_TO_REPRESENT(
245 ZYDIS_OPERAND_ENCODING_NONE,
246 ZYDIS_OPERAND_ENCODING_MODRM_REG,
247 ZYDIS_OPERAND_ENCODING_MODRM_RM,
248 ZYDIS_OPERAND_ENCODING_OPCODE,
249 ZYDIS_OPERAND_ENCODING_NDSNDD,
250 ZYDIS_OPERAND_ENCODING_IS4,
251 ZYDIS_OPERAND_ENCODING_MASK,
252 ZYDIS_OPERAND_ENCODING_DISP8,
253 ZYDIS_OPERAND_ENCODING_DISP16,
254 ZYDIS_OPERAND_ENCODING_DISP32,
255 ZYDIS_OPERAND_ENCODING_DISP64,
256 ZYDIS_OPERAND_ENCODING_DISP16_32_64,
257 ZYDIS_OPERAND_ENCODING_DISP32_32_64,
258 ZYDIS_OPERAND_ENCODING_DISP16_32_32,
259 ZYDIS_OPERAND_ENCODING_UIMM8,
260 ZYDIS_OPERAND_ENCODING_UIMM16,
261 ZYDIS_OPERAND_ENCODING_UIMM32,
262 ZYDIS_OPERAND_ENCODING_UIMM64,
263 ZYDIS_OPERAND_ENCODING_UIMM16_32_64,
264 ZYDIS_OPERAND_ENCODING_UIMM32_32_64,
265 ZYDIS_OPERAND_ENCODING_UIMM16_32_32,
266 ZYDIS_OPERAND_ENCODING_SIMM8,
267 ZYDIS_OPERAND_ENCODING_SIMM16,
268 ZYDIS_OPERAND_ENCODING_SIMM32,
269 ZYDIS_OPERAND_ENCODING_SIMM64,
270 ZYDIS_OPERAND_ENCODING_SIMM16_32_64,
271 ZYDIS_OPERAND_ENCODING_SIMM32_32_64,
272 ZYDIS_OPERAND_ENCODING_SIMM16_32_32,
273 ZYDIS_OPERAND_ENCODING_JIMM8,
274 ZYDIS_OPERAND_ENCODING_JIMM16,
275 ZYDIS_OPERAND_ENCODING_JIMM32,
276 ZYDIS_OPERAND_ENCODING_JIMM64,
277 ZYDIS_OPERAND_ENCODING_JIMM16_32_64,
278 ZYDIS_OPERAND_ENCODING_JIMM32_32_64,
279 ZYDIS_OPERAND_ENCODING_JIMM16_32_32,
300 ZYDIS_OPERAND_VISIBILITY_INVALID,
458 ZYDIS_OPCODE_MAP_DEFAULT,
460 ZYDIS_OPCODE_MAP_0F38,
461 ZYDIS_OPCODE_MAP_0F3A,
462 ZYDIS_OPCODE_MAP_MAP4,
463 ZYDIS_OPCODE_MAP_MAP5,
464 ZYDIS_OPCODE_MAP_MAP6,
465 ZYDIS_OPCODE_MAP_MAP7,
466 ZYDIS_OPCODE_MAP_0F0F,
467 ZYDIS_OPCODE_MAP_XOP8,
468 ZYDIS_OPCODE_MAP_XOP9,
469 ZYDIS_OPCODE_MAP_XOPA,
502 #define ZYDIS_ATTRIB_HAS_MODRM (1ULL << 0) 506 #define ZYDIS_ATTRIB_HAS_SIB (1ULL << 1) 510 #define ZYDIS_ATTRIB_HAS_REX (1ULL << 2) 514 #define ZYDIS_ATTRIB_HAS_XOP (1ULL << 3) 518 #define ZYDIS_ATTRIB_HAS_VEX (1ULL << 4) 522 #define ZYDIS_ATTRIB_HAS_EVEX (1ULL << 5) 526 #define ZYDIS_ATTRIB_HAS_MVEX (1ULL << 6) 530 #define ZYDIS_ATTRIB_IS_RELATIVE (1ULL << 7) 536 #define ZYDIS_ATTRIB_IS_PRIVILEGED (1ULL << 8) 540 #define ZYDIS_ATTRIB_CPUFLAG_ACCESS (1ULL << 9) 544 #define ZYDIS_ATTRIB_CPU_STATE_CR (1ULL << 10) 548 #define ZYDIS_ATTRIB_CPU_STATE_CW (1ULL << 11) 552 #define ZYDIS_ATTRIB_FPU_STATE_CR (1ULL << 12) 556 #define ZYDIS_ATTRIB_FPU_STATE_CW (1ULL << 13) 560 #define ZYDIS_ATTRIB_XMM_STATE_CR (1ULL << 14) 564 #define ZYDIS_ATTRIB_XMM_STATE_CW (1ULL << 15) 568 #define ZYDIS_ATTRIB_ACCEPTS_LOCK (1ULL << 16) 572 #define ZYDIS_ATTRIB_ACCEPTS_REP (1ULL << 17) 576 #define ZYDIS_ATTRIB_ACCEPTS_REPE (1ULL << 18) 580 #define ZYDIS_ATTRIB_ACCEPTS_REPZ ZYDIS_ATTRIB_ACCEPTS_REPE 584 #define ZYDIS_ATTRIB_ACCEPTS_REPNE (1ULL << 19) 588 #define ZYDIS_ATTRIB_ACCEPTS_REPNZ ZYDIS_ATTRIB_ACCEPTS_REPNE 592 #define ZYDIS_ATTRIB_ACCEPTS_BND (1ULL << 20) 596 #define ZYDIS_ATTRIB_ACCEPTS_XACQUIRE (1ULL << 21) 600 #define ZYDIS_ATTRIB_ACCEPTS_XRELEASE (1ULL << 22) 605 #define ZYDIS_ATTRIB_ACCEPTS_HLE_WITHOUT_LOCK (1ULL << 23) 609 #define ZYDIS_ATTRIB_ACCEPTS_BRANCH_HINTS (1ULL << 24) 613 #define ZYDIS_ATTRIB_ACCEPTS_NOTRACK (1ULL << 25) 618 #define ZYDIS_ATTRIB_ACCEPTS_SEGMENT (1ULL << 26) 622 #define ZYDIS_ATTRIB_HAS_LOCK (1ULL << 27) 626 #define ZYDIS_ATTRIB_HAS_REP (1ULL << 28) 630 #define ZYDIS_ATTRIB_HAS_REPE (1ULL << 29) 634 #define ZYDIS_ATTRIB_HAS_REPZ ZYDIS_ATTRIB_HAS_REPE 638 #define ZYDIS_ATTRIB_HAS_REPNE (1ULL << 30) 642 #define ZYDIS_ATTRIB_HAS_REPNZ ZYDIS_ATTRIB_HAS_REPNE 646 #define ZYDIS_ATTRIB_HAS_BND (1ULL << 31) 650 #define ZYDIS_ATTRIB_HAS_XACQUIRE (1ULL << 32) 654 #define ZYDIS_ATTRIB_HAS_XRELEASE (1ULL << 33) 658 #define ZYDIS_ATTRIB_HAS_BRANCH_NOT_TAKEN (1ULL << 34) 662 #define ZYDIS_ATTRIB_HAS_BRANCH_TAKEN (1ULL << 35) 666 #define ZYDIS_ATTRIB_HAS_NOTRACK (1ULL << 36) 670 #define ZYDIS_ATTRIB_HAS_SEGMENT_CS (1ULL << 37) 674 #define ZYDIS_ATTRIB_HAS_SEGMENT_SS (1ULL << 38) 678 #define ZYDIS_ATTRIB_HAS_SEGMENT_DS (1ULL << 39) 682 #define ZYDIS_ATTRIB_HAS_SEGMENT_ES (1ULL << 40) 686 #define ZYDIS_ATTRIB_HAS_SEGMENT_FS (1ULL << 41) 690 #define ZYDIS_ATTRIB_HAS_SEGMENT_GS (1ULL << 42) 694 #define ZYDIS_ATTRIB_HAS_SEGMENT (ZYDIS_ATTRIB_HAS_SEGMENT_CS | \ 695 ZYDIS_ATTRIB_HAS_SEGMENT_SS | \ 696 ZYDIS_ATTRIB_HAS_SEGMENT_DS | \ 697 ZYDIS_ATTRIB_HAS_SEGMENT_ES | \ 698 ZYDIS_ATTRIB_HAS_SEGMENT_FS | \ 699 ZYDIS_ATTRIB_HAS_SEGMENT_GS) 703 #define ZYDIS_ATTRIB_HAS_OPERANDSIZE (1ULL << 43) // TODO: rename 707 #define ZYDIS_ATTRIB_HAS_ADDRESSSIZE (1ULL << 44) // TODO: rename 713 #define ZYDIS_ATTRIB_HAS_EVEX_B (1ULL << 45) // TODO: rename The instruction uses the AMD 3DNow-encoding.
Definition: SharedTypes.h:420
The operand is written (must write) and conditionally read by the instruction (may read)...
Definition: SharedTypes.h:379
The operand is part of the opcode, and not typically listed as an operand.
Definition: SharedTypes.h:312
16-bit floating point value (half).
Definition: SharedTypes.h:151
16 bit protected mode.
Definition: SharedTypes.h:87
enum ZydisMachineMode_ ZydisMachineMode
Defines the ZydisMachineMode enum.
ZydisElementType_
Defines the ZydisElementType enum.
Definition: SharedTypes.h:133
The operand is a pointer operand with a segment:offset lvalue.
Definition: SharedTypes.h:216
32 bit protected mode.
Definition: SharedTypes.h:75
The operand is a memory operand.
Definition: SharedTypes.h:212
Unsigned integer value.
Definition: SharedTypes.h:143
32 bit protected mode.
Definition: SharedTypes.h:83
The instruction uses the MVEX-encoding.
Definition: SharedTypes.h:436
The operand is an immediate operand.
Definition: SharedTypes.h:220
ZydisOperandType_
Defines the ZydisOperandType enum.
Definition: SharedTypes.h:199
16 bit protected mode.
Definition: SharedTypes.h:79
Maximum value of this enum.
Definition: SharedTypes.h:119
The instruction uses the AMD XOP-encoding.
Definition: SharedTypes.h:424
ZydisOpcodeMap_
Defines the ZydisOpcodeMap enum.
Definition: SharedTypes.h:456
The minimum number of bits required to represent all values of this enum.
Definition: SharedTypes.h:445
The instruction uses the EVEX-encoding.
Definition: SharedTypes.h:432
The minimum number of bits required to represent all values of this bitset.
Definition: SharedTypes.h:396
ZyanU16 ZydisElementSize
Defines the ZydisElementSize datatype.
Definition: SharedTypes.h:190
64-bit floating point value (double).
Definition: SharedTypes.h:159
16 bit real mode.
Definition: SharedTypes.h:91
The operand is read (must read) and conditionally written by the instruction (may write)...
Definition: SharedTypes.h:373
The operand is conditionally read (may read) and conditionally written by the instruction (may write)...
Definition: SharedTypes.h:367
The operand is explicitly encoded in the instruction.
Definition: SharedTypes.h:304
Maximum value of this enum.
Definition: SharedTypes.h:225
The minimum number of bits required to represent all values of this enum.
Definition: SharedTypes.h:123
ZydisInstructionEncoding_
Defines the ZydisInstructionEncoding enum.
Definition: SharedTypes.h:411
The minimum number of bits required to represent all values of this enum.
Definition: SharedTypes.h:478
Maximum value of this enum.
Definition: SharedTypes.h:441
Maximum value of this enum.
Definition: SharedTypes.h:317
Signed integer value.
Definition: SharedTypes.h:147
enum ZydisOperandAction_ ZydisOperandAction
Defines the ZydisOperandAction enum.
Mask combining all writing access flags.
Definition: SharedTypes.h:389
ZydisOperandVisibility_
Defines the ZydisOperandVisibility enum.
Definition: SharedTypes.h:298
32-bit floating point value (single).
Definition: SharedTypes.h:155
enum ZydisStackWidth_ ZydisStackWidth
Defines the ZydisStackWidth enum.
A struct type.
Definition: SharedTypes.h:139
The operand is conditionally written by the instruction (may write).
Definition: SharedTypes.h:353
ZydisMachineMode_
Defines the ZydisMachineMode enum.
Definition: SharedTypes.h:66
Binary coded decimal value.
Definition: SharedTypes.h:167
The minimum number of bits required to represent all values of this enum.
Definition: SharedTypes.h:180
The operand is conditionally read by the instruction.
Definition: SharedTypes.h:349
The instruction uses the VEX-encoding.
Definition: SharedTypes.h:428
Maximum value of this enum.
Definition: SharedTypes.h:96
The operand is not used.
Definition: SharedTypes.h:204
enum ZydisInstructionEncoding_ ZydisInstructionEncoding
Defines the ZydisInstructionEncoding enum.
ZydisOperandAction_
Defines the ZydisOperandAction enum.
Definition: SharedTypes.h:332
The operand is read by the instruction.
Definition: SharedTypes.h:341
Mask combining all reading access flags.
Definition: SharedTypes.h:385
Maximum value of this enum.
Definition: SharedTypes.h:284
The instruction uses the legacy encoding.
Definition: SharedTypes.h:416
Maximum value of this enum.
Definition: SharedTypes.h:474
ZyanU8 ZydisOperandActions
Defines the ZydisOperandActions data-type.
Definition: SharedTypes.h:402
The operand is a register operand.
Definition: SharedTypes.h:208
enum ZydisOpcodeMap_ ZydisOpcodeMap
Defines the ZydisOpcodeMap enum.
The minimum number of bits required to represent all values of this enum.
Definition: SharedTypes.h:229
The operand is read (must read) and written by the instruction (must write).
Definition: SharedTypes.h:362
enum ZydisElementType_ ZydisElementType
Defines the ZydisElementType enum.
enum ZydisOperandVisibility_ ZydisOperandVisibility
Defines the ZydisOperandVisibility enum.
ZydisStackWidth_
Defines the ZydisStackWidth enum.
Definition: SharedTypes.h:110
64 bit mode.
Definition: SharedTypes.h:71
The minimum number of bits required to represent all values of this enum.
Definition: SharedTypes.h:321
Maximum value of this enum.
Definition: SharedTypes.h:176
The operand is part of the opcode, but listed as an operand.
Definition: SharedTypes.h:308
A condition code (e.g.
Definition: SharedTypes.h:171
ZyanU64 ZydisInstructionAttributes
Defines the ZydisInstructionAttributes data-type.
Definition: SharedTypes.h:497
enum ZydisOperandType_ ZydisOperandType
Defines the ZydisOperandType enum.
The minimum number of bits required to represent all values of this enum.
Definition: SharedTypes.h:100
enum ZydisOperandEncoding_ ZydisOperandEncoding
Defines the ZydisOperandEncoding enum.
The operand is written by the instruction (must write).
Definition: SharedTypes.h:345
ZydisOperandEncoding_
Defines the ZydisOperandEncoding enum.
Definition: SharedTypes.h:243
The minimum number of bits required to represent all values of this enum.
Definition: SharedTypes.h:288
80-bit floating point value (extended).
Definition: SharedTypes.h:163