More actions
m was also used in tmn! |
BigBang1112 (talk | contribs) Explain differences between pre-2008 and post-2010 pak file |
||
| Line 3: | Line 3: | ||
Pak files cannot be opened in any standard archiver. The majority of the package is encrypted with the [https://en.wikipedia.org/wiki/Blowfish%20(cipher) Blowfish cipher]. Individual files are then often compressed with either [https://en.wikipedia.org/wiki/Zlib zlib] or [https://en.wikipedia.org/wiki/LZ4%20(compression%20algorithm) LZ4] algorithms. | Pak files cannot be opened in any standard archiver. The majority of the package is encrypted with the [https://en.wikipedia.org/wiki/Blowfish%20(cipher) Blowfish cipher]. Individual files are then often compressed with either [https://en.wikipedia.org/wiki/Zlib zlib] or [https://en.wikipedia.org/wiki/LZ4%20(compression%20algorithm) LZ4] algorithms. | ||
The | The primary purpose of the Pak format is to conceal parts of the GameData directory behind a secure wall, significantly limiting the modification capabilities of the official game content. The format is also effective enough for keeping the content safe from infringement. | ||
== History == | == History == | ||
In the [[TrackMania (series)|TrackMania series]], the system of NadeoPak was first introduced in the [[TrackMania United]] release (not the Forever one). It was intended to replace the [https://en.wikipedia.org/wiki/StarForce StarForce protection], which was used in the previous TrackMania games, such as Sunrise and Original. The format evolved in many ways over the years, reaching up to version 18 that is currently used for | In the [[TrackMania (series)|TrackMania series]], the system of NadeoPak was first introduced in the [[TrackMania United]] release (not the Forever one). It was intended to replace the [https://en.wikipedia.org/wiki/StarForce StarForce protection], which was used in the previous TrackMania games, such as [[TrackMania Sunrise eXtreme|Sunrise]] and [[TrackMania Original|Original]]. The format evolved in many ways over the years, reaching up to version 18 that is currently used both for the [[Maniaplanet]] platform and in [[Trackmania 2020]]. | ||
== Structure == | |||
The structure of the Pak file is slightly different between [[TrackMania United Forever]] (up to 2008) and [[Maniaplanet]] (from 2010). | |||
=== Up to 2008 (version 3) === | |||
Pak files until the release of Forever games use version 3. This version always encrypts everything in the file, including the header. The only unencrypted information is the version itself and the Blowfish [https://en.wikipedia.org/wiki/Initialization%20vector initialization vector]. The key used to decrypt each of these Pak files is stored in the paklist.dat file located in the Packs directory of the installation, next to the other Pak files. | |||
=== From 2010 (version 6 to 18) === | |||
Newer Pak files have an unencrypted header with various descriptive metadata about their contents. That includes: | |||
* SHA256 checksum of the header contents, used for comparison regarding validity and updates | |||
* Author of the package, their login, nickname, and zone | |||
* Description (comments) | |||
* Build information | |||
* Creation date | |||
* Metadata about other included Pak content | |||
* Custom download URL (version 13+) | |||
There are 2 types of keys used for actual decryption: | |||
* Header key - decrypts the list of files and directories | |||
* File key - decrypts the file contents | |||
These 2 keys are formed from the base key that is either hardcoded in the game executable or resolved from an encrypted key given from the [[master server]]. The base key is then used to create the file key like this: | |||
fileKey = md5(baseKey + "NadeoPak") | |||
The header key is then created like this: | |||
headerKey = fileKey ^ 0xCE591D76EBFC7DA1N90BCB6DEBBCBEE56N | |||
Revision as of 02:04, 25 January 2026
Pak (PAK, or NadeoPak) is a proprietary file format used for packaging game content in encrypted form.
Pak files cannot be opened in any standard archiver. The majority of the package is encrypted with the Blowfish cipher. Individual files are then often compressed with either zlib or LZ4 algorithms.
The primary purpose of the Pak format is to conceal parts of the GameData directory behind a secure wall, significantly limiting the modification capabilities of the official game content. The format is also effective enough for keeping the content safe from infringement.
History
In the TrackMania series, the system of NadeoPak was first introduced in the TrackMania United release (not the Forever one). It was intended to replace the StarForce protection, which was used in the previous TrackMania games, such as Sunrise and Original. The format evolved in many ways over the years, reaching up to version 18 that is currently used both for the Maniaplanet platform and in Trackmania 2020.
Structure
The structure of the Pak file is slightly different between TrackMania United Forever (up to 2008) and Maniaplanet (from 2010).
Up to 2008 (version 3)
Pak files until the release of Forever games use version 3. This version always encrypts everything in the file, including the header. The only unencrypted information is the version itself and the Blowfish initialization vector. The key used to decrypt each of these Pak files is stored in the paklist.dat file located in the Packs directory of the installation, next to the other Pak files.
From 2010 (version 6 to 18)
Newer Pak files have an unencrypted header with various descriptive metadata about their contents. That includes:
- SHA256 checksum of the header contents, used for comparison regarding validity and updates
- Author of the package, their login, nickname, and zone
- Description (comments)
- Build information
- Creation date
- Metadata about other included Pak content
- Custom download URL (version 13+)
There are 2 types of keys used for actual decryption:
- Header key - decrypts the list of files and directories
- File key - decrypts the file contents
These 2 keys are formed from the base key that is either hardcoded in the game executable or resolved from an encrypted key given from the master server. The base key is then used to create the file key like this:
fileKey = md5(baseKey + "NadeoPak")
The header key is then created like this:
headerKey = fileKey ^ 0xCE591D76EBFC7DA1N90BCB6DEBBCBEE56N