HMM Packfile

From Just Solve the File Format Problem
Revision as of 04:58, 17 November 2022 by Dan Tobias (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
File Format
Name HMM Packfile
Ontology
Extension(s) .pak

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

Sample files

Further information

Additional links

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox