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 159: Line 159:
== Delivery ==
== Delivery ==


=== Title Patch XML ===
=== Title XML ===


The PS4 fetches information about update package files (including where to download them) from an XML file. This XML file contains information such as if the latest patch is mandatory, the latest package version, the latest PlayGo manifest JSON URL, the URL to the Delta Package, etc.
The PS4 fetches information about package files (including where to download them) from an XML file. This XML file contains information such as if the latest patch is mandatory, the latest package version, the manifest, as well as information in a param.sfo file. Below is an example of a typical title XML file:


Structure of the XML file:
<pre>
  <titlepatch titleid="CUSAXXXXX">
  <titlepatch titleid="CUSAXXXXX">
   <tag name="37" mandatory="true"><br>
   <tag name="37" mandatory="true"><br>
Line 177: Line 175:
   </tag>
   </tag>
  </titlepatch>
  </titlepatch>
</pre>


Notes:
Notes:
* The 'size' attribute of the 'package' node is in bytes
* The 'size' attribute of the 'package' node is in bytes
* The 'system_ver' attribute of the 'package' node is in decimal and must be converted to hexadecimal for readibility
* The 'system_ver' attribute of the 'package' node should be converted to hexadecimal for system firmware version
* The 'delta_info_set' node is absent if there is no Delta Package available
* The 'delta_info_set' node may or may not be present depending on the package


=== PlayGo Manifest JSON ===
=== Manifest ===


On SCE servers, PS4 package files have a maximum size of 4GB (i.e. 4096MB), therefore most games are split into chunks (also called pieces). This is kept track of in the PlayGo Manifest file. It contains JSON fields which document things such as the size of the final package after the chunks are spliced together, the digest of the final package, the number of chunks, as well as information for each chunk such as the package file URL, offset for splicing, size of the chunk, and the sha1 hash value of the individual chunk.
It should be noted that PS4 package files have a maximum size of 4GB (or 4096MB), therefore large (most) games are split into chunks or pieces. This is kept track of in the manifest file, which contains JSON fields which document things such as the size of the final package after the chunks are spliced together, the digest of the final package, the number of chunks, as well as information for each chunk such as the package file URL, offset for splicing, size of the file, and the sha1 hash value of the individual chunk.


Structure of the JSON file:
<pre>
  originalFileSize: [size]
  originalFileSize: [size]
  packageDigest: "[sha256 digest]"
  packageDigest: "[sha256 digest]"
Line 200: Line 195:
   fileSize: [size, often 4294967296 until last chunk]
   fileSize: [size, often 4294967296 until last chunk]
   hashValue: "[sha1 hash of chunk]"
   hashValue: "[sha1 hash of chunk]"
</pre>


== Tools ==
== Tools ==
Line 206: Line 200:
=== UnPKG tool by flatz ===
=== UnPKG tool by flatz ===


UnPKG is an open source python2 library made by flatz to extract a PS4 ?release and/or debug? NPDRM PKG file. It maybe extracts only partially the PKG or maybe requires a per-content key.
UnPKG is an open source python2 library made by flatz to extract a PS4 ?release and/or debug? NPDRM PKG file. It maybe only extracts only partially the PKG or maybe requires a per-content key.


<source lang="python">
<source lang="python">
Line 548: Line 542:
== Sample Packages ==
== Sample Packages ==


=== Games and Applications ===
=== Apps/Games ===


* Amazon/LOVEFiLM App
* Amazon/LOVEFiLM App
Line 576: Line 570:
* [https://gist.github.com/hosamn/255a5c29c5b3e47a50641a804813bf32 PS4 PKGs CUSA1-10000.csv (2022-11-28)]
* [https://gist.github.com/hosamn/255a5c29c5b3e47a50641a804813bf32 PS4 PKGs CUSA1-10000.csv (2022-11-28)]
* [https://gist.github.com/hosamn/8e22e39353bbbe3285f9bd603e3e0b70 PS4 PKGs CUSA1-10000.csv (2018-04-13)]
* [https://gist.github.com/hosamn/8e22e39353bbbe3285f9bd603e3e0b70 PS4 PKGs CUSA1-10000.csv (2018-04-13)]
* [https://gist.github.com/hosamn/cadee497bacff249ccf95bad73b0f923 ps4_theme_links.csv]
* [https://gist.github.com/hosamn/2b7e30f095bd2c68908c18276ea19aed ps4_theme_links_private.csv]


{{File Formats}}
{{File Formats}}
<noinclude>[[Category:Main]]</noinclude>
<noinclude>[[Category:Main]]</noinclude>
Please note that all contributions to PS4 Developer wiki are considered to be released under the GNU Free Documentation License 1.2 (see PS4 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)