Packages (.PKG)

From Vita Developer wiki
Revision as of 00:10, 23 April 2018 by CelesteBlue (talk | contribs)
Jump to navigation Jump to search


PS3 PKG / PS4 PKG

There are two kinds of PS VITA package files (.pkg):

1. PS VITA Content Packages (.pkg)

2. PS VITA System Packages (.pkg)

Content Packages

Content PKG Keys

See Keys#Content_PKG_Keys.

Debug and Retail v1.0 (not the actual ones) PS VITA Game Package files (.pkg) can be decrypted & extracted using the "PS VITA .pkg xTractor"

Structure

A picture showing the unpacked game .pkg structure: PKGdirstruct.png

See also: System_File_Object_(SFO)_(PSF), Keys and PKG type

PSN

Game Update

It is a bit upgraded but basicly the same as on PS3. Once a game tab is opened, the VITA downloads a PKG for this game tab. This includes update information, such as if an update if available. If thats the case, the game tab will show you a yellow arrow on the top of the screen which gives you information about the update available. This information is stored in XML's which are gathered via URL's like this example one:

 http://gs.ww.np.dl.playstation.net/ppkg/np/PCSG00001/PCSG00001_T1/0101/c653f481544f8b19/changeinfo.xml

this is the content:

<?xml version="1.0" encoding="UTF-8"?>
<changeinfo titleid="PCSG00001">
  <changes app_ver="01.01">
    <![CDATA[
オンライン仕様に関わる動作の安定性を向上しました
    ]]>
  </changes>
</changeinfo>

This is the original update PKG.

 http://gs.ww.np.dl.playstation.net/ppkg/np/PCSG00001/PCSG00001_T1/c653f481544f8b19/JP0700-PCSG00001_00-RIDGERACERPSVITA-A0101-V0100-fd9baf01343b2db6df0d434b17ef822a9699c6da-PE.pkg 

original link(SKFU BLOG)

the update is stored with the XML.

 http://gs.ww.np.dl.playstation.net/ppkg/np/[TITLE_ID]/[TITLE_ID]_T1/[Version]/[An HASH]/changeinfo.xml


Package Installer uses SceNpDrm to decrypt/extract the game package into a temporary directory. Then it calls ScePromoterUtil NID 0x86641BC6 on 1.69 and NID 0x716C81F4 on 1.80+ to "promote" (aka install) the files into the right directory in ux0. ScePromoterUtil is just a wrapper for a SceShellSvc call, so SceShell actually moves the files, then adds the LiveArea bubble and updates app.db accordingly. In theory you can use SceNpDrm and ScePromoterUtil separately and package your games in an alternative format.


System Packages

PSVita Firmware Package files (.pkg) are inside PS VITA Update Files (.pup).

Those packages can not be decrypted, yet.

Structure

Bytes are in Little Endian.

typedef struct {
    unint32_t type;          /*type of pkg. must be 0x3 (Offset 0x04)*/
    unint64_t unknown;       /*unknown but static       (Offset 0x08)*/
    unint64_t hdr_size;      /*header size              (Offset 0x10)*/
    unint64_t content_size;  /*package content size     (Offset 0x18)*/
    unint64_t size;          /*package size             (Offset 0x20)*/
} s_pkg;