Zydis  v2.0.0-beta1
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/MetaInfo.h>
37 #include <Zydis/Mnemonic.h>
38 #include <Zydis/Register.h>
39 #include <Zydis/SharedTypes.h>
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
45 /* ============================================================================================== */
46 /* Decoded operand */
47 /* ============================================================================================== */
48 
49 /* ---------------------------------------------------------------------------------------------- */
50 /* Memory type */
51 /* ---------------------------------------------------------------------------------------------- */
52 
56 typedef ZydisU8 ZydisMemoryOperandType;
57 
62 {
63  ZYDIS_MEMOP_TYPE_INVALID,
79 };
80 
81 /* ---------------------------------------------------------------------------------------------- */
82 /* Decoded operand */
83 /* ---------------------------------------------------------------------------------------------- */
84 
88 typedef struct ZydisDecodedOperand_
89 {
93  ZydisU8 id;
113  ZydisU16 size;
125  ZydisU16 elementCount;
129  struct
130  {
135  // TODO: AVX512_4VNNIW MULTISOURCE registers
136  } reg;
140  struct
141  {
161  ZydisU8 scale;
165  struct
166  {
174  ZydisI64 value;
175  } disp;
176  } mem;
180  struct
181  {
182  ZydisU16 segment;
183  ZydisU32 offset;
184  } ptr;
188  struct
189  {
202  union
203  {
204  ZydisU64 u;
205  ZydisI64 s;
206  } value;
207  } imm;
209 
210 /* ---------------------------------------------------------------------------------------------- */
211 
212 /* ============================================================================================== */
213 /* Decoded instruction */
214 /* ============================================================================================== */
215 
216 /* ---------------------------------------------------------------------------------------------- */
217 /* Instruction attributes */
218 /* ---------------------------------------------------------------------------------------------- */
219 
223 typedef ZydisU64 ZydisInstructionAttributes;
224 
228 #define ZYDIS_ATTRIB_HAS_MODRM 0x0000000000000001 // (1 << 0)
232 #define ZYDIS_ATTRIB_HAS_SIB 0x0000000000000002 // (1 << 1)
236 #define ZYDIS_ATTRIB_HAS_REX 0x0000000000000004 // (1 << 2)
240 #define ZYDIS_ATTRIB_HAS_XOP 0x0000000000000008 // (1 << 3)
244 #define ZYDIS_ATTRIB_HAS_VEX 0x0000000000000010 // (1 << 4)
248 #define ZYDIS_ATTRIB_HAS_EVEX 0x0000000000000020 // (1 << 5)
252 #define ZYDIS_ATTRIB_HAS_MVEX 0x0000000000000040 // (1 << 6)
256 #define ZYDIS_ATTRIB_IS_RELATIVE 0x0000000000000080 // (1 << 7)
262 #define ZYDIS_ATTRIB_IS_PRIVILEGED 0x0000000000000100 // (1 << 8)
263 
267 #define ZYDIS_ATTRIB_IS_FAR_BRANCH 0x0000001000000000 // (1 << 36) // TODO: rebase
268 
272 #define ZYDIS_ATTRIB_ACCEPTS_LOCK 0x0000000000000200 // (1 << 9)
276 #define ZYDIS_ATTRIB_ACCEPTS_REP 0x0000000000000400 // (1 << 10)
280 #define ZYDIS_ATTRIB_ACCEPTS_REPE 0x0000000000000800 // (1 << 11)
284 #define ZYDIS_ATTRIB_ACCEPTS_REPZ 0x0000000000000800 // (1 << 11)
288 #define ZYDIS_ATTRIB_ACCEPTS_REPNE 0x0000000000001000 // (1 << 12)
292 #define ZYDIS_ATTRIB_ACCEPTS_REPNZ 0x0000000000001000 // (1 << 12)
296 #define ZYDIS_ATTRIB_ACCEPTS_BOUND 0x0000000000002000 // (1 << 13)
300 #define ZYDIS_ATTRIB_ACCEPTS_XACQUIRE 0x0000000000004000 // (1 << 14)
304 #define ZYDIS_ATTRIB_ACCEPTS_XRELEASE 0x0000000000008000 // (1 << 15)
309 #define ZYDIS_ATTRIB_ACCEPTS_HLE_WITHOUT_LOCK 0x0000000000010000 // (1 << 16)
313 #define ZYDIS_ATTRIB_ACCEPTS_BRANCH_HINTS 0x0000000000020000 // (1 << 17)
317 #define ZYDIS_ATTRIB_ACCEPTS_SEGMENT 0x0000000000040000 // (1 << 18)
321 #define ZYDIS_ATTRIB_HAS_LOCK 0x0000000000080000 // (1 << 19)
325 #define ZYDIS_ATTRIB_HAS_REP 0x0000000000100000 // (1 << 20)
329 #define ZYDIS_ATTRIB_HAS_REPE 0x0000000000200000 // (1 << 21)
333 #define ZYDIS_ATTRIB_HAS_REPZ 0x0000000000200000 // (1 << 21)
337 #define ZYDIS_ATTRIB_HAS_REPNE 0x0000000000400000 // (1 << 22)
341 #define ZYDIS_ATTRIB_HAS_REPNZ 0x0000000000400000 // (1 << 22)
345 #define ZYDIS_ATTRIB_HAS_BOUND 0x0000000000800000 // (1 << 23)
349 #define ZYDIS_ATTRIB_HAS_XACQUIRE 0x0000000001000000 // (1 << 24)
353 #define ZYDIS_ATTRIB_HAS_XRELEASE 0x0000000002000000 // (1 << 25)
357 #define ZYDIS_ATTRIB_HAS_BRANCH_NOT_TAKEN 0x0000000004000000 // (1 << 26)
361 #define ZYDIS_ATTRIB_HAS_BRANCH_TAKEN 0x0000000008000000 // (1 << 27)
365 #define ZYDIS_ATTRIB_HAS_SEGMENT 0x00000003F0000000
369 #define ZYDIS_ATTRIB_HAS_SEGMENT_CS 0x0000000010000000 // (1 << 28)
373 #define ZYDIS_ATTRIB_HAS_SEGMENT_SS 0x0000000020000000 // (1 << 29)
377 #define ZYDIS_ATTRIB_HAS_SEGMENT_DS 0x0000000040000000 // (1 << 30)
381 #define ZYDIS_ATTRIB_HAS_SEGMENT_ES 0x0000000080000000 // (1 << 31)
385 #define ZYDIS_ATTRIB_HAS_SEGMENT_FS 0x0000000100000000 // (1 << 32)
389 #define ZYDIS_ATTRIB_HAS_SEGMENT_GS 0x0000000200000000 // (1 << 33)
393 #define ZYDIS_ATTRIB_HAS_OPERANDSIZE 0x0000000400000000 // (1 << 34) // TODO: rename
397 #define ZYDIS_ATTRIB_HAS_ADDRESSSIZE 0x0000000800000000 // (1 << 35) // TODO: rename
398 
399 /* ---------------------------------------------------------------------------------------------- */
400 /* R/E/FLAGS info */
401 /* ---------------------------------------------------------------------------------------------- */
402 
406 typedef ZydisU8 ZydisCPUFlag;
407 
411 typedef ZydisU32 ZydisCPUFlagMask;
412 
417 {
506 };
507 
511 typedef ZydisU8 ZydisCPUFlagAction;
512 
517 {
518  ZYDIS_CPUFLAG_ACTION_NONE,
519  ZYDIS_CPUFLAG_ACTION_TESTED,
520  ZYDIS_CPUFLAG_ACTION_MODIFIED,
521  ZYDIS_CPUFLAG_ACTION_SET_0,
522  ZYDIS_CPUFLAG_ACTION_SET_1,
523  ZYDIS_CPUFLAG_ACTION_UNDEFINED,
527  ZYDIS_CPUFLAG_ACTION_MAX_VALUE = ZYDIS_CPUFLAG_ACTION_UNDEFINED
528 };
529 
530 /* ---------------------------------------------------------------------------------------------- */
531 /* SSE/AVX exception-class */
532 /* ---------------------------------------------------------------------------------------------- */
533 
537 typedef ZydisU8 ZydisExceptionClass;
538 
543 {
544  ZYDIS_EXCEPTION_CLASS_NONE,
545  // TODO: FP Exceptions
546  ZYDIS_EXCEPTION_CLASS_SSE1,
547  ZYDIS_EXCEPTION_CLASS_SSE2,
548  ZYDIS_EXCEPTION_CLASS_SSE3,
549  ZYDIS_EXCEPTION_CLASS_SSE4,
550  ZYDIS_EXCEPTION_CLASS_SSE5,
551  ZYDIS_EXCEPTION_CLASS_SSE7,
552  ZYDIS_EXCEPTION_CLASS_AVX1,
553  ZYDIS_EXCEPTION_CLASS_AVX2,
554  ZYDIS_EXCEPTION_CLASS_AVX3,
555  ZYDIS_EXCEPTION_CLASS_AVX4,
556  ZYDIS_EXCEPTION_CLASS_AVX5,
557  ZYDIS_EXCEPTION_CLASS_AVX6,
558  ZYDIS_EXCEPTION_CLASS_AVX7,
559  ZYDIS_EXCEPTION_CLASS_AVX8,
560  ZYDIS_EXCEPTION_CLASS_AVX11,
561  ZYDIS_EXCEPTION_CLASS_AVX12,
562  ZYDIS_EXCEPTION_CLASS_E1,
563  ZYDIS_EXCEPTION_CLASS_E1NF,
564  ZYDIS_EXCEPTION_CLASS_E2,
565  ZYDIS_EXCEPTION_CLASS_E2NF,
566  ZYDIS_EXCEPTION_CLASS_E3,
567  ZYDIS_EXCEPTION_CLASS_E3NF,
568  ZYDIS_EXCEPTION_CLASS_E4,
569  ZYDIS_EXCEPTION_CLASS_E4NF,
570  ZYDIS_EXCEPTION_CLASS_E5,
571  ZYDIS_EXCEPTION_CLASS_E5NF,
572  ZYDIS_EXCEPTION_CLASS_E6,
573  ZYDIS_EXCEPTION_CLASS_E6NF,
574  ZYDIS_EXCEPTION_CLASS_E7NM,
575  ZYDIS_EXCEPTION_CLASS_E7NM128,
576  ZYDIS_EXCEPTION_CLASS_E9NF,
577  ZYDIS_EXCEPTION_CLASS_E10,
578  ZYDIS_EXCEPTION_CLASS_E10NF,
579  ZYDIS_EXCEPTION_CLASS_E11,
580  ZYDIS_EXCEPTION_CLASS_E11NF,
581  ZYDIS_EXCEPTION_CLASS_E12,
582  ZYDIS_EXCEPTION_CLASS_E12NP,
583  ZYDIS_EXCEPTION_CLASS_K20,
584  ZYDIS_EXCEPTION_CLASS_K21,
588  ZYDIS_EXCEPTION_CLASS_MAX_VALUE = ZYDIS_EXCEPTION_CLASS_K21
589 };
590 
591 /* ---------------------------------------------------------------------------------------------- */
592 /* AVX vector-length */
593 /* ---------------------------------------------------------------------------------------------- */
594 
598 typedef ZydisU16 ZydisVectorLength;
599 
604 {
605  ZYDIS_VECTOR_LENGTH_INVALID = 0,
606  ZYDIS_VECTOR_LENGTH_128 = 128,
607  ZYDIS_VECTOR_LENGTH_256 = 256,
608  ZYDIS_VECTOR_LENGTH_512 = 512,
612  ZYDIS_VECTOR_LENGTH_MAX_VALUE = ZYDIS_VECTOR_LENGTH_512
613 };
614 
615 /* ---------------------------------------------------------------------------------------------- */
616 /* AVX mask mode */
617 /* ---------------------------------------------------------------------------------------------- */
618 
622 typedef ZydisU8 ZydisMaskMode;
623 
628 {
629  ZYDIS_MASK_MODE_INVALID,
643 };
644 
645 /* ---------------------------------------------------------------------------------------------- */
646 /* AVX broadcast-mode */
647 /* ---------------------------------------------------------------------------------------------- */
648 
652 typedef ZydisU8 ZydisBroadcastMode;
653 
658 {
659  ZYDIS_BROADCAST_MODE_INVALID,
660  ZYDIS_BROADCAST_MODE_1_TO_2,
661  ZYDIS_BROADCAST_MODE_1_TO_4,
662  ZYDIS_BROADCAST_MODE_1_TO_8,
663  ZYDIS_BROADCAST_MODE_1_TO_16,
664  ZYDIS_BROADCAST_MODE_1_TO_32,
665  ZYDIS_BROADCAST_MODE_1_TO_64,
666  ZYDIS_BROADCAST_MODE_2_TO_4,
667  ZYDIS_BROADCAST_MODE_2_TO_8,
668  ZYDIS_BROADCAST_MODE_2_TO_16,
669  ZYDIS_BROADCAST_MODE_4_TO_8,
670  ZYDIS_BROADCAST_MODE_4_TO_16,
671  ZYDIS_BROADCAST_MODE_8_TO_16,
675  ZYDIS_BROADCAST_MODE_MAX_VALUE = ZYDIS_BROADCAST_MODE_8_TO_16
676 };
677 
678 /* ---------------------------------------------------------------------------------------------- */
679 /* AVX rounding-mode */
680 /* ---------------------------------------------------------------------------------------------- */
681 
685 typedef ZydisU8 ZydisRoundingMode;
686 
691 {
692  ZYDIS_ROUNDING_MODE_INVALID,
713 };
714 
715 /* ---------------------------------------------------------------------------------------------- */
716 /* KNC swizzle-mode */
717 /* ---------------------------------------------------------------------------------------------- */
718 
722 typedef ZydisU8 ZydisSwizzleMode;
723 
728 {
729  ZYDIS_SWIZZLE_MODE_INVALID,
730  ZYDIS_SWIZZLE_MODE_DCBA,
731  ZYDIS_SWIZZLE_MODE_CDAB,
732  ZYDIS_SWIZZLE_MODE_BADC,
733  ZYDIS_SWIZZLE_MODE_DACB,
734  ZYDIS_SWIZZLE_MODE_AAAA,
735  ZYDIS_SWIZZLE_MODE_BBBB,
736  ZYDIS_SWIZZLE_MODE_CCCC,
737  ZYDIS_SWIZZLE_MODE_DDDD,
741  ZYDIS_SWIZZLE_MODE_MAX_VALUE = ZYDIS_SWIZZLE_MODE_DDDD
742 };
743 
744 /* ---------------------------------------------------------------------------------------------- */
745 /* KNC conversion-mode */
746 /* ---------------------------------------------------------------------------------------------- */
747 
751 typedef ZydisU8 ZydisConversionMode;
752 
757 {
758  ZYDIS_CONVERSION_MODE_INVALID,
759  ZYDIS_CONVERSION_MODE_FLOAT16,
760  ZYDIS_CONVERSION_MODE_SINT8,
761  ZYDIS_CONVERSION_MODE_UINT8,
762  ZYDIS_CONVERSION_MODE_SINT16,
763  ZYDIS_CONVERSION_MODE_UINT16,
767  ZYDIS_CONVERSION_MODE_MAX_VALUE = ZYDIS_CONVERSION_MODE_UINT16
768 };
769 
770 /* ---------------------------------------------------------------------------------------------- */
771 /* Decoded instruction */
772 /* ---------------------------------------------------------------------------------------------- */
773 
778 {
786  ZydisMnemonic mnemonic;
790  ZydisU8 length;
794  ZydisU8 data[ZYDIS_MAX_INSTRUCTION_LENGTH];
806  ZydisU8 opcode;
810  ZydisU8 stackWidth;
814  ZydisU8 operandWidth;
818  ZydisU8 addressWidth;
822  ZydisU8 operandCount;
826  ZydisDecodedOperand operands[ZYDIS_MAX_OPERAND_COUNT];
835  ZydisU64 instrAddress;
839  struct
840  {
852  struct
853  {
861  struct
862  {
875  } mask;
879  struct
880  {
896  struct
897  {
906  struct
907  {
916  struct
917  {
931  } avx;
935  struct
936  {
940  ZydisInstructionCategory category;
944  ZydisISASet isaSet;
948  ZydisISAExt isaExt;
953  } meta;
958  struct
959  {
963  struct
964  {
965  ZydisU8 data[ZYDIS_MAX_INSTRUCTION_LENGTH - 1];
966  ZydisU8 count;
967  ZydisU8 hasF0;
968  ZydisU8 hasF3;
969  ZydisU8 hasF2;
970  ZydisU8 has2E;
971  ZydisU8 has36;
972  ZydisU8 has3E;
973  ZydisU8 has26;
974  ZydisU8 has64;
975  ZydisU8 has65;
976  ZydisU8 has66;
977  ZydisU8 has67;
982  struct
983  {
991  ZydisU8 data[1];
995  ZydisU8 W;
999  ZydisU8 R;
1003  ZydisU8 X;
1007  ZydisU8 B;
1008  } rex;
1012  struct
1013  {
1021  ZydisU8 data[3];
1025  ZydisU8 R;
1029  ZydisU8 X;
1033  ZydisU8 B;
1037  ZydisU8 m_mmmm;
1041  ZydisU8 W;
1045  ZydisU8 vvvv;
1049  ZydisU8 L;
1053  ZydisU8 pp;
1054  } xop;
1058  struct
1059  {
1067  ZydisU8 data[3];
1071  ZydisU8 R;
1075  ZydisU8 X;
1079  ZydisU8 B;
1083  ZydisU8 m_mmmm;
1087  ZydisU8 W;
1091  ZydisU8 vvvv;
1095  ZydisU8 L;
1099  ZydisU8 pp;
1100  } vex;
1104  struct
1105  {
1113  ZydisU8 data[4];
1117  ZydisU8 R;
1121  ZydisU8 X;
1125  ZydisU8 B;
1129  ZydisU8 R2;
1133  ZydisU8 mm;
1137  ZydisU8 W;
1141  ZydisU8 vvvv;
1145  ZydisU8 pp;
1149  ZydisU8 z;
1153  ZydisU8 L2;
1157  ZydisU8 L;
1161  ZydisU8 b;
1165  ZydisU8 V2;
1169  ZydisU8 aaa;
1170  } evex;
1174  struct
1175  {
1183  ZydisU8 data[4];
1187  ZydisU8 R;
1191  ZydisU8 X;
1195  ZydisU8 B;
1199  ZydisU8 R2;
1203  ZydisU8 mmmm;
1207  ZydisU8 W;
1211  ZydisU8 vvvv;
1215  ZydisU8 pp;
1219  ZydisU8 E;
1223  ZydisU8 SSS;
1227  ZydisU8 V2;
1231  ZydisU8 kkk;
1232  } mvex;
1236  struct
1237  {
1239  ZydisU8 data[1];
1240  ZydisU8 mod;
1241  ZydisU8 reg;
1242  ZydisU8 rm;
1247  struct
1248  {
1250  ZydisU8 data[1];
1251  ZydisU8 scale;
1252  ZydisU8 index;
1253  ZydisU8 base;
1254  } sib;
1258  struct
1259  {
1263  ZydisI64 value;
1267  ZydisU8 size;
1272  ZydisU8 offset;
1273  } disp;
1277  struct
1278  {
1291  union
1292  {
1293  ZydisU64 u;
1294  ZydisI64 s;
1299  ZydisU8 size;
1304  ZydisU8 offset;
1305  } imm[2];
1306  } raw;
1308 
1309 /* ---------------------------------------------------------------------------------------------- */
1310 
1311 /* ============================================================================================== */
1312 
1313 #ifdef __cplusplus
1314 }
1315 #endif
1316 
1317 #endif /* ZYDIS_INSTRUCTIONINFO_H */
Includes and defines some default datatypes.
ZydisU8 ZydisBool
@briefs Defines the ZydisBool datatype.
Definition: CommonTypes.h:133
ZydisU8 ZydisBroadcastMode
Defines the ZydisBroadcastMode datatype.
Definition: DecoderTypes.h:652
ZydisU32 ZydisCPUFlagMask
Defines the ZydisCPUFlagMask datatype.
Definition: DecoderTypes.h:411
ZydisU8 ZydisExceptionClass
Defines the ZydisExceptionClass datatype.
Definition: DecoderTypes.h:537
ZydisConversionModes
Values that represent conversion-modes.
Definition: DecoderTypes.h:757
@ ZYDIS_CONVERSION_MODE_MAX_VALUE
Maximum value of this enum.
Definition: DecoderTypes.h:767
ZydisU8 ZydisCPUFlagAction
Defines the ZydisCPUFlagAction datatype.
Definition: DecoderTypes.h:511
ZydisU8 ZydisSwizzleMode
Defines the ZydisSwizzleMode datatype.
Definition: DecoderTypes.h:722
ZydisExceptionClasses
Values that represent exception-classes.
Definition: DecoderTypes.h:543
@ ZYDIS_EXCEPTION_CLASS_MAX_VALUE
Maximum value of this enum.
Definition: DecoderTypes.h:588
ZydisU8 ZydisConversionMode
Defines the ZydisConversionMode datatype.
Definition: DecoderTypes.h:751
ZydisVectorLengths
Values that represent vector-lengths.
Definition: DecoderTypes.h:604
@ ZYDIS_VECTOR_LENGTH_MAX_VALUE
Maximum value of this enum.
Definition: DecoderTypes.h:612
ZydisMaskModes
Values that represent AVX mask-modes.
Definition: DecoderTypes.h:628
@ ZYDIS_MASK_MODE_MAX_VALUE
Maximum value of this enum.
Definition: DecoderTypes.h:642
@ ZYDIS_MASK_MODE_MERGE
The embedded mask register is used as a merge-mask.
Definition: DecoderTypes.h:634
@ ZYDIS_MASK_MODE_ZERO
The embedded mask register is used as a zero-mask.
Definition: DecoderTypes.h:638
ZydisMemoryOperandTypes
Values that represent memory-operand types.
Definition: DecoderTypes.h:62
@ ZYDIS_MEMOP_TYPE_AGEN
The memory operand is only used for address-generation.
Definition: DecoderTypes.h:72
@ ZYDIS_MEMOP_TYPE_MEM
Normal memory operand.
Definition: DecoderTypes.h:67
@ ZYDIS_MEMOP_TYPE_MIB
A memory operand using SIB addressing form, where the index register is not used in address calcula...
Definition: DecoderTypes.h:78
ZydisCPUFlags
Values that represent CPU-flags.
Definition: DecoderTypes.h:417
@ ZYDIS_CPUFLAG_ZF
Zero flag.
Definition: DecoderTypes.h:433
@ ZYDIS_CPUFLAG_TF
Trap flag.
Definition: DecoderTypes.h:441
@ ZYDIS_CPUFLAG_C1
FPU condition-code flag 1.
Definition: DecoderTypes.h:493
@ ZYDIS_CPUFLAG_SF
Sign flag.
Definition: DecoderTypes.h:437
@ ZYDIS_CPUFLAG_OF
Overflow flag.
Definition: DecoderTypes.h:453
@ ZYDIS_CPUFLAG_IF
Interrupt enable flag.
Definition: DecoderTypes.h:445
@ ZYDIS_CPUFLAG_VIP
Virtual interrupt pending.
Definition: DecoderTypes.h:481
@ ZYDIS_CPUFLAG_VIF
Virtual interrupt flag.
Definition: DecoderTypes.h:477
@ ZYDIS_CPUFLAG_CF
Carry flag.
Definition: DecoderTypes.h:421
@ ZYDIS_CPUFLAG_PF
Parity flag.
Definition: DecoderTypes.h:425
@ ZYDIS_CPUFLAG_C3
FPU condition-code flag 3.
Definition: DecoderTypes.h:501
@ ZYDIS_CPUFLAG_C2
FPU condition-code flag 2.
Definition: DecoderTypes.h:497
@ ZYDIS_CPUFLAG_MAX_VALUE
Maximum value of this enum.
Definition: DecoderTypes.h:505
@ ZYDIS_CPUFLAG_C0
FPU condition-code flag 0.
Definition: DecoderTypes.h:489
@ ZYDIS_CPUFLAG_DF
Direction flag.
Definition: DecoderTypes.h:449
@ ZYDIS_CPUFLAG_AC
Alignment check.
Definition: DecoderTypes.h:473
@ ZYDIS_CPUFLAG_VM
Virtual 8086 mode flag.
Definition: DecoderTypes.h:469
@ ZYDIS_CPUFLAG_IOPL
I/O privilege level flag.
Definition: DecoderTypes.h:457
@ ZYDIS_CPUFLAG_RF
Resume flag.
Definition: DecoderTypes.h:465
@ ZYDIS_CPUFLAG_AF
Adjust flag.
Definition: DecoderTypes.h:429
@ ZYDIS_CPUFLAG_NT
Nested task flag.
Definition: DecoderTypes.h:461
@ ZYDIS_CPUFLAG_ID
Able to use CPUID instruction.
Definition: DecoderTypes.h:485
ZydisU8 ZydisMemoryOperandType
Defines the ZydisMemoryOperandType datatype.
Definition: DecoderTypes.h:56
struct ZydisDecodedOperand_ ZydisDecodedOperand
Defines the ZydisDecodedOperand struct.
ZydisU8 ZydisMaskMode
Defines the ZydisMaskMode datatype.
Definition: DecoderTypes.h:622
ZydisRoundingModes
Values that represent AVX rounding-modes.
Definition: DecoderTypes.h:691
@ ZYDIS_ROUNDING_MODE_RN
Round to nearest.
Definition: DecoderTypes.h:696
@ ZYDIS_ROUNDING_MODE_RZ
Round towards zero.
Definition: DecoderTypes.h:708
@ ZYDIS_ROUNDING_MODE_RD
Round down.
Definition: DecoderTypes.h:700
@ ZYDIS_ROUNDING_MODE_MAX_VALUE
Maximum value of this enum.
Definition: DecoderTypes.h:712
@ ZYDIS_ROUNDING_MODE_RU
Round up.
Definition: DecoderTypes.h:704
ZydisU64 ZydisInstructionAttributes
Defines the ZydisInstructionAttributes datatype.
Definition: DecoderTypes.h:223
ZydisU16 ZydisVectorLength
Defines the ZydisVectorLength datatype.
Definition: DecoderTypes.h:598
ZydisU8 ZydisCPUFlag
Defines the ZydisCPUFlag datatype.
Definition: DecoderTypes.h:406
ZydisCPUFlagActions
Values that represent CPU-flag actions.
Definition: DecoderTypes.h:517
@ ZYDIS_CPUFLAG_ACTION_MAX_VALUE
Maximum value of this enum.
Definition: DecoderTypes.h:527
struct ZydisDecodedInstruction_ ZydisDecodedInstruction
Defines the ZydisDecodedInstruction struct.
ZydisSwizzleModes
Values that represent swizzle-modes.
Definition: DecoderTypes.h:728
@ ZYDIS_SWIZZLE_MODE_MAX_VALUE
Maximum value of this enum.
Definition: DecoderTypes.h:741
ZydisU8 ZydisRoundingMode
Defines the ZydisRoundingMode datatype.
Definition: DecoderTypes.h:685
ZydisBroadcastModes
Values that represent AVX broadcast-modes.
Definition: DecoderTypes.h:658
@ ZYDIS_BROADCAST_MODE_MAX_VALUE
Maximum value of this enum.
Definition: DecoderTypes.h:675
Mnemonic constant definitions and helper functions.
Utility functions and constants for registers.
ZydisU8 ZydisRegister
Defines the ZydisRegister datatype.
Definition: Register.h:54
Defines decoder/encoder-shared macros and types.
ZydisU8 ZydisOperandEncoding
Defines the ZydisOperandEncoding datatype.
Definition: SharedTypes.h:202
ZydisU8 ZydisInstructionEncoding
Defines the ZydisInstructionEncoding datatype.
Definition: SharedTypes.h:350
ZydisU16 ZydisElementSize
Defines the ZydisElementSize datatype.
Definition: SharedTypes.h:153
ZydisU8 ZydisElementType
Defines the ZydisElementType datatype.
Definition: SharedTypes.h:131
ZydisU8 ZydisOperandVisibility
Defines the ZydisOperandVisibility datatype.
Definition: SharedTypes.h:254
ZydisU8 ZydisOperandAction
Defines the ZydisOperandAction datatype.
Definition: SharedTypes.h:287
ZydisU8 ZydisOpcodeMap
Defines the ZydisOpcodeMap map.
Definition: SharedTypes.h:395
ZydisU8 ZydisMachineMode
Defines the ZydisMachineMode datatype.
Definition: SharedTypes.h:65
ZydisU8 ZydisOperandType
Defines the ZydisOperandType datatype.
Definition: SharedTypes.h:162
Defines the ZydisDecodedInstruction struct.
Definition: DecoderTypes.h:778
struct ZydisDecodedInstruction_::@9::@18 vex
Detailed info about the VEX-prefix.
ZydisConversionMode mode
The AVX data-conversion mode (MVEX only).
Definition: DecoderTypes.h:921
ZydisU8 size
The physical displacement size, in bits.
Definition: DecoderTypes.h:1267
ZydisMnemonic mnemonic
The instruction-mnemonic.
Definition: DecoderTypes.h:786
ZydisU8 mmmm
Opcode-map specifier.
Definition: DecoderTypes.h:1203
ZydisU8 aaa
Embedded opmask register specifier.
Definition: DecoderTypes.h:1169
struct ZydisDecodedInstruction_::@9::@23 disp
Detailed info about displacement-bytes.
ZydisU8 SSS
Swizzle/broadcast/up-convert/down-convert/static-rounding controls.
Definition: DecoderTypes.h:1223
struct ZydisDecodedInstruction_::@9::@24 imm[2]
Detailed info about immediate-bytes.
ZydisRegister reg
The mask register.
Definition: DecoderTypes.h:870
ZydisCPUFlagAction action
The CPU-flag action.
Definition: DecoderTypes.h:847
ZydisExceptionClass exceptionClass
The exception class.
Definition: DecoderTypes.h:952
struct ZydisDecodedInstruction_::@9::@15 prefixes
Detailed info about the legacy prefixes.
ZydisU64 instrAddress
The instruction address points at the current instruction (based on the initial instruction pointer).
Definition: DecoderTypes.h:835
ZydisU8 vvvv
NDS register specifier (inverted).
Definition: DecoderTypes.h:1045
struct ZydisDecodedInstruction_::@7 avx
Extended info for AVX instructions.
ZydisU8 X
Extension of the SIB.index field.
Definition: DecoderTypes.h:1003
ZydisU8 B
Extension of the ModRM.rm, SIB.base, or opcode.reg field.
Definition: DecoderTypes.h:1007
ZydisU8 mm
Opcode-map specifier.
Definition: DecoderTypes.h:1133
ZydisU8 offset
The offset of the displacement data, relative to the beginning of the instruction,...
Definition: DecoderTypes.h:1272
ZydisU8 pp
Compressed legacy prefix.
Definition: DecoderTypes.h:1053
ZydisBroadcastMode mode
The AVX broadcast-mode.
Definition: DecoderTypes.h:891
ZydisU8 operandCount
The number of instruction-operands.
Definition: DecoderTypes.h:822
ZydisU8 data[ZYDIS_MAX_INSTRUCTION_LENGTH]
The raw bytes of the decoded instruction.
Definition: DecoderTypes.h:794
struct ZydisDecodedInstruction_::@9::@21 modrm
Detailed info about the ModRM-byte.
ZydisU8 R2
High-16 register specifier modifier (inverted).
Definition: DecoderTypes.h:1129
struct ZydisDecodedInstruction_::@7::@13 swizzle
Contains info about the AVX register-swizzle (MVEX only).
ZydisU8 E
Non-temporal/eviction hint.
Definition: DecoderTypes.h:1219
struct ZydisDecodedInstruction_::@6 accessedFlags[ZYDIS_CPUFLAG_MAX_VALUE+1]
Information about accessed CPU flags.
struct ZydisDecodedInstruction_::@7::@14 conversion
Contains info about the AVX data-conversion (MVEX only).
ZydisSwizzleMode mode
The AVX register-swizzle mode (MVEX only).
Definition: DecoderTypes.h:911
ZydisU8 R
Extension of the ModRM.reg field.
Definition: DecoderTypes.h:999
struct ZydisDecodedInstruction_::@8 meta
Meta info.
ZydisBool isDecoded
TRUE if the prefix got already decoded.
Definition: DecoderTypes.h:987
ZydisISAExt isaExt
The ISA-set extension.
Definition: DecoderTypes.h:948
struct ZydisDecodedInstruction_::@9 raw
Extended info about different instruction-parts like ModRM, SIB or encoding-prefixes.
ZydisU8 z
Zeroing/Merging.
Definition: DecoderTypes.h:1149
ZydisU8 kkk
Embedded opmask register specifier.
Definition: DecoderTypes.h:1231
struct ZydisDecodedInstruction_::@7::@12 rounding
Contains info about the AVX rounding.
ZydisVectorLength vectorLength
The AVX vector-length.
Definition: DecoderTypes.h:857
ZydisI64 value
The displacement value.
Definition: DecoderTypes.h:1263
ZydisInstructionEncoding encoding
The instruction-encoding (default, 3DNow, VEX, EVEX, XOP).
Definition: DecoderTypes.h:798
ZydisU8 length
The length of the decoded instruction.
Definition: DecoderTypes.h:790
ZydisInstructionAttributes attributes
Instruction attributes.
Definition: DecoderTypes.h:830
struct ZydisDecodedInstruction_::@7::@11 broadcast
Contains info about the AVX broadcast.
ZydisRoundingMode mode
The AVX rounding-mode.
Definition: DecoderTypes.h:901
ZydisISASet isaSet
The ISA-set.
Definition: DecoderTypes.h:944
struct ZydisDecodedInstruction_::@7::@10 mask
Info about the embedded writemask-register.
ZydisBool isRelative
Signals, if the immediate value contains a relative offset.
Definition: DecoderTypes.h:1287
ZydisU8 m_mmmm
Opcode-map specifier.
Definition: DecoderTypes.h:1037
ZydisMaskMode mode
The masking mode.
Definition: DecoderTypes.h:866
ZydisU8 V2
High-16 NDS/VIDX register specifier.
Definition: DecoderTypes.h:1165
ZydisBool hasSAE
Signals, if the sae functionality is enabled for the instruction.
Definition: DecoderTypes.h:926
ZydisU8 L2
Vector-length specifier or rounding-control (most significant bit).
Definition: DecoderTypes.h:1153
ZydisDecodedOperand operands[ZYDIS_MAX_OPERAND_COUNT]
Detailed info for all instruction operands.
Definition: DecoderTypes.h:826
ZydisU8 operandWidth
The effective operand width.
Definition: DecoderTypes.h:814
struct ZydisDecodedInstruction_::@9::@16 rex
Detailed info about the REX-prefix.
ZydisU8 addressWidth
The effective address width.
Definition: DecoderTypes.h:818
ZydisBool isStatic
Signals, if the broadcast is a static broadcast.
Definition: DecoderTypes.h:887
ZydisBool hasEvictionHint
Signals, if the instruction has a memory eviction-hint (MVEX only).
Definition: DecoderTypes.h:930
ZydisU8 b
Broadcast/RC/SAE Context.
Definition: DecoderTypes.h:1161
struct ZydisDecodedInstruction_::@9::@19 evex
Detailed info about the EVEX-prefix.
ZydisU8 L
Vector-length specifier.
Definition: DecoderTypes.h:1049
ZydisBool isSigned
Signals, if the immediate value is signed.
Definition: DecoderTypes.h:1282
ZydisU8 stackWidth
The stack width.
Definition: DecoderTypes.h:810
ZydisU8 opcode
The instruction-opcode.
Definition: DecoderTypes.h:806
ZydisOpcodeMap opcodeMap
The opcode-map.
Definition: DecoderTypes.h:802
struct ZydisDecodedInstruction_::@9::@20 mvex
Detailed info about the MVEX-prefix.
ZydisBool isControlMask
Signals, if the mask-register is used as a control mask.
Definition: DecoderTypes.h:874
struct ZydisDecodedInstruction_::@9::@22 sib
Detailed info about the SIB-byte.
struct ZydisDecodedInstruction_::@9::@17 xop
Detailed info about the XOP-prefix.
ZydisMachineMode machineMode
The machine mode used to decode this instruction.
Definition: DecoderTypes.h:782
ZydisInstructionCategory category
The instruction category.
Definition: DecoderTypes.h:940
ZydisU8 W
64-bit operand-size promotion.
Definition: DecoderTypes.h:995
Defines the ZydisDecodedOperand struct.
Definition: DecoderTypes.h:89
ZydisU8 id
The operand-id.
Definition: DecoderTypes.h:93
ZydisOperandAction action
The operand-action.
Definition: DecoderTypes.h:105
struct ZydisDecodedOperand_::@0 reg
Extended info for register-operands.
ZydisMemoryOperandType type
The type of the memory operand.
Definition: DecoderTypes.h:145
ZydisOperandEncoding encoding
The operand-encoding.
Definition: DecoderTypes.h:109
ZydisRegister segment
The segment register.
Definition: DecoderTypes.h:149
struct ZydisDecodedOperand_::@2 ptr
Extended info for pointer-operands.
struct ZydisDecodedOperand_::@1::@4 disp
Extended info for memory-operands with displacement.
ZydisRegister base
The base register.
Definition: DecoderTypes.h:153
ZydisU16 size
The logical size of the operand (in bits).
Definition: DecoderTypes.h:113
ZydisOperandVisibility visibility
The visibility of the operand.
Definition: DecoderTypes.h:101
ZydisElementSize elementSize
The size of a single element.
Definition: DecoderTypes.h:121
ZydisElementType elementType
The element-type.
Definition: DecoderTypes.h:117
ZydisI64 value
The displacement value.
Definition: DecoderTypes.h:174
ZydisBool isRelative
Signals, if the immediate value contains a relative offset.
Definition: DecoderTypes.h:198
ZydisBool hasDisplacement
Signals, if the displacement value is used.
Definition: DecoderTypes.h:170
ZydisU8 scale
The scale factor.
Definition: DecoderTypes.h:161
ZydisU16 elementCount
The number of elements.
Definition: DecoderTypes.h:125
struct ZydisDecodedOperand_::@1 mem
Extended info for memory-operands.
ZydisRegister index
The index register.
Definition: DecoderTypes.h:157
ZydisBool isSigned
Signals, if the immediate value is signed.
Definition: DecoderTypes.h:193
struct ZydisDecodedOperand_::@3 imm
Extended info for immediate-operands.
ZydisOperandType type
The type of the operand.
Definition: DecoderTypes.h:97
ZydisRegister value
The register value.
Definition: DecoderTypes.h:134