From 1bfa1d5e4e2160a73008e52687d1730a0bc4ba63 Mon Sep 17 00:00:00 2001 From: Arthur Beck Date: Tue, 18 Mar 2025 17:08:43 -0500 Subject: [PATCH] Add object spec --- OBJECTS.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 OBJECTS.md diff --git a/OBJECTS.md b/OBJECTS.md new file mode 100644 index 0000000..1f65211 --- /dev/null +++ b/OBJECTS.md @@ -0,0 +1,43 @@ +# Object format + +Objects are stored for each mod. Each object consists of a custom binary diff-style format(where numbers are little-endian unless otherwise noted): + +``` +0x0B7D1FF0: Magic number +0x00000000: 32-bit version. By convention, unofficial object formats should have the left-most(commonly referred to as the 31st bit) set. +0x0000000000000007: 64-bit number of entries + +0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000: Padding + +0xCF83E1357EEFB8BDF1542850D66D8007D620E4050B5715DC83F4A921D36CE9CE47D0D13C5D85F2B0FF8318D2877EEC2F63B931BD47417A81A538327AF927DA3E: SHA512 hash of object with hash replaced with this hash(the SHA512 hash of an empty string) + +(entries) +``` + +Each entry is in the format: + +``` +0x0000000000000007: 64-bit size of path in bytes +0x0000000000000008: Number of diffs +0x00: Type of change: 0=Removal of file(no diffs), 1=Modification or addition +(path as a UTF-8 encoded string using UNIX conventions such as a forward slash / as a separator) + +(diffs) +``` + +Each diff is in the format: + +``` +0x00: Type of change: 0=Removal(no body), 1=Insertion, 2=Replacement +0x00000000000000: Padding +0x0000000000000000: Start of change (relative to original file) +0x0000000000000010: Length of change + +(body) +``` + +Known versions: + +|32-bit value|Name| +|-----|-----| +|0x00000000|Official venus version 0.1(this doc)|