Editing PKG files

Jump to navigation Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
See also {{talk}} page, [https://wiki.henkaku.xyz/vita/Packages PS Vita PKG files on henkaku wiki], [https://www.psdevwiki.com/ps5/PKG_files PS4 PKG files], [https://www.psdevwiki.com/ps5/PKG_files PS5 PKG files], [[PKG_DIGEST.DAT]], [https://psdevwiki.com/vita/index.php?title=System_File_Object_(SFO)_(PSF)].
See also {{talk}} page, [http://www.psdevwiki.com/ps4/PKG_files PS4 PKG], [[PKG_DIGEST.DAT]], [https://playstationdev.wiki/psvitadevwiki/index.php?title=System_File_Object_(SFO)_(PSF)].


There are two kinds of SCE package files (.pkg):
There are two kinds of SCE package files (.pkg):
* System Software Update Packages (.pkg), which are [[Certified File]]s containing patch files for some hardware or software components of the console,
* NPDRM Packages (.pkg), which can be either release or debug, that contain files for a specific game or application.


= System Software Update Packages =
1. Content Packages (.pkg)


System Software Update files are packed into .pkg files then encrypted into .spkg, a sort of [[Certified File]].
2. System Update Packages (.pkg)


A System Update package contains 3 segments:
= System Update Packages =
 
System Update packages are encrypted into .spkg, a sort of [[Certified File]].
 
Contains 3 segments:
  1) update_package_header
  1) update_package_header
  2) update_package_contents_header
  2) update_package_contents_header
  3) update_package itself
  3) update_package itself


= NPDRM Packages =
= Game Packages =
All game packages are signed with the ECDSA signature. The public key for it can be found in '''download_plugin.prx''' or in '''nas_plugin.prx''' (this also applies to NPDRM SELFs). Usually game packages are signed with two signatures - one for the header and the other for the entry table.


== Security ==
== Security ==


The security of .pkg consists in some hashes and signatures.
The security of .pkg consists in some hashes and signatures.
All NPDRM packages are signed with an ECDSA signature. Usually NPDRM packages are signed with two signatures - one for the header and the other for the entry table.


PS3: file SHA-1 + QA digest + ECDSA signature.
PS3: file SHA-1 + QA digest + ECDSA signature.
Line 26: Line 27:
PSP: PS3 securities + Extended Header (3 [[PKG_files#PKG_HMAC_algorithm|PKG HMAC]] hashes of the headers).
PSP: PS3 securities + Extended Header (3 [[PKG_files#PKG_HMAC_algorithm|PKG HMAC]] hashes of the headers).


PS Vita: PSP securities + more Metadata (0xD-0x12) that embed digests of files embedded into the .pkg.
PSVita: PSP securities + more Metadata (0xD-0x12) that embed digests of files embedded into the .pkg.


=== PKG Digest ===
=== 0x40 digest ===


See [[Keys#NPDRM_PKG.2FSELF_ECDSA_Public_Key]].
See [[Keys#GPKG.2FSELF_ECDSA_signature]].


{| class="wikitable"
{| class="wikitable"
Line 36: Line 37:
! Name !! Offset !! Size !! Remark
! Name !! Offset !! Size !! Remark
|-
|-
| cmac_hash || 0x0 || 0x10 || AES-CMAC hash. Using always npdrm_pkg_ps3_aes_key / npdrm_pkg_ps3_idu_aes_key, whatever the platform is.
| cmac_hash || 0x0 || 0x10 || CMAC OMAC hash. PS3 gpkg_key used as key.
|-
|-
| npdrm_signature || 0x10 || 0x28 || PKG header NPDRM ECDSA signature (R_sig, S_sig).
| npdrm_signature || 0x10 || 0x28 || PKG header NPDRM ECDSA (R_sig, S_sig)
|-
|-
| sha1_hash || 0x38 || 0x8 || Last 8 bytes of sha1 hash.
| sha1_hash || 0x38 || 0x8 || last 8 bytes of sha1 hash
|}
|}


<source lang="C">
<source lang="C">
   typedef struct pkg_digest { // size is 0x40
   typedef struct { // size is 0x40
     u8 cmac_hash[0x10];
     u8 cmac_hash[0x10];
     u8 npdrm_signature[0x28];
     u8 npdrm_signature[0x28];
     u8 sha1_hash[0x8];
     u8 sha1_hash[0x8];
   } pkg_digest;
   } digest;
</source>
</source>


Line 89: Line 90:
=== Decryption ===
=== Decryption ===


See also [[#Package_Tools]] and [[Keys#NPDRM PKG AES Keys]].
See also [[#Package_Tools]] and [[Keys#GPKG_AES_key]].


==== Finalized Packages ====
==== Finalized Packages ====


Finalized (retail) packages are encrypted using AES128CTR with a key derived from a constant key (NPDRM PKG AES key).
Finalized (retail) packages are encrypted using AES128CTR with a key derived from a constant key (GPKG AES key).


===== PS3 / PSP Finalized Packages =====
===== PS3 / PSP =====


For PS3 / PSP NPDRM packages, the file table and the data are AES128CTR encrypted/decrypted using pkg_data_riv as the IV along with the PS3/PSP constant AES Key.
For PS3 / PSP packages, the file table and the data is AES128CTR encrypted/decrypted using pkg_data_riv as the IV along with the PS3/PSP constant AES Key.


<source lang="C">
<source lang="C">
static void decrypt_finalized_npdrm_pkg(void) {
static void decrypt_finalized_pkg(void) {
u8 key[0x10];
u8 key[0x10];
u8 iv[0x10];
u8 iv[0x10];
Line 107: Line 108:
fail("invalid pkg type: %x", be16(pkg + 0x06));
fail("invalid pkg type: %x", be16(pkg + 0x06));


if (key_get_simple("npdrm-pkg-key", key, 0x10) < 0)
if (key_get_simple("gpkg-key", key, 0x10) < 0)
fail("failed to load the package key.");
fail("failed to load the package key.");


Line 115: Line 116:
</source>
</source>


===== PS Vita / PSM Finalized Packages =====
===== PSVita / PSM =====


For PS Vita / PSM NPDRM packages type 2, 3 and 4, pkg_data_riv is AES128ECB encrypted with the constant per-platform AES128 key to create an AES session key. Then it does the normal AES128CTR with pkg_data_riv as the IV and the session key as the AES128CTR key.
For PSVita / PSM packages type 2, 3 and 4, pkg_data_riv is AES128CTR encrypted to create an AES session key. Then do the normal AES128CTR with pkg_data_riv as the IV and the session key as the AES128CTR key.


<source lang="C">
<source lang="C">
// Source code to add here
// Source code to add
</source>
</source>


Line 130: Line 131:


<source lang="C">
<source lang="C">
static void decrypt_non_finalized_npdrm_pkg(void) {
static void decrypt_non_finalized_pkg(void) {
u8 key[0x40];
u8 key[0x40];
u8 bfr[0x1c];
u8 bfr[0x1c];
Line 136: Line 137:


memset(key, 0, sizeof key);
memset(key, 0, sizeof key);
memcpy(key, pkg->pkg_header_digest, 8);
memcpy(key, pkg->digest, 8);
memcpy(key + 0x08, pkg->pkg_header_digest, 8);
memcpy(key + 0x08, pkg->digest, 8);
if (isArcade)
if (isArcade)
memcpy(key + 0x10, pkg->pkg_header_digest, 8);
memcpy(key + 0x10, pkg->digest, 8);
else
else
memcpy(key + 0x10, pkg->pkg_header_digest + 0x08, 8);
memcpy(key + 0x10, pkg->digest + 0x08, 8);
memcpy(key + 0x18, pkg->pkg_header_digest + 0x08, 8);
memcpy(key + 0x18, pkg->digest + 0x08, 8);
if (isArcade)
if (isArcade)
memset(key + 0x20, 0xA0, 0x18);
memset(key + 0x20, 0xA0, 0x18);
Line 162: Line 163:
== File Header ==
== File Header ==


Header consists of main header that points to metadata header. PSP and PS Vita .pkg also have .ext header right after main header.
Header consists of main header that points to metadata header. PSP and PSVita .pkg also have .ext header right after main header.


=== Example from a finalized PS3 .pkg ===
=== Example from a finalized PS3 .pkg ===
Line 193: Line 194:
| <span style="background-color:#008000; color:#FFFFFF;">pkg_revision || 0x04 || 0x02 || 80 00 || 80 00 for finalized (retail), 00 00 for non finalized (debug)
| <span style="background-color:#008000; color:#FFFFFF;">pkg_revision || 0x04 || 0x02 || 80 00 || 80 00 for finalized (retail), 00 00 for non finalized (debug)
|-
|-
| <span style="background-color:#3F48CC; color:#FFFFFF;">pkg_type    || 0x06 || 0x02 || 00 01 || 00 01 for PS3, 00 02 for PSP and PS Vita
| <span style="background-color:#3F48CC; color:#FFFFFF;">pkg_type    || 0x06 || 0x02 || 00 01 || 00 01 for PS3, 00 02 for PSP and PSVita
|-
|-
| <span style="background-color:#B5E61D;">pkg_metadata_offset        || 0x08 || 0x04 || 00 00 00 C0 || usually 0xC0 for PS3, usually 0x280 for PSP and PS Vita
| <span style="background-color:#B5E61D;">pkg_metadata_offset        || 0x08 || 0x04 || 00 00 00 C0 || usually 0xC0 for PS3, usually 0x280 for PSP and PSVita
|-
|-
| <span style="background-color:#B97A57;">pkg_metadata_count          || 0x0C || 0x04 || 00 00 00 08 || metadata item count
| <span style="background-color:#B97A57;">pkg_metadata_count          || 0x0C || 0x04 || 00 00 00 08 || metadata item count
|-
|-
| <span style="background-color:#ff7f27;">pkg_metadata_size          || 0x10 || 0x04 || 00 00 00 C0 || usually 0xC0 for PSP and PS3, usually 0x160 for PS Vita
| <span style="background-color:#ff7f27;">pkg_metadata_size          || 0x10 || 0x04 || 00 00 00 C0 || usually 0xC0 for PSP and PS3, usually 0x160 for PSVita
|-
|-
| <span style="background-color:#fff200;">item_count        || 0x14 || 0x04 || 00 00 00 02 || files and folders into the encrypted data
| <span style="background-color:#fff200;">item_count        || 0x14 || 0x04 || 00 00 00 02 || files and folders into the encrypted data
Line 215: Line 216:
| <span style="background-color:#000000; color:#ffffff;">digest || 0x60 || 0x10 || 09 8B A2 CA 2D 30 30 1F 8B 5B 82 79 C6 70 35 F3 || sha1 from debug files and attributes together merged in one block
| <span style="background-color:#000000; color:#ffffff;">digest || 0x60 || 0x10 || 09 8B A2 CA 2D 30 30 1F 8B 5B 82 79 C6 70 35 F3 || sha1 from debug files and attributes together merged in one block
|-
|-
| <span style="background-color:#ed1c24;">pkg_data_riv          || 0x70 || 0x10 || D5 FA 15 9E 7F AC 82 70 BB 3E 0C EB 97 3D 30 11 || AES-128-CTR IV. Used with npdrm_pkg_PLATFORM_aes_key to decrypt data.
| <span style="background-color:#ed1c24;">pkg_data_riv          || 0x70 || 0x10 || D5 FA 15 9E 7F AC 82 70 BB 3E 0C EB 97 3D 30 11 || aes-128-ctr IV. Used with gpkg_aes_key to decrypt data.
|-
| <span style="background-color:#808000;">header_cmac_hash      || 0x80 || 0x10 || 48 0D 86 60 9F 26 8E 7F 4F B4 DA A4 33 1E 9A A1 || CMAC OMAC hash from 0x00-0x7F. PS3 gpkg_key used as key.
|-
|-
| <span style="background-color:#808000;">pkg_header_digest     || 0x80 || 0x40 || || PKG Digest structure signing data at 0x00-0x7F.
| <span style="background-color:#3f48cc; color:#FFFFFF;">header_npdrm_signature || 0x90 || 0x28 || || PKG header NPDRM ECDSA (R_sig, S_sig)
|-
| <span style="background-color:#a349a4; color:#FFFFFF;">header_sha1_hash     || 0xB8 || 0x08 || EC 61 40 39 A6 5B DC BD || last 8 bytes of sha1 hash of 0x00-0x7F
|}
|}


Line 235: Line 240:
     u8 digest[0x10];
     u8 digest[0x10];
     u8 pkg_data_riv[0x10];
     u8 pkg_data_riv[0x10];
     pkg_digest pkg_header_digest;
     u8 header_cmac_hash[0x10];
    u8 header_npdrm_signature[0x28];
    u8 header_sha1_hash[0x8];
   } PKG_HEADER;
   } PKG_HEADER;
</source>
</source>
Line 241: Line 248:
=== Extended Header ===
=== Extended Header ===


Not present on PS3 .pkg. Only present on PSP and PS Vita .pkg. It was certainly a security improvement implemented in PS Vita Pkg Installer.
Not present on PS3 .pkg. Only present on PSP and PSVita .pkg. It was certainly a security improvement implemented in PSVita Pkg Installer.


HMAC pointed by this header are generated using [[PKG_files#PKG_HMAC_algorithm|PKG HMAC algorithm]].
HMAC pointed by this header are generated using [[PKG_files#PKG_HMAC_algorithm|PKG HMAC algorithm]].
Line 248: Line 255:
   typedef struct {
   typedef struct {
     u32 magic;                            // 0x7F657874 (".ext")
     u32 magic;                            // 0x7F657874 (".ext")
     u32 unknown_1;                        // Maybe version. Always 1.
     u32 unknown_1;                        // Maybe version. always 1
     u32 ext_hdr_size;                      // Extended header size. ex: 0x40
     u32 ext_hdr_size;                      // Extended header size. ex: 0x40
     u32 ext_data_size;                    // ex: 0x180
     u32 ext_data_size;                    // ex: 0x180
     u32 main_and_ext_headers_hmac_offset;  // ex: 0x100
     u32 main_and_ext_headers_hmac_offset;  // ex: 0x100
     u32 metadata_header_hmac_offset;      // ex: 0x360, 0x390, 0x490  
     u32 metadata_header_hmac_offset;      // ex: 0x360, 0x390, 0x490  
     u64 tail_offset;                      // Tail size seems to be always 0x1A0
     u64 tail_offset;                      // tail size seams to be always 0x1A0
     u32 padding1;
     u32 padding1;
     u32 pkg_key_id;                        // Id of the AES key used for decryption. PSP = 0x1, PS Vita = 0xC0000002, PSM = 0xC0000004
     u32 pkg_key_id;                        // Id of the AES key used for decryption. PSP = 0x1, PSVita = 0xC0000002, PSM = 0xC0000004
     u32 full_header_hmac_offset;          // ex: none (old pkg): 0, 0x930
     u32 full_header_hmac_offset;          // ex: none (old pkg): 0, 0x930
     u8 padding2[0x14];
     u8 padding2[0x14];
Line 273: Line 280:
   } ...
   } ...
   // u8 padding[variable];
   // u8 padding[variable];
   pkg_digest pkg_metadata_digest; // [[PKG_files#PKG_digest]]
   u8 digest[0x40]; // [[PKG_files#0x40_digest]]
   } PKG_METADATA;
   } PKG_METADATA;
</source>
</source>
Line 280: Line 287:
! Identifier !! PKG type !! Category name !! Possible size !! Possible values
! Identifier !! PKG type !! Category name !! Possible size !! Possible values
|-
|-
|0x1 || All || [[NPDRM#DRM_Type|DRMType]] || 4 || See [[NPDRM#DRM_Type|DRMType]].
|0x1 || All || DRM Type || 4 || 0/5/6/7/8/9/0xA/0xB/0xC (unknown), 0x1 (network), 0x2 (local), 0x3 (DRMfree no license), 0x4 (PSP), 0xD (DRMfree with license), 0xE (PSM)
|-
|-
|0x2 || All || [[PKG_files#ContentType|ContentType]] || 4 || 00 00 00 07
|0x2 || All || [[PKG_files#ContentType|ContentType]] || 4 || 00 00 00 07
|-
|-
|0x3 || All || [[PKG_files#PackageType|PackageType]] / [[PKG_files#PackageFlag|PackageFlag]] / [[PKG_files#StorageType|StorageType]] (PS Vita) || 4 ||
|0x3 || All || [[PKG_files#PackageType|PackageType]] / [[PKG_files#PackageFlag|PackageFlag]] / [[PKG_files#StorageType|StorageType]] (PSVita) || 4 ||
|-
|-
|0x4 || All || Package Size || 8 || 00 00 00 00 0E 77 40 00
|0x4 || All || Package Size || 8 || 00 00 00 00 0E 77 40 00
Line 292: Line 299:
|0x6 || PSP || Version + App Version / [[TitleID]] (on size 0xC) || 0xC || "NPEG00005\0\0\0"
|0x6 || PSP || Version + App Version / [[TitleID]] (on size 0xC) || 0xC || "NPEG00005\0\0\0"
|-
|-
|0x7 || PSP, PS3 and PS Vita before rev 1949 || QA Digest (described as "This is a digest of packaged files and attributes.") || 0x18 || 00 00 00 00 00 00 00 00 B5 76 E1 D9 00 EE 9B BC 8E 24 17 91 5D BC 5A CB
|0x7 || PSP and PS3 || QA Digest (described as "This is a digest of packaged files and attributes.")|| 0x18 || 00 00 00 00 00 00 00 00 B5 76 E1 D9 00 EE 9B BC 8E 24 17 91 5D BC 5A CB
|-
|-
|0x8 || All || unk (1 byte) + PS3/PSP/PSP2 System Version (3 bytes) + Package Version (2 bytes) + App Version (2 bytes) || 8 || 00 00 00 00 00 00 00 00, 00 00 00 00 01 00 01 00, 44 01 70 00 01 01 00 00, 81 01 90 00 01 00 01 00, 81 04 75 00 01 02 01 00 (4.7500, 1.02, 1.00) --> unk: 44 maybe PSP and 02/80/81 PS3
|0x8 || All || unk (1 byte) + PS3/PSP/PSP2 System Version (3 bytes) + Package Version (2 bytes) + App Version (2 bytes) || 8 || 00 00 00 00 00 00 00 00, 00 00 00 00 01 00 01 00, 44 01 70 00 01 01 00 00, 81 01 90 00 01 00 01 00, 81 04 75 00 01 02 01 00 (4.7500, 1.02, 1.00) --> unk: 44 maybe PSP and 02/80/81 PS3
Line 304: Line 311:
|0xC || All || unk ||  ||
|0xC || All || unk ||  ||
|-
|-
|0xD || PS Vita || [[PKG_files#PKG Item Record|Item Entries+Names Info]] || 0x28 || Offset in encrypted data (4 Bytes) + Size (4 Bytes) + SHA256 of decrypted data (32 Bytes)<br /> 00 00 00 00 / 00 00 05 A0 / 18 8B B1 8A E5 E8 40 FD EE 71 E2 27 60 55 E6 39 06 94 5B 65 89 04 B2 88 61 DA BB A3 B2 55 C5 C1
|0xD || PSVita || [[PKG_files#PKG Item Record|Item Entries+Names Info]] || 0x28 || Offset in encrypted data (4 Bytes) + Size (4 Bytes) + SHA256 of decrypted data (32 Bytes)<br /> 00 00 00 00 / 00 00 05 A0 / 18 8B B1 8A E5 E8 40 FD EE 71 E2 27 60 55 E6 39 06 94 5B 65 89 04 B2 88 61 DA BB A3 B2 55 C5 C1
|-
|-
|0xE || PS Vita || [[PKG_files#sfo_info|PARAM.SFO Info]] || 0x38 || Offset (4 Bytes) + Size (4 Bytes)  + Flags? (4 Bytes)  + Firmware (?4 Bytes?) + Unknown (?8 Bytes?) + SHA256 (32 Bytes)<br />00 00 0C 10 / 00 00 05 0C / 00 00 00 14 / 01 67 00 00 / 00 00 00 00 00 00 00 00 / FC 3D 1E 32 FA F7 A6 11 90 46 A6 34 BE 98 9A 78 65 A8 92 25 3C 49 D7 69 73 53 32 E7 8E 06 1E 60
|0xE || PSVita || [[PKG_files#sfo_info|PARAM.SFO Info]] || 0x38 || Offset (4 Bytes) + Size (4 Bytes)  + Flags? (4 Bytes)  + Firmware (?4 Bytes?) + Unknown (?8 Bytes?) + SHA256 (32 Bytes)<br />00 00 0C 10 / 00 00 05 0C / 00 00 00 14 / 01 67 00 00 / 00 00 00 00 00 00 00 00 / FC 3D 1E 32 FA F7 A6 11 90 46 A6 34 BE 98 9A 78 65 A8 92 25 3C 49 D7 69 73 53 32 E7 8E 06 1E 60
|-
|-
|0xF || PS Vita || [[PKG_files#unknown_data_info|unknown_data_info]] || 0x48 || 00 00 05 60 00 00 03 20 00 00 00 00 00 00 00 00 00 00 00 00 01 01 01 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 27 0F 26 BD 5C 2F 13 95 EB 16 E6 62 07 8D 9A E3 DC 0B AC 25 11 1C 19 39 B9 40 06 4E 82 AF 1E C3
|0xF || PSVita || [[PKG_files#unknown_data_info|unknown_data_info]] || 0x48 || 00 00 05 60 00 00 03 20 00 00 00 00 00 00 00 00 00 00 00 00 01 01 01 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 27 0F 26 BD 5C 2F 13 95 EB 16 E6 62 07 8D 9A E3 DC 0B AC 25 11 1C 19 39 B9 40 06 4E 82 AF 1E C3
00 00 06 10 00 00 03 20 00 00 01 F4 00 00 01 F7 00 00 00 00 01 01 01 01 A5 74 D5 71 00 03 00 01 00 00 00 00 00 00 00 00 79 52 B2 3F 78 3B 9D F4 C0 BB 26 C0 EC 14 1B 37 8B 9B 69 71 1C 22 C3 49 57 97 B6 DE 78 0A D0 00
00 00 06 10 00 00 03 20 00 00 01 F4 00 00 01 F7 00 00 00 00 01 01 01 01 A5 74 D5 71 00 03 00 01 00 00 00 00 00 00 00 00 79 52 B2 3F 78 3B 9D F4 C0 BB 26 C0 EC 14 1B 37 8B 9B 69 71 1C 22 C3 49 57 97 B6 DE 78 0A D0 00
|-
|-
|0x10 || PS Vita || [[PKG_files#entirety_info|Entirety Info]] || 0x38 || 00 00 0A 00 00 00 00 A0 D3 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 4D AD EB 44 67 51 C1 2D 69 95 46 8C 82 A9 3D 74 AD F4 62 49 90 BD EE F0 75 97 A3 B6 5B 17 48
|0x10 || PSVita || [[PKG_files#entirety_info|Entirety Info]] || 0x38 || 00 00 0A 00 00 00 00 A0 D3 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 4D AD EB 44 67 51 C1 2D 69 95 46 8C 82 A9 3D 74 AD F4 62 49 90 BD EE F0 75 97 A3 B6 5B 17 48
00 00 0A B0 00 00 01 60 FF D0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 D2 7F 9E EF 38 F7 61 6E C1 C5 CC B1 E1 83 12 0C 6F 38 4C 8C 22 84 8B A4 3B 7B 47 57 77 C9 F9 C9
00 00 0A B0 00 00 01 60 FF D0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 D2 7F 9E EF 38 F7 61 6E C1 C5 CC B1 E1 83 12 0C 6F 38 4C 8C 22 84 8B A4 3B 7B 47 57 77 C9 F9 C9
|-
|-
|0x11 || PS Vita || PublishingTools version (4 Bytes) + PFSBuilder version (4 Bytes) + padding (0x20 Bytes) || 0x28 || 01 60 00 00 00 06 23 47 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|0x11 || PSVita || PublishingTools version (4 Bytes) + PFSBuilder version (4 Bytes) + padding (0x20 Bytes) || 0x28 || 01 60 00 00 00 06 23 47 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02 07 00 00 00 07 60 74 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
02 07 00 00 00 07 60 74 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|-
|-
|0x12 || PS Vita || [[PKG_files#self_info|self_info]] || 0x38 || 00 00 11 20 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 CF 74 D5 30 04 99 F0 57 E8 65 20 5C 3D 71 12 36 F1 E4 EF BC 98 EA 52 F1 F0 60 E8 7C 8A 53 B8 A4
|0x12 || PSVita || [[PKG_files#self_info|self_info]] || 0x38 || 00 00 11 20 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 CF 74 D5 30 04 99 F0 57 E8 65 20 5C 3D 71 12 36 F1 E4 EF BC 98 EA 52 F1 F0 60 E8 7C 8A 53 B8 A4
|}
|}


Line 323: Line 330:


{| class="wikitable"
{| class="wikitable"
! Content type !! Type name !! Install path (on PS3) !! Install path (on PS Vita) !! Notes
! content type !! type name !! install path (on PS3) !! install path (on PSVita) !! notes
|-
|-
|0x1 || ? || /dev_hdd0/game/ || || Found in UP0700-NPUJ00213_00-0000000000000002 (so old that it does not embed make_package_npdrm revision)
|0x1 || ? || /dev_hdd0/game/ || || Found in UP0700-NPUJ00213_00-0000000000000002 (so old that it doesn't embed make_package_npdrm revision)
|-
|-
|0x2 ||  || ||  ||
|0x2 ||  || ||  ||
Line 331: Line 338:
|0x3 ||  || ||  ||
|0x3 ||  || ||  ||
|-
|-
|0x4 || GameData || /dev_hdd0/game/ || || Also concerns game patches.
|0x4 || GameData (also patches) || /dev_hdd0/game/ || ||
|-
|-
|0x5 || GameExec || /dev_hdd0/game/ || ||
|0x5 || GameExec || /dev_hdd0/game/ || ||
Line 337: Line 344:
|0x6 || PS1emu || /dev_hdd0/game/ || ux0:pspemu/PSP/GAME/ ||
|0x6 || PS1emu || /dev_hdd0/game/ || ux0:pspemu/PSP/GAME/ ||
|-
|-
|0x7 || PSP || /dev_hdd0/game/ || ux0:pspemu/PSP/GAME/ || Also concerns PCEngine.
|0x7 || PSP & PCEngine || /dev_hdd0/game/ || ?ux0:pspemu/PSP/GAME/? ||
|-
|-
|0x8 ||  || ||  ||
|0x8 ||  || ||  ||
Line 353: Line 360:
|0xE || PSPgo || /dev_hdd0/game/ || || Displayed as Unknown Album: Corrupted Data
|0xE || PSPgo || /dev_hdd0/game/ || || Displayed as Unknown Album: Corrupted Data
|-
|-
|0xF || minis || /dev_hdd0/game/ || ux0:pspemu/PSP/GAME/ ||
|0xF || Minis || /dev_hdd0/game/ || ux0:pspemu/PSP/GAME/ ||
|-
|-
|0x10 || NEOGEO || /dev_hdd0/game/ || ux0:pspemu/PSP/GAME/ ||
|0x10 || NEOGEO || /dev_hdd0/game/ || ux0:pspemu/PSP/GAME/ ||
Line 365: Line 372:
|0x14 || Seen on PSP remastered || /dev_hdd0/game/ || ||
|0x14 || Seen on PSP remastered || /dev_hdd0/game/ || ||
|-
|-
|0x15 || PSP2GD (PS Vita Game Data) || e.g. dev_bdvd/PS3_GAME/CROSSDIR/DATA000.PKG || ux0:app/ || e.g. PS3 Cross controller, PS VITA gd/gdc games/apps
|0x15 || PSP2GD (PSVita Game Data) || e.g. dev_bdvd/PS3_GAME/CROSSDIR/DATA000.PKG || ux0:app/ || e.g. PS3 Cross controller, PS VITA gd/gdc games/apps
|-
|-
|0x16 || PSP2AC (PS Vita Additional Content) || || ux0:addcont/ ||
|0x16 || PSP2AC (PSVita Additional Content) || || ux0:addcont/ ||
|-
|-
|0x17 || PSP2LA (PS Vita LiveArea) || || ux0:appmeta/ ||
|0x17 || PSP2LA (PSVita LiveArea) || || ?ux0:livearea/? ||
|-
|-
|0x18 || PSM (PS Vita PSM) || || ux0:psm/ || [https://www.playstation.com/en-ca/explore/playstation-mobile/ PlayStation Mobile]
|0x18 || ?PSM? (PSVita PSM) || || ux0:psm/ || [https://www.playstation.com/en-ca/explore/playstation-mobile/ PlayStation Mobile]
|-
|-
|0x19 || WT || /dev_hdd0/game/ || || Probably Web TV.
|0x19 || WT (?Web TV?) || /dev_hdd0/game/ || ||
|-
|-
|0x1D || PSM for Unity (PS Vita PSM) || ux0:psm/ || contains 'runtime/' folder. ||
|0x1D || ?PSM? (PSVita PSM) || || ||
|-
|-
|0x1F || PSP2Theme (PS Vita Theme) || || ux0:theme/ ||
|0x1F || PSP2Theme (PSVita Theme) || || ux0:theme/ ||
|}
|}


Line 385: Line 392:
! Identifier !! type name !! usage !! notes
! Identifier !! type name !! usage !! notes
|-
|-
| 0x10 || Patch || for PSP game updates, to use with CumulativePatch, IncrementalPatch, HybridPatch ||
| 4th byte, bit: xxx1 xxxx, ex: 00 00 00 1E (+CumulativePatch), 00 00 20 1E (+VC-MC+CumulativePatch) || Patch || for PSP game updates, to use with CumulativePatch, IncrementalPatch, HybridPatch ||
|-
|-
| DiscBinded + Game + Patch || DiscGamePatch || for PS3 BD games ||
| ex: 00 00 08 5A (+RenameDirectory) || DiscGamePatch || for PS3 BD games ||
|-
|-
| Game + Patch || HDDGamePatch || for PS3 HDD games (NPDRM) ||
| 4th byte, bit: xxx1 xxxx, ex: 00 00 00 5E (+Finalized+RenameDirectory) || HDDGamePatch || for PS3 HDD games (NPDRM) ||
|-
|-
| ?when 2 is not set? || NoEBOOTBIN ||  ||
| unk || NoEBOOTBIN ||  ||
|-
|-
| ex: 00 00 00 0A || Demo ||  ||
| 4th byte, bit: xxxx 1x1x, ex: 00 00 00 4A (+RenameDirectory) || Demo ||  ||
|-
|-
| ex: 00 00 00 0C || Key ||  ||
| 4th byte, bit: xxxx 11xx, ex: 00 00 00 0C || Key ||  ||
|-
|-
| ? || Upgradable ||  ||
| ex: 00 00 30 1E (+VC-MC+CumulativePatch+Patch) || Upgradable ||  ||
|}
|}
To class in PackageType or PackageFlag : DiscBinded


=== PackageFlag ===
=== PackageFlag ===


{| class="wikitable"
{| class="wikitable"
! Flag !! Name !! Usage !! Notes
! Identifier !! type name !! usage !! notes
|-
|-
| 0 || NO FLAGS ||  || It exists e.g. in IP9100-NPIA00001_00-PS2HDDSYSDAT0001 built with revision 960 (very old)!
| ex: 00 00 00 00 || NO FLAGS ||  || yes it exists, it was found in IP9100-NPIA00001_00-PS2HDDSYSDAT0001 that was builded with revision 960 (very old) !!!
or even in UP0700-NPUJ00213_00-0000000000000002 (so old that it does not embed make_package_npdrm revision).
or even UP0700-NPUJ00213_00-0000000000000002 (so old that it doesn't embed make_package_npdrm revision)
|-
|-
| 0x2 || ?EBOOT? ||  || Minis have it.
| 4rd byte, bit: x1xx xxxx, ex: 00 00 00 4E, 00 00 00 5E || RenameDirectory ||  ||
|-
|-
| 0x4 || ?Require License? ||  ||  
| when RenameDirectory flag is not set (default), ex: 00 00 00 0E || NoRenameDirectory ||  ||
|-
|-
| 0x8 || ?HDD/MC? ||  || NON Finalized flagged PS3 package (DLC)
| 4rd byte, bit: xxxx x11x, ex: 00 00 00 0E, 00 00 00 1E, 00 00 00 4E, 00 00 00 5E, warning: don't mistake with the finalized flag in main header || Finalized ||  || PS1 and PSP games have not this flag: 00 00 02 0C, PS3 game that has not this flag : 00 00 00 08
|-
|-
| 0x10 || CumulativePatch || Embeds the previous patches || To use with Patch PackageType.
| ex: 00 00 00 08 || NON Finalized flaged PS3 package (DLC) || ||
|-
|-
| ? || IncrementalPatch || Requires the previous patches to be installed first || To use with Patch PackageType.
| ex: 00 00 02 0C, 00 00 02 1C (+Patch) || NON Finalized flaged package (all PS1 and PSP packages) || ||
|-
|-
| ? || HybridPatch ||  || To use with Patch PackageType.
| ex: 00 00 02 4E (+RenameDirectory) || NON Finalized flaged minis package  ||  ||
|-
|-
| 0x40 || RenameDirectory || ||
| ex: 00 00 04 8C || Theme (.p3t.edat) / License package (.edat) || -> ????noEBOOOT?????? ||
|-
|-
| When 0x40 is not set (default) || NoRenameDirectory ||  ||
| ex: 00 00 04 0C || VSH Module package (PS3 only) ||  ||
|-
|-
| 0x80 || ?EDAT? || || Theme (.p3t.edat) / License package (.edat)
| 4rd byte, bit: xxxx ?111x?, ex: 00 00 20 1E, 00 00 00 1E || CumulativePatch || Embeds the previous patches || to use with Patch PackageType
|-
|-
| 0x200 || ?Emulator? || || All PS1 and PSP packages, minis.
| unk || IncrementalPatch || Requires the previous patches to be installed first || to use with Patch PackageType
|-
|-
| 0x400 || VSH Module ||  || PS3 only.
| unk || HybridPatch ||  || to use with Patch PackageType
|-
|-
| 0x800 || DiscBinded ||  || PS3 only.
| 3rd byte, bit: x1xx xxxx, ex: 00 00 40 0E || NonGame || used for most of PSVita NPDRM apps ||
|-
| 0x1000 || ? ||  ||
|-
| 0x2000 || See Storage Type. ||  ||
|-
| 0x4000 || NonGame || Used for most PS Vita NPDRM apps ||
|}
|}


=== StorageType ===
=== StorageType ===


It seems to be PS Vita only.
Seams to be PSVita only.


{| class="wikitable"
{| class="wikitable"
! Flag !! Name !! Usage !! Notes
! Identifier !! type name !! usage !! notes
|-
|-
| 8 / 4 / 2 || MC || This application can be distributed by network and installed onto memory card(MC). ||  
| 3rd byte, bit: xx1x xxxx, ex: 00 00 20 0E, 00 00 20 1E || VC-MC ||  
[VC-MC]
This application is distributed by PS Vita card(VC).
This application may be distributed by network and installed onto memory card(MC).
 
[In case of VC distribution]
The VC does NOT have rewritable(R/W) area, and Patches/Additional Contents/Save Data are stored on MC.
MC is REQUIRED to run this application.
|| There exists 2 variants : 2GB VC and 4GB VC (it is still unknown how to recognize this difference)
|-
|-
| 0x2000 || VC || This application can be distributed by PS Vita card(VC). ||
| default (when VC-MC flag is not set), ex: 00 00 00 0E, 00 00 00 1E || VC-VC || [No VC/MC-MC]
This application is NOT distributed by PS Vita card(VC).
This application is distributed by network and installed onto memory card(MC).
||
|}
|}


Line 709: Line 723:
| data_size || 0x10 || u64 ||
| data_size || 0x10 || u64 ||
|-
|-
| flags || 0x18 || u32 || The file type. Item_key_type = (flags >> 0x1C)&7 (key type 0 - ps3-aes-key, key type 1 - psp-aes-key)
| flags || 0x18 || u32 || The file type
|-
|-
| padding || 0x1C || u32 || zero
| padding || 0x1C || u32 || zero
Line 732: Line 746:
=== PKG builder / infos / extractor ===
=== PKG builder / infos / extractor ===


==== package.conf (PSP/PS3/PS Vita) ====
=== package.conf (PS3/PSVita/PSP) ===
 
Note that for convenience and backward compatibility with NPDRM.CONF, the package.conf parser (make_package_npdrm) is not case-sensitive and in some cases considers underscore as dash.


{| class="wikitable"
{| class="wikitable"
! Configuration name !! Usage !! Expected value !! Example !! Notes
! Config name !! usage !! expected value !! example
|-
| ContentID || needed || XXYYYY-XXXXYYYYY_00-XXXXXXXXXXXXXXXX || EP4153-NPEZ00314_00-0000111122223333 ||
|-
| Klicensee || needed on PS3 (can be set to 0x00000...) || 0x00000000000000000000000000000000 || 0x0123456789ABCDEF0123456789ABCDEF ||
|-
|-
| DRMType || needed || Network / Free / Local / DiscBind || Free ||
| Content_ID || needed || XXYYYY-XXXXYYYYY_00-XXXXXXXXXXXXXXXX || EP4153-NPEZ00314_00-0000111122223333
|-
|-
| ContentType || needed || See [[PKG_files#ContentType]] || minis ||
| K_licensee (PS3) || needed (can be set to 0x00000...) || 0x00000000000000000000000000000000 || 0x0123456789ABCDEF0123456789ABCDEF
|-
|-
| PackageVersion || needed || xx.yy || 01.02 ||
| DRMType || needed || Network / Free / Local || Free
|-
|-
| PackageType || || See [[PKG_files#PackageType]] || DiscGamePatch ||
| ContentType || needed || See [[PKG_files#ContentType]] || minis
|-
|-
| PackageFlag || || See [[PKG_files#PackageFlag]] || RenameDirectory ||
| PackageVersion || needed || XX.XX || 01.02
|-
|-
| StorageType || needed for PS Vita gamedata || See [[PKG_files#StorageType]] || VC-MC ||
| PackageType || || See [[PKG_files#PackageType]] || DiscGamePatch
|-
|-
| TitleID || used only for PSP and PS1 games || XXXXYYYYY || NPEZ00314 ||
| PackageFlag || || See [[PKG_files#PackageFlag]] || RenameDirectory
|-
|-
| LimitedTimeStart || || YYYY-MM-DDThh:mmTZD || 2018-10-30T11:55T32 ||
| StorageType || needed for PSVita gamedata || See [[PKG_files#StorageType]] || VC-MC
|-
|-
| LimitedTimeEnd || || YYYY-MM-DDThh:mmTZD || 2019-10-30T11:55T32 ||
| TitleID || used only for PSP and PS1 games || XXXXYYYYY || NPEZ00314
|-
|-
| InstallDirectory || used in PSP patches ?and DLCs? || ? || UCUS98744_LBPPDLCSONYPA002 ||
| LimitedTimeStart || || YYYY-MM-DDThh:mmTZD || 2018-10-30T11:55T32
|-
|-
| ForcedInstallTo || Allows installing packages to any HDD directory (and even flash memory if it is mounted RW). ||  || ||
| LimitedTimeEnd || || YYYY-MM-DDThh:mmTZD || 2019-10-30T11:55T32
|-
|-
| APP_VER || If the APP_VER value in PARAM.SFO is to be updated, set the new value in the format "xx.yy" (2 integer digits and 2 decimal digits). ||  || ||
| InstallDirectory || used in PSP patches ?and DLCs? || ? || UCUS98744_LBPPDLCSONYPA002
|-
|-
| PS3_SYSTEM_VER || If the PS3_SYSTEM_VER value in PARAM.SFO is to be updated with a patch package, set the new value in the format "xx.yyyy" (2 integer digits and 4 decimal digits). ||  || ||
| ForcedInstallTo || Allows installing packages to any hdd directory (and even flash memory if it's mounted RW). ||  ||
|}
|}


==== NPDRM.CONF (PSP) ====
=== NPDRM.CONF (PSP) ===


{| class="wikitable"
{| class="wikitable"
! Configuration name !! Usage !! Expected value !! Example !! Notes
! Config name !! usage !! expected value !! example
|-
|-
| Content-ID || needed || XXYYYY-XXXXYYYYY_00-XXXXXXXXXXXXXXXX || EP4153-NPEZ00314_00-0000111122223333 ||
| Content-ID || needed || XXYYYY-XXXXYYYYY_00-XXXXXXXXXXXXXXXX || EP4153-NPEZ00314_00-0000111122223333
|-
|-
| K-Licensee || needed (can be set to 0x00000...) || 0x00000000000000000000000000000000 || 0x0123456789ABCDEF0123456789ABCDEF ||
| K-Licensee || needed (can be set to 0x00000...) || 0x00000000000000000000000000000000 || 0x0123456789ABCDEF0123456789ABCDEF
|-
|-
| PackageVersion || needed || XX.XX || 01.02 ||
| PackageVersion || needed || XX.XX || 01.02
|-
|-
| ProtectDocument || used in PSP Downloadable Game Package (PSP .pkg)
| ProtectDocument || used in PSP Downloadable Game Package (PSP .pkg)
Line 788: Line 796:
to purchase the downloadable game package. If "ProtectDocument = FALSE" is specified or
to purchase the downloadable game package. If "ProtectDocument = FALSE" is specified or
if no specification is made, the game manual will not be protected by NPDRM.
if no specification is made, the game manual will not be protected by NPDRM.
|| FALSE/TRUE || FALSE ||
|| FALSE/TRUE || FALSE
|-
|-
| [[PKG_files#HealthWarning|HealthWarning]] || used in PSP Downloadable Game Package (PSP .pkg)
| [[PKG_files#HealthWarning|HealthWarning]] || used in PSP Downloadable Game Package (PSP .pkg)
Line 798: Line 806:
If "HealthWarning = NONE" is specified or if no specification is made, no startup warning
If "HealthWarning = NONE" is specified or if no specification is made, no startup warning
will be displayed.
will be displayed.
|| NONE/[[PKG_files#HealthWarning|specification word]] || NONE ||
|| NONE/[[PKG_files#HealthWarning|specification word]] || NONE
|-
|-
| ZIPThreshold || used in PSP Downloadable Game Package (PSP .pkg)
| ZIPThreshold || used in PSP Downloadable Game Package (PSP .pkg)
Line 810: Line 818:
download the package. Unless you specifically need to change the compression rate, do not
download the package. Unless you specifically need to change the compression rate, do not
include this specification.
include this specification.
|| 0 to 100 || 80 ||
|| 0 to 100 || 80
|-
|-
| OptimizeLevel || used in PSP Downloadable Game Package (PSP .pkg)
| OptimizeLevel || used in PSP Downloadable Game Package (PSP .pkg)
Line 821: Line 829:
When the authoring service changes, refer to details that are publically available in the
When the authoring service changes, refer to details that are publically available in the
Technical Notes.
Technical Notes.
|| ?0 to 100? || ?80? ||
|| ?0 to 100? || ?80?
|-
|-
| BootablePlatform || used in PSP minis Package (PSP minis .pkg)
| BootablePlatform || used in PSP minis Package (PSP minis .pkg)
Line 827: Line 835:
games, "BootablePlatform = minis" must be set in NPDRM.CONF that is a configuration file
games, "BootablePlatform = minis" must be set in NPDRM.CONF that is a configuration file
for packaging.
for packaging.
|| minis || minis ||
|| minis || minis
|-
|-
| BootablePlatformDetails || used in PSP minis Package (PSP minis .pkg)
| BootablePlatformDetails || used in PSP minis Package (PSP minis .pkg)
Line 835: Line 843:
"BootablePlatformDetails=onlyPSP" to NPDRM.CONF in addition to the setting
"BootablePlatformDetails=onlyPSP" to NPDRM.CONF in addition to the setting
"BootablePlatform = minis".
"BootablePlatform = minis".
|| onlyPSP || onlyPSP ||
|| onlyPSP || onlyPSP
|}
|}


==== PSP SDK official tool: make_package_npdrm (2006-2014) ====
==== PSP SDK official tool : make_package_npdrm (2006-2014) ====
 
* latest version: rev 1642 in 6.60 PSP SDK
 
==== PS3 SDK official tool: make_package_npdrm (2006-2014) ====
 
* oldest known version: rev 1061 in ?.?? PS3 SDK
* rev 1203 in 1.92 PS3 SDK
* rev 1588 in 3.00 PS3 SDK
* most famous version: rev 1732 in 3.40 PS3 SDK (also found under unofficial patched form)
* rev 1754 in 3.60 PS3 SDK
* rev 1962 in 4.00 PS3 SDK
* rev 1966 in 4.?? PS3 SDK (seen in TrueAncestor tools)
* latest version: rev 1972 in 4.75 PS3 SDK
 
<pre>
make_package_npdrm.exe --informal-help
 
usage: [revision 1972]
 
    THIS IS INFORMAL HELP. ONLY FOR INTERNAL USE! NEVER USE FOR RELEASING!
 
    make_package_npdrm [options] config-file target-directory
        -v | --verbose          increases verbose messages.
        -f | --nofindlimit      no limitation to file find.
        -o | --output DIR      output package to DIR.
        -C | --directory DIR    change to DIR before doing anything.
        --find-path PATH        set find command path to file find.
        --content-id STRING    set ContentID.
        --k-licensee HEX        set KLicensee.
        --drm-type STRING      set DRMType.
        --content-type STRING  set ContentType.
        --package-version NUM  set PackageVersion.
        --patch-for-discgame    generate patch package for DiscGame.
        --patch-for-hddgame    generate patch package for HDDGame.
        --patch-for-psstore    generate patch package for PSSTORE (pay patch).
        --force-info            overwrite content information files.
        --weak-info            no overwrite content information files.
        --force-user            overwrite user directory files.
        --weak-user            no overwrite user directory files.
 
    make_package_npdrm [options] target-directory
        generate package with 'target-directory/package.conf'.
        [options]              same as the above.
 
    make_package_npdrm [options] npdrm-package [target]
        [default]              print package informations.
        -c | --check            check package format.
        -l | --list            print [target] files/dirs information.
        -x | --extract          extract [target] files/dirs.
        --extract-tropdir      extract trophy files.
        --extract-rootdir      extract system files.
        --no-entitlement        generate debuging package.
 
    make_package_npdrm [options]
        --version              print revision.
        --help                  print help message.
        --informal-help        print this message.
</pre>
 
==== PS Vita SDK official tool: make_package_npdrm.exe (2011) ====


* oldest known version: make_package_npdrm.exe rev 1840 (2011-04-05) from PublishingTools version 0.16.0.283 in ?0.945? PS Vita SDK.
* latest version: rev 1642 from 6.60 PSP SDK
* make_package_npdrm.exe rev 1949 (2011-07-22) from PublishingTools version 0.50.0.585 in 0.996 PS Vita SDK.
* make_package_npdrm.exe rev 1957 (2011-09-14) from PublishingTools version 1.41.0.958 in ?1.00? PS Vita SDK.
* make_package_npdrm.exe rev 1962 (2011-12-02) from PublishingTools version 1.41.0.958 in ?1.50? PS Vita SDK.
* make_package_npdrm.exe rev 1963 (2011-12-26) from PublishingTools version 1.50.0.1026 in ?1.60? PS Vita SDK.


==== PS Vita SDK official tool: make_pkg.exe (2014) ====
==== PSVita SDK official tool : make_pkg (2011-2015) ====


At some point, SCE renamed make_package_npdrm to make_pkg. The reason is certainly that on PS Vita, .pkg are used for many types of contents not just NPDRM protected contents.
* latest version: rev 1972 from 3.55 PSVita SDK


* latest version: make_pkg.exe rev 1972 (2014-06-29) from PublishingTools version 2.31.0.1669 in 3.55/3.57 PS Vita SDK.
==== PS3 SDK official tool : make_package_npdrm (2006-2017) ====


<pre>
* latest version: rev 1972 from 4.75 PS3 SDK
make_pkg.exe --help
* common version: rev 1732 from 3.40 PS3 SDK (also found under patched form)
 
* oldest leaked version: rev 1061 from X.XX PS3 SDK
usage: [revision 1972]
 
    make_package_npdrm [options] config-file target-directory
        -v | --verbose          increases verbose messages.
        -f | --nofindlimit      no limitation to file find.
        -o | --output DIR      output package to DIR.
        -C | --directory DIR    change to DIR before doing anything.
        --find-path PATH        set find command path to file find.
        --content-id STRING    set ContentID.
        --k-licensee HEX        set KLicensee.
        --drm-type STRING      set DRMType.
        --content-type STRING  set ContentType.
        --package-version NUM  set PackageVersion.
</pre>


==== Make Package Npdrm Patcher (revision 1732) by SubZero Dezigns (2012) ====
==== Make Package Npdrm Patcher (revision 1732) by SubZero Dezigns (2012) ====
Line 1,022: Line 952:
==== PkgDecrypt by St4rk (2017) ====
==== PkgDecrypt by St4rk (2017) ====


PS Vita .pkg
PSVita .pkg
 
[https://github.com/st4rk/PkgDecrypt Source code]
 
==== unpkg_vita by RikuKH3 (2017) ====
 
[https://github.com/RikuKH3/unpkg_vita Source code]
 
==== PKGrip by qwikrazor87 (2018) ====
 
Fast linux alternative for decrypting PS3/PSP NPDRM PKG files.
 
[https://github.com/qwikrazor87/pkgrip Source code]


==== PSN_get_pkg_info.py by windsurfer1122 (2018-2020) ====
==== PSN_get_pkg_info.py by windsurfer1122 (2018) ====
 
[[PSN_get_pkg_info.py]] Extracts information from package file as text or JSON for further analysis.<br />
Extracts information from package file as text or JSON for further analysis.<br />
Provides Linux shell scripts for mass creation of analysis data and to quickly grep through them.<br />
Provides Linux shell scripts for mass creation of analysis data and to quickly grep through them.<br />
Analysis data of 10.000+ packages already directly downloadable [https://mega.nz/#F!cyxSVACA!Lp8VFpFz4K-DQLb221d83A here].<br />
Analysis data of 10.000+ packages already directly downloadable [https://mega.nz/#F!cyxSVACA!Lp8VFpFz4K-DQLb221d83A here].<br />
Decrypts package to an unencrypted raw package.<br />
Decrypts package to an unencrypted raw package.<br />
Planned feature is package extraction like PkgDecrypt and pkg2zip.
Planned feature is package extraction like PkgDecrypt and pkg2zip.<br />
 
PS3/PS1/PSP/PSV/PSM .pkg
 
[https://github.com/windsurfer1122/PSN_get_pkg_info Source code]


==== LibOrbisPkg by Maxton ====
PS3/PSX/PSP/PSV/PSM .pkg
 
PS4 Tool but could help to understand PFS.
 
[https://github.com/maxton/LibOrbisPkg Source code]
 
==== PS4 PFS Tool by flatz (2020) ====
 
PS4 Tool but could help to understand PFS.
 
[https://github.com/flatz/pkg_pfs_tool Source code]


== Package links ==
== Package links ==
Line 1,110: Line 1,013:
};
};
</syntaxhighlight>
</syntaxhighlight>




{{File Formats}}<noinclude>[[Category:Main]]</noinclude>
{{File Formats}}<noinclude>[[Category:Main]]</noinclude>
Please note that all contributions to PS3 Developer wiki are considered to be released under the GNU Free Documentation License 1.2 (see PS3 Developer wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following hCaptcha:

Cancel Editing help (opens in new window)