Zydis  v3.2.0
Utils.h File Reference

Other utility functions. More...

#include <Zycore/Defines.h>
#include <Zydis/DecoderTypes.h>
#include <Zydis/Status.h>
Include dependency graph for Utils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

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 ZydisCalcAbsoluteAddress (const ZydisDecodedInstruction *instruction, const ZydisDecodedOperand *operand, ZyanU64 runtime_address, ZyanU64 *result_address)
 Calculates the absolute address value for the given instruction operand. More...
 
ZYDIS_EXPORT ZyanStatus ZydisCalcAbsoluteAddressEx (const ZydisDecodedInstruction *instruction, const ZydisDecodedOperand *operand, ZyanU64 runtime_address, const ZydisRegisterContext *register_context, ZyanU64 *result_address)
 Calculates the absolute address value for the given instruction operand. More...
 
ZYDIS_EXPORT ZyanStatus ZydisGetAccessedFlagsByAction (const ZydisDecodedInstruction *instruction, ZydisCPUFlagAction action, ZydisCPUFlags *flags)
 Returns a mask of accessed CPU-flags matching the given action. More...
 
ZYDIS_DEPRECATED_EXPORT ZyanStatus ZydisGetAccessedFlagsRead (const ZydisDecodedInstruction *instruction, ZydisCPUFlags *flags)
 Returns a mask of accessed CPU-flags that are read (tested) by the current instruction. More...
 
ZYDIS_DEPRECATED_EXPORT ZyanStatus ZydisGetAccessedFlagsWritten (const ZydisDecodedInstruction *instruction, ZydisCPUFlags *flags)
 Returns a mask of accessed CPU-flags that are written (modified, undefined) by the current instruction. More...
 
ZYDIS_EXPORT ZyanStatus ZydisGetInstructionSegments (const ZydisDecodedInstruction *instruction, ZydisInstructionSegments *segments)
 Returns offsets and sizes of all logical instruction segments (e.g. More...
 

Detailed Description

Other utility functions.

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.