Zydis: include/Zydis/DecoderTypes.h Source File

Zydis v4.0.0

Loading...
Searching...
No Matches
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
42extern "C" {
43#endif
44
45/* ============================================================================================== */
46/* Decoded operand */
47/* ============================================================================================== */
48
49/* ---------------------------------------------------------------------------------------------- */
50/* Operand attributes */
51/* ---------------------------------------------------------------------------------------------- */
52
56 typedef ZyanU8 ZydisOperandAttributes;
57
66#define ZYDIS_OATTRIB_IS_MULTISOURCE4 0x01 // (1 << 0)
67
68/* ---------------------------------------------------------------------------------------------- */
69/* Memory type */
70/* ---------------------------------------------------------------------------------------------- */
71
75 typedef enum ZydisMemoryOperandType_
76{
77 ZYDIS_MEMOP_TYPE_INVALID,
81 ZYDIS_MEMOP_TYPE_MEM,
86 ZYDIS_MEMOP_TYPE_AGEN,
91 ZYDIS_MEMOP_TYPE_MIB,
95 ZYDIS_MEMOP_TYPE_VSIB,
96
100 ZYDIS_MEMOP_TYPE_MAX_VALUE = ZYDIS_MEMOP_TYPE_VSIB,
104 ZYDIS_MEMOP_TYPE_REQUIRED_BITS = ZYAN_BITS_TO_REPRESENT(ZYDIS_MEMOP_TYPE_MAX_VALUE)
105} ZydisMemoryOperandType;
106
107/* ---------------------------------------------------------------------------------------------- */
108/* Decoded operand */
109/* ---------------------------------------------------------------------------------------------- */
110
114 typedef struct ZydisDecodedOperandReg_
115{
119 ZydisRegister value;
120} ZydisDecodedOperandReg;
121
125 typedef struct ZydisDecodedOperandMem_
126{
130 ZydisMemoryOperandType type;
134 ZydisRegister segment;
138 ZydisRegister base;
142 ZydisRegister index;
146 ZyanU8 scale;
150 struct ZydisDecodedOperandMemDisp_
151 {
155 ZyanBool has_displacement;
159 ZyanI64 value;
160 } disp;
161} ZydisDecodedOperandMem;
162
166 typedef struct ZydisDecodedOperandPtr_
167{
168 ZyanU16 segment;
169 ZyanU32 offset;
170} ZydisDecodedOperandPtr;
171
175 typedef struct ZydisDecodedOperandImm_
176{
180 ZyanBool is_signed;
185 ZyanBool is_relative;
189 union ZydisDecodedOperandImmValue_
190 {
191 ZyanU64 u;
192 ZyanI64 s;
193 } value;
194} ZydisDecodedOperandImm;
195
199 typedef struct ZydisDecodedOperand_
200{
204 ZyanU8 id;
208 ZydisOperandVisibility visibility;
212 ZydisOperandActions actions;
216 ZydisOperandEncoding encoding;
220 ZyanU16 size;
224 ZydisElementType element_type;
228 ZydisElementSize element_size;
232 ZyanU16 element_count;
233 /*
234 * Additional operand attributes.
235 */
236 ZydisOperandAttributes attributes;
240 ZydisOperandType type;
241 /*
242 * Operand type specific information.
243 *
244 * The enabled union variant is determined by the `type` field.
245 */
246 union
247 {
248 ZydisDecodedOperandReg reg;
249 ZydisDecodedOperandMem mem;
250 ZydisDecodedOperandPtr ptr;
251 ZydisDecodedOperandImm imm;
252 };
253} ZydisDecodedOperand;
254
255/* ---------------------------------------------------------------------------------------------- */
256
257/* ============================================================================================== */
258/* Decoded instruction */
259/* ============================================================================================== */
260
261/* ---------------------------------------------------------------------------------------------- */
262/* CPU/FPU flags */
263/* ---------------------------------------------------------------------------------------------- */
264
268 typedef ZyanU32 ZydisAccessedFlagsMask;
269
282#define ZYDIS_CPUFLAG_CF (1ul << 0)
286#define ZYDIS_CPUFLAG_PF (1ul << 2)
290#define ZYDIS_CPUFLAG_AF (1ul << 4)
294#define ZYDIS_CPUFLAG_ZF (1ul << 6)
298#define ZYDIS_CPUFLAG_SF (1ul << 7)
302#define ZYDIS_CPUFLAG_TF (1ul << 8)
306#define ZYDIS_CPUFLAG_IF (1ul << 9)
310#define ZYDIS_CPUFLAG_DF (1ul << 10)
314#define ZYDIS_CPUFLAG_OF (1ul << 11)
318#define ZYDIS_CPUFLAG_IOPL (1ul << 12)
322#define ZYDIS_CPUFLAG_NT (1ul << 14)
326#define ZYDIS_CPUFLAG_RF (1ul << 16)
330#define ZYDIS_CPUFLAG_VM (1ul << 17)
334#define ZYDIS_CPUFLAG_AC (1ul << 18)
338#define ZYDIS_CPUFLAG_VIF (1ul << 19)
342#define ZYDIS_CPUFLAG_VIP (1ul << 20)
346#define ZYDIS_CPUFLAG_ID (1ul << 21)
347
364#define ZYDIS_FPUFLAG_C0 (1ul << 0)
368#define ZYDIS_FPUFLAG_C1 (1ul << 1)
372#define ZYDIS_FPUFLAG_C2 (1ul << 2)
376#define ZYDIS_FPUFLAG_C3 (1ul << 3)
377
382/*
383 * Information about CPU/FPU flags accessed by the instruction.
384 */
385 typedef struct ZydisAccessedFlags_
386{
387 /*
388 * As mask containing the flags `TESTED` by the instruction.
389 */
390 ZydisAccessedFlagsMask tested;
391 /*
392 * As mask containing the flags `MODIFIED` by the instruction.
393 */
394 ZydisAccessedFlagsMask modified;
395 /*
396 * As mask containing the flags `SET_0` by the instruction.
397 */
398 ZydisAccessedFlagsMask set_0;
399 /*
400 * As mask containing the flags `SET_1` by the instruction.
401 */
402 ZydisAccessedFlagsMask set_1;
403 /*
404 * As mask containing the flags `UNDEFINED` by the instruction.
405 */
406 ZydisAccessedFlagsMask undefined;
407} ZydisAccessedFlags;
408
409/* ---------------------------------------------------------------------------------------------- */
410/* Branch types */
411/* ---------------------------------------------------------------------------------------------- */
412
416 typedef enum ZydisBranchType_
417{
421 ZYDIS_BRANCH_TYPE_NONE,
425 ZYDIS_BRANCH_TYPE_SHORT,
429 ZYDIS_BRANCH_TYPE_NEAR,
433 ZYDIS_BRANCH_TYPE_FAR,
434
438 ZYDIS_BRANCH_TYPE_MAX_VALUE = ZYDIS_BRANCH_TYPE_FAR,
442 ZYDIS_BRANCH_TYPE_REQUIRED_BITS = ZYAN_BITS_TO_REPRESENT(ZYDIS_BRANCH_TYPE_MAX_VALUE)
443} ZydisBranchType;
444
445/* ---------------------------------------------------------------------------------------------- */
446/* SSE/AVX exception-class */
447/* ---------------------------------------------------------------------------------------------- */
448
452 typedef enum ZydisExceptionClass_
453{
454 ZYDIS_EXCEPTION_CLASS_NONE,
455 // TODO: FP Exceptions
456 ZYDIS_EXCEPTION_CLASS_SSE1,
457 ZYDIS_EXCEPTION_CLASS_SSE2,
458 ZYDIS_EXCEPTION_CLASS_SSE3,
459 ZYDIS_EXCEPTION_CLASS_SSE4,
460 ZYDIS_EXCEPTION_CLASS_SSE5,
461 ZYDIS_EXCEPTION_CLASS_SSE7,
462 ZYDIS_EXCEPTION_CLASS_AVX1,
463 ZYDIS_EXCEPTION_CLASS_AVX2,
464 ZYDIS_EXCEPTION_CLASS_AVX3,
465 ZYDIS_EXCEPTION_CLASS_AVX4,
466 ZYDIS_EXCEPTION_CLASS_AVX5,
467 ZYDIS_EXCEPTION_CLASS_AVX6,
468 ZYDIS_EXCEPTION_CLASS_AVX7,
469 ZYDIS_EXCEPTION_CLASS_AVX8,
470 ZYDIS_EXCEPTION_CLASS_AVX11,
471 ZYDIS_EXCEPTION_CLASS_AVX12,
472 ZYDIS_EXCEPTION_CLASS_E1,
473 ZYDIS_EXCEPTION_CLASS_E1NF,
474 ZYDIS_EXCEPTION_CLASS_E2,
475 ZYDIS_EXCEPTION_CLASS_E2NF,
476 ZYDIS_EXCEPTION_CLASS_E3,
477 ZYDIS_EXCEPTION_CLASS_E3NF,
478 ZYDIS_EXCEPTION_CLASS_E4,
479 ZYDIS_EXCEPTION_CLASS_E4NF,
480 ZYDIS_EXCEPTION_CLASS_E5,
481 ZYDIS_EXCEPTION_CLASS_E5NF,
482 ZYDIS_EXCEPTION_CLASS_E6,
483 ZYDIS_EXCEPTION_CLASS_E6NF,
484 ZYDIS_EXCEPTION_CLASS_E7NM,
485 ZYDIS_EXCEPTION_CLASS_E7NM128,
486 ZYDIS_EXCEPTION_CLASS_E9NF,
487 ZYDIS_EXCEPTION_CLASS_E10,
488 ZYDIS_EXCEPTION_CLASS_E10NF,
489 ZYDIS_EXCEPTION_CLASS_E11,
490 ZYDIS_EXCEPTION_CLASS_E11NF,
491 ZYDIS_EXCEPTION_CLASS_E12,
492 ZYDIS_EXCEPTION_CLASS_E12NP,
493 ZYDIS_EXCEPTION_CLASS_K20,
494 ZYDIS_EXCEPTION_CLASS_K21,
495 ZYDIS_EXCEPTION_CLASS_AMXE1,
496 ZYDIS_EXCEPTION_CLASS_AMXE2,
497 ZYDIS_EXCEPTION_CLASS_AMXE3,
498 ZYDIS_EXCEPTION_CLASS_AMXE4,
499 ZYDIS_EXCEPTION_CLASS_AMXE5,
500 ZYDIS_EXCEPTION_CLASS_AMXE6,
501
505 ZYDIS_EXCEPTION_CLASS_MAX_VALUE = ZYDIS_EXCEPTION_CLASS_AMXE6,
509 ZYDIS_EXCEPTION_CLASS_REQUIRED_BITS = ZYAN_BITS_TO_REPRESENT(ZYDIS_EXCEPTION_CLASS_MAX_VALUE)
510} ZydisExceptionClass;
511
512/* ---------------------------------------------------------------------------------------------- */
513/* AVX mask mode */
514/* ---------------------------------------------------------------------------------------------- */
515
519 typedef enum ZydisMaskMode_
520{
521 ZYDIS_MASK_MODE_INVALID,
525 ZYDIS_MASK_MODE_DISABLED,
529 ZYDIS_MASK_MODE_MERGING,
533 ZYDIS_MASK_MODE_ZEROING,
537 ZYDIS_MASK_MODE_CONTROL,
541 ZYDIS_MASK_MODE_CONTROL_ZEROING,
542
546 ZYDIS_MASK_MODE_MAX_VALUE = ZYDIS_MASK_MODE_CONTROL_ZEROING,
550 ZYDIS_MASK_MODE_REQUIRED_BITS = ZYAN_BITS_TO_REPRESENT(ZYDIS_MASK_MODE_MAX_VALUE)
551} ZydisMaskMode;
552
553/* ---------------------------------------------------------------------------------------------- */
554/* AVX broadcast-mode */
555/* ---------------------------------------------------------------------------------------------- */
556
560 typedef enum ZydisBroadcastMode_
561{
562 ZYDIS_BROADCAST_MODE_INVALID,
563 ZYDIS_BROADCAST_MODE_1_TO_2,
564 ZYDIS_BROADCAST_MODE_1_TO_4,
565 ZYDIS_BROADCAST_MODE_1_TO_8,
566 ZYDIS_BROADCAST_MODE_1_TO_16,
567 ZYDIS_BROADCAST_MODE_1_TO_32,
568 ZYDIS_BROADCAST_MODE_1_TO_64,
569 ZYDIS_BROADCAST_MODE_2_TO_4,
570 ZYDIS_BROADCAST_MODE_2_TO_8,
571 ZYDIS_BROADCAST_MODE_2_TO_16,
572 ZYDIS_BROADCAST_MODE_4_TO_8,
573 ZYDIS_BROADCAST_MODE_4_TO_16,
574 ZYDIS_BROADCAST_MODE_8_TO_16,
575
579 ZYDIS_BROADCAST_MODE_MAX_VALUE = ZYDIS_BROADCAST_MODE_8_TO_16,
583 ZYDIS_BROADCAST_MODE_REQUIRED_BITS = ZYAN_BITS_TO_REPRESENT(ZYDIS_BROADCAST_MODE_MAX_VALUE)
584} ZydisBroadcastMode;
585
586/* ---------------------------------------------------------------------------------------------- */
587/* AVX rounding-mode */
588/* ---------------------------------------------------------------------------------------------- */
589
593 typedef enum ZydisRoundingMode_
594{
595 ZYDIS_ROUNDING_MODE_INVALID,
599 ZYDIS_ROUNDING_MODE_RN,
603 ZYDIS_ROUNDING_MODE_RD,
607 ZYDIS_ROUNDING_MODE_RU,
611 ZYDIS_ROUNDING_MODE_RZ,
612
616 ZYDIS_ROUNDING_MODE_MAX_VALUE = ZYDIS_ROUNDING_MODE_RZ,
620 ZYDIS_ROUNDING_MODE_REQUIRED_BITS = ZYAN_BITS_TO_REPRESENT(ZYDIS_ROUNDING_MODE_MAX_VALUE)
621} ZydisRoundingMode;
622
623/* ---------------------------------------------------------------------------------------------- */
624/* KNC swizzle-mode */
625/* ---------------------------------------------------------------------------------------------- */
626
630 typedef enum ZydisSwizzleMode_
631{
632 ZYDIS_SWIZZLE_MODE_INVALID,
633 ZYDIS_SWIZZLE_MODE_DCBA,
634 ZYDIS_SWIZZLE_MODE_CDAB,
635 ZYDIS_SWIZZLE_MODE_BADC,
636 ZYDIS_SWIZZLE_MODE_DACB,
637 ZYDIS_SWIZZLE_MODE_AAAA,
638 ZYDIS_SWIZZLE_MODE_BBBB,
639 ZYDIS_SWIZZLE_MODE_CCCC,
640 ZYDIS_SWIZZLE_MODE_DDDD,
641
645 ZYDIS_SWIZZLE_MODE_MAX_VALUE = ZYDIS_SWIZZLE_MODE_DDDD,
649 ZYDIS_SWIZZLE_MODE_REQUIRED_BITS = ZYAN_BITS_TO_REPRESENT(ZYDIS_SWIZZLE_MODE_MAX_VALUE)
650} ZydisSwizzleMode;
651
652/* ---------------------------------------------------------------------------------------------- */
653/* KNC conversion-mode */
654/* ---------------------------------------------------------------------------------------------- */
655
659 typedef enum ZydisConversionMode_
660{
661 ZYDIS_CONVERSION_MODE_INVALID,
662 ZYDIS_CONVERSION_MODE_FLOAT16,
663 ZYDIS_CONVERSION_MODE_SINT8,
664 ZYDIS_CONVERSION_MODE_UINT8,
665 ZYDIS_CONVERSION_MODE_SINT16,
666 ZYDIS_CONVERSION_MODE_UINT16,
667
671 ZYDIS_CONVERSION_MODE_MAX_VALUE = ZYDIS_CONVERSION_MODE_UINT16,
675 ZYDIS_CONVERSION_MODE_REQUIRED_BITS = ZYAN_BITS_TO_REPRESENT(ZYDIS_CONVERSION_MODE_MAX_VALUE)
676} ZydisConversionMode;
677
678/* ---------------------------------------------------------------------------------------------- */
679/* Legacy prefix type */
680/* ---------------------------------------------------------------------------------------------- */
681
685 typedef enum ZydisPrefixType_
686{
693 ZYDIS_PREFIX_TYPE_IGNORED,
697 ZYDIS_PREFIX_TYPE_EFFECTIVE,
704 ZYDIS_PREFIX_TYPE_MANDATORY,
705
709 ZYDIS_PREFIX_TYPE_MAX_VALUE = ZYDIS_PREFIX_TYPE_MANDATORY,
713 ZYDIS_PREFIX_TYPE_REQUIRED_BITS = ZYAN_BITS_TO_REPRESENT(ZYDIS_PREFIX_TYPE_MAX_VALUE)
714} ZydisPrefixType;
715
716// TODO: Check effective for 66/67 prefixes (currently defaults to EFFECTIVE)
717
718/* ---------------------------------------------------------------------------------------------- */
719/* Decoded instruction */
720/* ---------------------------------------------------------------------------------------------- */
721
725 typedef struct ZydisDecodedInstructionRawRex_
726{
730 ZyanU8 W;
734 ZyanU8 R;
738 ZyanU8 X;
742 ZyanU8 B;
754 ZyanU8 offset;
755} ZydisDecodedInstructionRawRex;
756
760 typedef struct ZydisDecodedInstructionRawXop_
761{
765 ZyanU8 R;
769 ZyanU8 X;
773 ZyanU8 B;
777 ZyanU8 m_mmmm;
781 ZyanU8 W;
786 ZyanU8 vvvv;
790 ZyanU8 L;
794 ZyanU8 pp;
799 ZyanU8 offset;
800} ZydisDecodedInstructionRawXop;
801
805 typedef struct ZydisDecodedInstructionRawVex_
806{
810 ZyanU8 R;
814 ZyanU8 X;
818 ZyanU8 B;
822 ZyanU8 m_mmmm;
826 ZyanU8 W;
831 ZyanU8 vvvv;
835 ZyanU8 L;
839 ZyanU8 pp;
844 ZyanU8 offset;
848 ZyanU8 size;
849} ZydisDecodedInstructionRawVex;
850
854 typedef struct ZydisDecodedInstructionRawEvex
855{
859 ZyanU8 R;
863 ZyanU8 X;
867 ZyanU8 B;
871 ZyanU8 R2;
875 ZyanU8 mmm;
879 ZyanU8 W;
884 ZyanU8 vvvv;
888 ZyanU8 pp;
892 ZyanU8 z;
896 ZyanU8 L2;
900 ZyanU8 L;
904 ZyanU8 b;
908 ZyanU8 V2;
912 ZyanU8 aaa;
917 ZyanU8 offset;
918} ZydisDecodedInstructionRawEvex;
919
923 typedef struct ZydisDecodedInstructionRawMvex_
924{
928 ZyanU8 R;
932 ZyanU8 X;
936 ZyanU8 B;
940 ZyanU8 R2;
944 ZyanU8 mmmm;
948 ZyanU8 W;
953 ZyanU8 vvvv;
957 ZyanU8 pp;
961 ZyanU8 E;
965 ZyanU8 SSS;
969 ZyanU8 V2;
973 ZyanU8 kkk;
978 ZyanU8 offset;
979} ZydisDecodedInstructionRawMvex;
980
984 typedef struct ZydisDecodedInstructionAvx_
985{
989 ZyanU16 vector_length;
993 struct ZydisDecodedInstructionAvxMask_
994 {
998 ZydisMaskMode mode;
1002 ZydisRegister reg;
1003 } mask;
1007 struct ZydisDecodedInstructionAvxBroadcast_
1008 {
1015 ZyanBool is_static;
1019 ZydisBroadcastMode mode;
1020 } broadcast;
1024 struct ZydisDecodedInstructionAvxRounding_
1025 {
1029 ZydisRoundingMode mode;
1030 } rounding;
1034 struct ZydisDecodedInstructionAvxSwizzle_
1035 {
1039 ZydisSwizzleMode mode;
1040 } swizzle;
1044 struct ZydisDecodedInstructionAvxConversion_
1045 {
1049 ZydisConversionMode mode;
1050 } conversion;
1055 ZyanBool has_sae;
1059 ZyanBool has_eviction_hint;
1060 // TODO: publish EVEX tuple-type and MVEX functionality
1061} ZydisDecodedInstructionAvx;
1062
1066 typedef struct ZydisDecodedInstructionMeta_
1067{
1071 ZydisInstructionCategory category;
1075 ZydisISASet isa_set;
1079 ZydisISAExt isa_ext;
1083 ZydisBranchType branch_type;
1087 ZydisExceptionClass exception_class;
1088} ZydisDecodedInstructionMeta;
1089
1094 typedef struct ZydisDecodedInstructionRaw_
1095{
1099 ZyanU8 prefix_count;
1103 struct ZydisDecodedInstructionRawPrefixes_
1104 {
1108 ZydisPrefixType type;
1112 ZyanU8 value;
1113 } prefixes[ZYDIS_MAX_INSTRUCTION_LENGTH];
1114
1115 /*
1116 * Copy of the `encoding` field.
1117 *
1118 * This is here to allow the Rust bindings to treat the following union as an `enum`,
1119 * sparing us a lot of unsafe code. Prefer using the regular `encoding` field in C/C++ code.
1120 */
1121 ZydisInstructionEncoding encoding2;
1122 /*
1123 * Union for things from various mutually exclusive encodings.
1124 */
1125 union
1126 {
1127 ZydisDecodedInstructionRawRex rex;
1128 ZydisDecodedInstructionRawXop xop;
1129 ZydisDecodedInstructionRawVex vex;
1130 ZydisDecodedInstructionRawEvex evex;
1131 ZydisDecodedInstructionRawMvex mvex;
1132 };
1133
1137 struct ZydisDecodedInstructionModRm_
1138 {
1142 ZyanU8 mod;
1146 ZyanU8 reg;
1150 ZyanU8 rm;
1155 ZyanU8 offset;
1156 } modrm;
1160 struct ZydisDecodedInstructionRawSib_
1161 {
1165 ZyanU8 scale;
1169 ZyanU8 index;
1173 ZyanU8 base;
1178 ZyanU8 offset;
1179 } sib;
1183 struct ZydisDecodedInstructionRawDisp_
1184 {
1188 ZyanI64 value;
1192 ZyanU8 size;
1193 // TODO: publish cd8 scale
1198 ZyanU8 offset;
1199 } disp;
1203 struct ZydisDecodedInstructionRawImm_
1204 {
1208 ZyanBool is_signed;
1213 ZyanBool is_relative;
1217 union ZydisDecodedInstructionRawImmValue_
1218 {
1219 ZyanU64 u;
1220 ZyanI64 s;
1221 } value;
1225 ZyanU8 size;
1230 ZyanU8 offset;
1231 } imm[2];
1232} ZydisDecodedInstructionRaw;
1233
1237 typedef struct ZydisDecodedInstruction_
1238{
1242 ZydisMachineMode machine_mode;
1246 ZydisMnemonic mnemonic;
1250 ZyanU8 length;
1254 ZydisInstructionEncoding encoding;
1258 ZydisOpcodeMap opcode_map;
1262 ZyanU8 opcode;
1266 ZyanU8 stack_width;
1270 ZyanU8 operand_width;
1274 ZyanU8 address_width;
1282 ZyanU8 operand_count;
1289 ZyanU8 operand_count_visible;
1293 ZydisInstructionAttributes attributes;
1300 const ZydisAccessedFlags* cpu_flags;
1306 const ZydisAccessedFlags* fpu_flags;
1310 ZydisDecodedInstructionAvx avx;
1314 ZydisDecodedInstructionMeta meta;
1319 ZydisDecodedInstructionRaw raw;
1320} ZydisDecodedInstruction;
1321
1322/* ---------------------------------------------------------------------------------------------- */
1323/* Decoder context */
1324/* ---------------------------------------------------------------------------------------------- */
1325
1338 typedef struct ZydisDecoderContext_
1339{
1343 const void* definition;
1349 ZyanU8 eosz_index;
1355 ZyanU8 easz_index;
1359 struct
1360 {
1361 ZyanU8 W;
1362 ZyanU8 R;
1363 ZyanU8 X;
1364 ZyanU8 B;
1365 ZyanU8 L;
1366 ZyanU8 LL;
1367 ZyanU8 R2;
1368 ZyanU8 V2;
1369 ZyanU8 vvvv;
1370 ZyanU8 mask;
1371 } vector_unified;
1375 struct
1376 {
1380 ZyanBool is_mod_reg;
1384 ZyanU8 id_reg;
1390 ZyanU8 id_rm;
1394 ZyanU8 id_ndsndd;
1400 ZyanU8 id_base;
1407 ZyanU8 id_index;
1408 } reg_info;
1412 struct
1413 {
1417 ZyanU8 tuple_type;
1421 ZyanU8 element_size;
1422 } evex;
1426 struct
1427 {
1431 ZyanU8 functionality;
1432 } mvex;
1436 ZyanU8 cd8_scale; // TODO: Could make sense to expose this in the ZydisDecodedInstruction
1437} ZydisDecoderContext;
1438
1439/* ---------------------------------------------------------------------------------------------- */
1440
1441/* ============================================================================================== */
1442
1443#ifdef __cplusplus
1444}
1445#endif
1446
1447#endif /* ZYDIS_INSTRUCTIONINFO_H */
ZydisDecodedInstructionRawRex
struct ZydisDecodedInstructionRawRex_ ZydisDecodedInstructionRawRex
Detailed info about the REX prefix.
ZydisConversionMode
enum ZydisConversionMode_ ZydisConversionMode
Defines the ZydisConversionMode enum.
ZydisMaskMode
enum ZydisMaskMode_ ZydisMaskMode
Defines the ZydisMaskMode enum.
ZydisDecodedInstructionRawMvex
struct ZydisDecodedInstructionRawMvex_ ZydisDecodedInstructionRawMvex
Detailed info about the MVEX prefix.
ZydisRoundingMode
enum ZydisRoundingMode_ ZydisRoundingMode
Defines the ZydisRoundingMode enum.
ZydisDecodedOperandPtr
struct ZydisDecodedOperandPtr_ ZydisDecodedOperandPtr
Extended info for pointer-operands.
ZydisDecodedOperandImm
struct ZydisDecodedOperandImm_ ZydisDecodedOperandImm
Extended info for immediate-operands.
ZydisExceptionClass_
ZydisExceptionClass_
Defines the ZydisExceptionClass enum.
Definition: DecoderTypes.h:453
ZYDIS_EXCEPTION_CLASS_MAX_VALUE
@ ZYDIS_EXCEPTION_CLASS_MAX_VALUE
Maximum value of this enum.
Definition: DecoderTypes.h:505
ZYDIS_EXCEPTION_CLASS_REQUIRED_BITS
@ ZYDIS_EXCEPTION_CLASS_REQUIRED_BITS
The minimum number of bits required to represent all values of this enum.
Definition: DecoderTypes.h:509
ZydisBranchType_
ZydisBranchType_
Defines the ZydisBranchType enum.
Definition: DecoderTypes.h:417
ZYDIS_BRANCH_TYPE_MAX_VALUE
@ ZYDIS_BRANCH_TYPE_MAX_VALUE
Maximum value of this enum.
Definition: DecoderTypes.h:438
ZYDIS_BRANCH_TYPE_FAR
@ ZYDIS_BRANCH_TYPE_FAR
The instruction is a far (inter-segment) branch instruction.
Definition: DecoderTypes.h:433
ZYDIS_BRANCH_TYPE_NONE
@ ZYDIS_BRANCH_TYPE_NONE
The instruction is not a branch instruction.
Definition: DecoderTypes.h:421
ZYDIS_BRANCH_TYPE_NEAR
@ ZYDIS_BRANCH_TYPE_NEAR
The instruction is a near (16-bit or 32-bit) branch instruction.
Definition: DecoderTypes.h:429
ZYDIS_BRANCH_TYPE_SHORT
@ ZYDIS_BRANCH_TYPE_SHORT
The instruction is a short (8-bit) branch instruction.
Definition: DecoderTypes.h:425
ZYDIS_BRANCH_TYPE_REQUIRED_BITS
@ ZYDIS_BRANCH_TYPE_REQUIRED_BITS
The minimum number of bits required to represent all values of this enum.
Definition: DecoderTypes.h:442
ZydisDecodedOperandReg
struct ZydisDecodedOperandReg_ ZydisDecodedOperandReg
Extended info for register-operands.
ZydisDecoderContext
struct ZydisDecoderContext_ ZydisDecoderContext
The decoder context is used to preserve some internal state between subsequent decode operations for ...
ZydisAccessedFlagsMask
ZyanU32 ZydisAccessedFlagsMask
Defines the ZydisAccessedFlagsMask data-type.
Definition: DecoderTypes.h:268
ZydisBroadcastMode_
ZydisBroadcastMode_
Defines the ZydisBroadcastMode enum.
Definition: DecoderTypes.h:561
ZYDIS_BROADCAST_MODE_REQUIRED_BITS
@ ZYDIS_BROADCAST_MODE_REQUIRED_BITS
The minimum number of bits required to represent all values of this enum.
Definition: DecoderTypes.h:583
ZYDIS_BROADCAST_MODE_MAX_VALUE
@ ZYDIS_BROADCAST_MODE_MAX_VALUE
Maximum value of this enum.
Definition: DecoderTypes.h:579
ZydisExceptionClass
enum ZydisExceptionClass_ ZydisExceptionClass
Defines the ZydisExceptionClass enum.
ZydisPrefixType_
ZydisPrefixType_
Defines the ZydisPrefixType enum.
Definition: DecoderTypes.h:686
ZYDIS_PREFIX_TYPE_IGNORED
@ ZYDIS_PREFIX_TYPE_IGNORED
The prefix is ignored by the instruction.
Definition: DecoderTypes.h:693
ZYDIS_PREFIX_TYPE_REQUIRED_BITS
@ ZYDIS_PREFIX_TYPE_REQUIRED_BITS
The minimum number of bits required to represent all values of this enum.
Definition: DecoderTypes.h:713
ZYDIS_PREFIX_TYPE_MAX_VALUE
@ ZYDIS_PREFIX_TYPE_MAX_VALUE
Maximum value of this enum.
Definition: DecoderTypes.h:709
ZYDIS_PREFIX_TYPE_MANDATORY
@ ZYDIS_PREFIX_TYPE_MANDATORY
The prefix is used as a mandatory prefix.
Definition: DecoderTypes.h:704
ZYDIS_PREFIX_TYPE_EFFECTIVE
@ ZYDIS_PREFIX_TYPE_EFFECTIVE
The prefix is effectively used by the instruction.
Definition: DecoderTypes.h:697
ZydisMemoryOperandType_
ZydisMemoryOperandType_
Defines the ZydisMemoryOperandType enum.
Definition: DecoderTypes.h:76
ZYDIS_MEMOP_TYPE_AGEN
@ ZYDIS_MEMOP_TYPE_AGEN
The memory operand is only used for address-generation.
Definition: DecoderTypes.h:86
ZYDIS_MEMOP_TYPE_MEM
@ ZYDIS_MEMOP_TYPE_MEM
Normal memory operand.
Definition: DecoderTypes.h:81
ZYDIS_MEMOP_TYPE_MIB
@ ZYDIS_MEMOP_TYPE_MIB
A memory operand using SIB addressing form, where the index register is not used in address calculati...
Definition: DecoderTypes.h:91
ZYDIS_MEMOP_TYPE_REQUIRED_BITS
@ ZYDIS_MEMOP_TYPE_REQUIRED_BITS
The minimum number of bits required to represent all values of this enum.
Definition: DecoderTypes.h:104
ZYDIS_MEMOP_TYPE_VSIB
@ ZYDIS_MEMOP_TYPE_VSIB
A vector SIB memory addressing operand (VSIB).
Definition: DecoderTypes.h:95
ZYDIS_MEMOP_TYPE_MAX_VALUE
@ ZYDIS_MEMOP_TYPE_MAX_VALUE
Maximum value of this enum.
Definition: DecoderTypes.h:100
ZydisRoundingMode_
ZydisRoundingMode_
Defines the ZydisRoundingMode enum.
Definition: DecoderTypes.h:594
ZYDIS_ROUNDING_MODE_REQUIRED_BITS
@ ZYDIS_ROUNDING_MODE_REQUIRED_BITS
The minimum number of bits required to represent all values of this enum.
Definition: DecoderTypes.h:620
ZYDIS_ROUNDING_MODE_RN
@ ZYDIS_ROUNDING_MODE_RN
Round to nearest.
Definition: DecoderTypes.h:599
ZYDIS_ROUNDING_MODE_RZ
@ ZYDIS_ROUNDING_MODE_RZ
Round towards zero.
Definition: DecoderTypes.h:611
ZYDIS_ROUNDING_MODE_RD
@ ZYDIS_ROUNDING_MODE_RD
Round down.
Definition: DecoderTypes.h:603
ZYDIS_ROUNDING_MODE_MAX_VALUE
@ ZYDIS_ROUNDING_MODE_MAX_VALUE
Maximum value of this enum.
Definition: DecoderTypes.h:616
ZYDIS_ROUNDING_MODE_RU
@ ZYDIS_ROUNDING_MODE_RU
Round up.
Definition: DecoderTypes.h:607
ZydisDecodedInstructionRawXop
struct ZydisDecodedInstructionRawXop_ ZydisDecodedInstructionRawXop
Detailed info about the XOP prefix.
ZydisSwizzleMode
enum ZydisSwizzleMode_ ZydisSwizzleMode
Defines the ZydisSwizzleMode enum.
ZydisMemoryOperandType
enum ZydisMemoryOperandType_ ZydisMemoryOperandType
Defines the ZydisMemoryOperandType enum.
ZydisDecodedInstructionRaw
struct ZydisDecodedInstructionRaw_ ZydisDecodedInstructionRaw
Detailed info about different instruction-parts like ModRM, SIB or encoding-prefixes.
ZydisConversionMode_
ZydisConversionMode_
Defines the ZydisConversionMode enum.
Definition: DecoderTypes.h:660
ZYDIS_CONVERSION_MODE_REQUIRED_BITS
@ ZYDIS_CONVERSION_MODE_REQUIRED_BITS
The minimum number of bits required to represent all values of this enum.
Definition: DecoderTypes.h:675
ZYDIS_CONVERSION_MODE_MAX_VALUE
@ ZYDIS_CONVERSION_MODE_MAX_VALUE
Maximum value of this enum.
Definition: DecoderTypes.h:671
ZydisOperandAttributes
ZyanU8 ZydisOperandAttributes
Defines the ZydisOperandAttributes data-type.
Definition: DecoderTypes.h:56
ZydisDecodedOperand
struct ZydisDecodedOperand_ ZydisDecodedOperand
Defines the ZydisDecodedOperand struct.
ZydisDecodedInstructionMeta
struct ZydisDecodedInstructionMeta_ ZydisDecodedInstructionMeta
Instruction meta info.
ZydisDecodedOperandMem
struct ZydisDecodedOperandMem_ ZydisDecodedOperandMem
Extended info for memory-operands.
ZydisBroadcastMode
enum ZydisBroadcastMode_ ZydisBroadcastMode
Defines the ZydisBroadcastMode enum.
ZydisPrefixType
enum ZydisPrefixType_ ZydisPrefixType
Defines the ZydisPrefixType enum.
ZydisDecodedInstruction
struct ZydisDecodedInstruction_ ZydisDecodedInstruction
Information about a decoded instruction.
ZydisMaskMode_
ZydisMaskMode_
Defines the ZydisMaskMode enum.
Definition: DecoderTypes.h:520
ZYDIS_MASK_MODE_DISABLED
@ ZYDIS_MASK_MODE_DISABLED
Masking is disabled for the current instruction (K0 register is used).
Definition: DecoderTypes.h:525
ZYDIS_MASK_MODE_CONTROL
@ ZYDIS_MASK_MODE_CONTROL
The embedded mask register is used as a control-mask (element selector).
Definition: DecoderTypes.h:537
ZYDIS_MASK_MODE_MAX_VALUE
@ ZYDIS_MASK_MODE_MAX_VALUE
Maximum value of this enum.
Definition: DecoderTypes.h:546
ZYDIS_MASK_MODE_MERGING
@ ZYDIS_MASK_MODE_MERGING
The embedded mask register is used as a merge-mask.
Definition: DecoderTypes.h:529
ZYDIS_MASK_MODE_CONTROL_ZEROING
@ ZYDIS_MASK_MODE_CONTROL_ZEROING
The embedded mask register is used as a zeroing control-mask (element selector).
Definition: DecoderTypes.h:541
ZYDIS_MASK_MODE_ZEROING
@ ZYDIS_MASK_MODE_ZEROING
The embedded mask register is used as a zero-mask.
Definition: DecoderTypes.h:533
ZYDIS_MASK_MODE_REQUIRED_BITS
@ ZYDIS_MASK_MODE_REQUIRED_BITS
The minimum number of bits required to represent all values of this enum.
Definition: DecoderTypes.h:550
ZydisBranchType
enum ZydisBranchType_ ZydisBranchType
Defines the ZydisBranchType enum.
ZydisSwizzleMode_
ZydisSwizzleMode_
Defines the ZydisSwizzleMode enum.
Definition: DecoderTypes.h:631
ZYDIS_SWIZZLE_MODE_MAX_VALUE
@ ZYDIS_SWIZZLE_MODE_MAX_VALUE
Maximum value of this enum.
Definition: DecoderTypes.h:645
ZYDIS_SWIZZLE_MODE_REQUIRED_BITS
@ ZYDIS_SWIZZLE_MODE_REQUIRED_BITS
The minimum number of bits required to represent all values of this enum.
Definition: DecoderTypes.h:649
ZydisDecodedInstructionRawVex
struct ZydisDecodedInstructionRawVex_ ZydisDecodedInstructionRawVex
Detailed info about the VEX prefix.
ZydisDecodedInstructionAvx
struct ZydisDecodedInstructionAvx_ ZydisDecodedInstructionAvx
Extended info for AVX instructions.
MetaInfo.h
Mnemonic.h
Mnemonic constant definitions and helper functions.
Register.h
Utility functions and constants for registers.
SharedTypes.h
Defines decoder/encoder-shared macros and types.
ZydisOperandEncoding
enum ZydisOperandEncoding_ ZydisOperandEncoding
Defines the ZydisOperandEncoding enum.
ZydisInstructionEncoding
enum ZydisInstructionEncoding_ ZydisInstructionEncoding
Defines the ZydisInstructionEncoding enum.
ZydisOperandType
enum ZydisOperandType_ ZydisOperandType
Defines the ZydisOperandType enum.
ZydisOperandVisibility
enum ZydisOperandVisibility_ ZydisOperandVisibility
Defines the ZydisOperandVisibility enum.
ZydisOperandActions
ZyanU8 ZydisOperandActions
Defines the ZydisOperandActions data-type.
Definition: SharedTypes.h:402
ZydisOpcodeMap
enum ZydisOpcodeMap_ ZydisOpcodeMap
Defines the ZydisOpcodeMap enum.
ZydisElementType
enum ZydisElementType_ ZydisElementType
Defines the ZydisElementType enum.
ZydisElementSize
ZyanU16 ZydisElementSize
Defines the ZydisElementSize datatype.
Definition: SharedTypes.h:190
ZydisMachineMode
enum ZydisMachineMode_ ZydisMachineMode
Defines the ZydisMachineMode enum.
ZydisInstructionAttributes
ZyanU64 ZydisInstructionAttributes
Defines the ZydisInstructionAttributes data-type.
Definition: SharedTypes.h:497
ZydisAccessedFlags_
Definition: DecoderTypes.h:386
ZydisDecodedInstructionAvx_::ZydisDecodedInstructionAvxBroadcast_
Contains info about the AVX broadcast.
Definition: DecoderTypes.h:1008
ZydisDecodedInstructionAvx_::ZydisDecodedInstructionAvxBroadcast_::mode
ZydisBroadcastMode mode
The AVX broadcast-mode.
Definition: DecoderTypes.h:1019
ZydisDecodedInstructionAvx_::ZydisDecodedInstructionAvxBroadcast_::is_static
ZyanBool is_static
Signals, if the broadcast is a static broadcast.
Definition: DecoderTypes.h:1015
ZydisDecodedInstructionAvx_::ZydisDecodedInstructionAvxConversion_
Contains info about the AVX data-conversion (KNC only).
Definition: DecoderTypes.h:1045
ZydisDecodedInstructionAvx_::ZydisDecodedInstructionAvxConversion_::mode
ZydisConversionMode mode
The AVX data-conversion mode.
Definition: DecoderTypes.h:1049
ZydisDecodedInstructionAvx_::ZydisDecodedInstructionAvxMask_
Info about the embedded writemask-register (AVX-512 and KNC only).
Definition: DecoderTypes.h:994
ZydisDecodedInstructionAvx_::ZydisDecodedInstructionAvxMask_::reg
ZydisRegister reg
The mask register.
Definition: DecoderTypes.h:1002
ZydisDecodedInstructionAvx_::ZydisDecodedInstructionAvxMask_::mode
ZydisMaskMode mode
The masking mode.
Definition: DecoderTypes.h:998
ZydisDecodedInstructionAvx_::ZydisDecodedInstructionAvxRounding_
Contains info about the AVX rounding.
Definition: DecoderTypes.h:1025
ZydisDecodedInstructionAvx_::ZydisDecodedInstructionAvxRounding_::mode
ZydisRoundingMode mode
The AVX rounding-mode.
Definition: DecoderTypes.h:1029
ZydisDecodedInstructionAvx_::ZydisDecodedInstructionAvxSwizzle_
Contains info about the AVX register-swizzle (KNC only).
Definition: DecoderTypes.h:1035
ZydisDecodedInstructionAvx_::ZydisDecodedInstructionAvxSwizzle_::mode
ZydisSwizzleMode mode
The AVX register-swizzle mode.
Definition: DecoderTypes.h:1039
ZydisDecodedInstructionAvx_
Extended info for AVX instructions.
Definition: DecoderTypes.h:985
ZydisDecodedInstructionAvx_::has_eviction_hint
ZyanBool has_eviction_hint
Signals, if the instruction has a memory-eviction-hint (KNC only).
Definition: DecoderTypes.h:1059
ZydisDecodedInstructionAvx_::vector_length
ZyanU16 vector_length
The AVX vector-length.
Definition: DecoderTypes.h:989
ZydisDecodedInstructionAvx_::has_sae
ZyanBool has_sae
Signals, if the SAE (suppress-all-exceptions) functionality is enabled for the instruction.
Definition: DecoderTypes.h:1055
ZydisDecodedInstructionMeta_
Instruction meta info.
Definition: DecoderTypes.h:1067
ZydisDecodedInstructionMeta_::branch_type
ZydisBranchType branch_type
The branch type.
Definition: DecoderTypes.h:1083
ZydisDecodedInstructionMeta_::isa_set
ZydisISASet isa_set
The ISA-set.
Definition: DecoderTypes.h:1075
ZydisDecodedInstructionMeta_::isa_ext
ZydisISAExt isa_ext
The ISA-set extension.
Definition: DecoderTypes.h:1079
ZydisDecodedInstructionMeta_::exception_class
ZydisExceptionClass exception_class
The exception class.
Definition: DecoderTypes.h:1087
ZydisDecodedInstructionMeta_::category
ZydisInstructionCategory category
The instruction category.
Definition: DecoderTypes.h:1071
ZydisDecodedInstructionRawEvex
Detailed info about the EVEX prefix.
Definition: DecoderTypes.h:855
ZydisDecodedInstructionRawEvex::R2
ZyanU8 R2
High-16 register specifier modifier (inverted).
Definition: DecoderTypes.h:871
ZydisDecodedInstructionRawEvex::L2
ZyanU8 L2
Vector-length specifier or rounding-control (most significant bit).
Definition: DecoderTypes.h:896
ZydisDecodedInstructionRawEvex::X
ZyanU8 X
Extension of the SIB.index/vidx field (inverted).
Definition: DecoderTypes.h:863
ZydisDecodedInstructionRawEvex::L
ZyanU8 L
Vector-length specifier or rounding-control (least significant bit).
Definition: DecoderTypes.h:900
ZydisDecodedInstructionRawEvex::aaa
ZyanU8 aaa
Embedded opmask register specifier.
Definition: DecoderTypes.h:912
ZydisDecodedInstructionRawEvex::offset
ZyanU8 offset
The offset of the first evex byte, relative to the beginning of the instruction, in bytes.
Definition: DecoderTypes.h:917
ZydisDecodedInstructionRawEvex::R
ZyanU8 R
Extension of the ModRM.reg field (inverted).
Definition: DecoderTypes.h:859
ZydisDecodedInstructionRawEvex::pp
ZyanU8 pp
Compressed legacy prefix.
Definition: DecoderTypes.h:888
ZydisDecodedInstructionRawEvex::W
ZyanU8 W
64-bit operand-size promotion or opcode-extension.
Definition: DecoderTypes.h:879
ZydisDecodedInstructionRawEvex::b
ZyanU8 b
Broadcast/RC/SAE context.
Definition: DecoderTypes.h:904
ZydisDecodedInstructionRawEvex::z
ZyanU8 z
Zeroing/Merging.
Definition: DecoderTypes.h:892
ZydisDecodedInstructionRawEvex::vvvv
ZyanU8 vvvv
NDS/NDD (non-destructive-source/destination) register specifier (inverted).
Definition: DecoderTypes.h:884
ZydisDecodedInstructionRawEvex::V2
ZyanU8 V2
High-16 NDS/VIDX register specifier.
Definition: DecoderTypes.h:908
ZydisDecodedInstructionRawEvex::B
ZyanU8 B
Extension of the ModRM.rm or SIB.base field (inverted).
Definition: DecoderTypes.h:867
ZydisDecodedInstructionRawEvex::mmm
ZyanU8 mmm
Opcode-map specifier.
Definition: DecoderTypes.h:875
ZydisDecodedInstructionRawMvex_
Detailed info about the MVEX prefix.
Definition: DecoderTypes.h:924
ZydisDecodedInstructionRawMvex_::SSS
ZyanU8 SSS
Swizzle/broadcast/up-convert/down-convert/static-rounding controls.
Definition: DecoderTypes.h:965
ZydisDecodedInstructionRawMvex_::R2
ZyanU8 R2
High-16 register specifier modifier (inverted).
Definition: DecoderTypes.h:940
ZydisDecodedInstructionRawMvex_::kkk
ZyanU8 kkk
Embedded opmask register specifier.
Definition: DecoderTypes.h:973
ZydisDecodedInstructionRawMvex_::X
ZyanU8 X
Extension of the SIB.index/vidx field (inverted).
Definition: DecoderTypes.h:932
ZydisDecodedInstructionRawMvex_::offset
ZyanU8 offset
The offset of the first mvex byte, relative to the beginning of the instruction, in bytes.
Definition: DecoderTypes.h:978
ZydisDecodedInstructionRawMvex_::R
ZyanU8 R
Extension of the ModRM.reg field (inverted).
Definition: DecoderTypes.h:928
ZydisDecodedInstructionRawMvex_::pp
ZyanU8 pp
Compressed legacy prefix.
Definition: DecoderTypes.h:957
ZydisDecodedInstructionRawMvex_::W
ZyanU8 W
64-bit operand-size promotion or opcode-extension.
Definition: DecoderTypes.h:948
ZydisDecodedInstructionRawMvex_::mmmm
ZyanU8 mmmm
Opcode-map specifier.
Definition: DecoderTypes.h:944
ZydisDecodedInstructionRawMvex_::vvvv
ZyanU8 vvvv
NDS/NDD (non-destructive-source/destination) register specifier (inverted).
Definition: DecoderTypes.h:953
ZydisDecodedInstructionRawMvex_::V2
ZyanU8 V2
High-16 NDS/VIDX register specifier.
Definition: DecoderTypes.h:969
ZydisDecodedInstructionRawMvex_::E
ZyanU8 E
Non-temporal/eviction hint.
Definition: DecoderTypes.h:961
ZydisDecodedInstructionRawMvex_::B
ZyanU8 B
Extension of the ModRM.rm or SIB.base field (inverted).
Definition: DecoderTypes.h:936
ZydisDecodedInstructionRawRex_
Detailed info about the REX prefix.
Definition: DecoderTypes.h:726
ZydisDecodedInstructionRawRex_::X
ZyanU8 X
Extension of the SIB.index field.
Definition: DecoderTypes.h:738
ZydisDecodedInstructionRawRex_::offset
ZyanU8 offset
The offset of the effective REX byte, relative to the beginning of the instruction,...
Definition: DecoderTypes.h:754
ZydisDecodedInstructionRawRex_::R
ZyanU8 R
Extension of the ModRM.reg field.
Definition: DecoderTypes.h:734
ZydisDecodedInstructionRawRex_::W
ZyanU8 W
64-bit operand-size promotion.
Definition: DecoderTypes.h:730
ZydisDecodedInstructionRawRex_::B
ZyanU8 B
Extension of the ModRM.rm, SIB.base, or opcode.reg field.
Definition: DecoderTypes.h:742
ZydisDecodedInstructionRawVex_
Detailed info about the VEX prefix.
Definition: DecoderTypes.h:806
ZydisDecodedInstructionRawVex_::m_mmmm
ZyanU8 m_mmmm
Opcode-map specifier.
Definition: DecoderTypes.h:822
ZydisDecodedInstructionRawVex_::X
ZyanU8 X
Extension of the SIB.index field (inverted).
Definition: DecoderTypes.h:814
ZydisDecodedInstructionRawVex_::size
ZyanU8 size
The size of the VEX prefix, in bytes.
Definition: DecoderTypes.h:848
ZydisDecodedInstructionRawVex_::L
ZyanU8 L
Vector-length specifier.
Definition: DecoderTypes.h:835
ZydisDecodedInstructionRawVex_::offset
ZyanU8 offset
The offset of the first VEX byte, relative to the beginning of the instruction, in bytes.
Definition: DecoderTypes.h:844
ZydisDecodedInstructionRawVex_::R
ZyanU8 R
Extension of the ModRM.reg field (inverted).
Definition: DecoderTypes.h:810
ZydisDecodedInstructionRawVex_::pp
ZyanU8 pp
Compressed legacy prefix.
Definition: DecoderTypes.h:839
ZydisDecodedInstructionRawVex_::W
ZyanU8 W
64-bit operand-size promotion or opcode-extension.
Definition: DecoderTypes.h:826
ZydisDecodedInstructionRawVex_::vvvv
ZyanU8 vvvv
NDS/NDD (non-destructive-source/destination) register specifier (inverted).
Definition: DecoderTypes.h:831
ZydisDecodedInstructionRawVex_::B
ZyanU8 B
Extension of the ModRM.rm, SIB.base, or opcode.reg field (inverted).
Definition: DecoderTypes.h:818
ZydisDecodedInstructionRawXop_
Detailed info about the XOP prefix.
Definition: DecoderTypes.h:761
ZydisDecodedInstructionRawXop_::m_mmmm
ZyanU8 m_mmmm
Opcode-map specifier.
Definition: DecoderTypes.h:777
ZydisDecodedInstructionRawXop_::X
ZyanU8 X
Extension of the SIB.index field (inverted).
Definition: DecoderTypes.h:769
ZydisDecodedInstructionRawXop_::L
ZyanU8 L
Vector-length specifier.
Definition: DecoderTypes.h:790
ZydisDecodedInstructionRawXop_::offset
ZyanU8 offset
The offset of the first xop byte, relative to the beginning of the instruction, in bytes.
Definition: DecoderTypes.h:799
ZydisDecodedInstructionRawXop_::R
ZyanU8 R
Extension of the ModRM.reg field (inverted).
Definition: DecoderTypes.h:765
ZydisDecodedInstructionRawXop_::pp
ZyanU8 pp
Compressed legacy prefix.
Definition: DecoderTypes.h:794
ZydisDecodedInstructionRawXop_::W
ZyanU8 W
64-bit operand-size promotion or opcode-extension.
Definition: DecoderTypes.h:781
ZydisDecodedInstructionRawXop_::vvvv
ZyanU8 vvvv
NDS/NDD (non-destructive-source/destination) register specifier (inverted).
Definition: DecoderTypes.h:786
ZydisDecodedInstructionRawXop_::B
ZyanU8 B
Extension of the ModRM.rm, SIB.base, or opcode.reg field (inverted).
Definition: DecoderTypes.h:773
ZydisDecodedInstructionRaw_::ZydisDecodedInstructionModRm_
Detailed info about the ModRM byte.
Definition: DecoderTypes.h:1138
ZydisDecodedInstructionRaw_::ZydisDecodedInstructionModRm_::rm
ZyanU8 rm
Register specifier or opcode-extension.
Definition: DecoderTypes.h:1150
ZydisDecodedInstructionRaw_::ZydisDecodedInstructionModRm_::mod
ZyanU8 mod
The addressing mode.
Definition: DecoderTypes.h:1142
ZydisDecodedInstructionRaw_::ZydisDecodedInstructionModRm_::offset
ZyanU8 offset
The offset of the ModRM byte, relative to the beginning of the instruction, in bytes.
Definition: DecoderTypes.h:1155
ZydisDecodedInstructionRaw_::ZydisDecodedInstructionModRm_::reg
ZyanU8 reg
Register specifier or opcode-extension.
Definition: DecoderTypes.h:1146
ZydisDecodedInstructionRaw_::ZydisDecodedInstructionRawDisp_
Detailed info about displacement-bytes.
Definition: DecoderTypes.h:1184
ZydisDecodedInstructionRaw_::ZydisDecodedInstructionRawDisp_::size
ZyanU8 size
The physical displacement size, in bits.
Definition: DecoderTypes.h:1192
ZydisDecodedInstructionRaw_::ZydisDecodedInstructionRawDisp_::value
ZyanI64 value
The displacement value.
Definition: DecoderTypes.h:1188
ZydisDecodedInstructionRaw_::ZydisDecodedInstructionRawDisp_::offset
ZyanU8 offset
The offset of the displacement data, relative to the beginning of the instruction,...
Definition: DecoderTypes.h:1198
ZydisDecodedInstructionRaw_::ZydisDecodedInstructionRawImm_
Detailed info about immediate-bytes.
Definition: DecoderTypes.h:1204
ZydisDecodedInstructionRaw_::ZydisDecodedInstructionRawImm_::size
ZyanU8 size
The physical immediate size, in bits.
Definition: DecoderTypes.h:1225
ZydisDecodedInstructionRaw_::ZydisDecodedInstructionRawImm_::is_relative
ZyanBool is_relative
Signals, if the immediate value contains a relative offset.
Definition: DecoderTypes.h:1213
ZydisDecodedInstructionRaw_::ZydisDecodedInstructionRawImm_::is_signed
ZyanBool is_signed
Signals, if the immediate value is signed.
Definition: DecoderTypes.h:1208
ZydisDecodedInstructionRaw_::ZydisDecodedInstructionRawImm_::offset
ZyanU8 offset
The offset of the immediate data, relative to the beginning of the instruction, in bytes.
Definition: DecoderTypes.h:1230
ZydisDecodedInstructionRaw_::ZydisDecodedInstructionRawPrefixes_
Detailed info about the legacy prefixes (including REX).
Definition: DecoderTypes.h:1104
ZydisDecodedInstructionRaw_::ZydisDecodedInstructionRawPrefixes_::type
ZydisPrefixType type
The prefix type.
Definition: DecoderTypes.h:1108
ZydisDecodedInstructionRaw_::ZydisDecodedInstructionRawPrefixes_::value
ZyanU8 value
The prefix byte.
Definition: DecoderTypes.h:1112
ZydisDecodedInstructionRaw_::ZydisDecodedInstructionRawSib_
Detailed info about the SIB byte.
Definition: DecoderTypes.h:1161
ZydisDecodedInstructionRaw_::ZydisDecodedInstructionRawSib_::base
ZyanU8 base
The base-register specifier.
Definition: DecoderTypes.h:1173
ZydisDecodedInstructionRaw_::ZydisDecodedInstructionRawSib_::scale
ZyanU8 scale
The scale factor.
Definition: DecoderTypes.h:1165
ZydisDecodedInstructionRaw_::ZydisDecodedInstructionRawSib_::offset
ZyanU8 offset
The offset of the SIB byte, relative to the beginning of the instruction, in bytes.
Definition: DecoderTypes.h:1178
ZydisDecodedInstructionRaw_::ZydisDecodedInstructionRawSib_::index
ZyanU8 index
The index-register specifier.
Definition: DecoderTypes.h:1169
ZydisDecodedInstructionRaw_
Detailed info about different instruction-parts like ModRM, SIB or encoding-prefixes.
Definition: DecoderTypes.h:1095
ZydisDecodedInstructionRaw_::prefix_count
ZyanU8 prefix_count
The number of legacy prefixes.
Definition: DecoderTypes.h:1099
ZydisDecodedInstruction_
Information about a decoded instruction.
Definition: DecoderTypes.h:1238
ZydisDecodedInstruction_::mnemonic
ZydisMnemonic mnemonic
The instruction-mnemonic.
Definition: DecoderTypes.h:1246
ZydisDecodedInstruction_::operand_width
ZyanU8 operand_width
The effective operand width.
Definition: DecoderTypes.h:1270
ZydisDecodedInstruction_::meta
ZydisDecodedInstructionMeta meta
Meta info.
Definition: DecoderTypes.h:1314
ZydisDecodedInstruction_::opcode
ZyanU8 opcode
The instruction-opcode.
Definition: DecoderTypes.h:1262
ZydisDecodedInstruction_::machine_mode
ZydisMachineMode machine_mode
The machine mode used to decode this instruction.
Definition: DecoderTypes.h:1242
ZydisDecodedInstruction_::opcode_map
ZydisOpcodeMap opcode_map
The opcode-map.
Definition: DecoderTypes.h:1258
ZydisDecodedInstruction_::encoding
ZydisInstructionEncoding encoding
The instruction-encoding (LEGACY, 3DNOW, VEX, EVEX, XOP).
Definition: DecoderTypes.h:1254
ZydisDecodedInstruction_::attributes
ZydisInstructionAttributes attributes
See Instruction attributes.
Definition: DecoderTypes.h:1293
ZydisDecodedInstruction_::stack_width
ZyanU8 stack_width
The stack width.
Definition: DecoderTypes.h:1266
ZydisDecodedInstruction_::cpu_flags
const ZydisAccessedFlags * cpu_flags
Information about CPU flags accessed by the instruction.
Definition: DecoderTypes.h:1300
ZydisDecodedInstruction_::address_width
ZyanU8 address_width
The effective address width.
Definition: DecoderTypes.h:1274
ZydisDecodedInstruction_::operand_count
ZyanU8 operand_count
The number of instruction-operands.
Definition: DecoderTypes.h:1282
ZydisDecodedInstruction_::length
ZyanU8 length
The length of the decoded instruction.
Definition: DecoderTypes.h:1250
ZydisDecodedInstruction_::avx
ZydisDecodedInstructionAvx avx
Extended info for AVX instructions.
Definition: DecoderTypes.h:1310
ZydisDecodedInstruction_::fpu_flags
const ZydisAccessedFlags * fpu_flags
Information about FPU flags accessed by the instruction.
Definition: DecoderTypes.h:1306
ZydisDecodedInstruction_::raw
ZydisDecodedInstructionRaw raw
Detailed info about different instruction-parts like ModRM, SIB or encoding-prefixes.
Definition: DecoderTypes.h:1319
ZydisDecodedInstruction_::operand_count_visible
ZyanU8 operand_count_visible
The number of explicit (visible) instruction-operands.
Definition: DecoderTypes.h:1289
ZydisDecodedOperandImm_
Extended info for immediate-operands.
Definition: DecoderTypes.h:176
ZydisDecodedOperandImm_::is_relative
ZyanBool is_relative
Signals, if the immediate value contains a relative offset.
Definition: DecoderTypes.h:185
ZydisDecodedOperandImm_::is_signed
ZyanBool is_signed
Signals, if the immediate value is signed.
Definition: DecoderTypes.h:180
ZydisDecodedOperandMem_::ZydisDecodedOperandMemDisp_
Extended info for memory-operands with displacement.
Definition: DecoderTypes.h:151
ZydisDecodedOperandMem_::ZydisDecodedOperandMemDisp_::value
ZyanI64 value
The displacement value.
Definition: DecoderTypes.h:159
ZydisDecodedOperandMem_::ZydisDecodedOperandMemDisp_::has_displacement
ZyanBool has_displacement
Signals, if the displacement value is used.
Definition: DecoderTypes.h:155
ZydisDecodedOperandMem_
Extended info for memory-operands.
Definition: DecoderTypes.h:126
ZydisDecodedOperandMem_::type
ZydisMemoryOperandType type
The type of the memory operand.
Definition: DecoderTypes.h:130
ZydisDecodedOperandMem_::segment
ZydisRegister segment
The segment register.
Definition: DecoderTypes.h:134
ZydisDecodedOperandMem_::base
ZydisRegister base
The base register.
Definition: DecoderTypes.h:138
ZydisDecodedOperandMem_::scale
ZyanU8 scale
The scale factor.
Definition: DecoderTypes.h:146
ZydisDecodedOperandMem_::index
ZydisRegister index
The index register.
Definition: DecoderTypes.h:142
ZydisDecodedOperandPtr_
Extended info for pointer-operands.
Definition: DecoderTypes.h:167
ZydisDecodedOperandReg_
Extended info for register-operands.
Definition: DecoderTypes.h:115
ZydisDecodedOperandReg_::value
ZydisRegister value
The register value.
Definition: DecoderTypes.h:119
ZydisDecodedOperand_
Defines the ZydisDecodedOperand struct.
Definition: DecoderTypes.h:200
ZydisDecodedOperand_::size
ZyanU16 size
The logical size of the operand (in bits).
Definition: DecoderTypes.h:220
ZydisDecodedOperand_::element_count
ZyanU16 element_count
The number of elements.
Definition: DecoderTypes.h:232
ZydisDecodedOperand_::actions
ZydisOperandActions actions
The operand-actions.
Definition: DecoderTypes.h:212
ZydisDecodedOperand_::encoding
ZydisOperandEncoding encoding
The operand-encoding.
Definition: DecoderTypes.h:216
ZydisDecodedOperand_::element_type
ZydisElementType element_type
The element-type.
Definition: DecoderTypes.h:224
ZydisDecodedOperand_::visibility
ZydisOperandVisibility visibility
The visibility of the operand.
Definition: DecoderTypes.h:208
ZydisDecodedOperand_::type
ZydisOperandType type
The type of the operand.
Definition: DecoderTypes.h:240
ZydisDecodedOperand_::id
ZyanU8 id
The operand-id.
Definition: DecoderTypes.h:204
ZydisDecodedOperand_::element_size
ZydisElementSize element_size
The size of a single element.
Definition: DecoderTypes.h:228
ZydisDecoderContext_
The decoder context is used to preserve some internal state between subsequent decode operations for ...
Definition: DecoderTypes.h:1339
ZydisDecoderContext_::functionality
ZyanU8 functionality
The MVEX functionality.
Definition: DecoderTypes.h:1431
ZydisDecoderContext_::mvex
struct ZydisDecoderContext_::@7 mvex
Internal MVEX-specific information.
ZydisDecoderContext_::tuple_type
ZyanU8 tuple_type
The EVEX tuple-type.
Definition: DecoderTypes.h:1417
ZydisDecoderContext_::id_base
ZyanU8 id_base
The final register id for the base register.
Definition: DecoderTypes.h:1400
ZydisDecoderContext_::cd8_scale
ZyanU8 cd8_scale
The scale factor for EVEX/MVEX compressed 8-bit displacement values.
Definition: DecoderTypes.h:1436
ZydisDecoderContext_::reg_info
struct ZydisDecoderContext_::@5 reg_info
Information about encoded operand registers.
ZydisDecoderContext_::element_size
ZyanU8 element_size
The EVEX element-size.
Definition: DecoderTypes.h:1421
ZydisDecoderContext_::eosz_index
ZyanU8 eosz_index
Contains the effective operand-size index.
Definition: DecoderTypes.h:1349
ZydisDecoderContext_::id_rm
ZyanU8 id_rm
The final register id for the rm encoded register.
Definition: DecoderTypes.h:1390
ZydisDecoderContext_::evex
struct ZydisDecoderContext_::@6 evex
Internal EVEX-specific information.
ZydisDecoderContext_::id_reg
ZyanU8 id_reg
The final register id for the reg encoded register.
Definition: DecoderTypes.h:1384
ZydisDecoderContext_::definition
const void * definition
A pointer to the internal instruction definition.
Definition: DecoderTypes.h:1343
ZydisDecoderContext_::vector_unified
struct ZydisDecoderContext_::@4 vector_unified
Contains some cached REX/XOP/VEX/EVEX/MVEX values to provide uniform access.
ZydisDecoderContext_::id_index
ZyanU8 id_index
The final register id for the index register.
Definition: DecoderTypes.h:1407
ZydisDecoderContext_::is_mod_reg
ZyanBool is_mod_reg
Signals if the modrm.mod == 3 or reg form is forced for the instruction.
Definition: DecoderTypes.h:1380
ZydisDecoderContext_::id_ndsndd
ZyanU8 id_ndsndd
The final register id for the ndsndd (.vvvv) encoded register.
Definition: DecoderTypes.h:1394
ZydisDecoderContext_::easz_index
ZyanU8 easz_index
Contains the effective address-size index.
Definition: DecoderTypes.h:1355
ZydisDecodedInstructionRaw_::ZydisDecodedInstructionRawImm_::ZydisDecodedInstructionRawImmValue_
The immediate value.
Definition: DecoderTypes.h:1218
ZydisDecodedOperandImm_::ZydisDecodedOperandImmValue_
The immediate value.
Definition: DecoderTypes.h:190