VPK

From Vita Developer wiki
Revision as of 06:14, 27 February 2023 by 10.0.2.2 (talk) (→‎Make your own VPK files)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The scene's equivalent to Sony's PKGS format but in this case it's to be used with a HENkaku-enabled PS Vita or PS TV. It does not use any encryption over files so you can not install a VPK with the official PKG installer and vice versa. VitaShell can not install PKGS files.

Make your own VPK files[edit | edit source]

Do it the same it would be done for self-made PKGS files but instead of the original encrypted files, use the ones from your project or from another place for non-encrypted app files.

File format[edit | edit source]

File Layout[edit | edit source]

  • The PKZip (Zip) file. (.vpk) format consists of:
File Layout
Local file header 1
File data 1
Data descriptor 1
Local file header 2
File data 2
Data descriptor 2
...
Local file header n
File data n
Data descriptor n
Archive descriptor header
Archive extra data record
Central directory

Local File[edit | edit source]

  • For a single local file:
byte index Description
[0x00-0x03] Signature of the local file header. This is always '\x50\x4b\x03\x04'.
[0x04-0x05] Version
[0x06-0x07] Flags
Bit index
00 01-02 03 04 05 06 07-10 11 12 13 14-15
encrypted file compression option data descriptor enhanced deflation compressed patched data strong encryption unused language encoding reserved mask header values reserved
[0x08-0x09] Compression
  • 00: no compression
  • 01: shrunk
  • 02: reduced with compression factor 1
  • 03: reduced with compression factor 2
  • 04: reduced with compression factor 3
  • 05: reduced with compression factor 4
  • 06: imploded
  • 07: reserved
  • 08: deflated
  • 09: enhanced deflated
  • 10: PKWare DCL imploded
  • 11: reserved
  • 12: compressed using BZIP2
  • 13: reserved
  • 14: LZMA
  • 15-17: reserved
  • 18: compressed using IBM TERSE
  • 19: IBM LZ77 z
  • 98: PPMd version I, Rev 1
[0x0A-0x0B] File modification time

stored in standard MS-DOS format:

  • Bits 00-04: seconds divided by 2
  • Bits 05-10: minute
  • Bits 11-15: hour
[0x0C-0x0D] File modification date:

stored in standard MS-DOS format:

  • Bits 00-04: day
  • Bits 05-08: month
  • Bits 09-15: years from 1980
[0x0E-0x11] Crc-32: