Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Pkg2zip Vita: Difference between revisions

From GameBrew
No edit summary
No edit summary
 
(15 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{#seo:
|title=Vita Homebrew PC Tools (PC Utilities) - GameBrew
|title_mode=append
|image=pkg2zipvita.jpg
|image_alt=pkg2zip
}}
{{Infobox Vita Homebrews
{{Infobox Vita Homebrews
|title=pkg2zip
|title=pkg2zip
|image=pkg2zipvita.jpg
|image=pkg2zipvita2.png
|description=Convert pkg files to zip ones.
|description=Convert pkg files to zip ones.
|author=mmozeiko, lusid1
|author=Yoti, mmozeiko, lusid1
|lastupdated=2021/05/30
|lastupdated=2024/06/29
|type=PC Utilities
|type=PC Utilities
|version=2.3
|version=2.6
|license=Public Domain
|license=Public Domain
|download=https://dlhb.gamebrew.org/vitahomebrews/pkg2zipvita.7z 1.8 & 2.3
|download=https://dlhb.gamebrew.org/vitahomebrews/pkg2zipvita.7z
|website=https://github.com/lusid1/pkg2zip
|website=https://github.com/lusid1/pkg2zip
|source=https://github.com/lusid1/pkg2zip
|source=https://github.com/lusid1/pkg2zip
}}
{{#seo:
|title=Vita Homebrew PC Tools (PC Utilities) - GameBrew
|title_mode=append
|image=pkg2zipvita2.png
|image_alt=pkg2zip
}}
}}
Pkg2zip, an utility that decrypts PlayStation Vita pkg file and creates zip package.  
Pkg2zip, an utility that decrypts PlayStation Vita pkg file and creates zip package.  


Supported PKG, PSX and PSP PKG files for use with [[Adrenaline Vita|Adrenaline]].  
Supported pkg files - main application, DLC, patch, theme and PSM files. Also supported PKG, PSX and PSP PKG files for use with [[Adrenaline Vita|Adrenaline]].  


Optionally writes [[NoNpDrm Vita|NoNpDrm]] or [[NoPsmDrm Vita|NoPsmDrm]] fake license file from zRIF string. You must provide license key.
Optionally writes [[NoNpDrm Vita|NoNpDrm]] or [[NoPsmDrm Vita|NoPsmDrm]] fake license file from zRIF string. You must provide license key.
Line 39: Line 39:
* [[VitaShell]] v1.76 or newer required for DLC installation.
* [[VitaShell]] v1.76 or newer required for DLC installation.
* [[Adrenaline Vita|Adrenaline]] for PSX or PSP titles.
* [[Adrenaline Vita|Adrenaline]] for PSX or PSP titles.
* [[Npdrm free PSP|Npdrm free]] for PSP titles in eboot format.


===How to use===
===How to use===
If you have zRIF fake license, then execute:
Use the following command if you have zRIF fake license. <br>
 
This will create <code>title [id] [region].zip</code> file. Title, ID and region is automatically detected from pkg file. It will include work.bin file. Example:
<pre>pkg2zip package.pkg zRIF_STRING</pre>
<pre>pkg2zip package.pkg zRIF_STRING</pre>


This will create <code>title [id] [region].zip</code> file. Title, ID and region is automatically detected from pkg file. It will include work.bin file.
Omit last argument if you don't have zRIF fake license, but just want to unpack files. <br>
 
Resulting zip file will not include work.bin. This is useful for patch pkg files. Example:
If you don't have zRIF fake license, but just want to unpack files, then omit last argument:
 
<pre>pkg2zip package.pkg</pre>
<pre>pkg2zip package.pkg</pre>


Resulting zip file will not include work.bin. This is useful for patch pkg files.
Use <code>-l</code> to get output file name of the zip (must come before pkg file and cannot be used with <code>-x</code>). Example:
 
To get output file name of the zip, use <code>-l</code> (must come before pkg file and cannot be used with <code>-x</code>):
 
<pre>pkg2zip -l package.pkg</pre>
<pre>pkg2zip -l package.pkg</pre>


To avoid zipping process and create individual files, use <code>-x</code> argument (must come before pkg file):
Use <code>-x</code> argument to avoid zipping process and create individual files (must come before pkg file). <br>
 
PSX or PSP pkg files do not require zRIF argument. It will be ignored. Example:
<pre>pkg2zip -x package.pkg [zRIF_STRING]</pre>
<pre>pkg2zip -x package.pkg [zRIF_STRING]</pre>


PSX or PSP pkg files do not require zRIF argument. It will be ignored.
For PSP files pkg2zip by default will create .ISO file. <br>
 
To create compressed .CSO file pass <code>-cN</code> argument where N is compression factor (1 for the fastest compression). Example:
For PSP files pkg2zip by default will create .ISO file. To create compressed .CSO file pass -cN argument where N is compression factor. For example, for fastest compression use:
 
<pre>pkg2zip -c1 package.pkg</pre>
<pre>pkg2zip -c1 package.pkg</pre>


To create smaller cso file (more compression will require more time) use -c9, or anything inbetween:
Use <code>-c9</code>, or anything inbetween to create smaller cso file (more compression will require more time). Example:
<pre>pkg2zip -c9 package.pkg</pre>


<pre>pkg2zip -c9 package.pkg</pre>
You can combine <code>-cN</code> argument together with <code>-x</code>. Example:
<pre>pkg2zip -x -c9 package.pkg</pre>


You can combine -cN argument together with -x:
Use the <code>-p</code> argument to extract PSP files in their original EBOOT.PBP format. Example:
<pre>pkg2zip -p package.pkg</pre>


<pre>pkg2zip -x -c9 package.pkg</pre>
Note: On PSP hardware titles with DLC should be kept in ISO/CSO format due to limitations on the CFW NoDRM Engine.


=== Generating zRIF string ===
=== Generating zRIF string ===
If you have working NoNpDrm license file (work.bin or 6488b73b912a753a492e2714e9b38bc7.rif) you can create zRIF string with <code>rif2zrif.py</code> python script:
If you have working NoNpDrm license file (work.bin or 6488b73b912a753a492e2714e9b38bc7.rif) you can create zRIF string with <code>rif2zrif.py</code> python script.<br>
 
Example (it will print zRIF string to stdout):
<pre>$ python rif2zrif.py path/to/work.bin</pre>
<pre>$ python rif2zrif.py path/to/work.bin</pre>


It will print zRIF string to stdout.
To generate work.bin from zRIF string use <code>zrif2rif.py</code> script.<br>
 
Example (last argument is optional, it specifies where to save file and defaults to work.bin name):
To generate work.bin from zRIF string use <code>zrif2rif.py</code> script:
 
<div class="snippet-clipboard-content notranslate position-relative overflow-auto">
 
<pre>$ python zrif2rif.py zRIF work.bin</pre>
<pre>$ python zrif2rif.py zRIF work.bin</pre>
Last argument is optional, it specifies where to save file and defaults to work.bin name.


===Limitations===
===Limitations===
Line 101: Line 92:


==Changelog==
==Changelog==
'''v2.6'''
* enhanced pkg file support (Yoti).
* additional languages (Yoti).
* PSM extraction for android (LiEnby).
'''v2.5''' (by Yoti)
*Added support for more regions.
'''v2.4''' (by Yoti)
* Added support to decrypt/extract PKG type 1.
* Added support for KEYS.BIN for PKG type 1.
* Added region detection for PS1 games.
* Fixed some messages here and there.
'''v2.3''' (by lusid1)
'''v2.3''' (by lusid1)
* Only decrypt PSP EDAT files in ISO mode.
* Only decrypt PSP EDAT files in ISO mode.
Line 168: Line 173:


== External links ==
== External links ==
* GitHub - https://github.com/Yoti/pkg2zip
* GitHub - https://github.com/lusid1/pkg2zip
* GitHub - https://github.com/lusid1/pkg2zip
* GitHub - https://github.com/mmozeiko/pkg2zip
* GitHub - https://github.com/mmozeiko/pkg2zip
* VitaDB - https://vitadb.rinnegatamante.it/#/info/342
* VitaDB - https://vitadb.rinnegatamante.it/#/info/342

Latest revision as of 06:43, 30 Haziran 2024

pkg2zip
Pkg2zipvita2.png
General
AuthorYoti, mmozeiko, lusid1
TypePC Utilities
Version2.6
LicensePublic Domain
Last Updated2024/06/29
Links
Download
Website
Source

Pkg2zip, an utility that decrypts PlayStation Vita pkg file and creates zip package.

Supported pkg files - main application, DLC, patch, theme and PSM files. Also supported PKG, PSX and PSP PKG files for use with Adrenaline.

Optionally writes NoNpDrm or NoPsmDrm fake license file from zRIF string. You must provide license key.

Features

  • Portable, written in cross-platform C code, runs on Windows, GNU/Linux, macOS (system dependent functionality is isolated in sys.c file).
  • Small, has no external library dependencies and uses very minimal dynamic memory allocations.
  • Fast, uses AESNI hardware accelerated AES decryption if supported by CPU (requires AESNI and SSSE3 instructions).
  • Simple, creates zip package with same folder structure that Vita expects (just drag & drop all file from zip archive to ux0:). Zip file is created directly from pkg without any intermediate temporary files.
  • Vita DLC, Vita PATCH and PSM pkg unpacking.
  • PSX, PSP, PSP Updates, PSP DLC, and PSP THEME pkg unpacking.

User guide

Requirements

How to use

Use the following command if you have zRIF fake license.
This will create title [id] [region].zip file. Title, ID and region is automatically detected from pkg file. It will include work.bin file. Example:

pkg2zip package.pkg zRIF_STRING

Omit last argument if you don't have zRIF fake license, but just want to unpack files.
Resulting zip file will not include work.bin. This is useful for patch pkg files. Example:

pkg2zip package.pkg

Use -l to get output file name of the zip (must come before pkg file and cannot be used with -x). Example:

pkg2zip -l package.pkg

Use -x argument to avoid zipping process and create individual files (must come before pkg file).
PSX or PSP pkg files do not require zRIF argument. It will be ignored. Example:

pkg2zip -x package.pkg [zRIF_STRING]

For PSP files pkg2zip by default will create .ISO file.
To create compressed .CSO file pass -cN argument where N is compression factor (1 for the fastest compression). Example:

pkg2zip -c1 package.pkg

Use -c9, or anything inbetween to create smaller cso file (more compression will require more time). Example:

pkg2zip -c9 package.pkg

You can combine -cN argument together with -x. Example:

pkg2zip -x -c9 package.pkg

Use the -p argument to extract PSP files in their original EBOOT.PBP format. Example:

pkg2zip -p package.pkg

Note: On PSP hardware titles with DLC should be kept in ISO/CSO format due to limitations on the CFW NoDRM Engine.

Generating zRIF string

If you have working NoNpDrm license file (work.bin or 6488b73b912a753a492e2714e9b38bc7.rif) you can create zRIF string with rif2zrif.py python script.
Example (it will print zRIF string to stdout):

$ python rif2zrif.py path/to/work.bin

To generate work.bin from zRIF string use zrif2rif.py script.
Example (last argument is optional, it specifies where to save file and defaults to work.bin name):

$ python zrif2rif.py zRIF work.bin

Limitations

No actual title name is extracted for PSM pkg files.

Alternatives

Screenshots

pkg2zipvita3.png

Changelog

v2.6

  • enhanced pkg file support (Yoti).
  • additional languages (Yoti).
  • PSM extraction for android (LiEnby).

v2.5 (by Yoti)

  • Added support for more regions.

v2.4 (by Yoti)

  • Added support to decrypt/extract PKG type 1.
  • Added support for KEYS.BIN for PKG type 1.
  • Added region detection for PS1 games.
  • Fixed some messages here and there.

v2.3 (by lusid1)

  • Only decrypt PSP EDAT files in ISO mode.
  • Fixes PCEngine extraction in PBP mode (-p).
  • Fixes DLC compatibility in PBP mode (-p).
  • Added -d switch to force EDAT decryption
  • Merged cli improvements and other fixes from sigmaboy

v2.2 (by lusid1)

  • PSP Theme names are now used for zip file names.

v2.1 (by lusid1)

  • PSX pkg unpacking now includes keys.bin

v2.0 (by lusid1)

  • Added support for VITA Theme pkg.
  • Added support for PSP Theme pkg.
  • Added support for PSP DLC pkg.
  • Added support for pocketstation pkg.
  • Added option to unpack PSP pkg to EBOOT.PBP.
  • Fixed CSO compression.
  • Fixed psm dev kit cert.bin extraction.

v1.8 (by mmozeiko/Mārtiņš Možeiko)

  • Support PSP pkg file unpacking, including NeoGeo, Mini, Go, PC Engine pkg files.
  • Unpack PSP pkg files to ISO or CSO.
  • Better output with UTF-8 encoding on Windows for title names.
  • Show unpacking progress in percents.

v1.7

  • Fix issue with patch file unpacking in -x mode.

v1.6

  • Much faster zip file creation - depending on CPU and disk speed it is now ~2 to 3 times faster.
  • Add -x argument which makes unpacking files in extracted form - with same layout as ux0.
  • Unpacking PSM pkg files for use with NoPsmDrm.
  • Unpacking PSX pkg files for use with Adrenaline.
  • Unpacking PSP pkg files. Result is not yet directly usable on Vita - it produces EBOOT.PBP which requires to be unpacked further with different 3rd party tool.

v1.5

  • Adjust size of tail.bin - now it uses all remaining data after encrypted blob.

v1.4

  • Add support for DLC and PATCH pkg file unpacking.
  • Supports unlimited amount of files inside zip file.
  • Fix for zip files larger than 4GB.
  • Drop support for dummy work.bin generation (without key inside).
  • Drop support for hexkey argument to try generate work.bin.

v1.3

  • Fix a bug when wrong title id was put in work.bin when generating it from raw key.
  • Display minimum required firmware version to run the game.
  • Verify integrity of zRIF before starting to unpack pkg file, and display error if it is not correct zRIF.
  • Allow utf-8 characters in automatic zip filename, useful for non-english game names.
  • Increase limit of max allowed files in zip file.

v1.2

  • Support zRIF strings for generating work.bin file.
  • Add rif2zrif python script to create zRIF string.
  • Identify PCSD prefix as JPN region.

v1.1

  • Fixes wrong head.bin when it is larger than 64KB.

v1.0

  • First Release..

External links

Advertising: