Skip to content
Decrypts PlayStation Vita pkg file and packages to zip archive
C Other
  1. C 98.4%
  2. Other 1.6%
Branch: master
Clone or download
#1 Compare This branch is 31 commits ahead of mmozeiko:master.
Latest commit 3ca0531 Feb 21, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.appveyor.yml update CI configs Oct 31, 2017
.gitignore ignore .zip files Sep 23, 2017
.travis.yml use default gcc/clang on Travis CI for faster builds Nov 1, 2017
LICENSE first version Sep 23, 2017
README.md Update README.md Feb 21, 2019
build.cmd faster build for MSVC Nov 10, 2017
makefile ignore warning with pragma in source code Jul 15, 2018
miniz_tdef.c add real compression to PSP iso in zip file Nov 7, 2017
miniz_tdef.h add real compression to PSP iso in zip file Nov 7, 2017
pkg2zip.c incremented version number to 2.2 Feb 21, 2019
pkg2zip_aes.c unpack PSP eboot.pbp to ISO file Nov 6, 2017
pkg2zip_aes.h unpack PSP eboot.pbp to ISO file Nov 6, 2017
pkg2zip_aes_x86.c unpack PSP eboot.pbp to ISO file Nov 6, 2017
pkg2zip_crc32.c unpack PSP pkg files to CSO Nov 10, 2017
pkg2zip_crc32.h unpack PSP pkg files to CSO Nov 10, 2017
pkg2zip_crc32_x86.c small cleanup in crc32 Nov 5, 2017
pkg2zip_out.c PSP pkg unpacking fixes Feb 7, 2019
pkg2zip_out.h PSP pkg unpacking fixes Feb 7, 2019
pkg2zip_psp.c - Use PSP Theme title for zip naming Feb 16, 2019
pkg2zip_psp.h - Use PSP Theme title for zip naming Feb 16, 2019
pkg2zip_sys.c fixed missing include Feb 6, 2019
pkg2zip_sys.h Added Vita Theme pkg support Feb 5, 2019
pkg2zip_utils.h fixing unicode output on Windows Nov 12, 2017
pkg2zip_zip.c fixing unicode output on Windows Nov 12, 2017
pkg2zip_zip.h unpack PSP pkg files to CSO Nov 10, 2017
pkg2zip_zrif.c fixing unicode output on Windows Nov 12, 2017
pkg2zip_zrif.h PSM pkg unpacking for use with NoPsmDrm Oct 31, 2017
puff.c fixed minor warnings for msvc build Sep 28, 2017
puff.h add zRIF support Sep 25, 2017
rif2zrif.py store zRIF dictionary compressed in scripts Sep 25, 2017
zrif2rif.py store zRIF dictionary compressed in scripts Sep 25, 2017

README.md

pkg2zip

Travis CI Build Status AppVeyor Build Status Downloads Release License

Utility that decrypts PlayStation Vita pkg file and creates zip package. Supported pkg files - main application, DLC, patch, theme and PSM files. Also supports 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.

Requirements

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.

Limitations:

  • no actual title name is extracted for PSM pkg files.

Usage

If you have zRIF fake license, then execute:

pkg2zip package.pkg zRIF_STRING

This will create title [id] [region].zip file. Title, ID and region is automatically detected from pkg file. It will include work.bin file.

If you don't have zRIF fake license, but just want to unpack files, then omit last argument:

pkg2zip package.pkg

Resulting zip file will not include work.bin. This is useful for patch pkg files.

To get output file name of the zip, use -l (must come before pkg file and cannot be used with -x):

pkg2zip -l package.pkg

To avoid zipping process and create individual files, use -x argument (must come before pkg file):

pkg2zip -x package.pkg [zRIF_STRING]

To disable bgdl output for VITA Theme extraction, use the '-b' argument.

pkg2zip -b -x package.pkg zRIF_STRING

PSX or PSP pkg files do not require zRIF argument. It will be ignored.

For PSP files pkg2zip by default will create a .ISO file. To create a compressed .CSO file pass -cN argument where N is compression factor. For example, for fastest compression use:

pkg2zip -c1 package.pkg

To create smaller cso file (more compression will require more time) use -c9, or anything inbetween:

pkg2zip -c9 package.pkg

You can combine -cN argument together with -x:

pkg2zip -x -c9 package.pkg

To extract PSP files in their original EBOOT.PBP format use the '-p' argument:

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:

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

It will print zRIF string to stdout.

To generate work.bin from zRIF string use zrif2rif.py script:

$ python zrif2rif.py zRIF work.bin

Last argument is optional, it specifies where to save file and defaults to work.bin name.

Download

Get latest Windows binaries here.

ArchLinux users can build binary with pkg2zip package in AUR repository. For example, with pacaur:

$ pacaur -S pkg2zip

openSUSE users can download the package from the Packman repository. If this repository is enabled, just install pkg2zip with zypper.

# zypper install pkg2zip

Building

Execute make if you are on GNU/Linux or macOS.

On Windows you can build either with MinGW (get MinGW-w64) or Visual Studio 2017 Community Edition.

  • for MinGW make sure you have make installed, and then execute mingw32-make
  • for Visual Studio run build.cmd

Alternatives

License

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

You can’t perform that action at this time.