Zydis v4.1.1

Loading...
Searching...
No Matches
ZydisEncoderRequest_ Struct Reference

Main structure consumed by the encoder. More...

`#include <Encoder.h>`

## Data Structures
struct | ZydisEncoderRequestEvexFeatures_
| Extended info for EVEX instructions. More...
struct | ZydisEncoderRequestMvexFeatures_
| Extended info for MVEX instructions. More...

## Data Fields
ZydisMachineMode | machine_mode
| The machine mode used to encode this instruction.
ZydisEncodableEncoding | allowed_encodings
| This optional field can be used to restrict allowed physical encodings for desired instruction.
ZydisMnemonic | mnemonic
| The instruction-mnemonic.
ZydisInstructionAttributes | prefixes
| A combination of requested encodable prefixes (ZYDIS_ATTRIB_HAS_* flags) for desired instruction.
ZydisBranchType | branch_type
| Branch type (required for branching instructions only).
ZydisBranchWidth | branch_width
| Specifies physical size for relative immediate operands.
ZydisAddressSizeHint | address_size_hint
| Optional address size hint used to resolve ambiguities for some instructions.
ZydisOperandSizeHint | operand_size_hint
| Optional operand size hint used to resolve ambiguities for some instructions.
ZyanU8 | operand_count
| The number of instruction-operands.
ZydisEncoderOperand | operands [ZYDIS_ENCODER_MAX_OPERANDS]
| Detailed info for all explicit and implicit instruction operands.
struct ZydisEncoderRequest_::ZydisEncoderRequestEvexFeatures_ | evex
struct ZydisEncoderRequest_::ZydisEncoderRequestMvexFeatures_ | mvex

## Detailed Description

Main structure consumed by the encoder.

It represents full semantics of an instruction.

## Field Documentation

## ◆ address_size_hint

ZydisAddressSizeHint address_size_hint

Optional address size hint used to resolve ambiguities for some instructions.

Generally encoder deduces address size from ZydisEncoderOperand structures that represent explicit and implicit operands. This hint resolves conflicts when instruction's hidden operands scale with address size attribute.

This hint is also used for instructions with absolute memory addresses (memory operands with displacement and no registers). Since displacement field is a 64-bit signed integer it's not possible to determine actual size of the address value in all situations. This hint specifies size of the address value provided inside encoder request rather than desired address size attribute of encoded instruction. Use ZYDIS_ADDRESS_SIZE_HINT_NONE to assume address size default for specified machine mode.

## ◆ allowed_encodings

ZydisEncodableEncoding allowed_encodings

This optional field can be used to restrict allowed physical encodings for desired instruction.

Some mnemonics can be supported by more than one encoding, so this field can resolve ambiguities e.g. you can disable AVX-512 extensions by prohibiting usage of EVEX prefix and allow only VEX variants.

## ◆ branch_type

ZydisBranchType branch_type

Branch type (required for branching instructions only).

Use ZYDIS_BRANCH_TYPE_NONE to let encoder pick size-optimal branch type automatically (short and near are prioritized over far).

## ◆ branch_width

ZydisBranchWidth branch_width

Specifies physical size for relative immediate operands.

Use ZYDIS_BRANCH_WIDTH_NONE to let encoder pick size-optimal branch width automatically. For segment:offset far branches this field applies to physical size of the offset part. For branching instructions without relative operands this field affects effective operand size attribute.

## ◆ evex

struct ZydisEncoderRequest_::ZydisEncoderRequestEvexFeatures_ evex

## ◆ machine_mode

ZydisMachineMode machine_mode

The machine mode used to encode this instruction.

## ◆ mnemonic

ZydisMnemonic mnemonic

The instruction-mnemonic.

## ◆ mvex

struct ZydisEncoderRequest_::ZydisEncoderRequestMvexFeatures_ mvex

## ◆ operand_count

ZyanU8 operand_count

The number of instruction-operands.

## ◆ operand_size_hint

ZydisOperandSizeHint operand_size_hint

Optional operand size hint used to resolve ambiguities for some instructions.

Generally encoder deduces operand size from ZydisEncoderOperand structures that represent explicit and implicit operands. This hint resolves conflicts when instruction's hidden operands scale with operand size attribute.

## ◆ operands

ZydisEncoderOperand operands[ZYDIS_ENCODER_MAX_OPERANDS]

Detailed info for all explicit and implicit instruction operands.

## ◆ prefixes

ZydisInstructionAttributes prefixes

A combination of requested encodable prefixes (ZYDIS_ATTRIB_HAS_* flags) for desired instruction.

See ZYDIS_ENCODABLE_PREFIXES for list of available prefixes.

The documentation for this struct was generated from the following file:

- include/Zydis/Encoder.h