Zydis  v2.0
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 <Zycore/Types.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 
57 {
58  ZYDIS_MEMOP_TYPE_INVALID,
73 
83 
84 /* ---------------------------------------------------------------------------------------------- */
85 /* Decoded operand */
86 /* ---------------------------------------------------------------------------------------------- */
87 
91 typedef struct ZydisDecodedOperand_
92 {
96  ZyanU8 id;
116  ZyanU16 size;
128  ZyanU16 element_count;
132  struct
133  {
137  ZydisRegister value;
138  // TODO: AVX512_4VNNIW MULTISOURCE registers
139  } reg;
143  struct
144  {
152  ZydisRegister segment;
156  ZydisRegister base;
160  ZydisRegister index;
164  ZyanU8 scale;
168  struct
169  {
177  ZyanI64 value;
178  } disp;
179  } mem;
183  struct
184  {
185  ZyanU16 segment;
186  ZyanU32 offset;
187  } ptr;
191  struct
192  {
196  ZyanBool is_signed;
201  ZyanBool is_relative;
205  union
206  {
207  ZyanU64 u;
208  ZyanI64 s;
209  } value;
210  } imm;
212 
213 /* ---------------------------------------------------------------------------------------------- */
214 
215 /* ============================================================================================== */
216 /* Decoded instruction */
217 /* ============================================================================================== */
218 
219 /* ---------------------------------------------------------------------------------------------- */
220 /* Instruction attributes */
221 /* ---------------------------------------------------------------------------------------------- */
222 
227 
231 #define ZYDIS_ATTRIB_HAS_MODRM 0x0000000000000001 // (1 << 0)
232 
235 #define ZYDIS_ATTRIB_HAS_SIB 0x0000000000000002 // (1 << 1)
236 
239 #define ZYDIS_ATTRIB_HAS_REX 0x0000000000000004 // (1 << 2)
240 
243 #define ZYDIS_ATTRIB_HAS_XOP 0x0000000000000008 // (1 << 3)
244 
247 #define ZYDIS_ATTRIB_HAS_VEX 0x0000000000000010 // (1 << 4)
248 
251 #define ZYDIS_ATTRIB_HAS_EVEX 0x0000000000000020 // (1 << 5)
252 
255 #define ZYDIS_ATTRIB_HAS_MVEX 0x0000000000000040 // (1 << 6)
256 
259 #define ZYDIS_ATTRIB_IS_RELATIVE 0x0000000000000080 // (1 << 7)
260 
265 #define ZYDIS_ATTRIB_IS_PRIVILEGED 0x0000000000000100 // (1 << 8)
266 
270 #define ZYDIS_ATTRIB_IS_FAR_BRANCH 0x0000001000000000 // (1 << 36) // TODO: rebase
271 
274 #define ZYDIS_ATTRIB_CPUFLAG_ACCESS 0x0000002000000000 // (1 << 37) // TODO: rebase
275 
279 #define ZYDIS_ATTRIB_ACCEPTS_LOCK 0x0000000000000200 // (1 << 9)
280 
283 #define ZYDIS_ATTRIB_ACCEPTS_REP 0x0000000000000400 // (1 << 10)
284 
287 #define ZYDIS_ATTRIB_ACCEPTS_REPE 0x0000000000000800 // (1 << 11)
288 
291 #define ZYDIS_ATTRIB_ACCEPTS_REPZ 0x0000000000000800 // (1 << 11)
292 
295 #define ZYDIS_ATTRIB_ACCEPTS_REPNE 0x0000000000001000 // (1 << 12)
296 
299 #define ZYDIS_ATTRIB_ACCEPTS_REPNZ 0x0000000000001000 // (1 << 12)
300 
303 #define ZYDIS_ATTRIB_ACCEPTS_BOUND 0x0000000000002000 // (1 << 13)
304 
307 #define ZYDIS_ATTRIB_ACCEPTS_XACQUIRE 0x0000000000004000 // (1 << 14)
308 
311 #define ZYDIS_ATTRIB_ACCEPTS_XRELEASE 0x0000000000008000 // (1 << 15)
312 
316 #define ZYDIS_ATTRIB_ACCEPTS_HLE_WITHOUT_LOCK 0x0000000000010000 // (1 << 16)
317 
320 #define ZYDIS_ATTRIB_ACCEPTS_BRANCH_HINTS 0x0000000000020000 // (1 << 17)
321 
324 #define ZYDIS_ATTRIB_ACCEPTS_SEGMENT 0x0000000000040000 // (1 << 18)
325 
328 #define ZYDIS_ATTRIB_HAS_LOCK 0x0000000000080000 // (1 << 19)
329 
332 #define ZYDIS_ATTRIB_HAS_REP 0x0000000000100000 // (1 << 20)
333 
336 #define ZYDIS_ATTRIB_HAS_REPE 0x0000000000200000 // (1 << 21)
337 
340 #define ZYDIS_ATTRIB_HAS_REPZ 0x0000000000200000 // (1 << 21)
341 
344 #define ZYDIS_ATTRIB_HAS_REPNE 0x0000000000400000 // (1 << 22)
345 
348 #define ZYDIS_ATTRIB_HAS_REPNZ 0x0000000000400000 // (1 << 22)
349 
352 #define ZYDIS_ATTRIB_HAS_BOUND 0x0000000000800000 // (1 << 23)
353 
356 #define ZYDIS_ATTRIB_HAS_XACQUIRE 0x0000000001000000 // (1 << 24)
357 
360 #define ZYDIS_ATTRIB_HAS_XRELEASE 0x0000000002000000 // (1 << 25)
361 
364 #define ZYDIS_ATTRIB_HAS_BRANCH_NOT_TAKEN 0x0000000004000000 // (1 << 26)
365 
368 #define ZYDIS_ATTRIB_HAS_BRANCH_TAKEN 0x0000000008000000 // (1 << 27)
369 
372 #define ZYDIS_ATTRIB_HAS_SEGMENT 0x00000003F0000000
373 
376 #define ZYDIS_ATTRIB_HAS_SEGMENT_CS 0x0000000010000000 // (1 << 28)
377 
380 #define ZYDIS_ATTRIB_HAS_SEGMENT_SS 0x0000000020000000 // (1 << 29)
381 
384 #define ZYDIS_ATTRIB_HAS_SEGMENT_DS 0x0000000040000000 // (1 << 30)
385 
388 #define ZYDIS_ATTRIB_HAS_SEGMENT_ES 0x0000000080000000 // (1 << 31)
389 
392 #define ZYDIS_ATTRIB_HAS_SEGMENT_FS 0x0000000100000000 // (1 << 32)
393 
396 #define ZYDIS_ATTRIB_HAS_SEGMENT_GS 0x0000000200000000 // (1 << 33)
397 
400 #define ZYDIS_ATTRIB_HAS_OPERANDSIZE 0x0000000400000000 // (1 << 34) // TODO: rename
401 
404 #define ZYDIS_ATTRIB_HAS_ADDRESSSIZE 0x0000000800000000 // (1 << 35) // TODO: rename
405 
406 /* ---------------------------------------------------------------------------------------------- */
407 /* R/E/FLAGS info */
408 /* ---------------------------------------------------------------------------------------------- */
409 
413 typedef ZyanU32 ZydisCPUFlags;
414 
418 typedef enum ZydisCPUFlag_
419 {
504 
513 } ZydisCPUFlag;
514 
519 {
520  ZYDIS_CPUFLAG_ACTION_NONE,
521  ZYDIS_CPUFLAG_ACTION_TESTED,
522  ZYDIS_CPUFLAG_ACTION_MODIFIED,
523  ZYDIS_CPUFLAG_ACTION_SET_0,
524  ZYDIS_CPUFLAG_ACTION_SET_1,
525  ZYDIS_CPUFLAG_ACTION_UNDEFINED,
526 
530  ZYDIS_CPUFLAG_ACTION_MAX_VALUE = ZYDIS_CPUFLAG_ACTION_UNDEFINED,
536 
537 /* ---------------------------------------------------------------------------------------------- */
538 /* SSE/AVX exception-class */
539 /* ---------------------------------------------------------------------------------------------- */
540 
545 {
546  ZYDIS_EXCEPTION_CLASS_NONE,
547  // TODO: FP Exceptions
548  ZYDIS_EXCEPTION_CLASS_SSE1,
549  ZYDIS_EXCEPTION_CLASS_SSE2,
550  ZYDIS_EXCEPTION_CLASS_SSE3,
551  ZYDIS_EXCEPTION_CLASS_SSE4,
552  ZYDIS_EXCEPTION_CLASS_SSE5,
553  ZYDIS_EXCEPTION_CLASS_SSE7,
554  ZYDIS_EXCEPTION_CLASS_AVX1,
555  ZYDIS_EXCEPTION_CLASS_AVX2,
556  ZYDIS_EXCEPTION_CLASS_AVX3,
557  ZYDIS_EXCEPTION_CLASS_AVX4,
558  ZYDIS_EXCEPTION_CLASS_AVX5,
559  ZYDIS_EXCEPTION_CLASS_AVX6,
560  ZYDIS_EXCEPTION_CLASS_AVX7,
561  ZYDIS_EXCEPTION_CLASS_AVX8,
562  ZYDIS_EXCEPTION_CLASS_AVX11,
563  ZYDIS_EXCEPTION_CLASS_AVX12,
564  ZYDIS_EXCEPTION_CLASS_E1,
565  ZYDIS_EXCEPTION_CLASS_E1NF,
566  ZYDIS_EXCEPTION_CLASS_E2,
567  ZYDIS_EXCEPTION_CLASS_E2NF,
568  ZYDIS_EXCEPTION_CLASS_E3,
569  ZYDIS_EXCEPTION_CLASS_E3NF,
570  ZYDIS_EXCEPTION_CLASS_E4,
571  ZYDIS_EXCEPTION_CLASS_E4NF,
572  ZYDIS_EXCEPTION_CLASS_E5,
573  ZYDIS_EXCEPTION_CLASS_E5NF,
574  ZYDIS_EXCEPTION_CLASS_E6,
575  ZYDIS_EXCEPTION_CLASS_E6NF,
576  ZYDIS_EXCEPTION_CLASS_E7NM,
577  ZYDIS_EXCEPTION_CLASS_E7NM128,
578  ZYDIS_EXCEPTION_CLASS_E9NF,
579  ZYDIS_EXCEPTION_CLASS_E10,
580  ZYDIS_EXCEPTION_CLASS_E10NF,
581  ZYDIS_EXCEPTION_CLASS_E11,
582  ZYDIS_EXCEPTION_CLASS_E11NF,
583  ZYDIS_EXCEPTION_CLASS_E12,
584  ZYDIS_EXCEPTION_CLASS_E12NP,
585  ZYDIS_EXCEPTION_CLASS_K20,
586  ZYDIS_EXCEPTION_CLASS_K21,
587 
591  ZYDIS_EXCEPTION_CLASS_MAX_VALUE = ZYDIS_EXCEPTION_CLASS_K21,
597 
598 /* ---------------------------------------------------------------------------------------------- */
599 /* AVX mask mode */
600 /* ---------------------------------------------------------------------------------------------- */
601 
605 typedef enum ZydisMaskMode_
606 {
607  ZYDIS_MASK_MODE_INVALID,
628 
637 } ZydisMaskMode;
638 
639 /* ---------------------------------------------------------------------------------------------- */
640 /* AVX broadcast-mode */
641 /* ---------------------------------------------------------------------------------------------- */
642 
647 {
648  ZYDIS_BROADCAST_MODE_INVALID,
649  ZYDIS_BROADCAST_MODE_1_TO_2,
650  ZYDIS_BROADCAST_MODE_1_TO_4,
651  ZYDIS_BROADCAST_MODE_1_TO_8,
652  ZYDIS_BROADCAST_MODE_1_TO_16,
653  ZYDIS_BROADCAST_MODE_1_TO_32,
654  ZYDIS_BROADCAST_MODE_1_TO_64,
655  ZYDIS_BROADCAST_MODE_2_TO_4,
656  ZYDIS_BROADCAST_MODE_2_TO_8,
657  ZYDIS_BROADCAST_MODE_2_TO_16,
658  ZYDIS_BROADCAST_MODE_4_TO_8,
659  ZYDIS_BROADCAST_MODE_4_TO_16,
660  ZYDIS_BROADCAST_MODE_8_TO_16,
661 
665  ZYDIS_BROADCAST_MODE_MAX_VALUE = ZYDIS_BROADCAST_MODE_8_TO_16,
671 
672 /* ---------------------------------------------------------------------------------------------- */
673 /* AVX rounding-mode */
674 /* ---------------------------------------------------------------------------------------------- */
675 
679 typedef enum ZydisRoundingMode_
680 {
681  ZYDIS_ROUNDING_MODE_INVALID,
698 
708 
709 /* ---------------------------------------------------------------------------------------------- */
710 /* KNC swizzle-mode */
711 /* ---------------------------------------------------------------------------------------------- */
712 
716 typedef enum ZydisSwizzleMode_
717 {
718  ZYDIS_SWIZZLE_MODE_INVALID,
719  ZYDIS_SWIZZLE_MODE_DCBA,
720  ZYDIS_SWIZZLE_MODE_CDAB,
721  ZYDIS_SWIZZLE_MODE_BADC,
722  ZYDIS_SWIZZLE_MODE_DACB,
723  ZYDIS_SWIZZLE_MODE_AAAA,
724  ZYDIS_SWIZZLE_MODE_BBBB,
725  ZYDIS_SWIZZLE_MODE_CCCC,
726  ZYDIS_SWIZZLE_MODE_DDDD,
727 
731  ZYDIS_SWIZZLE_MODE_MAX_VALUE = ZYDIS_SWIZZLE_MODE_DDDD,
737 
738 /* ---------------------------------------------------------------------------------------------- */
739 /* KNC conversion-mode */
740 /* ---------------------------------------------------------------------------------------------- */
741 
746 {
747  ZYDIS_CONVERSION_MODE_INVALID,
748  ZYDIS_CONVERSION_MODE_FLOAT16,
749  ZYDIS_CONVERSION_MODE_SINT8,
750  ZYDIS_CONVERSION_MODE_UINT8,
751  ZYDIS_CONVERSION_MODE_SINT16,
752  ZYDIS_CONVERSION_MODE_UINT16,
753 
757  ZYDIS_CONVERSION_MODE_MAX_VALUE = ZYDIS_CONVERSION_MODE_UINT16,
763 
764 /* ---------------------------------------------------------------------------------------------- */
765 /* Decoded instruction */
766 /* ---------------------------------------------------------------------------------------------- */
767 
772 {
780  ZydisMnemonic mnemonic;
784  ZyanU8 length;
788  ZyanU8 data[ZYDIS_MAX_INSTRUCTION_LENGTH];
800  ZyanU8 opcode;
804  ZyanU8 stack_width;
820  ZydisDecodedOperand operands[ZYDIS_MAX_OPERAND_COUNT];
828  struct
829  {
841  struct
842  {
846  ZyanU16 vector_length;
850  struct
851  {
859  ZydisRegister reg;
860  } mask;
864  struct
865  {
872  ZyanBool is_static;
877  } broadcast;
881  struct
882  {
887  } rounding;
891  struct
892  {
897  } swizzle;
901  struct
902  {
907  } conversion;
911  ZyanBool has_SAE;
916  // TODO: publish EVEX tuple-type and MVEX functionality
917  } avx;
921  struct
922  {
926  ZydisInstructionCategory category;
930  ZydisISASet isa_set;
934  ZydisISAExt isa_ext;
939  } meta;
944  struct
945  {
949  struct
950  {
951  ZyanU8 data[ZYDIS_MAX_INSTRUCTION_LENGTH - 1];
952  ZyanU8 count;
953  ZyanU8 hasF0;
954  ZyanU8 hasF3;
955  ZyanU8 hasF2;
956  ZyanU8 has2E;
957  ZyanU8 has36;
958  ZyanU8 has3E;
959  ZyanU8 has26;
960  ZyanU8 has64;
961  ZyanU8 has65;
962  ZyanU8 has66;
963  ZyanU8 has67;
964  } prefixes;
968  struct
969  {
973  ZyanBool is_decoded;
977  ZyanU8 data[1];
981  ZyanU8 W;
985  ZyanU8 R;
989  ZyanU8 X;
993  ZyanU8 B;
994  } rex;
998  struct
999  {
1003  ZyanBool is_decoded;
1007  ZyanU8 data[3];
1011  ZyanU8 R;
1015  ZyanU8 X;
1019  ZyanU8 B;
1023  ZyanU8 m_mmmm;
1027  ZyanU8 W;
1031  ZyanU8 vvvv;
1035  ZyanU8 L;
1039  ZyanU8 pp;
1040  } xop;
1044  struct
1045  {
1049  ZyanBool is_decoded;
1053  ZyanU8 data[3];
1057  ZyanU8 R;
1061  ZyanU8 X;
1065  ZyanU8 B;
1069  ZyanU8 m_mmmm;
1073  ZyanU8 W;
1077  ZyanU8 vvvv;
1081  ZyanU8 L;
1085  ZyanU8 pp;
1086  } vex;
1090  struct
1091  {
1095  ZyanBool is_decoded;
1099  ZyanU8 data[4];
1103  ZyanU8 R;
1107  ZyanU8 X;
1111  ZyanU8 B;
1115  ZyanU8 R2;
1119  ZyanU8 mm;
1123  ZyanU8 W;
1127  ZyanU8 vvvv;
1131  ZyanU8 pp;
1135  ZyanU8 z;
1139  ZyanU8 L2;
1143  ZyanU8 L;
1147  ZyanU8 b;
1151  ZyanU8 V2;
1155  ZyanU8 aaa;
1156  } evex;
1160  struct
1161  {
1165  ZyanBool is_decoded;
1169  ZyanU8 data[4];
1173  ZyanU8 R;
1177  ZyanU8 X;
1181  ZyanU8 B;
1185  ZyanU8 R2;
1189  ZyanU8 mmmm;
1193  ZyanU8 W;
1197  ZyanU8 vvvv;
1201  ZyanU8 pp;
1205  ZyanU8 E;
1209  ZyanU8 SSS;
1213  ZyanU8 V2;
1217  ZyanU8 kkk;
1218  } mvex;
1222  struct
1223  {
1224  ZyanBool is_decoded;
1225  ZyanU8 data[1];
1226  ZyanU8 mod;
1227  ZyanU8 reg;
1228  ZyanU8 rm;
1229  } modrm;
1233  struct
1234  {
1235  ZyanBool is_decoded;
1236  ZyanU8 data[1];
1237  ZyanU8 scale;
1238  ZyanU8 index;
1239  ZyanU8 base;
1240  } sib;
1244  struct
1245  {
1249  ZyanI64 value;
1253  ZyanU8 size;
1254  // TODO: publish cd8 scale
1259  ZyanU8 offset;
1260  } disp;
1264  struct
1265  {
1269  ZyanBool is_signed;
1274  ZyanBool is_relative;
1278  union
1279  {
1280  ZyanU64 u;
1281  ZyanI64 s;
1282  } value;
1286  ZyanU8 size;
1291  ZyanU8 offset;
1292  } imm[2];
1293  } raw;
1295 
1296 /* ---------------------------------------------------------------------------------------------- */
1297 
1298 /* ============================================================================================== */
1299 
1300 #ifdef __cplusplus
1301 }
1302 #endif
1303 
1304 #endif /* ZYDIS_INSTRUCTIONINFO_H */
ZydisCPUFlag_
Defines the ZydisCPUFlag enum.
Definition: DecoderTypes.h:418
struct ZydisDecodedInstruction_::@9::@21 modrm
Detailed info about the ModRM-byte.
struct ZydisDecodedOperand_::@1 mem
Extended info for memory-operands.
Alignment check.
Definition: DecoderTypes.h:475
Mnemonic constant definitions and helper functions.
ZyanU8 scale
The scale factor.
Definition: DecoderTypes.h:164
ZyanU8 R
Extension of the ModRM.reg field.
Definition: DecoderTypes.h:985
FPU condition-code flag 1.
Definition: DecoderTypes.h:495
Masking is disabled for the current instruction (K0 register is used).
Definition: DecoderTypes.h:611
ZydisOperandType type
The type of the operand.
Definition: DecoderTypes.h:100
ZyanU8 length
The length of the decoded instruction.
Definition: DecoderTypes.h:784
ZyanBool is_relative
Signals, if the immediate value contains a relative offset. You can use ZydisCalcAbsoluteAddress to d...
Definition: DecoderTypes.h:201
Direction flag.
Definition: DecoderTypes.h:451
ZyanU8 opcode
The instruction-opcode.
Definition: DecoderTypes.h:800
ZydisInstructionEncoding encoding
The instruction-encoding (default, 3DNow, VEX, EVEX, XOP).
Definition: DecoderTypes.h:792
struct ZydisDecodedInstruction_::@9 raw
Extended info about different instruction-parts like ModRM, SIB or encoding-prefixes.
struct ZydisDecodedOperand_::@2 ptr
Extended info for pointer-operands.
ZydisISAExt isa_ext
The ISA-set extension.
Definition: DecoderTypes.h:934
struct ZydisDecodedInstruction_::@9::@16 rex
Detailed info about the REX-prefix.
Round to nearest.
Definition: DecoderTypes.h:685
The minimum number of bits required to represent all values of this enum.
Definition: DecoderTypes.h:669
ZydisOperandEncoding encoding
The operand-encoding.
Definition: DecoderTypes.h:112
ZyanU8 id
The operand-id.
Definition: DecoderTypes.h:96
FPU condition-code flag 2.
Definition: DecoderTypes.h:499
The embedded mask register is used as a control-mask (element selector).
Definition: DecoderTypes.h:623
FPU condition-code flag 0.
Definition: DecoderTypes.h:491
Resume flag.
Definition: DecoderTypes.h:467
ZyanU8 R2
High-16 register specifier modifier (inverted).
Definition: DecoderTypes.h:1115
ZyanBool is_relative
Signals, if the immediate value contains a relative offset. You can use ZydisCalcAbsoluteAddress to d...
Definition: DecoderTypes.h:1274
ZyanU8 SSS
Swizzle/broadcast/up-convert/down-convert/static-rounding controls.
Definition: DecoderTypes.h:1209
Parity flag.
Definition: DecoderTypes.h:427
ZyanBool has_SAE
Signals, if the sae functionality is enabled for the instruction.
Definition: DecoderTypes.h:911
ZyanU8 stack_width
The stack width.
Definition: DecoderTypes.h:804
Trap flag.
Definition: DecoderTypes.h:443
enum ZydisMachineMode_ ZydisMachineMode
Defines the ZydisMachineMode enum.
ZydisCPUFlagAction_
Defines the ZydisCPUFlagAction enum.
Definition: DecoderTypes.h:518
Maximum value of this enum.
Definition: DecoderTypes.h:632
ZydisSwizzleMode mode
The AVX register-swizzle mode.
Definition: DecoderTypes.h:896
Maximum value of this enum.
Definition: DecoderTypes.h:731
struct ZydisDecodedInstruction_::@7::@14 conversion
Contains info about the AVX data-conversion (KNC only).
struct ZydisDecodedInstruction_::@6 accessedFlags[ZYDIS_CPUFLAG_MAX_VALUE+1]
Information about accessed CPU flags.
The memory operand is only used for address-generation. No real memory-access is caused.
Definition: DecoderTypes.h:67
enum ZydisOperandAction_ ZydisOperandAction
Defines the ZydisOperandVisibility enum.
ZydisMemoryOperandType type
The type of the memory operand.
Definition: DecoderTypes.h:148
ZydisRegister reg
The mask register.
Definition: DecoderTypes.h:859
ZydisMemoryOperandType_
Defines the ZydisMemoryOperandType enum.
Definition: DecoderTypes.h:56
struct ZydisDecodedInstruction_::@7::@13 swizzle
Contains info about the AVX register-swizzle (KNC only).
ZyanU64 ZydisInstructionAttributes
Defines the ZydisInstructionAttributes datatype.
Definition: DecoderTypes.h:226
struct ZydisDecodedInstruction_::@9::@20 mvex
Detailed info about the MVEX-prefix.
Able to use CPUID instruction.
Definition: DecoderTypes.h:487
ZydisMaskMode mode
The masking mode.
Definition: DecoderTypes.h:855
ZydisOperandVisibility visibility
The visibility of the operand.
Definition: DecoderTypes.h:104
ZydisExceptionClass exception_class
The exception class.
Definition: DecoderTypes.h:938
ZydisISASet isa_set
The ISA-set.
Definition: DecoderTypes.h:930
ZydisInstructionAttributes attributes
Instruction attributes.
Definition: DecoderTypes.h:824
ZyanU8 offset
The offset of the displacement data, relative to the beginning of the instruction, in bytes.
Definition: DecoderTypes.h:1259
struct ZydisDecodedInstruction_::@9::@19 evex
Detailed info about the EVEX-prefix.
ZyanU8 B
Extension of the ModRM.rm, SIB.base, or opcode.reg field.
Definition: DecoderTypes.h:993
struct ZydisDecodedInstruction_::@9::@18 vex
Detailed info about the VEX-prefix.
Interrupt enable flag.
Definition: DecoderTypes.h:447
enum ZydisCPUFlag_ ZydisCPUFlag
Defines the ZydisCPUFlag enum.
ZyanU8 operand_count
The number of instruction-operands.
Definition: DecoderTypes.h:816
Overflow flag.
Definition: DecoderTypes.h:455
Maximum value of this enum.
Definition: DecoderTypes.h:665
Maximum value of this enum.
Definition: DecoderTypes.h:757
enum ZydisOperandEncoding_ ZydisOperandEncoding
Defines the ZydisOperandEncoding enum.
struct ZydisDecodedInstruction_::@7::@11 broadcast
Contains info about the AVX broadcast.
enum ZydisExceptionClass_ ZydisExceptionClass
Defines the ZydisExceptionClass enum.
ZyanU8 L
Vector-length specifier.
Definition: DecoderTypes.h:1035
struct ZydisDecodedInstruction_::@9::@23 disp
Detailed info about displacement-bytes.
ZydisBroadcastMode mode
The AVX broadcast-mode.
Definition: DecoderTypes.h:876
enum ZydisOperandType_ ZydisOperandType
Defines the ZydisOperandType enum.
ZydisElementSize element_size
The size of a single element.
Definition: DecoderTypes.h:124
ZyanU8 data[ZYDIS_MAX_INSTRUCTION_LENGTH]
The raw bytes of the decoded instruction.
Definition: DecoderTypes.h:788
ZydisInstructionCategory category
The instruction category.
Definition: DecoderTypes.h:926
ZyanU8 size
The physical displacement size, in bits.
Definition: DecoderTypes.h:1253
I/O privilege level flag.
Definition: DecoderTypes.h:459
enum ZydisConversionMode_ ZydisConversionMode
Defines the ZydisConversionMode enum.
ZydisConversionMode_
Defines the ZydisConversionMode enum.
Definition: DecoderTypes.h:745
ZyanU8 aaa
Embedded opmask register specifier.
Definition: DecoderTypes.h:1155
ZyanBool is_signed
Signals, if the immediate value is signed.
Definition: DecoderTypes.h:196
Virtual interrupt pending.
Definition: DecoderTypes.h:483
ZyanU8 mm
Opcode-map specifier.
Definition: DecoderTypes.h:1119
ZyanI64 value
The displacement value.
Definition: DecoderTypes.h:1249
ZydisExceptionClass_
Defines the ZydisExceptionClass enum.
Definition: DecoderTypes.h:544
Maximum value of this enum.
Definition: DecoderTypes.h:591
ZydisElementType element_type
The element-type.
Definition: DecoderTypes.h:120
enum ZydisElementType_ ZydisElementType
Defines the ZydisElementType enum.
Carry flag.
Definition: DecoderTypes.h:423
Virtual interrupt flag.
Definition: DecoderTypes.h:479
ZyanU8 X
Extension of the SIB.index field.
Definition: DecoderTypes.h:989
Round towards zero.
Definition: DecoderTypes.h:697
ZyanBool has_eviction_hint
Signals, if the instruction has a memory eviction-hint (KNC only).
Definition: DecoderTypes.h:915
Defines decoder/encoder-shared macros and types.
enum ZydisOperandVisibility_ ZydisOperandVisibility
Defines the ZydisOperandVisibility enum.
enum ZydisMaskMode_ ZydisMaskMode
Defines the ZydisMaskMode enum.
Maximum value of this enum.
Definition: DecoderTypes.h:77
ZyanBool is_signed
Signals, if the immediate value is signed.
Definition: DecoderTypes.h:1269
The minimum number of bits required to represent all values of this enum.
Definition: DecoderTypes.h:512
The embedded mask register is used as a zero-mask.
Definition: DecoderTypes.h:619
ZydisMachineMode machine_mode
The machine mode used to decode this instruction.
Definition: DecoderTypes.h:776
The minimum number of bits required to represent all values of this enum.
Definition: DecoderTypes.h:595
enum ZydisInstructionEncoding_ ZydisInstructionEncoding
Defines the ZydisInstructionEncoding enum.
struct ZydisDecodedOperand_ ZydisDecodedOperand
Defines the ZydisDecodedOperand struct.
Sign flag.
Definition: DecoderTypes.h:439
enum ZydisOpcodeMap_ ZydisOpcodeMap
Defines the ZydisOpcodeMap enum.
ZyanU8 L2
Vector-length specifier or rounding-control (most significant bit).
Definition: DecoderTypes.h:1139
ZydisRegister segment
The segment register.
Definition: DecoderTypes.h:152
Defines the ZydisDecodedOperand struct.
Definition: DecoderTypes.h:91
ZydisCPUFlagAction action
The CPU-flag action.
Definition: DecoderTypes.h:836
Virtual 8086 mode flag.
Definition: DecoderTypes.h:471
Round up.
Definition: DecoderTypes.h:693
ZydisRoundingMode_
Defines the ZydisRoundingMode enum.
Definition: DecoderTypes.h:679
enum ZydisSwizzleMode_ ZydisSwizzleMode
Defines the ZydisSwizzleMode enum.
ZydisRegister base
The base register.
Definition: DecoderTypes.h:156
ZydisMnemonic mnemonic
The instruction-mnemonic.
Definition: DecoderTypes.h:780
struct ZydisDecodedInstruction_::@7::@10 mask
Info about the embedded writemask-register (AVX-512 and KNC only).
ZyanBool is_static
Signals, if the broadcast is a static broadcast.
Definition: DecoderTypes.h:872
The minimum number of bits required to represent all values of this enum.
Definition: DecoderTypes.h:735
enum ZydisCPUFlagAction_ ZydisCPUFlagAction
Defines the ZydisCPUFlagAction enum.
The embedded mask register is used as a zeroing control-mask (element selector).
Definition: DecoderTypes.h:627
ZyanU8 z
Zeroing/Merging.
Definition: DecoderTypes.h:1135
ZyanU32 ZydisCPUFlags
Defines the ZydisCPUFlags datatype.
Definition: DecoderTypes.h:413
struct ZydisDecodedInstruction_::@9::@22 sib
Detailed info about the SIB-byte.
Normal memory operand.
Definition: DecoderTypes.h:62
The minimum number of bits required to represent all values of this enum.
Definition: DecoderTypes.h:534
struct ZydisDecodedOperand_::@0 reg
Extended info for register-operands.
The minimum number of bits required to represent all values of this enum.
Definition: DecoderTypes.h:636
ZyanBool has_displacement
Signals, if the displacement value is used.
Definition: DecoderTypes.h:173
struct ZydisDecodedInstruction_::@7 avx
Extended info for AVX instructions.
struct ZydisDecodedOperand_::@1::@4 disp
Extended info for memory-operands with displacement.
ZyanU16 vector_length
The AVX vector-length.
Definition: DecoderTypes.h:846
Defines the ZydisDecodedInstruction struct.
Definition: DecoderTypes.h:771
Maximum value of this enum.
Definition: DecoderTypes.h:530
Maximum value of this enum.
Definition: DecoderTypes.h:508
ZyanU16 element_count
The number of elements.
Definition: DecoderTypes.h:128
struct ZydisDecodedInstruction_::@9::@15 prefixes
Detailed info about the legacy prefixes.
ZydisBroadcastMode_
Defines the ZydisBroadcastMode enum.
Definition: DecoderTypes.h:646
FPU condition-code flag 3.
Definition: DecoderTypes.h:503
struct ZydisDecodedInstruction_ ZydisDecodedInstruction
Defines the ZydisDecodedInstruction struct.
A memory operand using SIB addressing form, where the index register is not used in address calculati...
Definition: DecoderTypes.h:72
ZyanU8 kkk
Embedded opmask register specifier.
Definition: DecoderTypes.h:1217
ZydisOperandAction action
The operand-action.
Definition: DecoderTypes.h:108
enum ZydisMemoryOperandType_ ZydisMemoryOperandType
Defines the ZydisMemoryOperandType enum.
The embedded mask register is used as a merge-mask.
Definition: DecoderTypes.h:615
ZyanU8 W
64-bit operand-size promotion.
Definition: DecoderTypes.h:981
struct ZydisDecodedInstruction_::@9::@24 imm[2]
Detailed info about immediate-bytes.
ZydisConversionMode mode
The AVX data-conversion mode.
Definition: DecoderTypes.h:906
Round down.
Definition: DecoderTypes.h:689
Zero flag.
Definition: DecoderTypes.h:435
ZyanU8 address_width
The effective address width.
Definition: DecoderTypes.h:812
ZyanU8 b
Broadcast/RC/SAE Context.
Definition: DecoderTypes.h:1147
enum ZydisRoundingMode_ ZydisRoundingMode
Defines the ZydisRoundingMode enum.
struct ZydisDecodedOperand_::@3 imm
Extended info for immediate-operands.
The minimum number of bits required to represent all values of this enum.
Definition: DecoderTypes.h:706
ZyanU16 ZydisElementSize
Defines the ZydisElementSize datatype.
Definition: SharedTypes.h:161
Nested task flag.
Definition: DecoderTypes.h:463
struct ZydisDecodedInstruction_::@9::@17 xop
Detailed info about the XOP-prefix.
Maximum value of this enum.
Definition: DecoderTypes.h:702
ZyanU8 operand_width
The effective operand width.
Definition: DecoderTypes.h:808
ZyanU8 m_mmmm
Opcode-map specifier.
Definition: DecoderTypes.h:1023
Adjust flag.
Definition: DecoderTypes.h:431
The minimum number of bits required to represent all values of this enum.
Definition: DecoderTypes.h:761
ZyanU8 pp
Compressed legacy prefix.
Definition: DecoderTypes.h:1039
ZydisRegister value
The register value.
Definition: DecoderTypes.h:137
The minimum number of bits required to represent all values of this enum.
Definition: DecoderTypes.h:81
struct ZydisDecodedInstruction_::@7::@12 rounding
Contains info about the AVX rounding.
ZydisDecodedOperand operands[ZYDIS_MAX_OPERAND_COUNT]
Detailed info for all instruction operands.
Definition: DecoderTypes.h:820
Utility functions and constants for registers.
ZyanU8 E
Non-temporal/eviction hint.
Definition: DecoderTypes.h:1205
ZyanI64 value
The displacement value.
Definition: DecoderTypes.h:177
ZyanBool is_decoded
ZYAN_TRUE if the prefix got already decoded.
Definition: DecoderTypes.h:973
ZydisRegister index
The index register.
Definition: DecoderTypes.h:160
ZydisSwizzleMode_
Defines the ZydisSwizzleMode enum.
Definition: DecoderTypes.h:716
ZyanU8 vvvv
NDS register specifier (inverted).
Definition: DecoderTypes.h:1031
enum ZydisBroadcastMode_ ZydisBroadcastMode
Defines the ZydisBroadcastMode enum.
ZyanU8 mmmm
Opcode-map specifier.
Definition: DecoderTypes.h:1189
ZydisRoundingMode mode
The AVX rounding-mode.
Definition: DecoderTypes.h:886
ZyanU8 V2
High-16 NDS/VIDX register specifier.
Definition: DecoderTypes.h:1151
ZydisOpcodeMap opcode_map
The opcode-map.
Definition: DecoderTypes.h:796
struct ZydisDecodedInstruction_::@8 meta
Meta info.
ZyanU16 size
The logical size of the operand (in bits).
Definition: DecoderTypes.h:116
ZydisMaskMode_
Defines the ZydisMaskMode enum.
Definition: DecoderTypes.h:605