Zydis
master
|
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, force_leading_number) |
Appends an unsigned numeric value to the given string. More... | |
#define | ZYDIS_STRING_APPEND_NUM_S(formatter, base, str, value, padding_length, force_leading_number, 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_leading_number, | |||
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 to append. |
padding_length | The padding length. |
force_leading_number | Enable this option to prepend a leading 0 , if the first character is non-numeric. |
force_sign | Enable to print the '+' sign for positive numbers. |
#define ZYDIS_STRING_APPEND_NUM_U | ( | formatter, | |
base, | |||
str, | |||
value, | |||
padding_length, | |||
force_leading_number | |||
) |
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 to append. |
padding_length | The padding length. |
force_leading_number | Enable this option to prepend a leading 0 if the first character is non-numeric. |
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, | ||
const ZydisDecodedOperand * | operand | ||
) |
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. |
operand | 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
.