Zydis  v4.1.0
Segment

Functions and types providing encoding information about individual instruction bytes. More...

Data Structures

struct  ZydisInstructionSegments_
 Defines the ZydisInstructionSegments struct. More...
 

Macros

#define ZYDIS_MAX_INSTRUCTION_SEGMENT_COUNT   9
 

Typedefs

typedef enum ZydisInstructionSegment_ ZydisInstructionSegment
 Defines the ZydisInstructionSegment struct. More...
 
typedef struct ZydisInstructionSegments_ ZydisInstructionSegments
 Defines the ZydisInstructionSegments struct. More...
 

Enumerations

enum  ZydisInstructionSegment_ {
  ZYDIS_INSTR_SEGMENT_NONE , ZYDIS_INSTR_SEGMENT_PREFIXES , ZYDIS_INSTR_SEGMENT_REX , ZYDIS_INSTR_SEGMENT_XOP ,
  ZYDIS_INSTR_SEGMENT_VEX , ZYDIS_INSTR_SEGMENT_EVEX , ZYDIS_INSTR_SEGMENT_MVEX , ZYDIS_INSTR_SEGMENT_OPCODE ,
  ZYDIS_INSTR_SEGMENT_MODRM , ZYDIS_INSTR_SEGMENT_SIB , ZYDIS_INSTR_SEGMENT_DISPLACEMENT , ZYDIS_INSTR_SEGMENT_IMMEDIATE ,
  ZYDIS_INSTR_SEGMENT_MAX_VALUE = ZYDIS_INSTR_SEGMENT_IMMEDIATE , ZYDIS_INSTR_SEGMENT_REQUIRED_BITS = ZYAN_BITS_TO_REPRESENT(ZYDIS_INSTR_SEGMENT_MAX_VALUE)
}
 Defines the ZydisInstructionSegment struct. More...
 

Functions

ZYDIS_EXPORT ZyanStatus ZydisGetInstructionSegments (const ZydisDecodedInstruction *instruction, ZydisInstructionSegments *segments)
 Returns offsets and sizes of all logical instruction segments (e.g. More...
 

Detailed Description

Functions and types providing encoding information about individual instruction bytes.

Macro Definition Documentation

◆ ZYDIS_MAX_INSTRUCTION_SEGMENT_COUNT

#define ZYDIS_MAX_INSTRUCTION_SEGMENT_COUNT   9

Typedef Documentation

◆ ZydisInstructionSegment

Defines the ZydisInstructionSegment struct.

◆ ZydisInstructionSegments

Defines the ZydisInstructionSegments struct.

Enumeration Type Documentation

◆ ZydisInstructionSegment_

Defines the ZydisInstructionSegment struct.

Enumerator
ZYDIS_INSTR_SEGMENT_NONE 
ZYDIS_INSTR_SEGMENT_PREFIXES 

The legacy prefixes (including ignored REX prefixes).

ZYDIS_INSTR_SEGMENT_REX 

The effective REX prefix byte.

ZYDIS_INSTR_SEGMENT_XOP 

The XOP prefix bytes.

ZYDIS_INSTR_SEGMENT_VEX 

The VEX prefix bytes.

ZYDIS_INSTR_SEGMENT_EVEX 

The EVEX prefix bytes.

ZYDIS_INSTR_SEGMENT_MVEX 

The MVEX prefix bytes.

ZYDIS_INSTR_SEGMENT_OPCODE 

The opcode bytes.

ZYDIS_INSTR_SEGMENT_MODRM 

The ModRM byte.

ZYDIS_INSTR_SEGMENT_SIB 

The SIB byte.

ZYDIS_INSTR_SEGMENT_DISPLACEMENT 

The displacement bytes.

ZYDIS_INSTR_SEGMENT_IMMEDIATE 

The immediate bytes.

ZYDIS_INSTR_SEGMENT_MAX_VALUE 

Maximum value of this enum.

ZYDIS_INSTR_SEGMENT_REQUIRED_BITS 

The minimum number of bits required to represent all values of this enum.

Function Documentation

◆ ZydisGetInstructionSegments()

ZYDIS_EXPORT ZyanStatus ZydisGetInstructionSegments ( const ZydisDecodedInstruction instruction,
ZydisInstructionSegments segments 
)

Returns offsets and sizes of all logical instruction segments (e.g.

OPCODE, MODRM, ...).

Parameters
instructionA pointer to the ZydisDecodedInstruction struct.
segmentsReceives the instruction segments information.
Returns
A zyan status code.