• Stars
    star
    385
  • Rank 111,464 (Top 3 %)
  • Language
    C
  • License
    The Unlicense
  • Created about 7 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Decrypts PlayStation Vita pkg file and packages to zip archive

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 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 and PSP pkg unpacking.

Limitations:

  • no PSP DLC pkg files are supported.
  • 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]

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

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:

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

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.

More Repositories

1

RcloneBrowser

Simple cross platform GUI for rclone
C++
1,303
star
2

aes-finder

Utility to find AES keys in running processes
C++
923
star
3

wcap

Simple and efficient screen recording utility for Windows 10 and 11
C
718
star
4

pkgi

pkg download & installation directly on Vita
C
245
star
5

CxxProfiler

Simple sampling C/C++ profiler
C++
97
star
6

TwitchNotify

Simple utility to notify when Twitch users go live for Windows 10 and up
C
69
star
7

android-native-example

simple example for building native app on Android
C
63
star
8

build-gcc-mingw

Automatic 32-bit and 64-bit Windows build of gcc, mingw-w64, gdb and make.
Shell
57
star
9

docker-mingw-w64

mingw-w64 toolchain in docker for targeting 64-bit Windows
Dockerfile
48
star
10

build-mesa

Automatic build of mesa3d for Windows
Batchfile
28
star
11

docker-unity3d

Unity3d in docker for targeting Windows and Linux
Dockerfile
25
star
12

aseprite-bin

Batchfile
22
star
13

build-sdl3

Automatic build of SDL3 libraries for Windows
Batchfile
22
star
14

symget

fast pdb debug symbol downloader
C
19
star
15

build-angle

Automatic build of angle for Windows
Batchfile
16
star
16

ScreenBuddy

Simple remote desktop sharing application for Windows
C
15
star
17

rpi

Various demos for RaspberryPi
C
14
star
18

c_d2d_dwrite

Direct2D and DirectWrite C headers
C
13
star
19

gitprj

git tags as Windows Projected Filesystem
C
11
star
20

build-sdl2

Automatic build of SDL2 libraries for Windows
Batchfile
11
star
21

build-gcc-arm

Automatic Windows build of gcc, gdb and make for targeting 32-bit and 64-bit arm bare-metal targets.
Shell
10
star
22

build-dawn

Automatic build of dawn (WebGPU) for Windows
Batchfile
10
star
23

wstream

Experiments with RTMP streaming
C
10
star
24

derpnet

Network library in C for Windows
C
5
star
25

jvpn

Python script for connecting Juniper VPN on Linux
Python
4
star
26

smhasher3

C++
4
star
27

stuff

C
3
star
28

build-ffmpeg

static build of ffmpeg binaries for 64-bit Windows
Shell
3
star
29

build-blend2d

Batchfile
2
star
30

Squares3D-iPad

Squares3D port to iPad
C++
2
star
31

Squares3D-Android

Squares3D port to Android
C++
2
star
32

Squares3D

Indago 2006 Latvian game development contest winner
C
2
star
33

kvnc

C
2
star
34

chacha20bench

chacha20 benchmarks with avx2 & avx512
Assembly
1
star
35

Squares3D-prototype

Early prototype for Squares3D. Written in Python.
Python
1
star