Psychonauts PKG: Difference between revisions
imported>Zamba No edit summary |
imported>Ikskoks No edit summary |
||
| (3 intermediate revisions by 2 users not shown) | |||
| Line 41: | Line 41: | ||
:: byte {1} - One character of a directory name <br> | :: byte {1} - One character of a directory name <br> | ||
:: byte {1} - null <br> | :: byte {1} - null <br> | ||
:: uint16 {2} - <font color="red"> '' Unknown | :: uint16 {2} - <font color="red"> '' Unknown (possibly a reference to another record if nonzero)''</font><br> | ||
:: uint16 {2} - <font color="red"> '' Unknown | :: uint16 {2} - <font color="red"> '' Unknown (possibly a reference to another record if nonzero)''</font><br> | ||
:: uint16 {2} - Record ID <font color="purple">(incremental from 1)</font> <br> | :: uint16 {2} - Record ID <font color="purple">(incremental from 1)</font> <br> | ||
:: uint16 {2} - Start index <font color="purple">(inclusive)</font><br> | :: uint16 {2} - Start index <font color="purple">(inclusive)</font><br> | ||
| Line 78: | Line 78: | ||
* [[Game Extractor|Game Extractor]]<br> | * [[Game Extractor|Game Extractor]]<br> | ||
* [http://quick.mixnmojo.com/software.php#psychonautsexplorer Psychonauts Explorer]<br> | * [http://quick.mixnmojo.com/software.php#psychonautsexplorer Psychonauts Explorer]<br> | ||
[[Category:File Format]] | |||
Latest revision as of 13:23, 17 January 2021
PKG
- Format Type : Archive
- Endian Order : Little Endian
Format Specifications
// XBOX ONLY
In the xbox version the .pkg file is zlib compressed. There is a 16 byte header then a compressed zlib archive. The format of this header is:
- uint32 {4} - Header (ZLIB)
- uint32 {4} - Version (1)
- uint32 {4} - Size of decompressed file
- uint32 {4} - Size of compressed file (minus the 16 byte header)
// ARCHIVE HEADER
- char {4} - Header (ZPKG)
- uint32 {4} - Version (1)
- uint32 {4} - First File Offset
- uint32 {4} - Number Of Files In Directory 1
- uint32 {4} - Directory 2 Offset
- uint32 {4} - Number Of Records In Directory 2
- uint32 {4} - Filename Directory Offset
- uint32 {4} - Extension Directory Offset
- byte {480} - null Padding to offset 512
// DIRECTORY 1
- // for each file in dir 1
- byte {1} - null
- uint16 {2} - File Extension Offset (relative to the start of the Extension Directory)
- byte {1} - null
- uint32 {4} - Filename Offset (relative to the start of the Filename Directory)
- uint32 {4} - File Offset
- uint32 {4} - File Length
- byte {1} - null
// DIRECTORY 2 (Directory structure)
- // for each record in dir 2
- byte {1} - One character of a directory name
- byte {1} - null
- uint16 {2} - Unknown (possibly a reference to another record if nonzero)
- uint16 {2} - Unknown (possibly a reference to another record if nonzero)
- uint16 {2} - Record ID (incremental from 1)
- uint16 {2} - Start index (inclusive)
- uint16 {2} - End index (exclusive)
- byte {1} - One character of a directory name
The characters read in each record add up to form a directory name. Start index and and end index are usually zero unless the name is complete. If start index or end index are nonzero, then the directory name is complete and the entries in the file records in the given range belong to the directory name just read. When a new directory name starts with a slash (/), the new name must be appended to the one previously read.
There are a few anomalies, because some directories are missing the first letter(s) of their name.
// FILENAME DIRECTORY
- byte {1} - null
- // for each filename
- char {X} - Filename
- byte {1} - null
- char {X} - Filename
// EXTENSION DIRECTORY
- byte {1} - null
- // for each extension
- char {X} - Extension Name
- byte {1} - null
- char {X} - Extension Name
// FILE DATA
- // for each file
- byte {X} - File Data
- byte {X} - File Data
MultiEx BMS
Not written yet