Zydis v4.0.0
|
Implements the ZydisFormatterToken
type and provides functions to use it.
More...
#include <Zycore/String.h>
#include <Zycore/Types.h>
#include <Zydis/Defines.h>
#include <Zydis/Status.h>
Go to the source code of this file.
Data Structures | |
struct | ZydisFormatterToken_ |
Defines the ZydisFormatterToken struct. More... | |
struct | ZydisFormatterBuffer_ |
Defines the ZydisFormatterBuffer struct. More... | |
Typedefs | |
typedef ZyanU8 | ZydisTokenType |
Defines the ZydisTokenType data-type. | |
typedef struct ZydisFormatterToken_ | ZydisFormatterToken |
Defines the ZydisFormatterToken struct. More... | |
typedef const ZydisFormatterToken | ZydisFormatterTokenConst |
Defines the ZydisFormatterTokenConst data-type. | |
typedef struct ZydisFormatterBuffer_ | ZydisFormatterBuffer |
Defines the ZydisFormatterBuffer struct. More... | |
Functions | |
ZYDIS_EXPORT ZyanStatus | ZydisFormatterTokenGetValue (const ZydisFormatterToken *token, ZydisTokenType *type, ZyanConstCharPointer *value) |
Returns the type and the string value of the given token . More... | |
ZYDIS_EXPORT ZyanStatus | ZydisFormatterTokenNext (ZydisFormatterTokenConst **token) |
Obtains the next token linked to the passed one. More... | |
ZYDIS_EXPORT ZyanStatus | ZydisFormatterBufferGetToken (const ZydisFormatterBuffer *buffer, ZydisFormatterTokenConst **token) |
Returns the current (most recently added) token. More... | |
ZYDIS_EXPORT ZyanStatus | ZydisFormatterBufferGetString (ZydisFormatterBuffer *buffer, ZyanString **string) |
Returns the ZyanString instance associated with the given buffer. More... | |
ZYDIS_EXPORT ZyanStatus | ZydisFormatterBufferAppend (ZydisFormatterBuffer *buffer, ZydisTokenType type) |
Appends a new token to the buffer . More... | |
ZYDIS_EXPORT ZyanStatus | ZydisFormatterBufferRemember (const ZydisFormatterBuffer *buffer, ZyanUPointer *state) |
Returns a snapshot of the buffer-state. More... | |
ZYDIS_EXPORT ZyanStatus | ZydisFormatterBufferRestore (ZydisFormatterBuffer *buffer, ZyanUPointer state) |
Restores a previously saved buffer-state. More... | |
Implements the ZydisFormatterToken
type and provides functions to use it.
typedef struct ZydisFormatterBuffer_ ZydisFormatterBuffer |
Defines the ZydisFormatterBuffer
struct.
All fields in this struct should be considered as "private". Any changes may lead to unexpected behavior.
typedef struct ZydisFormatterToken_ ZydisFormatterToken |
Defines the ZydisFormatterToken
struct.
All fields in this struct should be considered as "private". Any changes may lead to unexpected behavior.
ZYDIS_EXPORT ZyanStatus ZydisFormatterBufferAppend | ( | ZydisFormatterBuffer * | buffer, |
ZydisTokenType | type | ||
) |
Appends a new token to the buffer
.
buffer | A pointer to the ZydisFormatterBuffer struct. |
type | The type of the new token. |
Note that the ZyanString
instance returned by ZydisFormatterBufferGetString
will automatically be updated by calling this function.
ZYDIS_EXPORT ZyanStatus ZydisFormatterBufferGetString | ( | ZydisFormatterBuffer * | buffer, |
ZyanString ** | string | ||
) |
Returns the ZyanString
instance associated with the given buffer.
buffer | A pointer to the ZydisFormatterBuffer struct. |
string | Receives a pointer to the ZyanString instance associated with the given buffer. |
This function returns ZYAN_STATUS_INVALID_OPERATION
, if the buffer does not contain at least one token.
The returned string always refers to the literal value of the current (most recently added) token and will remain valid until the buffer is destroyed.
ZYDIS_EXPORT ZyanStatus ZydisFormatterBufferGetToken | ( | const ZydisFormatterBuffer * | buffer, |
ZydisFormatterTokenConst ** | token | ||
) |
Returns the current (most recently added) token.
buffer | A pointer to the ZydisFormatterBuffer struct. |
token | Receives a pointer to the current token. |
This function returns ZYAN_STATUS_INVALID_OPERATION
, if the buffer does not contain at least one token.
ZYDIS_EXPORT ZyanStatus ZydisFormatterBufferRemember | ( | const ZydisFormatterBuffer * | buffer, |
ZyanUPointer * | state | ||
) |
Returns a snapshot of the buffer-state.
buffer | A pointer to the ZydisFormatterBuffer struct. |
state | Receives a snapshot of the buffer-state. |
Note that the buffer-state is saved inside the buffer itself and thus becomes invalid as soon as the buffer gets overwritten or destroyed.
ZYDIS_EXPORT ZyanStatus ZydisFormatterBufferRestore | ( | ZydisFormatterBuffer * | buffer, |
ZyanUPointer | state | ||
) |
Restores a previously saved buffer-state.
buffer | A pointer to the ZydisFormatterBuffer struct. |
state | The buffer-state to restore. |
All tokens added after obtaining the given state
snapshot will be removed. This function does NOT restore any string content.
Note that the ZyanString
instance returned by ZydisFormatterBufferGetString
will automatically be updated by calling this function.
ZYDIS_EXPORT ZyanStatus ZydisFormatterTokenGetValue | ( | const ZydisFormatterToken * | token, |
ZydisTokenType * | type, | ||
ZyanConstCharPointer * | value | ||
) |
Returns the type
and the string value
of the given token
.
token | A pointer to the ZydisFormatterToken struct. |
type | Receives the token type. |
value | Receives a pointer to the string value of the token. |
ZYDIS_EXPORT ZyanStatus ZydisFormatterTokenNext | ( | ZydisFormatterTokenConst ** | token | ) |
Obtains the next token
linked to the passed one.
token | Receives a pointer to the next ZydisFormatterToken struct linked to the passed one. |