Zydis: include/Zydis/Encoder.h Source File

Zydis v4.1.1

Loading...
Searching...
No Matches
Encoder.h
Go to the documentation of this file.
1/***************************************************************************************************
2
3 Zyan Disassembler Library (Zydis)
4
5 Original Author : Mappa
6
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal
9 * in the Software without restriction, including without limitation the rights
10 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 * copies of the Software, and to permit persons to whom the Software is
12 * furnished to do so, subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included in all
15 * copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 * SOFTWARE.
24
25***************************************************************************************************/
26
31
32#ifndef ZYDIS_ENCODER_H
33#define ZYDIS_ENCODER_H
34
35#include <Zycore/Types.h>
36#include <Zydis/MetaInfo.h>
37#include <Zydis/Register.h>
38#include <Zydis/DecoderTypes.h>
39#include <Zydis/Mnemonic.h>
40#include <Zydis/Status.h>
41
42#ifdef __cplusplus
43extern "C" {
44#endif
45
46/* ============================================================================================== */
47/* Macros */
48/* ============================================================================================== */
49
50/* ---------------------------------------------------------------------------------------------- */
51/* Constants */
52/* ---------------------------------------------------------------------------------------------- */
53
57#define ZYDIS_ENCODER_MAX_OPERANDS 5
58
59// If asserts are failing here remember to update encoder table generator before fixing asserts
60ZYAN_STATIC_ASSERT(ZYAN_BITS_TO_REPRESENT(ZYDIS_ENCODER_MAX_OPERANDS) == 3);
61
65#define ZYDIS_ENCODABLE_PREFIXES (ZYDIS_ATTRIB_HAS_LOCK | \
66 ZYDIS_ATTRIB_HAS_REP | \
67 ZYDIS_ATTRIB_HAS_REPE | \
68 ZYDIS_ATTRIB_HAS_REPNE | \
69 ZYDIS_ATTRIB_HAS_BND | \
70 ZYDIS_ATTRIB_HAS_XACQUIRE | \
71 ZYDIS_ATTRIB_HAS_XRELEASE | \
72 ZYDIS_ATTRIB_HAS_BRANCH_NOT_TAKEN | \
73 ZYDIS_ATTRIB_HAS_BRANCH_TAKEN | \
74 ZYDIS_ATTRIB_HAS_NOTRACK | \
75 ZYDIS_ATTRIB_HAS_SEGMENT_CS | \
76 ZYDIS_ATTRIB_HAS_SEGMENT_SS | \
77 ZYDIS_ATTRIB_HAS_SEGMENT_DS | \
78 ZYDIS_ATTRIB_HAS_SEGMENT_ES | \
79 ZYDIS_ATTRIB_HAS_SEGMENT_FS | \
80 ZYDIS_ATTRIB_HAS_SEGMENT_GS)
81
82/* ---------------------------------------------------------------------------------------------- */
83
84/* ============================================================================================== */
85/* Enums and types */
86/* ============================================================================================== */
87
92 typedef enum ZydisEncodableEncoding_
93{
94 ZYDIS_ENCODABLE_ENCODING_DEFAULT = 0x00000000,
95 ZYDIS_ENCODABLE_ENCODING_LEGACY = 0x00000001,
96 ZYDIS_ENCODABLE_ENCODING_3DNOW = 0x00000002,
97 ZYDIS_ENCODABLE_ENCODING_XOP = 0x00000004,
98 ZYDIS_ENCODABLE_ENCODING_VEX = 0x00000008,
99 ZYDIS_ENCODABLE_ENCODING_EVEX = 0x00000010,
100 ZYDIS_ENCODABLE_ENCODING_MVEX = 0x00000020,
101
105 ZYDIS_ENCODABLE_ENCODING_MAX_VALUE = (ZYDIS_ENCODABLE_ENCODING_MVEX |
106 (ZYDIS_ENCODABLE_ENCODING_MVEX - 1)),
110 ZYDIS_ENCODABLE_ENCODING_REQUIRED_BITS =
111 ZYAN_BITS_TO_REPRESENT(ZYDIS_ENCODABLE_ENCODING_MAX_VALUE)
112} ZydisEncodableEncoding;
113
118 typedef enum ZydisBranchWidth_
119{
120 ZYDIS_BRANCH_WIDTH_NONE,
121 ZYDIS_BRANCH_WIDTH_8,
122 ZYDIS_BRANCH_WIDTH_16,
123 ZYDIS_BRANCH_WIDTH_32,
124 ZYDIS_BRANCH_WIDTH_64,
125
129 ZYDIS_BRANCH_WIDTH_MAX_VALUE = ZYDIS_BRANCH_WIDTH_64,
133 ZYDIS_BRANCH_WIDTH_REQUIRED_BITS = ZYAN_BITS_TO_REPRESENT(ZYDIS_BRANCH_WIDTH_MAX_VALUE)
134} ZydisBranchWidth;
135
140 typedef enum ZydisAddressSizeHint_
141{
142 ZYDIS_ADDRESS_SIZE_HINT_NONE,
143 ZYDIS_ADDRESS_SIZE_HINT_16,
144 ZYDIS_ADDRESS_SIZE_HINT_32,
145 ZYDIS_ADDRESS_SIZE_HINT_64,
146
150 ZYDIS_ADDRESS_SIZE_HINT_MAX_VALUE = ZYDIS_ADDRESS_SIZE_HINT_64,
154 ZYDIS_ADDRESS_SIZE_HINT_REQUIRED_BITS =
155 ZYAN_BITS_TO_REPRESENT(ZYDIS_ADDRESS_SIZE_HINT_MAX_VALUE)
156} ZydisAddressSizeHint;
157
162 typedef enum ZydisOperandSizeHint_
163{
164 ZYDIS_OPERAND_SIZE_HINT_NONE,
165 ZYDIS_OPERAND_SIZE_HINT_8,
166 ZYDIS_OPERAND_SIZE_HINT_16,
167 ZYDIS_OPERAND_SIZE_HINT_32,
168 ZYDIS_OPERAND_SIZE_HINT_64,
169
173 ZYDIS_OPERAND_SIZE_HINT_MAX_VALUE = ZYDIS_OPERAND_SIZE_HINT_64,
177 ZYDIS_OPERAND_SIZE_HINT_REQUIRED_BITS =
178 ZYAN_BITS_TO_REPRESENT(ZYDIS_OPERAND_SIZE_HINT_MAX_VALUE)
179} ZydisOperandSizeHint;
180
184 typedef struct ZydisEncoderOperand_
185{
189 ZydisOperandType type;
193 struct ZydisEncoderOperandReg_
194 {
198 ZydisRegister value;
204 ZyanBool is4;
205 } reg;
206
209 struct ZydisEncoderOperandMem_
210 {
214 ZydisRegister base;
218 ZydisRegister index;
222 ZyanU8 scale;
230 ZyanI64 displacement;
234 ZyanU16 size;
235 } mem;
236
239 struct ZydisEncoderOperandPtr_
240 {
244 ZyanU16 segment;
248 ZyanU32 offset;
249 } ptr;
250
253 union ZydisEncoderOperandImm_
254 {
258 ZyanU64 u;
262 ZyanI64 s;
263 } imm;
264} ZydisEncoderOperand;
265
269 typedef struct ZydisEncoderRequest_
270{
274 ZydisMachineMode machine_mode;
281 ZydisEncodableEncoding allowed_encodings;
285 ZydisMnemonic mnemonic;
290 ZydisInstructionAttributes prefixes;
296 ZydisBranchType branch_type;
303 ZydisBranchWidth branch_width;
317 ZydisAddressSizeHint address_size_hint;
324 ZydisOperandSizeHint operand_size_hint;
328 ZyanU8 operand_count;
332 ZydisEncoderOperand operands[ZYDIS_ENCODER_MAX_OPERANDS];
336 struct ZydisEncoderRequestEvexFeatures_
337 {
342 ZydisBroadcastMode broadcast;
346 ZydisRoundingMode rounding;
351 ZyanBool sae;
356 ZyanBool zeroing_mask;
357 } evex;
358
361 struct ZydisEncoderRequestMvexFeatures_
362 {
366 ZydisBroadcastMode broadcast;
370 ZydisConversionMode conversion;
374 ZydisRoundingMode rounding;
378 ZydisSwizzleMode swizzle;
383 ZyanBool sae;
387 ZyanBool eviction_hint;
388 } mvex;
389} ZydisEncoderRequest;
390
391/* ============================================================================================== */
392/* Exported functions */
393/* ============================================================================================== */
394
400
411 ZYDIS_EXPORT ZyanStatus ZydisEncoderEncodeInstruction(const ZydisEncoderRequest *request,
412 void *buffer, ZyanUSize *length);
413
429 ZYDIS_EXPORT ZyanStatus ZydisEncoderEncodeInstructionAbsolute(ZydisEncoderRequest *request,
430 void *buffer, ZyanUSize *length, ZyanU64 runtime_address);
431
449 ZYDIS_EXPORT ZyanStatus ZydisEncoderDecodedInstructionToEncoderRequest(
450 const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operands,
451 ZyanU8 operand_count, ZydisEncoderRequest* request);
452
461 ZYDIS_EXPORT ZyanStatus ZydisEncoderNopFill(void *buffer, ZyanUSize length);
462
464
465/* ============================================================================================== */
466
467#ifdef __cplusplus
468}
469#endif
470
471#endif /* ZYDIS_ENCODER_H */
DecoderTypes.h
Defines the basic ZydisDecodedInstruction and ZydisDecodedOperand structs.
ZydisConversionMode
enum ZydisConversionMode_ ZydisConversionMode
Defines the ZydisConversionMode enum.
ZydisRoundingMode
enum ZydisRoundingMode_ ZydisRoundingMode
Defines the ZydisRoundingMode enum.
ZydisSwizzleMode
enum ZydisSwizzleMode_ ZydisSwizzleMode
Defines the ZydisSwizzleMode enum.
ZydisDecodedOperand
struct ZydisDecodedOperand_ ZydisDecodedOperand
Defines the ZydisDecodedOperand struct.
ZydisBroadcastMode
enum ZydisBroadcastMode_ ZydisBroadcastMode
Defines the ZydisBroadcastMode enum.
ZydisDecodedInstruction
struct ZydisDecodedInstruction_ ZydisDecodedInstruction
Information about a decoded instruction.
ZydisBranchType
enum ZydisBranchType_ ZydisBranchType
Defines the ZydisBranchType enum.
ZYDIS_EXPORT
#define ZYDIS_EXPORT
Symbol is exported in shared library builds.
Definition Defines.h:67
ZYDIS_ENCODER_MAX_OPERANDS
#define ZYDIS_ENCODER_MAX_OPERANDS
Maximum number of encodable (explicit and implicit) operands.
Definition Encoder.h:57
ZydisAddressSizeHint
enum ZydisAddressSizeHint_ ZydisAddressSizeHint
Defines possible values for address size hints.
ZydisBranchWidth
enum ZydisBranchWidth_ ZydisBranchWidth
Defines encodable physical/effective sizes of relative immediate operands.
ZydisAddressSizeHint_
ZydisAddressSizeHint_
Defines possible values for address size hints.
Definition Encoder.h:141
ZYDIS_ADDRESS_SIZE_HINT_REQUIRED_BITS
@ ZYDIS_ADDRESS_SIZE_HINT_REQUIRED_BITS
The minimum number of bits required to represent all values of this enum.
Definition Encoder.h:154
ZYDIS_ADDRESS_SIZE_HINT_NONE
@ ZYDIS_ADDRESS_SIZE_HINT_NONE
Definition Encoder.h:142
ZYDIS_ADDRESS_SIZE_HINT_16
@ ZYDIS_ADDRESS_SIZE_HINT_16
Definition Encoder.h:143
ZYDIS_ADDRESS_SIZE_HINT_MAX_VALUE
@ ZYDIS_ADDRESS_SIZE_HINT_MAX_VALUE
Maximum value of this enum.
Definition Encoder.h:150
ZYDIS_ADDRESS_SIZE_HINT_32
@ ZYDIS_ADDRESS_SIZE_HINT_32
Definition Encoder.h:144
ZYDIS_ADDRESS_SIZE_HINT_64
@ ZYDIS_ADDRESS_SIZE_HINT_64
Definition Encoder.h:145
ZydisEncoderOperand
struct ZydisEncoderOperand_ ZydisEncoderOperand
Describes explicit or implicit instruction operand.
ZYAN_STATIC_ASSERT
ZYAN_STATIC_ASSERT(ZYAN_BITS_TO_REPRESENT(ZYDIS_ENCODER_MAX_OPERANDS)==3)
ZydisOperandSizeHint_
ZydisOperandSizeHint_
Defines possible values for operand size hints.
Definition Encoder.h:163
ZYDIS_OPERAND_SIZE_HINT_16
@ ZYDIS_OPERAND_SIZE_HINT_16
Definition Encoder.h:166
ZYDIS_OPERAND_SIZE_HINT_32
@ ZYDIS_OPERAND_SIZE_HINT_32
Definition Encoder.h:167
ZYDIS_OPERAND_SIZE_HINT_REQUIRED_BITS
@ ZYDIS_OPERAND_SIZE_HINT_REQUIRED_BITS
The minimum number of bits required to represent all values of this enum.
Definition Encoder.h:177
ZYDIS_OPERAND_SIZE_HINT_NONE
@ ZYDIS_OPERAND_SIZE_HINT_NONE
Definition Encoder.h:164
ZYDIS_OPERAND_SIZE_HINT_8
@ ZYDIS_OPERAND_SIZE_HINT_8
Definition Encoder.h:165
ZYDIS_OPERAND_SIZE_HINT_MAX_VALUE
@ ZYDIS_OPERAND_SIZE_HINT_MAX_VALUE
Maximum value of this enum.
Definition Encoder.h:173
ZYDIS_OPERAND_SIZE_HINT_64
@ ZYDIS_OPERAND_SIZE_HINT_64
Definition Encoder.h:168
ZydisEncodableEncoding
enum ZydisEncodableEncoding_ ZydisEncodableEncoding
Defines possible physical instruction encodings as bit flags, so multiple acceptable encodings can be...
ZydisOperandSizeHint
enum ZydisOperandSizeHint_ ZydisOperandSizeHint
Defines possible values for operand size hints.
ZydisBranchWidth_
ZydisBranchWidth_
Defines encodable physical/effective sizes of relative immediate operands.
Definition Encoder.h:119
ZYDIS_BRANCH_WIDTH_NONE
@ ZYDIS_BRANCH_WIDTH_NONE
Definition Encoder.h:120
ZYDIS_BRANCH_WIDTH_MAX_VALUE
@ ZYDIS_BRANCH_WIDTH_MAX_VALUE
Maximum value of this enum.
Definition Encoder.h:129
ZYDIS_BRANCH_WIDTH_8
@ ZYDIS_BRANCH_WIDTH_8
Definition Encoder.h:121
ZYDIS_BRANCH_WIDTH_32
@ ZYDIS_BRANCH_WIDTH_32
Definition Encoder.h:123
ZYDIS_BRANCH_WIDTH_REQUIRED_BITS
@ ZYDIS_BRANCH_WIDTH_REQUIRED_BITS
The minimum number of bits required to represent all values of this enum.
Definition Encoder.h:133
ZYDIS_BRANCH_WIDTH_16
@ ZYDIS_BRANCH_WIDTH_16
Definition Encoder.h:122
ZYDIS_BRANCH_WIDTH_64
@ ZYDIS_BRANCH_WIDTH_64
Definition Encoder.h:124
ZydisEncodableEncoding_
ZydisEncodableEncoding_
Defines possible physical instruction encodings as bit flags, so multiple acceptable encodings can be...
Definition Encoder.h:93
ZYDIS_ENCODABLE_ENCODING_REQUIRED_BITS
@ ZYDIS_ENCODABLE_ENCODING_REQUIRED_BITS
The minimum number of bits required to represent all values of this enum.
Definition Encoder.h:110
ZYDIS_ENCODABLE_ENCODING_MAX_VALUE
@ ZYDIS_ENCODABLE_ENCODING_MAX_VALUE
Maximum value of this enum.
Definition Encoder.h:105
ZYDIS_ENCODABLE_ENCODING_DEFAULT
@ ZYDIS_ENCODABLE_ENCODING_DEFAULT
Definition Encoder.h:94
ZYDIS_ENCODABLE_ENCODING_VEX
@ ZYDIS_ENCODABLE_ENCODING_VEX
Definition Encoder.h:98
ZYDIS_ENCODABLE_ENCODING_MVEX
@ ZYDIS_ENCODABLE_ENCODING_MVEX
Definition Encoder.h:100
ZYDIS_ENCODABLE_ENCODING_EVEX
@ ZYDIS_ENCODABLE_ENCODING_EVEX
Definition Encoder.h:99
ZYDIS_ENCODABLE_ENCODING_XOP
@ ZYDIS_ENCODABLE_ENCODING_XOP
Definition Encoder.h:97
ZYDIS_ENCODABLE_ENCODING_LEGACY
@ ZYDIS_ENCODABLE_ENCODING_LEGACY
Definition Encoder.h:95
ZYDIS_ENCODABLE_ENCODING_3DNOW
@ ZYDIS_ENCODABLE_ENCODING_3DNOW
Definition Encoder.h:96
ZydisEncoderRequest
struct ZydisEncoderRequest_ ZydisEncoderRequest
Main structure consumed by the encoder.
ZydisMnemonic
enum ZydisMnemonic_ ZydisMnemonic
Defines the ZydisMnemonic enum.
ZydisRegister
enum ZydisRegister_ ZydisRegister
Defines the ZydisRegister enum.
MetaInfo.h
Mnemonic.h
Mnemonic constant definitions and helper functions.
Register.h
Utility functions and constants for registers.
ZydisOperandType
enum ZydisOperandType_ ZydisOperandType
Defines the ZydisOperandType enum.
ZydisMachineMode
enum ZydisMachineMode_ ZydisMachineMode
Defines the ZydisMachineMode enum.
Status.h
Status code definitions and check macros.
ZydisEncoderDecodedInstructionToEncoderRequest
ZYDIS_EXPORT ZyanStatus ZydisEncoderDecodedInstructionToEncoderRequest(const ZydisDecodedInstruction *instruction, const ZydisDecodedOperand *operands, ZyanU8 operand_count, ZydisEncoderRequest *request)
Converts decoded instruction to encoder request that can be passed to ZydisEncoderEncodeInstruction.
ZydisEncoderEncodeInstruction
ZYDIS_EXPORT ZyanStatus ZydisEncoderEncodeInstruction(const ZydisEncoderRequest *request, void *buffer, ZyanUSize *length)
Encodes instruction with semantics specified in encoder request structure.
ZydisEncoderEncodeInstructionAbsolute
ZYDIS_EXPORT ZyanStatus ZydisEncoderEncodeInstructionAbsolute(ZydisEncoderRequest *request, void *buffer, ZyanUSize *length, ZyanU64 runtime_address)
Encodes instruction with semantics specified in encoder request structure.
ZydisEncoderNopFill
ZYDIS_EXPORT ZyanStatus ZydisEncoderNopFill(void *buffer, ZyanUSize length)
Fills provided buffer with NOP instructions using longest possible multi-byte instructions.
ZydisInstructionAttributes
ZyanU64 ZydisInstructionAttributes
Defines the ZydisInstructionAttributes data-type.
Definition SharedTypes.h:501
ZydisEncoderOperand_::ZydisEncoderOperandMem_
Extended info for memory-operands.
Definition Encoder.h:210
ZydisEncoderOperand_::ZydisEncoderOperandMem_::size
ZyanU16 size
Size of this operand in bytes.
Definition Encoder.h:234
ZydisEncoderOperand_::ZydisEncoderOperandMem_::displacement
ZyanI64 displacement
The displacement value.
Definition Encoder.h:230
ZydisEncoderOperand_::ZydisEncoderOperandMem_::base
ZydisRegister base
The base register.
Definition Encoder.h:214
ZydisEncoderOperand_::ZydisEncoderOperandMem_::scale
ZyanU8 scale
The scale factor.
Definition Encoder.h:222
ZydisEncoderOperand_::ZydisEncoderOperandMem_::index
ZydisRegister index
The index register.
Definition Encoder.h:218
ZydisEncoderOperand_::ZydisEncoderOperandPtr_
Extended info for pointer-operands.
Definition Encoder.h:240
ZydisEncoderOperand_::ZydisEncoderOperandPtr_::offset
ZyanU32 offset
The offset value.
Definition Encoder.h:248
ZydisEncoderOperand_::ZydisEncoderOperandPtr_::segment
ZyanU16 segment
The segment value.
Definition Encoder.h:244
ZydisEncoderOperand_::ZydisEncoderOperandReg_
Extended info for register-operands.
Definition Encoder.h:194
ZydisEncoderOperand_::ZydisEncoderOperandReg_::is4
ZyanBool is4
Is this 4th operand (VEX/XOP).
Definition Encoder.h:204
ZydisEncoderOperand_::ZydisEncoderOperandReg_::value
ZydisRegister value
The register value.
Definition Encoder.h:198
ZydisEncoderOperand_
Describes explicit or implicit instruction operand.
Definition Encoder.h:185
ZydisEncoderOperand_::ptr
struct ZydisEncoderOperand_::ZydisEncoderOperandPtr_ ptr
ZydisEncoderOperand_::reg
struct ZydisEncoderOperand_::ZydisEncoderOperandReg_ reg
ZydisEncoderOperand_::imm
union ZydisEncoderOperand_::ZydisEncoderOperandImm_ imm
ZydisEncoderOperand_::mem
struct ZydisEncoderOperand_::ZydisEncoderOperandMem_ mem
ZydisEncoderOperand_::type
ZydisOperandType type
The type of the operand.
Definition Encoder.h:189
ZydisEncoderRequest_::ZydisEncoderRequestEvexFeatures_
Extended info for EVEX instructions.
Definition Encoder.h:337
ZydisEncoderRequest_::ZydisEncoderRequestEvexFeatures_::rounding
ZydisRoundingMode rounding
The rounding-mode.
Definition Encoder.h:346
ZydisEncoderRequest_::ZydisEncoderRequestEvexFeatures_::zeroing_mask
ZyanBool zeroing_mask
Signals, if the zeroing-mask functionality should be enabled for the instruction.
Definition Encoder.h:356
ZydisEncoderRequest_::ZydisEncoderRequestEvexFeatures_::sae
ZyanBool sae
Signals, if the SAE (suppress-all-exceptions) functionality should be enabled for the instruction.
Definition Encoder.h:351
ZydisEncoderRequest_::ZydisEncoderRequestEvexFeatures_::broadcast
ZydisBroadcastMode broadcast
The broadcast-mode.
Definition Encoder.h:342
ZydisEncoderRequest_::ZydisEncoderRequestMvexFeatures_
Extended info for MVEX instructions.
Definition Encoder.h:362
ZydisEncoderRequest_::ZydisEncoderRequestMvexFeatures_::rounding
ZydisRoundingMode rounding
The rounding-mode.
Definition Encoder.h:374
ZydisEncoderRequest_::ZydisEncoderRequestMvexFeatures_::conversion
ZydisConversionMode conversion
The data-conversion mode.
Definition Encoder.h:370
ZydisEncoderRequest_::ZydisEncoderRequestMvexFeatures_::eviction_hint
ZyanBool eviction_hint
Signals, if the instruction has a memory-eviction-hint (KNC only).
Definition Encoder.h:387
ZydisEncoderRequest_::ZydisEncoderRequestMvexFeatures_::sae
ZyanBool sae
Signals, if the SAE (suppress-all-exceptions) functionality is enabled for the instruction.
Definition Encoder.h:383
ZydisEncoderRequest_::ZydisEncoderRequestMvexFeatures_::swizzle
ZydisSwizzleMode swizzle
The AVX register-swizzle mode.
Definition Encoder.h:378
ZydisEncoderRequest_::ZydisEncoderRequestMvexFeatures_::broadcast
ZydisBroadcastMode broadcast
The broadcast-mode.
Definition Encoder.h:366
ZydisEncoderRequest_
Main structure consumed by the encoder.
Definition Encoder.h:270
ZydisEncoderRequest_::branch_type
ZydisBranchType branch_type
Branch type (required for branching instructions only).
Definition Encoder.h:296
ZydisEncoderRequest_::mnemonic
ZydisMnemonic mnemonic
The instruction-mnemonic.
Definition Encoder.h:285
ZydisEncoderRequest_::operand_size_hint
ZydisOperandSizeHint operand_size_hint
Optional operand size hint used to resolve ambiguities for some instructions.
Definition Encoder.h:324
ZydisEncoderRequest_::prefixes
ZydisInstructionAttributes prefixes
A combination of requested encodable prefixes (ZYDIS_ATTRIB_HAS_* flags) for desired instruction.
Definition Encoder.h:290
ZydisEncoderRequest_::allowed_encodings
ZydisEncodableEncoding allowed_encodings
This optional field can be used to restrict allowed physical encodings for desired instruction.
Definition Encoder.h:281
ZydisEncoderRequest_::machine_mode
ZydisMachineMode machine_mode
The machine mode used to encode this instruction.
Definition Encoder.h:274
ZydisEncoderRequest_::evex
struct ZydisEncoderRequest_::ZydisEncoderRequestEvexFeatures_ evex
ZydisEncoderRequest_::mvex
struct ZydisEncoderRequest_::ZydisEncoderRequestMvexFeatures_ mvex
ZydisEncoderRequest_::operands
ZydisEncoderOperand operands[ZYDIS_ENCODER_MAX_OPERANDS]
Detailed info for all explicit and implicit instruction operands.
Definition Encoder.h:332
ZydisEncoderRequest_::operand_count
ZyanU8 operand_count
The number of instruction-operands.
Definition Encoder.h:328
ZydisEncoderRequest_::branch_width
ZydisBranchWidth branch_width
Specifies physical size for relative immediate operands.
Definition Encoder.h:303
ZydisEncoderRequest_::address_size_hint
ZydisAddressSizeHint address_size_hint
Optional address size hint used to resolve ambiguities for some instructions.
Definition Encoder.h:317
ZydisEncoderOperand_::ZydisEncoderOperandImm_
Extended info for immediate-operands.
Definition Encoder.h:254
ZydisEncoderOperand_::ZydisEncoderOperandImm_::u
ZyanU64 u
The unsigned immediate value.
Definition Encoder.h:258
ZydisEncoderOperand_::ZydisEncoderOperandImm_::s
ZyanI64 s
The signed immediate value.
Definition Encoder.h:262