Skip to content
This repository was archived by the owner on Aug 12, 2025. It is now read-only.

Commit 0a7c295

Browse files
committed
first version
0 parents  commit 0a7c295

15 files changed

+1556
-0
lines changed

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
pkg2zip
2+
pkg2zip.exe
3+
*.d
4+
*.o
5+
*.obj
6+
*.pdb
7+

LICENSE

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
This is free and unencumbered software released into the public domain.
2+
3+
Anyone is free to copy, modify, publish, use, compile, sell, or
4+
distribute this software, either in source code form or as a compiled
5+
binary, for any purpose, commercial or non-commercial, and by any
6+
means.
7+
8+
In jurisdictions that recognize copyright laws, the author or authors
9+
of this software dedicate any and all copyright interest in the
10+
software to the public domain. We make this dedication for the benefit
11+
of the public at large and to the detriment of our heirs and
12+
successors. We intend this dedication to be an overt act of
13+
relinquishment in perpetuity of all present and future rights to this
14+
software under copyright law.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19+
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22+
OTHER DEALINGS IN THE SOFTWARE.
23+
24+
For more information, please refer to <http://unlicense.org>

README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# pkg2zip
2+
3+
Utility that decrypts PlayStation Vita pkg file and creates zip package.
4+
5+
Optionally embedds [NoNpDrm](https://github.com/TheOfficialFloW/NoNpDrm) license into work.bin file. You must provide license key.
6+
7+
# Features
8+
9+
* **portable**, written in cross-platform C code, runs on Windows, GNU/Linux, macOS (system dependent functionality is isolated in sys.c file).
10+
* **small**, uses zero dynamic memory allocations and has no external library dependencies.
11+
* **fast**, uses AESNI hardware accelerated AES decryption if supported by CPU (requires [AESNI](https://en.wikipedia.org/wiki/AES_instruction_set) and [SSSE3](https://en.wikipedia.org/wiki/SSSE3) instructions).
12+
* **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.
13+
14+
Limitations:
15+
* currently works only for main application pkg files, no DLC.
16+
17+
# Usage
18+
19+
Execute `pkg2zip package.pkg` to create `title [id] [region].zip` file. Title, ID and region is automatically detected from pkg file.
20+
21+
If you have license key (32 hex characters) you can execute `pkg2zip package.pkg hexkey` to embed key into work.bin file.
22+
23+
# Download
24+
25+
Get latest Windows binaries [here](https://github.com/mmozeiko/pkg2zip/releases).
26+
27+
# Building
28+
29+
Execute `make` if you are on GNU/Linux or macOS.
30+
31+
On Windows you can build either with MinGW (get [MinGW-w64](http://www.msys2.org/)) or [Visual Studio 2017 Community Edition](https://www.visualstudio.com/vs/community/).
32+
* for MinGW make sure you have make installed, and then execute `mingw32-make`
33+
* for Visual Studio run `build.cmd`
34+
35+
# Alternatives
36+
37+
* https://github.com/RikuKH3/unpkg_vita
38+
* https://github.com/St4rk/PkgDecrypt
39+
* https://github.com/TheRadziu/PkgDecrypt
40+
41+
# License
42+
43+
This is free and unencumbered software released into the public domain.
44+
45+
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.

build.cmd

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
@echo off
2+
3+
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64
4+
5+
set CL=/nologo /errorReport:none /Gm- /GF /GS- /MT /W4
6+
set LINK=/errorReport:none /INCREMENTAL:NO
7+
8+
set CL=%CL% /Ox
9+
rem set CL=%CL% /Od /Zi
10+
rem set LINK=%LINK% /DEBUG
11+
12+
cl.exe pkg2zip*.c /Fepkg2zip.exe

makefile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
ifeq ($(OS),Windows_NT)
2+
RM := del /q
3+
EXE := .exe
4+
else
5+
EXE :=
6+
endif
7+
8+
BIN=pkg2zip${EXE}
9+
SRC=${wildcard pkg2zip*.c}
10+
OBJ=${SRC:.c=.o}
11+
DEP=${SRC:.c=.d}
12+
13+
CFLAGS=-pipe -fvisibility=hidden -Wall -Wextra -DNDEBUG -O2
14+
LDFLAGS=-s
15+
16+
.PHONY: all clean
17+
18+
all: ${BIN}
19+
20+
clean:
21+
@${RM} ${BIN} ${OBJ} ${DEP}
22+
23+
${BIN}: ${OBJ}
24+
@echo [L] $@
25+
@${CC} ${LDFLAGS} -o $@ $^
26+
27+
%_x86.o: %_x86.c
28+
@echo [C] $<
29+
@${CC} ${CFLAGS} -maes -mssse3 -MMD -c -o $@ $<
30+
31+
%.o: %.c
32+
@echo [C] $<
33+
@${CC} ${CFLAGS} -MMD -c -o $@ $<
34+
35+
-include ${DEP}

0 commit comments

Comments
 (0)