maxton / LibOrbisPkg

Library, GUI, CLI for creating, inspecting, and modifying PS4 PKG, SFO, PFS, and related filetypes

Home Page:https://ci.appveyor.com/project/maxton/liborbispkg/build/artifacts

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Validate Failed: Header Digest, PFS Image Digest, PFS Signed Digest when creating AC.

alpakeno opened this issue · comments

When creating AC pkg using PkgEdit ( adding just param.sfo and icon0.png inside sce_sys ) then tried to verify the created pkg, it will fail.

Note:
By adding just param.sfo without icon0.png, the package will be Validated successfully.

Edit:
I'm think that there is an issue in PkgEditor when creating AC with icon0.png,
since I tried to create the same pkg using sony's tool and it pass the validating in PkgEditor.

commented

That’s interesting, none of the CI tests currently test additional entries beyond param.sfo so I’m not surprised that it fails to validate. Does the PKG install and show an icon on the PS4? Or since you mentioned you have the publishing tools, have you tried using the Image Checker to check the LibOrbisPkg-generated pkg to see if it passes?

I didn't try installing it on PS4 since currently I don't have access to it, but I tried using the publishing tools and it passes.

Edit: please see the Followup post below for more details.

Followup: after trying latest build of PkgEditor and doing some test using both PkgEditor and sony's tool, here is the results:

First test when creating AC using PkgEditor with param.sfo + icon0.png then verifying using sony's tool with this arg img_verify --integrity_check on --format_check on

[Debug] 2020-02-10 05:36:50 Verify Process started. [Debug] Check started. [Debug] [System Information] [Debug] Program : Publishing Tools ver.3.38 [Debug] Checker Version : 3.38 [Debug] [Debug] [Target Information] [Debug] Checked Contents : 1 (addcont) [Debug] [Debug] [Check Logs] [Debug] [Log #000 (addcont)] [Debug] Checking single additional content. [Debug] Checking directory tree. [Error] The following directory is mandatory, but not found. (Sc0) [Debug] Checking consistency. [Debug] Checking image attribute. [Error] Could not mount the image. Maybe permission error. [Error] Format of the pkg file is not valid. (package file, invalid header) [Debug] [Debug] [Debug] [Check Result] [Error] Number of Error(s) : 3 [Debug] Number of Warning(s) : 0 [Error] Result : ERROR [Debug] [Debug] Check ended. [Error] 2020-02-10 05:36:50 Verify Process finished with error(s).

Second test when creating only param.sfo using PkgEditor:

[Debug] 2020-02-10 05:36:51 Verify Process started. [Debug] Check started. [Debug] [System Information] [Debug] Program : Publishing Tools ver.3.38 [Debug] Checker Version : 3.38 [Debug] [Debug] [Target Information] [Debug] Checked Contents : 1 (addcont) [Debug] Title ID : CUSA03694 [Debug] [Debug] [Check Logs] [Debug] [Log #000 (addcont)] [Debug] Checking single additional content. [Debug] Checking directory tree. [Debug] Checking Package Header files. [Debug] param.sfo: Param file for PS4 Additional Content. [Debug] param.sfo: Param CATEGORY = ac. [Debug] param.sfo: Param TITLE_ID = CUSA03694. [Debug] param.sfo: Param CONTENT_ID = UP9000-CUSA03694_00-ACUSCROWXXXXXXXX. [Debug] param.sfo: Param ATTRIBUTE = 0x00000000. [Debug] param.sfo: Param VERSION = 01.00. [Debug] param.sfo: Creation Date = 2020-02-10. [Debug] param.sfo: Publishing Tools Version is 2.89. [Error] The following file is mandatory, but not found. (icon0.png) [Debug] license.dat: System file. [Debug] license.info: System file. [Debug] psreserved.dat: System file. [Debug] Checking PFS root directory. [Debug] Checking sce_sys directory. [Debug] Total number of PFS files/directories = 2. [Debug] Checking consistency. [Debug] Checking image attribute. [Debug] PFS format = normal. [Debug] [Debug] [Debug] [Check Result] [Error] Number of Error(s) : 1 [Debug] Number of Warning(s) : 0 [Error] Result : ERROR [Debug] [Debug] Check ended. [Error] 2020-02-10 05:36:51 Verify Process finished with error(s).

Third test using sony's tool to create the same pkg with param.sfo + icon0.png: ( it success )

[Debug] 2020-02-10 05:45:19 Verify Process started. [Debug] Check started. [Debug] [System Information] [Debug] Program : Publishing Tools ver.3.38 [Debug] Checker Version : 3.38 [Debug] [Debug] [Target Information] [Debug] Checked Contents : 1 (addcont) [Debug] Title ID : CUSA03694 [Debug] [Debug] [Check Logs] [Debug] [Log #000 (addcont)] [Debug] Checking single additional content. [Debug] Checking directory tree. [Debug] Checking Package Header files. [Debug] param.sfo: Param file for PS4 Additional Content. [Debug] param.sfo: Param CATEGORY = ac. [Debug] param.sfo: Param TITLE_ID = CUSA03694. [Debug] param.sfo: Param CONTENT_ID = UP9000-CUSA03694_00-ACUSCROWXXXXXXXX. [Debug] param.sfo: Param ATTRIBUTE = 0x00000000. [Debug] param.sfo: Param VERSION = 01.00. [Debug] param.sfo: Creation Date = 2020-02-10. [Debug] param.sfo: Publishing Tools Version is 3.38. [Debug] icon0.png: 512x512/24bit. [Debug] license.dat: System file. [Debug] license.info: System file. [Debug] psreserved.dat: System file. [Debug] Checking PFS root directory. [Debug] Checking sce_sys directory. [Debug] Total number of PFS files/directories = 2. [Debug] Checking consistency. [Debug] Checking image attribute. [Debug] PFS format = normal. [Debug] [Debug] [Debug] [Check Result] [Debug] Number of Error(s) : 0 [Debug] Number of Warning(s) : 0 [Info] Result : OK [Debug] [Debug] Check ended. [Debug] 2020-02-10 05:45:19 Verify Process successfully finished. [Debug] 2020-02-10 05:45:19 Check Integrity Process started. [Debug] Check Integrity started. [Debug] Check Integrity ended. [Debug] 2020-02-10 05:45:20 Check Integrity Process successfully finished.

Forth test using sony's tool to create the same pkg with only param.sfo:
The results is identical to the one created by PkgEditor.

commented

It seems to be working for me. Can you maybe upload a zip with a GP4 project, SFO, and PNG file that reproduce the error?

Sure, here is the zip file:

CUSA04943.zip

i can confirm this error. tested ac with data and ac without data, in both case there are the same errors

param.sfo + icon0.png - 3 errors

[OK] (Hash) Content Digest @ 0x2920
[OK] (Hash) Game Digest @ 0x2940
[ERROR] Hash invalid at 0x2960: Header Digest
[OK] (Hash) Major Param Digest @ 0x29A0
[OK] (Hash) Param Digest @ 0x29C0
[OK] (Hash) ENTRY_KEYS digest @ 0x2C00
[OK] (Hash) IMAGE_KEY digest @ 0x2C20
[OK] (Hash) GENERAL_DIGESTS digest @ 0x2C40
[OK] (Hash) METAS digest @ 0x2C60
[OK] (Hash) ENTRY_NAMES digest @ 0x2C80
[OK] (Hash) LICENSE_DAT digest @ 0x2CA0
[OK] (Hash) LICENSE_INFO digest @ 0x2CC0
[OK] (Hash) PSRESERVED_DAT digest @ 0x2CE0
[OK] (Hash) PARAM_SFO digest @ 0x2D00
[OK] (Hash) ICON0_PNG digest @ 0x2D20
[ERROR] Hash invalid at 0x460: PFS Signed Digest
[ERROR] Hash invalid at 0x440: PFS Image Digest
[OK] (Hash) Body Digest @ 0x160
[OK] (Hash) Digest Table Hash @ 0x140
[OK] (Hash) SC Entries Hash 1 @ 0x100
[OK] (Hash) SC Entries Hash 2 @ 0x120
[OK] (Hash) PKG Header Digest @ 0xFE0
[OK] (Signature) PKG Header Signature @ 0x1000
[OK] (Signature) Debug RIF Signature @ 0x3060

param.sfo only - no errors

[OK] (Hash) Content Digest @ 0x2920
[OK] (Hash) Game Digest @ 0x2940
[OK] (Hash) Header Digest @ 0x2960
[OK] (Hash) Major Param Digest @ 0x29A0
[OK] (Hash) Param Digest @ 0x29C0
[OK] (Hash) ENTRY_KEYS digest @ 0x2BE0
[OK] (Hash) IMAGE_KEY digest @ 0x2C00
[OK] (Hash) GENERAL_DIGESTS digest @ 0x2C20
[OK] (Hash) METAS digest @ 0x2C40
[OK] (Hash) ENTRY_NAMES digest @ 0x2C60
[OK] (Hash) LICENSE_DAT digest @ 0x2C80
[OK] (Hash) LICENSE_INFO digest @ 0x2CA0
[OK] (Hash) PSRESERVED_DAT digest @ 0x2CC0
[OK] (Hash) PARAM_SFO digest @ 0x2CE0
[OK] (Hash) PFS Signed Digest @ 0x460
[OK] (Hash) PFS Image Digest @ 0x440
[OK] (Hash) Body Digest @ 0x160
[OK] (Hash) Digest Table Hash @ 0x140
[OK] (Hash) SC Entries Hash 1 @ 0x100
[OK] (Hash) SC Entries Hash 2 @ 0x120
[OK] (Hash) PKG Header Digest @ 0xFE0
[OK] (Signature) PKG Header Signature @ 0x1000
[OK] (Signature) Debug RIF Signature @ 0x3010

regards

commented

I believe this is fixed now. While adding support for AL PKGs I fixed PKG body size calculation. The problem here was that the PKG body (Sc0) was overwriting part of the PFS image. I did not catch it sooner because I was testing with a much smaller PNG file.

data dlc

2 errors fixed, but still there is an error

[ERROR] Hash invalid at 0x2960: Header Digest

no data dlc

param.sfo + icon0.png - still got the same 3 errors as earlier
param.sfo only - 2 errors

regards

commented

I think PkgTool is just buggy at validating stuff, I would take those results with a grain of salt