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 718: Line 718:
=== PackageDigest ===
=== PackageDigest ===


Official description: This is SHA1 digest of package without last 32 bytes.
This is SHA1 digest of package without last 32 bytes.


The last 32 bytes of the package contain a hash (sha1sum) of the package (sha1 of the whole file minus the last 32 bytes). Or in other words... to verify the integrity of a package it is needed to crop the 0x20 bytes at the end, then calculate the SHA1 of the resulting file, then compare with the SHA1 that was cropped.
The last 0x20 bytes of the package contains a hash (sha1sum) of the package (sha1 of the whole file minus the last 0x20 bytes). Or in other words... to verify the integrity of a package is needed to crop the 0x20 bytes at the end, then calculate the SHA1 of the resulting file, then compare with the SHA1 that was cropped.


It is also used as part of the package identification info inside the '''TITLE_ID-ver.xml''' files in PSN servers that lists the available game patches for each game. See: [[Online_Connections#Game_Updating_Procedure|Game Updating Procedure]] page and the '''sha1sum''' in the .xml examples
It is also used as part of the package identification info inside the '''TITLE_ID-ver.xml''' files in PSN servers that lists the available game patches for each game. See: [[Online_Connections#Game_Updating_Procedure|Game Updating Procedure]] page and the '''sha1sum''' in the .xml examples


*Notes
*Notes
**This footer area is considered part of the package and is included when counting the '''total_size''' of the package (in the header at offset 0x18), and the header is hashed too by '''header_sha1_hash ''' (at offset 0xB8), this is important in the sequence of actions needed when building the package and updating/adding the PackageDigest.
**This footer area is considered part of the package and is included when counting the '''total_size''' of the package (in the header at offset 0x18), and the header is hashed too by '''header_sha1_hash ''' (at offset 0xB8), this is important in the sequence of actions needed when building the package and updating/adding the sha1 footer at the end
**PS3 homebrew packages (at least some of them) doesnt includes PackageDigest
**Homebrew packages (at least some of them) doesnt includes this footer


== Package Tools ==
== Package Tools ==
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)