Skip to content

Instantly share code, notes, and snippets.

@FelixWolf
Created October 31, 2020 01:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FelixWolf/81104c9c910df5e6ade45a58b3b3df66 to your computer and use it in GitHub Desktop.
Save FelixWolf/81104c9c910df5e6ade45a58b3b3df66 to your computer and use it in GitHub Desktop.
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