* Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE.
/** * Defines the `ZydisFormatterToken` struct. * * All fields in this struct should be considered as "private". Any changes may lead to unexpected * behavior.
*/ typedefstruct ZydisFormatterToken_
{ /** * The token type.
*/
ZydisTokenType type; /** * An offset to the next token, or `0`.
*/
ZyanU8 next;
} ZydisFormatterToken;
#pragmapack(pop)
/** * Defines the `ZydisFormatterTokenConst` data-type.
*/ typedefconst ZydisFormatterToken ZydisFormatterTokenConst;
/** * Defines the `ZydisFormatterBuffer` struct. * * All fields in this struct should be considered as "private". Any changes may * lead to unexpected behavior.
*/ typedefstruct ZydisFormatterBuffer_
{ /** * `ZYAN_TRUE`, if the buffer contains a token stream or `ZYAN_FALSE, if it * contains a simple string.
*/
ZyanBool is_token_list; /** * The remaining capacity of the buffer.
*/
ZyanUSize capacity; /** * The `ZyanString` instance that refers to the literal value of the most * recently added token.
*/
ZyanString string;
} ZydisFormatterBuffer;
/** * Returns the `type` and the string `value` of the given `token`. * * @param token A pointer to the `ZydisFormatterToken` struct. * @param type Receives the token type. * @param value Receives a pointer to the string value of the token. * * @return A zyan status code.
*/
ZYDIS_EXPORT ZyanStatus ZydisFormatterTokenGetValue(const ZydisFormatterToken* token,
ZydisTokenType* type, ZyanConstCharPointer* value);
/** * Obtains the next `token` linked to the passed one. * * @param token Receives a pointer to the next `ZydisFormatterToken` struct * linked to the passed one. * * @return A zyan status code.
*/
ZYDIS_EXPORT ZyanStatus ZydisFormatterTokenNext(ZydisFormatterTokenConst** token);
/** * Returns the current (most recently added) token. * * @param buffer A pointer to the `ZydisFormatterBuffer` struct. * @param token Receives a pointer to the current token. * * @return A zyan status code. * * This function returns `ZYAN_STATUS_INVALID_OPERATION`, if the buffer does not contain at least * one token.
*/
ZYDIS_EXPORT ZyanStatus ZydisFormatterBufferGetToken(const ZydisFormatterBuffer* buffer,
ZydisFormatterTokenConst** token);
/** * Returns the `ZyanString` instance associated with the given buffer. * * @param buffer A pointer to the `ZydisFormatterBuffer` struct. * @param string Receives a pointer to the `ZyanString` instance associated with the given * buffer. * * @return A zyan status code. * * 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 ZydisFormatterBufferGetString(ZydisFormatterBuffer* buffer,
ZyanString** string);
/** * Appends a new token to the `buffer`. * * @param buffer A pointer to the `ZydisFormatterBuffer` struct. * @param type The type of the new token. * * @return A zyan status code. * * Note that the `ZyanString` instance returned by `ZydisFormatterBufferGetString` will * automatically be updated by calling this function.
*/
ZYDIS_EXPORT ZyanStatus ZydisFormatterBufferAppend(ZydisFormatterBuffer* buffer,
ZydisTokenType type);
/** * Returns a snapshot of the buffer-state. * * @param buffer A pointer to the `ZydisFormatterBuffer` struct. * @param state Receives a snapshot of the buffer-state. * * @return A zyan status code. * * 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 ZydisFormatterBufferRemember(const ZydisFormatterBuffer* buffer,
ZyanUPointer* state);
/** * Restores a previously saved buffer-state. * * @param buffer A pointer to the `ZydisFormatterBuffer` struct. * @param state The buffer-state to restore. * * @return A zyan status code. * * 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 ZydisFormatterBufferRestore(ZydisFormatterBuffer* buffer,
ZyanUPointer state);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.