Skip to content

Instantly share code, notes, and snippets.

@Radfordhound
Created July 18, 2020 22:13
Show Gist options
  • Save Radfordhound/6fd7474a3c03405e0d7d6f5e8d99ba78 to your computer and use it in GitHub Desktop.
Save Radfordhound/6fd7474a3c03405e0d7d6f5e8d99ba78 to your computer and use it in GitHub Desktop.
// Sonic '06 .arc spec
// By Radfordhound
// Apparently this whole thing is a modification of Nintendo's U8 Format
// which includes support for zlib compression. How? Why? No idea. But anyway...
struct Header
{
uint32_t Signature = 0x2D38AA55;
uint32_t EntriesOffset;
uint32_t EntriesSize;
uint32_t DataOffset;
// Something to do with zlib?
uint32_t Unknown5;
uint32_t Unknown6;
uint32_t Unknown7; // Count of something? Wait no it's in little-endian?!
uint32_t Unknown8;
}
struct DataEntry
{
uint8_t Type; // 0 == File, 1 == Directory
uint24_t NameOffset; // Offset to the file or directory's name relative to the beginning of the string table.
uint32_t DataOffset; // For files, this is an offset to the file's compresed data. For directories, this is the index of the parent directory. The root directory just leaves this as 0 which kind of means it specifies itself.
uint32_t DataCompressedSize; // For files, this is the compressed size of the data. For directories, this is the index of the first node that's not part of this directory. For the root directory and the last directory in the archive, this is the count of all of the nodes in the archive. Basically the game uses this to quickly skip to the next directory if this isn't the one it's looking for.
uint32_t DataUncompressedSize; // For file, this is the uncompressed size of the data. For directories, I have no fricken idea what this is. It seems to just be whatever the heck the devs want it to be. Sometimes it's set to 0x656E6F6E, which is ASCII for "none" lol. I guess it's like flags??
}
// Data is zlib-compressed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment