repo_name
string
dataset
string
owner
string
lang
string
func_name
string
code
string
docstring
string
url
string
sha
string
BugChecker
github_2023
vitoplantamura
c
js___date_now
static JSValue js___date_now(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv) { int64_t d; struct timeval tv; gettimeofday(&tv, NULL); d = (int64_t)tv.tv_sec * 1000 + (tv.tv_usec / 1000); return JS_NewInt64(ctx, d); }
/* OS dependent: return the UTC time in ms since 1970. */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/BugChecker/QuickJS/quickjs.c#L42439-L42447
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
js___date_create
static JSValue js___date_create(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv) { JSValue obj, proto; proto = js_get_prototype_from_ctor(ctx, argv[0], argv[1]); if (JS_IsException(proto)) return proto; obj = JS_NewObjectProtoClass(ctx, proto, ...
/* create a new date object */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/BugChecker/QuickJS/quickjs.c#L42538-L42550
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
js_operator_set_finalizer
static void js_operator_set_finalizer(JSRuntime *rt, JSValue val) { JSOperatorSetData *opset = JS_GetOpaque(val, JS_CLASS_OPERATOR_SET); int i, j; JSBinaryOperatorDefEntry *ent; if (opset) { for(i = 0; i < JS_OVOP_COUNT; i++) { if (opset->self_ops[i]) JS_FreeValueRT(...
/* Operators */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/BugChecker/QuickJS/quickjs.c#L49283-L49312
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
js_operators_create_internal
static JSValue js_operators_create_internal(JSContext *ctx, int argc, JSValueConst *argv, BOOL is_primitive) { JSValue opset_obj, prop, obj; JSOperatorSetData *opset, *opset1; JSBinaryOperatorDef *def; JSValueConst a...
/* create an OperatorSet object */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/BugChecker/QuickJS/quickjs.c#L49348-L49452
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
JS_AddIntrinsicOperators
void JS_AddIntrinsicOperators(JSContext *ctx) { JSValue obj; ctx->allow_operator_overloading = TRUE; obj = JS_NewCFunction(ctx, js_global_operators, "Operators", 1); JS_SetPropertyFunctionList(ctx, obj, js_operators_funcs, countof(js_operato...
/* must be called after all overloadable base types are initialized */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/BugChecker/QuickJS/quickjs.c#L49558-L49577
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
JS_ToBigIntCtorFree
static JSValue JS_ToBigIntCtorFree(JSContext *ctx, JSValue val) { uint32_t tag; redo: tag = JS_VALUE_GET_NORM_TAG(val); switch(tag) { case JS_TAG_INT: case JS_TAG_BOOL: val = JS_NewBigInt64(ctx, JS_VALUE_GET_INT(val)); break; case JS_TAG_BIG_INT: break; case JS_TAG_...
/* BigInt */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/BugChecker/QuickJS/quickjs.c#L49581-L49649
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
js_thisBigFloatValue
static JSValue js_thisBigFloatValue(JSContext *ctx, JSValueConst this_val) { if (JS_IsBigFloat(this_val)) return JS_DupValue(ctx, this_val); if (JS_VALUE_GET_TAG(this_val) == JS_TAG_OBJECT) { JSObject *p = JS_VALUE_GET_OBJ(this_val); if (p->class_id == JS_CLASS_BIG_FLOAT) { ...
/* BigFloat */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/BugChecker/QuickJS/quickjs.c#L49922-L49935
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
js_float_env_constructor
static JSValue js_float_env_constructor(JSContext *ctx, JSValueConst new_target, int argc, JSValueConst *argv) { JSValue obj; JSFloatEnv *fe; int64_t prec; int flags, rndmode; prec = ctx->fp_env.prec; flags = ctx->f...
/* FloatEnv */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/BugChecker/QuickJS/quickjs.c#L50584-L50621
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
JS_ToBigDecimalFree
static JSValue JS_ToBigDecimalFree(JSContext *ctx, JSValue val, BOOL allow_null_or_undefined) { redo: switch(JS_VALUE_GET_NORM_TAG(val)) { case JS_TAG_BIG_DECIMAL: break; case JS_TAG_NULL: if (!allow_null_or_undefined) goto fail; /* fal...
/* BigDecimal */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/BugChecker/QuickJS/quickjs.c#L50831-L50925
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
js_typed_array___getLength
static JSValue js_typed_array___getLength(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv) { BOOL ignore_detached = JS_ToBool(ctx, argv[1]); if (ignore_detached) { return js_typed_array_get_length(ct...
/* validate a typed array and return its length */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/BugChecker/QuickJS/quickjs.c#L52203-L52218
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
JS_GetObjectClassName
JSValue JS_GetObjectClassName(JSContext *ctx, JSValueConst obj) { JSValue ctor = JS_GetProperty(ctx, obj, JS_ATOM_constructor); JSObject *p; if (JS_VALUE_GET_TAG(ctor) != JS_TAG_OBJECT) goto fail; p = JS_VALUE_GET_OBJ(ctor); if (p->class_id != JS_CLASS_BYTECODE_FUNCTION) goto fail; JSValue name = ...
/* get name of user's class. For this obj: class Account {} var obj = new Account(); it will return "Account" */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/BugChecker/QuickJS/quickjs.c#L54719-L54737
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
JS_GetLocalValue
JSValue JS_GetLocalValue(JSContext *ctx, JSAtom name) { for (JSStackFrame *sf = ctx->rt->current_stack_frame; sf != NULL; sf = sf->prev_frame) { JSObject *f = JS_VALUE_GET_OBJ(sf->cur_func); if (!f || !js_class_has_bytecode(f->class_id)) break; JSFunctionBytecode *b = f->u.func.function_bytecode; ...
/* get value defined in local call frames/namespaces */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/BugChecker/QuickJS/quickjs.c#L54741-L54767
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
RestrictTest
static size_t RestrictTest(char* EA_RESTRICT p) { return sizeof(p); }
// Should fail. //static_assert(sizeof(int32_t) == 8, "static_assert failure");
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/EABase/test/source/TestEABaseC.c#L228-L231
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
EAMain
int EAMain(int argc, char** argv) { int nErrorCount = 0, nTotalErrorCount = 0; (void)argc; (void)argv; nErrorCount = TestEABase(); Printf("EABase test error count: %d\n\n", nErrorCount); nTotalErrorCount += nErrorCount; nErrorCount = TestEAPlatform(); Printf("EAPlatform test error count: %d\n\n", nErrorCount...
// The test below should cause compilation to fail if it is uncommented. However we can't // obviously enable the test because it will break the build. It should be tested manually // if changes to EA_IS_ENABLED are made. // // #if EA_IS_ENABLED(EABASE_TEST_FEATURE_WITH_NO_DEFINE) // #endif
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/EABase/test/source/TestEABaseC.c#L1184-L1213
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
PerformBasicTests
static ZyanStatus PerformBasicTests(ZyanString* string) { ZYAN_ASSERT(string); ZYAN_UNUSED(string); return ZYAN_STATUS_SUCCESS; }
/* ============================================================================================== */ /* Enums and types */ /* ============================================================================================== */ /* ==============...
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/examples/String.c#L63-L71
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
TestDynamic
static ZyanStatus TestDynamic(void) { PerformBasicTests(ZYAN_NULL); return ZYAN_STATUS_SUCCESS; }
/** * Performs basic tests on a string that dynamically manages memory. * * @return A zyan status code. */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/examples/String.c#L78-L82
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
TestStatic
static ZyanStatus TestStatic(void) { PerformBasicTests(ZYAN_NULL); return ZYAN_STATUS_SUCCESS; }
/** * Performs basic tests on a string that uses a static buffer. * * @return A zyan status code. */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/examples/String.c#L89-L93
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
TestAllocator
static ZyanStatus TestAllocator(void) { return ZYAN_STATUS_SUCCESS; }
/* ---------------------------------------------------------------------------------------------- */ /* Custom allocator */ /* ---------------------------------------------------------------------------------------------- */ //static ZyanStat...
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/examples/String.c#L163-L166
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
main
int main() { if (!ZYAN_SUCCESS(TestDynamic())) { return EXIT_FAILURE; } if (!ZYAN_SUCCESS(TestStatic())) { return EXIT_FAILURE; } if (!ZYAN_SUCCESS(TestAllocator())) { return EXIT_FAILURE; } return EXIT_SUCCESS; }
/* ---------------------------------------------------------------------------------------------- */ /* ============================================================================================== */ /* Entry point */ /* ==============...
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/examples/String.c#L174-L190
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
InitTestdata
static void InitTestdata(TestStruct* data, ZyanU32 n) { ZYAN_ASSERT(data); data->u32 = n; data->u64 = n; data->f = (float)n; }
/* ============================================================================================== */ /* Helper functions */ /* ============================================================================================== */ /** * Initialize...
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/examples/Vector.c#L65-L72
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
PerformBasicTests
static ZyanStatus PerformBasicTests(ZyanVector* vector) { ZYAN_ASSERT(vector); static TestStruct e_v; static const TestStruct* e_p; // Insert `20` elements. The vector automatically manages its size for (ZyanU32 i = 0; i < 20; ++i) { InitTestdata(&e_v, i); ZYAN_CHECK(Zya...
/* ============================================================================================== */ /* Tests */ /* ============================================================================================== */ /* --------------...
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/examples/Vector.c#L89-L131
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
TestDataComparison
static ZyanI32 TestDataComparison(const TestStruct* left, const TestStruct* right) { ZYAN_ASSERT(left); ZYAN_ASSERT(right); if (left->u32 < right->u32) { return -1; } if (left->u32 > right->u32) { return 1; } return 0; }
/** * A dummy comparison function for the `TestStruct` that uses the `u32` field as key * value. * * @param left A pointer to the first element. * @param right A pointer to the second element. * * @return Returns values in the following range: * `left == right -> result == 0` * `lef...
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/examples/Vector.c#L145-L159
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
PerformBinarySearchTest
static ZyanStatus PerformBinarySearchTest(ZyanVector* vector) { ZYAN_ASSERT(vector); static TestStruct e_v; static const TestStruct* e_p; ZyanUSize value; ZYAN_CHECK(ZyanVectorGetCapacity(vector, &value)); // Create a sorted test vector for (ZyanUSize i = 0; i < value; ++i) { ...
/** * Tests the binary-search functionality of the given `ZyanVector` instance. * * @param vector A pointer to the `ZyanVector` instance. * * @return A zyan status code. */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/examples/Vector.c#L168-L200
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
TestDynamic
static ZyanStatus TestDynamic(void) { // Initialize vector with a base capacity of `10` elements ZyanVector vector; ZYAN_CHECK(ZyanVectorInit(&vector, sizeof(TestStruct), 10, ZYAN_NULL)); ZYAN_CHECK(PerformBasicTests(&vector)); ZYAN_CHECK(ZyanVectorClear(&vector)); ZYAN_CHECK(ZyanVectorReserve(...
/** * Performs basic tests on a vector that dynamically manages memory. * * @return A zyan status code. */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/examples/Vector.c#L207-L220
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
TestStatic
static ZyanStatus TestStatic(void) { static TestStruct buffer[20]; // Initialize vector to use a static buffer with a total capacity of `20` elements. ZyanVector vector; ZYAN_CHECK(ZyanVectorInitCustomBuffer(&vector, sizeof(TestStruct), buffer, ZYAN_ARRAY_LENGTH(buffer), ZYAN_NULL)); // Co...
/** * Performs basic tests on a vector that uses a static buffer. * * @return A zyan status code. */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/examples/Vector.c#L227-L255
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
AllocatorAllocate
static ZyanStatus AllocatorAllocate(ZyanAllocator* allocator, void** p, ZyanUSize element_size, ZyanUSize n) { ZYAN_ASSERT(allocator); ZYAN_ASSERT(p); ZYAN_ASSERT(element_size); ZYAN_ASSERT(n); ZYAN_UNUSED(allocator); *p = ZYAN_MALLOC(element_size * n); if (!*p) { return ZY...
/* ---------------------------------------------------------------------------------------------- */ /* Custom allocator */ /* ---------------------------------------------------------------------------------------------- */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/examples/Vector.c#L261-L278
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
TestAllocator
static ZyanStatus TestAllocator(void) { ZyanAllocator allocator; ZYAN_CHECK(ZyanAllocatorInit(&allocator, &AllocatorAllocate, &AllocatorReallocate, &AllocatorDeallocate)); // Initialize vector with a base capacity of `10` elements. Growth-factor is set to 10 and // dynamic shrinking is disabled...
/* ---------------------------------------------------------------------------------------------- */ /** * Performs basic tests on a vector that dynamically manages memory using a custom * allocator and modified growth-factor/shrink-threshold. * * @return A zyan status code. */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/examples/Vector.c#L325-L366
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
main
int main() { time_t t; srand((unsigned)time(&t)); if (!ZYAN_SUCCESS(TestDynamic())) { return EXIT_FAILURE; } if (!ZYAN_SUCCESS(TestStatic())) { return EXIT_FAILURE; } if (!ZYAN_SUCCESS(TestAllocator())) { return EXIT_FAILURE; } return EXIT_SUCCES...
/* ---------------------------------------------------------------------------------------------- */ /* ============================================================================================== */ /* Entry point */ /* ==============...
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/examples/Vector.c#L374-L393
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanAllocatorInit
ZyanStatus ZyanAllocatorInit(ZyanAllocator* allocator, ZyanAllocatorAllocate allocate, ZyanAllocatorAllocate reallocate, ZyanAllocatorDeallocate deallocate) { if (!allocator || !allocate || !reallocate || !deallocate) { return ZYAN_STATUS_INVALID_ARGUMENT; } allocator->allocate = allocate...
// ZYAN_NO_LIBC /* ---------------------------------------------------------------------------------------------- */ /* ============================================================================================== */ /* Exported functions */ /...
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/Allocator.c#L104-L117
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanBitsetInitVectorElements
static ZyanStatus ZyanBitsetInitVectorElements(ZyanVector* vector, ZyanUSize count) { ZYAN_ASSERT(vector); static const ZyanU8 zero = 0; for (ZyanUSize i = 0; i < count; ++i) { ZYAN_CHECK(ZyanVectorPushBack(vector, &zero)); } return ZYAN_STATUS_SUCCESS; }
/* ============================================================================================== */ /* Internal functions */ /* ============================================================================================== */ /* --------------...
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/Bitset.c#L87-L98
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanBitsetOperationAND
static ZyanStatus ZyanBitsetOperationAND(ZyanU8* b1, const ZyanU8* b2) { *b1 &= *b2; return ZYAN_STATUS_SUCCESS; }
/* ---------------------------------------------------------------------------------------------- */ /* Byte operations */ /* ---------------------------------------------------------------------------------------------- */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/Bitset.c#L104-L108
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanBitsetInitEx
ZyanStatus ZyanBitsetInitEx(ZyanBitset* bitset, ZyanUSize count, ZyanAllocator* allocator, ZyanU8 growth_factor, ZyanU8 shrink_threshold) { if (!bitset) { return ZYAN_STATUS_INVALID_ARGUMENT; } const ZyanU32 bytes = ZYAN_BITSET_BITS_TO_BYTES(count); bitset->size = count; ZYAN_CHECK...
// ZYAN_NO_LIBC
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/Bitset.c#L142-L158
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanBitsetPerformByteOperation
ZyanStatus ZyanBitsetPerformByteOperation(ZyanBitset* destination, const ZyanBitset* source, ZyanBitsetByteOperation operation) { if (!destination || !source || !operation) { return ZYAN_STATUS_INVALID_ARGUMENT; } ZyanUSize s1; ZyanUSize s2; ZYAN_CHECK(ZyanVectorGetSize(&destination...
/* ---------------------------------------------------------------------------------------------- */ /* Logical operations */ /* ---------------------------------------------------------------------------------------------- */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/Bitset.c#L196-L224
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanBitsetSet
ZyanStatus ZyanBitsetSet(ZyanBitset* bitset, ZyanUSize index) { if (!bitset) { return ZYAN_STATUS_INVALID_ARGUMENT; } if (index >= bitset->size) { return ZYAN_STATUS_OUT_OF_RANGE; } ZyanU8* value; ZYAN_CHECK(ZyanVectorGetPointerMutable(&bitset->bits, index / 8, (void**)&...
/* ---------------------------------------------------------------------------------------------- */ /* Bit access */ /* ---------------------------------------------------------------------------------------------- */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/Bitset.c#L264-L281
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanBitsetSetAll
ZyanStatus ZyanBitsetSetAll(ZyanBitset* bitset) { if (!bitset) { return ZYAN_STATUS_INVALID_ARGUMENT; } ZyanUSize size; ZYAN_CHECK(ZyanVectorGetSize(&bitset->bits, &size)); for (ZyanUSize i = 0; i < size; ++i) { ZyanU8* value; ZYAN_CHECK(ZyanVectorGetPointerMutable(&...
/* ---------------------------------------------------------------------------------------------- */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/Bitset.c#L365-L382
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanBitsetPush
ZyanStatus ZyanBitsetPush(ZyanBitset* bitset, ZyanBool value) { if (!bitset) { return ZYAN_STATUS_INVALID_ARGUMENT; } if ((bitset->size++ % 8) == 0) { static const ZyanU8 zero = 0; ZYAN_CHECK(ZyanVectorPushBack(&bitset->bits, &zero)); } return ZyanBitsetAssign(bitse...
/* ---------------------------------------------------------------------------------------------- */ /* Size management */ /* ---------------------------------------------------------------------------------------------- */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/Bitset.c#L407-L421
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanBitsetReserve
ZyanStatus ZyanBitsetReserve(ZyanBitset* bitset, ZyanUSize count) { return ZyanVectorReserve(&bitset->bits, ZYAN_BITSET_BITS_TO_BYTES(count)); }
/* ---------------------------------------------------------------------------------------------- */ /* Memory management */ /* ---------------------------------------------------------------------------------------------- */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/Bitset.c#L453-L456
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanBitsetGetSize
ZyanStatus ZyanBitsetGetSize(const ZyanBitset* bitset, ZyanUSize* size) { if (!bitset) { return ZYAN_STATUS_INVALID_ARGUMENT; } *size = bitset->size; return ZYAN_STATUS_SUCCESS; }
/* ---------------------------------------------------------------------------------------------- */ /* Information */ /* ---------------------------------------------------------------------------------------------- */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/Bitset.c#L467-L477
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanBitsetCount
ZyanStatus ZyanBitsetCount(const ZyanBitset* bitset, ZyanUSize* count) { if (!bitset || !count) { return ZYAN_STATUS_INVALID_ARGUMENT; } *count = 0; ZyanUSize size; ZYAN_CHECK(ZyanVectorGetSize(&bitset->bits, &size)); for (ZyanUSize i = 0; i < size; ++i) { ZyanU8* value...
/* ---------------------------------------------------------------------------------------------- */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/Bitset.c#L509-L536
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanStringAppendDecU
ZyanStatus ZyanStringAppendDecU(ZyanString* string, ZyanU64 value, ZyanU8 padding_length) { #if defined(ZYAN_X64) || defined(ZYAN_AARCH64) return ZyanStringAppendDecU64(string, value, padding_length); #else // Working with 64-bit values is slow on non 64-bit systems if (value & 0xFFFFFFFF00000000) { ...
// ZYAN_NO_LIBC /* ---------------------------------------------------------------------------------------------- */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/Format.c#L424-L436
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanListAllocateNode
static ZyanStatus ZyanListAllocateNode(ZyanList* list, ZyanListNode** node) { ZYAN_ASSERT(list); ZYAN_ASSERT(node); const ZyanBool is_dynamic = (list->allocator != ZYAN_NULL); if (is_dynamic) { ZYAN_ASSERT(list->allocator->allocate); ZYAN_CHECK(list->allocator->allocate(list->alloca...
/* ============================================================================================== */ /* Internal functions */ /* ============================================================================================== */ /* --------------...
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/List.c#L60-L90
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanListDeallocateNode
static ZyanStatus ZyanListDeallocateNode(ZyanList* list, ZyanListNode* node) { ZYAN_ASSERT(list); ZYAN_ASSERT(node); const ZyanBool is_dynamic = (list->allocator != ZYAN_NULL); if (is_dynamic) { ZYAN_ASSERT(list->allocator->deallocate); ZYAN_CHECK(list->allocator->deallocate(list->a...
/** * Frees memory of a node. * * @param list A pointer to the `ZyanList` instance. * @param node A pointer to the `ZyanListNode` struct. * * @return A zyan status code. */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/List.c#L100-L118
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanListInitEx
ZyanStatus ZyanListInitEx(ZyanList* list, ZyanUSize element_size, ZyanMemberProcedure destructor, ZyanAllocator* allocator) { if (!list || !element_size || !allocator) { return ZYAN_STATUS_INVALID_ARGUMENT; } list->allocator = allocator; list->size = 0; list->element_si...
// ZYAN_NO_LIBC
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/List.c#L140-L159
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanListGetHeadNode
ZyanStatus ZyanListGetHeadNode(const ZyanList* list, const ZyanListNode** node) { if (!list) { return ZYAN_STATUS_INVALID_ARGUMENT; } *node = list->head; return ZYAN_STATUS_SUCCESS; }
/* ---------------------------------------------------------------------------------------------- */ /* Duplication */ /* ---------------------------------------------------------------------------------------------- */ /* --------------...
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/List.c#L224-L234
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanListPushBack
ZyanStatus ZyanListPushBack(ZyanList* list, const void* item) { if (!list || !item) { return ZYAN_STATUS_INVALID_ARGUMENT; } ZyanListNode* node; ZYAN_CHECK(ZyanListAllocateNode(list, &node)); node->prev = list->tail; node->next = ZYAN_NULL; ZYAN_MEMCPY(ZYCORE_LIST_GET_NODE_DATA...
/* ---------------------------------------------------------------------------------------------- */ /* Insertion */ /* ---------------------------------------------------------------------------------------------- */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/List.c#L338-L364
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanListPopBack
ZyanStatus ZyanListPopBack(ZyanList* list) { if (!list) { return ZYAN_STATUS_INVALID_ARGUMENT; } if (!list->tail) { return ZYAN_STATUS_INVALID_OPERATION; } ZyanListNode* const node = list->tail; if (list->destructor) { list->destructor(ZYCORE_LIST_GET_NODE_D...
/* ---------------------------------------------------------------------------------------------- */ /* Deletion */ /* ---------------------------------------------------------------------------------------------- */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/List.c#L462-L492
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanListResize
ZyanStatus ZyanListResize(ZyanList* list, ZyanUSize size) { return ZyanListResizeEx(list, size, ZYAN_NULL); }
/* ---------------------------------------------------------------------------------------------- */ /* Searching */ /* ---------------------------------------------------------------------------------------------- */ /* --------------...
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/List.c#L556-L559
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanListGetSize
ZyanStatus ZyanListGetSize(const ZyanList* list, ZyanUSize* size) { if (!list) { return ZYAN_STATUS_INVALID_ARGUMENT; } *size = list->size; return ZYAN_STATUS_SUCCESS; }
/* ---------------------------------------------------------------------------------------------- */ /* Information */ /* ---------------------------------------------------------------------------------------------- */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/List.c#L659-L669
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanStringInitEx
ZyanStatus ZyanStringInitEx(ZyanString* string, ZyanUSize capacity, ZyanAllocator* allocator, ZyanU8 growth_factor, ZyanU8 shrink_threshold) { if (!string) { return ZYAN_STATUS_INVALID_ARGUMENT; } string->flags = 0; capacity = ZYAN_MAX(ZYAN_STRING_MIN_CAPACITY, capacity) + 1; ZYAN_C...
// ZYAN_NO_LIBC
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/String.c#L64-L84
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanStringDuplicateEx
ZyanStatus ZyanStringDuplicateEx(ZyanString* destination, const ZyanStringView* source, ZyanUSize capacity, ZyanAllocator* allocator, ZyanU8 growth_factor, ZyanU8 shrink_threshold) { if (!source || !source->string.vector.size) { return ZYAN_STATUS_INVALID_ARGUMENT; } const ZyanUSize len = s...
// ZYAN_NO_LIBC
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/String.c#L135-L154
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanStringConcatEx
ZyanStatus ZyanStringConcatEx(ZyanString* destination, const ZyanStringView* s1, const ZyanStringView* s2, ZyanUSize capacity, ZyanAllocator* allocator, ZyanU8 growth_factor, ZyanU8 shrink_threshold) { if (!s1 || !s2 || !s1->string.vector.size || !s2->string.vector.size) { return ZYAN_STATUS_INV...
// ZYAN_NO_LIBC
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/String.c#L196-L217
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanStringViewInsideView
ZyanStatus ZyanStringViewInsideView(ZyanStringView* view, const ZyanStringView* source) { if (!view || !source) { return ZYAN_STATUS_INVALID_ARGUMENT; } view->string.vector.data = source->string.vector.data; view->string.vector.size = source->string.vector.size; return ZYAN_STATUS_SUCC...
/* ---------------------------------------------------------------------------------------------- */ /* Views */ /* ---------------------------------------------------------------------------------------------- */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/String.c#L249-L260
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanStringGetChar
ZyanStatus ZyanStringGetChar(const ZyanStringView* string, ZyanUSize index, char* value) { if (!string || !value) { return ZYAN_STATUS_INVALID_ARGUMENT; } // Don't allow direct access to the terminating '\0' character if (index + 1 >= string->string.vector.size) { return ZYAN_ST...
/* ---------------------------------------------------------------------------------------------- */ /* Character access */ /* ---------------------------------------------------------------------------------------------- */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/String.c#L336-L354
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanStringInsert
ZyanStatus ZyanStringInsert(ZyanString* destination, ZyanUSize index, const ZyanStringView* source) { if (!destination || !source || !source->string.vector.size) { return ZYAN_STATUS_INVALID_ARGUMENT; } if (index == destination->vector.size) { return ZyanStringAppend(destination, so...
/* ---------------------------------------------------------------------------------------------- */ /* Insertion */ /* ---------------------------------------------------------------------------------------------- */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/String.c#L392-L415
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanStringAppend
ZyanStatus ZyanStringAppend(ZyanString* destination, const ZyanStringView* source) { if (!destination || !source || !source->string.vector.size) { return ZYAN_STATUS_INVALID_ARGUMENT; } const ZyanUSize len = destination->vector.size; ZYAN_CHECK(ZyanVectorResize(&destination->vector, len + s...
/* ---------------------------------------------------------------------------------------------- */ /* Appending */ /* ---------------------------------------------------------------------------------------------- */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/String.c#L453-L467
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanStringDelete
ZyanStatus ZyanStringDelete(ZyanString* string, ZyanUSize index, ZyanUSize count) { if (!string) { return ZYAN_STATUS_INVALID_ARGUMENT; } // Don't allow removal of the terminating '\0' character if (index + count >= string->vector.size) { return ZYAN_STATUS_OUT_OF_RANGE; } ...
/* ---------------------------------------------------------------------------------------------- */ /* Deletion */ /* ---------------------------------------------------------------------------------------------- */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/String.c#L496-L513
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanStringLPos
ZyanStatus ZyanStringLPos(const ZyanStringView* haystack, const ZyanStringView* needle, ZyanISize* found_index) { if (!haystack) { return ZYAN_STATUS_INVALID_ARGUMENT; } return ZyanStringLPosEx(haystack, needle, found_index, 0, haystack->string.vector.size - 1); }
/* ---------------------------------------------------------------------------------------------- */ /* Searching */ /* ---------------------------------------------------------------------------------------------- */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/String.c#L555-L564
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanStringCompare
ZyanStatus ZyanStringCompare(const ZyanStringView* s1, const ZyanStringView* s2, ZyanI32* result) { if (!s1 || !s2) { return ZYAN_STATUS_INVALID_ARGUMENT; } if (s1->string.vector.size < s2->string.vector.size) { *result = -1; return ZYAN_STATUS_FALSE; } if (s1->strin...
/* ---------------------------------------------------------------------------------------------- */ /* Comparing */ /* ---------------------------------------------------------------------------------------------- */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/String.c#L835-L879
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanStringToLowerCase
ZyanStatus ZyanStringToLowerCase(ZyanString* string) { if (!string) { return ZYAN_STATUS_INVALID_ARGUMENT; } return ZyanStringToLowerCaseEx(string, 0, string->vector.size - 1); }
/* ---------------------------------------------------------------------------------------------- */ /* Case conversion */ /* ---------------------------------------------------------------------------------------------- */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/String.c#L935-L943
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanStringResize
ZyanStatus ZyanStringResize(ZyanString* string, ZyanUSize size) { if (!string) { return ZYAN_STATUS_INVALID_ARGUMENT; } ZYAN_CHECK(ZyanVectorResize(&string->vector, size + 1)); ZYCORE_STRING_NULLTERMINATE(string); return ZYAN_STATUS_SUCCESS; }
/* ---------------------------------------------------------------------------------------------- */ /* Memory management */ /* ---------------------------------------------------------------------------------------------- */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/String.c#L1021-L1032
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanStringGetCapacity
ZyanStatus ZyanStringGetCapacity(const ZyanString* string, ZyanUSize* capacity) { if (!string) { return ZYAN_STATUS_INVALID_ARGUMENT; } ZYAN_ASSERT(string->vector.capacity >= 1); *capacity = string->vector.capacity - 1; return ZYAN_STATUS_SUCCESS; }
/* ---------------------------------------------------------------------------------------------- */ /* Information */ /* ---------------------------------------------------------------------------------------------- */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/String.c#L1058-L1069
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanVectorReallocate
static ZyanStatus ZyanVectorReallocate(ZyanVector* vector, ZyanUSize capacity) { ZYAN_ASSERT(vector); ZYAN_ASSERT(vector->capacity >= ZYAN_VECTOR_MIN_CAPACITY); ZYAN_ASSERT(vector->element_size); ZYAN_ASSERT(vector->data); if (!vector->allocator) { if (vector->capacity < capacity) ...
/* ============================================================================================== */ /* Internal functions */ /* ============================================================================================== */ /* --------------...
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/Vector.c#L84-L119
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanVectorShiftLeft
static ZyanStatus ZyanVectorShiftLeft(ZyanVector* vector, ZyanUSize index, ZyanUSize count) { ZYAN_ASSERT(vector); ZYAN_ASSERT(vector->element_size); ZYAN_ASSERT(vector->data); ZYAN_ASSERT(count > 0); //ZYAN_ASSERT((ZyanISize)count - (ZyanISize)index + 1 >= 0); const void* const source = ZYCORE...
/** * Shifts all elements starting at the specified `index` by the amount of `count` to the left. * * @param vector A pointer to the `ZyanVector` instance. * @param index The start index. * @param count The amount of shift operations. * * @return A zyan status code. */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/Vector.c#L130-L144
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanVectorShiftRight
static ZyanStatus ZyanVectorShiftRight(ZyanVector* vector, ZyanUSize index, ZyanUSize count) { ZYAN_ASSERT(vector); ZYAN_ASSERT(vector->element_size); ZYAN_ASSERT(vector->data); ZYAN_ASSERT(count > 0); ZYAN_ASSERT(vector->size + count <= vector->capacity); const void* const source = ZYCORE_VECT...
/** * Shifts all elements starting at the specified `index` by the amount of `count` to the right. * * @param vector A pointer to the `ZyanVector` instance. * @param index The start index. * @param count The amount of shift operations. * * @return A zyan status code. */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/Vector.c#L155-L169
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanVectorInitEx
ZyanStatus ZyanVectorInitEx(ZyanVector* vector, ZyanUSize element_size, ZyanUSize capacity, ZyanMemberProcedure destructor, ZyanAllocator* allocator, ZyanU8 growth_factor, ZyanU8 shrink_threshold) { if (!vector || !element_size || !allocator || (growth_factor < 1)) { return ZYAN_STATUS_INVALID_A...
// ZYAN_NO_LIBC
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/Vector.c#L192-L214
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanVectorDuplicateEx
ZyanStatus ZyanVectorDuplicateEx(ZyanVector* destination, const ZyanVector* source, ZyanUSize capacity, ZyanAllocator* allocator, ZyanU8 growth_factor, ZyanU8 shrink_threshold) { if (!source) { return ZYAN_STATUS_INVALID_ARGUMENT; } const ZyanUSize len = source->size; capacity = ZYAN_M...
// ZYAN_NO_LIBC
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/Vector.c#L280-L299
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanVectorPushBack
ZyanStatus ZyanVectorPushBack(ZyanVector* vector, const void* element) { if (!vector || !element) { return ZYAN_STATUS_INVALID_ARGUMENT; } ZYAN_ASSERT(vector->element_size); ZYAN_ASSERT(vector->data); if (ZYCORE_VECTOR_SHOULD_GROW(vector->size + 1, vector->capacity)) { ZYAN...
/* ---------------------------------------------------------------------------------------------- */ /* Insertion */ /* ---------------------------------------------------------------------------------------------- */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/Vector.c#L422-L444
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanVectorSwapElements
ZyanStatus ZyanVectorSwapElements(ZyanVector* vector, ZyanUSize index_first, ZyanUSize index_second) { if (!vector) { return ZYAN_STATUS_INVALID_ARGUMENT; } if ((index_first >= vector->size) || (index_second >= vector->size)) { return ZYAN_STATUS_OUT_OF_RANGE; } if (vector->...
/* ---------------------------------------------------------------------------------------------- */ /* Utils */ /* ---------------------------------------------------------------------------------------------- */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/Vector.c#L535-L562
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanVectorDelete
ZyanStatus ZyanVectorDelete(ZyanVector* vector, ZyanUSize index) { return ZyanVectorDeleteRange(vector, index, 1); }
/* ---------------------------------------------------------------------------------------------- */ /* Deletion */ /* ---------------------------------------------------------------------------------------------- */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/Vector.c#L568-L571
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanVectorFind
ZyanStatus ZyanVectorFind(const ZyanVector* vector, const void* element, ZyanISize* found_index, ZyanEqualityComparison comparison) { if (!vector) { return ZYAN_STATUS_INVALID_ARGUMENT; } return ZyanVectorFindEx(vector, element, found_index, comparison, 0, vector->size); }
/* ---------------------------------------------------------------------------------------------- */ /* Searching */ /* ---------------------------------------------------------------------------------------------- */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/Vector.c#L642-L651
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanVectorResize
ZyanStatus ZyanVectorResize(ZyanVector* vector, ZyanUSize size) { return ZyanVectorResizeEx(vector, size, ZYAN_NULL); }
/* ---------------------------------------------------------------------------------------------- */ /* Memory management */ /* ---------------------------------------------------------------------------------------------- */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/Vector.c#L747-L750
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanVectorGetCapacity
ZyanStatus ZyanVectorGetCapacity(const ZyanVector* vector, ZyanUSize* capacity) { if (!vector) { return ZYAN_STATUS_INVALID_ARGUMENT; } *capacity = vector->capacity; return ZYAN_STATUS_SUCCESS; }
/* ---------------------------------------------------------------------------------------------- */ /* Information */ /* ---------------------------------------------------------------------------------------------- */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/Vector.c#L820-L830
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZycoreGetVersion
ZyanU64 ZycoreGetVersion(void) { return ZYCORE_VERSION; }
/* ============================================================================================== */ /* Exported functions */ /* ============================================================================================== */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/Zycore.c#L33-L36
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanMemoryGetSystemPageSize
ZyanU32 ZyanMemoryGetSystemPageSize() { #if defined(ZYAN_WINDOWS) SYSTEM_INFO system_info; GetSystemInfo(&system_info); return system_info.dwPageSize; #elif defined(ZYAN_POSIX) return sysconf(_SC_PAGE_SIZE); #endif }
/* ============================================================================================== */ /* Exported functions */ /* ============================================================================================== */ /* --------------...
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/API/Memory.c#L47-L61
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanMemoryVirtualProtect
ZyanStatus ZyanMemoryVirtualProtect(void* address, ZyanUSize size, ZyanMemoryPageProtection protection) { #if defined(ZYAN_WINDOWS) DWORD old; if (!VirtualProtect(address, size, protection, &old)) { return ZYAN_STATUS_BAD_SYSTEMCALL; } #elif defined(ZYAN_POSIX) if (mprotect(address, ...
/* ---------------------------------------------------------------------------------------------- */ /* Memory management */ /* ---------------------------------------------------------------------------------------------- */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/API/Memory.c#L83-L104
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanProcessFlushInstructionCache
ZyanStatus ZyanProcessFlushInstructionCache(void* address, ZyanUSize size) { #if defined(ZYAN_WINDOWS) if (!FlushInstructionCache(GetCurrentProcess(), address, size)) { return ZYAN_STATUS_BAD_SYSTEMCALL; } #elif defined(ZYAN_POSIX) if (msync(address, size, MS_SYNC | MS_INVALIDATE)) { ...
/* ============================================================================================== */ /* Exported functions */ /* ============================================================================================== */ /* --------------...
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/API/Process.c#L51-L70
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanCriticalSectionInitialize
ZyanStatus ZyanCriticalSectionInitialize(ZyanCriticalSection* critical_section) { pthread_mutexattr_t attribute; int error = pthread_mutexattr_init(&attribute); if (error != 0) { if (error == ENOMEM) { return ZYAN_STATUS_NOT_ENOUGH_MEMORY; } return ZYAN_STATU...
/* ---------------------------------------------------------------------------------------------- */ /* Critical Section */ /* ---------------------------------------------------------------------------------------------- */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/API/Synchronization.c#L55-L94
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanCriticalSectionInitialize
ZyanStatus ZyanCriticalSectionInitialize(ZyanCriticalSection* critical_section) { InitializeCriticalSection(critical_section); return ZYAN_STATUS_SUCCESS; }
/* ---------------------------------------------------------------------------------------------- */ /* General */ /* ---------------------------------------------------------------------------------------------- */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/API/Synchronization.c#L163-L168
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanTerminalEnableVT100
ZyanStatus ZyanTerminalEnableVT100(ZyanStandardStream stream) { if ((stream != ZYAN_STDSTREAM_OUT) && (stream != ZYAN_STDSTREAM_ERR)) { return ZYAN_STATUS_INVALID_ARGUMENT; } #ifdef ZYAN_WINDOWS // Get file descriptor int file; switch (stream) { case ZYAN_STDSTREAM_OUT: ...
/* ============================================================================================== */ /* Exported functions */ /* ============================================================================================== */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/API/Terminal.c#L51-L98
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanThreadGetCurrentThread
ZyanStatus ZyanThreadGetCurrentThread(ZyanThread* thread) { *thread = pthread_self(); return ZYAN_STATUS_SUCCESS; }
/* ---------------------------------------------------------------------------------------------- */ /* General */ /* ---------------------------------------------------------------------------------------------- */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/API/Thread.c#L101-L106
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanThreadTlsAlloc
ZyanStatus ZyanThreadTlsAlloc(ZyanThreadTlsIndex* index, ZyanThreadTlsCallback destructor) { ZyanThreadTlsIndex value; const int error = pthread_key_create(&value, destructor); if (error != 0) { if (error == EAGAIN) { return ZYAN_STATUS_OUT_OF_RESOURCES; } if ...
/* ---------------------------------------------------------------------------------------------- */ /* Thread Local Storage */ /* ---------------------------------------------------------------------------------------------- */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/API/Thread.c#L123-L142
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanThreadGetCurrentThread
ZyanStatus ZyanThreadGetCurrentThread(ZyanThread* thread) { *thread = GetCurrentThread(); return ZYAN_STATUS_SUCCESS; }
/* ---------------------------------------------------------------------------------------------- */ /* General */ /* ---------------------------------------------------------------------------------------------- */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/API/Thread.c#L179-L184
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZyanThreadTlsAlloc
ZyanStatus ZyanThreadTlsAlloc(ZyanThreadTlsIndex* index, ZyanThreadTlsCallback destructor) { const ZyanThreadTlsIndex value = FlsAlloc(destructor); if (value == FLS_OUT_OF_INDEXES) { return ZYAN_STATUS_OUT_OF_RESOURCES; } *index = value; return ZYAN_STATUS_SUCCESS; }
/* ---------------------------------------------------------------------------------------------- */ /* Thread Local Storage (TLS) */ /* ---------------------------------------------------------------------------------------------- */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/dependencies/zycore/src/API/Thread.c#L197-L207
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ExpectSuccess
static void ExpectSuccess(ZyanStatus status) { if (ZYAN_FAILED(status)) { fprintf(stderr, "Something failed: 0x%08X\n", status); exit(EXIT_FAILURE); } }
/* ============================================================================================== */ /* Entry point */ /* ============================================================================================== */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/examples/EncodeFromScratch.c#L43-L50
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
DisassembleBuffer
static void DisassembleBuffer(ZydisDecoder* decoder, ZyanU8* data, ZyanUSize length) { ZydisFormatter formatter; ZydisFormatterInit(&formatter, ZYDIS_FORMATTER_STYLE_INTEL); ZydisFormatterSetProperty(&formatter, ZYDIS_FORMATTER_PROP_FORCE_SEGMENT, ZYAN_TRUE); ZydisFormatterSetProperty(&formatter, ZYDIS_...
/* ============================================================================================== */ /* Helper functions */ /* ============================================================================================== */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/examples/Formatter01.c#L102-L136
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
main
int main(void) { if (ZydisGetVersion() != ZYDIS_VERSION) { fputs("Invalid zydis version\n", ZYAN_STDERR); return EXIT_FAILURE; } ZyanU8 data[] = { 0x48, 0x8B, 0x05, 0x39, 0x00, 0x13, 0x00, // mov rax, qword ptr ds:[<SomeModule.SomeData>] 0x50, ...
/* ============================================================================================== */ /* Entry point */ /* ============================================================================================== */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/examples/Formatter01.c#L142-L166
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
DisassembleBuffer
static void DisassembleBuffer(ZydisDecoder* decoder, ZyanU8* data, ZyanUSize length, ZyanBool install_hooks) { ZydisFormatter formatter; ZydisFormatterInit(&formatter, ZYDIS_FORMATTER_STYLE_INTEL); ZydisFormatterSetProperty(&formatter, ZYDIS_FORMATTER_PROP_FORCE_SEGMENT, ZYAN_TRUE); ZydisFormatterSe...
/* ---------------------------------------------------------------------------------------------- */ /* ============================================================================================== */ /* Helper functions */ /* ==============...
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/examples/Formatter02.c#L193-L232
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
main
int main(void) { if (ZydisGetVersion() != ZYDIS_VERSION) { fputs("Invalid zydis version\n", ZYAN_STDERR); return EXIT_FAILURE; } ZyanU8 data[] = { // nop 0x90, // cmpps xmm1, xmm4, 0x03 0x0F, 0xC2, 0xCC, 0x03, // vcmppd xmm1, xmm2, xmm3, 0x1...
/* ============================================================================================== */ /* Entry point */ /* ============================================================================================== */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/examples/Formatter02.c#L238-L269
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
DisassembleBuffer
static void DisassembleBuffer(ZydisDecoder* decoder, ZyanU8* data, ZyanUSize length) { ZydisFormatter formatter; ZydisFormatterInit(&formatter, ZYDIS_FORMATTER_STYLE_INTEL); ZydisFormatterSetProperty(&formatter, ZYDIS_FORMATTER_PROP_FORCE_SEGMENT, ZYAN_TRUE); ZydisFormatterSetProperty(&formatter, ZYDIS_...
/* ============================================================================================== */ /* Helper functions */ /* ============================================================================================== */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/examples/Formatter03.c#L64-L103
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
main
int main(void) { if (ZydisGetVersion() != ZYDIS_VERSION) { fputs("Invalid zydis version\n", ZYAN_STDERR); return EXIT_FAILURE; } ZyanU8 data[] = { // vcmpps k2 {k7}, zmm2, dword ptr ds:[rax + rbx*4 + 0x100] {1to16}, 0x0F 0x62, 0xF1, 0x6C, 0x5F, 0xC2, 0x54, 0x98, 0x40...
/* ============================================================================================== */ /* Entry point */ /* ============================================================================================== */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/examples/Formatter03.c#L109-L129
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ExpectSuccess
static void ExpectSuccess(ZyanStatus status) { if (ZYAN_FAILED(status)) { fprintf(stderr, "Something failed: 0x%08X\n", status); exit(EXIT_FAILURE); } }
/* ============================================================================================== */ /* Entry point */ /* ============================================================================================== */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/examples/RewriteCode.c#L49-L56
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
AdjustProcessAndThreadPriority
static void AdjustProcessAndThreadPriority(void) { #if defined(ZYAN_WINDOWS) SYSTEM_INFO info; GetSystemInfo(&info); if (info.dwNumberOfProcessors > 1) { if (!SetThreadAffinityMask(GetCurrentThread(), (DWORD_PTR)1)) { ZYAN_FPRINTF(ZYAN_STDERR, "%sWarning: Could not set threa...
/* ---------------------------------------------------------------------------------------------- */ /* Process & Thread Priority */ /* ---------------------------------------------------------------------------------------------- */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/examples/ZydisPerfTest.c#L174-L218
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
main
int main(int argc, char** argv) { // Enable VT100 escape sequences on Windows, if the output is not redirected g_vt100_stdout = (ZyanTerminalIsTTY(ZYAN_STDSTREAM_OUT) == ZYAN_STATUS_TRUE) && ZYAN_SUCCESS(ZyanTerminalEnableVT100(ZYAN_STDSTREAM_OUT)); g_vt100_stderr = (ZyanTerminalIsTTY(Z...
/* ============================================================================================== */ /* Entry point */ /* ============================================================================================== */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/examples/ZydisPerfTest.c#L460-L585
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
Print
VOID Print( _In_ PCCH Format, _In_ ... ) { CHAR message[512]; va_list argList; va_start(argList, Format); const int n = _vsnprintf_s(message, sizeof(message), sizeof(message) - 1, Format, argList); message[n] = '\0'; vDbgPrintExWithPrefix("[ZYDIS] ", DPFLTR_IHVDRIVER_ID, DPFLTR_ERROR...
/* ============================================================================================== */ /* Helper functions */ /* ============================================================================================== */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/examples/ZydisWinKernel.c#L75-L88
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
DriverEntry
_Use_decl_annotations_ NTSTATUS DriverEntry( _In_ PDRIVER_OBJECT DriverObject, _In_ PUNICODE_STRING RegistryPath ) { PAGED_CODE(); UNREFERENCED_PARAMETER(RegistryPath); if (ZydisGetVersion() != ZYDIS_VERSION) { Print("Invalid zydis version\n"); return STATUS_UNKNOWN_REVISIO...
/* ============================================================================================== */ /* Entry point */ /* ============================================================================================== */
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/examples/ZydisWinKernel.c#L94-L191
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZydisInputPeek
static ZyanStatus ZydisInputPeek(ZydisDecoderState* state, ZydisDecodedInstruction* instruction, ZyanU8* value) { ZYAN_ASSERT(state); ZYAN_ASSERT(instruction); ZYAN_ASSERT(value); if (instruction->length >= ZYDIS_MAX_INSTRUCTION_LENGTH) { return ZYDIS_STATUS_INSTRUCTION_TOO_LONG; } ...
/* ---------------------------------------------------------------------------------------------- */ /* ============================================================================================== */ /* Internal functions */ /* ==============...
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/src/Decoder.c#L246-L265
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZydisInputSkip
static void ZydisInputSkip(ZydisDecoderState* context, ZydisDecodedInstruction* instruction) { ZYAN_ASSERT(context); ZYAN_ASSERT(instruction); ZYAN_ASSERT(instruction->length < ZYDIS_MAX_INSTRUCTION_LENGTH); ++instruction->length; ++context->buffer; --context->buffer_len; }
/** * Increases the read-position of the input data-source by one byte. * * @param context A pointer to the `ZydisDecoderContext` instance * @param instruction A pointer to the `ZydisDecodedInstruction` struct. * * This function is supposed to get called ONLY after a successful call of `ZydisInputPeek`. ...
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/src/Decoder.c#L277-L286
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZydisInputNext
static ZyanStatus ZydisInputNext(ZydisDecoderState* state, ZydisDecodedInstruction* instruction, ZyanU8* value) { ZYAN_ASSERT(state); ZYAN_ASSERT(instruction); ZYAN_ASSERT(value); if (instruction->length >= ZYDIS_MAX_INSTRUCTION_LENGTH) { return ZYDIS_STATUS_INSTRUCTION_TOO_LONG; } ...
/** * Reads one byte from the current read-position of the input data-source and increases * the read-position by one byte afterwards. * * @param state A pointer to the `ZydisDecoderState` struct. * @param instruction A pointer to the `ZydisDecodedInstruction` struct. * @param value A p...
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/src/Decoder.c#L300-L321
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZydisInputNextBytes
static ZyanStatus ZydisInputNextBytes(ZydisDecoderState* state, ZydisDecodedInstruction* instruction, ZyanU8* value, ZyanU8 number_of_bytes) { ZYAN_ASSERT(state); ZYAN_ASSERT(instruction); ZYAN_ASSERT(value); if (instruction->length + number_of_bytes > ZYDIS_MAX_INSTRUCTION_LENGTH) { re...
/** * Reads a variable amount of bytes from the current read-position of the input * data-source and increases the read-position by specified amount of bytes afterwards. * * @param state A pointer to the `ZydisDecoderState` struct. * @param instruction A pointer to the `ZydisDecodedInstr...
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/src/Decoder.c#L337-L361
8b81e76efe457b59be3a6e752efd43916ba0cabb
BugChecker
github_2023
vitoplantamura
c
ZydisDecodeREX
static void ZydisDecodeREX(ZydisDecoderContext* context, ZydisDecodedInstruction* instruction, ZyanU8 data) { ZYAN_ASSERT(instruction); ZYAN_ASSERT((data & 0xF0) == 0x40); instruction->attributes |= ZYDIS_ATTRIB_HAS_REX; instruction->raw.rex.W = (data >> 3) & 0x01; instruction->raw.rex.R = ...
/* ---------------------------------------------------------------------------------------------- */ /* Decode functions */ /* ---------------------------------------------------------------------------------------------- */ /** * Decodes th...
https://github.com/vitoplantamura/BugChecker/blob/8b81e76efe457b59be3a6e752efd43916ba0cabb/dependencies/zydis/src/Decoder.c#L374-L391
8b81e76efe457b59be3a6e752efd43916ba0cabb