Expand description
low level rust bindings for the zydis library for encoding/decoding and messing with x86 instructions.
for higher level bindings, check out the rydis
crate.
Re-exports§
pub use self::ZydisInstructionCategory_ as ZydisInstructionCategory;
pub use self::ZydisISASet_ as ZydisISASet;
pub use self::ZydisISAExt_ as ZydisISAExt;
pub use self::ZydisMnemonic_ as ZydisMnemonic;
pub use self::ZydisMachineMode_ as ZydisMachineMode;
pub use self::ZydisStackWidth_ as ZydisStackWidth;
pub use self::ZydisElementType_ as ZydisElementType;
pub use self::ZydisOperandType_ as ZydisOperandType;
pub use self::ZydisOperandEncoding_ as ZydisOperandEncoding;
pub use self::ZydisOperandVisibility_ as ZydisOperandVisibility;
pub use self::ZydisOperandAction_ as ZydisOperandAction;
pub use self::ZydisInstructionEncoding_ as ZydisInstructionEncoding;
pub use self::ZydisOpcodeMap_ as ZydisOpcodeMap;
pub use self::ZydisRegister_ as ZydisRegister;
pub use self::ZydisRegisterKind_ as ZydisRegisterKind;
pub use self::ZydisRegisterClass_ as ZydisRegisterClass;
pub use self::ZydisMemoryOperandType_ as ZydisMemoryOperandType;
pub use self::ZydisBranchType_ as ZydisBranchType;
pub use self::ZydisExceptionClass_ as ZydisExceptionClass;
pub use self::ZydisMaskMode_ as ZydisMaskMode;
pub use self::ZydisBroadcastMode_ as ZydisBroadcastMode;
pub use self::ZydisRoundingMode_ as ZydisRoundingMode;
pub use self::ZydisSwizzleMode_ as ZydisSwizzleMode;
pub use self::ZydisConversionMode_ as ZydisConversionMode;
pub use self::ZydisPrefixType_ as ZydisPrefixType;
pub use self::ZydisDecoderMode_ as ZydisDecoderMode;
pub use self::ZydisEncodableEncoding_ as ZydisEncodableEncoding;
pub use self::ZydisBranchWidth_ as ZydisBranchWidth;
pub use self::ZydisAddressSizeHint_ as ZydisAddressSizeHint;
pub use self::ZydisOperandSizeHint_ as ZydisOperandSizeHint;
pub use self::ZydisFormatterStyle_ as ZydisFormatterStyle;
pub use self::ZydisFormatterProperty_ as ZydisFormatterProperty;
pub use self::ZydisNumericBase_ as ZydisNumericBase;
pub use self::ZydisSignedness_ as ZydisSignedness;
pub use self::ZydisPadding_ as ZydisPadding;
pub use self::ZydisFormatterFunction_ as ZydisFormatterFunction;
pub use self::ZydisDecorator_ as ZydisDecorator;
pub use self::ZydisInstructionSegment_ as ZydisInstructionSegment;
pub use self::ZydisFeature_ as ZydisFeature;
Structs§
- Defines the
ZyanAllocator
struct. - Defines the
ZyanStringView
struct. - Defines the
ZyanString
struct. - Defines the
ZyanVector
struct. - @}
- Defines possible values for address size hints. See
ZydisEncoderRequest
for more information about address size hints. - Defines the
ZydisBranchType
enum. - Defines encodable physical/effective sizes of relative immediate operands. See
ZydisEncoderRequest.branch_width
for more details. - Defines the
ZydisBroadcastMode
enum. - Defines the
ZydisConversionMode
enum. - Extended info for
AVX
instructions. - Contains info about the
AVX
broadcast. - Contains info about the
AVX
data-conversion (KNC
only). - Info about the embedded writemask-register (
AVX-512
andKNC
only). - Contains info about the
AVX
rounding. - Contains info about the
AVX
register-swizzle (KNC
only). - Instruction meta info.
- Detailed info about the
EVEX
prefix. - Detailed info about the
MVEX
prefix. - Detailed info about the
REX
prefix. - Detailed info about the
VEX
prefix. - Detailed info about the
XOP
prefix. - Detailed info about different instruction-parts like
ModRM
,SIB
or encoding-prefixes. - Detailed info about the
ModRM
byte. - Detailed info about displacement-bytes.
- Detailed info about immediate-bytes.
- Detailed info about the legacy prefixes (including
REX
). - Detailed info about the
SIB
byte. - Information about a decoded instruction.
- Extended info for immediate-operands.
- Extended info for memory-operands.
- Extended info for memory-operands with displacement.
- Extended info for pointer-operands.
- Extended info for register-operands.
- Defines the
ZydisDecodedOperand
struct. - The decoder context is used to preserve some internal state between subsequent decode operations for THE SAME instruction.
- Contains some cached REX/XOP/VEX/EVEX/MVEX values to provide uniform access.
- Information about encoded operand registers.
- Internal EVEX-specific information.
- Internal MVEX-specific information.
- Defines the
ZydisDecoderMode
enum. - Defines the
ZydisDecoder
struct. - Enum of all decorator types.
- All commonly used information about a decoded instruction that Zydis can provide.
- Defines the
ZydisElementType
enum. - Defines possible physical instruction encodings as bit flags, so multiple acceptable encodings can be specified simultaneously.
- Describes explicit or implicit instruction operand.
- Extended info for memory-operands.
- Extended info for pointer-operands.
- Extended info for register-operands.
- Main structure consumed by the encoder. It represents full semantics of an instruction.
- Extended info for
EVEX
instructions. - Extended info for
MVEX
instructions. - Defines the
ZydisExceptionClass
enum. - Defines the
ZydisFeature
enum. - Defines the
ZydisFormatterBuffer
struct. - Context structure that that is passed to all formatter.
- Enum selecting a formatter function to be replaced with hooks.
- Enum selecting a property of the formatter.
- Enum selecting the syntax to format the disassembly in.
- Defines the
ZydisFormatterToken
struct. - Context structure keeping track of internal state of the formatter.
- The number formats for all numeric bases.
- Defines the
ZydisISAExt
enum. - Defines the
ZydisISASet
enum. - Defines the
ZydisInstructionCategory
enum. - Defines the
ZydisInstructionEncoding
enum. - Defines the
ZydisInstructionSegment
struct. - Defines the
ZydisInstructionSegments
struct. - Defines the
ZydisMachineMode
enum. - Defines the
ZydisMaskMode
enum. - Defines the
ZydisMemoryOperandType
enum. - Defines the
ZydisMnemonic
enum. - Enum defining different mantissae to be used during formatting.
- Defines the
ZydisOpcodeMap
enum. - Defines the
ZydisOperandAction
enum. - Defines the
ZydisOperandEncoding
enum. - Defines possible values for operand size hints. See
ZydisEncoderRequest
for more information about operand size hints. - Defines the
ZydisOperandType
enum. - Defines the
ZydisOperandVisibility
enum. - Enum definining magic values that receive special treatment when used as padding properties of the formatter.
- Defines the
ZydisPrefixType
enum. - Defines the
ZydisRegisterClass
enum. - Defines the
ZydisRegisterContext
struct. - Defines the
ZydisRegisterKind
enum. - Defines the
ZydisRegister
enum. - Defines the
ZydisRoundingMode
enum. - Defines the
ZydisShortString
struct. - Enum defining the signeness of integers to be used during formatting.
- Defines the
ZydisStackWidth
enum. - Defines the
ZydisSwizzleMode
enum.
Constants§
Functions§
- Initializes the given
ZyanAllocator
instance. - Appends the content of the source string to the end of the destination string.
- Appends
count
characters of the source string to the end of the destination string. - Erases the given string.
- Compares two strings.
- Performs a case-insensitive comparison of two strings.
- Initializes a new
ZyanString
instance by concatenating two existing strings and configures it to use a custom user defined buffer with a fixed size. - Initializes a new
ZyanString
instance by concatenating two existing strings and sets a customallocator
and memory allocation/deallocation parameters. - Deletes characters from the given string, starting at
index
. - Destroys the given
ZyanString
instance. - Initializes a new
ZyanString
instance by duplicating an existing string and configures it to use a custom user defined buffer with a fixed size. - Initializes a new
ZyanString
instance by duplicating an existing string and sets a customallocator
and memory allocation/deallocation parameters. - Returns the current capacity of the string.
- Returns the character at the given
index
. - Returns a pointer to the character at the given
index
. - Returns the C-style string of the given
ZyanString
instance. - Returns the current size (number of characters) of the string (excluding the terminating zero character).
- Initializes the given
ZyanString
instance and configures it to use a custom user defined buffer with a fixed size. - Initializes the given
ZyanString
instance and sets a customallocator
and memory allocation/deallocation parameters. - Inserts the content of the source string in the destination string at the given
index
. - Inserts
count
characters of the source string in the destination string at the givenindex
. - Searches for the first occurrence of
needle
in the givenhaystack
starting from the left. - Searches for the first occurrence of
needle
in the givenhaystack
starting from the left. - Performs a case-insensitive search for the first occurrence of
needle
in the givenhaystack
starting from the left. - Performs a case-insensitive search for the first occurrence of
needle
in the givenhaystack
starting from the left. - Searches for the first occurrence of
needle
in the givenhaystack
starting from the right. - Searches for the first occurrence of
needle
in the givenhaystack
starting from the right. - Performs a case-insensitive search for the first occurrence of
needle
in the givenhaystack
starting from the right. - Performs a case-insensitive search for the first occurrence of
needle
in the givenhaystack
starting from the right. - Changes the capacity of the given
ZyanString
instance. - Resizes the given
ZyanString
instance. - Assigns a new value to the character at the given
index
. - Shrinks the capacity of the given string to match it’s size.
- Converts the given string to lowercase letters.
- Converts
count
characters of the given string to lowercase letters. - Converts the given string to uppercase letters.
- Converts
count
characters of the given string to uppercase letters. - Deletes all remaining characters from the given string, starting at
index
. - Returns the C-style string of the given
ZyanString
instance. - Returns the size (number of characters) of the view.
- Returns a view inside a null-terminated C-style string.
- Returns a view inside a character buffer with custom length.
- Returns a view inside an existing view/string.
- Returns a view inside an existing view/string starting from the given
index
. - Searches for the first occurrence of
element
in the given vector using a binary- search algorithm. - Searches for the first occurrence of
element
in the given vector using a binary- search algorithm. - Erases all elements of the given vector.
- Deletes the element at the given
index
of the vector. - Deletes multiple elements from the given vector, starting at
index
. - Destroys the given
ZyanVector
instance. - Initializes a new
ZyanVector
instance by duplicating an existing vector and configures it to use a custom user defined buffer with a fixed size. - Initializes a new
ZyanVector
instance by duplicating an existing vector and sets a customallocator
and memory allocation/deallocation parameters. - Constructs an
element
in-place at the end of the vector. - Constructs an
element
in-place and inserts it at the givenindex
of the vector. - Sequentially searches for the first occurrence of
element
in the given vector. - Sequentially searches for the first occurrence of
element
in the given vector. - Returns a constant pointer to the element at the given
index
. - Returns the current capacity of the vector.
- Returns a mutable pointer to the element at the given
index
. - Returns a constant pointer to the element at the given
index
. - Returns a mutable pointer to the element at the given
index
. - Returns the current size of the vector.
- Initializes the given
ZyanVector
instance and configures it to use a custom user defined buffer with a fixed size. - Initializes the given
ZyanVector
instance and sets a customallocator
and memory allocation/deallocation parameters. - Inserts an
element
at the givenindex
of the vector. - Inserts multiple
elements
at the givenindex
of the vector. - Removes the last element of the vector.
- Adds a new
element
to the end of the vector. - Changes the capacity of the given
ZyanVector
instance. - Resizes the given
ZyanVector
instance. - Resizes the given
ZyanVector
instance. - Assigns a new value to the element at the given
index
. - Shrinks the capacity of the given vector to match it’s size.
- Swaps the element at
index_first
with the element atindex_second
. - Calculates the absolute address value for the given instruction operand.
- Calculates the absolute address value for the given instruction operand.
- Returns the specified instruction category string.
- Decodes the instruction in the given input
buffer
and returns all details (e.g. operands). - Decodes the instruction in the given input
buffer
. - Decodes the instruction operands.
- Enables or disables the specified decoder-mode.
- Initializes the given
ZydisDecoder
instance. - Disassemble an instruction and format it to human-readable text in a single step (AT&T syntax).
- Disassemble an instruction and format it to human-readable text in a single step (Intel syntax).
- Converts decoded instruction to encoder request that can be passed to
ZydisEncoderEncodeInstruction
. - Encodes instruction with semantics specified in encoder request structure.
- Encodes instruction with semantics specified in encoder request structure. This function expects absolute addresses inside encoder request instead of
EIP
/RIP
-relative values. Function predicts final instruction length prior to encoding and writes back calculated relative operands to provided encoder request. - Fills provided buffer with
NOP
instructions using longest possible multi-byte instructions. - Appends a new token to the
buffer
. - Returns the
ZyanString
instance associated with the given buffer. - Returns the current (most recently added) token.
- Returns a snapshot of the buffer-state.
- Restores a previously saved buffer-state.
- Formats the given instruction and writes it into the output buffer.
- Formats the given operand and writes it into the output buffer.
- Initializes the given
ZydisFormatter
instance. - Replaces a formatter function with a custom callback and/or retrieves the currently used function.
- Changes the value of the specified formatter
property
. - Returns the
type
and the stringvalue
of the giventoken
. - Obtains the next
token
linked to the passed one. - Tokenizes the given instruction and writes it into the output buffer.
- Tokenizes the given operand and writes it into the output buffer.
- Returns offsets and sizes of all logical instruction segments (e.g.
OPCODE
,MODRM
, …). - Returns the zydis version.
- Returns the specified isa-extension string.
- Returns the specified isa-set string.
- Checks, if the specified feature is enabled in the current zydis library instance.
- Returns the specified instruction mnemonic string.
- Returns the specified instruction mnemonic as
ZydisShortString
. - Returns the width of the specified register-class.
- Returns the register specified by the
register_class
andid
tuple. - Returns the register-class of the specified register.
- Returns the id of the specified register.
- Returns the largest enclosing register of the given register.
- Returns the specified register string.
- Returns the specified register string as
ZydisShortString
. - Returns the width of the specified register.
Type Aliases§
- Defines the
ZyanAllocator
struct. - Defines the
ZyanAllocatorAllocate
function prototype. - Defines the
ZyanAllocatorDeallocate
function prototype. - Defines the
ZyanBool
data-type. - Defines the
ZyanCharPointer
data-type. - Defines the
ZyanComparison
function prototype. - Defines the
ZyanConstCharPointer
data-type. - Defines the
ZyanConstMemberFunction
function prototype. - Defines the
ZyanConstMemberProcedure
function prototype. - Defines the
ZyanConstVoidPointer
data-type. - Defines the
ZyanEqualityComparison
function prototype. - Defines the
ZyanMemberFunction
function prototype. - Defines the
ZyanMemberProcedure
function prototype. - Defines the
ZyanStatus
data type. - Defines the
ZyanString
struct. - Defines the
ZyanStringFlags
data-type. - Defines the
ZyanStringView
struct. - Defines the
ZyanTernary
data-type. - Defines the
ZyanVector
struct. - Defines the
ZyanVoidPointer
data-type. - @}
- Defines the
ZydisAccessedFlagsMask
data-type. - Information about a decoded instruction.
- Extended info for
AVX
instructions. - Instruction meta info.
- Detailed info about different instruction-parts like
ModRM
,SIB
or encoding-prefixes. - Detailed info about the
MVEX
prefix. - Detailed info about the
REX
prefix. - Detailed info about the
VEX
prefix. - Detailed info about the
XOP
prefix. - Defines the
ZydisDecodedOperand
struct. - Extended info for immediate-operands.
- Extended info for memory-operands.
- Extended info for pointer-operands.
- Extended info for register-operands.
- Defines the
ZydisDecoder
struct. - The decoder context is used to preserve some internal state between subsequent decode operations for THE SAME instruction.
- All commonly used information about a decoded instruction that Zydis can provide.
- Defines the
ZydisElementSize
datatype. - Describes explicit or implicit instruction operand.
- Main structure consumed by the encoder. It represents full semantics of an instruction.
- Context structure keeping track of internal state of the formatter.
- Defines the
ZydisFormatterBuffer
struct. - Context structure that that is passed to all formatter.
- Defines the
ZydisFormatterDecoratorFunc
function prototype. - Defines the
ZydisFormatterFunc
function prototype. - Defines the
ZydisFormatterRegisterFunc
function prototype. - Defines the
ZydisFormatterToken
struct. - Defines the
ZydisFormatterTokenConst
data-type. - Defines the
ZydisInstructionAttributes
data-type. - Defines the
ZydisInstructionSegments
struct. - Defines the
ZydisOperandActions
data-type. - Defines the
ZydisOperandAttributes
data-type. - Defines the
ZydisRegisterContext
struct. - Defines the
ZydisRegisterWidth
data-type. - Defines the
ZydisShortString
struct. - Defines the
ZydisTokenType
data-type.
Unions§
- The immediate value.
- The immediate value.
- Extended info for immediate-operands.