hhyyrylainen / GodotPckTool

Standalone tool for extracting and creating Godot .pck files
MIT License
408 stars 34 forks source link

Add support for Godot 4 PCK files #17

Closed aaronfranke closed 1 year ago

aaronfranke commented 2 years ago

I tried to use this tool to extract a PCK file from a Godot 4 project on Linux, and I got an error that the version is unsupported:

$ ../install/bin/godotpcktool mirror-client.pck 
ERROR: pck is unsupported version: 2
ERROR: couldn't load pck file: mirror-client.pck

Please add support for extracting PCK files from Godot 4.

nikitalita commented 1 year ago

You can use GDRE tools as a reference for this: https://github.com/bruvzg/gdsdecomp/blob/master/utility/gdre_packed_source.cpp#L226

basically, in format version 2, they added a couple of additional fields to the header (changing the header length; they didn’t bother to use the reserved fields for some reason) and an additional flags field to every file entry.

they also added encryption support, which is here as well.

hhyyrylainen commented 1 year ago

At the latest I'll add support for this when Thrive is moving to Godot 4 (relevant issue for that: https://github.com/Revolutionary-Games/Thrive/issues/2998).

hhyyrylainen commented 1 year ago

Does anyone have a Godot 4 .pck file to test with? A PR was just opened but Thrive is not on Godot 4 yet so I don't have a file to really verify things work.

hhyyrylainen commented 1 year ago

I just put out a new version of this tool that now supports reading Godot 4 .pck files: https://github.com/hhyyrylainen/GodotPckTool/releases/tag/v1.9