In the Groove PCK

The rhythm dancing game In the Groove internally uses several PCK archive files to store game data. The format is not publicly documented, but has been reverse-engineered.

Format details
A PCK archive consists overall of three segments: a short fixed header, a table listing file locations and details, and file data (which may be compressed).

Within the file, all strings are ASCII (the behavior of high-bit strings is unknown, as it is not used), all numbers are stored as little-endian 32-bit integers, and all sizes are in bytes.

Header
A PCK archive always begins with a 132-byte header:

File table
Immediately following the header is a list of the files contained in the archive. The order can be arbitrary. Each file is described with the following variable-length structure:

File data
While the data for files can technically be arranged however desired, in practice each file is stored in the same order given in the file table, at offsets specified in that table.

If the compress flag is set for a file, the data for that file is deflated using zlib. The following Python code can be used to implement compression and decompression:

compressed_data = zlib.compress(data, 9)[2:] decompressed_data = zlib.uncompress(data, -15)

Implementation notes
In The Groove reads data from PCK files with the following file names and comments (for ITG r2 Mac, other versions may vary):


 * DD70BA0B.PCK ("default base branding")
 * DBFEE9B0.PCK ("default base other")
 * DDF0C003.PCK ("default patch base")
 * D82CA1FD.PCK ("default base song")
 * D673D8A8.PCK ("default base movies")
 * DC37F75E.PCK ("default packa song")
 * D1513758.PCK ("default packa movies")
 * D4D500B4.PCK ("default packa other")

The names and expected lengths of these files are hard-coded into the binary. Files with other names will not be examined, and larger / smaller files will cause game startup to fail.