Zydis  master
EncoderData.h File Reference
#include <Zycore/Defines.h>
#include <Zydis/Mnemonic.h>
#include <Zydis/SharedTypes.h>
Include dependency graph for EncoderData.h:

Go to the source code of this file.

Data Structures

struct  ZydisEncoderLookupEntry_
 Used in encoder's primary lookup table which allows to access a set of instruction definitions for specified mnemonic in constant time. More...
 
struct  ZydisEncodableInstruction_
 This structure is encoder's internal representation of encodable instruction definition. More...
 
struct  ZydisEncoderRelInfo_
 Contains information used by instruction size prediction algorithm inside ZydisEncoderEncodeInstructionAbsolute. More...
 

Typedefs

typedef enum ZydisWidthFlag_ ZydisWidthFlag
 Used in encoder's table to represent standard ISA sizes in form of bit flags. More...
 
typedef enum ZydisMandatoryPrefix_ ZydisMandatoryPrefix
 Used in encoder's table to represent mandatory instruction prefix. More...
 
typedef enum ZydisVectorLength_ ZydisVectorLength
 Used in encoder's table to represent vector size supported by instruction definition. More...
 
typedef enum ZydisSizeHint_ ZydisSizeHint
 Used in encoder's table to represent hint type supported by instruction definition. More...
 
typedef struct ZydisEncoderLookupEntry_ ZydisEncoderLookupEntry
 Used in encoder's primary lookup table which allows to access a set of instruction definitions for specified mnemonic in constant time. More...
 
typedef struct ZydisEncodableInstruction_ ZydisEncodableInstruction
 This structure is encoder's internal representation of encodable instruction definition. More...
 
typedef struct ZydisEncoderRelInfo_ ZydisEncoderRelInfo
 Contains information used by instruction size prediction algorithm inside ZydisEncoderEncodeInstructionAbsolute. More...
 

Enumerations

enum  ZydisWidthFlag_ {
  ZYDIS_WIDTH_INVALID = 0x00 , ZYDIS_WIDTH_16 = 0x01 , ZYDIS_WIDTH_32 = 0x02 , ZYDIS_WIDTH_64 = 0x04 ,
  ZYDIS_WIDTH_MAX_VALUE = (ZYDIS_WIDTH_64 | (ZYDIS_WIDTH_64 - 1)) , ZYDIS_WIDTH_REQUIRED_BITS = ZYAN_BITS_TO_REPRESENT(ZYDIS_WIDTH_MAX_VALUE)
}
 Used in encoder's table to represent standard ISA sizes in form of bit flags. More...
 
enum  ZydisMandatoryPrefix_ {
  ZYDIS_MANDATORY_PREFIX_NONE , ZYDIS_MANDATORY_PREFIX_66 , ZYDIS_MANDATORY_PREFIX_F2 , ZYDIS_MANDATORY_PREFIX_F3 ,
  ZYDIS_MANDATORY_PREFIX_MAX_VALUE = ZYDIS_MANDATORY_PREFIX_F3 , ZYDIS_MANDATORY_PREFIX_REQUIRED_BITS = ZYAN_BITS_TO_REPRESENT(ZYDIS_MANDATORY_PREFIX_MAX_VALUE)
}
 Used in encoder's table to represent mandatory instruction prefix. More...
 
enum  ZydisVectorLength_ {
  ZYDIS_VECTOR_LENGTH_INVALID , ZYDIS_VECTOR_LENGTH_128 , ZYDIS_VECTOR_LENGTH_256 , ZYDIS_VECTOR_LENGTH_512 ,
  ZYDIS_VECTOR_LENGTH_MAX_VALUE = ZYDIS_VECTOR_LENGTH_512 , ZYDIS_VECTOR_LENGTH_REQUIRED_BITS = ZYAN_BITS_TO_REPRESENT(ZYDIS_VECTOR_LENGTH_MAX_VALUE)
}
 Used in encoder's table to represent vector size supported by instruction definition. More...
 
enum  ZydisSizeHint_ {
  ZYDIS_SIZE_HINT_NONE , ZYDIS_SIZE_HINT_ASZ , ZYDIS_SIZE_HINT_OSZ , ZYDIS_SIZE_HINT_MAX_VALUE = ZYDIS_SIZE_HINT_OSZ ,
  ZYDIS_SIZE_HINT_REQUIRED_BITS = ZYAN_BITS_TO_REPRESENT(ZYDIS_SIZE_HINT_MAX_VALUE)
}
 Used in encoder's table to represent hint type supported by instruction definition. More...
 

Functions

ZyanU8 ZydisGetEncodableInstructions (ZydisMnemonic mnemonic, const ZydisEncodableInstruction **instruction)
 Fetches array of ZydisEncodableInstruction structures and its size for given instruction mnemonic. More...
 
const ZydisEncoderRelInfoZydisGetRelInfo (ZydisMnemonic mnemonic)
 Fetches ZydisEncoderRelInfo record for given instruction mnemonic. More...
 

Typedef Documentation

◆ ZydisEncodableInstruction

This structure is encoder's internal representation of encodable instruction definition.

◆ ZydisEncoderLookupEntry

Used in encoder's primary lookup table which allows to access a set of instruction definitions for specified mnemonic in constant time.

◆ ZydisEncoderRelInfo

Contains information used by instruction size prediction algorithm inside ZydisEncoderEncodeInstructionAbsolute.

◆ ZydisMandatoryPrefix

Used in encoder's table to represent mandatory instruction prefix.

Using this enum instead of actual prefix value saves space.

◆ ZydisSizeHint

Used in encoder's table to represent hint type supported by instruction definition.

◆ ZydisVectorLength

Used in encoder's table to represent vector size supported by instruction definition.

◆ ZydisWidthFlag

Used in encoder's table to represent standard ISA sizes in form of bit flags.

Enumeration Type Documentation

◆ ZydisMandatoryPrefix_

Used in encoder's table to represent mandatory instruction prefix.

Using this enum instead of actual prefix value saves space.

Enumerator
ZYDIS_MANDATORY_PREFIX_NONE 
ZYDIS_MANDATORY_PREFIX_66 
ZYDIS_MANDATORY_PREFIX_F2 
ZYDIS_MANDATORY_PREFIX_F3 
ZYDIS_MANDATORY_PREFIX_MAX_VALUE 

Maximum value of this enum.

ZYDIS_MANDATORY_PREFIX_REQUIRED_BITS 

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

◆ ZydisSizeHint_

Used in encoder's table to represent hint type supported by instruction definition.

Enumerator
ZYDIS_SIZE_HINT_NONE 
ZYDIS_SIZE_HINT_ASZ 
ZYDIS_SIZE_HINT_OSZ 
ZYDIS_SIZE_HINT_MAX_VALUE 

Maximum value of this enum.

ZYDIS_SIZE_HINT_REQUIRED_BITS 

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

◆ ZydisVectorLength_

Used in encoder's table to represent vector size supported by instruction definition.

Enumerator
ZYDIS_VECTOR_LENGTH_INVALID 
ZYDIS_VECTOR_LENGTH_128 
ZYDIS_VECTOR_LENGTH_256 
ZYDIS_VECTOR_LENGTH_512 
ZYDIS_VECTOR_LENGTH_MAX_VALUE 

Maximum value of this enum.

ZYDIS_VECTOR_LENGTH_REQUIRED_BITS 

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

◆ ZydisWidthFlag_

Used in encoder's table to represent standard ISA sizes in form of bit flags.

Enumerator
ZYDIS_WIDTH_INVALID 
ZYDIS_WIDTH_16 
ZYDIS_WIDTH_32 
ZYDIS_WIDTH_64 
ZYDIS_WIDTH_MAX_VALUE 

Maximum value of this enum.

ZYDIS_WIDTH_REQUIRED_BITS 

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

Function Documentation

◆ ZydisGetEncodableInstructions()

ZyanU8 ZydisGetEncodableInstructions ( ZydisMnemonic  mnemonic,
const ZydisEncodableInstruction **  instruction 
)

Fetches array of ZydisEncodableInstruction structures and its size for given instruction mnemonic.

Parameters
mnemonicInstruction mnemonic.
instructionThis variable will receive a pointer to the array of ZydisEncodableInstruction structures.
Returns
Entry count (0 if function failed).

◆ ZydisGetRelInfo()

const ZydisEncoderRelInfo* ZydisGetRelInfo ( ZydisMnemonic  mnemonic)

Fetches ZydisEncoderRelInfo record for given instruction mnemonic.

Parameters
mnemonicInstruction mnemonic.
Returns
Pointer to ZydisEncoderRelInfo structure or ZYAN_NULL if instruction doesn't have relative operands.