Zydis 5.0.0
Zyan Disassembler Library
Loading...
Searching...
No Matches
EncoderData.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
27#ifndef ZYDIS_INTERNAL_ENCODERDATA_H
28#define ZYDIS_INTERNAL_ENCODERDATA_H
29
30#include <Zycore/Defines.h>
31#include <Zydis/Mnemonic.h>
32#include <Zydis/SharedTypes.h>
33#include <Zydis/DecoderTypes.h>
34
54
75
95
114
133
149
150#pragma pack(push, 1)
151
238
239#pragma pack(pop)
240
265
277 const ZydisEncodableInstruction **instruction);
278
288
298
299#endif /* ZYDIS_INTERNAL_ENCODERDATA_H */
Defines the basic ZydisDecodedInstruction and ZydisDecodedOperand structs.
enum ZydisSourceConditionCode_ ZydisSourceConditionCode
Defines the ZydisSourceConditionCode enum.
ZydisVectorLength_
Used in encoder's table to represent vector size supported by instruction definition.
Definition EncoderData.h:80
@ ZYDIS_VECTOR_LENGTH_256
Definition EncoderData.h:83
@ ZYDIS_VECTOR_LENGTH_512
Definition EncoderData.h:84
@ ZYDIS_VECTOR_LENGTH_128
Definition EncoderData.h:82
@ ZYDIS_VECTOR_LENGTH_MAX_VALUE
Maximum value of this enum.
Definition EncoderData.h:89
@ ZYDIS_VECTOR_LENGTH_REQUIRED_BITS
The minimum number of bits required to represent all values of this enum.
Definition EncoderData.h:93
@ ZYDIS_VECTOR_LENGTH_INVALID
Definition EncoderData.h:81
ZyanBool ZydisGetCcInfo(ZydisMnemonic mnemonic, ZydisSourceConditionCode *scc)
Fetches information about APX conditional instructions.
enum ZydisVectorLength_ ZydisVectorLength
Used in encoder's table to represent vector size supported by instruction definition.
enum ZydisWidthFlag_ ZydisWidthFlag
Used in encoder's table to represent standard ISA sizes in form of bit flags.
enum ZydisSizeHint_ ZydisSizeHint
Used in encoder's table to represent hint type supported by instruction definition.
enum ZydisMandatoryPrefix_ ZydisMandatoryPrefix
Used in encoder's table to represent mandatory instruction prefix.
ZydisWidthFlag_
Used in encoder's table to represent standard ISA sizes in form of bit flags.
Definition EncoderData.h:39
@ ZYDIS_WIDTH_INVALID
Definition EncoderData.h:40
@ ZYDIS_WIDTH_REQUIRED_BITS
The minimum number of bits required to represent all values of this enum.
Definition EncoderData.h:52
@ ZYDIS_WIDTH_16
Definition EncoderData.h:41
@ ZYDIS_WIDTH_64
Definition EncoderData.h:43
@ ZYDIS_WIDTH_32
Definition EncoderData.h:42
@ ZYDIS_WIDTH_MAX_VALUE
Maximum value of this enum.
Definition EncoderData.h:48
ZydisRex2Type_
Used in encoder's table to indicate REX2 prefix support type.
Definition EncoderData.h:119
@ ZYDIS_REX2_TYPE_FORBIDDEN
Definition EncoderData.h:120
@ ZYDIS_REX2_TYPE_MANDATORY
Definition EncoderData.h:122
@ ZYDIS_REX2_TYPE_REQUIRED_BITS
The minimum number of bits required to represent all values of this enum.
Definition EncoderData.h:131
@ ZYDIS_REX2_TYPE_MAX_VALUE
Maximum value of this enum.
Definition EncoderData.h:127
@ ZYDIS_REX2_TYPE_ALLOWED
Definition EncoderData.h:121
const ZydisEncoderRelInfo * ZydisGetRelInfo(ZydisMnemonic mnemonic)
Fetches ZydisEncoderRelInfo record for given instruction mnemonic.
enum ZydisRex2Type_ ZydisRex2Type
Used in encoder's table to indicate REX2 prefix support type.
struct ZydisEncoderLookupEntry_ ZydisEncoderLookupEntry
Used in encoder's primary lookup table which allows to access a set of instruction definitions for sp...
ZydisSizeHint_
Used in encoder's table to represent hint type supported by instruction definition.
Definition EncoderData.h:100
@ ZYDIS_SIZE_HINT_ASZ
Definition EncoderData.h:102
@ ZYDIS_SIZE_HINT_REQUIRED_BITS
The minimum number of bits required to represent all values of this enum.
Definition EncoderData.h:112
@ ZYDIS_SIZE_HINT_MAX_VALUE
Maximum value of this enum.
Definition EncoderData.h:108
@ ZYDIS_SIZE_HINT_NONE
Definition EncoderData.h:101
@ ZYDIS_SIZE_HINT_OSZ
Definition EncoderData.h:103
ZydisMandatoryPrefix_
Used in encoder's table to represent mandatory instruction prefix.
Definition EncoderData.h:60
@ ZYDIS_MANDATORY_PREFIX_NONE
Definition EncoderData.h:61
@ ZYDIS_MANDATORY_PREFIX_MAX_VALUE
Maximum value of this enum.
Definition EncoderData.h:69
@ ZYDIS_MANDATORY_PREFIX_66
Definition EncoderData.h:62
@ ZYDIS_MANDATORY_PREFIX_F3
Definition EncoderData.h:64
@ ZYDIS_MANDATORY_PREFIX_F2
Definition EncoderData.h:63
@ ZYDIS_MANDATORY_PREFIX_REQUIRED_BITS
The minimum number of bits required to represent all values of this enum.
Definition EncoderData.h:73
struct ZydisEncodableInstruction_ ZydisEncodableInstruction
This structure is encoder's internal representation of encodable instruction definition.
ZyanU8 ZydisGetEncodableInstructions(ZydisMnemonic mnemonic, const ZydisEncodableInstruction **instruction)
Fetches array of ZydisEncodableInstruction structures and its size for given instruction mnemonic.
struct ZydisEncoderRelInfo_ ZydisEncoderRelInfo
Contains information used by instruction size prediction algorithm inside ZydisEncoderEncodeInstructi...
enum ZydisMnemonic_ ZydisMnemonic
Defines the ZydisMnemonic enum.
Mnemonic constant definitions and helper functions.
Defines decoder/encoder-shared macros and types.
@ ZYDIS_INSTRUCTION_ENCODING_REQUIRED_BITS
The minimum number of bits required to represent all values of this enum.
Definition SharedTypes.h:453
@ ZYDIS_OPCODE_MAP_REQUIRED_BITS
The minimum number of bits required to represent all values of this enum.
Definition SharedTypes.h:490
This structure is encoder's internal representation of encodable instruction definition.
Definition EncoderData.h:156
ZyanU16 operand_mask
Compressed information about operand count and types.
Definition EncoderData.h:165
ZyanU16 instruction_reference
Index to one of decoder's instruction definition arrays.
Definition EncoderData.h:160
ZyanU8 swappable ZYAN_BITFIELD(1)
Indicates that next instruction definition can be safely used instead of current one.
ZyanU8 modrm
The mandatory ModR/M value.
Definition EncoderData.h:173
ZyanU8 operand_sizes ZYAN_BITFIELD(ZYDIS_WIDTH_REQUIRED_BITS)
The combination of allowed operand sizes.
ZyanU8 vector_length ZYAN_BITFIELD(ZYDIS_VECTOR_LENGTH_REQUIRED_BITS)
The vector length.
ZyanU8 opcode
The instruction-opcode.
Definition EncoderData.h:169
ZyanU8 evex_nd ZYAN_BITFIELD(1)
True if EEVEX.ND is required for this definition.
ZyanU8 accepts_hint ZYAN_BITFIELD(ZYDIS_SIZE_HINT_REQUIRED_BITS)
The accepted sizing hint.
ZyanU8 modes ZYAN_BITFIELD(ZYDIS_WIDTH_REQUIRED_BITS)
The combination of allowed processor modes.
ZyanU8 mandatory_prefix ZYAN_BITFIELD(ZYDIS_MANDATORY_PREFIX_REQUIRED_BITS)
The mandatory prefix.
ZyanU8 rex_w ZYAN_BITFIELD(1)
True if REX.W is required for this definition.
ZyanU8 apx_osz ZYAN_BITFIELD(1)
True if APX definition scales memory operand with operand size attribute.
ZyanU8 evex_nf ZYAN_BITFIELD(1)
True if EEVEX.NF is required for this definition.
ZyanU8 encoding ZYAN_BITFIELD(ZYDIS_INSTRUCTION_ENCODING_REQUIRED_BITS)
The instruction-encoding.
ZyanU8 opcode_map ZYAN_BITFIELD(ZYDIS_OPCODE_MAP_REQUIRED_BITS)
The opcode map.
ZyanU8 rex2 ZYAN_BITFIELD(ZYDIS_REX2_TYPE_REQUIRED_BITS)
True if REX2 prefix is required for this definition.
ZyanU8 address_sizes ZYAN_BITFIELD(ZYDIS_WIDTH_REQUIRED_BITS)
The combination of allowed address sizes.
Used in encoder's primary lookup table which allows to access a set of instruction definitions for sp...
Definition EncoderData.h:139
ZyanU16 encoder_reference
Index to main array of ZydisEncodableInstruction.
Definition EncoderData.h:143
ZyanU8 instruction_count
The number of entries.
Definition EncoderData.h:147
Contains information used by instruction size prediction algorithm inside ZydisEncoderEncodeInstructi...
Definition EncoderData.h:246
ZyanU8 size[3][3]
Sizes of instruction variants.
Definition EncoderData.h:251
ZyanBool accepts_branch_hints
True if instruction accepts branch hint prefixes.
Definition EncoderData.h:259
ZyanU8 accepts_scaling_hints
See ZydisSizeHint.
Definition EncoderData.h:255
ZyanBool accepts_bound
True if instruction accepts bound (BND) prefix.
Definition EncoderData.h:263