27 #ifndef ZYDIS_INTERNAL_DECODERDATA_H
28 #define ZYDIS_INTERNAL_DECODERDATA_H
30 #include <Zycore/Defines.h>
31 #include <Zycore/Types.h>
44 # pragma warning(push)
45 # pragma warning(disable:4214)
233 #define ZYDIS_OPCODE_TABLE_PRIMARY 0x00
234 #define ZYDIS_OPCODE_TABLE_0F 0x01
235 #define ZYDIS_OPCODE_TABLE_0F38 0x02
236 #define ZYDIS_OPCODE_TABLE_0F3A 0x03
237 #define ZYDIS_OPCODE_TABLE_VEX 0x04
238 #define ZYDIS_OPCODE_TABLE_EVEX 0x14
239 #define ZYDIS_OPCODE_TABLE_MVEX 0x34
240 #define ZYDIS_OPCODE_TABLE_XOP 0x44
241 #define ZYDIS_OPCODE_TABLE_3DNOW 0x47
248 # pragma warning(pop)
263 #define ZYDIS_INSTR_ENC_FLAG_HAS_MODRM 0x01
268 #define ZYDIS_INSTR_ENC_FLAG_HAS_DISP 0x02
273 #define ZYDIS_INSTR_ENC_FLAG_HAS_IMM0 0x04
278 #define ZYDIS_INSTR_ENC_FLAG_HAS_IMM1 0x08
286 #define ZYDIS_INSTR_ENC_FLAG_FORCE_REG_FORM 0x10
348 #define ZYDIS_DT_GET_TYPE(node) \
349 ((ZydisDecoderTreeNodeType)((*(node)) & 0xFF))
358 #define ZYDIS_DT_GET_ARG0(node) \
359 ((ZyanU8)(((*(node)) >> 8) & 0xFF))
367 #define ZYDIS_DT_GET_VALUE(node, index) \
368 ((ZyanU16)(*((node) + 1 + (index))))
ZyanU8 ZydisInstructionEncodingFlags
Defines the ZydisInstructionEncodingFlags data-type.
Definition: DecoderData.h:258
enum ZydisDecoderTreeNodeType_ ZydisDecoderTreeNodeType
Values that represent Zydis decoder tree node types.
ZyanU16 ZydisDecoderTreeNode
Defines the ZydisDecoderTreeNode data-type.
Definition: DecoderData.h:57
ZYDIS_NO_EXPORT const ZydisDecoderTreeNode * ZydisGetOpcodeTableRootNode(ZyanU8 opcode_table_id)
Returns the root node of the opcode table with the given opcode_table_id.
ZYDIS_NO_EXPORT void ZydisGetInstructionEncodingInfo(const ZydisDecoderTreeNode *node, const ZydisInstructionEncodingInfo **info)
Returns information about optional instruction parts (like modrm, displacement or immediates) for the...
ZydisDecoderTreeNodeType_
Values that represent Zydis decoder tree node types.
Definition: DecoderData.h:65
@ ZYDIS_NODETYPE_MODE_CET
Reference to a CET-mode selector.
Definition: DecoderData.h:171
@ ZYDIS_NODETYPE_MODE_CLDEMOTE
Reference to a CLDEMOTE-mode selector.
Definition: DecoderData.h:187
@ ZYDIS_NODETYPE_MODRM_MOD_COMPACT
Reference to a compacted ModRM.mod selector.
Definition: DecoderData.h:111
@ ZYDIS_NODETYPE_ADDRESS_SIZE
Reference to an address-size selector.
Definition: DecoderData.h:135
@ ZYDIS_NODETYPE_MODRM_MOD
Reference to a ModRM.mod selector.
Definition: DecoderData.h:107
@ ZYDIS_NODETYPE_DEFINITION
Reference to an instruction-definition.
Definition: DecoderData.h:70
@ ZYDIS_NODETYPE_VECTOR_LENGTH
Reference to a vector-length selector.
Definition: DecoderData.h:139
@ ZYDIS_NODETYPE_MAX_VALUE
Maximum value of this enum.
Definition: DecoderData.h:220
@ ZYDIS_NODETYPE_EVEX_U
Reference to a EVEX.U selector.
Definition: DecoderData.h:215
@ ZYDIS_NODETYPE_MODE_MPX
Reference to a MPX-mode selector.
Definition: DecoderData.h:167
@ ZYDIS_NODETYPE_MODRM_REG
Reference to a ModRM.reg selector.
Definition: DecoderData.h:115
@ ZYDIS_NODETYPE_SWITCH_TABLE_REX2
Reference to a REX2-map selector.
Definition: DecoderData.h:91
@ ZYDIS_NODETYPE_MODE_AMD
Reference to a AMD-mode selector.
Definition: DecoderData.h:159
@ ZYDIS_NODETYPE_EVEX_B
Reference to an EVEX.b selector.
Definition: DecoderData.h:151
@ ZYDIS_NODETYPE_MODE_COMPACT
Reference to an compacted instruction-mode selector.
Definition: DecoderData.h:103
@ ZYDIS_NODETYPE_REX_B
Reference to an REX/VEX/EVEX.B selector.
Definition: DecoderData.h:147
@ ZYDIS_NODETYPE_SWITCH_TABLE_EMVEX
Reference to an EVEX/MVEX-map selector.
Definition: DecoderData.h:87
@ ZYDIS_NODETYPE_OPCODE_TABLE
Reference to an opcode selector.
Definition: DecoderData.h:95
@ ZYDIS_NODETYPE_MODE_KNC
Reference to a KNC-mode selector.
Definition: DecoderData.h:163
@ ZYDIS_NODETYPE_SWITCH_TABLE
A decoder tree node that instructs the decoder to switch to a different opcode table.
Definition: DecoderData.h:75
@ ZYDIS_NODETYPE_MODE_UD0_COMPAT
Reference to a UD0_COMPAT-mode selector.
Definition: DecoderData.h:195
@ ZYDIS_NODETYPE_MODRM_RM
Reference to a ModRM.rm selector.
Definition: DecoderData.h:119
@ ZYDIS_NODETYPE_PREFIX_GROUP1
Reference to a PrefixGroup1 selector.
Definition: DecoderData.h:123
@ ZYDIS_NODETYPE_REX_W
Reference to an REX/VEX/EVEX.W selector.
Definition: DecoderData.h:143
@ ZYDIS_NODETYPE_MODE_TZCNT
Reference to a TZCNT-mode selector.
Definition: DecoderData.h:179
@ ZYDIS_NODETYPE_EVEX_SCC
Reference to an EVEX.scc selector.
Definition: DecoderData.h:207
@ ZYDIS_NODETYPE_OPERAND_SIZE
Reference to an operand-size selector.
Definition: DecoderData.h:131
@ ZYDIS_NODETYPE_SWITCH_TABLE_XOP
Reference to an XOP-map selector.
Definition: DecoderData.h:79
@ ZYDIS_NODETYPE_MANDATORY_PREFIX
Reference to a mandatory-prefix selector.
Definition: DecoderData.h:127
@ ZYDIS_NODETYPE_MODE_LZCNT
Reference to a LZCNT-mode selector.
Definition: DecoderData.h:175
@ ZYDIS_NODETYPE_MVEX_E
Reference to an MVEX.E selector.
Definition: DecoderData.h:155
@ ZYDIS_NODETYPE_REQUIRED_BITS
The minimum number of bits required to represent all values of this enum.
Definition: DecoderData.h:224
@ ZYDIS_NODETYPE_MODE_WBNOINVD
Reference to a WBNOINVD-mode selector.
Definition: DecoderData.h:183
@ ZYDIS_NODETYPE_INVALID
Definition: DecoderData.h:66
@ ZYDIS_NODETYPE_SWITCH_TABLE_VEX
Reference to an VEX-map selector.
Definition: DecoderData.h:83
@ ZYDIS_NODETYPE_MODE
Reference to an instruction-mode selector.
Definition: DecoderData.h:99
@ ZYDIS_NODETYPE_REX_2
Reference to a REX2-prefix selector.
Definition: DecoderData.h:211
@ ZYDIS_NODETYPE_EVEX_ND
Reference to an EVEX.nd selector.
Definition: DecoderData.h:199
@ ZYDIS_NODETYPE_EVEX_NF
Reference to an EVEX.nf selector.
Definition: DecoderData.h:203
@ ZYDIS_NODETYPE_MODE_IPREFETCH
Reference to a IPREFETCH-mode selector.
Definition: DecoderData.h:191
struct ZydisInstructionEncodingInfo_ ZydisInstructionEncodingInfo
Defines the ZydisInstructionEncodingInfo struct.
Import/export defines for MSVC builds.
#define ZYDIS_NO_EXPORT
Symbol is not exported and for internal use only.
Definition: Defines.h:74
Defines the ZydisInstructionEncodingInfo struct.
Definition: DecoderData.h:292
ZyanBool is_address
Signals, if the value is an address.
Definition: DecoderData.h:323
struct ZydisInstructionEncodingInfo_::@9 disp
Displacement info.
ZydisInstructionEncodingFlags flags
Contains flags with information about the physical instruction-encoding.
Definition: DecoderData.h:296
ZyanBool is_relative
Signals, if the value is a relative offset.
Definition: DecoderData.h:327
ZyanBool is_signed
Signals, if the value is signed.
Definition: DecoderData.h:319
ZyanU8 size[3]
The size of the displacement value.
Definition: DecoderData.h:305
struct ZydisInstructionEncodingInfo_::@10 imm[2]
Immediate info.