GGPK files have a version field that was previously thought to be an element count in the GGPK chunk in the legacy version 2.
Steam releases and post-bundle PC Standalone has version 3 which have the same format and signifies that the file contains bundles instead of all loose files.
The Standalone GGPK on macOS has version 4 which again contains bundles but with the difference that File and Directory entries use UTF-32LE strings instead of UTF-16LE.
Action Taken
This fix detects the version and decodes strings according to version, enabling the use of Standalone GGPK files on macOS.
Caveats
As GGPK writing seems broken already no attempt was made to also make that aware of versions, the work that needs to be done there is to ensure that the base chunk length changes if the name or version changes as well as actually writing file data.
Abstract
GGPK files have a version field that was previously thought to be an element count in the GGPK chunk in the legacy version 2. Steam releases and post-bundle PC Standalone has version 3 which have the same format and signifies that the file contains bundles instead of all loose files. The Standalone GGPK on macOS has version 4 which again contains bundles but with the difference that File and Directory entries use UTF-32LE strings instead of UTF-16LE.
Action Taken
This fix detects the version and decodes strings according to version, enabling the use of Standalone GGPK files on macOS.
Caveats
As GGPK writing seems broken already no attempt was made to also make that aware of versions, the work that needs to be done there is to ensure that the base chunk length changes if the name or version changes as well as actually writing file data.