Zydis  v2.0.0-alpha1
DecoderTypes.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_INSTRUCTIONINFO_H
33 #define ZYDIS_INSTRUCTIONINFO_H
34 
35 #include <Zydis/CommonTypes.h>
36 #include <Zydis/Mnemonic.h>
37 #include <Zydis/Register.h>
38 #include <Zydis/SharedTypes.h>
39 
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 
44 /* ============================================================================================== */
45 /* Decoded operand */
46 /* ============================================================================================== */
47 
51 typedef struct ZydisDecodedOperand_
52 {
56  uint8_t id;
76  uint16_t size;
88  uint16_t elementCount;
96  struct
97  {
117  uint8_t scale;
121  struct
122  {
130  int64_t value;
131  } disp;
132  } mem;
136  struct
137  {
138  uint16_t segment;
139  uint32_t offset;
140  } ptr;
144  struct
145  {
158  union
159  {
160  uint64_t u;
161  int64_t s;
162  } value;
163  } imm;
165 
166 /* ============================================================================================== */
167 /* Decoded instruction */
168 /* ============================================================================================== */
169 
170 /* ---------------------------------------------------------------------------------------------- */
171 /* Instruction attributes */
172 /* ---------------------------------------------------------------------------------------------- */
173 
177 typedef uint64_t ZydisInstructionAttributes;
178 
179 // TODO: Update values
180 
184 #define ZYDIS_ATTRIB_HAS_MODRM 0x0000000000000001
188 #define ZYDIS_ATTRIB_HAS_SIB 0x0000000000000002
192 #define ZYDIS_ATTRIB_HAS_REX 0x0000000000000004
196 #define ZYDIS_ATTRIB_HAS_XOP 0x0000000000000008
200 #define ZYDIS_ATTRIB_HAS_VEX 0x0000000000000010
204 #define ZYDIS_ATTRIB_HAS_EVEX 0x0000000000000020
208 #define ZYDIS_ATTRIB_IS_RELATIVE 0x0000000000000040
214 #define ZYDIS_ATTRIB_IS_PRIVILEGED 0x0000000000000080
218 #define ZYDIS_ATTRIB_ACCEPTS_LOCK 0x0000000000000100
222 #define ZYDIS_ATTRIB_ACCEPTS_REP 0x0000000000000200
226 #define ZYDIS_ATTRIB_ACCEPTS_REPE 0x0000000000000400
230 #define ZYDIS_ATTRIB_ACCEPTS_REPZ 0x0000000000000400
234 #define ZYDIS_ATTRIB_ACCEPTS_REPNE 0x0000000000000800
238 #define ZYDIS_ATTRIB_ACCEPTS_REPNZ 0x0000000000000800
242 #define ZYDIS_ATTRIB_ACCEPTS_BOUND 0x0000000000001000
246 #define ZYDIS_ATTRIB_ACCEPTS_XACQUIRE 0x0000000000002000
250 #define ZYDIS_ATTRIB_ACCEPTS_XRELEASE 0x0000000000004000
255 #define ZYDIS_ATTRIB_ACCEPTS_HLE_WITHOUT_LOCK 0x0000000000008000
259 #define ZYDIS_ATTRIB_ACCEPTS_BRANCH_HINTS 0x0000000000010000
263 #define ZYDIS_ATTRIB_ACCEPTS_SEGMENT 0x0000000000020000
267 #define ZYDIS_ATTRIB_HAS_LOCK 0x0000000000100000
271 #define ZYDIS_ATTRIB_HAS_REP 0x0000000000200000
275 #define ZYDIS_ATTRIB_HAS_REPE 0x0000000000400000
279 #define ZYDIS_ATTRIB_HAS_REPZ 0x0000000000400000
283 #define ZYDIS_ATTRIB_HAS_REPNE 0x0000000000800000
287 #define ZYDIS_ATTRIB_HAS_REPNZ 0x0000000000800000
291 #define ZYDIS_ATTRIB_HAS_BOUND 0x0000000001000000
295 #define ZYDIS_ATTRIB_HAS_XACQUIRE 0x0000000002000000
299 #define ZYDIS_ATTRIB_HAS_XRELEASE 0x0000000004000000
303 #define ZYDIS_ATTRIB_HAS_BRANCH_NOT_TAKEN 0x0000000008000000
307 #define ZYDIS_ATTRIB_HAS_BRANCH_TAKEN 0x0000000010000000
311 #define ZYDIS_ATTRIB_HAS_SEGMENT 0x00000007E0000000
315 #define ZYDIS_ATTRIB_HAS_SEGMENT_CS 0x0000000020000000
319 #define ZYDIS_ATTRIB_HAS_SEGMENT_SS 0x0000000040000000
323 #define ZYDIS_ATTRIB_HAS_SEGMENT_DS 0x0000000080000000
327 #define ZYDIS_ATTRIB_HAS_SEGMENT_ES 0x0000000100000000
331 #define ZYDIS_ATTRIB_HAS_SEGMENT_FS 0x0000000200000000
335 #define ZYDIS_ATTRIB_HAS_SEGMENT_GS 0x0000000400000000
339 #define ZYDIS_ATTRIB_HAS_OPERANDSIZE 0x0000000800000000
343 #define ZYDIS_ATTRIB_HAS_ADDRESSSIZE 0x0000001000000000
344 
345 /* ---------------------------------------------------------------------------------------------- */
346 /* R/E/FLAGS info */
347 /* ---------------------------------------------------------------------------------------------- */
348 
352 typedef uint8_t ZydisCPUFlag;
353 
357 typedef uint32_t ZydisCPUFlagMask;
358 
363 {
448 
453 };
454 
458 typedef uint8_t ZydisCPUFlagAction;
459 
464 {
471 };
472 
473 /* ---------------------------------------------------------------------------------------------- */
474 /* SSE/AVX exception-class */
475 /* ---------------------------------------------------------------------------------------------- */
476 
480 typedef uint16_t ZydisExceptionClass;
481 
486 {
488  // TODO: SSE and AVX
511 };
512 
513 /* ---------------------------------------------------------------------------------------------- */
514 /* AVX vector-length */
515 /* ---------------------------------------------------------------------------------------------- */
516 
520 typedef uint16_t ZydisVectorLength;
521 
526 {
531 };
532 
533 /* ---------------------------------------------------------------------------------------------- */
534 /* AVX mask mode */
535 /* ---------------------------------------------------------------------------------------------- */
536 
540 typedef uint8_t ZydisMaskMode;
541 
546 {
557 };
558 
559 /* ---------------------------------------------------------------------------------------------- */
560 /* AVX broadcast-mode */
561 /* ---------------------------------------------------------------------------------------------- */
562 
566 typedef uint16_t ZydisBroadcastMode;
567 
572 {
586 };
587 
588 /* ---------------------------------------------------------------------------------------------- */
589 /* AVX rounding-mode */
590 /* ---------------------------------------------------------------------------------------------- */
591 
595 typedef uint8_t ZydisRoundingMode;
596 
601 {
619 };
620 
621 /* ---------------------------------------------------------------------------------------------- */
622 /* KNC swizzle-mode */
623 /* ---------------------------------------------------------------------------------------------- */
624 
628 typedef uint16_t ZydisSwizzleMode;
629 
634 {
644 };
645 
646 /* ---------------------------------------------------------------------------------------------- */
647 /* KNC conversion-mode */
648 /* ---------------------------------------------------------------------------------------------- */
649 
653 typedef uint16_t ZydisConversionMode;
654 
659 {
666 };
667 
668 /* ---------------------------------------------------------------------------------------------- */
669 /* Decoded instruction */
670 /* ---------------------------------------------------------------------------------------------- */
671 
676 {
688  uint8_t length;
704  uint8_t opcode;
708  uint8_t operandSize;
712  uint8_t stackWidth;
716  uint8_t addressWidth;
720  uint8_t operandCount;
733  uint64_t instrAddress;
740  uint64_t instrPointer;
744  struct
745  {
757  struct
758  {
766  struct
767  {
780  } mask;
784  struct
785  {
818  } avx;
823  struct
824  {
828  struct
829  {
830  uint8_t data[ZYDIS_MAX_INSTRUCTION_LENGTH - 1];
831  uint8_t count;
832  uint8_t hasF0;
833  uint8_t hasF3;
834  uint8_t hasF2;
835  uint8_t has2E;
836  uint8_t has36;
837  uint8_t has3E;
838  uint8_t has26;
839  uint8_t has64;
840  uint8_t has65;
841  uint8_t has66;
842  uint8_t has67;
847  struct
848  {
856  uint8_t data[1];
860  uint8_t W;
864  uint8_t R;
868  uint8_t X;
872  uint8_t B;
873  } rex;
877  struct
878  {
886  uint8_t data[3];
890  uint8_t R;
894  uint8_t X;
898  uint8_t B;
902  uint8_t m_mmmm;
906  uint8_t W;
910  uint8_t vvvv;
914  uint8_t L;
918  uint8_t pp;
919  } xop;
923  struct
924  {
932  uint8_t data[3];
936  uint8_t R;
940  uint8_t X;
944  uint8_t B;
948  uint8_t m_mmmm;
952  uint8_t W;
956  uint8_t vvvv;
960  uint8_t L;
964  uint8_t pp;
965  } vex;
969  struct
970  {
978  uint8_t data[4];
982  uint8_t R;
986  uint8_t X;
990  uint8_t B;
994  uint8_t R2;
998  uint8_t mm;
1002  uint8_t W;
1006  uint8_t vvvv;
1010  uint8_t pp;
1014  uint8_t z;
1018  uint8_t L2;
1022  uint8_t L;
1026  uint8_t b;
1030  uint8_t V2;
1034  uint8_t aaa;
1035  } evex;
1039  struct
1040  {
1048  uint8_t data[4];
1052  uint8_t R;
1056  uint8_t X;
1060  uint8_t B;
1064  uint8_t R2;
1068  uint8_t mmmm;
1072  uint8_t W;
1076  uint8_t vvvv;
1080  uint8_t pp;
1084  uint8_t E;
1088  uint8_t SSS;
1092  uint8_t V2;
1096  uint8_t kkk;
1097  } mvex;
1101  struct
1102  {
1104  uint8_t data[1];
1105  uint8_t mod;
1106  uint8_t reg;
1107  uint8_t rm;
1112  struct
1113  {
1115  uint8_t data[1];
1116  uint8_t scale;
1117  uint8_t index;
1118  uint8_t base;
1119  } sib;
1123  struct
1124  {
1128  int64_t value;
1132  uint8_t size;
1137  uint8_t offset;
1138  } disp;
1142  struct
1143  {
1157  union
1158  {
1159  uint64_t u;
1160  int64_t s;
1165  uint8_t size;
1170  uint8_t offset;
1171  } imm[2];
1172  } raw;
1176  void* userData;
1178 
1179 /* ---------------------------------------------------------------------------------------------- */
1180 
1181 /* ============================================================================================== */
1182 
1183 #ifdef __cplusplus
1184 }
1185 #endif
1186 
1187 #endif /* ZYDIS_INSTRUCTIONINFO_H */
Includes and defines some default datatypes.
uint8_t ZydisBool
@briefs Defines the ZydisBool datatype.
Definition: CommonTypes.h:63
ZydisConversionModes
Values that represent conversion-modes.
Definition: DecoderTypes.h:659
@ ZYDIS_CONVERSION_MODE_SINT8
Definition: DecoderTypes.h:662
@ ZYDIS_CONVERSION_MODE_INVALID
Definition: DecoderTypes.h:660
@ ZYDIS_CONVERSION_MODE_SINT16
Definition: DecoderTypes.h:664
@ ZYDIS_CONVERSION_MODE_UINT16
Definition: DecoderTypes.h:665
@ ZYDIS_CONVERSION_MODE_FLOAT16
Definition: DecoderTypes.h:661
@ ZYDIS_CONVERSION_MODE_UINT8
Definition: DecoderTypes.h:663
uint16_t ZydisConversionMode
Defines the ZydisConversionMode datatype.
Definition: DecoderTypes.h:653
uint16_t ZydisBroadcastMode
Defines the ZydisBroadcastMode datatype.
Definition: DecoderTypes.h:566
ZydisExceptionClasses
Values that represent exception-classes.
Definition: DecoderTypes.h:486
@ ZYDIS_EXCEPTION_CLASS_E5
Definition: DecoderTypes.h:497
@ ZYDIS_EXCEPTION_CLASS_E1NF
Definition: DecoderTypes.h:490
@ ZYDIS_EXCEPTION_CLASS_E7NM128
Definition: DecoderTypes.h:502
@ ZYDIS_EXCEPTION_CLASS_E12NP
Definition: DecoderTypes.h:508
@ ZYDIS_EXCEPTION_CLASS_E10
Definition: DecoderTypes.h:504
@ ZYDIS_EXCEPTION_CLASS_E3
Definition: DecoderTypes.h:493
@ ZYDIS_EXCEPTION_CLASS_E1
Definition: DecoderTypes.h:489
@ ZYDIS_EXCEPTION_CLASS_K20
Definition: DecoderTypes.h:509
@ ZYDIS_EXCEPTION_CLASS_E9NF
Definition: DecoderTypes.h:503
@ ZYDIS_EXCEPTION_CLASS_E3NF
Definition: DecoderTypes.h:494
@ ZYDIS_EXCEPTION_CLASS_E11
Definition: DecoderTypes.h:506
@ ZYDIS_EXCEPTION_CLASS_E4
Definition: DecoderTypes.h:495
@ ZYDIS_EXCEPTION_CLASS_E12
Definition: DecoderTypes.h:507
@ ZYDIS_EXCEPTION_CLASS_K21
Definition: DecoderTypes.h:510
@ ZYDIS_EXCEPTION_CLASS_E6NF
Definition: DecoderTypes.h:500
@ ZYDIS_EXCEPTION_CLASS_E2NF
Definition: DecoderTypes.h:492
@ ZYDIS_EXCEPTION_CLASS_E5NF
Definition: DecoderTypes.h:498
@ ZYDIS_EXCEPTION_CLASS_NONE
Definition: DecoderTypes.h:487
@ ZYDIS_EXCEPTION_CLASS_E6
Definition: DecoderTypes.h:499
@ ZYDIS_EXCEPTION_CLASS_E10NF
Definition: DecoderTypes.h:505
@ ZYDIS_EXCEPTION_CLASS_E4NF
Definition: DecoderTypes.h:496
@ ZYDIS_EXCEPTION_CLASS_E2
Definition: DecoderTypes.h:491
@ ZYDIS_EXCEPTION_CLASS_E7NM
Definition: DecoderTypes.h:501
uint8_t ZydisRoundingMode
Defines the ZydisRoundingMode datatype.
Definition: DecoderTypes.h:595
ZydisVectorLengths
Values that represent vector-lengths.
Definition: DecoderTypes.h:526
@ ZYDIS_VECTOR_LENGTH_256
Definition: DecoderTypes.h:529
@ ZYDIS_VECTOR_LENGTH_512
Definition: DecoderTypes.h:530
@ ZYDIS_VECTOR_LENGTH_128
Definition: DecoderTypes.h:528
@ ZYDIS_VECTOR_LENGTH_INVALID
Definition: DecoderTypes.h:527
ZydisMaskModes
Values that represent AVX mask-modes.
Definition: DecoderTypes.h:546
@ ZYDIS_MASK_MODE_INVALID
Definition: DecoderTypes.h:547
@ ZYDIS_MASK_MODE_MERGE
The embedded mask register is used as a merge-mask.
Definition: DecoderTypes.h:552
@ ZYDIS_MASK_MODE_ZERO
The embedded mask register is used as a zero-mask.
Definition: DecoderTypes.h:556
uint32_t ZydisCPUFlagMask
Defines the ZydisCPUFlagMask datatype.
Definition: DecoderTypes.h:357
uint64_t ZydisInstructionAttributes
Defines the ZydisInstructionAttributes datatype.
Definition: DecoderTypes.h:177
ZydisCPUFlags
Values that represent CPU-flags.
Definition: DecoderTypes.h:363
@ ZYDIS_CPUFLAG_ZF
Zero flag.
Definition: DecoderTypes.h:379
@ ZYDIS_CPUFLAG_TF
Trap flag.
Definition: DecoderTypes.h:387
@ ZYDIS_CPUFLAG_C1
FPU condition-code flag 1.
Definition: DecoderTypes.h:439
@ ZYDIS_CPUFLAG_SF
Sign flag.
Definition: DecoderTypes.h:383
@ ZYDIS_CPUFLAG_OF
Overflow flag.
Definition: DecoderTypes.h:399
@ ZYDIS_CPUFLAG_IF
Interrupt enable flag.
Definition: DecoderTypes.h:391
@ ZYDIS_CPUFLAG_VIP
Virtual interrupt pending.
Definition: DecoderTypes.h:427
@ ZYDIS_CPUFLAG_VIF
Virtual interrupt flag.
Definition: DecoderTypes.h:423
@ ZYDIS_CPUFLAG_CF
Carry flag.
Definition: DecoderTypes.h:367
@ ZYDIS_CPUFLAG_PF
Parity flag.
Definition: DecoderTypes.h:371
@ ZYDIS_CPUFLAG_C3
FPU condition-code flag 3.
Definition: DecoderTypes.h:447
@ ZYDIS_CPUFLAG_ENUM_COUNT
Marker value.
Definition: DecoderTypes.h:452
@ ZYDIS_CPUFLAG_C2
FPU condition-code flag 2.
Definition: DecoderTypes.h:443
@ ZYDIS_CPUFLAG_C0
FPU condition-code flag 0.
Definition: DecoderTypes.h:435
@ ZYDIS_CPUFLAG_DF
Direction flag.
Definition: DecoderTypes.h:395
@ ZYDIS_CPUFLAG_AC
Alignment check.
Definition: DecoderTypes.h:419
@ ZYDIS_CPUFLAG_VM
Virtual 8086 mode flag.
Definition: DecoderTypes.h:415
@ ZYDIS_CPUFLAG_IOPL
I/O privilege level flag.
Definition: DecoderTypes.h:403
@ ZYDIS_CPUFLAG_RF
Resume flag.
Definition: DecoderTypes.h:411
@ ZYDIS_CPUFLAG_AF
Adjust flag.
Definition: DecoderTypes.h:375
@ ZYDIS_CPUFLAG_NT
Nested task flag.
Definition: DecoderTypes.h:407
@ ZYDIS_CPUFLAG_ID
Able to use CPUID instruction.
Definition: DecoderTypes.h:431
uint8_t ZydisMaskMode
Defines the ZydisMaskMode datatype.
Definition: DecoderTypes.h:540
uint16_t ZydisVectorLength
Defines the ZydisVectorLength datatype.
Definition: DecoderTypes.h:520
uint16_t ZydisExceptionClass
Defines the ZydisExceptionClass datatype.
Definition: DecoderTypes.h:480
struct ZydisDecodedOperand_ ZydisDecodedOperand
Defines the ZydisDecodedOperand struct.
uint8_t ZydisCPUFlagAction
Defines the ZydisCPUFlagAction datatype.
Definition: DecoderTypes.h:458
ZydisRoundingModes
Values that represent AVX rounding-modes.
Definition: DecoderTypes.h:601
@ ZYDIS_ROUNDING_MODE_INVALID
Definition: DecoderTypes.h:602
@ ZYDIS_ROUNDING_MODE_RN
Round to nearest.
Definition: DecoderTypes.h:606
@ ZYDIS_ROUNDING_MODE_RZ
Round towards zero.
Definition: DecoderTypes.h:618
@ ZYDIS_ROUNDING_MODE_RD
Round down.
Definition: DecoderTypes.h:610
@ ZYDIS_ROUNDING_MODE_RU
Round up.
Definition: DecoderTypes.h:614
uint8_t ZydisCPUFlag
Defines the ZydisCPUFlag datatype.
Definition: DecoderTypes.h:352
ZydisCPUFlagActions
Values that represent CPU-flag actions.
Definition: DecoderTypes.h:464
@ ZYDIS_CPUFLAG_ACTION_SET_0
Definition: DecoderTypes.h:468
@ ZYDIS_CPUFLAG_ACTION_NONE
Definition: DecoderTypes.h:465
@ ZYDIS_CPUFLAG_ACTION_UNDEFINED
Definition: DecoderTypes.h:470
@ ZYDIS_CPUFLAG_ACTION_MODIFIED
Definition: DecoderTypes.h:467
@ ZYDIS_CPUFLAG_ACTION_SET_1
Definition: DecoderTypes.h:469
@ ZYDIS_CPUFLAG_ACTION_TESTED
Definition: DecoderTypes.h:466
struct ZydisDecodedInstruction_ ZydisDecodedInstruction
Defines the ZydisDecodedInstruction struct.
uint16_t ZydisSwizzleMode
Defines the ZydisSwizzleMode datatype.
Definition: DecoderTypes.h:628
ZydisSwizzleModes
Values that represent swizzle-modes.
Definition: DecoderTypes.h:634
@ ZYDIS_SWIZZLE_MODE_DACB
Definition: DecoderTypes.h:639
@ ZYDIS_SWIZZLE_MODE_BADC
Definition: DecoderTypes.h:638
@ ZYDIS_SWIZZLE_MODE_AAAA
Definition: DecoderTypes.h:640
@ ZYDIS_SWIZZLE_MODE_DCBA
Definition: DecoderTypes.h:636
@ ZYDIS_SWIZZLE_MODE_BBBB
Definition: DecoderTypes.h:641
@ ZYDIS_SWIZZLE_MODE_CCCC
Definition: DecoderTypes.h:642
@ ZYDIS_SWIZZLE_MODE_DDDD
Definition: DecoderTypes.h:643
@ ZYDIS_SWIZZLE_MODE_CDAB
Definition: DecoderTypes.h:637
@ ZYDIS_SWIZZLE_MODE_INVALID
Definition: DecoderTypes.h:635
ZydisBroadcastModes
Values that represent AVX broadcast-modes.
Definition: DecoderTypes.h:572
@ ZYDIS_BROADCAST_MODE_1_TO_8
Definition: DecoderTypes.h:576
@ ZYDIS_BROADCAST_MODE_INVALID
Definition: DecoderTypes.h:573
@ ZYDIS_BROADCAST_MODE_1_TO_2
Definition: DecoderTypes.h:574
@ ZYDIS_BROADCAST_MODE_1_TO_64
Definition: DecoderTypes.h:579
@ ZYDIS_BROADCAST_MODE_2_TO_8
Definition: DecoderTypes.h:581
@ ZYDIS_BROADCAST_MODE_4_TO_16
Definition: DecoderTypes.h:584
@ ZYDIS_BROADCAST_MODE_4_TO_8
Definition: DecoderTypes.h:583
@ ZYDIS_BROADCAST_MODE_1_TO_16
Definition: DecoderTypes.h:577
@ ZYDIS_BROADCAST_MODE_1_TO_4
Definition: DecoderTypes.h:575
@ ZYDIS_BROADCAST_MODE_2_TO_4
Definition: DecoderTypes.h:580
@ ZYDIS_BROADCAST_MODE_2_TO_16
Definition: DecoderTypes.h:582
@ ZYDIS_BROADCAST_MODE_1_TO_32
Definition: DecoderTypes.h:578
@ ZYDIS_BROADCAST_MODE_8_TO_16
Definition: DecoderTypes.h:585
uint16_t ZydisMnemonic
Defines the ZydisMnemonic datatype.
Definition: Mnemonic.h:44
uint8_t ZydisRegister
Defines the ZydisRegister datatype.
Definition: Register.h:49
Defines decoder/encoder-shared macros and types.
uint8_t ZydisMachineMode
Defines the ZydisMachineMode datatype.
Definition: SharedTypes.h:65
uint16_t ZydisElementSize
Defines the ZydisElementSize datatype.
Definition: SharedTypes.h:147
uint8_t ZydisOperandAction
Defines the ZydisOperandAction datatype.
Definition: SharedTypes.h:272
uint8_t ZydisInstructionEncoding
Defines the ZydisInstructionEncoding datatype.
Definition: SharedTypes.h:317
#define ZYDIS_MAX_INSTRUCTION_LENGTH
Definition: SharedTypes.h:49
uint8_t ZydisOpcodeMap
Defines the ZydisOpcodeMap map.
Definition: SharedTypes.h:358
uint8_t ZydisOperandVisibility
Defines the ZydisOperandVisibility datatype.
Definition: SharedTypes.h:243
#define ZYDIS_MAX_OPERAND_COUNT
Definition: SharedTypes.h:50
uint8_t ZydisElementType
Defines the ZydisElementType datatype.
Definition: SharedTypes.h:126
uint8_t ZydisOperandType
Defines the ZydisOperandType datatype.
Definition: SharedTypes.h:156
uint8_t ZydisOperandEncoding
Defines the ZydisOperandEncoding datatype.
Definition: SharedTypes.h:192
Defines the ZydisDecodedInstruction struct.
Definition: DecoderTypes.h:676
uint8_t has2E
Definition: DecoderTypes.h:835
struct ZydisDecodedInstruction_::@7::@14 evex
Detailed info about the EVEX-prefix.
uint8_t rm
Definition: DecoderTypes.h:1107
struct ZydisDecodedInstruction_::@6 avx
Extended info for AVX instructions.
int64_t s
Definition: DecoderTypes.h:1160
struct ZydisDecodedInstruction_::@7 raw
Extended info about different instruction-parts like ModRM, SIB or encoding-prefixes.
ZydisMnemonic mnemonic
The instruction-mnemonic.
Definition: DecoderTypes.h:684
struct ZydisDecodedInstruction_::@7::@10 prefixes
Detailed info about the legacy prefixes.
uint8_t SSS
Swizzle/broadcast/up-convert/down-convert/static-rounding controls.
Definition: DecoderTypes.h:1088
uint8_t count
Definition: DecoderTypes.h:831
struct ZydisDecodedInstruction_::@7::@15 mvex
Detailed info about the MVEX-prefix.
ZydisRegister reg
The mask register.
Definition: DecoderTypes.h:775
ZydisCPUFlagAction action
The CPU-flag action.
Definition: DecoderTypes.h:752
uint8_t hasF3
Definition: DecoderTypes.h:833
void * userData
This field is intended for custom data and may be freely set by the user.
Definition: DecoderTypes.h:1176
uint8_t operandSize
The effective operand size.
Definition: DecoderTypes.h:708
uint8_t has64
Definition: DecoderTypes.h:839
uint8_t R2
High-16 register specifier modifier (inverted).
Definition: DecoderTypes.h:994
uint8_t addressWidth
The effective address width.
Definition: DecoderTypes.h:716
uint8_t aaa
Embedded opmask register specifier.
Definition: DecoderTypes.h:1034
uint8_t b
Broadcast/RC/SAE Context.
Definition: DecoderTypes.h:1026
ZydisBroadcastMode mode
The AVX broadcast-mode.
Definition: DecoderTypes.h:796
uint8_t E
Non-temporal/eviction hint.
Definition: DecoderTypes.h:1084
uint8_t W
64-bit operand-size promotion.
Definition: DecoderTypes.h:860
uint8_t opcode
The instruction-opcode.
Definition: DecoderTypes.h:704
uint8_t scale
Definition: DecoderTypes.h:1116
uint8_t mmmm
Opcode-map specifier.
Definition: DecoderTypes.h:1068
uint8_t has3E
Definition: DecoderTypes.h:837
uint8_t L2
Vector-length specifier or rounding-control (most significant bit).
Definition: DecoderTypes.h:1018
struct ZydisDecodedInstruction_::@7::@16 modrm
Detailed info about the ModRM-byte.
struct ZydisDecodedInstruction_::@7::@17 sib
Detailed info about the SIB-byte.
ZydisBool isDecoded
TRUE if the prefix got already decoded.
Definition: DecoderTypes.h:852
ZydisSwizzleMode swizzleMode
The AVX register-swizzle mode (MVEX only).
Definition: DecoderTypes.h:805
uint8_t hasF0
Definition: DecoderTypes.h:832
struct ZydisDecodedInstruction_::@7::@13 vex
Detailed info about the VEX-prefix.
uint8_t mm
Opcode-map specifier.
Definition: DecoderTypes.h:998
uint8_t B
Extension of the ModRM.rm, SIB.base, or opcode.reg field.
Definition: DecoderTypes.h:872
uint8_t mod
Definition: DecoderTypes.h:1105
struct ZydisDecodedInstruction_::@6::@8 mask
Info about the embedded writemask-register.
ZydisVectorLength vectorLength
The AVX vector-length.
Definition: DecoderTypes.h:762
uint8_t operandCount
The number of instruction-operands.
Definition: DecoderTypes.h:720
struct ZydisDecodedInstruction_::@5 flags[ZYDIS_CPUFLAG_ENUM_COUNT]
Information about accessed CPU flags.
ZydisInstructionEncoding encoding
The instruction-encoding (default, 3DNow, VEX, EVEX, XOP).
Definition: DecoderTypes.h:696
uint8_t hasF2
Definition: DecoderTypes.h:834
ZydisRoundingMode roundingMode
The AVX rounding-mode.
Definition: DecoderTypes.h:801
ZydisInstructionAttributes attributes
Instruction attributes.
Definition: DecoderTypes.h:728
uint8_t reg
Definition: DecoderTypes.h:1106
uint8_t vvvv
NDS register specifier (inverted).
Definition: DecoderTypes.h:910
ZydisBool isRelative
Signals, if the immediate value contains a relative offset.
Definition: DecoderTypes.h:1153
uint8_t has26
Definition: DecoderTypes.h:838
ZydisMaskMode mode
The masking mode.
Definition: DecoderTypes.h:771
uint8_t stackWidth
The stack width.
Definition: DecoderTypes.h:712
uint8_t kkk
Embedded opmask register specifier.
Definition: DecoderTypes.h:1096
uint8_t has66
Definition: DecoderTypes.h:841
ZydisBool hasSAE
Signals, if the sae functionality is enabled for the instruction.
Definition: DecoderTypes.h:813
uint8_t offset
The offset of the displacement data, relative to the beginning of the instruction,...
Definition: DecoderTypes.h:1137
uint8_t X
Extension of the SIB.index field.
Definition: DecoderTypes.h:868
ZydisDecodedOperand operands[ZYDIS_MAX_OPERAND_COUNT]
Detailed info for all instruction operands.
Definition: DecoderTypes.h:724
struct ZydisDecodedInstruction_::@7::@19 imm[2]
Detailed info about immediate-bytes.
uint8_t index
Definition: DecoderTypes.h:1117
uint64_t instrAddress
The instruction address points at the current instruction (relative to the initial instruction pointe...
Definition: DecoderTypes.h:733
uint8_t length
The length of the decoded instruction.
Definition: DecoderTypes.h:688
uint8_t z
Zeroing/Merging.
Definition: DecoderTypes.h:1014
ZydisConversionMode conversionMode
The AVX data-conversion mode (MVEX only).
Definition: DecoderTypes.h:809
uint8_t has67
Definition: DecoderTypes.h:842
uint8_t has36
Definition: DecoderTypes.h:836
uint64_t u
Definition: DecoderTypes.h:1159
int64_t value
The displacement value.
Definition: DecoderTypes.h:1128
ZydisBool isStatic
Signals, if the broadcast is a static broadcast.
Definition: DecoderTypes.h:792
ZydisBool hasEvictionHint
Signals, if the instruction has a memory eviction-hint (MVEX only).
Definition: DecoderTypes.h:817
uint64_t instrPointer
The instruction pointer points at the address of the next instruction (relative to the initial instru...
Definition: DecoderTypes.h:740
uint8_t m_mmmm
Opcode-map specifier.
Definition: DecoderTypes.h:902
uint8_t base
Definition: DecoderTypes.h:1118
uint8_t R
Extension of the ModRM.reg field.
Definition: DecoderTypes.h:864
struct ZydisDecodedInstruction_::@6::@9 broadcast
Contains info about the AVX broadcast-factor.
ZydisBool isSigned
Signals, if the immediate value is signed.
Definition: DecoderTypes.h:1147
uint8_t V2
High-16 NDS/VIDX register specifier.
Definition: DecoderTypes.h:1030
ZydisOpcodeMap opcodeMap
The opcode-map.
Definition: DecoderTypes.h:700
uint8_t pp
Compressed legacy prefix.
Definition: DecoderTypes.h:918
uint8_t size
The physical displacement size, in bits.
Definition: DecoderTypes.h:1132
ZydisBool isControlMask
Signals, if the mask-register is used as a control mask.
Definition: DecoderTypes.h:779
uint8_t L
Vector-length specifier.
Definition: DecoderTypes.h:914
struct ZydisDecodedInstruction_::@7::@11 rex
Detailed info about the REX-prefix.
ZydisMachineMode machineMode
The machine mode used to decode this instruction.
Definition: DecoderTypes.h:680
struct ZydisDecodedInstruction_::@7::@18 disp
Detailed info about displacement-bytes.
uint8_t has65
Definition: DecoderTypes.h:840
uint8_t data[ZYDIS_MAX_INSTRUCTION_LENGTH]
The raw bytes of the decoded instruction.
Definition: DecoderTypes.h:692
struct ZydisDecodedInstruction_::@7::@12 xop
Detailed info about the XOP-prefix.
Defines the ZydisDecodedOperand struct.
Definition: DecoderTypes.h:52
struct ZydisDecodedOperand_::@1 ptr
Extended info for pointer-operands.
int64_t s
Definition: DecoderTypes.h:161
ZydisBool isAddressGenOnly
Signals, if the memory operand is only used for address generation.
Definition: DecoderTypes.h:101
ZydisOperandAction action
The operand-action.
Definition: DecoderTypes.h:68
uint8_t id
The operand-id.
Definition: DecoderTypes.h:56
struct ZydisDecodedOperand_::@0::@3 disp
Extended info for memory-operands with displacement.
ZydisRegister reg
Extended info for register-operands.
Definition: DecoderTypes.h:92
ZydisOperandEncoding encoding
The operand-encoding.
Definition: DecoderTypes.h:72
ZydisRegister segment
The segment register.
Definition: DecoderTypes.h:105
struct ZydisDecodedOperand_::@0 mem
Extended info for memory-operands.
uint16_t elementCount
The number of elements.
Definition: DecoderTypes.h:88
ZydisRegister base
The base register.
Definition: DecoderTypes.h:109
ZydisOperandVisibility visibility
The visibility of the operand.
Definition: DecoderTypes.h:64
ZydisElementSize elementSize
The size of a single element.
Definition: DecoderTypes.h:84
uint8_t scale
The scale factor.
Definition: DecoderTypes.h:117
struct ZydisDecodedOperand_::@2 imm
Extended info for immediate-operands.
ZydisElementType elementType
The element-type.
Definition: DecoderTypes.h:80
uint32_t offset
Definition: DecoderTypes.h:139
ZydisBool isRelative
Signals, if the immediate value contains a relative offset.
Definition: DecoderTypes.h:154
uint16_t segment
Definition: DecoderTypes.h:138
ZydisBool hasDisplacement
Signals, if the displacement value is used.
Definition: DecoderTypes.h:126
uint16_t size
The logical size of the operand (in bits).
Definition: DecoderTypes.h:76
uint64_t u
Definition: DecoderTypes.h:160
int64_t value
The displacement value.
Definition: DecoderTypes.h:130
ZydisRegister index
The index register.
Definition: DecoderTypes.h:113
ZydisBool isSigned
Signals, if the immediate value is signed.
Definition: DecoderTypes.h:149
ZydisOperandType type
The type of the operand.
Definition: DecoderTypes.h:60