PUP

PUP files are update archives for the Vita.

PUP Header
A good resource on the PUP header can be found HERE.

Filename IDs
It is a mistake to try to connect a file entry ID to any specific file. A better way of organizing the update contents is through the extracted SCE encrypted file header. Nevertheless, there are certain file entry IDs that have been linked with the same data throughout all observed update packages.

Package Headers
Most of the files in the update PUP are SCE encrypted. Each component of the update is broken up into multiple parts, then optionally compressed, and finally encrypted into the SCE file. Right after the SCE header (usually offset 0x400) is the update package header that provides information for piecing the component back together. The contents of this header is as follows:

Flags
There are flags that are set in the package header. Some potential ones are listed here.

Type ID
The type id determines which decryption routine to use in SceSblSsUpdateMgr. There is a truth table to determine which id can be handled by which decryption function. To see how this table is used, check out the example code for decrypting packages.

Type ID (Identifier)
The type ID is also used to identify the component of the update.

PUP Update Contents
Each PUP contain updates for different partitions of the system. Most packages, once decrypted, decompressed, and pieced together are an raw disk image for the partition to update. Sometimes a TAR archive patch is also used along with the disk images but not as often. Sony usually releases three kinds of update files, each to update different components.

full
This contains the actual system files. The main components are,  , and the bootloader partition.

systemdata
Systemdata PUPs only update the  partition. It is likely separated from the main update due to it not regularly needing updates and size concerns.

preinst
Preinst PUPs only update the  partition. This is the Welcome Park application and the initial setup movie. It is likely separated from the main update because of the size.

com
Unknown.

modeldiff
Unknown.

Debug
Debug updates for PTEL-XXXX and PDEL-XXXX do not separate into different PUPs. A single PUP will update all components. Additionally updates for PDEL units contains updates for the CP and probably other development unit specific components.

SCEWM Header
This is a watermark for PUPs. For development PUPs, the Issue ID is unique to the company/organization the PUP is issued to.

The Issue ID for SCE/retail PUPs seems to be 0x5A.

SCEWM Content
The encrypted SCEWM file is composed of 3 parts:


 * SCEWM header: size 0x20 bytes.
 * RSA signature of the PUP regardless of the watermark: size 0x100 bytes.
 * SCEWM unique data per issue ID: size 0x900 bytes (may vary, check SCEWM header).

SCEWM Security
When comparing same PUP signed for two different issue IDs, we can notice only 2 differences:
 * the issue ID in SCEWM header
 * the SCEWM unique data