Created
October 31, 2020 01:43
-
-
Save FelixWolf/81104c9c910df5e6ade45a58b3b3df66 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
header { //This must be equal to or less than chunksize, as the header it's self is a chunk | |
char[4] magic | |
uint16 version_major | |
uint16 version_minor | |
uint8 chunksize // Chunk size = 8 << chunksize | |
uint32 numchunks | |
// Pointers point to chunk IDs, not file offset! Chunk ID = | |
uint32 filetable_pointer | |
uint32 bitmap_pointer | |
// Zero pad until size of chunksize | |
} | |
chunk { | |
uint32 previous_chunk_pointer // If zero, this is the first chunk | |
char[chunksize - 8] | |
uint32 next_chunk_pointer // If zero, this is the last chunk | |
} | |
filetable { | |
uint32 timestamp | |
uint32 filecount | |
fileentry[filecount] | |
} | |
fileentry { | |
uint8 filename_len | |
char[filename_len] filename | |
uint32 timestamp | |
uint32 filesize | |
uint32 chunk_pointer | |
} | |
bitmap { | |
uint8 compression | |
char[ceil(((8 << chunksize) * numchunks) / 8)] bitmap | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment