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 29: | Line 29: | ||
To document. | To document. | ||
=== | === PSVita === | ||
PUP | Each PUP contain updates for different partitions of the system. Most packages, once decrypted, decompressed and pieced together are a 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, systemdata and preinst. | ||
There are different types of | There are different types of PSVita .PUP: | ||
==== | ==== full ==== | ||
This contains the actual system files. The main components are <code>os0</code>, <code>vs0</code>, and the [[Boot Sequence|bootloader partition]]. | |||
==== systemdata ==== | |||
Systemdata PUPs only update the <code>sa0</code> [[Partitions|partition]]. It is likely separated from the main update due to it not regularly needing updates and size concerns. | Systemdata PUPs only update the <code>sa0</code> [[Partitions|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 <code>pd0</code> [[Partitions|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 ==== | ==== com ==== | ||
Unknown. Maybe stands for Common. | |||
Unknown. Maybe stands for Common | |||
==== modeldiff ==== | ==== modeldiff ==== | ||
Unknown. Maybe stands for Model Differences. | |||
==== 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. | |||
== Revisions == | == Revisions == | ||
=== | === PSVita === | ||
See [https:// | See [https://playstationdev.wiki/psvitadevwiki/index.php?title=Category:Firmware_revisions]. | ||
== Update List == | == Update List == | ||
Line 65: | Line 63: | ||
=== PS3 === | === PS3 === | ||
There is no regioning in the .PUP files | There is no regioning in the .PUP files, they are the same for all different regions (if you were looking for regioninfo, [[SKU_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). | |||
<ul> | <ul> | ||
Line 82: | Line 81: | ||
<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 [[Product Code]]: 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 92: | ||
Content: | Content: | ||
# JP(shop) | # JP(shop) | ||
Dest=83;CompatibleSystemSoftwareVersion=4.7600-; | Dest=83;CompatibleSystemSoftwareVersion=4.7600-; | ||
Line 130: | Line 128: | ||
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 134: | ||
(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. | |||
On retail (CEX) consoles, when you check for updates via WiFi in settings the console will download an XML file based on the console's region code. For example on | However, the PSVita gets the psp2-updatelist.xml from different servers, depending on the region of that model. | ||
On retail (CEX) consoles, when you check for updates via WiFi in settings the console will download an XML file based on the console's region code. For example on PSVitas sold within the United States the URL for the XML file is <code>http://fus01.psp2.update.playstation.net/update/psp2/list/us/psp2-updatelist.xml</code>. | |||
When this file is read by the system, the <code>region id</code> MUST match the system region. | When this file is read by the system, the <code>region id</code> MUST match the system region. | ||
Line 148: | Line 148: | ||
The file must be no larger than 65535 bytes, and the URL's specifying where to download the .PUP from can be no longer than 1024 characters, it also must be a direct URL to the content *including "http://" protocol*. | The file must be no larger than 65535 bytes, and the URL's specifying where to download the .PUP from can be no longer than 1024 characters, it also must be a direct URL to the content *including "http://" protocol*. | ||
When selecting "Update via connecting to PC" | When selecting "Update via connecting to PC" the console instead connected to Content Mannager Assistant and then CMA downloads the updatelist file and the PUP files from PC side and sends it back to the vita, because of this using a custom Content Mannager Assistant such as QCMA you can just send whatever psp2-updatelist you want to the vita. this is also what happens with "Update via connecting to PS3". | ||
On | On devkit and testkit you can configure your own URL for the psp2-updatelist.xml file in <code>Debug Settings > System Update</code> and this setting can be overridden by placing a file at <code>ux0:/PSP2/UPDATE/SERVER_URL.TXT</code> or <code>host0:/PSP2/UPDATE/SERVER_URL.TXT</code>. | ||
Retail: | Retail: | ||
Line 254: | Line 254: | ||
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) | |||
</pre> | |||
'''<?xml''' <span style="color: blue;">version</span><span style="color: red;">="1.0"</span> <span style="color: blue;">encoding</span><span style="color: red;">="UTF-8"</span>'''?>''' | '''<?xml''' <span style="color: blue;">version</span><span style="color: red;">="1.0"</span> <span style="color: blue;">encoding</span><span style="color: red;">="UTF-8"</span>'''?>''' | ||
Line 278: | Line 276: | ||
'''</update_data_list>''' | '''</update_data_list>''' | ||
PSVita PUP links use the same structure as the PS3: | |||
<nowiki>http://d</nowiki><span style="color: red;"><TLD></span>01.ps4.update.playstation.net/update/ps4/image/<span style="color: green;"><YYYY_MMDD></span>/<span style="color: orange;"><TYPE></span>_<span style="color: blue;"><MD5></span>/PS4UPDATE.PUP?dest=<span style="color: red;"><TLD></span> | <nowiki>http://d</nowiki><span style="color: red;"><TLD></span>01.ps4.update.playstation.net/update/ps4/image/<span style="color: green;"><YYYY_MMDD></span>/<span style="color: orange;"><TYPE></span>_<span style="color: blue;"><MD5></span>/PS4UPDATE.PUP?dest=<span style="color: red;"><TLD></span> | ||
Line 290: | Line 288: | ||
Note: this is untested, please report back! | Note: this is untested, please report back! | ||
Using a webserver (apache, lighttpd, nginx, etc.) and proxy/firewall to catch http://f**01.psp2.update.playstation.net/update/psp2/list/**/psp2-updatelist.xml" and point it to your local server you could[1] have more control over the updates/bandwith. Of course you need to have every <code>PSP2UPDATE.PUP</code> file you reference to, otherwise it errors out. | Using a webserver (apache, lighttpd, nginx, etc. whatever your preference is) and proxy/firewall to catch http://f**01.psp2.update.playstation.net/update/psp2/list/**/psp2-updatelist.xml" and point it to your local server you could[1] have more control over the updates/bandwith. Of course you need to have every <code>PSP2UPDATE.PUP</code> file you reference to, otherwise it errors out. | ||
In this example the webserver is configured at http://192.168.0.254, region is set to <code>eu</code>[2]. | In this example the webserver is configured at http://192.168.0.254, region is set to <code>eu</code>[2]. Change it to your own need. | ||
'''<update_data_list>''' | '''<update_data_list>''' | ||
Line 452: | Line 450: | ||
== Verification == | == Verification == | ||
The PUP Header is signed using HMAC, HMAC-SHA1 for PS3 and HMAC-SHA256 for | The PUP Header is signed using HMAC, HMAC-SHA1 for PS3 and HMAC-SHA256 for PSVita. | ||
On | On PSVita, the PUP Header Digest is signed using RSA2048. The PUP Header RSA signature is RSA-signed along with a message into SCEWM file, which is encrypted using AES128CBC. | ||
The PUP Header embeds HMAC signatures for each PUP segment. | The PUP Header embeds HMAC signatures for each PUP segment. | ||
Line 464: | Line 462: | ||
=== PS3 === | === PS3 === | ||
=== | === PSVita === | ||
The | The PSVita and PSVita TV update files can be extracted from .PUP using: | ||
* "[http://www. | * "[http://www.vitadevwiki.com/index.php?title=Tools PS VITA Firmware xTractor]" | ||
* pupunpack from [http://www. | * pupunpack from [http://www.vitadevwiki.com/index.php?title=Tools#Vitatools vitatools]. | ||
== Decryption == | == Decryption == | ||
Line 479: | Line 477: | ||
<source lang="C"> | <source lang="C"> | ||
typedef struct | typedef struct { | ||
uint64_t magic; | |||
uint8_t format_flag; | uint8_t format_flag; | ||
uint64_t package_version; | uint64_t package_version; | ||
uint64_t image_version; | uint64_t image_version; | ||
uint64_t segment_num; | uint64_t segment_num; | ||
uint64_t | uint64_t header_length; | ||
uint64_t | uint64_t data_length; | ||
} | } PUPHeader_v1; | ||
</source> | </source> | ||
Line 498: | Line 496: | ||
| 0x7 || 0x1 || uint8_t || Format Flag | | 0x7 || 0x1 || uint8_t || Format Flag | ||
|- | |- | ||
| 0x8 || 0x8 || unsigned long || Package Version. ?Might be Format version like on | | 0x8 || 0x8 || unsigned long || Package Version. ?Might be Format version like on PSVita? | ||
|- | |- | ||
| 0x10 || 0x8 || unsigned long || Image Version. ? | | 0x10 || 0x8 || unsigned long || Image Version. ?what is that? | ||
|- | |- | ||
| 0x18 || 0x8 || unsigned long || Segment | | 0x18 || 0x8 || unsigned long || Segment Num | ||
|- | |- | ||
| 0x20 || 0x8 || unsigned long || | | 0x20 || 0x8 || unsigned long || Header Length | ||
|- | |- | ||
| 0x28 || 0x8 || unsigned long || | | 0x28 || 0x8 || unsigned long || Data Length | ||
|- | |- | ||
| 0x30 || 0x20 * '''segment_num''' || '''Segment Table''' || Segment Table | | 0x30 || 0x20 * '''segment_num''' || '''Segment Table''' || Segment Table | ||
Line 522: | Line 520: | ||
<source lang="C"> | <source lang="C"> | ||
typedef struct | typedef struct { | ||
uint64_t id; | uint64_t id; | ||
uint64_t offset; | uint64_t offset; | ||
uint64_t size; | uint64_t size; | ||
uint32_t sign_algorithm; | uint32_t sign_algorithm; | ||
uint8_t padding[4]; | |||
} | } PUPSegmentEntry; | ||
</source> | </source> | ||
Line 553: | Line 551: | ||
! Segment Entry ID !! Console !! File name !! Notes | ! Segment Entry ID !! Console !! File name !! Notes | ||
|- | |- | ||
| 0x100 || [[version.txt]] || PS3, | | 0x100 || [[version.txt]] || PS3, PSVita || Version string | ||
|- | |- | ||
| 0x101 || [[license.xml]] || PS3, | | 0x101 || [[license.xml]] || PS3, PSVita || License XML. (?aka: resource.txt?) | ||
|- | |- | ||
| 0x102 || [[promo_flags.txt]] || PS3 || (only on {{SHOP}}) (?aka: shop.txt?) | | 0x102 || [[promo_flags.txt]] || PS3 || (only on {{SHOP}}) (?aka: shop.txt?) | ||
Line 563: | Line 561: | ||
| 0x104 || [[patch_build.txt]] || PS3 || | | 0x104 || [[patch_build.txt]] || PS3 || | ||
|- | |- | ||
| 0x200 || [[ps3swu.self]], [[psp2swu.self]] || PS3, | | 0x200 || [[ps3swu.self]], [[psp2swu.self]] || PS3, PSVita || Main updater executable | ||
|- | |- | ||
| 0x201 || [[vsh.tar]] / [[font_resource.tar]] || PS3 || | | 0x201 || [[vsh.tar]] / [[font_resource.tar]] || PS3 || | ||
Line 571: | Line 569: | ||
| 0x203 || [[patch_data.pkg]] || PS3 || | | 0x203 || [[patch_data.pkg]] || PS3 || | ||
|- | |- | ||
| 0x204 || [[cui_setupper.self]] || | | 0x204 || [[cui_setupper.self]] || PSVita || Classical UI updater setupper executable | ||
|- | |- | ||
| 0x221 || [[vs0_patch_tar_info.txt]] || | | 0x221 || [[vs0_patch_tar_info.txt]] || PSVita || vs0 patch tar archive access permission config | ||
|- | |- | ||
| 0x231 || [[vs0_patch_tar_2_info.txt]] || | | 0x231 || [[vs0_patch_tar_2_info.txt]] || PSVita || vs0 patch tar archive 2 access permission config | ||
|- | |- | ||
| 0x300 || [[update_files.tar]] || PS3 || | | 0x300 || [[update_files.tar]] || PS3 || | ||
|- | |- | ||
| 0x302 || || | | 0x302 || || PSVita || SLB2 | ||
|- | |- | ||
| 0x303 || || | | 0x303 || || PSVita || os0 | ||
|- | |- | ||
| 0x304 || || | | 0x304 || || PSVita || vs0 | ||
|- | |- | ||
| 0x305 || || | | 0x305 || || PSVita || | ||
|- | |- | ||
| 0x306 || || | | 0x306 || || PSVita || | ||
|- | |- | ||
| 0x307 || || | | 0x307 || || PSVita || | ||
|- | |- | ||
| 0x308 || || | | 0x308 || || PSVita || | ||
|- | |- | ||
| 0x309 || || | | 0x309 || || PSVita || | ||
|- | |- | ||
| 0x30A || || | | 0x30A || || PSVita || | ||
|- | |- | ||
| 0x30B || || | | 0x30B || || PSVita || | ||
|- | |- | ||
| 0x30C || || | | 0x30C || || PSVita || | ||
|- | |- | ||
| 0x30D || || | | 0x30D || || PSVita || | ||
|- | |- | ||
| 0x30E || || | | 0x30E || || PSVita || | ||
|- | |- | ||
| 0x30F || || | | 0x30F || || PSVita || | ||
|- | |- | ||
| 0x310 || || | | 0x310 || || PSVita || | ||
|- | |- | ||
| 0x311 || || | | 0x311 || || PSVita || vs0 patch tar archive | ||
|- | |- | ||
| 0x312 || || | | 0x312 || || PSVita || vs0 patch tar archive 2 | ||
|- | |- | ||
| 0x313 || || | | 0x313 || || PSVita || Syscon update type 0: 00 24 10 00 | ||
|- | |- | ||
| 0x314 || || | | 0x314 || || PSVita || Syscon update type 1: 00 50 31 00, 00 50 40 00 | ||
|- | |- | ||
| 0x315 || || | | 0x315 || || PSVita || Syscon update type 2: 00 26 10 00, 00 52 40 00 | ||
|- | |- | ||
| 0x316 || || | | 0x316 || || PSVita || Syscon update type 3: 00 52 31 00 | ||
|- | |- | ||
| 0x317 || || | | 0x317 || || PSVita || Syscon update type 4: | ||
|- | |- | ||
| 0x318 || || | | 0x318 || || PSVita || Syscon update type 5: | ||
|- | |- | ||
| 0x319 || || | | 0x319 || || PSVita || Syscon update type 6: | ||
|- | |- | ||
| 0x31A || || | | 0x31A || || PSVita || Syscon update type 7: | ||
|- | |- | ||
| 0x31B || || | | 0x31B || || PSVita || Syscon update type 8: | ||
|- | |- | ||
| 0x31C || || | | 0x31C || || PSVita || Syscon update type 9: 00 30 70 00 | ||
|- | |- | ||
| 0x400 || [[package_scewm.wm]] || | | 0x400 || [[package_scewm.wm]] || PSVita || SCEWM file | ||
|- | |- | ||
| 0x401 || [[package_sceas.as]] || | | 0x401 || [[package_sceas.as]] || PSVita || SCEAS file | ||
|- | |- | ||
| 0x501 || [[spkg_hdr.tar]] || PS3 || (added since FW 3.56) | | 0x501 || [[spkg_hdr.tar]] || PS3 || (added since FW 3.56) | ||
Line 641: | Line 639: | ||
| 0x601 || [[ps3swu2.self]] || PS3 || (added since FW 3.56) | | 0x601 || [[ps3swu2.self]] || PS3 || (added since FW 3.56) | ||
|- | |- | ||
| 0x2005 || || | | 0x2005 || || PSVita || CP ES1 firmware. In early Tool PUPs only. | ||
|- | |- | ||
| 0x2006 || || | | 0x2006 || || PSVita || CP ES2 firmware. In recent Tool PUPs only. | ||
|} | |} | ||
Line 651: | Line 649: | ||
<source lang="C"> | <source lang="C"> | ||
typedef struct | typedef struct { | ||
uint64_t segment_index; | uint64_t segment_index; | ||
uint8_t digest[0x14]; | uint8_t digest[0x14]; | ||
uint32_t padding; | uint32_t padding; | ||
} | } PUPDigestEntry_v1; | ||
</source> | </source> | ||
Line 677: | Line 675: | ||
</source> | </source> | ||
== | == PSVita == | ||
=== Differences with PS3 PUPs === | === Differences with PS3 PUPs === | ||
The file structure of the | The file structure of the PSVita PUP is almost identical to the PS3 PUP, although there is a slight difference in the header, the hash algorithm and the signature. | ||
* | * PSVita PUP is little endian. PS3 PUP is big-endian. | ||
* | * In PSVita PUP '''Format Version''' is 2. In PS3 PUP it is 1. | ||
* There are 0x50 bytes of extra data in the | * There are 0x50 bytes of extra data in the PSVita PUP Header compared to PS3 PUP. | ||
* | * PSVita PUP digests are longer than the ones in PS3 PUP: 0x20 bytes (SHA-256 length) in PSVita PUP versus 0x14 bytes (SHA-1 length) in PS3 PUP. | ||
* | * PSVita PUP Header Digest is signed using RSA2048 in the SCEWM file. ?PS3 PUP have a RSA signature? | ||
=== Header === | === Header === | ||
{| class="wikitable" | {| class="wikitable" | ||
Line 732: | Line 708: | ||
| 0x28 || 0x8 || uint64_t || Data Length. Equals (PUP file size - PUP Header Length). | | 0x28 || 0x8 || uint64_t || Data Length. Equals (PUP file size - PUP Header Length). | ||
|- | |- | ||
| 0x30 || 0x4 || uint32_t || Sign Algorithm. | | 0x30 || 0x4 || uint32_t || Sign Algorithm. PSVita only. (ex: 2) | ||
|- | |- | ||
| 0x34 || 0x4 || uint32_t || Sign Key Index. | | 0x34 || 0x4 || uint32_t || Sign Key Index. PSVita only. (ex: 1) | ||
|- | |- | ||
| 0x38 || 0x4 || uint8_t[4] || Attribute. | | 0x38 || 0x4 || uint8_t[4] || Attribute. PSVita only. 0: default, 1: QAF required. | ||
|- | |- | ||
| 0x3C || 0x4 || uint32_t || Target. | | 0x3C || 0x4 || uint32_t || Target. PSVita only. 1: TOOL, 2: CEX, 4: DEX. cex_for_tool PUPs are set to 1. | ||
|- | |- | ||
| 0x40 || 0x4 || uint32_t || Sub Target. | | 0x40 || 0x4 || uint32_t || Sub Target. PSVita only. (ex: 0) | ||
|- | |- | ||
| 0x44 || 0x4 || uint32_t || Support List. | | 0x44 || 0x4 || uint32_t || Support List. PSVita only. (ex: 1, 7, 0xC, 0xF, 0x38, 0x78, 0x3F8, 0xFF8, 0xCFF8) | ||
|- | |- | ||
| 0x48 || 0x4 || uint32_t || Base Version. | | 0x48 || 0x4 || uint32_t || Base Version. PSVita only. (ex: 0) | ||
|- | |- | ||
| 0x4C || 0x4 || uint32_t || Base Build No. | | 0x4C || 0x4 || uint32_t || Base Build No. PSVita only. (ex: 0) | ||
|- | |- | ||
| 0x50 || 0x30 || char[0x30] || Unknown. | | 0x50 || 0x30 || char[0x30] || Unknown. PSVita only. (ex: 0x2000) | ||
|- | |- | ||
| 0x80 || 0x20 * '''segment_num''' || '''Segment Table''' || Segment Table | | 0x80 || 0x20 * '''segment_num''' || '''Segment Table''' || Segment Table | ||
Line 766: | Line 742: | ||
<source lang="C"> | <source lang="C"> | ||
typedef struct | typedef struct { | ||
uint64_t segment_index; | |||
uint8_t digest[0x20]; | |||
uint8_t padding[0x18]; | |||
} | } PUPDigestEntry_v2; | ||
</source> | </source> | ||
Line 1,068: | Line 1,044: | ||
</pre> | </pre> | ||
== | == PSVita == | ||
=== preinst - 01.000.000 === | === preinst - 01.000.000 === |