Zydis
v3.2.0
|
Provides formatter functions that are shared between the different formatters. More...
Go to the source code of this file.
Data Structures | |
struct | ZydisPredefinedToken_ |
Macros | |
#define | ZYDIS_STRING_APPEND_NUM_U(formatter, base, str, value, padding_length) |
Appends an unsigned numeric value to the given string. More... | |
#define | ZYDIS_STRING_APPEND_NUM_S(formatter, base, str, value, padding_length, force_sign) |
Appends a signed numeric value to the given string. More... | |
#define | ZYDIS_BUFFER_APPEND_TOKEN(buffer, type) |
Invokes the ZydisFormatterBufferAppend routine, if tokenization is enabled for the current pass. More... | |
#define | ZYDIS_BUFFER_REMEMBER(buffer, state) |
Returns a snapshot of the buffer-state. More... | |
#define | ZYDIS_BUFFER_APPEND(buffer, name) |
Appends a string (STR_ -prefix) or a predefined token-list (TOK_ -prefix). More... | |
#define | ZYDIS_BUFFER_APPEND_CASE(buffer, name, letter_case) |
Appends a string (STR_ -prefix) or a predefined token-list (TOK_ -prefix). More... | |
Typedefs | |
typedef struct ZydisPredefinedToken_ | ZydisPredefinedToken |
Provides formatter functions that are shared between the different formatters.
#define ZYDIS_BUFFER_APPEND | ( | buffer, | |
name | |||
) |
Appends a string (STR_
-prefix) or a predefined token-list (TOK_
-prefix).
buffer | A pointer to the ZydisFormatterBuffer struct. |
name | The base name (without prefix) of the string- or token. |
#define ZYDIS_BUFFER_APPEND_CASE | ( | buffer, | |
name, | |||
letter_case | |||
) |
Appends a string (STR_
-prefix) or a predefined token-list (TOK_
-prefix).
buffer | A pointer to the ZydisFormatterBuffer struct. |
name | The base name (without prefix) of the string- or token. |
letter-case | The desired letter-case. |
#define ZYDIS_BUFFER_APPEND_TOKEN | ( | buffer, | |
type | |||
) |
Invokes the ZydisFormatterBufferAppend
routine, if tokenization is enabled for the current pass.
buffer | A pointer to the ZydisFormatterBuffer struct. |
type | The token type. |
Using this macro instead of direct calls to ZydisFormatterBufferAppend
greatly improves the performance for non-tokenizing passes.
#define ZYDIS_BUFFER_REMEMBER | ( | buffer, | |
state | |||
) |
Returns a snapshot of the buffer-state.
buffer | A pointer to the ZydisFormatterBuffer struct. |
state | Receives a snapshot of the buffer-state. |
Using this macro instead of direct calls to ZydisFormatterBufferRemember
improves the performance for non-tokenizing passes.
#define ZYDIS_STRING_APPEND_NUM_S | ( | formatter, | |
base, | |||
str, | |||
value, | |||
padding_length, | |||
force_sign | |||
) |
Appends a signed numeric value to the given string.
formatter | A pointer to the ZydisFormatter instance. |
base | The numeric base. |
str | The destination string. |
value | The value. |
padding_length | The padding length. |
force_sign | Forces printing of the '+' sign for positive numbers. |
#define ZYDIS_STRING_APPEND_NUM_U | ( | formatter, | |
base, | |||
str, | |||
value, | |||
padding_length | |||
) |
Appends an unsigned numeric value to the given string.
formatter | A pointer to the ZydisFormatter instance. |
base | The numeric base. |
str | The destination string. |
value | The value. |
padding_length | The padding length. |
typedef struct ZydisPredefinedToken_ ZydisPredefinedToken |
ZyanStatus ZydisFormatterBaseFormatOperandIMM | ( | const ZydisFormatter * | formatter, |
ZydisFormatterBuffer * | buffer, | ||
ZydisFormatterContext * | context | ||
) |
ZyanStatus ZydisFormatterBaseFormatOperandPTR | ( | const ZydisFormatter * | formatter, |
ZydisFormatterBuffer * | buffer, | ||
ZydisFormatterContext * | context | ||
) |
ZyanStatus ZydisFormatterBaseFormatOperandREG | ( | const ZydisFormatter * | formatter, |
ZydisFormatterBuffer * | buffer, | ||
ZydisFormatterContext * | context | ||
) |
ZyanStatus ZydisFormatterBasePrintAddressABS | ( | const ZydisFormatter * | formatter, |
ZydisFormatterBuffer * | buffer, | ||
ZydisFormatterContext * | context | ||
) |
ZyanStatus ZydisFormatterBasePrintAddressREL | ( | const ZydisFormatter * | formatter, |
ZydisFormatterBuffer * | buffer, | ||
ZydisFormatterContext * | context | ||
) |
ZyanStatus ZydisFormatterBasePrintDecorator | ( | const ZydisFormatter * | formatter, |
ZydisFormatterBuffer * | buffer, | ||
ZydisFormatterContext * | context, | ||
ZydisDecorator | decorator | ||
) |
ZyanStatus ZydisFormatterBasePrintIMM | ( | const ZydisFormatter * | formatter, |
ZydisFormatterBuffer * | buffer, | ||
ZydisFormatterContext * | context | ||
) |
ZyanStatus ZydisFormatterBasePrintPrefixes | ( | const ZydisFormatter * | formatter, |
ZydisFormatterBuffer * | buffer, | ||
ZydisFormatterContext * | context | ||
) |
ZyanStatus ZydisFormatterBasePrintSegment | ( | const ZydisFormatter * | formatter, |
ZydisFormatterBuffer * | buffer, | ||
ZydisFormatterContext * | context | ||
) |
ZYAN_INLINE ZyanStatus ZydisFormatterBufferAppendPredefined | ( | ZydisFormatterBuffer * | buffer, |
const ZydisPredefinedToken * | data | ||
) |
Appends a predefined token-list to the buffer
.
buffer | A pointer to the ZydisFormatterBuffer struct. |
data | A pointer to the ZydisPredefinedToken struct. |
This function is internally used to improve performance while adding static strings or multiple tokens at once.
ZyanU32 ZydisFormatterHelperGetExplicitSize | ( | const ZydisFormatter * | formatter, |
ZydisFormatterContext * | context, | ||
ZyanU8 | memop_id | ||
) |
Returns the size to be used as explicit size suffix (AT&T
) or explicit typecast (INTEL
), if required.
formatter | A pointer to the ZydisFormatter instance. |
context | A pointer to the ZydisFormatterContext struct. |
memop_id | The operand-id of the instructions first memory operand. |
0
, if not needed.This function always returns a size different to 0
, if the ZYDIS_FORMATTER_PROP_FORCE_SIZE
is set to ZYAN_TRUE
.