Zydis  v3.0.0
DecoderData.h File Reference
#include <Zycore/Defines.h>
#include <Zydis/DecoderTypes.h>
Include dependency graph for DecoderData.h:

Go to the source code of this file.

Data Structures

struct  ZydisDecoderTreeNode_
 Defines the ZydisDecoderTreeNode struct. More...
 
struct  ZydisInstructionEncodingInfo_
 Defines the ZydisInstructionEncodingInfo struct. More...
 

Macros

#define ZYDIS_INSTR_ENC_FLAG_HAS_MODRM   0x01
 The instruction has an optional modrm byte. More...
 
#define ZYDIS_INSTR_ENC_FLAG_HAS_DISP   0x02
 The instruction has an optional displacement value. More...
 
#define ZYDIS_INSTR_ENC_FLAG_HAS_IMM0   0x04
 The instruction has an optional immediate value. More...
 
#define ZYDIS_INSTR_ENC_FLAG_HAS_IMM1   0x08
 The instruction has a second optional immediate value. More...
 
#define ZYDIS_INSTR_ENC_FLAG_FORCE_REG_FORM   0x10
 The instruction ignores the value of modrm.mod and always assumes modrm.mod == 3 ("reg, reg" - form). More...
 

Typedefs

typedef ZyanU8 ZydisDecoderTreeNodeType
 Defines the ZydisDecoderTreeNodeType data-type. More...
 
typedef ZyanU16 ZydisDecoderTreeNodeValue
 Defines the ZydisDecoderTreeNodeValue data-type. More...
 
typedef struct ZydisDecoderTreeNode_ ZydisDecoderTreeNode
 Defines the ZydisDecoderTreeNode struct. More...
 
typedef ZyanU8 ZydisInstructionEncodingFlags
 Defines the ZydisInstructionEncodingFlags data-type. More...
 
typedef struct ZydisInstructionEncodingInfo_ ZydisInstructionEncodingInfo
 Defines the ZydisInstructionEncodingInfo struct. More...
 

Enumerations

enum  ZydisDecoderTreeNodeTypes {
  ZYDIS_NODETYPE_INVALID = 0x00 , ZYDIS_NODETYPE_DEFINITION_MASK = 0x80 , ZYDIS_NODETYPE_FILTER_XOP = 0x01 , ZYDIS_NODETYPE_FILTER_VEX = 0x02 ,
  ZYDIS_NODETYPE_FILTER_EMVEX = 0x03 , ZYDIS_NODETYPE_FILTER_OPCODE = 0x04 , ZYDIS_NODETYPE_FILTER_MODE = 0x05 , ZYDIS_NODETYPE_FILTER_MODE_COMPACT = 0x06 ,
  ZYDIS_NODETYPE_FILTER_MODRM_MOD = 0x07 , ZYDIS_NODETYPE_FILTER_MODRM_MOD_COMPACT = 0x08 , ZYDIS_NODETYPE_FILTER_MODRM_REG = 0x09 , ZYDIS_NODETYPE_FILTER_MODRM_RM = 0x0A ,
  ZYDIS_NODETYPE_FILTER_PREFIX_GROUP1 = 0x0B , ZYDIS_NODETYPE_FILTER_MANDATORY_PREFIX = 0x0C , ZYDIS_NODETYPE_FILTER_OPERAND_SIZE = 0x0D , ZYDIS_NODETYPE_FILTER_ADDRESS_SIZE = 0x0E ,
  ZYDIS_NODETYPE_FILTER_VECTOR_LENGTH = 0x0F , ZYDIS_NODETYPE_FILTER_REX_W = 0x10 , ZYDIS_NODETYPE_FILTER_REX_B = 0x11 , ZYDIS_NODETYPE_FILTER_EVEX_B = 0x12 ,
  ZYDIS_NODETYPE_FILTER_MVEX_E = 0x13 , ZYDIS_NODETYPE_FILTER_MODE_AMD = 0x14 , ZYDIS_NODETYPE_FILTER_MODE_KNC = 0x15 , ZYDIS_NODETYPE_FILTER_MODE_MPX = 0x16 ,
  ZYDIS_NODETYPE_FILTER_MODE_CET = 0x17 , ZYDIS_NODETYPE_FILTER_MODE_LZCNT = 0x18 , ZYDIS_NODETYPE_FILTER_MODE_TZCNT = 0x19 , ZYDIS_NODETYPE_FILTER_MODE_WBNOINVD = 0x1A ,
  ZYDIS_NODETYPE_FILTER_MODE_CLDEMOTE = 0x1B
}
 Values that represent zydis decoder tree node types. More...
 

Functions

ZYDIS_NO_EXPORT const ZydisDecoderTreeNodeZydisDecoderTreeGetRootNode (void)
 Returns the root node of the instruction tree. More...
 
ZYDIS_NO_EXPORT const ZydisDecoderTreeNodeZydisDecoderTreeGetChildNode (const ZydisDecoderTreeNode *parent, ZyanU16 index)
 Returns the child node of parent specified by index. More...
 
ZYDIS_NO_EXPORT void ZydisGetInstructionEncodingInfo (const ZydisDecoderTreeNode *node, const ZydisInstructionEncodingInfo **info)
 Returns information about optional instruction parts (like modrm, displacement or immediates) for the instruction that is linked to the given node. More...
 

Macro Definition Documentation

◆ ZYDIS_INSTR_ENC_FLAG_FORCE_REG_FORM

#define ZYDIS_INSTR_ENC_FLAG_FORCE_REG_FORM   0x10

The instruction ignores the value of modrm.mod and always assumes modrm.mod == 3 ("reg, reg" - form).

Instructions with this flag can't have a SIB byte or a displacement value.

◆ ZYDIS_INSTR_ENC_FLAG_HAS_DISP

#define ZYDIS_INSTR_ENC_FLAG_HAS_DISP   0x02

The instruction has an optional displacement value.

◆ ZYDIS_INSTR_ENC_FLAG_HAS_IMM0

#define ZYDIS_INSTR_ENC_FLAG_HAS_IMM0   0x04

The instruction has an optional immediate value.

◆ ZYDIS_INSTR_ENC_FLAG_HAS_IMM1

#define ZYDIS_INSTR_ENC_FLAG_HAS_IMM1   0x08

The instruction has a second optional immediate value.

◆ ZYDIS_INSTR_ENC_FLAG_HAS_MODRM

#define ZYDIS_INSTR_ENC_FLAG_HAS_MODRM   0x01

The instruction has an optional modrm byte.

Typedef Documentation

◆ ZydisDecoderTreeNode

Defines the ZydisDecoderTreeNode struct.

◆ ZydisDecoderTreeNodeType

typedef ZyanU8 ZydisDecoderTreeNodeType

Defines the ZydisDecoderTreeNodeType data-type.

◆ ZydisDecoderTreeNodeValue

typedef ZyanU16 ZydisDecoderTreeNodeValue

Defines the ZydisDecoderTreeNodeValue data-type.

◆ ZydisInstructionEncodingFlags

Defines the ZydisInstructionEncodingFlags data-type.

◆ ZydisInstructionEncodingInfo

Defines the ZydisInstructionEncodingInfo struct.

Enumeration Type Documentation

◆ ZydisDecoderTreeNodeTypes

Values that represent zydis decoder tree node types.

Enumerator
ZYDIS_NODETYPE_INVALID 
ZYDIS_NODETYPE_DEFINITION_MASK 

Reference to an instruction-definition.

ZYDIS_NODETYPE_FILTER_XOP 

Reference to an XOP-map filter.

ZYDIS_NODETYPE_FILTER_VEX 

Reference to an VEX-map filter.

ZYDIS_NODETYPE_FILTER_EMVEX 

Reference to an EVEX/MVEX-map filter.

ZYDIS_NODETYPE_FILTER_OPCODE 

Reference to an opcode filter.

ZYDIS_NODETYPE_FILTER_MODE 

Reference to an instruction-mode filter.

ZYDIS_NODETYPE_FILTER_MODE_COMPACT 

Reference to an compacted instruction-mode filter.

ZYDIS_NODETYPE_FILTER_MODRM_MOD 

Reference to a ModRM.mod filter.

ZYDIS_NODETYPE_FILTER_MODRM_MOD_COMPACT 

Reference to a compacted ModRM.mod filter.

ZYDIS_NODETYPE_FILTER_MODRM_REG 

Reference to a ModRM.reg filter.

ZYDIS_NODETYPE_FILTER_MODRM_RM 

Reference to a ModRM.rm filter.

ZYDIS_NODETYPE_FILTER_PREFIX_GROUP1 

Reference to a PrefixGroup1 filter.

ZYDIS_NODETYPE_FILTER_MANDATORY_PREFIX 

Reference to a mandatory-prefix filter.

ZYDIS_NODETYPE_FILTER_OPERAND_SIZE 

Reference to an operand-size filter.

ZYDIS_NODETYPE_FILTER_ADDRESS_SIZE 

Reference to an address-size filter.

ZYDIS_NODETYPE_FILTER_VECTOR_LENGTH 

Reference to a vector-length filter.

ZYDIS_NODETYPE_FILTER_REX_W 

Reference to an REX/VEX/EVEX.W filter.

ZYDIS_NODETYPE_FILTER_REX_B 

Reference to an REX/VEX/EVEX.B filter.

ZYDIS_NODETYPE_FILTER_EVEX_B 

Reference to an EVEX.b filter.

ZYDIS_NODETYPE_FILTER_MVEX_E 

Reference to an MVEX.E filter.

ZYDIS_NODETYPE_FILTER_MODE_AMD 

Reference to a AMD-mode filter.

ZYDIS_NODETYPE_FILTER_MODE_KNC 

Reference to a KNC-mode filter.

ZYDIS_NODETYPE_FILTER_MODE_MPX 

Reference to a MPX-mode filter.

ZYDIS_NODETYPE_FILTER_MODE_CET 

Reference to a CET-mode filter.

ZYDIS_NODETYPE_FILTER_MODE_LZCNT 

Reference to a LZCNT-mode filter.

ZYDIS_NODETYPE_FILTER_MODE_TZCNT 

Reference to a TZCNT-mode filter.

ZYDIS_NODETYPE_FILTER_MODE_WBNOINVD 

Reference to a WBNOINVD-mode filter.

ZYDIS_NODETYPE_FILTER_MODE_CLDEMOTE 

Reference to a CLDEMOTE-mode filter.

Function Documentation

◆ ZydisDecoderTreeGetChildNode()

ZYDIS_NO_EXPORT const ZydisDecoderTreeNode* ZydisDecoderTreeGetChildNode ( const ZydisDecoderTreeNode parent,
ZyanU16  index 
)

Returns the child node of parent specified by index.

Parameters
parentThe parent node.
indexThe index of the child node to retrieve.
Returns
The specified child node.

◆ ZydisDecoderTreeGetRootNode()

ZYDIS_NO_EXPORT const ZydisDecoderTreeNode* ZydisDecoderTreeGetRootNode ( void  )

Returns the root node of the instruction tree.

Returns
The root node of the instruction tree.

◆ ZydisGetInstructionEncodingInfo()

ZYDIS_NO_EXPORT void ZydisGetInstructionEncodingInfo ( const ZydisDecoderTreeNode node,
const ZydisInstructionEncodingInfo **  info 
)

Returns information about optional instruction parts (like modrm, displacement or immediates) for the instruction that is linked to the given node.

Parameters
nodeThe instruction definition node.
infoA pointer to the ZydisInstructionParts struct.