Skip to content

ARCX format

Geoffrey Horsington edited this page Jul 17, 2018 · 3 revisions

Format structure (basic idea)

Archive structure

struct ARC 
{
    char[] magic = "ARCX"; //note that this is the direct ASCII byte representation, does not use the established string format
    uint16 version;
    uint64 headerOffset;
    blob compressedChunks;
    Header header;
}

Header

struct Header
{
    uint64 fileCount;
    uint32 targetChunkSize;
    uint64 chunkCount;
    File[fileCount] files;
    ArchiveChunk[chunkCount] chunks;
}

Entries

struct File
{
    string path;               // Path of the file. Can contain subdirectories separated by "/"
    int32 chunkID;            // Chunk ID that has the file
    uint16 contentType;         // Such as TEX texture, DDS texture
    uint64 offset;             // Offset within a chunk
    uint64 size;               // Size of the file. Used to determine the number of chunks to read (?)
}

Archive Chunks

struct ArchiveChunk
{
    int32 ID;
    uint8 compressionType;
    uint8 compressionFlags;
    uint32 CRC32;
    uint64 offset;
    uint64 compressedLength;
    uint64 uncompressedLength;
}
enum compressionType
{
    uncompressed = 0,
    lz4 = 1,
    zstd = 2,
    brotli = 3,
    lzham = 4,
    lzma = 5
}
Clone this wiki locally