Skip to content

Instantly share code, notes, and snippets.

@Summertime
Created August 22, 2019 17:58
Show Gist options
  • Save Summertime/4487e6f68df25191e4086335e5ce6fcb to your computer and use it in GitHub Desktop.
Save Summertime/4487e6f68df25191e4086335e5ce6fcb to your computer and use it in GitHub Desktop.

STPAK Specification Draft

Notes

All integers in the file are unsigned little endian, everything is little endian, unless otherwise specified! the packers / unpackers are expected to work across platforms however.

File layout

Root layout

Bytes Commentary
53 54 50 41 4b 00 "STPAK\0"
XX Major version
XX Minor version
XX Patch version

Followed by

Bytes Commentary
XX XX XX XX XX XX XX XX Pack's bitflags

Defined as:

  • 1<<0: Pack/file type
  • 1<<1: Name
  • 1<<2: Data

And then optionally from the following:

Pack/file type layout

Bytes Commentary
XX XX XX XX An int representing pack type

Defined as:

  • 0xFFFFFFFF: Index data (WIP)
  • ...

Name layout

Bytes Commentary
XX XX XX XX Number of bytes for the name
XX .. The name in either bytes (linux) or UTF8 (stringy-named platforms)

Name layout

Bytes Commentary
XX XX XX XX XX XX XX XX Number of bytes for the data
XX .. The data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment