27 #ifndef ZYDIS_STRING_H
28 #define ZYDIS_STRING_H
134 #define ZYDIS_MAKE_STRING(string) \
135 { (char*)string, sizeof(string) - 1, sizeof(string) - 1 }
142 #define ZYDIS_MAKE_STATIC_STRING(string) \
143 { string, sizeof(string) - 1 }
165 if (!
string || !value)
171 string->buffer = value;
172 string->length = length;
173 string->capacity = length;
196 string->buffer[
string->length] = 0;
253 if (!text || !text->
buffer)
312 if (!text || !text->
buffer)
Includes and defines some default datatypes.
uint64_t ZydisU64
Definition: CommonTypes.h:48
uint8_t ZydisU8
Definition: CommonTypes.h:45
int64_t ZydisI64
Definition: CommonTypes.h:52
ZydisU8 ZydisBool
@briefs Defines the ZydisBool datatype.
Definition: CommonTypes.h:133
size_t ZydisUSize
Definition: CommonTypes.h:53
#define ZYDIS_INLINE
Definition: Defines.h:121
#define ZydisStrLen
Definition: LibC.h:41
Status code definitions and check macros.
@ ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE
A buffer passed to a function was too small to complete the requested operation.
Definition: Status.h:74
@ ZYDIS_STATUS_SUCCESS
The operation completed successfully.
Definition: Status.h:62
@ ZYDIS_STATUS_INVALID_PARAMETER
An invalid parameter was passed to a function.
Definition: Status.h:66
ZydisU32 ZydisStatus
Defines the ZydisStatus datatype.
Definition: Status.h:48
#define ZYDIS_CHECK(status)
Checks if a zydis operation was successfull and returns the status-code, if not.
Definition: Status.h:164
ZYDIS_NO_EXPORT ZydisStatus ZydisPrintHexU(ZydisString *string, ZydisU64 value, ZydisU8 paddingLength, ZydisBool uppercase, const ZydisString *prefix, const ZydisString *suffix)
Formats the given unsigned ordinal value to its hexadecimal text-representation and appends it to the...
ZYDIS_NO_EXPORT ZYDIS_INLINE ZydisStatus ZydisStringAppend(ZydisString *string, const ZydisString *text)
Appends a ZydisString to another ZydisString.
Definition: String.h:275
ZYDIS_NO_EXPORT ZYDIS_INLINE ZydisStatus ZydisStringInit(ZydisString *string, char *value)
Initializes a ZydisString struct with a C-string.
Definition: String.h:163
ZYDIS_NO_EXPORT ZydisStatus ZydisPrintDecU(ZydisString *string, ZydisU64 value, ZydisU8 paddingLength)
Formats the given unsigned ordinal value to its decimal text-representation and appends it to s.
ZYDIS_NO_EXPORT ZYDIS_INLINE ZydisStatus ZydisStringAppendExC(ZydisString *string, const char *text, ZydisLetterCase letterCase)
Appends the given C-string to a ZydisString, converting it to the specified letter-case.
Definition: String.h:229
ZydisU8 ZydisLetterCase
Defines the ZydisLetterCase datatype.
Definition: String.h:93
ZYDIS_NO_EXPORT ZYDIS_INLINE ZydisStatus ZydisStringAppendStatic(ZydisString *string, const ZydisStaticString *text, ZydisLetterCase letterCase)
Appends the given 'ZydisStaticString' to a ZydisString.
Definition: String.h:309
ZYDIS_NO_EXPORT ZYDIS_INLINE ZydisStatus ZydisStringFinalize(ZydisString *string)
Finalizes a ZydisString struct by adding a terminating zero byte.
Definition: String.h:185
struct ZydisStaticString_ ZydisStaticString
Defines the ZydisStaticString struct.
ZYDIS_NO_EXPORT ZydisStatus ZydisPrintDecS(ZydisString *string, ZydisI64 value, ZydisU8 paddingLength)
Formats the given signed ordinal value to its decimal text-representation and appends it to s.
ZYDIS_NO_EXPORT ZYDIS_INLINE ZydisStatus ZydisStringAppendExStatic(ZydisString *string, const ZydisStaticString *text, ZydisLetterCase letterCase)
Appends the given 'ZydisStaticString' to a ZydisString, converting it to the specified letter-case.
Definition: String.h:250
ZYDIS_NO_EXPORT ZYDIS_INLINE ZydisStatus ZydisStringAppendC(ZydisString *string, const char *text)
Appends the given C-string to a ZydisString.
Definition: String.h:291
ZydisLetterCases
Values that represent letter cases.
Definition: String.h:99
@ ZYDIS_LETTER_CASE_UPPER
Converts the given text to uppercase letters.
Definition: String.h:111
@ ZYDIS_LETTER_CASE_MAX_VALUE
Maximum value of this enum.
Definition: String.h:116
@ ZYDIS_LETTER_CASE_DEFAULT
Uses the given text "as is".
Definition: String.h:103
@ ZYDIS_LETTER_CASE_LOWER
Converts the given text to lowercase letters.
Definition: String.h:107
ZYDIS_NO_EXPORT ZydisStatus ZydisStringAppendEx(ZydisString *string, const ZydisString *text, ZydisLetterCase letterCase)
Appends a ZydisString to another ZydisString, converting it to the specified letter-case.
struct ZydisString_ ZydisString
Defines the ZydisString struct.
ZYDIS_NO_EXPORT ZydisStatus ZydisPrintHexS(ZydisString *string, ZydisI64 value, ZydisU8 paddingLength, ZydisBool uppercase, const ZydisString *prefix, const ZydisString *suffix)
Formats the given signed ordinal value to its hexadecimal text-representation and appends it to the b...
Defines the ZydisStaticString struct.
Definition: String.h:73
ZydisU8 length
The length of the string (without 0-termination).
Definition: String.h:81
const char * buffer
The buffer that contains the actual string (0-termination is optional!).
Definition: String.h:77
Defines the ZydisString struct.
Definition: String.h:46
ZydisUSize length
The length of the string (without 0-termination).
Definition: String.h:54
ZydisUSize capacity
The total buffer capacity.
Definition: String.h:58
char * buffer
The buffer that contains the actual string (0-termination is optional!).
Definition: String.h:50