Z JMP2 Archive Format

From ModdingWiki
Jump to navigation Jump to search

The main asset archives of Z use the JMP2 container. Each directory entry identifies a separately compressed file. This includes MAIN.PAC, WARDATA.PAC, HEADFX.PAC and SHEADFX.PAC.

File format

Offset Data type Name Description
0 UINT32LE prefix Zero in the documented layout.
4 BYTE[] streams Individually compressed LZSS streams.
EOF - 8 - count * 24 ENTRY[count] directory Directory records below.
EOF - 8 UINT32LE count Number of files.
EOF - 4 char[4] signature ASCII JMP2.

Each 24-byte entry has a NUL-terminated name in bytes 0–15, a UINT32LE absolute stream offset at +16, and a UINT32LE decompressed size at +20. There is no compressed-size field. Decode to the end token and check the resulting length against the directory.

Notes

The generic loader tries the main archive, then the language archive, then a loose file. A loose replacement therefore does not automatically override an archived member. The installer archive Z.PAC does not have the JMP2 signature and must not be sent to this decoder.

Source code

From re-z, the open-source browser port:

Credits

This file format was reverse engineered by VorticonCmdr. If you find this information helpful in a project you're working on, please give credit where credit is due. (A link back to this wiki would be nice too!)