Unpacking playerstats.pck
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
-
- Posts: 422
- Joined: Wed, 3. Dec 03, 09:38
Unpacking playerstats.pck
I want to look what data is in my playerstats.pck file and tried X3MM (2.x) and x2archiver to unpack it. Neither worked: first one gave an error, 2nd one a 0 byte file.
Is there a way to make this pck file human readable?
Is there a way to make this pck file human readable?
-
- Posts: 422
- Joined: Wed, 3. Dec 03, 09:38
-
- Posts: 16999
- Joined: Mon, 5. Mar 07, 22:03
-
- Posts: 422
- Joined: Wed, 3. Dec 03, 09:38
A file beginning with bytes
is no zip-file. Zip-files begin with the two lettters "PK"
Code: Select all
1F 8B
-
- Posts: 22499
- Joined: Sat, 23. Apr 05, 21:42
-
- Moderator (Script&Mod)
- Posts: 22432
- Joined: Sun, 14. Nov 04, 23:26
actually its a zip file, not a zip archive.klingens wrote:A file beginning with bytesis no zip-file. Zip-files begin with the two lettters "PK"Code: Select all
1F 8B
theres a difference.
zip archives are usually multiple files, zipped up into a single file.
this is just a file thats been compressed on its own, the format is actually the same as it uses zlib.
most good zip tools can uncompress it
-
- Posts: 422
- Joined: Wed, 3. Dec 03, 09:38
-
- Posts: 671
- Joined: Fri, 12. Mar 04, 08:14
Can I also play "who is smarter" with you kids?
The container is GZIP
The compression is Deflate.
You can have GZIP with other compression, but it has never been implemented.
You can have pure Deflate stream without container - you save some 20 bytes and lost metadata such as ModifiedDate and CRC
@klingens: X3MM 0.0.8 can extract X2 and X3TC .pcks via shell context menu. You just need to associate it with .pck extension in Settings->File Association. Then right click on the file in Explorer. The "Open" button only works for catalogs.
The container is GZIP
The compression is Deflate.
You can have GZIP with other compression, but it has never been implemented.
You can have pure Deflate stream without container - you save some 20 bytes and lost metadata such as ModifiedDate and CRC
@klingens: X3MM 0.0.8 can extract X2 and X3TC .pcks via shell context menu. You just need to associate it with .pck extension in Settings->File Association. Then right click on the file in Explorer. The "Open" button only works for catalogs.
-
- Posts: 63
- Joined: Tue, 7. Feb 12, 06:20
This Works Best
this is for those of you who can't seem to get a .pck file extracted
using 7-zip & Winrar..
______________________________________________________
Quoted from: DrBullWinkle who helped me fix this frustrating issue
______________________________________________________
you need > X3 editor 2DrBullwinkle wrote:Yeah, that puzzled me at first, too. It turns out that some .pck's can be unzipped with 7-zip, while others cannot. Most "helpful" threads on the subject are incomplete.SpaceAcid wrote:cannot for the life of me figure out how to extract the compressed xml from .pck files using 7-Zip
everywhere in the forums they all say it works
The explanation that I received was that there are two different compression techniques and one of them (the older method) is encrypted. The plugin manager uses the encrypted technique. If I recall correctly, the X3 Editor also defaults to the encrypted technique.
The solution is to use X3 Editor:Also, the Script Editor (any of them) can open .pck files directly, so there is rarely a need to decompress a script file.
- 1) Open the Cat Manager from the Plugins Menu.
2) Create a New Catalog. Give it any name you like. I call mine "Packer.cat" but any name will do.
3) Drag and drop the .pck from Windows Explorer to the new .cat.
4) Drag and drop the .pck back to Windows Explorer. X3 Editor should automatically decompress the file.
hope this helps somebody else!
-
- Posts: 143
- Joined: Sun, 11. Oct 09, 14:32
And the crowd goes wild!doubleshadow wrote:Can I also play "who is smarter" with you kids?
The container is GZIP
The compression is Deflate.
You can have GZIP with other compression, but it has never been implemented.
You can have pure Deflate stream without container - you save some 20 bytes and lost metadata such as ModifiedDate and CRC
-
- Moderator (Script&Mod)
- Posts: 22432
- Joined: Sun, 14. Nov 04, 23:26
Re: This Works Best
first point, this thread is almost 4 years old, was there really a need to resurrect it ?SpaceAcid wrote:
this is for those of you who can't seem to get a .pck file extracted
using 7-zip & Winrar..
______________________________________________________
Quoted from: DrBullWinkle who helped me fix this frustrating issue
______________________________________________________
you need > X3 editor 2DrBullwinkle wrote:Yeah, that puzzled me at first, too. It turns out that some .pck's can be unzipped with 7-zip, while others cannot. Most "helpful" threads on the subject are incomplete.SpaceAcid wrote:cannot for the life of me figure out how to extract the compressed xml from .pck files using 7-Zip
everywhere in the forums they all say it works
The explanation that I received was that there are two different compression techniques and one of them (the older method) is encrypted. The plugin manager uses the encrypted technique. If I recall correctly, the X3 Editor also defaults to the encrypted technique.
The solution is to use X3 Editor:Also, the Script Editor (any of them) can open .pck files directly, so there is rarely a need to decompress a script file.
- 1) Open the Cat Manager from the Plugins Menu.
2) Create a New Catalog. Give it any name you like. I call mine "Packer.cat" but any name will do.
3) Drag and drop the .pck from Windows Explorer to the new .cat.
4) Drag and drop the .pck back to Windows Explorer. X3 Editor should automatically decompress the file.
hope this helps somebody else!
second, to make things clear about the 2 types of files.
Both use the same compression, but one has an Xor encryption applied to it as well.
The Xor method was the default for earier games, so all files in X3R were ilke this. These can be unpacked like a zip file, but they first need the encryption removed
In TC this changed and it was removed so it was just a standard gzip file
both the plugin manager and X3 editor can use both formats
you can also use the official modding tools (from X2) to unpack these files. Or the plugin manager tools can do it as well.
So if 7-zip doen't work then most likly its because its the older format and needs to use different tools
-
- Posts: 31
- Joined: Fri, 25. Oct 13, 13:57
From what I can gather from the X-Editor 2 source code, the "encrypted" file consists of one (random?) byte, followed by the gzipped file byte-wise xor-ed by that byte. Is this correct? If yes, I'll add the decryption to the Python script so the resulting file can be gunzip-ed.