Editing Playstation Update Package (PUP)
Jump to navigation
Jump to search
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 5: | Line 5: | ||
== Location == | == Location == | ||
=== | === PSVita === | ||
The | The PSVita and PSVita TV OS can install the update as /PSP2/UPDATE/PSP2UPDAT.PUP or as /PSVITA/UPDATE/PSVUPDAT.PUP.<br /> | ||
The update comes from: | The update comes from: | ||
Line 23: | Line 23: | ||
* https://darksoftware.xyz/VITA/FWList | * https://darksoftware.xyz/VITA/FWList | ||
== | == Regioning == | ||
=== PS3 === | === PS3 === | ||
There is no regioning in the .PUP files, they are the same for all different regions (if you were looking for regioninfo, [http://www.ps3devwiki.com/index.php?title=SKU_Models#Regioning see here]).<br /> | |||
The PS3 however gets the [[ps3-updatelist.txt]] from different servers, depending on the region of that model (last 2 numbers in the CECHxxXX SKU name). | |||
There is no regioning in the .PUP files | |||
<ul> | <ul> | ||
Line 82: | Line 45: | ||
<li> [http://fbr01.ps3.update.playstation.net/update/ps3/list/br/ps3-updatelist.txt Brasil, br] (11 > 0x8F) | <li> [http://fbr01.ps3.update.playstation.net/update/ps3/list/br/ps3-updatelist.txt Brasil, br] (11 > 0x8F) | ||
</ul> | </ul> | ||
for completeness see [[Target ID]]: Reference Tool/DECR : 0x81, Debug/DEX : 0x82, and Arcade : 0xA0 | |||
Retail basic structure of the update URL: | Retail basic structure of the update URL: | ||
Line 94: | Line 56: | ||
Content: | Content: | ||
# JP(shop) | # JP(shop) | ||
Dest=83;CompatibleSystemSoftwareVersion=4.7600-; | Dest=83;CompatibleSystemSoftwareVersion=4.7600-; | ||
Line 130: | Line 92: | ||
Dest=8F;CompatibleSystemSoftwareVersion=4.7600-; | Dest=8F;CompatibleSystemSoftwareVersion=4.7600-; | ||
Dest=8F;ImageVersion=00010015;SystemSoftwareVersion=4.7600;CDN=http://dbr01.ps3.update.playstation.net/update/ps3/image/shop/2015_0903_6f462b5aaaed64263d72e1e989e4b336/PS3UPDAT.PUP;CDN_Timeout=30; | Dest=8F;ImageVersion=00010015;SystemSoftwareVersion=4.7600;CDN=http://dbr01.ps3.update.playstation.net/update/ps3/image/shop/2015_0903_6f462b5aaaed64263d72e1e989e4b336/PS3UPDAT.PUP;CDN_Timeout=30; | ||
Shop basic structure of the update URL: | Shop basic structure of the update URL: | ||
Line 136: | Line 98: | ||
(TLD=2 letter abbreviation from above region, YYYY_MMDD is release date, MD5 is 22-digits long HASH) | (TLD=2 letter abbreviation from above region, YYYY_MMDD is release date, MD5 is 22-digits long HASH) | ||
=== | === PSVita === | ||
Contrarly to PS3, there is no regioning in the .PUP files: they are the same for all different regions.<br /> | |||
However, the PSVita gets the psp2-updatelist.xml from different servers, depending on the region of that model. | |||
Retail: | Retail: | ||
Line 254: | Line 205: | ||
Retail basic structure of the update URL: | Retail basic structure of the update URL: | ||
<pre> | <pre>http://d<TLD>01.psp2.update.playstation.net/update/psp2/image/<YYYY_MMDD>/pre_<md5>/PSP2UPDAT.PUP?dest=<TLD> | ||
http://d<TLD>01.psp2.update.playstation.net/update/psp2/image/<YYYY_MMDD>/pre_<md5>/PSP2UPDAT.PUP?dest=<TLD> | (TLD=2 letter abbreviation from above region, YYYY_MMDD is release date, md5 is 22-digits long HASH)</pre> | ||
(TLD=2 letter abbreviation from above region, YYYY_MMDD is release date, md5 is 22-digits long HASH) | |||
== Installation == | == Installation == | ||
Line 448: | Line 333: | ||
0x8002F2Ex - (Turning On/Off Recovery Mode Flag) | 0x8002F2Ex - (Turning On/Off Recovery Mode Flag) | ||
= | = File structure = | ||
== Verification == | == Verification == | ||
The | The HMAC key used to verify the packages has been released. Look around for "pup-hmac". | ||
== Decryption == | |||
To decrypt the files that are unpacked using the tool, the keys are available under [[Keys]]. | |||
== Extraction == | == Extraction == | ||
The PSVita and PSVita TV update files can be extracted from .PUP using: | |||
* "[http://www.vitadevwiki.com/index.php?title=Tools PS VITA Firmware xTractor]" | |||
= | * pupunpack from [http://www.vitadevwiki.com/index.php?title=Tools#Vitatools vitatools]. | ||
== PS3 == | |||
<!--// PUP Extractor http://www.megaupload.com/?d=WILOJ5TC (outdated: incompatible output, tool not update since 27 may 2008 - autor:NDT @ ps3news) //--> | |||
=== Header === | === Header === | ||
{| class="wikitable" | {| class="wikitable" | ||
Line 494: | Line 359: | ||
! Offset !! Length !! Type !! Information | ! Offset !! Length !! Type !! Information | ||
|- | |- | ||
| 0x0 || | | 0x0 || 0x8 || unsigned long || Magic | ||
|- | |- | ||
| | | 0x8 || 0x8 || unsigned long || Package Version | ||
|- | |- | ||
| | | 0x10 || 0x8 || unsigned long || Image Version | ||
|- | |- | ||
| | | 0x18 || 0x8 || unsigned long || File Count | ||
|- | |- | ||
| | | 0x20 || 0x8 || unsigned long || Header Length | ||
|- | |- | ||
| | | 0x28 || 0x8 || unsigned long || File Length | ||
|- | |- | ||
| | | 0x30 || 0x20 * '''File Count''' || '''File Table''' || File Table | ||
|- | |- | ||
| 0x30 || 0x20 * ''' | | 0x30 + (0x20 * '''File Count''') || 0x20 * '''File Count''' || '''Hash Table''' || Hash Table | ||
|- | |- | ||
| 0x30 + ( | | 0x30 + (0x40 * '''File Count''') || 0x14 || bytes || Header Hash | ||
|- | |- | ||
| | | 0x44 + (0x40 * '''File Count''') || 0xC || bytes || Unknown | ||
|- | |- | ||
|} | |} | ||
=== | === File Table === | ||
The | The file table consists of a number of file entries determined by '''File Count''', with the format below: | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
! Offset | ! Offset | ||
! Length | |||
! Type | |||
! Information | |||
|- | |- | ||
| 0x0 | | 0x0 | ||
| 0x8 | |||
| unsigned long | |||
| Entry ID | |||
|- | |- | ||
| 0x8 | | 0x8 | ||
| 0x8 | |||
| unsigned long | |||
| Data Offset | |||
|- | |- | ||
| 0x10 | | 0x10 | ||
| 0x8 | |||
| unsigned long | |||
| Data Length | |||
|- | |- | ||
| 0x18 | | | 0x18 | ||
| 0x8 | |||
| | | unsigned long | ||
| Unknown | |||
|} | |} | ||
=== | ===Filename IDs=== | ||
{| class="wikitable" | |||
{| class="wikitable | |||
|- | |- | ||
! File Entry ID | |||
! Filename | |||
|- | |- | ||
| | | 0x100 | ||
| [[version.txt]] (aka: ps3version.txt) | |||
|- | |- | ||
| | | 0x101 | ||
| [[license.xml]] (aka: resource.txt? ) | |||
|- | |- | ||
| | | 0x102 | ||
| [[promo_flags.txt]] (only on {{shop}}) (aka: shop.txt?) | |||
|- | |- | ||
| | | 0x103 | ||
| [[update_flags.txt]] | |||
|- | |- | ||
| | | 0x104 | ||
| [[patch_build.txt]] | |||
|- | |- | ||
| | | 0x200 | ||
| [[ps3swu.self]] | |||
|- | |- | ||
| | | 0x201 | ||
| [[vsh.tar]] / font_resource.tar | |||
|- | |- | ||
| | | 0x202 | ||
| [[dots.txt]] | |||
|- | |- | ||
| | | 0x203 | ||
| [[patch_data.pkg]] | |||
|- | |- | ||
| | | 0x300 | ||
| [[update_files.tar]] | |||
|- | |- | ||
| | | 0x501 | ||
| [[spkg_hdr.tar]] (added since FW 3.56) | |||
|- | |- | ||
| | | 0x601 | ||
| [[ps3swu2.self]] (added since FW 3.56) | |||
|} | |||
=== Hash Table === | |||
The hash table contains a hash entry for every file inside the PUP. | |||
The hash entry format is: | |||
{| class="wikitable" | |||
|- | |- | ||
! Offset | |||
! Length | |||
! Type | |||
! Information | |||
|- | |- | ||
| | | 0x0 | ||
| 0x8 | |||
| unsigned long | |||
| File Entry ID | |||
|- | |- | ||
| | | 0x8 | ||
| 0x14 | |||
| bytes | |||
| HMAC-SHA1 hash | |||
|- | |- | ||
| | | 0x1C | ||
| 0x4 | |||
| unsigned int | |||
| Unknown | |||
|} | |||
== PSVita == | |||
=== Differences with PS3 PUPs === | |||
The file structure of the PSVita PUP files is almost identical to the PS3's, although there is a slight difference in the header and the hash algorithm. Whereas in PS3 the format is big-endian, for the PSVita it is little endian. Also the '''Format Version''' field in PSVita PUP is set to 2 where in PS3 PUPs it was set to 1. There is also 0x50 bytes of extra data in the header and the hashes used are of a longer length than in PS3 updates: 0x20 bytes (SHA-256 length) in PSVita versus 0x14 bytes (SHA-1 length) in PS3. | |||
== SCEUF Header == | |||
{| class="wikitable" | |||
! Offset !! Length !! Type !! Information | |||
|- | |- | ||
| | | 0x0 || 0x7 || char[7] || Magic (hex: 53 43 45 55 46 00 00 ~ ASCII "SCEUF") | ||
|- | |- | ||
| | | 0x7 || 0x1 || uin8_t || Format Flag | ||
|- | |- | ||
| | | 0x8 || 0x2 || uin16_t || Format Version | ||
|- | |- | ||
| | | 0xA || 0x6 || char[6] || Padding or unk | ||
|- | |- | ||
| | | 0x10 || 0x4 || uin32_t || Sdk Version | ||
|- | |- | ||
| | | 0x14 || 0x4 || uin32_t || Build No | ||
|- | |- | ||
| | | 0x18 || 0x8 || uin32_t || Segment num | ||
|- | |- | ||
| | | 0x1C || 0x4 || uin32_t || Padding or unk | ||
|- | |- | ||
| | | 0x20 || 0x8 || uin64_t || Header Length (ex: 0xE00, 0x1000) | ||
|- | |- | ||
| | | 0x28 || 0x8 || uin64_t || Data Length ( = (PUP filesize - Header Length) / 0x100 ) | ||
|- | |- | ||
| | | 0x30 || 0x50 || '''UNKNOWN''' || UNKNOWN, same for all >V1.0 files so far, maybe something for extra security? (or maybe to break a PS3 which tries to read the update) | ||
<pre> | |||
Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | |||
00000030 02 00 00 00 01 00 00 00 00 00 00 00 02 00 00 00 ................ | |||
00000040 00 00 00 00 0F 00 00 00 00 00 00 00 00 00 00 00 ................ | |||
00000050 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ | |||
00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ | |||
00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ | |||
</pre> | |||
|- | |- | ||
| | | 0x80 || 0x20 * '''File Count''' || '''File Table''' || File Table | ||
|- | |- | ||
| | | 0x80 + (0x20 * '''File Count''') || 0x40 * '''File Count''' || '''Hash Table''' || Hash Table | ||
|- | |- | ||
| | | 0x80 + (0x60 * '''File Count''') || 0x20 || bytes || Header Hash (maybe SHA-256?) | ||
|} | |} | ||
=== | === File Table === | ||
The file table consists of a number of file entries determined by '''File Count''', with the format below (which is the same as the format in PS3 PUP1 files). | |||
{| class="wikitable" | {| class="wikitable" | ||
Line 662: | Line 540: | ||
! Offset !! Length !! Type !! Information | ! Offset !! Length !! Type !! Information | ||
|- | |- | ||
| 0x0 || 0x8 || | | 0x0 || 0x8 || unsigned long || Entry ID | ||
|- | |- | ||
| 0x8 || | | 0x8 || 0x8 || unsigned long || Data Offset | ||
|- | |- | ||
| | | 0x10 || 0x8 || unsigned long || Data Length | ||
|- | |||
| 0x18 || 0x8 || unsigned long || Unknown | |||
|} | |} | ||
=== | === Filename IDs === | ||
{| class="wikitable sortable" | |||
! File Entry ID !! Filename !! Notes | |||
|- | |||
| 0x10 || || Version string | |||
|- | |||
| 0x101 || license.xml || License XML | |||
|- | |||
| 0x200 || psp2swu.self || main updater | |||
|- | |- | ||
| | | 0x204 || cui_setupper.self || development updater initializer | ||
|- | |- | ||
| | | 0x301 || package_data01.pkg | ||
|- | |- | ||
| | | 0x302 || package_data02.pkg | ||
|- | |- | ||
| | | 0x303 || package_data03.pkg | ||
|- | |- | ||
| | | 0x304 || package_data04.pkg | ||
|- | |- | ||
| | | 0x305 || package_data05.pkg | ||
|- | |- | ||
| | | 0x306 || package_data06.pkg | ||
|- | |- | ||
| | | 0x307 || package_data07.pkg | ||
|- | |- | ||
| | | 0x308 || package_data08.pkg | ||
|- | |- | ||
| | | 0x309 || package_data09.pkg | ||
|- | |- | ||
| | | 0x30A || package_data10.pkg | ||
|- | |- | ||
| | | 0x30B || package_data11.pkg | ||
|- | |- | ||
| | | 0x30C || package_data12.pkg | ||
|- | |- | ||
| | | 0x30D || package_data13.pkg | ||
|- | |- | ||
| | | 0x30E || package_data14.pkg | ||
|- | |- | ||
| | | 0x30F || package_data15.pkg | ||
|- | |- | ||
| | | 0x400 || package_scewm.wm || wm means watermark. Same ID for retail PUPs. Different IDs for dev PUPs for each developer. | ||
|- | |- | ||
| | | 0x401 || package_sceas.as || Unknown SCEAS magic file | ||
|- | |- | ||
| | | 0x2005 || || CP firmware in early debug updates only | ||
|- | |- | ||
| | | 0x2006 || || CP firmware in debug updates only | ||
|} | |} | ||
=== | === Hash Table === | ||
The | The hash table contains a hash entry for every file inside the PUP. | ||
The hash entry format is: | |||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
! Offset !! Length !! Type !! Information | ! Offset !! Length !! Type !! Information | ||
|- | |- | ||
| 0x0 || 0x8 || unsigned long || | | 0x0 || 0x8 || unsigned long || File Index | ||
|- | |- | ||
| 0x8 || 0x20 || | | 0x8 || 0x20 || bytes || File Hash (hmac-sha256 algo?) | ||
|- | |- | ||
| 0x28 || 0x18 || | | 0x28 || 0x18 || bytes || Unknown | ||
|} | |} | ||
== | ==Files in tree example== | ||
Here are two examples of the files stored in a PUP. | |||
Here are examples of the files stored in a PUP. | |||
=== 3.55 === | === 3.55 === | ||
PS3UPDAT.PUP | PS3UPDAT.PUP | ||
├── dots.txt | ├── dots.txt | ||
Line 913: | Line 734: | ||
├── version.txt | ├── version.txt | ||
└── vsh.tar | └── vsh.tar | ||
For a comparison between Retail and Debug firmware : [[3.55 firmware]] | |||
For a comparison between Retail and Debug firmware : [[3.55 firmware]] | |||
=== 3.60 - 4.00 === | === 3.60 - 4.00 === | ||
PS3UPDAT.PUP | PS3UPDAT.PUP | ||
├── dots.txt | ├── dots.txt | ||
Line 1,066: | Line 884: | ||
└── vsh.tar | └── vsh.tar | ||
└── a | └── a | ||
==Content of different versions== | |||
The following information is a copy/paste from the output of [https://github.com/omgneeq/ps3utils KaKaRoTo's pup.c tool]. This is an old build, which does not support 3.56/3.60 and higher added entryid's x501 & 0x601 (which because of that are named ''Unknown entry id''). | |||
===File Structure=== | |||
HMAC Key | |||
<!-- <pre> | |||
static const uint8_t hmac_pup_key[] = { | |||
0xf4, 0x91, 0xad, 0x94, 0xc6, 0x81, 0x10, 0x96, | |||
0x91, 0x5f, 0xd5, 0xd2, 0x44, 0x81, 0xae, 0xdc, | |||
0xed, 0xed, 0xbe, 0x6b, 0xe5, 0x13, 0x72, 0x4d, | |||
0xd8, 0xf7, 0xb6, 0x91, 0xe8, 0x8a, 0x38, 0xf4, | |||
0xb5, 0x16, 0x2b, 0xfb, 0xec, 0xbe, 0x3a, 0x62, | |||
0x18, 0x5d, 0xd7, 0xc9, 0x4d, 0xa2, 0x22, 0x5a, | |||
0xda, 0x3f, 0xbf, 0xce, 0x55, 0x5b, 0x9e, 0xa9, | |||
0x64, 0x98, 0x29, 0xeb, 0x30, 0xce, 0x83, 0x66 | |||
}; | |||
</pre> --> | |||
<pre>REDACTED</pre> | |||
Header | |||
<pre> | |||
typedef struct { | |||
uint64_t magic; | |||
uint64_t package_version; | |||
uint64_t image_version; | |||
uint64_t file_count; | |||
uint64_t header_length; | |||
uint64_t data_length; | |||
} PUPHeader; | |||
</pre> | </pre> | ||
File Entry | |||
<pre> | |||
typedef struct { | |||
uint64_t entry_id; | |||
uint64_t data_offset; | |||
uint64_t data_length; | |||
uint8_t padding[8]; | |||
} PUPFileEntry; | |||
</pre> | |||
Hash Entry | |||
<pre> | |||
typedef struct { | |||
uint64_t entry_id; | |||
uint8_t hash[20]; | |||
uint8_t padding[4]; | |||
} PUPHashEntry; | |||
</pre> | |||
Footer | |||
<pre> | |||
typedef struct | |||
{ | |||
uint8_t hash[20]; | |||
uint8_t padding[12]; | |||
} PUPFooter; | |||
</pre> | |||
Entry Id | |||
<pre> | |||
typedef struct { | |||
uint64_t id; | |||
const char *filename; | |||
} PUPEntryID; | |||
</pre> | |||
PUPEntryID entries | |||
<pre>static const PUPEntryID entries[] = { | |||
{0x100, "version.txt"}, | |||
{0x101, "license.xml"}, | |||
{0x102, "promo_flags.txt"}, | |||
{0x103, "update_flags.txt"}, | |||
{0x104, "patch_build.txt"}, | |||
{0x200, "ps3swu.self"}, | |||
{0x201, "vsh.tar"}, | |||
{0x202, "dots.txt"}, | |||
{0x203, "patch_data.pkg"}, | |||
{0x300, "update_files.tar"}, | |||
{0x501, "spkg_hdr.tar"}, | |||
{0x601, "ps3swu2.self"}, | |||
{0, NULL} | |||
};</pre> | |||
=== | ===Contents=== | ||
{| class="wikitable" | |||
{| class="wikitable | |||
|- | |- | ||
!Entry Id | |||
!Filename | |||
|- | |- | ||
| | |0x100 | ||
|[[version.txt]] | |||
|- | |- | ||
| | |0x101 | ||
|[[license.xml]] | |||
|- | |- | ||
| | |0x102 | ||
|[[promo_flags.txt]] | |||
|- | |- | ||
| | |0x103 | ||
|[[update_flags.txt]] | |||
|- | |- | ||
| | |0x104 | ||
|[[patch_build.txt]] | |||
|- | |- | ||
| | |0x200 | ||
|[[ps3swu.self]] | |||
|- | |- | ||
| | |0x201 | ||
|[[vsh.tar]] | |||
|- | |- | ||
| | |0x202 | ||
|[[dots.txt]] | |||
|- | |- | ||
| | |0x203 | ||
|[[patch_data.pkg]] | |||
|- | |- | ||
| | |0x300 | ||
|[[update_files.tar]] | |||
|- | |- | ||
| | |0x501 | ||
|[[spkg_hdr.tar]] | |||
|- | |- | ||
| | |0x601 | ||
|[[ps3swu2.self]] | |||
|- | |- | ||
|} | |} | ||
{{Custom Firmware}}<noinclude>[[Category:Main]]</noinclude> | {{Custom Firmware}}<noinclude>[[Category:Main]]</noinclude> |