hhyyrylainen / godotpcktool Goto Github PK
View Code? Open in Web Editor NEWStandalone tool for extracting and creating Godot .pck files
License: MIT License
Standalone tool for extracting and creating Godot .pck files
License: MIT License
If I were to add Globals.gd to the pck, is there any way to make it override the already built in Globals.gd?
I used it on a pck of a web build. But it did not extract the images, only the import files for the images.
Add support for including and excluding files based on name (use a regex match).
when you export using:
pcktool.exe -p test.pck -a a C://somepath... it will not work as it should:
when extracting it will put all files to there absolute positions insted of relative
example:
pcktool.exe -p test.pck -a e -o extracted
will do:
C:/somepath.../file
but it should do:
/extracted/file
it would be great if this got fixed. (I'm using this tool to create simple game engine)
terminal output when listing .pck files:
to reduce the amount of generated input in scripting
please write detailed instructions
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.
GodotPckTool-master/src/pck/PckFile.cpp:293] (performance) Either inefficient or wrong usage of string::find(). string::starts_with() will be faster if string::find's result is compared with 0, because it will not scan the whole string. If your intention is to check that there are no findings in the string, you should compare with std::string::npos. [stlIfStrFind]
There were no changes to the PCK format between versions 0 (Godot 2.x) and 1 (3.x); they just changed the version number to make Godot 3.x refuse to load 2.x pcks and vice-versa.
When unpacking a PCK file it would be nice to have an option to convert STEX files into their 'original' form (PNG, JPG, OGG).
It seems that for now unicode file names is not supported since after unpacking .pck I got few files that can't be packed back properly, For example: original file name "魔王魂 アコースティック25.ogg-0683c3a09e15adb36630a670de69ac05.oggstr" (got it with Godot RE Tools), GodotPckTool generated file name "é”王éВВ‚ アコースティック25.ogg-0683c3a09e15adb36630a670de69ac05.oggstr" so at importing back I got such error:
terminate called after throwing an instance of 'std::filesystem::__cxx11::filesystem_error'
what(): filesystem error: cannot get file size: No such file or directory [extracted\.import\├Р┬У├В┬й├Р┬Т├В┬н├Р┬Т├в┬А┬Э├Р┬У├В┬з├Р┬Т├Р┬Л├Р┬Т├в┬А┬╣├Р┬У├В┬й├Р┬Т├В┬н├Р┬Т├в┬А┬Ъ ├Р┬У├Р┬И├Р┬Т├в┬А┬Ъ├Р┬Т├С┬Ю├Р┬У├Р┬И├Р┬Т├в┬А┬Ъ├Р┬Т├С┬Ц├Р┬У├Р┬И├Р┬Т├С┬У├Р┬Т├С┬Ш├Р┬У├Р┬И├Р┬Т├в┬А┬Ъ├Р┬Т├в┬Д┬Ц├Р┬У├Р┬И├Р┬Т├С┬У├Р┬Т├в┬А┬а├Р┬У├Р┬И├Р┬Т├в┬А┬Ъ├Р┬Т├Р┬И├Р┬У├Р┬И├Р┬Т├С┬У├Р┬Т├С┬У├Р┬У├Р┬И├Р┬Т├в┬А┬Ъ├Р┬Т├Р┬З06.ogg-bcfff188be40b560c38e232ce419ff3c.oggstr]
When I try to compile GodotPckTool using make
on macOS, I get this output:
% make
cd build && cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/aaronfranke/workspace/GodotPckTool/build
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C build
Consolidate compiler generated dependencies of target pck
[ 16%] Building CXX object src/CMakeFiles/pck.dir/PckTool.cpp.o
[ 33%] Building CXX object src/CMakeFiles/pck.dir/FileFilter.cpp.o
[ 50%] Linking CXX static library libpck.a
[ 66%] Built target pck
[ 83%] Building CXX object src/CMakeFiles/godotpcktool.dir/main.cpp.o
[100%] Linking CXX executable godotpcktool
clang: error: invalid linker name in argument '-fuse-ld=gold'
clang: error: unsupported option '-static-libgcc'
make[3]: *** [src/godotpcktool] Error 1
make[2]: *** [src/CMakeFiles/godotpcktool.dir/all] Error 2
make[1]: *** [all] Error 2
make: *** [compile] Error 2
I'm not familiar with CMake, so I'm not sure how to add support for macOS. But I would greatly appreciate it, it would be useful to have when trying to debug a Mac build of my Godot project.
Is it possible to overwrite files if they already exist in the PCK?
It seems like the only option atm is to unpack to a new folder, add the edited file, then make a new pack from that folder's contents. So I was hoping there might be a way to skip the unpack-repack part of the process.
The use case is for adding a mod loader as an autoload, before any other autoloads, so if possible I'd like to streamline the install process for users, and without exposing the game's assets.
Grep doesn't want to search the output, and on windows the listed paths include a null at the end.
So on reading a pck file a trailing null should be stripped, and on write the string size + 1 characters should be printed to include the null.
Reading these was just implemented but not writing.
The build command doesn't work, and the downloadable file is without any extension.
This project depends on this one and not mentioned in readme or how to fetch/install it.
Everytime i try to extract a .pck file it gives me that error.
trying to extract files gives this
...
terminate called after throwing an instance of 'std::runtime_error'
what(): files for entry contents failed
Aborted (core dumped)
trying to build, regardless of where i put MD5/src/md5.h
(./
, build/
, src/
) spits out this
CMake Error at third_party/CMakeLists.txt:13 (add_library):
Cannot find source file:
MD5/src/md5.h
Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm
.ccm .cxxm .c++m .h .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90
.f95 .f03 .hip .ispc
CMake Error at third_party/CMakeLists.txt:13 (add_library):
No SOURCES given to target: md5
also, is there a spec for the .pck format? id honestly rather ahead and rip the assets with dd
at this point
First of all, I'm not good at English.
Please forgive me because I am using machine translation.
Isn't Repack meant to turn unpacked files (in folders) into ".pck files" again?
Please tell me how to repack the folder containing the unpacked files into the ".pck file" again.
When I tried "godotpcktool.exe -p sample.pck -a r -f new.pck", "sample.pck" and "new.pck" did not become the same file.
I am very sorry for the basic question, but I would be very happy if you could reply.
The table of content padding calculation is wrong
In the file
PckFile.cpp
the lines 137--139
const size_t pathToWriteSize =
entry.Path.size() + (entry.Path.size() % PadPathsToMultipleWithNULLS);
const size_t padding = pathToWriteSize - entry.Path.size();
The middle line should be
entry.Path.size() + (PadPathsToMultipleWithNULLS - entry.Path.size() % PadPathsToMultipleWithNULLS)
For reference, see the function
static int _get_pad(int p_alignment, int p_n)
in
editor_export_platform.cpp
I am using Ubuntu 20.04.3 LTS.
godotpcktool
binary for Linuxchmod +x
./godotpcktool -h
./godotpcktool: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by ./godotpcktool)
./godotpcktool: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by ./godotpcktool)
This only happens with the release binaries of 1.5 and 1.6.
The 1.4 binaries work as expected.
Hi, first of all thanks for this great tool!
Is it possible to access the pck file if it is embedded in to the .exe?
I'm co creating a mod loader and as ithinkandicode mentioned in #25 we are using it with great success to add the mod loader autoload at the right spot to the project.binary.
Now we have the issue that some games embed the pck and it looks like we cant access that with the PckTool.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.