mmozeiko / pkg2zip

Decrypts PlayStation Vita pkg file and packages to zip archive
The Unlicense
406 stars 89 forks source link

Output is Zero Byte Zip when passthrough trrntzip #9

Closed u4113057 closed 6 years ago

u4113057 commented 6 years ago

when i pass the out put zip file through trrntzip the final output will be zero byte. not actually this program fault but output maybe non standard zip format ?

mmozeiko commented 6 years ago

Not sure which trrntzip are you using, but I took latest code from https://sourceforge.net/p/trrntzip/code/HEAD/tree/ compiled it and it correctly re-zipped my zip files from pkg2zip output.

Maybe you are using old version of trrntzip that does not support zip64 format?

image

u4113057 commented 6 years ago

trrntzip_v02_win.zip i use this one. this is the lastest compiled version that i found

mmozeiko commented 6 years ago

So this is not an issue with pkg2zip. Its a bug in older trnntzip. I suggest finding better version that has fixed this bug.

Although I'm not sure why would you want to do this at all. Output produced by trnntzip will be worse than original zip file. The main disadvantage is that it compresses all files. Which is useless. Because Vita files are encrypted, so compression doesn't help much. In many cases it actually makes zip file larger. And much slower to extract.

u4113057 commented 6 years ago

torrentzip is use maximum compression and output will be identical by whoever create the file. useful for sharing in some application like torrent. although maximum compression might not be useful but for identical file creation would be very useful. maybe you can include trrntzip as a parameter. thanks in advance

mmozeiko commented 6 years ago

Sorry, but compressing zip with pkg file contents is useless feature. When Vita pkg file is unpackaged to zip then all the files inside zip file are encrypted. And encrypted files cannot be compressed. Its information theory 101. That means after applying trnntzip in most cases the resulting zip file will be larger! Only with very few exceptions you'll get smaller zip file.

Here's an example with PCSG00582:

Another example with PCSG00714:

So not only you get larger zip files, but you also get much slower unpacking of zip files. pkg2zip doesn't compress any file which it puts inside zip. For example - after running pkg2zip on PCSG00582, I can unpack that ~5GB zip file on my machine in ~5.8 seconds. But unpacking trnntzip processed zip file takes ~13.6 seconds.

So what's the point of running trnntzip? You get larger zip files and slower unpacking. Its disadvantage for everbody (who creates and who uses zip file).

Creating identical files is not a really useful feature.. If you want identical output, just distribute pkg file itself - it is same for everybody.