Bug 1539806 - Incorporate the Zydis disassembler source. r=froydnj, r=mhoye
authorLars T Hansen <lhansen@mozilla.com>
Tue, 02 Apr 2019 10:44:54 +0200
changeset 539629 c44e595b046835b68df9613a068d745c437a5993
parent 539628 ccb4138ed2ff4f4a497492edc96b3f47c9646c5e
child 539630 7f6e7c86447a946fc2ee19a43e2228edd1bf4bd0
push id2131
push userffxbld-merge
push dateMon, 26 Aug 2019 18:30:20 +0000
treeherdermozilla-release@b19ffb3ca153 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj, mhoye
bugs1539806
milestone69.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1539806 - Incorporate the Zydis disassembler source. r=froydnj, r=mhoye The Zydis disassembler is a configurable MIT-licensed decoder and formatter for x64 and x86. The code comes from two github repositories: https://github.com/zyantific/zydis https://github.com/zyantific/zycore-c In accompanying licensing material (included in this patch) the authors are identified as these: Copyright (c) 2014-2019 Florian Bernd Copyright (c) 2014-2019 Joel Höner We will use Zydis to disassemble code generated by the Cranelift JIT. This source has been taken from the master branch of Zydis on github and incorporated here in the manner described in README.md in this directory. Effectively: a subset of files have been incorporated and the files are in new locations in a flatter tree. README.md has instructions for repeating the job. The files in the root Zydis directory js/src/zydis are largely authored by me but in some cases incorporate code from the Zydis repository on github and are therefore given a Zydis copyright when appropriate.
.clang-format-ignore
js/src/zydis/README.md
js/src/zydis/Zycore/API/Memory.c
js/src/zydis/Zycore/API/Memory.h
js/src/zydis/Zycore/Allocator.c
js/src/zydis/Zycore/Allocator.h
js/src/zydis/Zycore/Bitset.c
js/src/zydis/Zycore/Bitset.h
js/src/zydis/Zycore/Comparison.h
js/src/zydis/Zycore/Defines.h
js/src/zydis/Zycore/Format.c
js/src/zydis/Zycore/Format.h
js/src/zydis/Zycore/LICENSE
js/src/zydis/Zycore/LibC.h
js/src/zydis/Zycore/Object.h
js/src/zydis/Zycore/Status.h
js/src/zydis/Zycore/String.h
js/src/zydis/Zycore/Types.h
js/src/zydis/Zycore/Vector.c
js/src/zydis/Zycore/Vector.h
js/src/zydis/Zycore/Zycore.c
js/src/zydis/Zycore/Zycore.h
js/src/zydis/Zycore/ZycoreString.c
js/src/zydis/ZycoreExportConfig.h
js/src/zydis/Zydis/Decoder.c
js/src/zydis/Zydis/Decoder.h
js/src/zydis/Zydis/DecoderData.c
js/src/zydis/Zydis/DecoderTypes.h
js/src/zydis/Zydis/Formatter.c
js/src/zydis/Zydis/Formatter.h
js/src/zydis/Zydis/FormatterATT.c
js/src/zydis/Zydis/FormatterBase.c
js/src/zydis/Zydis/FormatterBuffer.c
js/src/zydis/Zydis/FormatterBuffer.h
js/src/zydis/Zydis/FormatterIntel.c
js/src/zydis/Zydis/Generated/AccessedFlags.inc
js/src/zydis/Zydis/Generated/DecoderTables.inc
js/src/zydis/Zydis/Generated/EncodableInstructions.inc
js/src/zydis/Zydis/Generated/EnumISAExt.h
js/src/zydis/Zydis/Generated/EnumISAExt.inc
js/src/zydis/Zydis/Generated/EnumISASet.h
js/src/zydis/Zydis/Generated/EnumISASet.inc
js/src/zydis/Zydis/Generated/EnumInstructionCategory.h
js/src/zydis/Zydis/Generated/EnumInstructionCategory.inc
js/src/zydis/Zydis/Generated/EnumMnemonic.h
js/src/zydis/Zydis/Generated/EnumMnemonic.inc
js/src/zydis/Zydis/Generated/EnumRegister.h
js/src/zydis/Zydis/Generated/EnumRegister.inc
js/src/zydis/Zydis/Generated/FormatterStrings.inc
js/src/zydis/Zydis/Generated/InstructionDefinitions.inc
js/src/zydis/Zydis/Generated/InstructionEncodings.inc
js/src/zydis/Zydis/Generated/OperandDefinitions.inc
js/src/zydis/Zydis/Internal/DecoderData.h
js/src/zydis/Zydis/Internal/FormatterATT.h
js/src/zydis/Zydis/Internal/FormatterBase.h
js/src/zydis/Zydis/Internal/FormatterIntel.h
js/src/zydis/Zydis/Internal/SharedData.h
js/src/zydis/Zydis/Internal/String.h
js/src/zydis/Zydis/LICENSE
js/src/zydis/Zydis/MetaInfo.c
js/src/zydis/Zydis/MetaInfo.h
js/src/zydis/Zydis/Mnemonic.c
js/src/zydis/Zydis/Mnemonic.h
js/src/zydis/Zydis/Register.c
js/src/zydis/Zydis/Register.h
js/src/zydis/Zydis/SharedData.c
js/src/zydis/Zydis/SharedTypes.h
js/src/zydis/Zydis/ShortString.h
js/src/zydis/Zydis/Status.h
js/src/zydis/Zydis/Utils.c
js/src/zydis/Zydis/Utils.h
js/src/zydis/Zydis/Zydis.c
js/src/zydis/Zydis/Zydis.h
js/src/zydis/Zydis/ZydisString.c
js/src/zydis/ZydisAPI.cpp
js/src/zydis/ZydisAPI.h
js/src/zydis/ZydisExportConfig.h
js/src/zydis/imported-revision.txt
js/src/zydis/moz.build
js/src/zydis/update.sh
toolkit/content/license.html
--- a/.clang-format-ignore
+++ b/.clang-format-ignore
@@ -4,16 +4,19 @@ build/clang-plugin/.*
 config/gcc-stl-wrapper.template.h
 config/msvc-stl-wrapper.template.h
 # Generated code
 js/src/builtin/intl/TimeZoneDataGenerated.h
 
 # Don't want to reformat irregexp. bug 1510128
 js/src/irregexp/.*
 
+# Don't want to reformat zydis (third-party library subject to occasional updates).
+js/src/zydis/.*
+
 # Generated by js/src/util/make_unicode.py
 # Note: the irregexp files are already excluded with the rest of js/src/irregexp
 # but we add them here in case that ever changes.
 js/src/irregexp/RegExpCharacters-inl.h
 js/src/irregexp/RegExpCharacters.cpp
 js/src/util/Unicode.cpp
 js/src/util/UnicodeNonBMP.h
 
new file mode 100644
--- /dev/null
+++ b/js/src/zydis/README.md
@@ -0,0 +1,22 @@
+# Zydis disassembler
+
+Zydis x64/x86 disassembler imported from github, see
+https://github.com/zyantific/zydis and https://github.com/zyantific/zycore-c.
+
+Zydis is MIT licensed code, see Zydis/LICENSE and Zycore/LICENSE.
+
+Sources here were taken from the tag/revision of Zydis that is recorded in the
+file imported-revision.txt.
+
+The file hierarchy of Zydis+Zycore has been flattened and processed as described
+in the script update.sh.
+
+## Integrating new versions of Zydis
+
+The procedure for pulling a new version is encoded in the script update.sh,
+which is to be run from the parent directory of zydis, ie, from js/src/.  It
+will create a new zydis directory and pull new files from github into it,
+leaving the old zydis directory as zydis_old.
+
+It's not a given that the script will work out of the box for new versions of
+zydis or that the resulting files will build as-is.  Buyer beware.
new file mode 100644
--- /dev/null
+++ b/js/src/zydis/Zycore/API/Memory.c
@@ -0,0 +1,35 @@
+/***************************************************************************************************
+
+  Zyan Core Library (Zycore-C)
+
+  Original Author : Florian Bernd
+
+ * 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.
+
+***************************************************************************************************/
+
+#include "zydis/Zycore/API/Memory.h"
+
+/* ============================================================================================== */
+/* Exported functions                                                                             */
+/* ============================================================================================== */
+
+
+
+/* ============================================================================================== */
new file mode 100644
--- /dev/null
+++ b/js/src/zydis/Zycore/API/Memory.h
@@ -0,0 +1,74 @@
+/***************************************************************************************************
+
+  Zyan Core Library (Zycore-C)
+
+  Original Author : Florian Bernd
+
+ * 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.
+
+***************************************************************************************************/
+
+/**
+ * @file
+ * @brief
+ */
+
+#ifndef ZYCORE_MEMORY_H
+#define ZYCORE_MEMORY_H
+
+#include "zydis/ZycoreExportConfig.h"
+#include "zydis/Zycore/Status.h"
+#include "zydis/Zycore/Types.h"
+
+/* ============================================================================================== */
+/* Enums and types                                                                                */
+/* ============================================================================================== */
+
+/**
+ * @brief   Defines the `ZyanMemoryManager` struct.
+ */
+typedef struct ZyanMemoryManager_
+{
+    int a;
+} ZyanMemoryManager;
+
+/* ============================================================================================== */
+/* Exported functions                                                                             */
+/* ============================================================================================== */
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Memory manager                                                                                 */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Returns the default memory manager.
+
+ * @return  The default memory manager.
+ */
+ZYCORE_EXPORT const ZyanMemoryManager* ZyanMemoryManagerDefault(void);
+
+/* ---------------------------------------------------------------------------------------------- */
+/*                                                                                                */
+/* ---------------------------------------------------------------------------------------------- */
+
+
+
+/* ============================================================================================== */
+
+#endif /* ZYCORE_MEMORY_H */
new file mode 100644
--- /dev/null
+++ b/js/src/zydis/Zycore/Allocator.c
@@ -0,0 +1,134 @@
+/***************************************************************************************************
+
+  Zyan Core Library (Zycore-C)
+
+  Original Author : Florian Bernd
+
+ * 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.
+
+***************************************************************************************************/
+
+#include "zydis/Zycore/Allocator.h"
+#include "zydis/Zycore/LibC.h"
+
+/* ============================================================================================== */
+/* Internal functions                                                                             */
+/* ============================================================================================== */
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Default allocator                                                                              */
+/* ---------------------------------------------------------------------------------------------- */
+
+#ifndef ZYAN_NO_LIBC
+
+static ZyanStatus ZyanAllocatorDefaultAllocate(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 ZYAN_STATUS_NOT_ENOUGH_MEMORY;
+    }
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+static ZyanStatus ZyanAllocatorDefaultReallocate(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);
+
+    void* const x = ZYAN_REALLOC(*p, element_size * n);
+    if (!x)
+    {
+        return ZYAN_STATUS_NOT_ENOUGH_MEMORY;
+    }
+    *p = x;
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+static ZyanStatus ZyanAllocatorDefaultDeallocate(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);
+    ZYAN_UNUSED(element_size);
+    ZYAN_UNUSED(n);
+
+    ZYAN_FREE(p);
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+#endif // ZYAN_NO_LIBC
+
+/* ---------------------------------------------------------------------------------------------- */
+
+/* ============================================================================================== */
+/* Exported functions                                                                             */
+/* ============================================================================================== */
+
+ZyanStatus ZyanAllocatorInit(ZyanAllocator* allocator, ZyanAllocatorAllocate allocate,
+    ZyanAllocatorAllocate reallocate, ZyanAllocatorDeallocate deallocate)
+{
+    if (!allocator || !allocate || !reallocate || !deallocate)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    allocator->allocate   = allocate;
+    allocator->reallocate = reallocate;
+    allocator->deallocate = deallocate;
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+#ifndef ZYAN_NO_LIBC
+
+ZyanAllocator* ZyanAllocatorDefault(void)
+{
+    static ZyanAllocator allocator =
+    {
+        &ZyanAllocatorDefaultAllocate,
+        &ZyanAllocatorDefaultReallocate,
+        &ZyanAllocatorDefaultDeallocate
+    };
+    return &allocator;
+}
+
+#endif
+
+/* ============================================================================================== */
new file mode 100644
--- /dev/null
+++ b/js/src/zydis/Zycore/Allocator.h
@@ -0,0 +1,143 @@
+/***************************************************************************************************
+
+  Zyan Core Library (Zycore-C)
+
+  Original Author : Florian Bernd
+
+ * 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.
+
+***************************************************************************************************/
+
+/**
+ * @file
+ * @brief
+ */
+
+#ifndef ZYCORE_ALLOCATOR_H
+#define ZYCORE_ALLOCATOR_H
+
+#include "zydis/ZycoreExportConfig.h"
+#include "zydis/Zycore/Status.h"
+#include "zydis/Zycore/Types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* ============================================================================================== */
+/* Enums and types                                                                                */
+/* ============================================================================================== */
+
+struct ZyanAllocator_;
+
+/**
+ * @brief   Defines the `ZyanAllocatorAllocate` function prototype.
+ *
+ * @param   allocator       A pointer to the `ZyanAllocator` instance.
+ * @param   p               Receives a pointer to the first memory block sufficient to hold an
+ *                          array of `n` elements with a size of `element_size`.
+ * @param   element_size    The size of a single element.
+ * @param   n               The number of elements to allocate storage for.
+ *
+ * @return  A zyan status code.
+ *
+ * This prototype is used for the `allocate()` and `reallocate()` functions.
+ *
+ * The result of the `reallocate()` function is undefined, if `p` does not point to a memory block
+ * previously obtained by `(re-)allocate()`.
+ */
+typedef ZyanStatus (*ZyanAllocatorAllocate)(struct ZyanAllocator_* allocator, void** p,
+    ZyanUSize element_size, ZyanUSize n);
+
+/**
+ * @brief   Defines the `ZyanAllocatorDeallocate` function prototype.
+ *
+ * @param   allocator       A pointer to the `ZyanAllocator` instance.
+ * @param   p               The pointer obtained from `(re-)allocate()`.
+ * @param   element_size    The size of a single element.
+ * @param   n               The number of elements earlier passed to `(re-)allocate()`.
+ *
+  * @return  A zyan status code.
+ */
+typedef ZyanStatus (*ZyanAllocatorDeallocate)(struct ZyanAllocator_* allocator, void* p,
+    ZyanUSize element_size, ZyanUSize n);
+
+/**
+ * @brief   Defines the `ZyanAllocator` struct.
+ *
+ * This is the base class for all custom allocator implementations.
+ *
+ * All fields in this struct should be considered as "private". Any changes may lead to unexpected
+ * behavior.
+ */
+typedef struct ZyanAllocator_
+{
+    /**
+     * @brief   The allocate function.
+     */
+    ZyanAllocatorAllocate allocate;
+    /**
+     * @brief   The reallocate function.
+     */
+    ZyanAllocatorAllocate reallocate;
+    /**
+     * @brief   The deallocate function.
+     */
+    ZyanAllocatorDeallocate deallocate;
+} ZyanAllocator;
+
+/* ============================================================================================== */
+/* Exported functions                                                                             */
+/* ============================================================================================== */
+
+/**
+ * @brief   Initializes the given `ZyanAllocator` instance.
+ *
+ * @param   allocator   A pointer to the `ZyanAllocator` instance.
+ * @param   allocate    The allocate function.
+ * @param   reallocate  The reallocate function.
+ * @param   deallocate  The deallocate function.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanAllocatorInit(ZyanAllocator* allocator, ZyanAllocatorAllocate allocate,
+    ZyanAllocatorAllocate reallocate, ZyanAllocatorDeallocate deallocate);
+
+#ifndef ZYAN_NO_LIBC
+
+/**
+ * @brief   Returns the default `ZyanAllocator` instance.
+ *
+ * @return  A pointer to the default `ZyanAllocator` instance.
+ *
+ * The default allocator uses the default memory manager to allocate memory on the heap.
+ *
+ * You should in no case modify the returned allocator instance to avoid unexpected behavior.
+ */
+ZYCORE_EXPORT ZYAN_REQUIRES_LIBC ZyanAllocator* ZyanAllocatorDefault(void);
+
+#endif // ZYAN_NO_LIBC
+
+/* ============================================================================================== */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* ZYCORE_ALLOCATOR_H */
new file mode 100644
--- /dev/null
+++ b/js/src/zydis/Zycore/Bitset.c
@@ -0,0 +1,634 @@
+/***************************************************************************************************
+
+  Zyan Core Library (Zycore-C)
+
+  Original Author : Florian Bernd
+
+ * 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.
+
+***************************************************************************************************/
+
+#include "zydis/Zycore/Bitset.h"
+#include "zydis/Zycore/LibC.h"
+
+/* ============================================================================================== */
+/* Internal constants                                                                             */
+/* ============================================================================================== */
+
+#define ZYAN_BITSET_GROWTH_FACTOR    2.00f
+#define ZYAN_BITSET_SHRINK_THRESHOLD 0.50f
+
+/* ============================================================================================== */
+/* Internal macros                                                                                */
+/* ============================================================================================== */
+
+/**
+ * @brief   Computes the smallest integer value not less than `x`.
+ *
+ * @param   x   The value.
+ *
+ * @return  The smallest integer value not less than `x`.
+ */
+#define ZYAN_BITSET_CEIL(x) \
+    (((x) == ((ZyanU32)(x))) ? (ZyanU32)(x) : ((ZyanU32)(x)) + 1)
+
+/**
+ * @brief   Converts bits to bytes.
+ *
+ * @param   x   The value in bits.
+ *
+ * @return  The amount of bytes needed to fit `x` bits.
+ */
+#define ZYAN_BITSET_BITS_TO_BYTES(x) \
+    ZYAN_BITSET_CEIL((x) / 8.0f)
+
+/**
+ * @brief   Returns the offset of the given bit.
+ *
+ * @param   index   The bit index.
+ *
+ * @return  The offset of the given bit.
+ */
+#define ZYAN_BITSET_BIT_OFFSET(index) \
+    (7 - ((index) % 8))
+
+/* ============================================================================================== */
+/* Internal functions                                                                             */
+/* ============================================================================================== */
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Helper functions                                                                               */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Initializes the given `vector` with `count` "zero"-bytes.
+ *
+ * @param   vector  A pointer to the `ZyanVector` instance.
+ * @param   count   The number of bytes.
+ *
+ * @return  A zyan status code.
+ */
+static ZyanStatus ZyanBitsetInitVectorElements(ZyanVector* vector, ZyanUSize count)
+{
+    ZYAN_ASSERT(vector);
+
+    static const ZyanU8 zero = 0;
+    for (ZyanUSize i = 0; i < count; ++i)
+    {
+        ZYAN_CHECK(ZyanVectorPush(vector, &zero));
+    }
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Byte operations                                                                                */
+/* ---------------------------------------------------------------------------------------------- */
+
+static ZyanStatus ZyanBitsetOperationAND(ZyanU8* b1, const ZyanU8* b2)
+{
+    *b1 &= *b2;
+    return ZYAN_STATUS_SUCCESS;
+}
+
+static ZyanStatus ZyanBitsetOperationOR (ZyanU8* b1, const ZyanU8* b2)
+{
+    *b1 |= *b2;
+    return ZYAN_STATUS_SUCCESS;
+}
+
+static ZyanStatus ZyanBitsetOperationXOR(ZyanU8* b1, const ZyanU8* b2)
+{
+    *b1 ^= *b2;
+    return ZYAN_STATUS_SUCCESS;
+}
+
+/* ---------------------------------------------------------------------------------------------- */
+
+/* ============================================================================================== */
+/* Exported functions                                                                             */
+/* ============================================================================================== */
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Constructor and destructor                                                                     */
+/* ---------------------------------------------------------------------------------------------- */
+
+#ifndef ZYAN_NO_LIBC
+
+ZyanStatus ZyanBitsetInit(ZyanBitset* bitset, ZyanUSize count)
+{
+    return ZyanBitsetInitEx(bitset, count, ZyanAllocatorDefault(), ZYAN_BITSET_GROWTH_FACTOR,
+        ZYAN_BITSET_SHRINK_THRESHOLD);
+}
+
+#endif // ZYAN_NO_LIBC
+
+ZyanStatus ZyanBitsetInitEx(ZyanBitset* bitset, ZyanUSize count, ZyanAllocator* allocator,
+    float growth_factor, float shrink_threshold)
+{
+    if (!bitset)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    const ZyanU32 bytes = ZYAN_BITSET_BITS_TO_BYTES(count);
+
+    bitset->size = count;
+    ZYAN_CHECK(ZyanVectorInitEx(&bitset->bits, sizeof(ZyanU8), bytes, allocator, growth_factor,
+        shrink_threshold));
+    ZYAN_CHECK(ZyanBitsetInitVectorElements(&bitset->bits, bytes));
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+ZyanStatus ZyanBitsetInitBuffer(ZyanBitset* bitset, ZyanUSize count, void* buffer,
+    ZyanUSize capacity)
+{
+    if (!bitset)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    const ZyanU32 bytes = ZYAN_BITSET_BITS_TO_BYTES(count);
+    if (capacity < bytes)
+    {
+        return ZYAN_STATUS_INSUFFICIENT_BUFFER_SIZE;
+    }
+
+    bitset->size = count;
+    ZYAN_CHECK(ZyanVectorInitCustomBuffer(&bitset->bits, sizeof(ZyanU8), buffer, capacity));
+    ZYAN_CHECK(ZyanBitsetInitVectorElements(&bitset->bits, bytes));
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+ZyanStatus ZyanBitsetDestroy(ZyanBitset* bitset)
+{
+    if (!bitset)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    return ZyanVectorDestroy(&bitset->bits, ZYAN_NULL);
+}
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Logical operations                                                                             */
+/* ---------------------------------------------------------------------------------------------- */
+
+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->bits, &s1));
+    ZYAN_CHECK(ZyanVectorGetSize(&source->bits, &s2));
+
+    const ZyanUSize min = ZYAN_MIN(s1, s2);
+    for (ZyanUSize i = 0; i < min; ++i)
+    {
+        ZyanU8* v1;
+        const ZyanU8* v2;
+        ZYAN_CHECK(ZyanVectorGetPointerMutable(&destination->bits, i, (void**)&v1));
+        ZYAN_CHECK(ZyanVectorGetPointer(&source->bits, i, (const void**)&v2));
+
+        ZYAN_ASSERT(v1);
+        ZYAN_ASSERT(v2);
+
+        ZYAN_CHECK(operation(v1, v2));
+    }
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+ZyanStatus ZyanBitsetAND(ZyanBitset* destination, const ZyanBitset* source)
+{
+    return ZyanBitsetPerformByteOperation(destination, source, ZyanBitsetOperationAND);
+}
+
+ZyanStatus ZyanBitsetOR (ZyanBitset* destination, const ZyanBitset* source)
+{
+    return ZyanBitsetPerformByteOperation(destination, source, ZyanBitsetOperationOR );
+}
+
+ZyanStatus ZyanBitsetXOR(ZyanBitset* destination, const ZyanBitset* source)
+{
+    return ZyanBitsetPerformByteOperation(destination, source, ZyanBitsetOperationXOR);
+}
+
+ZyanStatus ZyanBitsetFlip(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(&bitset->bits, i, (void**)&value));
+        *value = ~(*value);
+    }
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Bit access                                                                                     */
+/* ---------------------------------------------------------------------------------------------- */
+
+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**)&value));
+    *value |= (1 << ZYAN_BITSET_BIT_OFFSET(index));
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+ZyanStatus ZyanBitsetReset(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**)&value));
+    *value &= ~(1 << ZYAN_BITSET_BIT_OFFSET(index));
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+ZyanStatus ZyanBitsetAssign(ZyanBitset* bitset, ZyanUSize index, ZyanBool value)
+{
+    if (value)
+    {
+        return ZyanBitsetSet(bitset, index);
+    }
+    return ZyanBitsetReset(bitset, index);
+}
+
+ZyanStatus ZyanBitsetToggle(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**)&value));
+    *value ^= (1 << ZYAN_BITSET_BIT_OFFSET(index));
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+ZyanStatus ZyanBitsetTest(ZyanBitset* bitset, ZyanUSize index)
+{
+    if (!bitset)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+    if (index >= bitset->size)
+    {
+        return ZYAN_STATUS_OUT_OF_RANGE;
+    }
+
+    const ZyanU8* value;
+    ZYAN_CHECK(ZyanVectorGetPointer(&bitset->bits, index / 8, (const void**)&value));
+    if ((*value & (1 << ZYAN_BITSET_BIT_OFFSET(index))) == 0)
+    {
+        return ZYAN_STATUS_FALSE;
+    }
+    return ZYAN_STATUS_TRUE;
+}
+
+ZyanStatus ZyanBitsetTestMSB(ZyanBitset* bitset)
+{
+    if (!bitset)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    return ZyanBitsetTest(bitset, bitset->size - 1);
+}
+
+ZyanStatus ZyanBitsetTestLSB(ZyanBitset* bitset)
+{
+    return ZyanBitsetTest(bitset, 0);
+}
+
+/* ---------------------------------------------------------------------------------------------- */
+
+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(&bitset->bits, i, (void**)&value));
+        *value = 0xFF;
+    }
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+ZyanStatus ZyanBitsetResetAll(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(&bitset->bits, i, (void**)&value));
+        *value = 0x00;
+    }
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Size management                                                                                */
+/* ---------------------------------------------------------------------------------------------- */
+
+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(ZyanVectorPush(&bitset->bits, &zero));
+    }
+
+    return ZyanBitsetAssign(bitset, bitset->size - 1, value);
+}
+
+ZyanStatus ZyanBitsetPop(ZyanBitset* bitset)
+{
+    if (!bitset)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    if ((--bitset->size % 8) == 0)
+    {
+        return ZyanVectorPop(&bitset->bits);
+    }
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+ZyanStatus ZyanBitsetClear(ZyanBitset* bitset)
+{
+    if (!bitset)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    bitset->size = 0;
+    return ZyanVectorClear(&bitset->bits);
+}
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Memory management                                                                              */
+/* ---------------------------------------------------------------------------------------------- */
+
+ZyanStatus ZyanBitsetReserve(ZyanBitset* bitset, ZyanUSize count)
+{
+    return ZyanVectorReserve(&bitset->bits, ZYAN_BITSET_BITS_TO_BYTES(count));
+}
+
+ZyanStatus ZyanBitsetShrinkToFit(ZyanBitset* bitset)
+{
+    return ZyanVectorShrinkToFit(&bitset->bits);
+}
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Information                                                                                    */
+/* ---------------------------------------------------------------------------------------------- */
+
+ZyanStatus ZyanBitsetGetSize(const ZyanBitset* bitset, ZyanUSize* size)
+{
+    if (!bitset)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    *size = bitset->size;
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+ZyanStatus ZyanBitsetGetCapacity(const ZyanBitset* bitset, ZyanUSize* capacity)
+{
+    ZYAN_CHECK(ZyanBitsetGetCapacityBytes(bitset, capacity));
+    *capacity *= 8;
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+ZyanStatus ZyanBitsetGetSizeBytes(const ZyanBitset* bitset, ZyanUSize* size)
+{
+    if (!bitset)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    return ZyanVectorGetSize(&bitset->bits, size);
+}
+
+ZyanStatus ZyanBitsetGetCapacityBytes(const ZyanBitset* bitset, ZyanUSize* capacity)
+{
+    if (!bitset)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    return ZyanVectorGetCapacity(&bitset->bits, capacity);
+}
+
+/* ---------------------------------------------------------------------------------------------- */
+
+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;
+        ZYAN_CHECK(ZyanVectorGetPointer(&bitset->bits, i, (const void**)&value));
+
+        ZyanU8 popcnt = *value;
+        popcnt = (popcnt & 0x55) + ((popcnt >> 1) & 0x55);
+        popcnt = (popcnt & 0x33) + ((popcnt >> 2) & 0x33);
+        popcnt = (popcnt & 0x0F) + ((popcnt >> 4) & 0x0F);
+
+        *count += popcnt;
+    }
+
+    *count = ZYAN_MIN(*count, bitset->size);
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+ZyanStatus ZyanBitsetAll(const 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(ZyanVectorGetPointer(&bitset->bits, i, (const void**)&value));
+        if (i < (size - 1))
+        {
+            if (*value != 0xFF)
+            {
+                return ZYAN_STATUS_FALSE;
+            }
+        } else
+        {
+            const ZyanU8 mask = ~(8 - (bitset->size % 8));
+            if ((*value & mask) != mask)
+            {
+                return ZYAN_STATUS_FALSE;
+            }
+        }
+    }
+
+    return ZYAN_STATUS_TRUE;
+}
+
+ZyanStatus ZyanBitsetAny(const 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(ZyanVectorGetPointer(&bitset->bits, i, (const void**)&value));
+        if (i < (size - 1))
+        {
+            if (*value != 0x00)
+            {
+                return ZYAN_STATUS_TRUE;
+            }
+        } else
+        {
+            const ZyanU8 mask = ~(8 - (bitset->size % 8));
+            if ((*value & mask) != 0x00)
+            {
+                return ZYAN_STATUS_TRUE;
+            }
+        }
+    }
+
+    return ZYAN_STATUS_FALSE;
+}
+
+ZyanStatus ZyanBitsetNone(const 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(ZyanVectorGetPointer(&bitset->bits, i, (const void**)&value));
+        if (i < (size - 1))
+        {
+            if (*value != 0x00)
+            {
+                return ZYAN_STATUS_FALSE;
+            }
+        } else
+        {
+            const ZyanU8 mask = ~(8 - (bitset->size % 8));
+            if ((*value & mask) != 0x00)
+            {
+                return ZYAN_STATUS_FALSE;
+            }
+        }
+    }
+
+    return ZYAN_STATUS_TRUE;
+}
+
+/* ---------------------------------------------------------------------------------------------- */
+
+/* ============================================================================================== */
new file mode 100644
--- /dev/null
+++ b/js/src/zydis/Zycore/Bitset.h
@@ -0,0 +1,462 @@
+/***************************************************************************************************
+
+  Zyan Core Library (Zycore-C)
+
+  Original Author : Florian Bernd
+
+ * 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.
+
+***************************************************************************************************/
+
+/**
+ * @file
+ * @brief   Implements the bitset class.
+ */
+
+#ifndef ZYCORE_BITSET_H
+#define ZYCORE_BITSET_H
+
+#include "zydis/ZycoreExportConfig.h"
+#include "zydis/Zycore/Allocator.h"
+#include "zydis/Zycore/Status.h"
+#include "zydis/Zycore/Types.h"
+#include "zydis/Zycore/Vector.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* ============================================================================================== */
+/* Enums and types                                                                                */
+/* ============================================================================================== */
+
+/**
+ * @brief   Defines the `ZyanVector` struct.
+ *
+ * All fields in this struct should be considered as "private". Any changes may lead to unexpected
+ * behavior.
+ */
+typedef struct ZyanBitset_
+{
+    /**
+     * @brief   The bitset size.
+     */
+    ZyanUSize size;
+    /**
+     * @brief   The bitset data.
+     */
+    ZyanVector bits;
+} ZyanBitset;
+
+/**
+ * @brief   Defines the `ZyanBitsetByteOperation` function prototype.
+ *
+ * @param   v1  A pointer to the first byte. This value receives the result after performing the
+ *              desired operation.
+ * @param   v2  A pointer to the second byte.
+ *
+ * @return  A zyan status code.
+ *
+ * This function is used to perform byte-wise operations on two `ZyanBitset` instances.
+ */
+typedef ZyanStatus (*ZyanBitsetByteOperation)(ZyanU8* v1, const ZyanU8* v2);
+
+/* ============================================================================================== */
+/* Exported functions                                                                             */
+/* ============================================================================================== */
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Constructor and destructor                                                                     */
+/* ---------------------------------------------------------------------------------------------- */
+
+#ifndef ZYAN_NO_LIBC
+
+/**
+ * @brief   Initializes the given `ZyanBitset` instance.
+ *
+ * @param   bitset  A pointer to the `ZyanBitset` instance.
+ * @param   count   The initial amount of bits.
+ *
+ * @return  A zyan status code.
+ *
+ * The space for the bitset is dynamically allocated by the default allocator using the default
+ * growth factor of `2.0f` and the default shrink threshold of `0.5f`.
+ */
+ZYCORE_EXPORT ZYAN_REQUIRES_LIBC ZyanStatus ZyanBitsetInit(ZyanBitset* bitset, ZyanUSize count);
+
+#endif // ZYAN_NO_LIBC
+
+/**
+ * @brief   Initializes the given `ZyanBitset` instance and sets a custom `allocator` and memory
+ *          allocation/deallocation parameters.
+ *
+ * @param   bitset              A pointer to the `ZyanBitset` instance.
+ * @param   count               The initial amount of bits.
+ * @param   allocator           A pointer to a `ZyanAllocator` instance.
+ * @param   growth_factor       The growth factor (from `1.0f` to `x.xf`).
+ * @param   shrink_threshold    The shrink threshold (from `0.0f` to `1.0f`).
+ *
+ * @return  A zyan status code.
+ *
+ * A growth factor of `1.0f` disables overallocation and a shrink threshold of `0.0f` disables
+ * dynamic shrinking.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanBitsetInitEx(ZyanBitset* bitset, ZyanUSize count,
+    ZyanAllocator* allocator, float growth_factor, float shrink_threshold);
+
+/**
+ * @brief   Initializes the given `ZyanBitset` instance and configures it to use a custom user
+ *          defined buffer with a fixed size.
+ *
+ * @param   bitset      A pointer to the `ZyanBitset` instance.
+ * @param   count       The initial amount of bits.
+ * @param   buffer      A pointer to the buffer that is used as storage for the bits.
+ * @param   capacity    The maximum capacity (number of bytes) of the buffer.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanBitsetInitBuffer(ZyanBitset* bitset, ZyanUSize count, void* buffer,
+    ZyanUSize capacity);
+
+/**
+ * @brief   Destroys the given `ZyanBitset` instance.
+ *
+ * @param   bitset  A pointer to the `ZyanBitset` instance.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanBitsetDestroy(ZyanBitset* bitset);
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Logical operations                                                                             */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Performs a byte-wise `operation` for every byte in the given `ZyanBitset` instances.
+ *
+ * @param   destination A pointer to the `ZyanBitset` instance that is used as the first input and
+ *                      as the destination.
+ * @param   source      A pointer to the `ZyanBitset` instance that is used as the second input.
+ * @param   operation   A pointer to the function that performs the desired operation.
+ *
+ * @return  A zyan status code.
+ *
+ * The `operation` callback is invoked once for every byte in the smallest of the `ZyanBitset`
+ * instances.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanBitsetPerformByteOperation(ZyanBitset* destination,
+    const ZyanBitset* source, ZyanBitsetByteOperation operation);
+
+/**
+ * @brief   Performs a logical `AND` operation on the given `ZyanBitset` instances.
+ *
+ * @param   destination A pointer to the `ZyanBitset` instance that is used as the first input and
+ *                      as the destination.
+ * @param   source      A pointer to the `ZyanBitset` instance that is used as the second input.
+ *
+ * @return  A zyan status code.
+ *
+ * If the destination bitmask contains more bits than the source one, the state of the remaining
+ * bits will be undefined.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanBitsetAND(ZyanBitset* destination, const ZyanBitset* source);
+
+/**
+ * @brief   Performs a logical `OR`  operation on the given `ZyanBitset` instances.
+ *
+ * @param   destination A pointer to the `ZyanBitset` instance that is used as the first input and
+ *                      as the destination.
+ * @param   source      A pointer to the `ZyanBitset` instance that is used as the second input.
+ *
+ * @return  A zyan status code.
+ *
+ * If the destination bitmask contains more bits than the source one, the state of the remaining
+ * bits will be undefined.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanBitsetOR (ZyanBitset* destination, const ZyanBitset* source);
+
+/**
+ * @brief   Performs a logical `XOR` operation on the given `ZyanBitset` instances.
+ *
+ * @param   destination A pointer to the `ZyanBitset` instance that is used as the first input and
+ *                      as the destination.
+ * @param   source      A pointer to the `ZyanBitset` instance that is used as the second input.
+ *
+ * @return  A zyan status code.
+ *
+ * If the destination bitmask contains more bits than the source one, the state of the remaining
+ * bits will be undefined.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanBitsetXOR(ZyanBitset* destination, const ZyanBitset* source);
+
+/**
+ * @brief   Flips all bits of the given `ZyanBitset` instance.
+ *
+ * @param   bitset  A pointer to the `ZyanBitset` instance.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanBitsetFlip(ZyanBitset* bitset);
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Bit access                                                                                     */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Sets the bit at `index` of the given `ZyanBitset` instance to `1`.
+ *
+ * @param   bitset  A pointer to the `ZyanBitset` instance.
+ * @param   index   The bit index.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanBitsetSet(ZyanBitset* bitset, ZyanUSize index);
+
+/**
+ * @brief   Sets the bit at `index` of the given `ZyanBitset` instance to `0`.
+ *
+ * @param   bitset  A pointer to the `ZyanBitset` instance.
+ * @param   index   The bit index.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanBitsetReset(ZyanBitset* bitset, ZyanUSize index);
+
+/**
+ * @brief   Sets the bit at `index` of the given `ZyanBitset` instance to the specified `value`.
+ *
+ * @param   bitset  A pointer to the `ZyanBitset` instance.
+ * @param   index   The bit index.
+ * @param   value   The new value.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanBitsetAssign(ZyanBitset* bitset, ZyanUSize index, ZyanBool value);
+
+/**
+ * @brief   Toggles the bit at `index` of the given `ZyanBitset` instance.
+ *
+ * @param   bitset  A pointer to the `ZyanBitset` instance.
+ * @param   index   The bit index.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanBitsetToggle(ZyanBitset* bitset, ZyanUSize index);
+
+/**
+ * @brief   Returns the value of the bit at `index`.
+ *
+ * @param   bitset  A pointer to the `ZyanBitset` instance.
+ * @param   index   The bit index.
+ *
+ * @return  `ZYAN_STATUS_TRUE`, if the bit is set or `ZYAN_STATUS_FALSE`, if not, Another zyan
+ *          status code, if an error occured.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanBitsetTest(ZyanBitset* bitset, ZyanUSize index);
+
+/**
+ * @brief   Returns the value of the most significant bit.
+ *
+ * @param   bitset  A pointer to the `ZyanBitset` instance.
+ *
+ * @return  `ZYAN_STATUS_TRUE`, if the bit is set or `ZYAN_STATUS_FALSE`, if not. Another zyan
+ *          status code, if an error occured.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanBitsetTestMSB(ZyanBitset* bitset);
+
+/**
+ * @brief   Returns the value of the least significant bit.
+ *
+ * @param   bitset  A pointer to the `ZyanBitset` instance.
+ *
+ * @return  `ZYAN_STATUS_TRUE`, if the bit is set or `ZYAN_STATUS_FALSE`, if not. Another zyan
+ *          status code, if an error occured.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanBitsetTestLSB(ZyanBitset* bitset);
+
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Sets all bits of the given `ZyanBitset` instance to `1`.
+ *
+ * @param   bitset  A pointer to the `ZyanBitset` instance.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanBitsetSetAll(ZyanBitset* bitset);
+
+/**
+ * @brief   Sets all bits of the given `ZyanBitset` instance to `0`.
+ *
+ * @param   bitset  A pointer to the `ZyanBitset` instance.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanBitsetResetAll(ZyanBitset* bitset);
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Size management                                                                                */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Adds a new bit at the end of the bitset.
+ *
+ * @param   bitset  A pointer to the `ZyanBitset` instance.
+ * @param   value   The value of the new bit.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanBitsetPush(ZyanBitset* bitset, ZyanBool value);
+
+/**
+ * @brief   Removes the last bit of the bitset.
+ *
+ * @param   bitset  A pointer to the `ZyanBitset` instance.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanBitsetPop(ZyanBitset* bitset);
+
+/**
+ * @brief   Deletes all bits of the given `ZyanBitset` instance.
+ *
+ * @param   bitset  A pointer to the `ZyanBitset` instance.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanBitsetClear(ZyanBitset* bitset);
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Memory management                                                                              */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Changes the capacity of the given `ZyanBitset` instance.
+ *
+ * @param   bitset  A pointer to the `ZyanBitset` instance.
+ * @param   count   The new capacity (number of bits).
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanBitsetReserve(ZyanBitset* bitset, ZyanUSize count);
+
+/**
+ * @brief   Shrinks the capacity of the given bitset to match it's size.
+ *
+ * @param   bitset  A pointer to the `ZyanBitset` instance.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanBitsetShrinkToFit(ZyanBitset* bitset);
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Information                                                                                    */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Returns the current size of the bitset in bits.
+ *
+ * @param   bitset  A pointer to the `ZyanBitset` instance.
+ * @param   size    Receives the size of the bitset in bits.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanBitsetGetSize(const ZyanBitset* bitset, ZyanUSize* size);
+
+/**
+ * @brief   Returns the current capacity of the bitset in bits.
+ *
+ * @param   bitset      A pointer to the `ZyanBitset` instance.
+ * @param   capacity    Receives the size of the bitset in bits.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanBitsetGetCapacity(const ZyanBitset* bitset, ZyanUSize* capacity);
+
+/**
+ * @brief   Returns the current size of the bitset in bytes.
+ *
+ * @param   bitset  A pointer to the `ZyanBitset` instance.
+ * @param   size    Receives the size of the bitset in bytes.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanBitsetGetSizeBytes(const ZyanBitset* bitset, ZyanUSize* size);
+
+/**
+ * @brief   Returns the current capacity of the bitset in bytes.
+ *
+ * @param   bitset      A pointer to the `ZyanBitset` instance.
+ * @param   capacity    Receives the size of the bitset in bytes.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanBitsetGetCapacityBytes(const ZyanBitset* bitset, ZyanUSize* capacity);
+
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Returns the amount of bits set in the given bitset.
+ *
+ * @param   bitset  A pointer to the `ZyanBitset` instance.
+ * @param   count   Receives the amount of bits set in the given bitset.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanBitsetCount(const ZyanBitset* bitset, ZyanUSize* count);
+
+/**
+ * @brief   Checks, if all bits of the given bitset are set.
+ *
+ * @param   bitset  A pointer to the `ZyanBitset` instance.
+ *
+ * @return  `ZYAN_STATUS_TRUE`, if all bits are set, `ZYAN_STATUS_FALSE`, if not. Another zyan
+ *          status code, if an error occured.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanBitsetAll(const ZyanBitset* bitset);
+
+/**
+ * @brief   Checks, if at least one bit of the given bitset is set.
+ *
+ * @param   bitset  A pointer to the `ZyanBitset` instance.
+ *
+ * @return  `ZYAN_STATUS_TRUE`, if at least one bit is set, `ZYAN_STATUS_FALSE`, if not. Another
+ *          zyan status code, if an error occured.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanBitsetAny(const ZyanBitset* bitset);
+
+/**
+ * @brief   Checks, if none bits of the given bitset are set.
+ *
+ * @param   bitset  A pointer to the `ZyanBitset` instance.
+ *
+ * @return  `ZYAN_STATUS_TRUE`, if none bits are set, `ZYAN_STATUS_FALSE`, if not. Another zyan
+ *          status code, if an error occured.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanBitsetNone(const ZyanBitset* bitset);
+
+/* ---------------------------------------------------------------------------------------------- */
+
+/* ============================================================================================== */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* ZYCORE_BITSET_H */
new file mode 100644
--- /dev/null
+++ b/js/src/zydis/Zycore/Comparison.h
@@ -0,0 +1,316 @@
+/***************************************************************************************************
+
+  Zyan Core Library (Zycore-C)
+
+  Original Author : Florian Bernd
+
+ * 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.
+
+***************************************************************************************************/
+
+/**
+ * @file
+ * @brief   Defines prototypes of general-purpose comparison functions.
+ */
+
+#ifndef ZYCORE_COMPARISON_H
+#define ZYCORE_COMPARISON_H
+
+#include "zydis/Zycore/Defines.h"
+#include "zydis/Zycore/Types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* ============================================================================================== */
+/* Enums and types                                                                                */
+/* ============================================================================================== */
+
+/**
+ * @brief   Defines the `ZyanEqualityComparison` function prototype.
+ *
+ * @param   left    A pointer to the first element.
+ * @param   right   A pointer to the second element.
+ *
+ * @return  This function should return `ZYAN_TRUE` if the `left` element equals the `right` one
+ *          or `ZYAN_FALSE`, if not.
+ */
+typedef ZyanBool (*ZyanEqualityComparison)(const void* left, const void* right);
+
+/**
+ * @brief   Defines the `ZyanComparison` function prototype.
+ *
+ * @param   left    A pointer to the first element.
+ * @param   right   A pointer to the second element.
+ *
+ * @return  This function should return values in the following range:
+ *          `left == right -> result == 0`
+ *          `left <  right -> result  < 0`
+ *          `left >  right -> result  > 0`
+ */
+typedef ZyanI32 (*ZyanComparison)(const void* left, const void* right);
+
+/* ============================================================================================== */
+/* Macros                                                                                         */
+/* ============================================================================================== */
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Equality comparison functions                                                                  */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Declares a generic equality comparison function for an integral datatype.
+ *
+ * @param   name    The name of the function.
+ * @param   type    The name of the integral datatype.
+ */
+#define ZYAN_DECLARE_EQUALITY_COMPARISON(name, type) \
+    ZyanBool name(const type* left, const type* right) \
+    { \
+        ZYAN_ASSERT(left); \
+        ZYAN_ASSERT(right); \
+        \
+        return (*left == *right) ? ZYAN_TRUE : ZYAN_FALSE; \
+    }
+
+/**
+ * @brief   Declares a generic equality comparison function that compares a single integral
+ *          datatype field of a struct.
+ *
+ * @param   name        The name of the function.
+ * @param   type        The name of the integral datatype.
+ * @param   field_name  The name of the struct field.
+ */
+#define ZYAN_DECLARE_EQUALITY_COMPARISON_FOR_FIELD(name, type, field_name) \
+    ZyanBool name(const type* left, const type* right) \
+    { \
+        ZYAN_ASSERT(left); \
+        ZYAN_ASSERT(right); \
+        \
+        return (left->field_name == right->field_name) ? ZYAN_TRUE : ZYAN_FALSE; \
+    }
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Comparison functions                                                                           */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Declares a generic comparison function for an integral datatype.
+ *
+ * @param   name    The name of the function.
+ * @param   type    The name of the integral datatype.
+ */
+#define ZYAN_DECLARE_COMPARISON(name, type) \
+    ZyanI32 name(const type* left, const type* right) \
+    { \
+        ZYAN_ASSERT(left); \
+        ZYAN_ASSERT(right); \
+        \
+        if (*left < *right) \
+        { \
+            return -1; \
+        } \
+        if (*left > *right) \
+        { \
+            return  1; \
+        } \
+        return 0; \
+    }
+
+/**
+ * @brief   Declares a generic comparison function that compares a single integral datatype field
+ *          of a struct.
+ *
+ * @param   name        The name of the function.
+ * @param   type        The name of the integral datatype.
+ * @param   field_name  The name of the struct field.
+ */
+#define ZYAN_DECLARE_COMPARISON_FOR_FIELD(name, type, field_name) \
+    ZyanI32 name(const type* left, const type* right) \
+    { \
+        ZYAN_ASSERT(left); \
+        ZYAN_ASSERT(right); \
+        \
+        if (left->field_name < right->field_name) \
+        { \
+            return -1; \
+        } \
+        if (left->field_name > right->field_name) \
+        { \
+            return  1; \
+        } \
+        return 0; \
+    }
+
+ /* ---------------------------------------------------------------------------------------------- */
+
+/* ============================================================================================== */
+/* Exported functions                                                                             */
+/* ============================================================================================== */
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Default equality comparison functions                                                          */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Defines a default equality comparison function for pointer values.
+ *
+ * @param   left    A pointer to the first value.
+ * @param   right   A pointer to the second value.
+ *
+ * @return  Returns `ZYAN_TRUE` if the `left` value equals the `right` one or `ZYAN_FALSE`, if
+ *          not.
+ */
+ZYAN_INLINE ZYAN_DECLARE_EQUALITY_COMPARISON(ZyanEqualsPointer, void* const)
+
+/**
+ * @brief   Defines a default equality comparison function for `ZyanBool` values.
+ *
+ * @param   left    A pointer to the first value.
+ * @param   right   A pointer to the second value.
+ *
+ * @return  Returns `ZYAN_TRUE` if the `left` value equals the `right` one or `ZYAN_FALSE`, if
+ *          not.
+ */
+ZYAN_INLINE ZYAN_DECLARE_EQUALITY_COMPARISON(ZyanEqualsBool, ZyanBool)
+
+/**
+ * @brief   Defines a default equality comparison function for 8-bit numeric values.
+ *
+ * @param   left    A pointer to the first value.
+ * @param   right   A pointer to the second value.
+ *
+ * @return  Returns `ZYAN_TRUE` if the `left` value equals the `right` one or `ZYAN_FALSE`, if
+ *          not.
+ */
+ZYAN_INLINE ZYAN_DECLARE_EQUALITY_COMPARISON(ZyanEqualsNumeric8, ZyanU8)
+
+/**
+ * @brief   Defines a default equality comparison function for 16-bit numeric values.
+ *
+ * @param   left    A pointer to the first value.
+ * @param   right   A pointer to the second value.
+ *
+ * @return  Returns `ZYAN_TRUE` if the `left` value equals the `right` one or `ZYAN_FALSE`, if
+ *          not.
+ */
+ZYAN_INLINE ZYAN_DECLARE_EQUALITY_COMPARISON(ZyanEqualsNumeric16, ZyanU16)
+
+/**
+ * @brief   Defines a default equality comparison function for 32-bit numeric values.
+ *
+ * @param   left    A pointer to the first value.
+ * @param   right   A pointer to the second value.
+ *
+ * @return  Returns `ZYAN_TRUE` if the `left` value equals the `right` one or `ZYAN_FALSE`, if
+ *          not.
+ */
+ZYAN_INLINE ZYAN_DECLARE_EQUALITY_COMPARISON(ZyanEqualsNumeric32, ZyanU32)
+
+/**
+ * @brief   Defines a default equality comparison function for 64-bit numeric values.
+ *
+ * @param   left    A pointer to the first value.
+ * @param   right   A pointer to the second value.
+ *
+ * @return  Returns `ZYAN_TRUE` if the `left` value equals the `right` one or `ZYAN_FALSE`, if
+ *          not.
+ */
+ZYAN_INLINE ZYAN_DECLARE_EQUALITY_COMPARISON(ZyanEqualsNumeric64, ZyanU64)
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Default comparison functions                                                                   */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Defines a default comparison function for pointer values.
+ *
+ * @param   left    A pointer to the first value.
+ * @param   right   A pointer to the second value.
+ *
+ * @return  Returns `0` if the `left` value equals the `right` one, `-1` if the `left` value is
+ *          less than the `right` one, or `1` if the `left` value is greater than the `right` one.
+ */
+ZYAN_INLINE ZYAN_DECLARE_COMPARISON(ZyanComparePointer, void* const)
+
+/**
+ * @brief   Defines a default comparison function for `ZyanBool` values.
+ *
+ * @param   left    A pointer to the first value.
+ * @param   right   A pointer to the second value.
+ *
+ * @return  Returns `0` if the `left` value equals the `right` one, `-1` if the `left` value is
+ *          less than the `right` one, or `1` if the `left` value is greater than the `right` one.
+ */
+ZYAN_INLINE ZYAN_DECLARE_COMPARISON(ZyanCompareBool, ZyanBool)
+
+/**
+ * @brief   Defines a default comparison function for 8-bit numeric values.
+ *
+ * @param   left    A pointer to the first value.
+ * @param   right   A pointer to the second value.
+ *
+ * @return  Returns `0` if the `left` value equals the `right` one, `-1` if the `left` value is
+ *          less than the `right` one, or `1` if the `left` value is greater than the `right` one.
+ */
+ZYAN_INLINE ZYAN_DECLARE_COMPARISON(ZyanCompareNumeric8, ZyanU8)
+
+/**
+ * @brief   Defines a default comparison function for 16-bit numeric values.
+ *
+ * @param   left    A pointer to the first value.
+ * @param   right   A pointer to the second value.
+ *
+ * @return  Returns `0` if the `left` value equals the `right` one, `-1` if the `left` value is
+ *          less than the `right` one, or `1` if the `left` value is greater than the `right` one.
+ */
+ZYAN_INLINE ZYAN_DECLARE_COMPARISON(ZyanCompareNumeric16, ZyanU16)
+
+/**
+ * @brief   Defines a default comparison function for 32-bit numeric values.
+ *
+ * @param   left    A pointer to the first value.
+ * @param   right   A pointer to the second value.
+ *
+ * @return  Returns `0` if the `left` value equals the `right` one, `-1` if the `left` value is
+ *          less than the `right` one, or `1` if the `left` value is greater than the `right` one.
+ */
+ZYAN_INLINE ZYAN_DECLARE_COMPARISON(ZyanCompareNumeric32, ZyanU32)
+
+/**
+ * @brief   Defines a default comparison function for 64-bit numeric values.
+ *
+ * @param   left    A pointer to the first value.
+ * @param   right   A pointer to the second value.
+ *
+ * @return  Returns `0` if the `left` value equals the `right` one, `-1` if the `left` value is
+ *          less than the `right` one, or `1` if the `left` value is greater than the `right` one.
+ */
+ZYAN_INLINE ZYAN_DECLARE_COMPARISON(ZyanCompareNumeric64, ZyanU64)
+
+/* ---------------------------------------------------------------------------------------------- */
+
+/* ============================================================================================== */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* ZYCORE_COMPARISON_H */
new file mode 100644
--- /dev/null
+++ b/js/src/zydis/Zycore/Defines.h
@@ -0,0 +1,430 @@
+/***************************************************************************************************
+
+  Zyan Core Library (Zycore-C)
+
+  Original Author : Florian Bernd, Joel Hoener
+
+ * 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.
+
+***************************************************************************************************/
+
+/**
+ * @file
+ * @brief   General helper and platform detection macros.
+ */
+
+#ifndef ZYCORE_DEFINES_H
+#define ZYCORE_DEFINES_H
+
+/* ============================================================================================== */
+/* Meta macros                                                                                    */
+/* ============================================================================================== */
+
+/**
+ * @brief   Concatenates two values using the stringify operator (`##`).
+ *
+ * @brief   x   The first value.
+ * @brief   y   The second value.
+ *
+ * @return  The combined string of the given values.
+ */
+#define ZYAN_MACRO_CONCAT(x, y) x ## y
+
+/**
+ * @brief   Concatenates two values using the stringify operator (`##`) and expands the value to
+ *          be used in another macro.
+ *
+ * @brief   x   The first value.
+ * @brief   y   The second value.
+ *
+ * @return  The combined string of the given values.
+ */
+#define ZYAN_MACRO_CONCAT_EXPAND(x, y) ZYAN_MACRO_CONCAT(x, y)
+
+/* ============================================================================================== */
+/* Compiler detection                                                                             */
+/* ============================================================================================== */
+
+#if defined(__clang__)
+#   define ZYAN_CLANG
+#   define ZYAN_GNUC
+#elif defined(__ICC) || defined(__INTEL_COMPILER)
+#   define ZYAN_ICC
+#elif defined(__GNUC__) || defined(__GNUG__)
+#   define ZYAN_GCC
+#   define ZYAN_GNUC
+#elif defined(_MSC_VER)
+#   define ZYAN_MSVC
+#elif defined(__BORLANDC__)
+#   define ZYAN_BORLAND
+#else
+#   define ZYAN_UNKNOWN_COMPILER
+#endif
+
+/* ============================================================================================== */
+/* Platform detection                                                                             */
+/* ============================================================================================== */
+
+#if defined(_WIN32)
+#   define ZYAN_WINDOWS
+#elif defined(__EMSCRIPTEN__)
+#   define ZYAN_EMSCRIPTEN
+#elif defined(__APPLE__)
+#   define ZYAN_APPLE
+#   define ZYAN_POSIX
+#elif defined(__linux)
+#   define ZYAN_LINUX
+#   define ZYAN_POSIX
+#elif defined(__FreeBSD__)
+#   define ZYAN_FREEBSD
+#   define ZYAN_POSIX
+#elif defined(__unix)
+#   define ZYAN_UNIX
+#   define ZYAN_POSIX
+#elif defined(__posix)
+#   define ZYAN_POSIX
+#else
+#   define ZYAN_UNKNOWN_PLATFORM
+#endif
+
+/* ============================================================================================== */
+/* Kernel mode detection                                                                          */
+/* ============================================================================================== */
+
+#if (defined(ZYAN_WINDOWS) && defined(_KERNEL_MODE)) || \
+    (defined(ZYAN_APPLE) && defined(KERNEL)) || \
+    (defined(ZYAN_LINUX) && defined(__KERNEL__)) || \
+    (defined(__FreeBSD_kernel__))
+#   define ZYAN_KERNEL
+#else
+#   define ZYAN_USER
+#endif
+
+/* ============================================================================================== */
+/* Architecture detection                                                                         */
+/* ============================================================================================== */
+
+#if defined(_M_AMD64) || defined(__x86_64__)
+#   define ZYAN_X64
+#elif defined(_M_IX86) || defined(__i386__)
+#   define ZYAN_X86
+#elif defined(_M_ARM64) || defined(__aarch64__)
+#   define ZYAN_AARCH64
+#elif defined(_M_ARM) || defined(_M_ARMT) || defined(__arm__) || defined(__thumb__)
+#   define ZYAN_ARM
+#elif defined(__EMSCRIPTEN__)
+    // Nothing to do, `ZYAN_EMSCRIPTEN` is both platform and arch macro for this one.
+#else
+#   error "Unsupported architecture detected"
+#endif
+
+/* ============================================================================================== */
+/* Debug/Release detection                                                                        */
+/* ============================================================================================== */
+
+#if defined(ZYAN_MSVC) || defined(ZYAN_BORLAND)
+#   ifdef _DEBUG
+#       define ZYAN_DEBUG
+#   else
+#       define ZYAN_RELEASE
+#   endif
+#elif defined(ZYAN_GNUC) || defined(ZYAN_ICC)
+#   ifdef NDEBUG
+#       define ZYAN_RELEASE
+#   else
+#       define ZYAN_DEBUG
+#   endif
+#else
+#   define ZYAN_RELEASE
+#endif
+
+/* ============================================================================================== */
+/* Misc compatibility macros                                                                      */
+/* ============================================================================================== */
+
+#if defined(ZYAN_MSVC) || defined(ZYAN_BORLAND)
+#   define ZYAN_INLINE __inline
+#else
+#   define ZYAN_INLINE static inline
+#endif
+
+/* ============================================================================================== */
+/* Debugging and optimization macros                                                              */
+/* ============================================================================================== */
+
+/**
+ * @brief   Runtime debug assersion.
+ */
+#if defined(ZYAN_NO_LIBC)
+#   define ZYAN_ASSERT(condition) (void)(condition)
+#elif defined(ZYAN_WINDOWS) && defined(ZYAN_KERNEL)
+#   include <wdm.h>
+#   define ZYAN_ASSERT(condition) NT_ASSERT(condition)
+#else
+#   include <assert.h>
+#   define ZYAN_ASSERT(condition) assert(condition)
+#endif
+
+/**
+ * @brief   Compiler-time assertion.
+ */
+#if __STDC_VERSION__ >= 201112L
+#   define ZYAN_STATIC_ASSERT(x) _Static_assert(x, #x)
+#else
+#   define ZYAN_STATIC_ASSERT(x) \
+        typedef int ZYAN_MACRO_CONCAT_EXPAND(ZYAN_SASSERT_, __COUNTER__) [(x) ? 1 : -1]
+#endif
+
+/**
+ * @brief	Marks the current code path as unreachable.
+ */
+#if defined(ZYAN_RELEASE)
+#   if defined(ZYAN_CLANG) // GCC eagerly evals && RHS, we have to use nested ifs.
+#       if __has_builtin(__builtin_unreachable)
+#           define ZYAN_UNREACHABLE __builtin_unreachable()
+#       else
+#           define ZYAN_UNREACHABLE for(;;)
+#       endif
+#   elif defined(ZYAN_GCC) && ((__GNUC__ == 4 && __GNUC_MINOR__ > 4) || __GNUC__ > 4)
+#       define ZYAN_UNREACHABLE __builtin_unreachable()
+#   elif defined(ZYAN_ICC)
+#       ifdef ZYAN_WINDOWS
+#           include <stdlib.h> // "missing return statement" workaround
+#           define ZYAN_UNREACHABLE __assume(0); (void)abort()
+#       else
+#           define ZYAN_UNREACHABLE __builtin_unreachable()
+#       endif
+#   elif defined(ZYAN_MSVC)
+#       define ZYAN_UNREACHABLE __assume(0)
+#   else
+#       define ZYAN_UNREACHABLE for(;;)
+#   endif
+#elif defined(ZYAN_NO_LIBC)
+#   define ZYAN_UNREACHABLE for(;;)
+#elif defined(ZYAN_WINDOWS) && defined(ZYAN_KERNEL)
+#   define ZYAN_UNREACHABLE { __fastfail(0); for(;;){} }
+#else
+#   include <stdlib.h>
+#   define ZYAN_UNREACHABLE { assert(0); abort(); }
+#endif
+
+/* ============================================================================================== */
+/* Utils                                                                                          */
+/* ============================================================================================== */
+
+/* ---------------------------------------------------------------------------------------------- */
+/* General purpose                                                                                */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Marks the specified parameter as unused.
+ *
+ * @param   x   The name of the unused parameter.
+ */
+#define ZYAN_UNUSED(x) (void)(x)
+
+/**
+ * @brief   Intentional fallthrough.
+ */
+#if defined(ZYAN_GCC) && __GNUC__ > 7
+#   define ZYAN_FALLTHROUGH __attribute__ ((fallthrough))
+#else
+#   define ZYAN_FALLTHROUGH
+#endif
+
+/**
+ * @brief   Declares a bitfield.
+ *
+ * @param   x   The size (in bits) of the bitfield.
+ */
+#define ZYAN_BITFIELD(x) : x
+
+/**
+ * @brief   Marks functions that require libc (cannot be used with `ZYAN_NO_LIBC`).
+ */
+#define ZYAN_REQUIRES_LIBC
+
+/**
+ * @brief   Decorator for `printf`-style functions.
+ *
+ * @param   format_index    The 1-based index of the format string parameter.
+ * @param   first_to_check  The 1-based index of the format arguments parameter.
+ */
+#if defined(__RESHARPER__)
+#   define ZYAN_PRINTF_ATTR(format_index, first_to_check) \
+        [[gnu::format(printf, format_index, first_to_check)]]
+#elif defined(ZYAN_GCC)
+#   define ZYAN_PRINTF_ATTR(format_index, first_to_check) \
+        __attribute__((format(printf, format_index, first_to_check)))
+#else
+#   define ZYAN_PRINTF_ATTR(format_index, first_to_check)
+#endif
+
+/**
+ * @brief   Decorator for `wprintf`-style functions.
+ *
+ * @param   format_index    The 1-based index of the format string parameter.
+ * @param   first_to_check  The 1-based index of the format arguments parameter.
+ */
+#if defined(__RESHARPER__)
+#   define ZYAN_WPRINTF_ATTR(format_index, first_to_check) \
+        [[rscpp::format(wprintf, format_index, first_to_check)]]
+#else
+#   define ZYAN_WPRINTF_ATTR(format_index, first_to_check)
+#endif
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Arrays                                                                                         */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Returns the length (number of elements) of an array.
+ *
+ * @param   a   The name of the array.
+ *
+ * @return  The number of elements of the given array.
+ */
+#define ZYAN_ARRAY_LENGTH(a) (sizeof(a) / sizeof((a)[0]))
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Arithmetic                                                                                     */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Returns the smaller value of `a` or `b`.
+ *
+ * @param   a   The first value.
+ * @param   b   The second value.
+ *
+ * @return  The smaller value of `a` or `b`.
+ */
+#define ZYAN_MIN(a, b) (((a) < (b)) ? (a) : (b))
+
+/**
+ * @brief   Returns the bigger value of `a` or `b`.
+ *
+ * @param   a   The first value.
+ * @param   b   The second value.
+ *
+ * @return  The bigger value of `a` or `b`.
+ */
+#define ZYAN_MAX(a, b) (((a) > (b)) ? (a) : (b))
+
+/**
+ * @brief   Returns the absolute value of `a`.
+ *
+ * @param   a   The value.
+ *
+ * @return  The absolute value of `a`.
+ */
+#define ZYAN_ABS(a) (((a) < 0) ? -(a) : (a))
+
+/**
+ * @brief   Checks, if the given value is a power of 2.
+ *
+ * @param   x   The value.
+ *
+ * @return  `ZYAN_TRUE`, if the given value is a power of 2 or `ZYAN_FALSE`, if not.
+ *
+ * Note that this macro always returns `ZYAN_TRUE` for `x == 0`.
+ */
+#define ZYAN_IS_POWER_OF_2(x) (((x) & ((x) - 1)) == 0)
+
+/**
+ * @brief   Checks, if the given value is properly aligned.
+ *
+ * Note that this macro only works for powers of 2.
+ */
+#define ZYAN_IS_ALIGNED_TO(x, align) ((x & (align - 1)) == 0)
+
+/**
+ * @brief   Aligns the value to the nearest given alignment boundary (by rounding it up).
+ *
+ * @param   x       The value.
+ * @param   align   The desired alignment.
+ *
+ * @return  The aligned value.
+ *
+ * Note that this macro only works for powers of 2.
+ */
+#define ZYAN_ALIGN_UP(x, align) (((x) + (align) - 1) & ~((align) - 1))
+
+/**
+ * @brief   Aligns the value to the nearest given alignment boundary (by rounding it down).
+ *
+ * @param   x       The value.
+ * @param   align   The desired alignment.
+ *
+ * @return  The aligned value.
+ *
+ * Note that this macro only works for powers of 2.
+ */
+#define ZYAN_ALIGN_DOWN(x, align) (((x) - 1) & ~((align) - 1))
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Bit operations                                                                                 */
+/* ---------------------------------------------------------------------------------------------- */
+
+/*
+ * @brief   Checks, if the bit at index `b` is required to present the ordinal value `n`.
+ *
+ * @param   n   The ordinal value.
+ * @param   b   The bit index.
+ *
+ * @return  `ZYAN_TRUE`, if the bit at index `b` is required to present the ordinal value `n` or
+ *          `ZYAN_FALSE`, if not.
+ *
+ * Note that this macro always returns `ZYAN_FALSE` for `n == 0`.
+ */
+#define ZYAN_NEEDS_BIT(n, b) (((unsigned long)(n) >> (b)) > 0)
+
+/*
+ * @brief   Returns the number of bits required to represent the ordinal value `n`.
+ *
+ * @param   n   The ordinal value.
+ *
+ * @return  The number of bits required to represent the ordinal value `n`.
+ *
+ * Note that this macro returns `0` for `n == 0`.
+ */
+#define ZYAN_BITS_TO_REPRESENT(n) \
+    ( \
+        ZYAN_NEEDS_BIT(n,  0) + ZYAN_NEEDS_BIT(n,  1) + \
+        ZYAN_NEEDS_BIT(n,  2) + ZYAN_NEEDS_BIT(n,  3) + \
+        ZYAN_NEEDS_BIT(n,  4) + ZYAN_NEEDS_BIT(n,  5) + \
+        ZYAN_NEEDS_BIT(n,  6) + ZYAN_NEEDS_BIT(n,  7) + \
+        ZYAN_NEEDS_BIT(n,  8) + ZYAN_NEEDS_BIT(n,  9) + \
+        ZYAN_NEEDS_BIT(n, 10) + ZYAN_NEEDS_BIT(n, 11) + \
+        ZYAN_NEEDS_BIT(n, 12) + ZYAN_NEEDS_BIT(n, 13) + \
+        ZYAN_NEEDS_BIT(n, 14) + ZYAN_NEEDS_BIT(n, 15) + \
+        ZYAN_NEEDS_BIT(n, 16) + ZYAN_NEEDS_BIT(n, 17) + \
+        ZYAN_NEEDS_BIT(n, 18) + ZYAN_NEEDS_BIT(n, 19) + \
+        ZYAN_NEEDS_BIT(n, 20) + ZYAN_NEEDS_BIT(n, 21) + \
+        ZYAN_NEEDS_BIT(n, 22) + ZYAN_NEEDS_BIT(n, 23) + \
+        ZYAN_NEEDS_BIT(n, 24) + ZYAN_NEEDS_BIT(n, 25) + \
+        ZYAN_NEEDS_BIT(n, 26) + ZYAN_NEEDS_BIT(n, 27) + \
+        ZYAN_NEEDS_BIT(n, 28) + ZYAN_NEEDS_BIT(n, 29) + \
+        ZYAN_NEEDS_BIT(n, 30) + ZYAN_NEEDS_BIT(n, 31)   \
+    )
+
+/* ---------------------------------------------------------------------------------------------- */
+
+/* ============================================================================================== */
+
+#endif /* ZYCORE_DEFINES_H */
new file mode 100644
--- /dev/null
+++ b/js/src/zydis/Zycore/Format.c
@@ -0,0 +1,507 @@
+/***************************************************************************************************
+
+  Zyan Core Library (Zycore-C)
+
+  Original Author : Florian Bernd
+
+ * 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.
+
+***************************************************************************************************/
+
+#include "zydis/Zycore/Format.h"
+#include "zydis/Zycore/LibC.h"
+
+/* ============================================================================================== */
+/* Constants                                                                                      */
+/* ============================================================================================== */
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Defines                                                                                        */
+/* ---------------------------------------------------------------------------------------------- */
+
+#define ZYCORE_MAXCHARS_DEC_32 10
+#define ZYCORE_MAXCHARS_DEC_64 20
+#define ZYCORE_MAXCHARS_HEX_32  8
+#define ZYCORE_MAXCHARS_HEX_64 16
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Lookup Tables                                                                                  */
+/* ---------------------------------------------------------------------------------------------- */
+
+static const char* const DECIMAL_LOOKUP =
+    "00010203040506070809"
+    "10111213141516171819"
+    "20212223242526272829"
+    "30313233343536373839"
+    "40414243444546474849"
+    "50515253545556575859"
+    "60616263646566676869"
+    "70717273747576777879"
+    "80818283848586878889"
+    "90919293949596979899";
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Static strings                                                                                 */
+/* ---------------------------------------------------------------------------------------------- */
+
+static const ZyanStringView STR_ADD = ZYAN_DEFINE_STRING_VIEW("+");
+static const ZyanStringView STR_SUB = ZYAN_DEFINE_STRING_VIEW("-");
+
+/* ---------------------------------------------------------------------------------------------- */
+
+/* ============================================================================================== */
+/* Internal macros                                                                                */
+/* ============================================================================================== */
+
+/**
+ * @brief   Writes a terminating '\0' character at the end of the string data.
+ */
+#define ZYCORE_STRING_NULLTERMINATE(string) \
+      *(char*)((ZyanU8*)(string)->vector.data + (string)->vector.size - 1) = '\0';
+
+/* ============================================================================================== */
+/* Internal functions                                                                             */
+/* ============================================================================================== */
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Decimal                                                                                        */
+/* ---------------------------------------------------------------------------------------------- */
+
+#if defined(ZYAN_X86) || defined(ZYAN_ARM) || defined(ZYAN_EMSCRIPTEN)
+ZyanStatus ZyanStringAppendDecU32(ZyanString* string, ZyanU32 value, ZyanU8 padding_length)
+{
+    if (!string)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    char buffer[ZYCORE_MAXCHARS_DEC_32];
+    char *buffer_end = &buffer[ZYCORE_MAXCHARS_DEC_32];
+    char *buffer_write_pointer = buffer_end;
+    while (value >= 100)
+    {
+        const ZyanU32 value_old = value;
+        buffer_write_pointer -= 2;
+        value /= 100;
+        ZYAN_MEMCPY(buffer_write_pointer, &DECIMAL_LOOKUP[(value_old - (value * 100)) * 2], 2);
+    }
+    buffer_write_pointer -= 2;
+    ZYAN_MEMCPY(buffer_write_pointer, &DECIMAL_LOOKUP[value * 2], 2);
+
+    const ZyanUSize offset_odd    = (ZyanUSize)(value < 10);
+    const ZyanUSize length_number = buffer_end - buffer_write_pointer - offset_odd;
+    const ZyanUSize length_total  = ZYAN_MAX(length_number, padding_length);
+    const ZyanUSize length_target = string->vector.size;
+
+    if (string->vector.size + length_total > string->vector.capacity)
+    {
+        ZYAN_CHECK(ZyanStringResize(string, string->vector.size + length_total - 1));
+    }
+
+    ZyanUSize offset_write = 0;
+    if (padding_length > length_number)
+    {
+        offset_write = padding_length - length_number;
+        ZYAN_MEMSET((char*)string->vector.data + length_target - 1, '0', offset_write);
+    }
+
+    ZYAN_MEMCPY((char*)string->vector.data + length_target + offset_write - 1,
+        buffer_write_pointer + offset_odd, length_number);
+    string->vector.size = length_target + length_total;
+    ZYCORE_STRING_NULLTERMINATE(string);
+
+    return ZYAN_STATUS_SUCCESS;
+}
+#endif
+
+ZyanStatus ZyanStringAppendDecU64(ZyanString* string, ZyanU64 value, ZyanU8 padding_length)
+{
+    if (!string)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    char buffer[ZYCORE_MAXCHARS_DEC_64];
+    char *buffer_end = &buffer[ZYCORE_MAXCHARS_DEC_64];
+    char *buffer_write_pointer = buffer_end;
+    while (value >= 100)
+    {
+        const ZyanU64 value_old = value;
+        buffer_write_pointer -= 2;
+        value /= 100;
+        ZYAN_MEMCPY(buffer_write_pointer, &DECIMAL_LOOKUP[(value_old - (value * 100)) * 2], 2);
+    }
+    buffer_write_pointer -= 2;
+    ZYAN_MEMCPY(buffer_write_pointer, &DECIMAL_LOOKUP[value * 2], 2);
+
+    const ZyanUSize offset_odd    = (ZyanUSize)(value < 10);
+    const ZyanUSize length_number = buffer_end - buffer_write_pointer - offset_odd;
+    const ZyanUSize length_total  = ZYAN_MAX(length_number, padding_length);
+    const ZyanUSize length_target = string->vector.size;
+
+    if (string->vector.size + length_total > string->vector.capacity)
+    {
+        ZYAN_CHECK(ZyanStringResize(string, string->vector.size + length_total - 1));
+    }
+
+    ZyanUSize offset_write = 0;
+    if (padding_length > length_number)
+    {
+        offset_write = padding_length - length_number;
+        ZYAN_MEMSET((char*)string->vector.data + length_target - 1, '0', offset_write);
+    }
+
+    ZYAN_MEMCPY((char*)string->vector.data + length_target + offset_write - 1,
+        buffer_write_pointer + offset_odd, length_number);
+    string->vector.size = length_target + length_total;
+    ZYCORE_STRING_NULLTERMINATE(string);
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Hexadecimal                                                                                    */
+/* ---------------------------------------------------------------------------------------------- */
+
+#if defined(ZYAN_X86) || defined(ZYAN_ARM) || defined(ZYAN_EMSCRIPTEN)
+ZyanStatus ZyanStringAppendHexU32(ZyanString* string, ZyanU32 value, ZyanU8 padding_length,
+    ZyanBool uppercase)
+{
+    if (!string)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    const ZyanUSize len = string->vector.size;
+    ZyanUSize remaining = string->vector.capacity - string->vector.size;
+
+    if (remaining < (ZyanUSize)padding_length)
+    {
+        ZYAN_CHECK(ZyanStringResize(string, len + padding_length - 1));
+        remaining = padding_length;
+    }
+
+    if (!value)
+    {
+        const ZyanU8 n = (padding_length ? padding_length : 1);
+
+        if (remaining < (ZyanUSize)n)
+        {
+            ZYAN_CHECK(ZyanStringResize(string, string->vector.size + n - 1));
+        }
+
+        ZYAN_MEMSET((char*)string->vector.data + len - 1, '0', n);
+        string->vector.size = len + n;
+        ZYCORE_STRING_NULLTERMINATE(string);
+
+        return ZYAN_STATUS_SUCCESS;
+    }
+
+    ZyanU8 n = 0;
+    char* buffer = ZYAN_NULL;
+    for (ZyanI8 i = ZYCORE_MAXCHARS_HEX_32 - 1; i >= 0; --i)
+    {
+        const ZyanU8 v = (value >> i * 4) & 0x0F;
+        if (!n)
+        {
+            if (!v)
+            {
+                continue;
+            }
+            if (remaining <= (ZyanU8)i)
+            {
+                ZYAN_CHECK(ZyanStringResize(string, string->vector.size + i));
+            }
+            buffer = (char*)string->vector.data + len - 1;
+            if (padding_length > i)
+            {
+                n = padding_length - i - 1;
+                ZYAN_MEMSET(buffer, '0', n);
+            }
+        }
+        ZYAN_ASSERT(buffer);
+        if (uppercase)
+        {
+            buffer[n++] = "0123456789ABCDEF"[v];
+        } else
+        {
+            buffer[n++] = "0123456789abcdef"[v];
+        }
+    }
+    string->vector.size = len + n;
+    ZYCORE_STRING_NULLTERMINATE(string);
+
+    return ZYAN_STATUS_SUCCESS;
+}
+#endif
+
+ZyanStatus ZyanStringAppendHexU64(ZyanString* string, ZyanU64 value, ZyanU8 padding_length,
+    ZyanBool uppercase)
+{
+    if (!string)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    const ZyanUSize len = string->vector.size;
+    ZyanUSize remaining = string->vector.capacity - string->vector.size;
+
+    if (remaining < (ZyanUSize)padding_length)
+    {
+        ZYAN_CHECK(ZyanStringResize(string, len + padding_length - 1));
+        remaining = padding_length;
+    }
+
+    if (!value)
+    {
+        const ZyanU8 n = (padding_length ? padding_length : 1);
+
+        if (remaining < (ZyanUSize)n)
+        {
+            ZYAN_CHECK(ZyanStringResize(string, string->vector.size + n - 1));
+        }
+
+        ZYAN_MEMSET((char*)string->vector.data + len - 1, '0', n);
+        string->vector.size = len + n;
+        ZYCORE_STRING_NULLTERMINATE(string);
+
+        return ZYAN_STATUS_SUCCESS;
+    }
+
+    ZyanU8 n = 0;
+    char* buffer = ZYAN_NULL;
+    for (ZyanI8 i = ((value & 0xFFFFFFFF00000000) ?
+        ZYCORE_MAXCHARS_HEX_64 : ZYCORE_MAXCHARS_HEX_32) - 1; i >= 0; --i)
+    {
+        const ZyanU8 v = (value >> i * 4) & 0x0F;
+        if (!n)
+        {
+            if (!v)
+            {
+                continue;
+            }
+            if (remaining <= (ZyanU8)i)
+            {
+                ZYAN_CHECK(ZyanStringResize(string, string->vector.size + i));
+            }
+            buffer = (char*)string->vector.data + len - 1;
+            if (padding_length > i)
+            {
+                n = padding_length - i - 1;
+                ZYAN_MEMSET(buffer, '0', n);
+            }
+        }
+        ZYAN_ASSERT(buffer);
+        if (uppercase)
+        {
+            buffer[n++] = "0123456789ABCDEF"[v];
+        } else
+        {
+            buffer[n++] = "0123456789abcdef"[v];
+        }
+    }
+    string->vector.size = len + n;
+    ZYCORE_STRING_NULLTERMINATE(string);
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+/* ---------------------------------------------------------------------------------------------- */
+
+/* ============================================================================================== */
+/* Exported functions                                                                             */
+/* ============================================================================================== */
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Insertion                                                                                      */
+/* ---------------------------------------------------------------------------------------------- */
+
+//ZyanStatus ZyanStringInsertFormat(ZyanString* string, ZyanUSize index, const char* format, ...)
+//{
+//
+//}
+//
+///* ---------------------------------------------------------------------------------------------- */
+//
+//ZyanStatus ZyanStringInsertDecU(ZyanString* string, ZyanUSize index, ZyanU64 value,
+//    ZyanUSize padding_length)
+//{
+//
+//}
+//
+//ZyanStatus ZyanStringInsertDecS(ZyanString* string, ZyanUSize index, ZyanI64 value,
+//    ZyanUSize padding_length, ZyanBool force_sign, const ZyanString* prefix)
+//{
+//
+//}
+//
+//ZyanStatus ZyanStringInsertHexU(ZyanString* string, ZyanUSize index, ZyanU64 value,
+//    ZyanUSize padding_length, ZyanBool uppercase)
+//{
+//
+//}
+//
+//ZyanStatus ZyanStringInsertHexS(ZyanString* string, ZyanUSize index, ZyanI64 value,
+//    ZyanUSize padding_length, ZyanBool uppercase, ZyanBool force_sign, const ZyanString* prefix)
+//{
+//
+//}
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Appending                                                                                      */
+/* ---------------------------------------------------------------------------------------------- */
+
+#ifndef ZYAN_NO_LIBC
+
+ZyanStatus ZyanStringAppendFormat(ZyanString* string, const char* format, ...)
+{
+    if (!string || !format)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    ZyanVAList arglist;
+    ZYAN_VA_START(arglist, format);
+
+    const ZyanUSize len = string->vector.size;
+
+    ZyanI32 w = ZYAN_VSNPRINTF((char*)string->vector.data + len - 1,
+        string->vector.capacity - len + 1, format, arglist);
+    if (w < 0)
+    {
+        ZYAN_VA_END(arglist);
+        return ZYAN_STATUS_FAILED;
+    }
+    if (w <= (ZyanI32)(string->vector.capacity - len))
+    {
+        string->vector.size = len + w;
+
+        ZYAN_VA_END(arglist);
+        return ZYAN_STATUS_SUCCESS;
+    }
+
+    // The remaining capacity was not sufficent to fit the formatted string. Trying to resize ..
+    const ZyanStatus status = ZyanStringResize(string, string->vector.size + w - 1);
+    if (!ZYAN_SUCCESS(status))
+    {
+        ZYAN_VA_END(arglist);
+        return status;
+    }
+
+    w = ZYAN_VSNPRINTF((char*)string->vector.data + len - 1,
+        string->vector.capacity - string->vector.size + 1, format, arglist);
+    if (w < 0)
+    {
+        ZYAN_VA_END(arglist);
+        return ZYAN_STATUS_FAILED;
+    }
+    ZYAN_ASSERT(w <= (ZyanI32)(string->vector.capacity - string->vector.size));
+
+    ZYAN_VA_END(arglist);
+    return ZYAN_STATUS_SUCCESS;
+}
+
+#endif // ZYAN_NO_LIBC
+
+/* ---------------------------------------------------------------------------------------------- */
+
+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)
+    {
+        return ZyanStringAppendDecU64(string, value, padding_length);
+    }
+    return ZyanStringAppendDecU32(string, (ZyanU32)value, padding_length);
+#endif
+}
+
+ZyanStatus ZyanStringAppendDecS(ZyanString* string, ZyanI64 value, ZyanU8 padding_length,
+    ZyanBool force_sign, const ZyanStringView* prefix)
+{
+    if (value < 0)
+    {
+        ZYAN_CHECK(ZyanStringAppend(string, &STR_SUB));
+        if (prefix)
+        {
+            ZYAN_CHECK(ZyanStringAppend(string, prefix));
+        }
+        return ZyanStringAppendDecU(string, -value, padding_length);
+    }
+
+    if (force_sign)
+    {
+        ZYAN_ASSERT(value >= 0);
+        ZYAN_CHECK(ZyanStringAppend(string, &STR_ADD));
+    }
+
+    if (prefix)
+    {
+        ZYAN_CHECK(ZyanStringAppend(string, prefix));
+    }
+    return ZyanStringAppendDecU(string, value, padding_length);
+}
+
+ZyanStatus ZyanStringAppendHexU(ZyanString* string, ZyanU64 value, ZyanU8 padding_length,
+    ZyanBool uppercase)
+{
+#if defined(ZYAN_X64) || defined(ZYAN_AARCH64)
+    return ZyanStringAppendHexU64(string, value, padding_length, uppercase);
+#else
+    // Working with 64-bit values is slow on non 64-bit systems
+    if (value & 0xFFFFFFFF00000000)
+    {
+        return ZyanStringAppendHexU64(string, value, padding_length, uppercase);
+    }
+    return ZyanStringAppendHexU32(string, (ZyanU32)value, padding_length, uppercase);
+#endif
+}
+
+ZyanStatus ZyanStringAppendHexS(ZyanString* string, ZyanI64 value, ZyanU8 padding_length,
+    ZyanBool uppercase, ZyanBool force_sign, const ZyanStringView* prefix)
+{
+    if (value < 0)
+    {
+        ZYAN_CHECK(ZyanStringAppend(string, &STR_SUB));
+        if (prefix)
+        {
+            ZYAN_CHECK(ZyanStringAppend(string, prefix));
+        }
+        return ZyanStringAppendHexU(string, -value, padding_length, uppercase);
+    }
+
+    if (force_sign)
+    {
+        ZYAN_ASSERT(value >= 0);
+        ZYAN_CHECK(ZyanStringAppend(string, &STR_ADD));
+    }
+
+    if (prefix)
+    {
+        ZYAN_CHECK(ZyanStringAppend(string, prefix));
+    }
+    return ZyanStringAppendHexU(string, value, padding_length, uppercase);
+}
+
+/* ---------------------------------------------------------------------------------------------- */
+
+/* ============================================================================================== */
new file mode 100644
--- /dev/null
+++ b/js/src/zydis/Zycore/Format.h
@@ -0,0 +1,261 @@
+/***************************************************************************************************
+
+  Zyan Core Library (Zycore-C)
+
+  Original Author : Florian Bernd
+
+ * 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.
+
+***************************************************************************************************/
+
+/**
+ * @file
+ * @brief   Provides helper functions for performant number to string conversion.
+ */
+
+#ifndef ZYCORE_FORMAT_H
+#define ZYCORE_FORMAT_H
+
+#include "zydis/ZycoreExportConfig.h"
+#include "zydis/Zycore/Status.h"
+#include "zydis/Zycore/String.h"
+#include "zydis/Zycore/Types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* ============================================================================================== */
+/* Exported functions                                                                             */
+/* ============================================================================================== */
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Insertion                                                                                      */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Inserts formatted text in the destination string at the given `index`.
+ *
+ * @param   string  The destination string.
+ * @param   index   The insert index.
+ * @param   format  The format string.
+ * @param   ...     The format arguments.
+ *
+ * @return  A zyan status code.
+ *
+ * This function will fail, if the `ZYAN_STRING_IS_IMMUTABLE` flag is set for the specified
+ * `ZyanString` instance.
+ */
+ZYAN_PRINTF_ATTR(3, 4)
+ZYCORE_EXPORT ZyanStatus ZyanStringInsertFormat(ZyanString* string, ZyanUSize index,
+    const char* format, ...);
+
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Formats the given unsigned ordinal `value` to its decimal text-representation and
+ *          inserts it to the `string`.
+ *
+ * @param   string          A pointer to the `ZyanString` instance.
+ * @param   index           The insert index.
+ * @param   value           The value.
+ * @param   padding_length  Padds the converted value with leading zeros, if the number of chars is
+ *                          less than the `padding_length`.
+ *
+ * @return  A zyan status code.
+ *
+ * This function will fail, if the `ZYAN_STRING_IS_IMMUTABLE` flag is set for the specified
+ * `ZyanString` instance.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringInsertDecU(ZyanString* string, ZyanUSize index, ZyanU64 value,
+    ZyanU8 padding_length);
+
+/**
+ * @brief   Formats the given signed ordinal `value` to its decimal text-representation and
+ *          inserts it to the `string`.
+ *
+ * @param   string          A pointer to the `ZyanString` instance.
+ * @param   index           The insert index.
+ * @param   value           The value.
+ * @param   padding_length  Padds the converted value with leading zeros, if the number of chars is
+ *                          less than the `padding_length`.
+ * @param   force_sign      Set `ZYAN_TRUE`, to force printing of the `+` sign for positive numbers.
+ * @param   prefix          The string to use as prefix or `ZYAN_NULL`, if not needed.
+ *
+ * @return  A zyan status code.
+ *
+ * This function will fail, if the `ZYAN_STRING_IS_IMMUTABLE` flag is set for the specified
+ * `ZyanString` instance.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringInsertDecS(ZyanString* string, ZyanUSize index, ZyanI64 value,
+    ZyanU8 padding_length, ZyanBool force_sign, const ZyanString* prefix);
+
+/**
+ * @brief   Formats the given unsigned ordinal `value` to its hexadecimal text-representation and
+ *          inserts it to the `string`.
+ *
+ * @param   string          A pointer to the `ZyanString` instance.
+ * @param   index           The insert index.
+ * @param   value           The value.
+ * @param   padding_length  Padds the converted value with leading zeros, if the number of chars is
+ *                          less than the `padding_length`.
+ * @param   uppercase       Set `ZYAN_TRUE` to use uppercase letters ('A'-'F') instead of lowercase
+ *                          ones ('a'-'f').
+ *
+ * @return  A zyan status code.
+ *
+ * This function will fail, if the `ZYAN_STRING_IS_IMMUTABLE` flag is set for the specified
+ * `ZyanString` instance.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringInsertHexU(ZyanString* string, ZyanUSize index, ZyanU64 value,
+    ZyanU8 padding_length, ZyanBool uppercase);
+
+/**
+ * @brief   Formats the given signed ordinal `value` to its hexadecimal text-representation and
+ *          inserts it to the `string`.
+ *
+ * @param   string          A pointer to the `ZyanString` instance.
+ * @param   index           The insert index.
+ * @param   value           The value.
+ * @param   padding_length  Padds the converted value with leading zeros, if the number of chars is
+ *                          less than the `padding_length`.
+ * @param   uppercase       Set `ZYAN_TRUE` to use uppercase letters ('A'-'F') instead of lowercase
+ *                          ones ('a'-'f').
+ * @param   force_sign      Set `ZYAN_TRUE`, to force printing of the `+` sign for positive numbers.
+ * @param   prefix          The string to use as prefix or `ZYAN_NULL`, if not needed.
+ *
+ * @return  A zyan status code.
+ *
+ * This function will fail, if the `ZYAN_STRING_IS_IMMUTABLE` flag is set for the specified
+ * `ZyanString` instance.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringInsertHexS(ZyanString* string, ZyanUSize index, ZyanI64 value,
+    ZyanU8 padding_length, ZyanBool uppercase, ZyanBool force_sign, const ZyanString* prefix);
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Appending                                                                                      */
+/* ---------------------------------------------------------------------------------------------- */
+
+#ifndef ZYAN_NO_LIBC
+
+/**
+ * @brief   Appends formatted text to the destination string.
+ *
+ * @param   string  The destination string.
+ * @param   format  The format string.
+ * @param   ...     The format arguments.
+ *
+ * @return  A zyan status code.
+ *
+ * This function will fail, if the `ZYAN_STRING_IS_IMMUTABLE` flag is set for the specified
+ * `ZyanString` instance.
+ */
+ZYAN_PRINTF_ATTR(2, 3)
+ZYCORE_EXPORT ZYAN_REQUIRES_LIBC ZyanStatus ZyanStringAppendFormat(
+    ZyanString* string, const char* format, ...);
+
+#endif // ZYAN_NO_LIBC
+
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Formats the given unsigned ordinal `value` to its decimal text-representation and
+ *          appends it to the `string`.
+ *
+ * @param   string          A pointer to the `ZyanString` instance.
+ * @param   value           The value.
+ * @param   padding_length  Padds the converted value with leading zeros, if the number of chars is
+ *                          less than the `padding_length`.
+ *
+ * @return  A zyan status code.
+ *
+ * This function will fail, if the `ZYAN_STRING_IS_IMMUTABLE` flag is set for the specified
+ * `ZyanString` instance.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringAppendDecU(ZyanString* string, ZyanU64 value,
+    ZyanU8 padding_length);
+
+/**
+ * @brief   Formats the given signed ordinal `value` to its decimal text-representation and
+ *          appends it to the `string`.
+ *
+ * @param   string          A pointer to the `ZyanString` instance.
+ * @param   value           The value.
+ * @param   padding_length  Padds the converted value with leading zeros, if the number of chars is
+ *                          less than the `padding_length`.
+ * @param   force_sign      Set `ZYAN_TRUE`, to force printing of the `+` sign for positive numbers.
+ * @param   prefix          The string to use as prefix or `ZYAN_NULL`, if not needed.
+ *
+ * @return  A zyan status code.
+ *
+ * This function will fail, if the `ZYAN_STRING_IS_IMMUTABLE` flag is set for the specified
+ * `ZyanString` instance.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringAppendDecS(ZyanString* string, ZyanI64 value,
+    ZyanU8 padding_length, ZyanBool force_sign, const ZyanStringView* prefix);
+
+/**
+ * @brief   Formats the given unsigned ordinal `value` to its hexadecimal text-representation and
+ *          appends it to the `string`.
+ *
+ * @param   string          A pointer to the `ZyanString` instance.
+ * @param   value           The value.
+ * @param   padding_length  Padds the converted value with leading zeros, if the number of chars is
+ *                          less than the `padding_length`.
+ * @param   uppercase       Set `ZYAN_TRUE` to use uppercase letters ('A'-'F') instead of lowercase
+ *                          ones ('a'-'f').
+ *
+ * @return  A zyan status code.
+ *
+ * This function will fail, if the `ZYAN_STRING_IS_IMMUTABLE` flag is set for the specified
+ * `ZyanString` instance.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringAppendHexU(ZyanString* string, ZyanU64 value,
+    ZyanU8 padding_length, ZyanBool uppercase);
+
+/**
+ * @brief   Formats the given signed ordinal `value` to its hexadecimal text-representation and
+ *          appends it to the `string`.
+ *
+ * @param   string          A pointer to the `ZyanString` instance.
+ * @param   value           The value.
+ * @param   padding_length  Padds the converted value with leading zeros, if the number of chars is
+ *                          less than the `padding_length`.
+ * @param   uppercase       Set `ZYAN_TRUE` to use uppercase letters ('A'-'F') instead of lowercase
+ *                          ones ('a'-'f').
+ * @param   force_sign      Set `ZYAN_TRUE`, to force printing of the `+` sign for positive numbers.
+ * @param   prefix          The string to use as prefix or `ZYAN_NULL`, if not needed.
+ *
+ * @return  A zyan status code.
+ *
+ * This function will fail, if the `ZYAN_STRING_IS_IMMUTABLE` flag is set for the specified
+ * `ZyanString` instance.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringAppendHexS(ZyanString* string, ZyanI64 value,
+    ZyanU8 padding_length, ZyanBool uppercase, ZyanBool force_sign, const ZyanStringView* prefix);
+
+/* ---------------------------------------------------------------------------------------------- */
+
+/* ============================================================================================== */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // ZYCORE_FORMAT_H
new file mode 100644
--- /dev/null
+++ b/js/src/zydis/Zycore/LICENSE
@@ -0,0 +1,23 @@
+The MIT License (MIT)
+
+Copyright (c) 2018-2019 Florian Bernd
+Copyright (c) 2018-2019 Joel Höner
+
+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.
+
new file mode 100644
--- /dev/null
+++ b/js/src/zydis/Zycore/LibC.h
@@ -0,0 +1,511 @@
+/***************************************************************************************************
+
+  Zyan Core Library (Zycore-C)
+
+  Original Author : Florian Bernd, Joel Hoener
+
+ * 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.
+
+***************************************************************************************************/
+
+/**
+ * @file
+ * @brief   Provides a simple LibC abstraction and fallback routines.
+ */
+
+#ifndef ZYCORE_LIBC_H
+#define ZYCORE_LIBC_H
+
+#ifndef ZYAN_CUSTOM_LIBC
+
+// Include a custom LibC header and define `ZYAN_CUSTOM_LIBC` to provide your own LibC
+// replacement functions
+
+#ifndef ZYAN_NO_LIBC
+
+/* ============================================================================================== */
+/* LibC is available                                                                              */
+/* ============================================================================================== */
+
+/* ---------------------------------------------------------------------------------------------- */
+/* errno.h                                                                                        */
+/* ---------------------------------------------------------------------------------------------- */
+
+#include <errno.h>
+
+#define ZYAN_ERRNO  errno
+
+/* ---------------------------------------------------------------------------------------------- */
+/* stdarg.h                                                                                       */
+/* ---------------------------------------------------------------------------------------------- */
+
+#include <stdarg.h>
+
+/**
+ * @brief   Defines the `ZyanVAList` datatype.
+ */
+typedef va_list ZyanVAList;
+
+#define ZYAN_VA_START               va_start
+#define ZYAN_VA_ARG                 va_arg
+#define ZYAN_VA_END                 va_end
+#define ZYAN_VA_COPY(dest, source)  va_copy((dest), (source))
+
+/* ---------------------------------------------------------------------------------------------- */
+/* stdio.h                                                                                        */
+/* ---------------------------------------------------------------------------------------------- */
+
+#include <stdio.h>
+
+#define ZYAN_FPUTS      fputs
+#define ZYAN_FPUTC      fputc
+#define ZYAN_FPRINTF    fprintf
+#define ZYAN_PRINTF     printf
+#define ZYAN_PUTC       putc
+#define ZYAN_PUTS       puts
+#define ZYAN_SCANF      scanf
+#define ZYAN_SSCANF     sscanf
+#define ZYAN_VSNPRINTF  vsnprintf
+
+/**
+ * @brief   Defines the `ZyanFile` datatype.
+ */
+typedef FILE ZyanFile;
+
+#define ZYAN_STDIN      stdin
+#define ZYAN_STDOUT     stdout
+#define ZYAN_STDERR     stderr
+
+/* ---------------------------------------------------------------------------------------------- */
+/* stdlib.h                                                                                       */
+/* ---------------------------------------------------------------------------------------------- */
+
+#include <stdlib.h>
+#define ZYAN_CALLOC     calloc
+#define ZYAN_FREE       free
+#define ZYAN_MALLOC     malloc
+#define ZYAN_REALLOC    realloc
+
+/* ---------------------------------------------------------------------------------------------- */
+/* string.h                                                                                       */
+/* ---------------------------------------------------------------------------------------------- */
+
+#include <string.h>
+#define ZYAN_MEMCHR     memchr
+#define ZYAN_MEMCMP     memcmp
+#define ZYAN_MEMCPY     memcpy
+#define ZYAN_MEMMOVE    memmove
+#define ZYAN_MEMSET     memset
+#define ZYAN_STRCAT     strcat
+#define ZYAN_STRCHR     strchr
+#define ZYAN_STRCMP     strcmp
+#define ZYAN_STRCOLL    strcoll
+#define ZYAN_STRCPY     strcpy
+#define ZYAN_STRCSPN    strcspn
+#define ZYAN_STRLEN     strlen
+#define ZYAN_STRNCAT    strncat
+#define ZYAN_STRNCMP    strncmp
+#define ZYAN_STRNCPY    strncpy
+#define ZYAN_STRPBRK    strpbrk
+#define ZYAN_STRRCHR    strrchr
+#define ZYAN_STRSPN     strspn
+#define ZYAN_STRSTR     strstr
+#define ZYAN_STRTOK     strtok
+#define ZYAN_STRXFRM    strxfrm
+
+/* ---------------------------------------------------------------------------------------------- */
+
+#else  // if ZYAN_NO_LIBC
+
+/* ============================================================================================== */
+/* No LibC available, use our own functions                                                       */
+/* ============================================================================================== */
+
+#include "zydis/Zycore/Defines.h"
+#include "zydis/Zycore/Types.h"
+
+/*
+ * These implementations are by no means optimized and will be outperformed by pretty much any
+ * libc implementation out there. We do not aim towards providing competetive implementations here,
+ * but towards providing a last resort fallback for environments without a working libc.
+ */
+
+/* ---------------------------------------------------------------------------------------------- */
+/* stdarg.h                                                                                       */
+/* ---------------------------------------------------------------------------------------------- */
+
+#if defined(ZYAN_MSVC) || defined(ZYAN_ICC)
+
+/**
+ * @brief   Defines the `ZyanVAList` datatype.
+ */
+typedef char* ZyanVAList;
+
+#   define ZYAN_VA_START __crt_va_start
+#   define ZYAN_VA_ARG   __crt_va_arg
+#   define ZYAN_VA_END   __crt_va_end
+#   define ZYAN_VA_COPY(destination, source) ((destination) = (source))
+
+#elif defined(ZYAN_GNUC)
+
+/**
+ * @brief   Defines the `ZyanVAList` datatype.
+ */
+typedef __builtin_va_list  ZyanVAList;
+
+#   define ZYAN_VA_START(v, l)  __builtin_va_start(v, l)
+#   define ZYAN_VA_END(v)       __builtin_va_end(v)
+#   define ZYAN_VA_ARG(v, l)    __builtin_va_arg(v, l)
+#   define ZYAN_VA_COPY(d, s)   __builtin_va_copy(d, s)
+
+#else
+#   error "Unsupported compiler for no-libc mode."
+#endif
+
+/* ---------------------------------------------------------------------------------------------- */
+/* stdio.h                                                                                        */
+/* ---------------------------------------------------------------------------------------------- */
+
+// ZYAN_INLINE int ZYAN_VSNPRINTF (char* const buffer, ZyanUSize const count,
+//     char const* const format, ZyanVAList args)
+// {
+//      // We cant provide a fallback implementation for this function
+//     ZYAN_UNUSED(buffer);
+//     ZYAN_UNUSED(count);
+//     ZYAN_UNUSED(format);
+//     ZYAN_UNUSED(args);
+//     return ZYAN_NULL;
+// }
+
+/* ---------------------------------------------------------------------------------------------- */
+/* stdlib.h                                                                                       */
+/* ---------------------------------------------------------------------------------------------- */
+
+// ZYAN_INLINE void* ZYAN_CALLOC(ZyanUSize nitems, ZyanUSize size)
+// {
+//      // We cant provide a fallback implementation for this function
+//     ZYAN_UNUSED(nitems);
+//     ZYAN_UNUSED(size);
+//     return ZYAN_NULL;
+// }
+//
+// ZYAN_INLINE void ZYAN_FREE(void *p)
+// {
+//      // We cant provide a fallback implementation for this function
+//     ZYAN_UNUSED(p);
+// }
+//
+// ZYAN_INLINE void* ZYAN_MALLOC(ZyanUSize n)
+// {
+//     // We cant provide a fallback implementation for this function
+//     ZYAN_UNUSED(n);
+//     return ZYAN_NULL;
+// }
+//
+// ZYAN_INLINE void* ZYAN_REALLOC(void* p, ZyanUSize n)
+// {
+//      // We cant provide a fallback implementation for this function
+//     ZYAN_UNUSED(p);
+//     ZYAN_UNUSED(n);
+//     return ZYAN_NULL;
+// }
+
+/* ---------------------------------------------------------------------------------------------- */
+/* string.h                                                                                       */
+/* ---------------------------------------------------------------------------------------------- */
+
+ZYAN_INLINE void* ZYAN_MEMCHR(const void* str, int c, ZyanUSize n)
+{
+    const ZyanU8* p = (ZyanU8*)str;
+    while (n--)
+    {
+        if (*p != (ZyanU8)c)
+        {
+            p++;
+        } else
+        {
+            return (void*)p;
+        }
+    }
+    return 0;
+}
+
+ZYAN_INLINE int ZYAN_MEMCMP(const void* s1, const void* s2, ZyanUSize n)
+{
+    const ZyanU8* p1 = s1, *p2 = s2;
+    while (n--)
+    {
+        if (*p1 != *p2)
+        {
+            return *p1 - *p2;
+        }
+        p1++, p2++;
+    }
+    return 0;
+}
+
+ZYAN_INLINE void* ZYAN_MEMCPY(void* dst, const void* src, ZyanUSize n)
+{
+    volatile ZyanU8* dp = dst;
+    const ZyanU8* sp = src;
+    while (n--)
+    {
+        *dp++ = *sp++;
+    }
+    return dst;
+}
+
+ZYAN_INLINE void* ZYAN_MEMMOVE(void* dst, const void* src, ZyanUSize n)
+{
+    volatile ZyanU8* pd = dst;
+    const ZyanU8* ps = src;
+    if (ps < pd)
+    {
+        for (pd += n, ps += n; n--;)
+        {
+            *--pd = *--ps;
+        }
+    } else
+    {
+        while (n--)
+        {
+            *pd++ = *ps++;
+        }
+    }
+    return dst;
+}
+
+ZYAN_INLINE void* ZYAN_MEMSET(void* dst, int val, ZyanUSize n)
+{
+    volatile ZyanU8* p = dst;
+    while (n--)
+    {
+        *p++ = (unsigned char)val;
+    }
+    return dst;
+}
+
+ZYAN_INLINE char* ZYAN_STRCAT(char* dest, const char* src)
+{
+    char* ret = dest;
+    while (*dest)
+    {
+        dest++;
+    }
+    while ((*dest++ = *src++));
+    return ret;
+}
+
+ZYAN_INLINE char* ZYAN_STRCHR(const char* s, int c)
+{
+    while (*s != (char)c)
+    {
+        if (!*s++)
+        {
+            return 0;
+        }
+    }
+    return (char*)s;
+}
+
+ZYAN_INLINE int ZYAN_STRCMP(const char* s1, const char* s2)
+{
+    while (*s1 && (*s1 == *s2))
+    {
+        s1++, s2++;
+    }
+    return *(const ZyanU8*)s1 - *(const ZyanU8*)s2;
+}
+
+ZYAN_INLINE int ZYAN_STRCOLL(const char *s1, const char *s2)
+{
+    // TODO: Implement
+
+    ZYAN_UNUSED(s1);
+    ZYAN_UNUSED(s2);
+
+    return 0;
+}
+
+ZYAN_INLINE char* ZYAN_STRCPY(char* dest, const char* src)
+{
+    char* ret = dest;
+    while ((*dest++ = *src++));
+    return ret;
+}
+
+ZYAN_INLINE ZyanUSize ZYAN_STRCSPN(const char *s1, const char *s2)
+{
+    ZyanUSize ret = 0;
+    while (*s1)
+    {
+        if (ZYAN_STRCHR(s2, *s1))
+        {
+            return ret;
+        }
+        s1++, ret++;
+    }
+    return ret;
+}
+
+ZYAN_INLINE ZyanUSize ZYAN_STRLEN(const char* str)
+{
+    const char* p = str;
+    while (*str)
+    {
+        ++str;
+    }
+    return str - p;
+}
+
+ZYAN_INLINE char* ZYAN_STRNCAT(char* dest, const char* src, ZyanUSize n)
+{
+    char* ret = dest;
+    while (*dest)
+    {
+        dest++;
+    }
+    while (n--)
+    {
+        if (!(*dest++ = *src++))
+        {
+            return ret;
+        }
+    }
+    *dest = 0;
+    return ret;
+}
+
+ZYAN_INLINE int ZYAN_STRNCMP(const char* s1, const char* s2, ZyanUSize n)
+{
+    while (n--)
+    {
+        if (*s1++ != *s2++)
+        {
+            return *(unsigned char*)(s1 - 1) - *(unsigned char*)(s2 - 1);
+        }
+    }
+    return 0;
+}
+
+ZYAN_INLINE char* ZYAN_STRNCPY(char* dest, const char* src, ZyanUSize n)
+{
+    char* ret = dest;
+    do
+    {
+        if (!n--)
+        {
+            return ret;
+        }
+    } while ((*dest++ = *src++));
+    while (n--)
+    {
+        *dest++ = 0;
+    }
+    return ret;
+}
+
+ZYAN_INLINE char* ZYAN_STRPBRK(const char* s1, const char* s2)
+{
+    while (*s1)
+    {
+        if(ZYAN_STRCHR(s2, *s1++))
+        {
+            return (char*)--s1;
+        }
+    }
+    return 0;
+}
+
+ZYAN_INLINE char* ZYAN_STRRCHR(const char* s, int c)
+{
+    char* ret = 0;
+    do
+    {
+        if (*s == (char)c)
+        {
+            ret = (char*)s;
+        }
+    } while (*s++);
+    return ret;
+}
+
+ZYAN_INLINE ZyanUSize ZYAN_STRSPN(const char* s1, const char* s2)
+{
+    ZyanUSize ret = 0;
+    while (*s1 && ZYAN_STRCHR(s2, *s1++))
+    {
+        ret++;
+    }
+    return ret;
+}
+
+ZYAN_INLINE char* ZYAN_STRSTR(const char* s1, const char* s2)
+{
+    const ZyanUSize n = ZYAN_STRLEN(s2);
+    while (*s1)
+    {
+        if (!ZYAN_MEMCMP(s1++, s2, n))
+        {
+            return (char*)(s1 - 1);
+        }
+    }
+    return 0;
+}
+
+ZYAN_INLINE char* ZYAN_STRTOK(char* str, const char* delim)
+{
+    static char* p = 0;
+    if (str)
+    {
+        p = str;
+    } else
+    if (!p)
+    {
+        return 0;
+    }
+    str = p + ZYAN_STRSPN(p, delim);
+    p = str + ZYAN_STRCSPN(str, delim);
+    if (p == str)
+    {
+        return p = 0;
+    }
+    p = *p ? *p = 0, p + 1 : 0;
+    return str;
+}
+
+ZYAN_INLINE ZyanUSize ZYAN_STRXFRM(char* dest, const char* src, ZyanUSize n)
+{
+    const ZyanUSize n2 = ZYAN_STRLEN(src);
+    if (n > n2)
+    {
+        ZYAN_STRCPY(dest, src);
+    }
+    return n2;
+}
+
+/* ---------------------------------------------------------------------------------------------- */
+
+#endif
+
+#endif
+
+/* ============================================================================================== */
+
+#endif /* ZYCORE_LIBC_H */
new file mode 100644
--- /dev/null
+++ b/js/src/zydis/Zycore/Object.h
@@ -0,0 +1,84 @@
+/***************************************************************************************************
+
+  Zyan Core Library (Zycore-C)
+
+  Original Author : Florian Bernd
+
+ * 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.
+
+***************************************************************************************************/
+
+/**
+ * @file
+ * @brief   Defines some generic object-related datatypes.
+ */
+
+#ifndef ZYCORE_OBJECT_H
+#define ZYCORE_OBJECT_H
+
+#include "zydis/Zycore/Status.h"
+#include "zydis/Zycore/Types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* ============================================================================================== */
+/* Enums and types                                                                                */
+/* ============================================================================================== */
+
+/**
+ * @brief   Defines the `ZyanMemberProcedure` function prototype.
+ *
+ * @param   object  A pointer to the object.
+ */
+typedef void (*ZyanMemberProcedure)(void* object);
+
+/**
+ * @brief   Defines the `ZyanConstMemberProcedure` function prototype.
+ *
+ * @param   object  A pointer to the object.
+ */
+typedef void (*ZyanConstMemberProcedure)(const void* object);
+
+/**
+ * @brief   Defines the `ZyanMemberFunction` function prototype.
+ *
+ * @param   object  A pointer to the object.
+ *
+ * @return  A zyan status code.
+ */
+typedef ZyanStatus (*ZyanMemberFunction)(void* object);
+
+/**
+ * @brief   Defines the `ZyanConstMemberFunction` function prototype.
+ *
+ * @param   object  A pointer to the object.
+ *
+ * @return  A zyan status code.
+ */
+typedef ZyanStatus (*ZyanConstMemberFunction)(const void* object);
+
+/* ============================================================================================== */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* ZYCORE_OBJECT_H */
new file mode 100644
--- /dev/null
+++ b/js/src/zydis/Zycore/Status.h
@@ -0,0 +1,241 @@
+/***************************************************************************************************
+
+  Zyan Core Library (Zyan-C)
+
+  Original Author : Florian Bernd, Joel Hoener
+
+ * 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.
+
+***************************************************************************************************/
+
+/**
+ * @file
+ * @brief   Status code definitions and check macros.
+ */
+
+#ifndef ZYCORE_STATUS_H
+#define ZYCORE_STATUS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "zydis/Zycore/Types.h"
+
+/* ============================================================================================== */
+/* Enums and types                                                                                */
+/* ============================================================================================== */
+
+/**
+ * @brief   Defines the `ZyanStatus` datatype.
+ */
+typedef ZyanU32 ZyanStatus;
+
+/* ============================================================================================== */
+/* Macros                                                                                         */
+/* ============================================================================================== */
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Definition                                                                                     */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Defines a zyan status code.
+ *
+ * @param   error   `1`, if the status code signals an error or `0`, if not.
+ * @param   module  The module id.
+ * @param   code    The actual code.
+ *
+ * @return  The zyan status code.
+ */
+#define ZYAN_MAKE_STATUS(error, module, code) \
+    (ZyanStatus)((((error) & 0x01) << 31) | (((module) & 0x7FF) << 20) | ((code) & 0xFFFFF))
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Checks                                                                                         */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Checks if a zyan operation was successfull.
+ *
+ * @param   status  The zyan status-code to check.
+ *
+ * @return  `ZYAN_TRUE`, if the operation succeeded or `ZYAN_FALSE`, if not.
+ */
+#define ZYAN_SUCCESS(status) \
+    (!((status) & 0x80000000))
+
+/**
+ * @brief   Checks if a zyan operation failed.
+ *
+ * @param   status  The zyan status-code to check.
+ *
+ * @return  `ZYAN_TRUE`, if the operation failed or `ZYAN_FALSE`, if not.
+ */
+#define ZYAN_FAILED(status) \
+    ((status) & 0x80000000)
+
+/**
+ * @brief   Checks if a zyan operation was successfull and returns with the status-code, if not.
+ *
+ * @param   status  The zyan status-code to check.
+ */
+#define ZYAN_CHECK(status) \
+    do \
+    { \
+        const ZyanStatus status_047620348 = (status); \
+        if (!ZYAN_SUCCESS(status_047620348)) \
+        { \
+            return status_047620348; \
+        } \
+    } while (0)
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Information                                                                                    */
+/* ---------------------------------------------------------------------------------------------- */
+
+ /**
+ * @brief   Returns the module id of a zyan status-code.
+ *
+ * @param   status  The zyan status-code.
+ *
+ * @return  The module id of the zyan status-code.
+ */
+#define ZYAN_STATUS_MODULE(status) \
+    (((status) >> 20) & 0x7FF)
+
+ /**
+ * @brief   Returns the code of a zyan status-code.
+ *
+ * @param   status  The zyan status-code.
+ *
+ * @return  The code of the zyan status-code.
+ */
+#define ZYAN_STATUS_CODE(status) \
+    ((status) & 0xFFFFF)
+
+/* ============================================================================================== */
+/* Status codes                                                                                   */
+/* ============================================================================================== */
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Module IDs                                                                                     */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   The zycore generic module id.
+ */
+#define ZYAN_MODULE_ZYCORE  0x001
+
+/**
+ * @brief   The base module id for user-defined status codes.
+ */
+#define ZYAN_MODULE_USER    0x3FF
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Status codes                                                                                   */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   The operation completed successfully.
+ */
+#define ZYAN_STATUS_SUCCESS \
+    ZYAN_MAKE_STATUS(0, ZYAN_MODULE_ZYCORE, 0x00)
+
+/**
+ * @brief   The operation failed with an generic error.
+ */
+#define ZYAN_STATUS_FAILED \
+    ZYAN_MAKE_STATUS(1, ZYAN_MODULE_ZYCORE, 0x01)
+
+/**
+ * @brief   The operation completed successfully and returned `ZYAN_TRUE`.
+ */
+#define ZYAN_STATUS_TRUE \
+    ZYAN_MAKE_STATUS(0, ZYAN_MODULE_ZYCORE, 0x02)
+
+/**
+ * @brief   The operation completed successfully and returned `ZYAN_FALSE`.
+ */
+#define ZYAN_STATUS_FALSE \
+    ZYAN_MAKE_STATUS(0, ZYAN_MODULE_ZYCORE, 0x03)
+
+/**
+ * @brief   An invalid argument was passed to a function.
+ */
+#define ZYAN_STATUS_INVALID_ARGUMENT \
+    ZYAN_MAKE_STATUS(1, ZYAN_MODULE_ZYCORE, 0x04)
+
+/**
+ * @brief   An attempt was made to perform an invalid operation.
+ */
+#define ZYAN_STATUS_INVALID_OPERATION \
+    ZYAN_MAKE_STATUS(1, ZYAN_MODULE_ZYCORE, 0x05)
+
+/**
+ * @brief   Insufficient privileges to perform the requested operation.
+ */
+#define ZYAN_STATUS_ACCESS_DENIED \
+    ZYAN_MAKE_STATUS(1, ZYAN_MODULE_ZYCORE, 0x06)
+
+/**
+ * @brief   The requested entity was not found.
+ */
+#define ZYAN_STATUS_NOT_FOUND \
+    ZYAN_MAKE_STATUS(1, ZYAN_MODULE_ZYCORE, 0x07)
+
+/**
+ * @brief   An index passed to a function was out of bounds.
+ */
+#define ZYAN_STATUS_OUT_OF_RANGE \
+    ZYAN_MAKE_STATUS(1, ZYAN_MODULE_ZYCORE, 0x08)
+
+/**
+ * @brief   A buffer passed to a function was too small to complete the requested operation.
+ */
+#define ZYAN_STATUS_INSUFFICIENT_BUFFER_SIZE \
+    ZYAN_MAKE_STATUS(1, ZYAN_MODULE_ZYCORE, 0x09)
+
+/**
+ * @brief   Insufficient memory to perform the operation.
+ */
+#define ZYAN_STATUS_NOT_ENOUGH_MEMORY \
+    ZYAN_MAKE_STATUS(1, ZYAN_MODULE_ZYCORE, 0x0A)
+
+/**
+ * @brief   An unknown error occured during a system function call.
+ */
+#define ZYAN_STATUS_BAD_SYSTEMCALL \
+    ZYAN_MAKE_STATUS(1, ZYAN_MODULE_ZYCORE, 0x0B)
+
+/**
+ * @brief   The process ran out of resources while performing an operation.
+ */
+#define ZYAN_STATUS_OUT_OF_RESOURCES \
+    ZYAN_MAKE_STATUS(1, ZYAN_MODULE_ZYCORE, 0x0C)
+
+/* ---------------------------------------------------------------------------------------------- */
+
+/* ============================================================================================== */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* ZYCORE_STATUS_H */
new file mode 100644
--- /dev/null
+++ b/js/src/zydis/Zycore/String.h
@@ -0,0 +1,999 @@
+/***************************************************************************************************
+
+  Zyan Core Library (Zycore-C)
+
+  Original Author : Florian Bernd
+
+ * 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.
+
+***************************************************************************************************/
+
+/**
+ * @file
+ * @brief   Implements a string type.
+ */
+
+#ifndef ZYCORE_STRING_H
+#define ZYCORE_STRING_H
+
+#include "zydis/ZycoreExportConfig.h"
+#include "zydis/Zycore/Allocator.h"
+#include "zydis/Zycore/Status.h"
+#include "zydis/Zycore/Types.h"
+#include "zydis/Zycore/Vector.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* ============================================================================================== */
+/* Constants                                                                                      */
+/* ============================================================================================== */
+
+/**
+ * @brief   The initial minimum capacity (number of characters) for all dynamically allocated
+ *          string instances - not including the terminating '\0'-character.
+ */
+#define ZYAN_STRING_MIN_CAPACITY                32
+
+/**
+ * @brief   The default growth factor for all string instances.
+ */
+#define ZYAN_STRING_DEFAULT_GROWTH_FACTOR       2.00f
+
+/**
+ * @brief   The default shrink threshold for all string instances.
+ */
+#define ZYAN_STRING_DEFAULT_SHRINK_THRESHOLD    0.25f
+
+/* ============================================================================================== */
+/* Enums and types                                                                                */
+/* ============================================================================================== */
+
+/* ---------------------------------------------------------------------------------------------- */
+/* String flags                                                                                   */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Defines the `ZyanStringFlags` datatype.
+ */
+typedef ZyanU8 ZyanStringFlags;
+
+/**
+ * @brief   The string uses a custom user-defined buffer with a fixed capacity.
+ */
+#define ZYAN_STRING_HAS_FIXED_CAPACITY  0x01 // (1 << 0)
+
+/* ---------------------------------------------------------------------------------------------- */
+/* String                                                                                         */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Defines the `ZyanString` struct.
+ *
+ * The `ZyanString` type is implemented as a size-prefixed string - which allows for a lot of
+ * performance optimizations.
+ * Nevertheless null-termination is guaranteed at all times to provide maximum compatibility with
+ * default C-style strings (use `ZyanStringGetData` to access the C-style string).
+ *
+ * All fields in this struct should be considered as "private". Any changes may lead to unexpected
+ * behavior.
+ */
+typedef struct ZyanString_
+{
+    /**
+     * @brief   String flags.
+     */
+    ZyanStringFlags flags;
+    /**
+     * @brief   The vector that contains the actual string.
+     */
+    ZyanVector vector;
+} ZyanString;
+
+/* ---------------------------------------------------------------------------------------------- */
+/* View                                                                                           */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Defines the `ZyanStringView` struct.
+ *
+ * The `ZyanStringView` type provides a view inside a string (`ZyanString` instances, null-
+ * terminated C-style strings, or even not-null-terminated custom strings). A view is immutable
+ * by design and can't be directly converted to a C-style string.
+ *
+ * Views might become invalid (e.g. pointing to invalid memory), if the underlying string gets
+ * destroyed or resized.
+ *
+ * The `ZYAN_STRING_TO_VIEW` macro can be used to cast a `ZyanString` to a `ZyanStringView` pointer
+ * without any runtime overhead.
+ * Casting a view to a normal string is not supported and will lead to unexpected behavior (use
+ * `ZyanStringDuplicate` to create a deep-copy instead).
+ *
+ * All fields in this struct should be considered as "private". Any changes may lead to unexpected
+ * behavior.
+ */
+typedef struct ZyanStringView_
+{
+    /**
+     * @brief   The string data.
+     *
+     * The view internally re-uses the normal string struct to allow casts without any runtime
+     * overhead.
+     */
+    ZyanString string;
+} ZyanStringView;
+
+/* ---------------------------------------------------------------------------------------------- */
+
+/* ============================================================================================== */
+/* Macros                                                                                         */
+/* ============================================================================================== */
+
+/* ---------------------------------------------------------------------------------------------- */
+/* General                                                                                        */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Defines an uninitialized `ZyanString` instance.
+ */
+#define ZYAN_STRING_UNINITIALIZED \
+    { \
+        /* flags  */ 0, \
+        /* vector */ ZYAN_VECTOR_UNINITIALIZED \
+    }
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Helper macros                                                                                  */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Casts a `ZyanString` pointer to a constant `ZyanStringView` pointer.
+ */
+#define ZYAN_STRING_TO_VIEW(string) (const ZyanStringView*)(string)
+
+/**
+ * @brief   Defines a `ZyanStringView` struct that provides a view into a static C-style string.
+ *
+ * @param   string  The C-style string.
+ */
+#define ZYAN_DEFINE_STRING_VIEW(string) \
+    { \
+        /* string */ \
+        { \
+            /* flags  */ 0, \
+            /* vector */ \
+            { \
+                /* allocator        */ ZYAN_NULL, \
+                /* growth_factor    */ 1.0f, \
+                /* shrink_threshold */ 0.0f, \
+                /* size             */ sizeof(string), \
+                /* capacity         */ sizeof(string), \
+                /* element_size     */ sizeof(char), \
+                /* data             */ (char*)(string) \
+            } \
+        } \
+    }
+
+/* ---------------------------------------------------------------------------------------------- */
+
+/* ============================================================================================== */
+/* Exported functions                                                                             */
+/* ============================================================================================== */
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Constructor and destructor                                                                     */
+/* ---------------------------------------------------------------------------------------------- */
+
+#ifndef ZYAN_NO_LIBC
+
+/**
+ * @brief   Initializes the given `ZyanString` instance.
+ *
+ * @param   string          A pointer to the `ZyanString` instance.
+ * @param   capacity        The initial capacity (number of characters).
+ *
+ * @return  A zyan status code.
+ *
+ * The memory for the string is dynamically allocated by the default allocator using the default
+ * growth factor of `2.0f` and the default shrink threshold of `0.25f`.
+ *
+ * The allocated buffer will be at least one character larger than the given `capacity`, to reserve
+ * space for the terminating '\0'.
+ *
+ * Finalization with `ZyanStringDestroy` is required for all strings created by this function.
+ */
+ZYCORE_EXPORT ZYAN_REQUIRES_LIBC ZyanStatus ZyanStringInit(ZyanString* string, ZyanUSize capacity);
+
+#endif // ZYAN_NO_LIBC
+
+/**
+ * @brief   Initializes the given `ZyanString` instance and sets a custom `allocator` and memory
+ *          allocation/deallocation parameters.
+ *
+ * @param   string              A pointer to the `ZyanString` instance.
+ * @param   capacity            The initial capacity (number of characters).
+ * @param   allocator           A pointer to a `ZyanAllocator` instance.
+ * @param   growth_factor       The growth factor (from `1.0f` to `x.xf`).
+ * @param   shrink_threshold    The shrink threshold (from `0.0f` to `1.0f`).
+ *
+ * @return  A zyan status code.
+ *
+ * A growth factor of `1.0f` disables overallocation and a shrink threshold of `0.0f` disables
+ * dynamic shrinking.
+ *
+ * The allocated buffer will be at least one character larger than the given `capacity`, to reserve
+ * space for the terminating '\0'.
+ *
+ * Finalization with `ZyanStringDestroy` is required for all strings created by this function.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringInitEx(ZyanString* string, ZyanUSize capacity,
+    ZyanAllocator* allocator, float growth_factor, float shrink_threshold);
+
+/**
+ * @brief   Initializes the given `ZyanString` instance and configures it to use a custom user
+ *          defined buffer with a fixed size.
+ *
+ * @param   string          A pointer to the `ZyanString` instance.
+ * @param   buffer          A pointer to the buffer that is used as storage for the string.
+ * @param   capacity        The maximum capacity (number of characters) of the buffer, including
+ *                          the terminating '\0'.
+ *
+ * @return  A zyan status code.
+ *
+ * Finalization is not required for strings created by this function.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringInitCustomBuffer(ZyanString* string, char* buffer,
+    ZyanUSize capacity);
+
+/**
+ * @brief   Destroys the given `ZyanString` instance.
+ *
+ * @param   string  A pointer to the `ZyanString` instance.
+ *
+ * @return  A zyan status code.
+ *
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringDestroy(ZyanString* string);
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Duplication                                                                                    */
+/* ---------------------------------------------------------------------------------------------- */
+
+#ifndef ZYAN_NO_LIBC
+
+/**
+ * @brief   Initializes a new `ZyanString` instance by duplicating an existing string.
+ *
+ * @param   destination A pointer to the (uninitialized) destination `ZyanString` instance.
+ * @param   source      A pointer to the source string.
+ * @param   capacity    The initial capacity (number of characters).
+ *
+ *                      This value is automatically adjusted to the size of the source string, if
+ *                      a smaller value was passed.
+ *
+ * @return  A zyan status code.
+ *
+ * The behavior of this function is undefined, if `source` is a view into the `destination`
+ * string or `destination` points to an already initialized `ZyanString` instance.
+ *
+ * The memory for the string is dynamically allocated by the default allocator using the default
+ * growth factor of `2.0f` and the default shrink threshold of `0.25f`.
+ *
+ * The allocated buffer will be at least one character larger than the given `capacity`, to reserve
+ * space for the terminating '\0'.
+ *
+ * Finalization with `ZyanStringDestroy` is required for all strings created by this function.
+ */
+ZYCORE_EXPORT ZYAN_REQUIRES_LIBC ZyanStatus ZyanStringDuplicate(ZyanString* destination,
+    const ZyanStringView* source, ZyanUSize capacity);
+
+#endif // ZYAN_NO_LIBC
+
+/**
+ * @brief   Initializes a new `ZyanString` instance by duplicating an existing string and sets a
+ *          custom `allocator` and memory allocation/deallocation parameters.
+ *
+ * @param   destination         A pointer to the (uninitialized) destination `ZyanString` instance.
+ * @param   source              A pointer to the source string.
+ * @param   capacity            The initial capacity (number of characters).
+
+ *                              This value is automatically adjusted to the size of the source
+ *                              string, if a smaller value was passed.
+ * @param   allocator           A pointer to a `ZyanAllocator` instance.
+ * @param   growth_factor       The growth factor (from `1.0f` to `x.xf`).
+ * @param   shrink_threshold    The shrink threshold (from `0.0f` to `1.0f`).
+ *
+ * @return  A zyan status code.
+ *
+ * The behavior of this function is undefined, if `source` is a view into the `destination`
+ * string or `destination` points to an already initialized `ZyanString` instance.
+ *
+ * A growth factor of `1.0f` disables overallocation and a shrink threshold of `0.0f` disables
+ * dynamic shrinking.
+ *
+ * The allocated buffer will be at least one character larger than the given `capacity`, to reserve
+ * space for the terminating '\0'.
+ *
+ * Finalization with `ZyanStringDestroy` is required for all strings created by this function.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringDuplicateEx(ZyanString* destination,
+    const ZyanStringView* source, ZyanUSize capacity, ZyanAllocator* allocator,
+    float growth_factor, float shrink_threshold);
+
+/**
+ * @brief   Initializes a new `ZyanString` instance by duplicating an existing string and
+ *          configures it to use a custom user defined buffer with a fixed size.
+ *
+ * @param   destination A pointer to the (uninitialized) destination `ZyanString` instance.
+ * @param   source      A pointer to the source string.
+ * @param   buffer      A pointer to the buffer that is used as storage for the string.
+ * @param   capacity    The maximum capacity (number of characters) of the buffer, including the
+ *                      terminating '\0'.
+
+ *                      This function will fail, if the capacity of the buffer is less or equal to
+ *                      the size of the source string.
+ *
+ * @return  A zyan status code.
+ *
+ * The behavior of this function is undefined, if `source` is a view into the `destination`
+ * string or `destination` points to an already initialized `ZyanString` instance.
+ *
+ * Finalization is not required for strings created by this function.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringDuplicateCustomBuffer(ZyanString* destination,
+    const ZyanStringView* source, char* buffer, ZyanUSize capacity);
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Concatenation                                                                                  */
+/* ---------------------------------------------------------------------------------------------- */
+
+#ifndef ZYAN_NO_LIBC
+
+/**
+ * @brief   Initializes a new `ZyanString` instance by concatenating two existing strings.
+ *
+ * @param   destination A pointer to the (uninitialized) destination `ZyanString` instance.
+ *
+ *                      This function will fail, if the destination `ZyanString` instance equals
+ *                      one of the source strings.
+ * @param   s1          A pointer to the first source string.
+ * @param   s2          A pointer to the second source string.
+ * @param   capacity    The initial capacity (number of characters).
+
+ *                      This value is automatically adjusted to the combined size of the source
+ *                      strings, if a smaller value was passed.
+ *
+ * @return  A zyan status code.
+ *
+ * The behavior of this function is undefined, if `s1` or `s2` are views into the `destination`
+ * string or `destination` points to an already initialized `ZyanString` instance.
+ *
+ * The memory for the string is dynamically allocated by the default allocator using the default
+ * growth factor of `2.0f` and the default shrink threshold of `0.25f`.
+ *
+ * The allocated buffer will be at least one character larger than the given `capacity`, to reserve
+ * space for the terminating '\0'.
+ *
+ * Finalization with `ZyanStringDestroy` is required for all strings created by this function.
+ */
+ZYCORE_EXPORT ZYAN_REQUIRES_LIBC ZyanStatus ZyanStringConcat(ZyanString* destination,
+    const ZyanStringView* s1, const ZyanStringView* s2, ZyanUSize capacity);
+
+#endif // ZYAN_NO_LIBC
+
+/**
+ * @brief   Initializes a new `ZyanString` instance by concatenating two existing strings and sets
+ *          a custom `allocator` and memory allocation/deallocation parameters.
+ *
+ * @param   destination         A pointer to the (uninitialized) destination `ZyanString` instance.
+ *
+ *                              This function will fail, if the destination `ZyanString` instance
+ *                              equals one of the source strings.
+ * @param   s1                  A pointer to the first source string.
+ * @param   s2                  A pointer to the second source string.
+ * @param   capacity            The initial capacity (number of characters).
+ *
+ *                              This value is automatically adjusted to the combined size of the
+ *                              source strings, if a smaller value was passed.
+ * @param   allocator           A pointer to a `ZyanAllocator` instance.
+ * @param   growth_factor       The growth factor (from `1.0f` to `x.xf`).
+ * @param   shrink_threshold    The shrink threshold (from `0.0f` to `1.0f`).
+ *
+ * @return  A zyan status code.
+ *
+ * The behavior of this function is undefined, if `s1` or `s2` are views into the `destination`
+ * string or `destination` points to an already initialized `ZyanString` instance.
+ *
+ * A growth factor of `1.0f` disables overallocation and a shrink threshold of `0.0f` disables
+ * dynamic shrinking.
+ *
+ * The allocated buffer will be at least one character larger than the given `capacity`, to reserve
+ * space for the terminating '\0'.
+ *
+ * Finalization with `ZyanStringDestroy` is required for all strings created by this function.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringConcatEx(ZyanString* destination, const ZyanStringView* s1,
+    const ZyanStringView* s2, ZyanUSize capacity, ZyanAllocator* allocator, float growth_factor,
+    float shrink_threshold);
+
+/**
+ * @brief   Initializes a new `ZyanString` instance by concatenating two existing strings and
+ *          configures it to use a custom user defined buffer with a fixed size.
+ *
+ * @param   destination A pointer to the (uninitialized) destination `ZyanString` instance.
+ *
+ *                      This function will fail, if the destination `ZyanString` instance equals
+ *                      one of the source strings.
+ * @param   s1          A pointer to the first source string.
+ * @param   s2          A pointer to the second source string.
+ * @param   buffer      A pointer to the buffer that is used as storage for the string.
+ * @param   capacity    The maximum capacity (number of characters) of the buffer.
+ *
+ *                      This function will fail, if the capacity of the buffer is less or equal to
+ *                      the combined size of the source strings.
+ *
+ * @return  A zyan status code.
+ *
+ * The behavior of this function is undefined, if `s1` or `s2` are views into the `destination`
+ * string or `destination` points to an already initialized `ZyanString` instance.
+ *
+ * Finalization is not required for strings created by this function.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringConcatCustomBuffer(ZyanString* destination,
+    const ZyanStringView* s1, const ZyanStringView* s2, char* buffer, ZyanUSize capacity);
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Views                                                                                          */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Returns a view inside an existing view/string.
+ *
+ * @param   view    A pointer to the `ZyanStringView` instance.
+ * @param   source  A pointer to the source string.
+ *
+ * @return  A zyan status code.
+ *
+ * The `ZYAN_STRING_TO_VEW` macro can be used to pass any `ZyanString` instance as value for the
+ * `source` string.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringViewInsideView(ZyanStringView* view,
+    const ZyanStringView* source);
+
+/**
+ * @brief   Returns a view inside an existing view/string starting from the given `index`.
+ *
+ * @param   view    A pointer to the `ZyanStringView` instance.
+ * @param   source  A pointer to the source string.
+ * @param   index   The start index.
+ * @param   count   The number of characters.
+ *
+ * @return  A zyan status code.
+ *
+ * The `ZYAN_STRING_TO_VEW` macro can be used to pass any `ZyanString` instance as value for the
+ * `source` string.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringViewInsideViewEx(ZyanStringView* view,
+    const ZyanStringView* source, ZyanUSize index, ZyanUSize count);
+
+/**
+ * @brief   Returns a view inside a null-terminated C-style string.
+ *
+ * @param   view    A pointer to the `ZyanStringView` instance.
+ * @param   string  The C-style string.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringViewInsideBuffer(ZyanStringView* view, const char* string);
+
+/**
+ * @brief   Returns a view inside a character buffer with custom length.
+ *
+ * @param   view    A pointer to the `ZyanStringView` instance.
+ * @param   buffer  A pointer to the buffer containing the string characters.
+ * @param   length  The length of the string (number of characters).
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringViewInsideBufferEx(ZyanStringView* view, const char* buffer,
+    ZyanUSize length);
+
+/**
+ * @brief   Returns the size (number of characters) of the view.
+ *
+ * @param   view    A pointer to the `ZyanStringView` instance.
+ * @param   size    Receives the size (number of characters) of the view.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringViewGetSize(const ZyanStringView* view, ZyanUSize* size);
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Character access                                                                               */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Returns the character at the given `index`.
+ *
+ * @param   string  A pointer to the `ZyanStringView` instance.
+ * @param   index   The character index.
+ * @param   value   Receives the desired character of the string.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringGetChar(const ZyanStringView* string, ZyanUSize index,
+    char* value);
+
+/**
+ * @brief   Returns a pointer to the character at the given `index`.
+ *
+ * @param   string  A pointer to the `ZyanString` instance.
+ * @param   index   The character index.
+ * @param   value   Receives a pointer to the desired character in the string.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringGetCharMutable(ZyanString* string, ZyanUSize index,
+    char** value);
+
+/**
+ * @brief   Assigns a new value to the character at the given `index`.
+ *
+ * @param   string  A pointer to the `ZyanString` instance.
+ * @param   index   The character index.
+ * @param   value   The character to assign.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringSetChar(ZyanString* string, ZyanUSize index, char value);
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Insertion                                                                                      */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Inserts the content of the source string in the destination string at the given `index`.
+ *
+ * @param   destination The destination string.
+ * @param   index       The insert index.
+ * @param   source      The source string.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringInsert(ZyanString* destination, ZyanUSize index,
+    const ZyanStringView* source);
+
+/**
+ * @brief   Inserts `count` characters of the source string in the destination string at the given
+ *          `index`.
+ *
+ * @param   destination         The destination string.
+ * @param   destination_index   The insert index.
+ * @param   source              The source string.
+ * @param   source_index        The index of the first character to be inserted from the source
+ *                              string.
+ * @param   count               The number of chars to insert from the source string.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringInsertEx(ZyanString* destination, ZyanUSize destination_index,
+    const ZyanStringView* source, ZyanUSize source_index, ZyanUSize count);
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Appending                                                                                      */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Appends the content of the source string to the end of the destination string.
+ *
+ * @param   destination The destination string.
+ * @param   source      The source string.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringAppend(ZyanString* destination, const ZyanStringView* source);
+
+/**
+ * @brief   Appends `count` characters of the source string to the end of the destination string.
+ *
+ * @param   destination     The destination string.
+ * @param   source          The source string.
+ * @param   source_index    The index of the first character to be appended from the source string.
+ * @param   count           The number of chars to append from the source string.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringAppendEx(ZyanString* destination, const ZyanStringView* source,
+    ZyanUSize source_index, ZyanUSize count);
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Deletion                                                                                       */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Deletes characters from the given string, starting at `index`.
+ *
+ * @param   string  A pointer to the `ZyanString` instance.
+ * @param   index   The index of the first character to delete.
+ * @param   count   The number of characters to delete.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringDelete(ZyanString* string, ZyanUSize index, ZyanUSize count);
+
+/**
+ * @brief   Deletes all remaining characters from the given string, starting at `index`.
+ *
+ * @param   string  A pointer to the `ZyanString` instance.
+ * @param   index   The index of the first character to delete.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringTruncate(ZyanString* string, ZyanUSize index);
+
+/**
+ * @brief   Erases the given string.
+ *
+ * @param   string  A pointer to the `ZyanString` instance.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringClear(ZyanString* string);
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Searching                                                                                      */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Searches for the first occurrence of `needle` in the given `haystack` starting from the
+ *          left.
+ *
+ * @param   haystack    The string to search in.
+ * @param   needle      The sub-string to search for.
+ * @param   found_index A pointer to a variable that receives the index of the first occurrence of
+ *                      `needle`.
+ *
+ * @return  `ZYAN_STATUS_TRUE`, if the needle was found, `ZYAN_STATUS_FALSE`, if not, or another
+ *          zyan status code, if an error occured.
+ *
+ * The `found_index` is set to `-1`, if the needle was not found.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringLPos(const ZyanStringView* haystack,
+    const ZyanStringView* needle, ZyanISize* found_index);
+
+/**
+ * @brief   Searches for the first occurrence of `needle` in the given `haystack` starting from the
+ *          left.
+ *
+ * @param   haystack    The string to search in.
+ * @param   needle      The sub-string to search for.
+ * @param   found_index A pointer to a variable that receives the index of the first occurrence of
+ *                      `needle`.
+ * @param   index       The start index.
+ * @param   count       The maximum number of characters to iterate, beginning from the start
+ *                      `index`.
+ *
+ * @return  `ZYAN_STATUS_TRUE`, if the needle was found, `ZYAN_STATUS_FALSE`, if not, or another
+ *          zyan status code, if an error occured.
+ *
+ * The `found_index` is set to `-1`, if the needle was not found.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringLPosEx(const ZyanStringView* haystack,
+    const ZyanStringView* needle, ZyanISize* found_index, ZyanUSize index, ZyanUSize count);
+
+/**
+ * @brief   Performs a case-insensitive search for the first occurrence of `needle` in the given
+ *          `haystack` starting from the left.
+ *
+ * @param   haystack    The string to search in.
+ * @param   needle      The sub-string to search for.
+ * @param   found_index A pointer to a variable that receives the index of the first occurrence of
+ *                      `needle`.
+ *
+ * @return  `ZYAN_STATUS_TRUE`, if the needle was found, `ZYAN_STATUS_FALSE`, if not, or another
+ *          zyan status code, if an error occured.
+ *
+ * The `found_index` is set to `-1`, if the needle was not found.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringLPosI(const ZyanStringView* haystack,
+    const ZyanStringView* needle, ZyanISize* found_index);
+
+/**
+ * @brief   Performs a case-insensitive search for the first occurrence of `needle` in the given
+ *          `haystack` starting from the left.
+ *
+ * @param   haystack    The string to search in.
+ * @param   needle      The sub-string to search for.
+ * @param   found_index A pointer to a variable that receives the index of the first occurrence of
+ *                      `needle`.
+ * @param   index       The start index.
+ * @param   count       The maximum number of characters to iterate, beginning from the start
+ *                      `index`.
+ *
+ * @return  `ZYAN_STATUS_TRUE`, if the needle was found, `ZYAN_STATUS_FALSE`, if not, or another
+ *          zyan status code, if an error occured.
+ *
+ * The `found_index` is set to `-1`, if the needle was not found.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringLPosIEx(const ZyanStringView* haystack,
+    const ZyanStringView* needle, ZyanISize* found_index, ZyanUSize index, ZyanUSize count);
+
+/**
+ * @brief   Searches for the first occurrence of `needle` in the given `haystack` starting from the
+ *          right.
+ *
+ * @param   haystack    The string to search in.
+ * @param   needle      The sub-string to search for.
+ * @param   found_index A pointer to a variable that receives the index of the first occurrence of
+ *                      `needle`.
+ *
+ * @return  `ZYAN_STATUS_TRUE`, if the needle was found, `ZYAN_STATUS_FALSE`, if not, or another
+ *          zyan status code, if an error occured.
+ *
+ * The `found_index` is set to `-1`, if the needle was not found.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringRPos(const ZyanStringView* haystack,
+    const ZyanStringView* needle, ZyanISize* found_index);
+
+/**
+ * @brief   Searches for the first occurrence of `needle` in the given `haystack` starting from the
+ *          right.
+ *
+ * @param   haystack    The string to search in.
+ * @param   needle      The sub-string to search for.
+ * @param   found_index A pointer to a variable that receives the index of the first occurrence of
+ *                      `needle`.
+ * @param   index       The start index.
+ * @param   count       The maximum number of characters to iterate, beginning from the start
+ *                      `index`.
+ *
+ * @return  `ZYAN_STATUS_TRUE`, if the needle was found, `ZYAN_STATUS_FALSE`, if not, or another
+ *          zyan status code, if an error occured.
+ *
+ * The `found_index` is set to `-1`, if the needle was not found.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringRPosEx(const ZyanStringView* haystack,
+    const ZyanStringView* needle, ZyanISize* found_index, ZyanUSize index, ZyanUSize count);
+
+/**
+ * @brief   Performs a case-insensitive search for the first occurrence of `needle` in the given
+ *          `haystack` starting from the right.
+ *
+ * @param   haystack    The string to search in.
+ * @param   needle      The sub-string to search for.
+ * @param   found_index A pointer to a variable that receives the index of the first occurrence of
+ *                      `needle`.
+ *
+ * @return  `ZYAN_STATUS_TRUE`, if the needle was found, `ZYAN_STATUS_FALSE`, if not, or another
+ *          zyan status code, if an error occured.
+ *
+ * The `found_index` is set to `-1`, if the needle was not found.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringRPosI(const ZyanStringView* haystack,
+    const ZyanStringView* needle, ZyanISize* found_index);
+
+/**
+ * @brief   Performs a case-insensitive search for the first occurrence of `needle` in the given
+ *          `haystack` starting from the right.
+ *
+ * @param   haystack    The string to search in.
+ * @param   needle      The sub-string to search for.
+ * @param   found_index A pointer to a variable that receives the index of the first occurrence of
+ *                      `needle`.
+ * @param   index       The start index.
+ * @param   count       The maximum number of characters to iterate, beginning from the start
+ *                      `index`.
+ *
+ * @return  `ZYAN_STATUS_TRUE`, if the needle was found, `ZYAN_STATUS_FALSE`, if not, or another
+ *          zyan status code, if an error occured.
+ *
+ * The `found_index` is set to `-1`, if the needle was not found.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringRPosIEx(const ZyanStringView* haystack,
+    const ZyanStringView* needle, ZyanISize* found_index, ZyanUSize index, ZyanUSize count);
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Comparing                                                                                      */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Compares two strings.
+ *
+ * @param   s1      The first string
+ * @param   s2      The second string.
+ * @param   result  Receives the comparison result.
+ *
+ *                  Values:
+ *                  - `result  < 0` -> The first character that does not match has a lower value
+ *                    in `s1` than in `s2`.
+ *                  - `result == 0` -> The contents of both strings are equal.
+ *                  - `result  > 0` -> The first character that does not match has a greater value
+ *                    in `s1` than in `s2`.
+ *
+ * @return  `ZYAN_STATUS_TRUE`, if the strings are equal, `ZYAN_STATUS_FALSE`, if not, or another
+ *          zyan status code, if an error occured.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringCompare(const ZyanStringView* s1, const ZyanStringView* s2,
+    ZyanI32* result);
+
+/**
+ * @brief   Performs a case-insensitive comparison of two strings.
+ *
+ * @param   s1      The first string
+ * @param   s2      The second string.
+ * @param   result  Receives the comparison result.
+ *
+ *                  Values:
+ *                  - `result  < 0` -> The first character that does not match has a lower value
+ *                    in `s1` than in `s2`.
+ *                  - `result == 0` -> The contents of both strings are equal.
+ *                  - `result  > 0` -> The first character that does not match has a greater value
+ *                    in `s1` than in `s2`.
+ *
+ * @return  `ZYAN_STATUS_TRUE`, if the strings are equal, `ZYAN_STATUS_FALSE`, if not, or another
+ *          zyan status code, if an error occured.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringCompareI(const ZyanStringView* s1, const ZyanStringView* s2,
+    ZyanI32* result);
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Case conversion                                                                                */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Converts the given string to lowercase letters.
+ *
+ * @param   string      A pointer to the `ZyanString` instance.
+ *
+ * @return  A zyan status code.
+ *
+ * This function will fail, if the `ZYAN_STRING_IS_IMMUTABLE` flag is set for the specified
+ * `ZyanString` instance.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringToLowerCase(ZyanString* string);
+
+/**
+ * @brief   Converts `count` characters of the given string to lowercase letters.
+ *
+ * @param   string  A pointer to the `ZyanString` instance.
+ * @param   index   The start index.
+ * @param   count   The number of characters to convert, beginning from the start `index`.
+ *
+ * @return  A zyan status code.
+ *
+ * This function will fail, if the `ZYAN_STRING_IS_IMMUTABLE` flag is set for the specified
+ * `ZyanString` instance.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringToLowerCaseEx(ZyanString* string, ZyanUSize index,
+    ZyanUSize count);
+
+/**
+ * @brief   Converts the given string to uppercase letters.
+ *
+ * @param   string      A pointer to the `ZyanString` instance.
+ *
+ * @return  A zyan status code.
+ *
+ * This function will fail, if the `ZYAN_STRING_IS_IMMUTABLE` flag is set for the specified
+ * `ZyanString` instance.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringToUpperCase(ZyanString* string);
+
+/**
+ * @brief   Converts `count` characters of the given string to uppercase letters.
+ *
+ * @param   string  A pointer to the `ZyanString` instance.
+ * @param   index   The start index.
+ * @param   count   The number of characters to convert, beginning from the start `index`.
+ *
+ * @return  A zyan status code.
+ *
+ * This function will fail, if the `ZYAN_STRING_IS_IMMUTABLE` flag is set for the specified
+ * `ZyanString` instance.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringToUpperCaseEx(ZyanString* string, ZyanUSize index,
+    ZyanUSize count);
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Memory management                                                                              */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Resizes the given `ZyanString` instance.
+ *
+ * @param   string  A pointer to the `ZyanString` instance.
+ * @param   size    The new size of the string.
+ *
+ * @return  A zyan status code.
+ *
+ * This function will fail, if the `ZYAN_STRING_IS_IMMUTABLE` flag is set for the specified
+ * `ZyanString` instance.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringResize(ZyanString* string, ZyanUSize size);
+
+/**
+ * @brief   Changes the capacity of the given `ZyanString` instance.
+ *
+ * @param   string      A pointer to the `ZyanString` instance.
+ * @param   capacity    The new minimum capacity of the string.
+ *
+ * @return  A zyan status code.
+ *
+ * This function will fail, if the `ZYAN_STRING_IS_IMMUTABLE` flag is set for the specified
+ * `ZyanString` instance.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringReserve(ZyanString* string, ZyanUSize capacity);
+
+/**
+ * @brief   Shrinks the capacity of the given string to match it's size.
+ *
+ * @param   string  A pointer to the `ZyanString` instance.
+ *
+ * @return  A zyan status code.
+ *
+ * This function will fail, if the `ZYAN_STRING_IS_IMMUTABLE` flag is set for the specified
+ * `ZyanString` instance.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringShrinkToFit(ZyanString* string);
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Information                                                                                    */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Returns the current capacity of the string.
+ *
+ * @param   string      A pointer to the `ZyanString` instance.
+ * @param   capacity    Receives the size of the string.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringGetCapacity(const ZyanString* string, ZyanUSize* capacity);
+
+/**
+ * @brief   Returns the current size (number of characters) of the string (excluding the
+ *          terminating zero character).
+ *
+ * @param   string  A pointer to the `ZyanString` instance.
+ * @param   size    Receives the size (number of characters) of the string.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringGetSize(const ZyanString* string, ZyanUSize* size);
+
+/**
+ * @brief   Returns the C-style string of the given `ZyanString` instance.
+ *
+ * @param   string  A pointer to the `ZyanString` instance.
+ * @param   value   Receives a pointer to the C-style string.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanStringGetData(const ZyanString* string, const char** value);
+
+/* ---------------------------------------------------------------------------------------------- */
+
+/* ============================================================================================== */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // ZYCORE_STRING_H
new file mode 100644
--- /dev/null
+++ b/js/src/zydis/Zycore/Types.h
@@ -0,0 +1,154 @@
+/***************************************************************************************************
+
+  Zyan Core Library (Zyan-C)
+
+  Original Author : Florian Bernd, Joel Hoener
+
+ * 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.
+
+***************************************************************************************************/
+
+/**
+ * @file
+ * @brief   Includes and defines some default datatypes.
+ */
+
+#ifndef ZYCORE_TYPES_H
+#define ZYCORE_TYPES_H
+
+#include "zydis/Zycore/Defines.h"
+
+/* ============================================================================================== */
+/* Integer types                                                                                  */
+/* ============================================================================================== */
+
+#if !defined(ZYAN_NO_LIBC) && (!defined(ZYAN_MSVC) && defined(ZYAN_KERNEL)) // The WDK LibC lacks stdint.h.
+    // If is LibC present, we use stdint types.
+#   include <stdint.h>
+#   include <stddef.h>
+    typedef uint8_t   ZyanU8;
+    typedef uint16_t  ZyanU16;
+    typedef uint32_t  ZyanU32;
+    typedef uint64_t  ZyanU64;
+    typedef int8_t    ZyanI8;
+    typedef int16_t   ZyanI16;
+    typedef int32_t   ZyanI32;
+    typedef int64_t   ZyanI64;
+    typedef size_t    ZyanUSize;
+    typedef ptrdiff_t ZyanISize;
+    typedef uintptr_t ZyanUPointer;
+    typedef intptr_t  ZyanIPointer;
+#else
+    // No LibC, use compiler built-in types / macros.
+#   if defined(ZYAN_MSVC) || defined(ZYAN_ICC)
+        typedef unsigned __int8  ZyanU8;
+        typedef unsigned __int16 ZyanU16;
+        typedef unsigned __int32 ZyanU32;
+        typedef unsigned __int64 ZyanU64;
+        typedef   signed __int8  ZyanI8;
+        typedef   signed __int16 ZyanI16;
+        typedef   signed __int32 ZyanI32;
+        typedef   signed __int64 ZyanI64;
+#       if _WIN64
+           typedef ZyanU64       ZyanUSize;
+           typedef ZyanI64       ZyanISize;
+           typedef ZyanU64       ZyanUPointer;
+           typedef ZyanI64       ZyanIPointer;
+#       else
+           typedef ZyanU32       ZyanUSize;
+           typedef ZyanI32       ZyanISize;
+           typedef ZyanU32       ZyanUPointer;
+           typedef ZyanI32       ZyanIPointer;
+#       endif
+#   elif defined(ZYAN_GNUC)
+        typedef __UINT8_TYPE__   ZyanU8;
+        typedef __UINT16_TYPE__  ZyanU16;
+        typedef __UINT32_TYPE__  ZyanU32;
+        typedef __UINT64_TYPE__  ZyanU64;
+        typedef __INT8_TYPE__    ZyanI8;
+        typedef __INT16_TYPE__   ZyanI16;
+        typedef __INT32_TYPE__   ZyanI32;
+        typedef __INT64_TYPE__   ZyanI64;
+        typedef __SIZE_TYPE__    ZyanUSize;
+        typedef __PTRDIFF_TYPE__ ZyanISize;
+        typedef __UINTPTR_TYPE__ ZyanUPointer;
+        typedef __INTPTR_TYPE__  ZyanIPointer;
+#   else
+#       error "Unsupported compiler for no-libc mode."
+#   endif
+#endif
+
+// Verify size assumptions.
+ZYAN_STATIC_ASSERT(sizeof(ZyanU8      ) == 1            );
+ZYAN_STATIC_ASSERT(sizeof(ZyanU16     ) == 2            );
+ZYAN_STATIC_ASSERT(sizeof(ZyanU32     ) == 4            );
+ZYAN_STATIC_ASSERT(sizeof(ZyanU64     ) == 8            );
+ZYAN_STATIC_ASSERT(sizeof(ZyanI8      ) == 1            );
+ZYAN_STATIC_ASSERT(sizeof(ZyanI16     ) == 2            );
+ZYAN_STATIC_ASSERT(sizeof(ZyanI32     ) == 4            );
+ZYAN_STATIC_ASSERT(sizeof(ZyanI64     ) == 8            );
+ZYAN_STATIC_ASSERT(sizeof(ZyanUSize   ) == sizeof(void*)); // TODO: This one is incorrect!
+ZYAN_STATIC_ASSERT(sizeof(ZyanISize   ) == sizeof(void*)); // TODO: This one is incorrect!
+ZYAN_STATIC_ASSERT(sizeof(ZyanUPointer) == sizeof(void*));
+ZYAN_STATIC_ASSERT(sizeof(ZyanIPointer) == sizeof(void*));
+
+// Verify signedness assumptions (relies on size checks above).
+ZYAN_STATIC_ASSERT((ZyanI8 )-1 >> 1 < (ZyanI8 )((ZyanU8 )-1 >> 1));
+ZYAN_STATIC_ASSERT((ZyanI16)-1 >> 1 < (ZyanI16)((ZyanU16)-1 >> 1));
+ZYAN_STATIC_ASSERT((ZyanI32)-1 >> 1 < (ZyanI32)((ZyanU32)-1 >> 1));
+ZYAN_STATIC_ASSERT((ZyanI64)-1 >> 1 < (ZyanI64)((ZyanU64)-1 >> 1));
+
+/* ============================================================================================== */
+/* NULL                                                                                           */
+/* ============================================================================================== */
+
+#define ZYAN_NULL ((void*)0)
+
+/* ============================================================================================== */
+/* Logic types                                                                                    */
+/* ============================================================================================== */
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Boolean                                                                                        */
+/* ---------------------------------------------------------------------------------------------- */
+
+#define ZYAN_FALSE 0
+#define ZYAN_TRUE  1
+
+/**
+ * @brief   Defines the `ZyanBool` datatype.
+ */
+typedef ZyanU8 ZyanBool;
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Ternary                                                                                        */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Defines the `ZyanTernary` datatype.
+ */
+typedef ZyanI8 ZyanTernary;
+
+#define ZYAN_TERNARY_FALSE    (-1)
+#define ZYAN_TERNARY_UNKNOWN  0x00
+#define ZYAN_TERNARY_TRUE     0x01
+
+/* ============================================================================================== */
+
+#endif /* ZYCORE_TYPES_H */
new file mode 100644
--- /dev/null
+++ b/js/src/zydis/Zycore/Vector.c
@@ -0,0 +1,800 @@
+/***************************************************************************************************
+
+  Zyan Core Library (Zycore-C)
+
+  Original Author : Florian Bernd
+
+ * 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.
+
+***************************************************************************************************/
+
+#include "zydis/Zycore/LibC.h"
+#include "zydis/Zycore/Vector.h"
+
+/* ============================================================================================== */
+/* Internal macros                                                                                */
+/* ============================================================================================== */
+
+/**
+ * @brief   Checks, if the passed vector should grow.
+ *
+ * @param   size        The desired size of the vector.
+ * @param   capacity    The current capacity of the vector.
+ *
+ * @return  `ZYAN_TRUE`, if the vector should grow or `ZYAN_FALSE`, if not.
+ */
+#define ZYCORE_VECTOR_SHOULD_GROW(size, capacity) \
+    ((size) > (capacity))
+
+/**
+ * @brief   Checks, if the passed vector should shrink.
+ *
+ * @param   size        The desired size of the vector.
+ * @param   capacity    The current capacity of the vector.
+ * @param   threshold   The shrink threshold.
+ *
+ * @return  `ZYAN_TRUE`, if the vector should shrink or `ZYAN_FALSE`, if not.
+ */
+#define ZYCORE_VECTOR_SHOULD_SHRINK(size, capacity, threshold) \
+    ((size) < (capacity) * (threshold))
+
+/**
+ * @brief   Returns the offset of the element at the given `index`.
+ *
+ * @param   vector  A pointer to the `ZyanVector` instance.
+ * @param   index   The element index.
+ *
+ * @return  The offset of the element at the given `index`.
+ */
+#define ZYCORE_VECTOR_OFFSET(vector, index) \
+    ((void*)((ZyanU8*)(vector)->data + ((index) * (vector)->element_size)))
+
+/* ============================================================================================== */
+/* Internal functions                                                                             */
+/* ============================================================================================== */
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Helper functions                                                                               */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Reallocates the internal buffer of the vector.
+ *
+ * @param   vector      A pointer to the `ZyanVector` instance.
+ * @param   capacity    The new capacity.
+ *
+ * @return  A zyan status code.
+ */
+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)
+        {
+            return ZYAN_STATUS_INSUFFICIENT_BUFFER_SIZE;
+        }
+        return ZYAN_STATUS_SUCCESS;
+    }
+
+    ZYAN_ASSERT(vector->allocator);
+    ZYAN_ASSERT(vector->allocator->reallocate);
+
+    if (capacity < ZYAN_VECTOR_MIN_CAPACITY)
+    {
+        if (vector->capacity > ZYAN_VECTOR_MIN_CAPACITY)
+        {
+            capacity = ZYAN_VECTOR_MIN_CAPACITY;
+        } else
+        {
+            return ZYAN_STATUS_SUCCESS;
+        }
+    }
+
+    vector->capacity = capacity;
+    ZYAN_CHECK(vector->allocator->reallocate(vector->allocator, &vector->data,
+        vector->element_size, vector->capacity));
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+/**
+ * @brief   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.
+ */
+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);
+
+    void* const source   = ZYCORE_VECTOR_OFFSET(vector, index + count);
+    void* const dest     = ZYCORE_VECTOR_OFFSET(vector, index);
+    const ZyanUSize size = (vector->size - index) * vector->element_size;
+    ZYAN_MEMMOVE(dest, source, size);
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+/**
+ * @brief   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.
+ */
+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);
+
+    void* const source   = ZYCORE_VECTOR_OFFSET(vector, index);
+    void* const dest     = ZYCORE_VECTOR_OFFSET(vector, index + count);
+    const ZyanUSize size = (vector->size - index) * vector->element_size;
+    ZYAN_MEMMOVE(dest, source, size);
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+/* ---------------------------------------------------------------------------------------------- */
+
+/* ============================================================================================== */
+/* Exported functions                                                                             */
+/* ============================================================================================== */
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Constructor and destructor                                                                     */
+/* ---------------------------------------------------------------------------------------------- */
+
+#ifndef ZYAN_NO_LIBC
+
+ZyanStatus ZyanVectorInit(ZyanVector* vector, ZyanUSize element_size, ZyanUSize capacity)
+{
+    return ZyanVectorInitEx(vector, element_size, capacity, ZyanAllocatorDefault(),
+        ZYAN_VECTOR_DEFAULT_GROWTH_FACTOR, ZYAN_VECTOR_DEFAULT_SHRINK_THRESHOLD);
+}
+
+#endif // ZYAN_NO_LIBC
+
+ZyanStatus ZyanVectorInitEx(ZyanVector* vector, ZyanUSize element_size, ZyanUSize capacity,
+    ZyanAllocator* allocator, float growth_factor, float shrink_threshold)
+{
+    if (!vector || !element_size || !allocator || (growth_factor < 1.0f) ||
+        (shrink_threshold < 0.0f) || (shrink_threshold > 1.0f))
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    ZYAN_ASSERT(allocator->allocate);
+
+    vector->allocator        = allocator;
+    vector->growth_factor    = growth_factor;
+    vector->shrink_threshold = shrink_threshold;
+    vector->size             = 0;
+    vector->capacity         = ZYAN_MAX(ZYAN_VECTOR_MIN_CAPACITY, capacity);
+    vector->element_size     = element_size;
+    vector->data             = ZYAN_NULL;
+
+    return allocator->allocate(vector->allocator, &vector->data, vector->element_size,
+        vector->capacity);
+}
+
+ZyanStatus ZyanVectorInitCustomBuffer(ZyanVector* vector, ZyanUSize element_size,
+    void* buffer, ZyanUSize capacity)
+{
+    if (!vector || !element_size || !buffer || !capacity)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    vector->allocator        = ZYAN_NULL;
+    vector->growth_factor    = 1.0f;
+    vector->shrink_threshold = 0.0f;
+    vector->size             = 0;
+    vector->capacity         = capacity;
+    vector->element_size     = element_size;
+    vector->data             = buffer;
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+ZyanStatus ZyanVectorDestroy(ZyanVector* vector, ZyanMemberProcedure destructor)
+{
+    if (!vector)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    ZYAN_ASSERT(vector->element_size);
+    ZYAN_ASSERT(vector->data);
+
+    if (destructor)
+    {
+        for (ZyanUSize i = 0; i < vector->size; ++i)
+        {
+            destructor(ZYCORE_VECTOR_OFFSET(vector, i));
+        }
+    }
+
+    if (vector->allocator && vector->capacity)
+    {
+        ZYAN_ASSERT(vector->allocator->deallocate);
+        ZYAN_CHECK(vector->allocator->deallocate(vector->allocator, vector->data,
+            vector->element_size, vector->capacity));
+    }
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Duplication                                                                                    */
+/* ---------------------------------------------------------------------------------------------- */
+
+#ifndef ZYAN_NO_LIBC
+
+ZyanStatus ZyanVectorDuplicate(ZyanVector* destination, const ZyanVector* source,
+    ZyanUSize capacity)
+{
+    return ZyanVectorDuplicateEx(destination, source, capacity, ZyanAllocatorDefault(),
+        ZYAN_VECTOR_DEFAULT_GROWTH_FACTOR, ZYAN_VECTOR_DEFAULT_SHRINK_THRESHOLD);
+}
+
+#endif // ZYAN_NO_LIBC
+
+ZyanStatus ZyanVectorDuplicateEx(ZyanVector* destination, const ZyanVector* source,
+    ZyanUSize capacity, ZyanAllocator* allocator, float growth_factor, float shrink_threshold)
+{
+    if (!source)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    const ZyanUSize len = source->size;
+
+    capacity = ZYAN_MAX(capacity, len);
+    ZYAN_CHECK(ZyanVectorInitEx(destination, source->element_size, capacity, allocator,
+        growth_factor, shrink_threshold));
+    ZYAN_ASSERT(destination->capacity >= len);
+
+    ZYAN_MEMCPY(destination->data, source->data, len * source->element_size);
+    destination->size = len;
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+ZyanStatus ZyanVectorDuplicateCustomBuffer(ZyanVector* destination, const ZyanVector* source,
+    void* buffer, ZyanUSize capacity)
+{
+    if (!source)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    const ZyanUSize len = source->size;
+
+    if (capacity < len)
+    {
+        return ZYAN_STATUS_INSUFFICIENT_BUFFER_SIZE;
+    }
+
+    ZYAN_CHECK(ZyanVectorInitCustomBuffer(destination, source->element_size, buffer, capacity));
+    ZYAN_ASSERT(destination->capacity >= len);
+
+    ZYAN_MEMCPY(destination->data, source->data, len * source->element_size);
+    destination->size = len;
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Element access                                                                                 */
+/* ---------------------------------------------------------------------------------------------- */
+
+const void* ZyanVectorGet(const ZyanVector* vector, ZyanUSize index)
+{
+    if (!vector || (index >= vector->size))
+    {
+        return ZYAN_NULL;
+    }
+
+    ZYAN_ASSERT(vector->element_size);
+    ZYAN_ASSERT(vector->data);
+
+    return ZYCORE_VECTOR_OFFSET(vector, index);
+}
+
+void* ZyanVectorGetMutable(const ZyanVector* vector, ZyanUSize index)
+{
+    if (!vector || (index >= vector->size))
+    {
+        return ZYAN_NULL;
+    }
+
+    ZYAN_ASSERT(vector->element_size);
+    ZYAN_ASSERT(vector->data);
+
+    return ZYCORE_VECTOR_OFFSET(vector, index);
+}
+
+ZyanStatus ZyanVectorGetPointer(const ZyanVector* vector, ZyanUSize index, const void** value)
+{
+    if (!vector || !value)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+    if (index >= vector->size)
+    {
+        return ZYAN_STATUS_OUT_OF_RANGE;
+    }
+
+    ZYAN_ASSERT(vector->element_size);
+    ZYAN_ASSERT(vector->data);
+
+    *value = (const void*)ZYCORE_VECTOR_OFFSET(vector, index);
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+ZyanStatus ZyanVectorGetPointerMutable(const ZyanVector* vector, ZyanUSize index, void** value)
+{
+    if (!vector || !value)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+    if (index >= vector->size)
+    {
+        return ZYAN_STATUS_OUT_OF_RANGE;
+    }
+
+    ZYAN_ASSERT(vector->element_size);
+    ZYAN_ASSERT(vector->data);
+
+    *value = ZYCORE_VECTOR_OFFSET(vector, index);
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+ZyanStatus ZyanVectorSet(ZyanVector* vector, ZyanUSize index, const void* value)
+{
+    if (!vector || !value)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+    if (index >= vector->size)
+    {
+        return ZYAN_STATUS_OUT_OF_RANGE;
+    }
+
+    ZYAN_ASSERT(vector->element_size);
+    ZYAN_ASSERT(vector->data);
+
+    void* const offset = ZYCORE_VECTOR_OFFSET(vector, index);
+    ZYAN_MEMCPY(offset, value, vector->element_size);
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Insertion                                                                                      */
+/* ---------------------------------------------------------------------------------------------- */
+
+ZyanStatus ZyanVectorPush(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_CHECK(ZyanVectorReallocate(vector,
+            ZYAN_MAX(1, (ZyanUSize)((vector->size + 1) * vector->growth_factor))));
+    }
+
+    void* const offset = ZYCORE_VECTOR_OFFSET(vector, vector->size);
+    ZYAN_MEMCPY(offset, element, vector->element_size);
+
+    ++vector->size;
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+ZyanStatus ZyanVectorInsert(ZyanVector* vector, ZyanUSize index, const void* element)
+{
+    return ZyanVectorInsertEx(vector, index, element, 1);
+}
+
+ZyanStatus ZyanVectorInsertEx(ZyanVector* vector, ZyanUSize index, const void* elements,
+    ZyanUSize count)
+{
+    if (!vector || !elements || !count)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+    if (index > vector->size)
+    {
+        return ZYAN_STATUS_OUT_OF_RANGE;
+    }
+
+    ZYAN_ASSERT(vector->element_size);
+    ZYAN_ASSERT(vector->data);
+
+    if (ZYCORE_VECTOR_SHOULD_GROW(vector->size + count, vector->capacity))
+    {
+        ZYAN_CHECK(ZyanVectorReallocate(vector,
+            ZYAN_MAX(1, (ZyanUSize)((vector->size + count) * vector->growth_factor))));
+    }
+
+    if (index < vector->size)
+    {
+        ZYAN_CHECK(ZyanVectorShiftRight(vector, index, count));
+    }
+
+    void* const offset = ZYCORE_VECTOR_OFFSET(vector, index);
+    ZYAN_MEMCPY(offset, elements, count * vector->element_size);
+    vector->size += count;
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+ZyanStatus ZyanVectorEmplace(ZyanVector* vector, void** element, ZyanMemberFunction constructor)
+{
+    if (!vector)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    return ZyanVectorEmplaceEx(vector, vector->size, element, constructor);
+}
+
+ZyanStatus ZyanVectorEmplaceEx(ZyanVector* vector, ZyanUSize index, void** element,
+    ZyanMemberFunction constructor)
+{
+    if (!vector)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+    if (index > vector->size)
+    {
+        return ZYAN_STATUS_OUT_OF_RANGE;
+    }
+
+    ZYAN_ASSERT(vector->element_size);
+    ZYAN_ASSERT(vector->data);
+
+    if (ZYCORE_VECTOR_SHOULD_GROW(vector->size + 1, vector->capacity))
+    {
+        ZYAN_CHECK(ZyanVectorReallocate(vector,
+            ZYAN_MAX(1, (ZyanUSize)((vector->size + 1) * vector->growth_factor))));
+    }
+
+    if (index < vector->size)
+    {
+        ZYAN_CHECK(ZyanVectorShiftRight(vector, index, 1));
+    }
+
+    *element = ZYCORE_VECTOR_OFFSET(vector, index);
+    if (constructor)
+    {
+        ZYAN_CHECK(constructor(*element));
+    }
+
+    ++vector->size;
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Utils                                                                                          */
+/* ---------------------------------------------------------------------------------------------- */
+
+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->size == vector->capacity)
+    {
+        return ZYAN_STATUS_INSUFFICIENT_BUFFER_SIZE;
+    }
+
+    ZYAN_ASSERT(vector->element_size);
+    ZYAN_ASSERT(vector->data);
+
+    ZyanU64* const t = ZYCORE_VECTOR_OFFSET(vector, vector->size);
+    ZyanU64* const a = ZYCORE_VECTOR_OFFSET(vector, index_first);
+    ZyanU64* const b = ZYCORE_VECTOR_OFFSET(vector, index_second);
+    ZYAN_MEMCPY(t, a, vector->element_size);
+    ZYAN_MEMCPY(a, b, vector->element_size);
+    ZYAN_MEMCPY(b, t, vector->element_size);
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Deletion                                                                                       */
+/* ---------------------------------------------------------------------------------------------- */
+
+ZyanStatus ZyanVectorDelete(ZyanVector* vector, ZyanUSize index)
+{
+    return ZyanVectorDeleteEx(vector, index, 1);
+}
+
+ZyanStatus ZyanVectorDeleteEx(ZyanVector* vector, ZyanUSize index, ZyanUSize count)
+{
+    if (!vector || !count)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+    if (index + count >= vector->size)
+    {
+        return ZYAN_STATUS_OUT_OF_RANGE;
+    }
+
+    if (index < vector->size - 1)
+    {
+        ZYAN_CHECK(ZyanVectorShiftLeft(vector, index, count));
+    }
+
+    vector->size -= count;
+    if (ZYCORE_VECTOR_SHOULD_SHRINK(vector->size, vector->capacity, vector->shrink_threshold))
+    {
+        return ZyanVectorReallocate(vector,
+            ZYAN_MAX(1, (ZyanUSize)(vector->size * vector->growth_factor)));
+    }
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+ZyanStatus ZyanVectorPop(ZyanVector* vector)
+{
+    if (!vector)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+    if (vector->size == 0)
+    {
+        return ZYAN_STATUS_OUT_OF_RANGE;
+    }
+
+    --vector->size;
+    if (ZYCORE_VECTOR_SHOULD_SHRINK(vector->size, vector->capacity, vector->shrink_threshold))
+    {
+        return ZyanVectorReallocate(vector,
+            ZYAN_MAX(1, (ZyanUSize)(vector->size * vector->growth_factor)));
+    }
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+ZyanStatus ZyanVectorClear(ZyanVector* vector)
+{
+    return ZyanVectorResize(vector, 0);
+}
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Searching                                                                                      */
+/* ---------------------------------------------------------------------------------------------- */
+
+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);
+}
+
+ZyanStatus ZyanVectorFindEx(const ZyanVector* vector, const void* element, ZyanISize* found_index,
+    ZyanEqualityComparison comparison, ZyanUSize index, ZyanUSize count)
+{
+    if (!vector)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+    if ((index + count > vector->size) || (index == vector->size))
+    {
+        return ZYAN_STATUS_OUT_OF_RANGE;
+    }
+
+    if (!count)
+    {
+        *found_index = -1;
+        return ZYAN_STATUS_FALSE;
+    }
+
+    ZYAN_ASSERT(vector->element_size);
+    ZYAN_ASSERT(vector->data);
+
+    for (ZyanUSize i = index; i < index + count; ++i)
+    {
+        if (comparison(ZYCORE_VECTOR_OFFSET(vector, i), element))
+        {
+            *found_index = i;
+            return ZYAN_STATUS_TRUE;
+        }
+    }
+
+    *found_index = -1;
+    return ZYAN_STATUS_FALSE;
+}
+
+ZyanStatus ZyanVectorBinarySearch(const ZyanVector* vector, const void* element,
+    ZyanUSize* found_index, ZyanComparison comparison)
+{
+    if (!vector)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    return ZyanVectorBinarySearchEx(vector, element, found_index, comparison, 0, vector->size);
+}
+
+ZyanStatus ZyanVectorBinarySearchEx(const ZyanVector* vector, const void* element,
+    ZyanUSize* found_index, ZyanComparison comparison, ZyanUSize index, ZyanUSize count)
+{
+    if (!vector)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+    if (((index >= vector->size) && (count > 0)) || (index + count > vector->size))
+    {
+        return ZYAN_STATUS_OUT_OF_RANGE;
+    }
+
+    if (!count)
+    {
+        *found_index = index;
+        return ZYAN_STATUS_FALSE;
+    }
+
+    ZYAN_ASSERT(vector->element_size);
+    ZYAN_ASSERT(vector->data);
+
+    ZyanStatus status = ZYAN_STATUS_FALSE;
+    ZyanISize l = index;
+    ZyanISize h = index + count - 1;
+    while (l <= h)
+    {
+        const ZyanUSize mid = l + ((h - l) >> 1);
+        const ZyanI32 cmp = comparison(ZYCORE_VECTOR_OFFSET(vector, mid), element);
+        if (cmp < 0)
+        {
+            l = mid + 1;
+        } else
+        {
+            h = mid - 1;
+            if (cmp == 0)
+            {
+                status = ZYAN_STATUS_TRUE;
+            }
+        }
+    }
+
+    *found_index = l;
+    return status;
+}
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Memory management                                                                              */
+/* ---------------------------------------------------------------------------------------------- */
+
+ZyanStatus ZyanVectorResize(ZyanVector* vector, ZyanUSize size)
+{
+    if (!vector)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    if (ZYCORE_VECTOR_SHOULD_GROW(size, vector->capacity) ||
+        ZYCORE_VECTOR_SHOULD_SHRINK(size, vector->capacity, vector->shrink_threshold))
+    {
+        ZYAN_CHECK(ZyanVectorReallocate(vector, (ZyanUSize)(size * vector->growth_factor)));
+    };
+
+    vector->size = size;
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+ZyanStatus ZyanVectorReserve(ZyanVector* vector, ZyanUSize capacity)
+{
+    if (!vector)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    if (capacity > vector->capacity)
+    {
+        ZYAN_CHECK(ZyanVectorReallocate(vector, capacity));
+    }
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+ZyanStatus ZyanVectorShrinkToFit(ZyanVector* vector)
+{
+    if (!vector)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    return ZyanVectorReallocate(vector, vector->size);
+}
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Information                                                                                    */
+/* ---------------------------------------------------------------------------------------------- */
+
+ZyanStatus ZyanVectorGetCapacity(const ZyanVector* vector, ZyanUSize* capacity)
+{
+    if (!vector)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    *capacity = vector->capacity;
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+ZyanStatus ZyanVectorGetSize(const ZyanVector* vector, ZyanUSize* size)
+{
+    if (!vector)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    *size = vector->size;
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+/* ---------------------------------------------------------------------------------------------- */
+
+/* ============================================================================================== */
new file mode 100644
--- /dev/null
+++ b/js/src/zydis/Zycore/Vector.h
@@ -0,0 +1,655 @@
+/***************************************************************************************************
+
+  Zyan Core Library (Zycore-C)
+
+  Original Author : Florian Bernd
+
+ * 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.
+
+***************************************************************************************************/
+
+/**
+ * @file
+ * @brief   Implements the vector container class.
+ */
+
+#ifndef ZYCORE_VECTOR_H
+#define ZYCORE_VECTOR_H
+
+#include "zydis/ZycoreExportConfig.h"
+#include "zydis/Zycore/Allocator.h"
+#include "zydis/Zycore/Comparison.h"
+#include "zydis/Zycore/Object.h"
+#include "zydis/Zycore/Status.h"
+#include "zydis/Zycore/Types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* ============================================================================================== */
+/* Constants                                                                                      */
+/* ============================================================================================== */
+
+/**
+ * @brief   The initial minimum capacity (number of elements) for all dynamically allocated vector
+ *          instances.
+ */
+#define ZYAN_VECTOR_MIN_CAPACITY                1
+
+/**
+ * @brief   The default growth factor for all vector instances.
+ */
+#define ZYAN_VECTOR_DEFAULT_GROWTH_FACTOR       2.00f
+
+/**
+ * @brief   The default shrink threshold for all vector instances.
+ */
+#define ZYAN_VECTOR_DEFAULT_SHRINK_THRESHOLD    0.25f
+
+/* ============================================================================================== */
+/* Enums and types                                                                                */
+/* ============================================================================================== */
+
+/**
+ * @brief   Defines the `ZyanVector` struct.
+ *
+ * All fields in this struct should be considered as "private". Any changes may lead to unexpected
+ * behavior.
+ */
+typedef struct ZyanVector_
+{
+    /**
+     * @brief   The memory allocator.
+     */
+    ZyanAllocator* allocator;
+    /**
+     * @brief   The growth factor.
+     */
+    float growth_factor;
+    /**
+     * @brief   The shrink threshold.
+     */
+    float shrink_threshold;
+    /**
+     * @brief   The current number of elements in the vector.
+     */
+    ZyanUSize size;
+    /**
+     * @brief   The maximum capacity (number of elements).
+     */
+    ZyanUSize capacity;
+    /**
+     * @brief   The size of a single element in bytes.
+     */
+    ZyanUSize element_size;
+    /**
+     * @brief   The data pointer.
+     */
+    void* data;
+} ZyanVector;
+
+/* ============================================================================================== */
+/* Macros                                                                                         */
+/* ============================================================================================== */
+
+/* ---------------------------------------------------------------------------------------------- */
+/* General                                                                                        */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Defines an uninitialized `ZyanVector` instance.
+ */
+#define ZYAN_VECTOR_UNINITIALIZED \
+    { \
+        /* allocator        */ ZYAN_NULL, \
+        /* growth_factor    */ 0.0f, \
+        /* shrink_threshold */ 0.0f, \
+        /* size             */ 0, \
+        /* capacity         */ 0, \
+        /* element_size     */ 0, \
+        /* data             */ ZYAN_NULL \
+    }
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Helper macros                                                                                  */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Returns the value of the element at the given `index`.
+ *
+ * @param   vector  A pointer to the `ZyanVector` instance.
+ * @param   index   The element index.
+ *
+ * @result  The value of the desired element in the vector.
+ *
+ * Note that this function is unsafe and might dereference a null-pointer.
+ */
+#ifdef __cplusplus
+#define ZYAN_VECTOR_GET(vector, index, type) \
+    (*reinterpret_cast<const type*>(ZyanVectorGet(vector, index)))
+#else
+#define ZYAN_VECTOR_GET(vector, index, type) \
+    (*(const type*)ZyanVectorGet(vector, index))
+#endif
+
+/* ---------------------------------------------------------------------------------------------- */
+
+/* ============================================================================================== */
+/* Exported functions                                                                             */
+/* ============================================================================================== */
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Constructor and destructor                                                                     */
+/* ---------------------------------------------------------------------------------------------- */
+
+#ifndef ZYAN_NO_LIBC
+
+/**
+ * @brief   Initializes the given `ZyanVector` instance.
+ *
+ * @param   vector          A pointer to the `ZyanVector` instance.
+ * @param   element_size    The size of a single element in bytes.
+ * @param   capacity        The initial capacity (number of elements).
+ *
+ * @return  A zyan status code.
+ *
+ * The memory for the vector elements is dynamically allocated by the default allocator using the
+ * default growth factor of `2.0f` and the default shrink threshold of `0.25f`.
+ *
+ * Finalization with `ZyanVectorDestroy` is required for all instances created by this function.
+ */
+ZYCORE_EXPORT ZYAN_REQUIRES_LIBC ZyanStatus ZyanVectorInit(ZyanVector* vector,
+    ZyanUSize element_size, ZyanUSize capacity);
+
+#endif // ZYAN_NO_LIBC
+
+/**
+ * @brief   Initializes the given `ZyanVector` instance and sets a custom `allocator` and memory
+ *          allocation/deallocation parameters.
+ *
+ * @param   vector              A pointer to the `ZyanVector` instance.
+ * @param   element_size        The size of a single element in bytes.
+ * @param   capacity            The initial capacity (number of elements).
+ * @param   allocator           A pointer to a `ZyanAllocator` instance.
+ * @param   growth_factor       The growth factor (from `1.0f` to `x.xf`).
+ * @param   shrink_threshold    The shrink threshold (from `0.0f` to `1.0f`).
+ *
+ * @return  A zyan status code.
+ *
+ * A growth factor of `1.0f` disables overallocation and a shrink threshold of `0.0f` disables
+ * dynamic shrinking.
+ *
+ * Finalization with `ZyanVectorDestroy` is required for all instances created by this function.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanVectorInitEx(ZyanVector* vector, ZyanUSize element_size,
+    ZyanUSize capacity, ZyanAllocator* allocator, float growth_factor, float shrink_threshold);
+
+/**
+ * @brief   Initializes the given `ZyanVector` instance and configures it to use a custom user
+ *          defined buffer with a fixed size.
+ *
+ * @param   vector          A pointer to the `ZyanVector` instance.
+ * @param   element_size    The size of a single element in bytes.
+ * @param   buffer          A pointer to the buffer that is used as storage for the elements.
+ * @param   capacity        The maximum capacity (number of elements) of the buffer.
+ *
+ * @return  A zyan status code.
+ *
+ * Finalization is not required for instances created by this function.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanVectorInitCustomBuffer(ZyanVector* vector, ZyanUSize element_size,
+    void* buffer, ZyanUSize capacity);
+
+/**
+ * @brief   Destroys the given `ZyanVector` instance.
+ *
+ * @param   vector      A pointer to the `ZyanVector` instance.
+ * @param   destructor  A destructor callback that is invoked for every element in the vector, or
+ *                      `ZYAN_NULL`.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanVectorDestroy(ZyanVector* vector, ZyanMemberProcedure destructor);
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Duplication                                                                                    */
+/* ---------------------------------------------------------------------------------------------- */
+
+#ifndef ZYAN_NO_LIBC
+
+/**
+ * @brief   Initializes a new `ZyanVector` instance by duplicating an existing vector.
+ *
+ * @param   destination A pointer to the (uninitialized) destination `ZyanVector` instance.
+ * @param   source      A pointer to the source vector.
+ * @param   capacity    The initial capacity (number of elements).
+ *
+ *                      This value is automatically adjusted to the size of the source vector, if
+ *                      a smaller value was passed.
+ *
+ * @return  A zyan status code.
+ *
+ * The memory for the vector is dynamically allocated by the default allocator using the default
+ * growth factor of `2.0f` and the default shrink threshold of `0.25f`.
+ *
+ * Finalization with `ZyanVectorDestroy` is required for all instances created by this function.
+ */
+ZYCORE_EXPORT ZYAN_REQUIRES_LIBC ZyanStatus ZyanVectorDuplicate(ZyanVector* destination,
+    const ZyanVector* source, ZyanUSize capacity);
+
+#endif // ZYAN_NO_LIBC
+
+/**
+ * @brief   Initializes a new `ZyanVector` instance by duplicating an existing vector and sets a
+ *          custom `allocator` and memory allocation/deallocation parameters.
+ *
+ * @param   destination         A pointer to the (uninitialized) destination `ZyanVector` instance.
+ * @param   source              A pointer to the source vector.
+ * @param   capacity            The initial capacity (number of elements).
+
+ *                              This value is automatically adjusted to the size of the source
+ *                              vector, if a smaller value was passed.
+ * @param   allocator           A pointer to a `ZyanAllocator` instance.
+ * @param   growth_factor       The growth factor (from `1.0f` to `x.xf`).
+ * @param   shrink_threshold    The shrink threshold (from `0.0f` to `1.0f`).
+ *
+ * @return  A zyan status code.
+ *
+ * A growth factor of `1.0f` disables overallocation and a shrink threshold of `0.0f` disables
+ * dynamic shrinking.
+ *
+ * Finalization with `ZyanVectorDestroy` is required for all instances created by this function.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanVectorDuplicateEx(ZyanVector* destination, const ZyanVector* source,
+    ZyanUSize capacity, ZyanAllocator* allocator, float growth_factor, float shrink_threshold);
+
+/**
+ * @brief   Initializes a new `ZyanVector` instance by duplicating an existing vector and
+ *          configures it to use a custom user defined buffer with a fixed size.
+ *
+ * @param   destination A pointer to the (uninitialized) destination `ZyanVector` instance.
+ * @param   source      A pointer to the source vector.
+ * @param   buffer      A pointer to the buffer that is used as storage for the elements.
+ * @param   capacity    The maximum capacity (number of elements) of the buffer.
+
+ *                      This function will fail, if the capacity of the buffer is less than the
+ *                      size of the source vector.
+ *
+ * @return  A zyan status code.
+ *
+ * Finalization is not required for instances created by this function.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanVectorDuplicateCustomBuffer(ZyanVector* destination,
+    const ZyanVector* source, void* buffer, ZyanUSize capacity);
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Element access                                                                                 */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Returns a constant pointer to the element at the given `index`.
+ *
+ * @param   vector      A pointer to the `ZyanVector` instance.
+ * @param   index       The element index.
+ *
+ * @return  A constant pointer to the desired element in the vector or `ZYAN_NULL`, if an error
+ *          occured.
+ *
+ * Note that the returned pointer might get invalid when the vector is resized by either a manual
+ * call to the memory-management functions or implicitly by inserting or removing elements.
+ *
+ * Take a look at `ZyanVectorGetPointer` instead, if you need a function that returns a zyan status
+ * code.
+ */
+ZYCORE_EXPORT const void* ZyanVectorGet(const ZyanVector* vector, ZyanUSize index);
+
+/**
+ * @brief   Returns a mutable pointer to the element at the given `index`.
+ *
+ * @param   vector      A pointer to the `ZyanVector` instance.
+ * @param   index       The element index.
+ *
+ * @return  A mutable pointer to the desired element in the vector or `ZYAN_NULL`, if an error
+ *          occured.
+ *
+ * Note that the returned pointer might get invalid when the vector is resized by either a manual
+ * call to the memory-management functions or implicitly by inserting or removing elements.
+ *
+ * Take a look at `ZyanVectorGetPointerMutable` instead, if you need a function that returns a
+ * zyan status code.
+ */
+ZYCORE_EXPORT void* ZyanVectorGetMutable(const ZyanVector* vector, ZyanUSize index);
+
+/**
+ * @brief   Returns a constant pointer to the element at the given `index`.
+ *
+ * @param   vector  A pointer to the `ZyanVector` instance.
+ * @param   index   The element index.
+ * @param   value   Receives a constant pointer to the desired element in the vector.
+ *
+ * Note that the returned pointer might get invalid when the vector is resized by either a manual
+ * call to the memory-management functions or implicitly by inserting or removing elements.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanVectorGetPointer(const ZyanVector* vector, ZyanUSize index,
+    const void** value);
+
+/**
+ * @brief   Returns a mutable pointer to the element at the given `index`.
+ *
+ * @param   vector  A pointer to the `ZyanVector` instance.
+ * @param   index   The element index.
+ * @param   value Receives a mutable pointer to the desired element in the vector.
+ *
+ * Note that the returned pointer might get invalid when the vector is resized by either a manual
+ * call to the memory-management functions or implicitly by inserting or removing elements.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanVectorGetPointerMutable(const ZyanVector* vector, ZyanUSize index,
+    void** value);
+
+/**
+ * @brief   Assigns a new value to the element at the given `index`.
+ *
+ * @param   vector  A pointer to the `ZyanVector` instance.
+ * @param   index   The value index.
+ * @param   value   The value to assign.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanVectorSet(ZyanVector* vector, ZyanUSize index,
+    const void* value);
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Insertion                                                                                      */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Adds a new `element` at the end of the vector.
+ *
+ * @param   vector  A pointer to the `ZyanVector` instance.
+ * @param   element A pointer to the element to add.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanVectorPush(ZyanVector* vector, const void* element);
+
+/**
+ * @brief   Inserts an `element` at the given `index` of the vector.
+ *
+ * @param   vector  A pointer to the `ZyanVector` instance.
+ * @param   index   The insert index.
+ * @param   element A pointer to the element to insert.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanVectorInsert(ZyanVector* vector, ZyanUSize index,
+    const void* element);
+
+/**
+ * @brief   Inserts multiple `elements` at the given `index` of the vector.
+ *
+ * @param   vector      A pointer to the `ZyanVector` instance.
+ * @param   index       The insert index.
+ * @param   elements    A pointer to the first element.
+ * @param   count       The number of elements to insert.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanVectorInsertEx(ZyanVector* vector, ZyanUSize index,
+    const void* elements, ZyanUSize count);
+
+ /**
+ * @brief   Constructs an `element` in-place and adds it at the end of the vector.
+ *
+ * @param   vector      A pointer to the `ZyanVector` instance.
+ * @param   element     Receives a pointer to the new element.
+ * @param   constructor The constructor callback or `ZYAN_NULL`. The new element will be in
+ *                      undefined state, if no constructor was passed.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanVectorEmplace(ZyanVector* vector, void** element,
+    ZyanMemberFunction constructor);
+
+/**
+ * @brief   Constructs an `element` in-place and inserts it at the given `index` of the vector.
+ *
+ * @param   vector      A pointer to the `ZyanVector` instance.
+ * @param   index       The insert index.
+ * @param   element     Receives a pointer to the new element.
+ * @param   constructor The constructor callback or `ZYAN_NULL`. The new element will be in
+ *                      undefined state, if no constructor was passed.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanVectorEmplaceEx(ZyanVector* vector, ZyanUSize index,
+    void** element, ZyanMemberFunction constructor);
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Utils                                                                                          */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Swaps the element at `index_first` with the element at `index_second`.
+ *
+ * @param   vector          A pointer to the `ZyanVector` instance.
+ * @param   index_first     The index of the first element.
+ * @param   index_second    The index of the second element.
+ *
+ * @return  A zyan status code.
+ *
+ * This function requires the vector to have spare capacity for one temporary element. Call
+ * `ZyanVectorReserve` before this function to increase capacity, if needed.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanVectorSwapElements(ZyanVector* vector, ZyanUSize index_first,
+    ZyanUSize index_second);
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Deletion                                                                                       */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Deletes the element at the given `index` of the vector.
+ *
+ * @param   vector  A pointer to the `ZyanVector` instance.
+ * @param   index   The element index.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanVectorDelete(ZyanVector* vector, ZyanUSize index);
+
+/**
+ * @brief   Deletes multiple elements from the given vector, starting at `index`.
+ *
+ * @param   vector  A pointer to the `ZyanVector` instance.
+ * @param   index   The index of the first element to delete.
+ * @param   count   The number of elements to delete.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanVectorDeleteEx(ZyanVector* vector, ZyanUSize index, ZyanUSize count);
+
+/**
+ * @brief   Removes the last element of the vector.
+ *
+ * @param   vector  A pointer to the `ZyanVector` instance.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanVectorPop(ZyanVector* vector);
+
+/**
+ * @brief   Erases all elements of the given vector.
+ *
+ * @param   vector  A pointer to the `ZyanVector` instance.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanVectorClear(ZyanVector* vector);
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Searching                                                                                      */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Sequentially searches for the first occurrence of `element` in the given vector.
+ *
+ * @param   vector      A pointer to the `ZyanVector` instance.
+ * @param   element     A pointer to the element to search for.
+ * @param   found_index A pointer to a variable that receives the index of the found element.
+ * @param   comparison  The comparison function to use.
+ *
+ * @return  `ZYAN_STATUS_TRUE` if the element was found, `ZYAN_STATUS_FALSE` if not or a generic
+ *          zyan status code if an error occured.
+ *
+ * The `found_index` is set to `-1`, if the element was not found.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanVectorFind(const ZyanVector* vector, const void* element,
+    ZyanISize* found_index, ZyanEqualityComparison comparison);
+
+/**
+ * @brief   Sequentially searches for the first occurrence of `element` in the given vector.
+ *
+ * @param   vector      A pointer to the `ZyanVector` instance.
+ * @param   element     A pointer to the element to search for.
+ * @param   found_index A pointer to a variable that receives the index of the found element.
+ * @param   comparison  The comparison function to use.
+ * @param   index       The start index.
+ * @param   count       The maximum number of elements to iterate, beginning from the start `index`.
+ *
+ * @return  `ZYAN_STATUS_TRUE` if the element was found, `ZYAN_STATUS_FALSE` if not or a generic
+ *          zyan status code if an error occured.
+ *
+ * The `found_index` is set to `-1`, if the element was not found.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanVectorFindEx(const ZyanVector* vector, const void* element,
+    ZyanISize* found_index, ZyanEqualityComparison comparison, ZyanUSize index, ZyanUSize count);
+
+/**
+ * @brief   Searches for the first occurrence of `element` in the given vector using a binary-
+ *          search algorithm.
+ *
+ * @param   vector      A pointer to the `ZyanVector` instance.
+ * @param   element     A pointer to the element to search for.
+ * @param   found_index A pointer to a variable that receives the index of the found element.
+ * @param   comparison  The comparison function to use.
+ *
+ * @return  `ZYAN_STATUS_TRUE` if the element was found, `ZYAN_STATUS_FALSE` if not or a generic
+ *          zyan status code if an error occured.
+ *
+ * If found, `found_index` contains the zero-based index of `element`. If not found, `found_index`
+ * contains the index of the first entry larger than `element`.
+ *
+ * This function requires all elements in the vector to be strictly ordered (sorted).
+ */
+ZYCORE_EXPORT ZyanStatus ZyanVectorBinarySearch(const ZyanVector* vector, const void* element,
+    ZyanUSize* found_index, ZyanComparison comparison);
+
+/**
+ * @brief   Searches for the first occurrence of `element` in the given vector using a binary-
+ *          search algorithm.
+ *
+ * @param   vector      A pointer to the `ZyanVector` instance.
+ * @param   element     A pointer to the element to search for.
+ * @param   found_index A pointer to a variable that receives the index of the found element.
+ * @param   comparison  The comparison function to use.
+ * @param   index       The start index.
+ * @param   count       The maximum number of elements to iterate, beginning from the start `index`.
+ *
+ * @return  `ZYAN_STATUS_TRUE` if the element was found, `ZYAN_STATUS_FALSE` if not or a generic
+ *          zyan status code if an error occured.
+ *
+ * If found, `found_index` contains the zero-based index of `element`. If not found, `found_index`
+ * contains the index of the first entry larger than `element`.
+ *
+ * This function requires all elements in the vector to be strictly ordered (sorted).
+ */
+ZYCORE_EXPORT ZyanStatus ZyanVectorBinarySearchEx(const ZyanVector* vector, const void* element,
+    ZyanUSize* found_index, ZyanComparison comparison, ZyanUSize index, ZyanUSize count);
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Memory management                                                                              */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Resizes the given `ZyanVector` instance.
+ *
+ * @param   vector  A pointer to the `ZyanVector` instance.
+ * @param   size    The new size of the vector.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanVectorResize(ZyanVector* vector, ZyanUSize size);
+
+/**
+ * @brief   Changes the capacity of the given `ZyanVector` instance.
+ *
+ * @param   vector      A pointer to the `ZyanVector` instance.
+ * @param   capacity    The new minimum capacity of the vector.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanVectorReserve(ZyanVector* vector, ZyanUSize capacity);
+
+/**
+ * @brief   Shrinks the capacity of the given vector to match it's size.
+ *
+ * @param   vector  A pointer to the `ZyanVector` instance.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanVectorShrinkToFit(ZyanVector* vector);
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Information                                                                                    */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Returns the current capacity of the vector.
+ *
+ * @param   vector      A pointer to the `ZyanVector` instance.
+ * @param   capacity    Receives the size of the vector.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanVectorGetCapacity(const ZyanVector* vector, ZyanUSize* capacity);
+
+/**
+ * @brief   Returns the current size of the vector.
+ *
+ * @param   vector  A pointer to the `ZyanVector` instance.
+ * @param   size    Receives the size of the vector.
+ *
+ * @return  A zyan status code.
+ */
+ZYCORE_EXPORT ZyanStatus ZyanVectorGetSize(const ZyanVector* vector, ZyanUSize* size);
+
+/* ---------------------------------------------------------------------------------------------- */
+
+/* ============================================================================================== */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* ZYCORE_VECTOR_H */
new file mode 100644
--- /dev/null
+++ b/js/src/zydis/Zycore/Zycore.c
@@ -0,0 +1,38 @@
+/***************************************************************************************************
+
+  Zyan Core Library (Zycore-C)
+
+  Original Author : Florian Bernd
+
+ * 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.
+
+***************************************************************************************************/
+
+#include "zydis/Zycore/Zycore.h"
+
+/* ============================================================================================== */
+/* Exported functions                                                                             */
+/* ============================================================================================== */
+
+ZyanU64 ZycoreGetVersion(void)
+{
+    return ZYCORE_VERSION;
+}
+
+/* ============================================================================================== */
new file mode 100644
--- /dev/null
+++ b/js/src/zydis/Zycore/Zycore.h
@@ -0,0 +1,111 @@
+/***************************************************************************************************
+
+  Zyan Core Library (Zycore-C)
+
+  Original Author : Florian Bernd
+
+ * 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.
+
+***************************************************************************************************/
+
+/**
+ * @file
+ * @brief   Master include file, including everything else.
+ */
+
+#ifndef ZYCORE_H
+#define ZYCORE_H
+
+#include "zydis/ZycoreExportConfig.h"
+#include "zydis/Zycore/Types.h"
+
+// TODO:
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* ============================================================================================== */
+/* Macros                                                                                         */
+/* ============================================================================================== */
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Constants                                                                                      */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   A macro that defines the zycore version.
+ */
+#define ZYCORE_VERSION (ZyanU64)0x0001000000000000
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Helper macros                                                                                  */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Extracts the major-part of the zycore version.
+ *
+ * @param   version The zycore version value
+ */
+#define ZYCORE_VERSION_MAJOR(version) (ZyanU16)((version & 0xFFFF000000000000) >> 48)
+
+/**
+ * @brief   Extracts the minor-part of the zycore version.
+ *
+ * @param   version The zycore version value
+ */
+#define ZYCORE_VERSION_MINOR(version) (ZyanU16)((version & 0x0000FFFF00000000) >> 32)
+
+/**
+ * @brief   Extracts the patch-part of the zycore version.
+ *
+ * @param   version The zycore version value
+ */
+#define ZYCORE_VERSION_PATCH(version) (ZyanU16)((version & 0x00000000FFFF0000) >> 16)
+
+/**
+ * @brief   Extracts the build-part of the zycore version.
+ *
+ * @param   version The zycore version value
+ */
+#define ZYCORE_VERSION_BUILD(version) (ZyanU16)(version & 0x000000000000FFFF)
+
+/* ---------------------------------------------------------------------------------------------- */
+
+/* ============================================================================================== */
+/* Exported functions                                                                             */
+/* ============================================================================================== */
+
+/**
+ * @brief   Returns the zycore version.
+ *
+ * @return  The zycore version.
+ *
+ * Use the macros provided in this file to extract the major, minor, patch and build part from the
+ * returned version value.
+ */
+ZYCORE_EXPORT ZyanU64 ZycoreGetVersion(void);
+
+/* ============================================================================================== */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* ZYCORE_H */
new file mode 100644
--- /dev/null
+++ b/js/src/zydis/Zycore/ZycoreString.c
@@ -0,0 +1,1085 @@
+/***************************************************************************************************
+
+  Zyan Core Library (Zycore-C)
+
+  Original Author : Florian Bernd
+
+ * 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.
+
+***************************************************************************************************/
+
+#include "zydis/Zycore/String.h"
+#include "zydis/Zycore/LibC.h"
+
+/* ============================================================================================== */
+/* Internal macros                                                                                */
+/* ============================================================================================== */
+
+/**
+ * @brief   Writes a terminating '\0' character at the end of the string data.
+ */
+#define ZYCORE_STRING_NULLTERMINATE(string) \
+      *(char*)((ZyanU8*)(string)->vector.data + (string)->vector.size - 1) = '\0';
+
+/**
+ * @brief   Checks for a terminating '\0' character at the end of the string data.
+ */
+#define ZYCORE_STRING_ASSERT_NULLTERMINATION(string) \
+      ZYAN_ASSERT(*(char*)((ZyanU8*)(string)->vector.data + (string)->vector.size - 1) == '\0');
+
+/* ============================================================================================== */
+/* Exported functions                                                                             */
+/* ============================================================================================== */
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Constructor and destructor                                                                     */
+/* ---------------------------------------------------------------------------------------------- */
+
+#ifndef ZYAN_NO_LIBC
+
+ZyanStatus ZyanStringInit(ZyanString* string, ZyanUSize capacity)
+{
+    return ZyanStringInitEx(string, capacity, ZyanAllocatorDefault(),
+        ZYAN_STRING_DEFAULT_GROWTH_FACTOR, ZYAN_STRING_DEFAULT_SHRINK_THRESHOLD);
+}
+
+#endif // ZYAN_NO_LIBC
+
+ZyanStatus ZyanStringInitEx(ZyanString* string, ZyanUSize capacity, ZyanAllocator* allocator,
+    float growth_factor, float shrink_threshold)
+{
+    if (!string)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    string->flags = 0;
+    capacity = ZYAN_MAX(ZYAN_STRING_MIN_CAPACITY, capacity) + 1;
+    ZYAN_CHECK(ZyanVectorInitEx(&string->vector, sizeof(char), capacity, allocator,
+        growth_factor, shrink_threshold));
+    ZYAN_ASSERT(string->vector.capacity >= capacity);
+    // Some of the string code relies on `sizeof(char) == 1`
+    ZYAN_ASSERT(string->vector.element_size == 1);
+
+    *(char*)string->vector.data = '\0';
+    ++string->vector.size;
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+ZyanStatus ZyanStringInitCustomBuffer(ZyanString* string, char* buffer, ZyanUSize capacity)
+{
+    if (!string || !capacity)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    string->flags = ZYAN_STRING_HAS_FIXED_CAPACITY;
+    ZYAN_CHECK(ZyanVectorInitCustomBuffer(&string->vector, sizeof(char), (void*)buffer, capacity));
+    ZYAN_ASSERT(string->vector.capacity == capacity);
+    // Some of the string code relies on `sizeof(char) == 1`
+    ZYAN_ASSERT(string->vector.element_size == 1);
+
+    *(char*)string->vector.data = '\0';
+    ++string->vector.size;
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+ZyanStatus ZyanStringDestroy(ZyanString* string)
+{
+    if (!string)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+    if (string->flags & ZYAN_STRING_HAS_FIXED_CAPACITY)
+    {
+        return ZYAN_STATUS_SUCCESS;
+    }
+
+    return ZyanVectorDestroy(&string->vector, ZYAN_NULL);
+}
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Duplication                                                                                    */
+/* ---------------------------------------------------------------------------------------------- */
+
+#ifndef ZYAN_NO_LIBC
+
+ZyanStatus ZyanStringDuplicate(ZyanString* destination, const ZyanStringView* source,
+    ZyanUSize capacity)
+{
+    return ZyanStringDuplicateEx(destination, source, capacity, ZyanAllocatorDefault(),
+        ZYAN_STRING_DEFAULT_GROWTH_FACTOR, ZYAN_STRING_DEFAULT_SHRINK_THRESHOLD);
+}
+
+#endif // ZYAN_NO_LIBC
+
+ZyanStatus ZyanStringDuplicateEx(ZyanString* destination, const ZyanStringView* source,
+    ZyanUSize capacity, ZyanAllocator* allocator, float growth_factor, float shrink_threshold)
+{
+    if (!source || !source->string.vector.size)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    const ZyanUSize len = source->string.vector.size;
+    capacity = ZYAN_MAX(capacity, len - 1);
+    ZYAN_CHECK(ZyanStringInitEx(destination, capacity, allocator, growth_factor, shrink_threshold));
+    ZYAN_ASSERT(destination->vector.capacity >= len);
+
+    ZYAN_MEMCPY(destination->vector.data, source->string.vector.data,
+        source->string.vector.size - 1);
+    destination->vector.size = len;
+    ZYCORE_STRING_NULLTERMINATE(destination);
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+ZyanStatus ZyanStringDuplicateCustomBuffer(ZyanString* destination, const ZyanStringView* source,
+    char* buffer, ZyanUSize capacity)
+{
+    if (!source || !source->string.vector.size)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    const ZyanUSize len = source->string.vector.size;
+    if (capacity < len)
+    {
+        return ZYAN_STATUS_INSUFFICIENT_BUFFER_SIZE;
+    }
+
+    ZYAN_CHECK(ZyanStringInitCustomBuffer(destination, buffer, capacity));
+    ZYAN_ASSERT(destination->vector.capacity >= len);
+
+    ZYAN_MEMCPY(destination->vector.data, source->string.vector.data,
+        source->string.vector.size - 1);
+    destination->vector.size = len;
+    ZYCORE_STRING_NULLTERMINATE(destination);
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Concatenation                                                                                  */
+/* ---------------------------------------------------------------------------------------------- */
+
+#ifndef ZYAN_NO_LIBC
+
+ZyanStatus ZyanStringConcat(ZyanString* destination, const ZyanStringView* s1,
+    const ZyanStringView* s2, ZyanUSize capacity)
+{
+    return ZyanStringConcatEx(destination, s1, s2, capacity, ZyanAllocatorDefault(),
+        ZYAN_STRING_DEFAULT_GROWTH_FACTOR, ZYAN_STRING_DEFAULT_SHRINK_THRESHOLD);
+}
+
+#endif // ZYAN_NO_LIBC
+
+ZyanStatus ZyanStringConcatEx(ZyanString* destination, const ZyanStringView* s1,
+    const ZyanStringView* s2, ZyanUSize capacity, ZyanAllocator* allocator, float growth_factor,
+    float shrink_threshold)
+{
+    if (!s1 || !s2 || !s1->string.vector.size || !s2->string.vector.size)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    const ZyanUSize len = s1->string.vector.size + s2->string.vector.size - 1;
+    capacity = ZYAN_MAX(capacity, len - 1);
+    ZYAN_CHECK(ZyanStringInitEx(destination, capacity, allocator, growth_factor, shrink_threshold));
+    ZYAN_ASSERT(destination->vector.capacity >= len);
+
+    ZYAN_MEMCPY(destination->vector.data, s1->string.vector.data, s1->string.vector.size - 1);
+    ZYAN_MEMCPY((char*)destination->vector.data + s1->string.vector.size - 1,
+        s2->string.vector.data, s2->string.vector.size - 1);
+    destination->vector.size = len;
+    ZYCORE_STRING_NULLTERMINATE(destination);
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+ZyanStatus ZyanStringConcatCustomBuffer(ZyanString* destination, const ZyanStringView* s1,
+    const ZyanStringView* s2, char* buffer, ZyanUSize capacity)
+{
+    if (!s1 || !s2 || !s1->string.vector.size || !s2->string.vector.size)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    const ZyanUSize len = s1->string.vector.size + s2->string.vector.size - 1;
+    if (capacity < len)
+    {
+        return ZYAN_STATUS_INSUFFICIENT_BUFFER_SIZE;
+    }
+
+    ZYAN_CHECK(ZyanStringInitCustomBuffer(destination, buffer, capacity));
+    ZYAN_ASSERT(destination->vector.capacity >= len);
+
+    ZYAN_MEMCPY(destination->vector.data, s1->string.vector.data, s1->string.vector.size - 1);
+    ZYAN_MEMCPY((char*)destination->vector.data + s1->string.vector.size - 1,
+        s2->string.vector.data, s2->string.vector.size - 1);
+    destination->vector.size = len;
+    ZYCORE_STRING_NULLTERMINATE(destination);
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Views                                                                                          */
+/* ---------------------------------------------------------------------------------------------- */
+
+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_SUCCESS;
+}
+
+ZyanStatus ZyanStringViewInsideViewEx(ZyanStringView* view, const ZyanStringView* source,
+    ZyanUSize index, ZyanUSize count)
+{
+    if (!view || !source)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    if (index + count >= source->string.vector.size)
+    {
+        return ZYAN_STATUS_OUT_OF_RANGE;
+    }
+
+    view->string.vector.data = (void*)((char*)source->string.vector.data + index);
+    view->string.vector.size = count;
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+ZyanStatus ZyanStringViewInsideBuffer(ZyanStringView* view, const char* string)
+{
+    if (!view || !string)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    view->string.vector.data = (void*)string;
+    view->string.vector.size = ZYAN_STRLEN(string) + 1;
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+ZyanStatus ZyanStringViewInsideBufferEx(ZyanStringView* view, const char* buffer, ZyanUSize length)
+{
+    if (!view || !buffer || !length)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    view->string.vector.data = (void*)buffer;
+    view->string.vector.size = length + 1;
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+ZyanStatus ZyanStringViewGetSize(const ZyanStringView* view, ZyanUSize* size)
+{
+    if (!view || !size)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    ZYAN_ASSERT(view->string.vector.size >= 1);
+    *size = view->string.vector.size - 1;
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Character access                                                                               */
+/* ---------------------------------------------------------------------------------------------- */
+
+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_STATUS_OUT_OF_RANGE;
+    }
+
+    const char* chr;
+    ZYAN_CHECK(ZyanVectorGetPointer(&string->string.vector, index, (const void**)&chr));
+    *value = *chr;
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+ZyanStatus ZyanStringGetCharMutable(ZyanString* string, ZyanUSize index, char** value)
+{
+    if (!string)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    // Don't allow direct access to the terminating '\0' character
+    if (index + 1 >= string->vector.size)
+    {
+        return ZYAN_STATUS_OUT_OF_RANGE;
+    }
+
+    return ZyanVectorGetPointerMutable(&string->vector, index, (void**)value);
+}
+
+ZyanStatus ZyanStringSetChar(ZyanString* string, ZyanUSize index, char value)
+{
+    if (!string)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    // Don't allow direct access to the terminating '\0' character
+    if (index + 1 >= string->vector.size)
+    {
+        return ZYAN_STATUS_OUT_OF_RANGE;
+    }
+
+    return ZyanVectorSet(&string->vector, index, (void*)&value);
+}
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Insertion                                                                                      */
+/* ---------------------------------------------------------------------------------------------- */
+
+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, source);
+    }
+
+    // Don't allow insertion after the terminating '\0' character
+    if (index >= destination->vector.size)
+    {
+        return ZYAN_STATUS_OUT_OF_RANGE;
+    }
+
+    ZYAN_CHECK(ZyanVectorInsertEx(&destination->vector, index, source->string.vector.data,
+        source->string.vector.size - 1));
+    ZYCORE_STRING_ASSERT_NULLTERMINATION(destination);
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+ZyanStatus ZyanStringInsertEx(ZyanString* destination, ZyanUSize destination_index,
+    const ZyanStringView* source, ZyanUSize source_index, ZyanUSize count)
+{
+    if (!destination || !source || !source->string.vector.size)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    if (destination_index == destination->vector.size)
+    {
+        return ZyanStringAppendEx(destination, source, source_index, count);
+    }
+
+    // Don't allow insertion after the terminating '\0' character
+    if (destination_index >= destination->vector.size)
+    {
+        return ZYAN_STATUS_OUT_OF_RANGE;
+    }
+
+    // Don't allow access to the terminating '\0' character
+    if (source_index + count >= source->string.vector.size)
+    {
+        return ZYAN_STATUS_OUT_OF_RANGE;
+    }
+
+    ZYAN_CHECK(ZyanVectorInsertEx(&destination->vector, destination_index,
+        (char*)source->string.vector.data + source_index, count));
+    ZYCORE_STRING_ASSERT_NULLTERMINATION(destination);
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Appending                                                                                      */
+/* ---------------------------------------------------------------------------------------------- */
+
+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 + source->string.vector.size - 1));
+    ZYAN_MEMCPY((char*)destination->vector.data + len - 1, source->string.vector.data,
+        source->string.vector.size - 1);
+    ZYCORE_STRING_NULLTERMINATE(destination);
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+ZyanStatus ZyanStringAppendEx(ZyanString* destination, const ZyanStringView* source,
+    ZyanUSize source_index, ZyanUSize count)
+{
+    if (!destination || !source || !source->string.vector.size)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    // Don't allow access to the terminating '\0' character
+    if (source_index + count >= source->string.vector.size)
+    {
+        return ZYAN_STATUS_OUT_OF_RANGE;
+    }
+
+    const ZyanUSize len = destination->vector.size;
+    ZYAN_CHECK(ZyanVectorResize(&destination->vector, len + count));
+    ZYAN_MEMCPY((char*)destination->vector.data + len - 1,
+        (const char*)source->string.vector.data + source_index, count);
+    ZYCORE_STRING_NULLTERMINATE(destination);
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Deletion                                                                                       */
+/* ---------------------------------------------------------------------------------------------- */
+
+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;
+    }
+
+    ZYAN_CHECK(ZyanVectorDeleteEx(&string->vector, index, count));
+    ZYCORE_STRING_NULLTERMINATE(string);
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+ZyanStatus ZyanStringTruncate(ZyanString* string, ZyanUSize index)
+{
+    if (!string)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    // Don't allow removal of the terminating '\0' character
+    if (index >= string->vector.size)
+    {
+        return ZYAN_STATUS_OUT_OF_RANGE;
+    }
+
+    ZYAN_CHECK(ZyanVectorDeleteEx(&string->vector, index, string->vector.size - index - 1));
+    ZYCORE_STRING_NULLTERMINATE(string);
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+ZyanStatus ZyanStringClear(ZyanString* string)
+{
+    if (!string)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    ZYAN_CHECK(ZyanVectorClear(&string->vector));
+    // `ZyanVector` guarantees a minimum capacity of 1 element/character
+    ZYAN_ASSERT(string->vector.capacity >= 1);
+
+    *(char*)string->vector.data = '\0';
+    string->vector.size++;
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Searching                                                                                      */
+/* ---------------------------------------------------------------------------------------------- */
+
+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);
+}
+
+ZyanStatus ZyanStringLPosEx(const ZyanStringView* haystack, const ZyanStringView* needle,
+    ZyanISize* found_index, ZyanUSize index, ZyanUSize count)
+{
+    if (!haystack || !needle || !found_index)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    // Don't allow access to the terminating '\0' character
+    if (index + count >= haystack->string.vector.size)
+    {
+        return ZYAN_STATUS_OUT_OF_RANGE;
+    }
+
+    if ((haystack->string.vector.size == 1) || (needle->string.vector.size == 1) ||
+        (haystack->string.vector.size < needle->string.vector.size))
+    {
+        *found_index = -1;
+        return ZYAN_STATUS_FALSE;
+    }
+
+    const char* s = (const char*)haystack->string.vector.data + index;
+    const char* b = (const char*)needle->string.vector.data;
+    for (; s + 1 < (const char*)haystack->string.vector.data + haystack->string.vector.size; ++s)
+    {
+        if (*s != *b)
+        {
+            continue;
+        }
+        const char* a = s;
+        for (;;)
+        {
+            if ((ZyanUSize)(a - (const char*)haystack->string.vector.data) > index + count)
+            {
+                *found_index = -1;
+                return ZYAN_STATUS_FALSE;
+            }
+            if (*b == 0)
+            {
+                *found_index = (ZyanISize)(s - (const char*)haystack->string.vector.data);
+                return ZYAN_STATUS_TRUE;
+            }
+            if (*a++ != *b++)
+            {
+                break;
+            }
+        }
+        b = (char*)needle->string.vector.data;
+    }
+
+    *found_index = -1;
+    return ZYAN_STATUS_FALSE;
+}
+
+ZyanStatus ZyanStringLPosI(const ZyanStringView* haystack, const ZyanStringView* needle,
+    ZyanISize* found_index)
+{
+    if (!haystack)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    return ZyanStringLPosIEx(haystack, needle, found_index, 0, haystack->string.vector.size - 1);
+}
+
+ZyanStatus ZyanStringLPosIEx(const ZyanStringView* haystack, const ZyanStringView* needle,
+    ZyanISize* found_index, ZyanUSize index, ZyanUSize count)
+{
+    // This solution assumes that characters are represented using ASCII representation, i.e.,
+    // codes for 'a', 'b', 'c', .. 'z' are 97, 98, 99, .. 122 respectively. And codes for 'A',
+    // 'B', 'C', .. 'Z' are 65, 66, .. 95 respectively.
+
+    if (!haystack || !needle || !found_index)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    // Don't allow access to the terminating '\0' character
+    if (index + count >= haystack->string.vector.size)
+    {
+        return ZYAN_STATUS_OUT_OF_RANGE;
+    }
+
+    if ((haystack->string.vector.size == 1) || (needle->string.vector.size == 1) ||
+        (haystack->string.vector.size < needle->string.vector.size))
+    {
+        *found_index = -1;
+        return ZYAN_STATUS_FALSE;
+    }
+
+    const char* s = (const char*)haystack->string.vector.data + index;
+    const char* b = (const char*)needle->string.vector.data;
+    for (; s + 1 < (const char*)haystack->string.vector.data + haystack->string.vector.size; ++s)
+    {
+        if ((*s != *b) && ((*s ^ 32) != *b))
+        {
+            continue;
+        }
+        const char* a = s;
+        for (;;)
+        {
+            if ((ZyanUSize)(a - (const char*)haystack->string.vector.data) > index + count)
+            {
+                *found_index = -1;
+                return ZYAN_STATUS_FALSE;
+            }
+            if (*b == 0)
+            {
+                *found_index = (ZyanISize)(s - (const char*)haystack->string.vector.data);
+                return ZYAN_STATUS_TRUE;
+            }
+            const char c1 = *a++;
+            const char c2 = *b++;
+            if ((c1 != c2) && ((c1 ^ 32) != c2))
+            {
+                break;
+            }
+        }
+        b = (char*)needle->string.vector.data;
+    }
+
+    *found_index = -1;
+    return ZYAN_STATUS_FALSE;
+}
+
+ZyanStatus ZyanStringRPos(const ZyanStringView* haystack, const ZyanStringView* needle,
+    ZyanISize* found_index)
+{
+    if (!haystack)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    return ZyanStringRPosEx(haystack, needle, found_index, haystack->string.vector.size - 1,
+        haystack->string.vector.size - 1);
+}
+
+ZyanStatus ZyanStringRPosEx(const ZyanStringView* haystack, const ZyanStringView* needle,
+    ZyanISize* found_index, ZyanUSize index, ZyanUSize count)
+{
+    if (!haystack || !needle || !found_index)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    // Don't allow access to the terminating '\0' character
+    if ((index >= haystack->string.vector.size) || (count > index))
+    {
+        return ZYAN_STATUS_OUT_OF_RANGE;
+    }
+
+    if (!index || !count ||
+        (haystack->string.vector.size == 1) || (needle->string.vector.size == 1) ||
+        (haystack->string.vector.size < needle->string.vector.size))
+    {
+        *found_index = -1;
+        return ZYAN_STATUS_FALSE;
+    }
+
+    const char* s = (const char*)haystack->string.vector.data + index - 1;
+    const char* b = (const char*)needle->string.vector.data + needle->string.vector.size - 2;
+    for (; s >= (const char*)haystack->string.vector.data; --s)
+    {
+        if (*s != *b)
+        {
+            continue;
+        }
+        const char* a = s;
+        for (;;)
+        {
+            if (b < (const char*)needle->string.vector.data)
+            {
+                *found_index = (ZyanISize)(a - (const char*)haystack->string.vector.data + 1);
+                return ZYAN_STATUS_TRUE;
+            }
+            if (a < (const char*)haystack->string.vector.data + index - count)
+            {
+                *found_index = -1;
+                return ZYAN_STATUS_FALSE;
+            }
+            if (*a-- != *b--)
+            {
+                break;
+            }
+        }
+        b = (char*)needle->string.vector.data + needle->string.vector.size - 2;
+    }
+
+    *found_index = -1;
+    return ZYAN_STATUS_FALSE;
+}
+
+ZyanStatus ZyanStringRPosI(const ZyanStringView* haystack, const ZyanStringView* needle,
+    ZyanISize* found_index)
+{
+    if (!haystack)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    return ZyanStringRPosIEx(haystack, needle, found_index, haystack->string.vector.size - 1,
+        haystack->string.vector.size - 1);
+}
+
+ZyanStatus ZyanStringRPosIEx(const ZyanStringView* haystack, const ZyanStringView* needle,
+    ZyanISize* found_index, ZyanUSize index, ZyanUSize count)
+{
+    // This solution assumes that characters are represented using ASCII representation, i.e.,
+    // codes for 'a', 'b', 'c', .. 'z' are 97, 98, 99, .. 122 respectively. And codes for 'A',
+    // 'B', 'C', .. 'Z' are 65, 66, .. 95 respectively.
+
+    if (!haystack || !needle || !found_index)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    // Don't allow access to the terminating '\0' character
+    if ((index >= haystack->string.vector.size) || (count > index))
+    {
+        return ZYAN_STATUS_OUT_OF_RANGE;
+    }
+
+    if (!index || !count ||
+        (haystack->string.vector.size == 1) || (needle->string.vector.size == 1) ||
+        (haystack->string.vector.size < needle->string.vector.size))
+    {
+        *found_index = -1;
+        return ZYAN_STATUS_FALSE;
+    }
+
+    const char* s = (const char*)haystack->string.vector.data + index - 1;
+    const char* b = (const char*)needle->string.vector.data + needle->string.vector.size - 2;
+    for (; s >= (const char*)haystack->string.vector.data; --s)
+    {
+        if ((*s != *b) && ((*s ^ 32) != *b))
+        {
+            continue;
+        }
+        const char* a = s;
+        for (;;)
+        {
+            if (b < (const char*)needle->string.vector.data)
+            {
+                *found_index = (ZyanISize)(a - (const char*)haystack->string.vector.data + 1);
+                return ZYAN_STATUS_TRUE;
+            }
+            if (a < (const char*)haystack->string.vector.data + index - count)
+            {
+                *found_index = -1;
+                return ZYAN_STATUS_FALSE;
+            }
+            const char c1 = *a--;
+            const char c2 = *b--;
+            if ((c1 != c2) && ((c1 ^ 32) != c2))
+            {
+                break;
+            }
+        }
+        b = (char*)needle->string.vector.data + needle->string.vector.size - 2;
+    }
+
+    *found_index = -1;
+    return ZYAN_STATUS_FALSE;
+}
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Comparing                                                                                      */
+/* ---------------------------------------------------------------------------------------------- */
+
+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->string.vector.size > s2->string.vector.size)
+    {
+        *result =  1;
+        return ZYAN_STATUS_FALSE;
+    }
+
+    const char* const a = (char*)s1->string.vector.data;
+    const char* const b = (char*)s2->string.vector.data;
+    ZyanUSize i;
+    for (i = 0; (i + 1 < s1->string.vector.size) && (i + 1 < s2->string.vector.size); ++i)
+    {
+        if (a[i] == b[i])
+        {
+            continue;
+        }
+        break;
+    }
+
+    if (a[i] == b[i])
+    {
+        *result = 0;
+        return ZYAN_STATUS_TRUE;
+    }
+
+    if ((a[i] | 32) < (b[i] | 32))
+    {
+        *result = -1;
+        return ZYAN_STATUS_FALSE;
+    }
+
+    *result = 1;
+    return ZYAN_STATUS_FALSE;
+}
+
+ZyanStatus ZyanStringCompareI(const ZyanStringView* s1, const ZyanStringView* s2, ZyanI32* result)
+{
+    // This solution assumes that characters are represented using ASCII representation, i.e.,
+    // codes for 'a', 'b', 'c', .. 'z' are 97, 98, 99, .. 122 respectively. And codes for 'A',
+    // 'B', 'C', .. 'Z' are 65, 66, .. 95 respectively.
+
+    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->string.vector.size > s2->string.vector.size)
+    {
+        *result =  1;
+        return ZYAN_STATUS_FALSE;
+    }
+
+    const char* const a = (char*)s1->string.vector.data;
+    const char* const b = (char*)s2->string.vector.data;
+    ZyanUSize i;
+    for (i = 0; (i + 1 < s1->string.vector.size) && (i + 1 < s2->string.vector.size); ++i)
+    {
+        if ((a[i] == b[i]) || ((a[i] ^ 32) == b[i]))
+        {
+            continue;
+        }
+        break;
+    }
+
+    if (a[i] == b[i])
+    {
+        *result = 0;
+        return ZYAN_STATUS_TRUE;
+    }
+
+    if ((a[i] | 32) < (b[i] | 32))
+    {
+        *result = -1;
+        return ZYAN_STATUS_FALSE;
+    }
+
+    *result = 1;
+    return ZYAN_STATUS_FALSE;
+}
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Case conversion                                                                                */
+/* ---------------------------------------------------------------------------------------------- */
+
+ZyanStatus ZyanStringToLowerCase(ZyanString* string)
+{
+    if (!string)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    return ZyanStringToLowerCaseEx(string, 0, string->vector.size - 1);
+}
+
+ZyanStatus ZyanStringToLowerCaseEx(ZyanString* string, ZyanUSize index, ZyanUSize count)
+{
+    // This solution assumes that characters are represented using ASCII representation, i.e.,
+    // codes for 'a', 'b', 'c', .. 'z' are 97, 98, 99, .. 122 respectively. And codes for 'A',
+    // 'B', 'C', .. 'Z' are 65, 66, .. 95 respectively.
+
+    if (!string)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    // Don't allow access to the terminating '\0' character
+    if (index + count >= string->vector.size)
+    {
+        return ZYAN_STATUS_OUT_OF_RANGE;
+    }
+
+    char* s = (char*)string->vector.data + index;
+    for (ZyanUSize i = index; i < index + count; ++i)
+    {
+        const char c = *s;
+        if ((c >= 'A') && (c <= 'Z'))
+        {
+            *s = c | 32;
+        }
+        ++s;
+    }
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+ZyanStatus ZyanStringToUpperCase(ZyanString* string)
+{
+    if (!string)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    return ZyanStringToUpperCaseEx(string, 0, string->vector.size - 1);
+}
+
+ZyanStatus ZyanStringToUpperCaseEx(ZyanString* string, ZyanUSize index, ZyanUSize count)
+{
+    // This solution assumes that characters are represented using ASCII representation, i.e.,
+    // codes for 'a', 'b', 'c', .. 'z' are 97, 98, 99, .. 122 respectively. And codes for 'A',
+    // 'B', 'C', .. 'Z' are 65, 66, .. 95 respectively.
+
+    if (!string)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    // Don't allow access to the terminating '\0' character
+    if (index + count >= string->vector.size)
+    {
+        return ZYAN_STATUS_OUT_OF_RANGE;
+    }
+
+    char* s = (char*)string->vector.data + index;
+    for (ZyanUSize i = index; i < index + count; ++i)
+    {
+        const char c = *s;
+        if ((c >= 'a') && (c <= 'z'))
+        {
+            *s = c & ~32;
+        }
+        ++s;
+    }
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Memory management                                                                              */
+/* ---------------------------------------------------------------------------------------------- */
+
+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;
+}
+
+ZyanStatus ZyanStringReserve(ZyanString* string, ZyanUSize capacity)
+{
+    if (!string)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    return ZyanVectorReserve(&string->vector, capacity);
+}
+
+ZyanStatus ZyanStringShrinkToFit(ZyanString* string)
+{
+    if (!string)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    return ZyanVectorShrinkToFit(&string->vector);
+}
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Information                                                                                    */
+/* ---------------------------------------------------------------------------------------------- */
+
+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;
+}
+
+ZyanStatus ZyanStringGetSize(const ZyanString* string, ZyanUSize* size)
+{
+    if (!string)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    ZYAN_ASSERT(string->vector.size >= 1);
+    *size = string->vector.size - 1;
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+ZyanStatus ZyanStringGetData(const ZyanString* string, const char** value)
+{
+    if (!string)
+    {
+        return ZYAN_STATUS_INVALID_ARGUMENT;
+    }
+
+    *value = string->vector.data;
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+/* ---------------------------------------------------------------------------------------------- */
+
+/* ============================================================================================== */
new file mode 100644
--- /dev/null
+++ b/js/src/zydis/ZycoreExportConfig.h
@@ -0,0 +1,10 @@
+#ifndef ZYCORE_EXPORT_H
+#define ZYCORE_EXPORT_H
+
+#define ZYCORE_EXPORT
+#define ZYCORE_NO_EXPORT
+#define ZYCORE_NO_DEPRECATED
+
+#endif /* ZYCORE_EXPORT_H */
+
+
new file mode 100644
--- /dev/null
+++ b/js/src/zydis/Zydis/Decoder.c
@@ -0,0 +1,4904 @@
+/***************************************************************************************************
+
+  Zyan Disassembler Library (Zydis)
+
+  Original Author : Florian Bernd
+
+ * 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.
+
+***************************************************************************************************/
+
+#include "zydis/Zycore/LibC.h"
+#include "zydis/Zydis/Decoder.h"
+#include "zydis/Zydis/Status.h"
+#include "zydis/Zydis/Internal/DecoderData.h"
+#include "zydis/Zydis/Internal/SharedData.h"
+
+/* ============================================================================================== */
+/* Internal enums and types                                                                       */
+/* ============================================================================================== */
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Decoder context                                                                                */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Defines the `ZydisDecoderContext` struct.
+ */
+typedef struct ZydisDecoderContext_
+{
+    /**
+     * @brief   A pointer to the `ZydisDecoder` instance.
+     */
+    const ZydisDecoder* decoder;
+    /**
+     * @brief   The input buffer.
+     */
+    const ZyanU8* buffer;
+    /**
+     * @brief   The input buffer length.
+     */
+    ZyanUSize buffer_len;
+    struct
+    {
+        /**
+         * @brief   Signals, if the instruction has a `LOCK` prefix (`F0`).
+         *
+         * This prefix originally belongs to group 1, but separating it from the other ones makes
+         * parsing easier for us later.
+         */
+        ZyanBool has_lock;
+        /**
+         * @brief   The effective prefix of group 1 (either `F2` or `F3`).
+         */
+        ZyanU8 group1;
+        /**
+         * @brief   The effective prefix of group 3 (`2E`,`36`, `3E`, `26`, `64` or `65`).
+         */
+        ZyanU8 group2;
+        /**
+         * @brief   Signals, if the instruction has an operand-size override prefix (`66`).
+         *
+         * This is the only prefix in group 3.
+         */
+        // ZyanBool has_osz_override;
+        /**
+         * @brief   Signals, if the instruction has an address-size override prefix (`67`).
+         *
+         * This is the only prefix in group 4.
+         */
+        // ZyanBool has_asz_override;
+        /**
+         * @brief   The effective segment prefix.
+         */
+        ZyanU8 effective_segment;
+        /**
+         * @brief   The prefix that should be treated as the mandatory-prefix, if the current
+         *          instruction needs one.
+         *
+         * The last `F3`/`F2` prefix has precedence over previous ones and `F3`/`F2` in general
+         * have precedence over `66`.
+         */
+        ZyanU8 mandatory_candidate;
+        /**
+         * @brief   The offset of the effective `LOCK` prefix.
+         */
+        ZyanU8 offset_lock;
+        /**
+         * @brief   The offset of the effective prefix in group 1.
+         */
+        ZyanU8 offset_group1;
+        /**
+         * @brief   The offset of the effective prefix in group 2.
+         */
+        ZyanU8 offset_group2;
+        /**
+         * @brief   The offset of the operand-size override prefix (`66`).
+         *
+         * This is the only prefix in group 3.
+         */
+        ZyanU8 offset_osz_override;
+        /**
+         * @brief   The offset of the address-size override prefix (`67`).
+         *
+         * This is the only prefix in group 4.
+         */
+        ZyanU8 offset_asz_override;
+        /**
+         * @brief   The offset of the effective segment prefix.
+         */
+        ZyanU8 offset_segment;
+        /**
+         * @brief   The offset of the mandatory-candidate prefix.
+         */
+        ZyanU8 offset_mandatory;
+    } prefixes;
+    /**
+     * @brief   Contains the effective operand-size index.
+     *
+     * 0 = 16 bit, 1 = 32 bit, 2 = 64 bit
+     */
+    ZyanU8 eosz_index;
+    /**
+     * @brief   Contains the effective address-size index.
+     *
+     * 0 = 16 bit, 1 = 32 bit, 2 = 64 bit
+     */
+    ZyanU8 easz_index;
+    /**
+     * @brief   Contains some cached REX/XOP/VEX/EVEX/MVEX values to provide uniform access.
+     */
+    struct
+    {
+        ZyanU8 W;
+        ZyanU8 R;
+        ZyanU8 X;
+        ZyanU8 B;
+        ZyanU8 L;
+        ZyanU8 LL;
+        ZyanU8 R2;
+        ZyanU8 V2;
+        ZyanU8 v_vvvv;
+        ZyanU8 mask;
+    } cache;
+#ifndef ZYDIS_DISABLE_AVX512
+    /**
+     * @brief   Internal EVEX-specific information.
+     */
+    struct
+    {
+        /**
+         * @brief   The EVEX tuple-type.
+         */
+        ZydisEVEXTupleType tuple_type;
+        /**
+         * @brief   The EVEX element-size.
+         */
+        ZyanU8 element_size;
+    } evex;
+#endif
+#ifndef ZYDIS_DISABLE_KNC
+    /**
+     * @brief   Internal MVEX-specific information.
+     */
+    struct
+    {
+        /**
+         * @brief   The MVEX functionality.
+         */
+        ZydisMVEXFunctionality functionality;
+    } mvex;
+#endif
+#if !defined(ZYDIS_DISABLE_AVX512) || !defined(ZYDIS_DISABLE_KNC)
+    /**
+     * @brief   The scale factor for EVEX/MVEX compressed 8-bit displacement values.
+     */
+    ZyanU8 cd8_scale;
+#endif
+} ZydisDecoderContext;
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Register encoding                                                                              */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Defines the `ZydisRegisterEncoding` enum.
+ */
+typedef enum ZydisRegisterEncoding_
+{
+    ZYDIS_REG_ENCODING_INVALID,
+    /**
+     * @brief   The register-id is encoded as part of the opcode.
+     *
+     * Possible extension by `REX/XOP/VEX/EVEX/MVEX.B`.
+     */
+    ZYDIS_REG_ENCODING_OPCODE,
+    /**
+     * @brief   The register-id is encoded in `modrm.reg`.
+     *
+     * Possible extension by `EVEX/MVEX.R'` (vector only) and `REX/XOP/VEX/EVEX/MVEX.R`.
+     */
+    ZYDIS_REG_ENCODING_REG,
+    /**
+     * @brief   The register-id is encoded in `XOP/VEX/EVEX/MVEX.vvvv`.
+     *
+     * Possible extension by `EVEX/MVEX.v'` (vector only).
+     */
+    ZYDIS_REG_ENCODING_NDSNDD,
+    /**
+     * @brief   The register-id is encoded in `modrm.rm`.
+     *
+     * Possible extension by `EVEX/MVEX.X` (vector only) and `REX/XOP/VEX/EVEX/MVEX.B`.
+     */
+    ZYDIS_REG_ENCODING_RM,
+    /**
+     * @brief   The register-id is encoded in `modrm.rm` or `sib.base` (if SIB is present).
+     *
+     * Possible extension by `REX/XOP/VEX/EVEX/MVEX.B`.
+     */
+    ZYDIS_REG_ENCODING_BASE,
+    /**
+     * @brief   The register-id is encoded in `sib.index`.
+     *
+     * Possible extension by `REX/XOP/VEX/EVEX/MVEX.X`.
+     */
+    ZYDIS_REG_ENCODING_INDEX,
+    /**
+     * @brief   The register-id is encoded in `sib.index`.
+     *
+     * Possible extension by `EVEX/MVEX.V'` (vector only) and `REX/XOP/VEX/EVEX/MVEX.X`.
+     */
+    ZYDIS_REG_ENCODING_VIDX,
+    /**
+     * @brief   The register-id is encoded in an additional 8-bit immediate value.
+     *
+     * Bits [7:4] in 64-bit mode with possible extension by bit [3] (vector only), bits [7:5] for
+     * all other modes.
+     */
+    ZYDIS_REG_ENCODING_IS4,
+    /**
+     * @brief   The register-id is encoded in `EVEX.aaa/MVEX.kkk`.
+     */
+    ZYDIS_REG_ENCODING_MASK,
+
+    /**
+     * @brief   Maximum value of this enum.
+     */
+    ZYDIS_REG_ENCODING_MAX_VALUE = ZYDIS_REG_ENCODING_MASK,
+    /**
+     * @brief   The minimum number of bits required to represent all values of this enum.
+     */
+    ZYDIS_REG_ENCODING_REQUIRED_BITS = ZYAN_BITS_TO_REPRESENT(ZYDIS_REG_ENCODING_MAX_VALUE)
+} ZydisRegisterEncoding;
+
+/* ---------------------------------------------------------------------------------------------- */
+
+/* ============================================================================================== */
+/* Internal functions                                                                             */
+/* ============================================================================================== */
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Input helper functions                                                                         */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Reads one byte from the current read-position of the input data-source.
+ *
+ * @param   context     A pointer to the `ZydisDecoderContext` instance.
+ * @param   instruction A pointer to the `ZydisDecodedInstruction` struct.
+ * @param   value       A pointer to the memory that receives the byte from the input data-source.
+ *
+ * @return  A zyan status code.
+ *
+ * This function may fail, if the `ZYDIS_MAX_INSTRUCTION_LENGTH` limit got exceeded, or no more
+ * data is available.
+ */
+static ZyanStatus ZydisInputPeek(ZydisDecoderContext* context,
+    ZydisDecodedInstruction* instruction, ZyanU8* value)
+{
+    ZYAN_ASSERT(context);
+    ZYAN_ASSERT(instruction);
+    ZYAN_ASSERT(value);
+
+    if (instruction->length >= ZYDIS_MAX_INSTRUCTION_LENGTH)
+    {
+        return ZYDIS_STATUS_INSTRUCTION_TOO_LONG;
+    }
+
+    if (context->buffer_len > 0)
+    {
+        *value = context->buffer[0];
+        return ZYAN_STATUS_SUCCESS;
+    }
+
+    return ZYDIS_STATUS_NO_MORE_DATA;
+}
+
+/**
+ * @brief   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 successfull call of `ZydisInputPeek`.
+ *
+ * This function increases the `length` field of the `ZydisDecodedInstruction` struct by one.
+ */
+static void ZydisInputSkip(ZydisDecoderContext* context, ZydisDecodedInstruction* instruction)
+{
+    ZYAN_ASSERT(context);
+    ZYAN_ASSERT(instruction);
+    ZYAN_ASSERT(instruction->length < ZYDIS_MAX_INSTRUCTION_LENGTH);
+
+    ++instruction->length;
+    ++context->buffer;
+    --context->buffer_len;
+}
+
+/**
+ * @brief   Reads one byte from the current read-position of the input data-source and increases
+ *          the read-position by one byte afterwards.
+ *
+ * @param   context     A pointer to the `ZydisDecoderContext` instance.
+ * @param   instruction A pointer to the `ZydisDecodedInstruction` struct.
+ * @param   value       A pointer to the memory that receives the byte from the input data-source.
+ *
+ * @return  A zyan status code.
+ *
+ * This function acts like a subsequent call of `ZydisInputPeek` and `ZydisInputSkip`.
+ */
+static ZyanStatus ZydisInputNext(ZydisDecoderContext* context,
+    ZydisDecodedInstruction* instruction, ZyanU8* value)
+{
+    ZYAN_ASSERT(context);
+    ZYAN_ASSERT(instruction);
+    ZYAN_ASSERT(value);
+
+    if (instruction->length >= ZYDIS_MAX_INSTRUCTION_LENGTH)
+    {
+        return ZYDIS_STATUS_INSTRUCTION_TOO_LONG;
+    }
+
+    if (context->buffer_len > 0)
+    {
+        *value = context->buffer++[0];
+        ++instruction->length;
+        --context->buffer_len;
+        return ZYAN_STATUS_SUCCESS;
+    }
+
+    return ZYDIS_STATUS_NO_MORE_DATA;
+}
+
+/**
+ * @brief   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   context         A pointer to the `ZydisDecoderContext` instance.
+ * @param   instruction     A pointer to the `ZydisDecodedInstruction` struct.
+ * @param   value           A pointer to the memory that receives the byte from the input
+ *                          data-source.
+ * @param   number_of_bytes The number of bytes to read from the input data-source.
+ *
+ * @return  A zyan status code.
+ *
+ * This function acts like a subsequent call of `ZydisInputPeek` and `ZydisInputSkip`.
+ */
+static ZyanStatus ZydisInputNextBytes(ZydisDecoderContext* context,
+    ZydisDecodedInstruction* instruction, ZyanU8* value, ZyanU8 number_of_bytes)
+{
+    ZYAN_ASSERT(context);
+    ZYAN_ASSERT(instruction);
+    ZYAN_ASSERT(value);
+
+    if (instruction->length + number_of_bytes > ZYDIS_MAX_INSTRUCTION_LENGTH)
+    {
+        return ZYDIS_STATUS_INSTRUCTION_TOO_LONG;
+    }
+
+    if (context->buffer_len >= number_of_bytes)
+    {
+        instruction->length += number_of_bytes;
+
+        ZYAN_MEMCPY(value, context->buffer, number_of_bytes);
+        context->buffer += number_of_bytes;
+        context->buffer_len -= number_of_bytes;
+
+        return ZYAN_STATUS_SUCCESS;
+    }
+
+    return ZYDIS_STATUS_NO_MORE_DATA;
+}
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Decode functions                                                                               */
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Decodes the `REX`-prefix.
+ *
+ * @param   context     A pointer to the `ZydisDecoderContext` struct.
+ * @param   instruction A pointer to the `ZydisDecodedInstruction` struct.
+ * @param   data        The `REX` byte.
+ */
+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       = (data >> 2) & 0x01;
+    instruction->raw.rex.X       = (data >> 1) & 0x01;
+    instruction->raw.rex.B       = (data >> 0) & 0x01;
+
+    // Update internal fields
+    context->cache.W = instruction->raw.rex.W;
+    context->cache.R = instruction->raw.rex.R;
+    context->cache.X = instruction->raw.rex.X;
+    context->cache.B = instruction->raw.rex.B;
+}
+
+/**
+ * @brief   Decodes the `XOP`-prefix.
+ *
+ * @param   context     A pointer to the `ZydisDecoderContext` struct.
+ * @param   instruction A pointer to the `ZydisDecodedInstruction` struct.
+ * @param   data        The `XOP` bytes.
+ *
+ * @return  A zyan status code.
+ */
+static ZyanStatus ZydisDecodeXOP(ZydisDecoderContext* context,
+    ZydisDecodedInstruction* instruction, const ZyanU8 data[3])
+{
+    ZYAN_ASSERT(instruction);
+    ZYAN_ASSERT(data[0] == 0x8F);
+    ZYAN_ASSERT(((data[1] >> 0) & 0x1F) >= 8);
+    ZYAN_ASSERT(instruction->raw.xop.offset == instruction->length - 3);
+
+    instruction->attributes |= ZYDIS_ATTRIB_HAS_XOP;
+    instruction->raw.xop.R       = (data[1] >> 7) & 0x01;
+    instruction->raw.xop.X       = (data[1] >> 6) & 0x01;
+    instruction->raw.xop.B       = (data[1] >> 5) & 0x01;
+    instruction->raw.xop.m_mmmm  = (data[1] >> 0) & 0x1F;
+
+    if ((instruction->raw.xop.m_mmmm < 0x08) || (instruction->raw.xop.m_mmmm > 0x0A))
+    {
+        // Invalid according to the AMD documentation
+        return ZYDIS_STATUS_INVALID_MAP;
+    }
+
+    instruction->raw.xop.W    = (data[2] >> 7) & 0x01;
+    instruction->raw.xop.vvvv = (data[2] >> 3) & 0x0F;
+    instruction->raw.xop.L    = (data[2] >> 2) & 0x01;
+    instruction->raw.xop.pp   = (data[2] >> 0) & 0x03;
+
+    // Update internal fields
+    context->cache.W = instruction->raw.xop.W;
+    context->cache.R = 0x01 & ~instruction->raw.xop.R;
+    context->cache.X = 0x01 & ~instruction->raw.xop.X;
+    context->cache.B = 0x01 & ~instruction->raw.xop.B;
+    context->cache.L = instruction->raw.xop.L;
+    context->cache.LL = instruction->raw.xop.L;
+    context->cache.v_vvvv = (0x0F & ~instruction->raw.xop.vvvv);
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+/**
+ * @brief   Decodes the `VEX`-prefix.
+ *
+ * @param   context     A pointer to the `ZydisDecoderContext` struct.
+ * @param   instruction A pointer to the `ZydisDecodedInstruction` struct.
+ * @param   data        The `VEX` bytes.
+ *
+ * @return  A zyan status code.
+ */
+static ZyanStatus ZydisDecodeVEX(ZydisDecoderContext* context,
+    ZydisDecodedInstruction* instruction, const ZyanU8 data[3])
+{
+    ZYAN_ASSERT(instruction);
+    ZYAN_ASSERT((data[0] == 0xC4) || (data[0] == 0xC5));
+
+    instruction->attributes |= ZYDIS_ATTRIB_HAS_VEX;
+    switch (data[0])
+    {
+    case 0xC4:
+        ZYAN_ASSERT(instruction->raw.vex.offset == instruction->length - 3);
+        instruction->raw.vex.size    = 3;
+        instruction->raw.vex.R       = (data[1] >> 7) & 0x01;
+        instruction->raw.vex.X       = (data[1] >> 6) & 0x01;
+        instruction->raw.vex.B       = (data[1] >> 5) & 0x01;
+        instruction->raw.vex.m_mmmm  = (data[1] >> 0) & 0x1F;
+        instruction->raw.vex.W       = (data[2] >> 7) & 0x01;
+        instruction->raw.vex.vvvv    = (data[2] >> 3) & 0x0F;
+        instruction->raw.vex.L       = (data[2] >> 2) & 0x01;
+        instruction->raw.vex.pp      = (data[2] >> 0) & 0x03;
+        break;
+    case 0xC5:
+        ZYAN_ASSERT(instruction->raw.vex.offset == instruction->length - 2);
+        instruction->raw.vex.size    = 2;
+        instruction->raw.vex.R       = (data[1] >> 7) & 0x01;
+        instruction->raw.vex.X       = 1;
+        instruction->raw.vex.B       = 1;
+        instruction->raw.vex.m_mmmm  = 1;
+        instruction->raw.vex.W       = 0;
+        instruction->raw.vex.vvvv    = (data[1] >> 3) & 0x0F;
+        instruction->raw.vex.L       = (data[1] >> 2) & 0x01;
+        instruction->raw.vex.pp      = (data[1] >> 0) & 0x03;
+        break;
+    default:
+        ZYAN_UNREACHABLE;
+    }
+
+    // Map 0 is only valid for some KNC instructions
+#ifdef ZYDIS_DISABLE_KNC
+    if ((instruction->raw.vex.m_mmmm == 0) || (instruction->raw.vex.m_mmmm > 0x03))
+#else
+    if (instruction->raw.vex.m_mmmm > 0x03)
+#endif
+    {
+        // Invalid according to the intel documentation
+        return ZYDIS_STATUS_INVALID_MAP;
+    }
+
+    // Update internal fields
+    context->cache.W = instruction->raw.vex.W;
+    context->cache.R = 0x01 & ~instruction->raw.vex.R;
+    context->cache.X = 0x01 & ~instruction->raw.vex.X;
+    context->cache.B = 0x01 & ~instruction->raw.vex.B;
+    context->cache.L = instruction->raw.vex.L;
+    context->cache.LL = instruction->raw.vex.L;
+    context->cache.v_vvvv = (0x0F & ~instruction->raw.vex.vvvv);
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+#ifndef ZYDIS_DISABLE_AVX512
+/**
+ * @brief   Decodes the `EVEX`-prefix.
+ *
+ * @param   context     A pointer to the `ZydisDecoderContext` struct.
+ * @param   instruction A pointer to the `ZydisDecodedInstruction` struct.
+ * @param   data        The `EVEX` bytes.
+ *
+ * @return  A zyan status code.
+ */
+static ZyanStatus ZydisDecodeEVEX(ZydisDecoderContext* context,
+    ZydisDecodedInstruction* instruction, const ZyanU8 data[4])
+{
+    ZYAN_ASSERT(instruction);
+    ZYAN_ASSERT(data[0] == 0x62);
+    ZYAN_ASSERT(instruction->raw.evex.offset == instruction->length - 4);
+
+    instruction->attributes |= ZYDIS_ATTRIB_HAS_EVEX;
+    instruction->raw.evex.R         = (data[1] >> 7) & 0x01;
+    instruction->raw.evex.X         = (data[1] >> 6) & 0x01;
+    instruction->raw.evex.B         = (data[1] >> 5) & 0x01;
+    instruction->raw.evex.R2        = (data[1] >> 4) & 0x01;
+
+    if (((data[1] >> 2) & 0x03) != 0x00)
+    {
+        // Invalid according to the intel documentation
+        return ZYDIS_STATUS_MALFORMED_EVEX;
+    }
+
+    instruction->raw.evex.mm        = (data[1] >> 0) & 0x03;
+
+    if (instruction->raw.evex.mm == 0x00)
+    {
+        // Invalid according to the intel documentation
+        return ZYDIS_STATUS_INVALID_MAP;
+    }
+
+    instruction->raw.evex.W         = (data[2] >> 7) & 0x01;
+    instruction->raw.evex.vvvv      = (data[2] >> 3) & 0x0F;
+
+    ZYAN_ASSERT(((data[2] >> 2) & 0x01) == 0x01);
+
+    instruction->raw.evex.pp        = (data[2] >> 0) & 0x03;
+    instruction->raw.evex.z         = (data[3] >> 7) & 0x01;
+    instruction->raw.evex.L2        = (data[3] >> 6) & 0x01;
+    instruction->raw.evex.L         = (data[3] >> 5) & 0x01;
+    instruction->raw.evex.b         = (data[3] >> 4) & 0x01;
+    instruction->raw.evex.V2        = (data[3] >> 3) & 0x01;
+
+    if (!instruction->raw.evex.V2 &&
+        (context->decoder->machine_mode != ZYDIS_MACHINE_MODE_LONG_64))
+    {
+        return ZYDIS_STATUS_MALFORMED_EVEX;
+    }
+
+    instruction->raw.evex.aaa       = (data[3] >> 0) & 0x07;
+
+    if (instruction->raw.evex.z && !instruction->raw.evex.aaa)
+    {
+        return ZYDIS_STATUS_INVALID_MASK; // TODO: Dedicated status code
+    }
+
+    // Update internal fields
+    context->cache.W = instruction->raw.evex.W;
+    context->cache.R = 0x01 & ~instruction->raw.evex.R;
+    context->cache.X = 0x01 & ~instruction->raw.evex.X;
+    context->cache.B = 0x01 & ~instruction->raw.evex.B;
+    context->cache.LL = (data[3] >> 5) & 0x03;
+    context->cache.R2 = 0x01 & ~instruction->raw.evex.R2;
+    context->cache.V2 = 0x01 & ~instruction->raw.evex.V2;
+    context->cache.v_vvvv =
+        ((0x01 & ~instruction->raw.evex.V2) << 4) | (0x0F & ~instruction->raw.evex.vvvv);
+    context->cache.mask = instruction->raw.evex.aaa;
+
+    if (!instruction->raw.evex.V2 && (context->decoder->machine_mode != ZYDIS_MACHINE_MODE_LONG_64))
+    {
+        return ZYDIS_STATUS_MALFORMED_EVEX;
+    }
+    if (!instruction->raw.evex.b && (context->cache.LL == 3))
+    {
+        // LL = 3 is only valid for instructions with embedded rounding control
+        return ZYDIS_STATUS_MALFORMED_EVEX;
+    }
+
+    return ZYAN_STATUS_SUCCESS;
+}
+#endif
+
+#ifndef ZYDIS_DISABLE_KNC
+/**
+ * @brief   Decodes the `MVEX`-prefix.
+ *
+ * @param   context     A pointer to the `ZydisDecoderContext` struct.
+ * @param   instruction A pointer to the `ZydisDecodedInstruction` struct.
+ * @param   data        The `MVEX` bytes.
+ *
+ * @return  A zyan status code.
+ */
+static ZyanStatus ZydisDecodeMVEX(ZydisDecoderContext* context,
+    ZydisDecodedInstruction* instruction, const ZyanU8 data[4])
+{
+    ZYAN_ASSERT(instruction);
+    ZYAN_ASSERT(data[0] == 0x62);
+    ZYAN_ASSERT(instruction->raw.mvex.offset == instruction->length - 4);
+
+    instruction->attributes |= ZYDIS_ATTRIB_HAS_MVEX;
+    instruction->raw.mvex.R       = (data[1] >> 7) & 0x01;
+    instruction->raw.mvex.X       = (data[1] >> 6) & 0x01;
+    instruction->raw.mvex.B       = (data[1] >> 5) & 0x01;
+    instruction->raw.mvex.R2      = (data[1] >> 4) & 0x01;
+    instruction->raw.mvex.mmmm    = (data[1] >> 0) & 0x0F;
+
+    if (instruction->raw.mvex.mmmm > 0x03)
+    {
+        // Invalid according to the intel documentation
+        return ZYDIS_STATUS_INVALID_MAP;
+    }
+
+    instruction->raw.mvex.W       = (data[2] >> 7) & 0x01;
+    instruction->raw.mvex.vvvv    = (data[2] >> 3) & 0x0F;
+
+    ZYAN_ASSERT(((data[2] >> 2) & 0x01) == 0x00);
+
+    instruction->raw.mvex.pp      = (data[2] >> 0) & 0x03;
+    instruction->raw.mvex.E       = (data[3] >> 7) & 0x01;
+    instruction->raw.mvex.SSS     = (data[3] >> 4) & 0x07;
+    instruction->raw.mvex.V2      = (data[3] >> 3) & 0x01;
+    instruction->raw.mvex.kkk     = (data[3] >> 0) & 0x07;
+
+    // Update internal fields
+    context->cache.W = instruction->raw.mvex.W;
+    context->cache.R = 0x01 & ~instruction->raw.mvex.R;
+    context->cache.X = 0x01 & ~instruction->raw.mvex.X;
+    context->cache.B = 0x01 & ~instruction->raw.mvex.B;
+    context->cache.R2 = 0x01 & ~instruction->raw.mvex.R2;
+    context->cache.V2 = 0x01 & ~instruction->raw.mvex.V2;
+    context->cache.LL = 2;
+    context->cache.v_vvvv =
+        ((0x01 & ~instruction->raw.mvex.V2) << 4) | (0x0F & ~instruction->raw.mvex.vvvv);
+    context->cache.mask = instruction->raw.mvex.kkk;
+
+    return ZYAN_STATUS_SUCCESS;
+}
+#endif
+
+/**
+ * @brief   Decodes the `ModRM`-byte.
+ *
+ * @param   instruction A pointer to the `ZydisDecodedInstruction` struct.
+ * @param   data        The `ModRM` byte.
+ */
+static void ZydisDecodeModRM(ZydisDecodedInstruction* instruction, ZyanU8 data)
+{
+    ZYAN_ASSERT(instruction);
+    ZYAN_ASSERT(!(instruction->attributes & ZYDIS_ATTRIB_HAS_MODRM));
+    ZYAN_ASSERT(instruction->raw.modrm.offset == instruction->length - 1);
+
+    instruction->attributes |= ZYDIS_ATTRIB_HAS_MODRM;
+    instruction->raw.modrm.mod     = (data >> 6) & 0x03;
+    instruction->raw.modrm.reg     = (data >> 3) & 0x07;
+    instruction->raw.modrm.rm      = (data >> 0) & 0x07;
+}
+
+/**
+ * @brief   Decodes the `SIB`-byte.
+ *
+ * @param   instruction A pointer to the `ZydisDecodedInstruction` struct
+ * @param   data        The `SIB` byte.
+ */
+static void ZydisDecodeSIB(ZydisDecodedInstruction* instruction, ZyanU8 data)
+{
+    ZYAN_ASSERT(instruction);
+    ZYAN_ASSERT(instruction->attributes & ZYDIS_ATTRIB_HAS_MODRM);
+    ZYAN_ASSERT(instruction->raw.modrm.rm == 4);
+    ZYAN_ASSERT(!(instruction->attributes & ZYDIS_ATTRIB_HAS_SIB));
+    ZYAN_ASSERT(instruction->raw.sib.offset == instruction->length - 1);
+
+    instruction->attributes |= ZYDIS_ATTRIB_HAS_SIB;
+    instruction->raw.sib.scale   = (data >> 6) & 0x03;
+    instruction->raw.sib.index   = (data >> 3) & 0x07;
+    instruction->raw.sib.base    = (data >> 0) & 0x07;
+}
+
+/* ---------------------------------------------------------------------------------------------- */
+
+/**
+ * @brief   Reads a displacement value.
+ *
+ * @param   context     A pointer to the `ZydisDecoderContext` struct.
+ * @param   instruction A pointer to the `ZydisDecodedInstruction` struct.
+ * @param   size        The physical size of the displacement value.
+ *
+ * @return  A zyan status code.
+ */
+static ZyanStatus ZydisReadDisplacement(ZydisDecoderContext* context,
+    ZydisDecodedInstruction* instruction, ZyanU8 size)
+{
+    ZYAN_ASSERT(context);
+    ZYAN_ASSERT(instruction);
+    ZYAN_ASSERT(instruction->raw.disp.size == 0);
+
+    instruction->raw.disp.size = size;
+    instruction->raw.disp.offset = instruction->length;
+
+    switch (size)
+    {
+    case 8:
+    {
+        ZyanU8 value;
+        ZYAN_CHECK(ZydisInputNext(context, instruction, &value));
+        instruction->raw.disp.value = *(ZyanI8*)&value;
+        break;
+    }
+    case 16:
+    {
+        ZyanU16 value;
+        ZYAN_CHECK(ZydisInputNextBytes(context, instruction, (ZyanU8*)&value, 2));
+        instruction->raw.disp.value = *(ZyanI16*)&value;
+        break;
+    }
+    case 32:
+    {
+        ZyanU32 value;
+        ZYAN_CHECK(ZydisInputNextBytes(context, instruction, (ZyanU8*)&value, 4));
+        instruction->raw.disp.value = *(ZyanI32*)&value;
+        break;
+    }
+    case 64:
+    {
+        ZyanU64 value;
+        ZYAN_CHECK(ZydisInputNextBytes(context, instruction, (ZyanU8*)&value, 8));
+        instruction->raw.disp.value = *(ZyanI64*)&value;
+        break;
+    }
+    default:
+        ZYAN_UNREACHABLE;
+    }
+
+    // TODO: Fix endianess on big-endian systems
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+/**
+ * @brief   Reads an immediate value.
+ *
+ * @param   context     A pointer to the `ZydisDecoderContext` struct.
+ * @param   instruction A pointer to the `ZydisDecodedInstruction` struct.
+ * @param   id          The immediate id (either `0` or `1`).
+ * @param   size        The physical size of the immediate value.
+ * @param   is_signed   Signals, if the immediate value is signed.
+ * @param   is_relative Signals, if the immediate value is a relative offset.
+ *
+ * @return  A zyan status code.
+ */
+static ZyanStatus ZydisReadImmediate(ZydisDecoderContext* context,
+    ZydisDecodedInstruction* instruction, ZyanU8 id, ZyanU8 size, ZyanBool is_signed,
+    ZyanBool is_relative)
+{
+    ZYAN_ASSERT(context);
+    ZYAN_ASSERT(instruction);
+    ZYAN_ASSERT((id == 0) || (id == 1));
+    ZYAN_ASSERT(is_signed || !is_relative);
+    ZYAN_ASSERT(instruction->raw.imm[id].size == 0);
+
+    instruction->raw.imm[id].size = size;
+    instruction->raw.imm[id].offset = instruction->length;
+    instruction->raw.imm[id].is_signed = is_signed;
+    instruction->raw.imm[id].is_relative = is_relative;
+    switch (size)
+    {
+    case 8:
+    {
+        ZyanU8 value;
+        ZYAN_CHECK(ZydisInputNext(context, instruction, &value));
+        if (is_signed)
+        {
+            instruction->raw.imm[id].value.s = (ZyanI8)value;
+        } else
+        {
+            instruction->raw.imm[id].value.u = value;
+        }
+        break;
+    }
+    case 16:
+    {
+        ZyanU16 value;
+        ZYAN_CHECK(ZydisInputNextBytes(context, instruction, (ZyanU8*)&value, 2));
+        if (is_signed)
+        {
+            instruction->raw.imm[id].value.s = (ZyanI16)value;
+        } else
+        {
+            instruction->raw.imm[id].value.u = value;
+        }
+        break;
+    }
+    case 32:
+    {
+        ZyanU32 value;
+        ZYAN_CHECK(ZydisInputNextBytes(context, instruction, (ZyanU8*)&value, 4));
+        if (is_signed)
+        {
+            instruction->raw.imm[id].value.s = (ZyanI32)value;
+        } else
+        {
+            instruction->raw.imm[id].value.u = value;
+        }
+        break;
+    }
+    case 64:
+    {
+        ZyanU64 value;
+        ZYAN_CHECK(ZydisInputNextBytes(context, instruction, (ZyanU8*)&value, 8));
+        if (is_signed)
+        {
+            instruction->raw.imm[id].value.s = (ZyanI64)value;
+        } else
+        {
+            instruction->raw.imm[id].value.u = value;
+        }
+        break;
+    }
+    default:
+        ZYAN_UNREACHABLE;
+    }
+
+    // TODO: Fix endianess on big-endian systems
+
+    return ZYAN_STATUS_SUCCESS;
+}
+
+/* ---------------------------------------------------------------------------------------------- */
+/* Semantical instruction decoding                                                                */
+/* ---------------------------------------------------------------------------------------------- */
+
+#ifndef ZYDIS_MINIMAL_MODE
+/**
+ * @brief   Calculates the register-id for a specific register-encoding and register-class.
+ *
+ * @param   context         A pointer to the `ZydisDecoderContext` struct.
+ * @param   instruction     A pointer to the ` ZydisDecodedInstruction` struct.
+ * @param   encoding        The register-encoding.
+ * @param   register_class  The register-class.
+ *
+ * @return  A zyan status code.
+ *
+ * This function calculates the register-id by combining different fields and flags of previously
+ * decoded structs.
+ */
+static ZyanU8 ZydisCalcRegisterId(ZydisDecoderContext* context,
+    ZydisDecodedInstruction* instruction, ZydisRegisterEncoding encoding,
+    ZydisRegisterClass register_class)
+{
+    switch (context->decoder->machine_mode)
+    {
+    case ZYDIS_MACHINE_MODE_LONG_COMPAT_16:
+    case ZYDIS_MACHINE_MODE_LEGACY_16:
+    case ZYDIS_MACHINE_MODE_REAL_16:
+    case ZYDIS_MACHINE_MODE_LONG_COMPAT_32:
+    case ZYDIS_MACHINE_MODE_LEGACY_32:
+        switch (encoding)
+        {
+        case ZYDIS_REG_ENCODING_OPCODE:
+        {
+            ZYAN_ASSERT((register_class == ZYDIS_REGCLASS_GPR8) ||
+                        (register_class == ZYDIS_REGCLASS_GPR16) ||
+                        (register_class == ZYDIS_REGCLASS_GPR32) ||
+                        (register_class == ZYDIS_REGCLASS_GPR64));
+            ZyanU8 value = (instruction->opcode & 0x0F);
+            if (value > 7)
+            {
+                value = value - 8;
+            }
+            return value;
+        }
+        case ZYDIS_REG_ENCODING_REG:
+            ZYAN_ASSERT(instruction->attributes & ZYDIS_ATTRIB_HAS_MODRM);
+            return instruction->raw.modrm.reg;
+        case ZYDIS_REG_ENCODING_NDSNDD:
+            return context->cache.v_vvvv & 0x07;
+        case ZYDIS_REG_ENCODING_RM:
+            ZYAN_ASSERT(instruction->attributes & ZYDIS_ATTRIB_HAS_MODRM);
+            return instruction->raw.modrm.rm;
+        case ZYDIS_REG_ENCODING_BASE:
+            ZYAN_ASSERT(instruction->attributes & ZYDIS_ATTRIB_HAS_MODRM);
+            ZYAN_ASSERT(instruction->raw.modrm.mod != 3);
+            if (instruction->raw.modrm.rm == 4)
+            {
+                ZYAN_ASSERT(instruction->attributes & ZYDIS_ATTRIB_HAS_SIB);
+                return instruction->raw.sib.base;
+            }
+            return instruction->raw.modrm.rm;
+        case ZYDIS_REG_ENCODING_INDEX:
+            ZYAN_ASSERT(instruction->attributes & ZYDIS_ATTRIB_HAS_MODRM);
+            ZYAN_ASSERT(instruction->raw.modrm.mod != 3);
+            ZYAN_ASSERT(instruction->attributes & ZYDIS_ATTRIB_HAS_SIB);
+            return instruction->raw.sib.index;
+        case ZYDIS_REG_ENCODING_VIDX:
+            ZYAN_ASSERT(instruction->attributes & ZYDIS_ATTRIB_HAS_MODRM);
+            ZYAN_ASSERT(instruction->raw.modrm.mod != 3);
+            ZYAN_ASSERT(instruction->attributes & ZYDIS_ATTRIB_HAS_SIB);
+            ZYAN_ASSERT((register_class == ZYDIS_REGCLASS_XMM) ||
+                        (register_class == ZYDIS_REGCLASS_YMM) ||
+                        (register_class == ZYDIS_REGCLASS_ZMM));
+            return instruction->raw.sib.index;
+        case ZYDIS_REG_ENCODING_IS4:
+            return (instruction->raw.imm[0].value.u >> 4) & 0x07;
+        case ZYDIS_REG_ENCODING_MASK:
+            return context->cache.mask;
+        default:
+            ZYAN_UNREACHABLE;
+        }
+    case ZYDIS_MACHINE_MODE_LONG_64:
+        switch (encoding)
+        {
+        case ZYDIS_REG_ENCODING_OPCODE:
+        {
+            ZYAN_ASSERT((register_class == ZYDIS_REGCLASS_GPR8) ||
+                        (register_class == ZYDIS_REGCLASS_GPR16) ||
+                        (register_class == ZYDIS_REGCLASS_GPR32) ||
+                        (register_class == ZYDIS_REGCLASS_GPR64));
+            ZyanU8 value = (instruction->opcode & 0x0F);
+            if (value > 7)
+            {
+                value = value - 8;
+            }
+            return value | (context->cache.B << 3);
+        }
+        case ZYDIS_REG_ENCODING_REG:
+        {
+            ZYAN_ASSERT(instruction->attributes & ZYDIS_ATTRIB_HAS_MODRM);
+            ZyanU8 value = instruction->raw.modrm.reg;
+            switch (register_class)
+            {
+            case ZYDIS_REGCLASS_GPR8:
+            case ZYDIS_REGCLASS_GPR16:
+            case ZYDIS_REGCLASS_GPR32:
+            case ZYDIS_REGCLASS_GPR64:
+            case ZYDIS_REGCLASS_XMM:
+            case ZYDIS_REGCLASS_YMM:
+            case ZYDIS_REGCLASS_ZMM:
+            case ZYDIS_REGCLASS_CONTROL:
+            case ZYDIS_REGCLASS_DEBUG:
+                value |= (context->cache.R << 3);
+                break;
+            default:
+                break;
+            }
+            // R' only exists for EVEX and MVEX. No encoding check needed
+            switch (register_class)
+            {
+            case ZYDIS_REGCLASS_XMM:
+            case ZYDIS_REGCLASS_YMM:
+            case ZYDIS_REGCLASS_ZMM:
+                value |= (context->cache.R2 << 4);
+                break;
+            default:
+                break;
+            }
+            return value;
+        }
+        case ZYDIS_REG_ENCODING_NDSNDD:
+            // v' only exists for EVEX and MVEX. No encoding check needed
+            switch (register_class)
+            {
+            case ZYDIS_REGCLASS_XMM:
+            case ZYDIS_REGCLASS_YMM:
+            case ZYDIS_REGCLASS_ZMM:
+                return context->cache.v_vvvv;
+            case ZYDIS_REGCLASS_MASK:
+                return context->cache.v_vvvv & 0x07;
+            default:
+                return context->cache.v_vvvv & 0x0F;
+            }
+        case ZYDIS_REG_ENCODING_RM:
+        {
+            ZYAN_ASSERT(instruction->attributes & ZYDIS_ATTRIB_HAS_MODRM);
+            ZyanU8 value = instruction->raw.modrm.rm;
+            switch (register_class)
+            {
+            case ZYDIS_REGCLASS_GPR8:
+            case ZYDIS_REGCLASS_GPR16:
+            case ZYDIS_REGCLASS_GPR32:
+            case ZYDIS_REGCLASS_GPR64:
+            case ZYDIS_REGCLASS_XMM:
+            case ZYDIS_REGCLASS_YMM:
+            case ZYDIS_REGCLASS_ZMM:
+            case ZYDIS_REGCLASS_CONTROL:
+            case ZYDIS_REGCLASS_DEBUG:
+                value |= (context->cache.B << 3);
+                break;
+            default:
+                break;
+            }
+            // We have to check the instruction-encoding, because the extension by X is only valid
+            // for EVEX and MVEX instructions
+            if ((instruction->encoding == ZYDIS_INSTRUCTION_ENCODING_EVEX) ||
+                (instruction->encoding == ZYDIS_INSTRUCTION_ENCODING_MVEX))
+            {
+                switch (register_class)
+                {
+                case ZYDIS_REGCLASS_XMM:
+                case ZYDIS_REGCLASS_YMM:
+                case ZYDIS_REGCLASS_ZMM:
+                    value |= (context->cache.X << 4);
+                    break;
+                default:
+                    break;
+                }
+            }
+            return value;
+        }
+        case ZYDIS_REG_ENCODING_BASE:
+            ZYAN_ASSERT(instruction->attributes & ZYDIS_ATTRIB_HAS_MODRM);
+            ZYAN_ASSERT(instruction->raw.modrm.mod != 3);
+            if (instruction->raw.modrm.rm == 4)
+            {
+                ZYAN_ASSERT(instruction->attributes & ZYDIS_ATTRIB_HAS_SIB);
+                return instruction->raw.sib.base | (context->cache.B << 3);
+            }
+            return instruction->raw.modrm.rm | (context->cache.B << 3);
+        case ZYDIS_REG_ENCODING_INDEX:
+            ZYAN_ASSERT(instruction->attributes & ZYDIS_ATTRIB_HAS_MODRM);
+            ZYAN_ASSERT(instruction->raw.modrm.mod != 3);
+            ZYAN_ASSERT(instruction->attributes & ZYDIS_ATTRIB_HAS_SIB);
+            return instruction->raw.sib.index | (context->cache.X << 3);
+        case ZYDIS_REG_ENCODING_VIDX:
+            ZYAN_ASSERT(instruction->attributes & ZYDIS_ATTRIB_HAS_MODRM);
+            ZYAN_ASSERT(instruction->raw.modrm.mod != 3);
+            ZYAN_ASSERT(instruction->attributes & ZYDIS_ATTRIB_HAS_SIB);
+            ZYAN_ASSERT((register_class == ZYDIS_REGCLASS_XMM) ||
+                        (register_class == ZYDIS_REGCLASS_YMM) ||
+                        (register_class == ZYDIS_REGCLASS_ZMM));
+            // v' only exists for EVEX and MVEX. No encoding check needed
+            return instruction->raw.sib.index | (context->cache.X << 3) |
+                (context->cache.V2 << 4);
+        case ZYDIS_REG_ENCODING_IS4:
+        {
+            ZyanU8 value = (instruction->raw.imm[0].value.u >> 4) & 0x0F;
+            // We have to check the instruction-encoding, because the extension by bit [3] is only
+            // valid for EVEX and MVEX instructions
+            if ((instruction->encoding == ZYDIS_INSTRUCTION_ENCODING_EVEX) ||
+                (instruction->encoding == ZYDIS_INSTRUCTION_ENCODING_MVEX))
+            {
+                switch (register_class)
+                {
+                case ZYDIS_REGCLASS_XMM:
+                case ZYDIS_REGCLASS_YMM:
+                case ZYDIS_REGCLASS_ZMM:
+                    value |= ((instruction->raw.imm[0].value.u & 0x08) << 1);
+                default:
+                    break;
+                }
+            }
+            return value;
+        }
+        case ZYDIS_REG_ENCODING_MASK:
+            return context->cache.mask;
+        default:
+            ZYAN_UNREACHABLE;
+        }
+    default:
+        ZYAN_UNREACHABLE;
+    }
+}
+#endif
+
+#ifndef ZYDIS_MINIMAL_MODE
+/**
+ * @brief   Sets the operand-size and element-specific information for the given operand.
+ *
+ * @param   context         A pointer to the `ZydisDecoderContext` instance.
+ * @param   instruction     A pointer to the `ZydisDecodedInstruction` struct.
+ * @param   operand         A pointer to the `ZydisDecodedOperand` struct.
+ * @param   definition      A pointer to the `ZydisOperandDefinition` struct.
+ */
+static void ZydisSetOperandSizeAndElementInfo(ZydisDecoderContext* context,
+    ZydisDecodedInstruction* instruction, ZydisDecodedOperand* operand,
+    const ZydisOperandDefinition* definition)
+{
+    ZYAN_ASSERT(context);
+    ZYAN_ASSERT(instruction);
+    ZYAN_ASSERT(operand);
+    ZYAN_ASSERT(definition);
+
+    // Operand size
+    switch (operand->type)
+    {
+    case ZYDIS_OPERAND_TYPE_REGISTER:
+    {
+        if (definition->size[context->eosz_index])
+        {
+            operand->size = definition->size[context->eosz_index] * 8;
+        } else
+        {
+            operand->size = ZydisRegisterGetWidth(context->decoder->machine_mode,
+                operand->reg.value);
+        }
+        operand->element_type = ZYDIS_ELEMENT_TYPE_INT;
+        operand->element_size = operand->size;
+        break;
+    }
+    case ZYDIS_OPERAND_TYPE_MEMORY:
+        switch (instruction->encoding)
+        {
+        case ZYDIS_INSTRUCTION_ENCODING_LEGACY:
+        case ZYDIS_INSTRUCTION_ENCODING_3DNOW:
+        case ZYDIS_INSTRUCTION_ENCODING_XOP:
+        case ZYDIS_INSTRUCTION_ENCODING_VEX:
+            if (operand->mem.type == ZYDIS_MEMOP_TYPE_AGEN)
+            {
+                ZYAN_ASSERT(definition->size[context->eosz_index] == 0);
+                operand->size = instruction->address_width;
+                operand->element_type = ZYDIS_ELEMENT_TYPE_INT;
+            } else
+            {
+                ZYAN_ASSERT(definition->size[context->eosz_index]);
+                operand->size = definition->size[context->eosz_index] * 8;
+            }
+            break;
+        case ZYDIS_INSTRUCTION_ENCODING_EVEX:
+#ifndef ZYDIS_DISABLE_AVX512
+            if (definition->size[context->eosz_index])
+            {
+                // Operand size is hardcoded
+                operand->size = definition->size[context->eosz_index] * 8;
+            } else
+            {
+                // Operand size depends on the tuple-type, the element-size and the number of
+                // elements
+                ZYAN_ASSERT(instruction->avx.vector_length);
+                ZYAN_ASSERT(context->evex.element_size);
+                switch (context->evex.tuple_type)
+                {
+                case ZYDIS_TUPLETYPE_FV:
+                    if (instruction->avx.broadcast.mode)
+                    {
+                        operand->size = context->evex.element_size;
+                    } else
+                    {
+                        operand->size = instruction->avx.vector_length;
+                    }
+                    break;
+                case ZYDIS_TUPLETYPE_HV:
+                    if (instruction->avx.broadcast.mode)
+                    {
+                        operand->size = context->evex.element_size;
+                    } else
+                    {
+                        operand->size = (ZyanU16)instruction->avx.vector_length / 2;
+                    }
+                    break;
+                default:
+                    ZYAN_UNREACHABLE;