HMM Packfile
m (Extension categories are normally lowercased) |
(edited archive.org links to generic non-server specific.) |
||
Line 70: | Line 70: | ||
== Sample files == | == Sample files == | ||
− | * [https:// | + | * [https://archive.org/download/backstreet-boys-puzzle/Backstreet%20Boys%20-%20Puzzles%20in%20Motion%20%281999%29%28Ravensburger%29%5BMac-PC%5D.iso/ Backstreet Boys ISO on the Internet Archive]. |
− | * [https:// | + | * [https://archive.org/download/NemesisOfTheRomanEmpireWindows/Nemesis_of_the_Roman_Empire_Win_Preinstalled_EN.zip Nemesis of the Roman Empire ISO on the Internet Archive]. |
== Further information == | == Further information == |
Revision as of 16:02, 16 November 2022
The HMM Packfile is a generic game data format that packages files for distribution with digital games. HMM likely stands for "Haemimont-Smartcom" who are a games publisher associated with at least two different releases known to contain HMM Packfiles - "Rising Kingdoms" (2005) and "Backstreet Boys Moving Puzzle" (1999).
Contents |
Identification
Magic for HMM Packfiles is HMMSYS PackFile
. Although more data can be taken from the 40-byte format header which is documented as:
char {16} - Header ("HMMSYS PackFile" + LF) uint32 {4} - Unknown (26) byte {12} - null-bytes. uint32 {4} - Number Of Files. uint32 {4} - Directory length.
Example data (file has 67 files):
magic: 48 4d 4d 53 59 53 20 50 61 63 6b 46 69 6c 65 0a unknown constant: 1a 00 00 00 null: 00 00 00 00 00 00 00 00 00 00 00 00 number of files: 43 00 00 00 directory length: ec 11 00 00
Note: The Python implementation of the HMM unpacker below notes that it cannot confirm "directory length" as a field in the structure here. The value does not seem to align to the different section or object boundaries in the file when converted to an integer. Additional research here would be beneficial.
Suggested PRONOM signature
A PRONOM signature may look as follows:
484d4d535953205061636b46696c650a1a000000000000000000000000000000
Format layout
The format layout looks as follows:
HMM Packfile |
---|
Format header (40 bytes) |
File directory (n-bytes * no_files) |
Padding (no_files * 4-bytes) |
Files (n-bytes * no_files * file_length) |
File directory
byte {1} - Filename Length byte {1} - Previous Filename Reuse Length char {X} - Filename Part (length = filenameLength - previousFilenameReuseLength) uint32 {4} - File Offset uint32 {4} - File Length
The file directory is a variably sized section of the file. It contains information about the names of the files "packed" into the object. Filenames are encoded using a basic compression mechanism. This mechanism saves space by avoiding repetition of the logical stricture of the packed objects on-disk. To do this, a "reuse length" field is associated with every file. If this value is greater than zero then the number it documents describes the number of bytes to take from the beginning of the previous filename - these are then amended onto the beginning of the current file name as we walk through the directory. We can infer that files are stored a predicable order based on how they were originally stored on disk.
Software for unpacking HMM Packfiles
- Ruby script for unpacking HMM Packfiles NB. Needs updating for modern Ruby.
- Python script for unpacking HMM Packfiles
Sample files
- Backstreet Boys ISO on the Internet Archive.
- Nemesis of the Roman Empire ISO on the Internet Archive.
Further information
- Haemimont Games on Wikipedia.
- Rising Kingdoms PAK (Packfile) reverse engineering on the Xentax forum.