Zydis
v3.1.0
|
Functions allowing formatting of previously decoded instructions to human readable text. More...
Functions | |
ZYDIS_EXPORT ZyanStatus | ZydisFormatterInit (ZydisFormatter *formatter, ZydisFormatterStyle style) |
Initializes the given ZydisFormatter instance. More... | |
ZYDIS_EXPORT ZyanStatus | ZydisFormatterSetProperty (ZydisFormatter *formatter, ZydisFormatterProperty property, ZyanUPointer value) |
Changes the value of the specified formatter property . More... | |
ZYDIS_EXPORT ZyanStatus | ZydisFormatterSetHook (ZydisFormatter *formatter, ZydisFormatterFunction type, const void **callback) |
Replaces a formatter function with a custom callback and/or retrieves the currently used function. More... | |
ZYDIS_EXPORT ZyanStatus | ZydisFormatterFormatInstruction (const ZydisFormatter *formatter, const ZydisDecodedInstruction *instruction, char *buffer, ZyanUSize length, ZyanU64 runtime_address) |
Formats the given instruction and writes it into the output buffer. More... | |
ZYDIS_EXPORT ZyanStatus | ZydisFormatterFormatInstructionEx (const ZydisFormatter *formatter, const ZydisDecodedInstruction *instruction, char *buffer, ZyanUSize length, ZyanU64 runtime_address, void *user_data) |
Formats the given instruction and writes it into the output buffer. More... | |
ZYDIS_EXPORT ZyanStatus | ZydisFormatterFormatOperand (const ZydisFormatter *formatter, const ZydisDecodedInstruction *instruction, ZyanU8 index, char *buffer, ZyanUSize length, ZyanU64 runtime_address) |
Formats the given operand and writes it into the output buffer. More... | |
ZYDIS_EXPORT ZyanStatus | ZydisFormatterFormatOperandEx (const ZydisFormatter *formatter, const ZydisDecodedInstruction *instruction, ZyanU8 index, char *buffer, ZyanUSize length, ZyanU64 runtime_address, void *user_data) |
Formats the given operand and writes it into the output buffer. More... | |
ZYDIS_EXPORT ZyanStatus | ZydisFormatterTokenizeInstruction (const ZydisFormatter *formatter, const ZydisDecodedInstruction *instruction, void *buffer, ZyanUSize length, ZyanU64 runtime_address, ZydisFormatterTokenConst **token) |
Tokenizes the given instruction and writes it into the output buffer. More... | |
ZYDIS_EXPORT ZyanStatus | ZydisFormatterTokenizeInstructionEx (const ZydisFormatter *formatter, const ZydisDecodedInstruction *instruction, void *buffer, ZyanUSize length, ZyanU64 runtime_address, ZydisFormatterTokenConst **token, void *user_data) |
Tokenizes the given instruction and writes it into the output buffer. More... | |
ZYDIS_EXPORT ZyanStatus | ZydisFormatterTokenizeOperand (const ZydisFormatter *formatter, const ZydisDecodedInstruction *instruction, ZyanU8 index, void *buffer, ZyanUSize length, ZyanU64 runtime_address, ZydisFormatterTokenConst **token) |
Tokenizes the given operand and writes it into the output buffer. More... | |
ZYDIS_EXPORT ZyanStatus | ZydisFormatterTokenizeOperandEx (const ZydisFormatter *formatter, const ZydisDecodedInstruction *instruction, ZyanU8 index, void *buffer, ZyanUSize length, ZyanU64 runtime_address, ZydisFormatterTokenConst **token, void *user_data) |
Tokenizes the given operand and writes it into the output buffer. More... | |
Functions allowing formatting of previously decoded instructions to human readable text.
ZYDIS_EXPORT ZyanStatus ZydisFormatterFormatInstruction | ( | const ZydisFormatter * | formatter, |
const ZydisDecodedInstruction * | instruction, | ||
char * | buffer, | ||
ZyanUSize | length, | ||
ZyanU64 | runtime_address | ||
) |
Formats the given instruction and writes it into the output buffer.
formatter | A pointer to the ZydisFormatter instance. |
instruction | A pointer to the ZydisDecodedInstruction struct. |
buffer | A pointer to the output buffer. |
length | The length of the output buffer (in characters). |
runtime_address | The runtime address of the instruction or ZYDIS_RUNTIME_ADDRESS_NONE to print relative addresses. |
ZYDIS_EXPORT ZyanStatus ZydisFormatterFormatInstructionEx | ( | const ZydisFormatter * | formatter, |
const ZydisDecodedInstruction * | instruction, | ||
char * | buffer, | ||
ZyanUSize | length, | ||
ZyanU64 | runtime_address, | ||
void * | user_data | ||
) |
Formats the given instruction and writes it into the output buffer.
formatter | A pointer to the ZydisFormatter instance. |
instruction | A pointer to the ZydisDecodedInstruction struct. |
buffer | A pointer to the output buffer. |
length | The length of the output buffer (in characters). |
runtime_address | The runtime address of the instruction or ZYDIS_RUNTIME_ADDRESS_NONE to print relative addresses. |
user_data | A pointer to user-defined data which can be used in custom formatter callbacks. |
ZYDIS_EXPORT ZyanStatus ZydisFormatterFormatOperand | ( | const ZydisFormatter * | formatter, |
const ZydisDecodedInstruction * | instruction, | ||
ZyanU8 | index, | ||
char * | buffer, | ||
ZyanUSize | length, | ||
ZyanU64 | runtime_address | ||
) |
Formats the given operand and writes it into the output buffer.
formatter | A pointer to the ZydisFormatter instance. |
instruction | A pointer to the ZydisDecodedInstruction struct. |
index | The index of the operand to format. |
buffer | A pointer to the output buffer. |
length | The length of the output buffer (in characters). |
runtime_address | The runtime address of the instruction or ZYDIS_RUNTIME_ADDRESS_NONE to print relative addresses. |
Use ZydisFormatterFormatInstruction
or ZydisFormatterFormatInstructionEx
to format a complete instruction.
ZYDIS_EXPORT ZyanStatus ZydisFormatterFormatOperandEx | ( | const ZydisFormatter * | formatter, |
const ZydisDecodedInstruction * | instruction, | ||
ZyanU8 | index, | ||
char * | buffer, | ||
ZyanUSize | length, | ||
ZyanU64 | runtime_address, | ||
void * | user_data | ||
) |
Formats the given operand and writes it into the output buffer.
formatter | A pointer to the ZydisFormatter instance. |
instruction | A pointer to the ZydisDecodedInstruction struct. |
index | The index of the operand to format. |
buffer | A pointer to the output buffer. |
length | The length of the output buffer (in characters). |
runtime_address | The runtime address of the instruction or ZYDIS_RUNTIME_ADDRESS_NONE to print relative addresses. |
user_data | A pointer to user-defined data which can be used in custom formatter callbacks. |
Use ZydisFormatterFormatInstruction
or ZydisFormatterFormatInstructionEx
to format a complete instruction.
ZYDIS_EXPORT ZyanStatus ZydisFormatterInit | ( | ZydisFormatter * | formatter, |
ZydisFormatterStyle | style | ||
) |
Initializes the given ZydisFormatter
instance.
formatter | A pointer to the ZydisFormatter instance. |
style | The base formatter style (either AT&T or Intel style). |
ZYDIS_EXPORT ZyanStatus ZydisFormatterSetHook | ( | ZydisFormatter * | formatter, |
ZydisFormatterFunction | type, | ||
const void ** | callback | ||
) |
Replaces a formatter function with a custom callback and/or retrieves the currently used function.
formatter | A pointer to the ZydisFormatter instance. |
type | The formatter function-type. |
callback | A pointer to a variable that contains the pointer of the callback function and receives the pointer of the currently used function. |
Call this function with callback
pointing to a ZYAN_NULL
value to retrieve the currently used function without replacing it.
This function returns ZYAN_STATUS_INVALID_OPERATION
if a function can't be replaced for the current formatter-style.
ZYDIS_EXPORT ZyanStatus ZydisFormatterSetProperty | ( | ZydisFormatter * | formatter, |
ZydisFormatterProperty | property, | ||
ZyanUPointer | value | ||
) |
Changes the value of the specified formatter property
.
formatter | A pointer to the ZydisFormatter instance. |
property | The id of the formatter-property. |
value | The new value. |
This function returns ZYAN_STATUS_INVALID_OPERATION
if a property can't be changed for the current formatter-style.
ZYDIS_EXPORT ZyanStatus ZydisFormatterTokenizeInstruction | ( | const ZydisFormatter * | formatter, |
const ZydisDecodedInstruction * | instruction, | ||
void * | buffer, | ||
ZyanUSize | length, | ||
ZyanU64 | runtime_address, | ||
ZydisFormatterTokenConst ** | token | ||
) |
Tokenizes the given instruction and writes it into the output buffer.
formatter | A pointer to the ZydisFormatter instance. |
instruction | A pointer to the ZydisDecodedInstruction struct. |
buffer | A pointer to the output buffer. |
length | The length of the output buffer (in bytes). |
runtime_address | The runtime address of the instruction or ZYDIS_RUNTIME_ADDRESS_NONE to print relative addresses. |
token | Receives a pointer to the first token in the output buffer. |
ZYDIS_EXPORT ZyanStatus ZydisFormatterTokenizeInstructionEx | ( | const ZydisFormatter * | formatter, |
const ZydisDecodedInstruction * | instruction, | ||
void * | buffer, | ||
ZyanUSize | length, | ||
ZyanU64 | runtime_address, | ||
ZydisFormatterTokenConst ** | token, | ||
void * | user_data | ||
) |
Tokenizes the given instruction and writes it into the output buffer.
formatter | A pointer to the ZydisFormatter instance. |
instruction | A pointer to the ZydisDecodedInstruction struct. |
buffer | A pointer to the output buffer. |
length | The length of the output buffer (in bytes). |
runtime_address | The runtime address of the instruction or ZYDIS_RUNTIME_ADDRESS_NONE to print relative addresses. |
token | Receives a pointer to the first token in the output buffer. |
user_data | A pointer to user-defined data which can be used in custom formatter callbacks. |
ZYDIS_EXPORT ZyanStatus ZydisFormatterTokenizeOperand | ( | const ZydisFormatter * | formatter, |
const ZydisDecodedInstruction * | instruction, | ||
ZyanU8 | index, | ||
void * | buffer, | ||
ZyanUSize | length, | ||
ZyanU64 | runtime_address, | ||
ZydisFormatterTokenConst ** | token | ||
) |
Tokenizes the given operand and writes it into the output buffer.
formatter | A pointer to the ZydisFormatter instance. |
instruction | A pointer to the ZydisDecodedInstruction struct. |
index | The index of the operand to format. |
buffer | A pointer to the output buffer. |
length | The length of the output buffer (in bytes). |
runtime_address | The runtime address of the instruction or ZYDIS_RUNTIME_ADDRESS_NONE to print relative addresses. |
token | Receives a pointer to the first token in the output buffer. |
Use ZydisFormatterTokenizeInstruction
or ZydisFormatterTokenizeInstructionEx
to tokenize a complete instruction.
ZYDIS_EXPORT ZyanStatus ZydisFormatterTokenizeOperandEx | ( | const ZydisFormatter * | formatter, |
const ZydisDecodedInstruction * | instruction, | ||
ZyanU8 | index, | ||
void * | buffer, | ||
ZyanUSize | length, | ||
ZyanU64 | runtime_address, | ||
ZydisFormatterTokenConst ** | token, | ||
void * | user_data | ||
) |
Tokenizes the given operand and writes it into the output buffer.
formatter | A pointer to the ZydisFormatter instance. |
instruction | A pointer to the ZydisDecodedInstruction struct. |
index | The index of the operand to format. |
buffer | A pointer to the output buffer. |
length | The length of the output buffer (in bytes). |
runtime_address | The runtime address of the instruction or ZYDIS_RUNTIME_ADDRESS_NONE to print relative addresses. |
token | Receives a pointer to the first token in the output buffer. |
user_data | A pointer to user-defined data which can be used in custom formatter callbacks. |
Use ZydisFormatterTokenizeInstruction
or ZydisFormatterTokenizeInstructionEx
to tokenize a complete instruction.