windsurfer1122 / PSN_get_pkg_info

Extract package information from header and PARAM.SFO of PS3/PSX/PSP/PSV/PSM and PS4 packages.
GNU General Public License v3.0
33 stars 11 forks source link

No support for Namco System 357 PKGs #2

Open picodico opened 5 years ago

picodico commented 5 years ago

Hi!

I'm not sure if support for Namco System 357 would be in this project's scope, but I'd like to bring forward this issue anyway.

I have the data for a Taiko no Tatsujin USB update dongle, which has three PKGs on it. From what I can tell, the headers on the PKGs seems to be valid and they all have the ContentID UP0001-SCEEXE000_00-FULLPACKAGE00001. Here are the full headers for one of them:

Offset(d) 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15
00000000  7F 50 4B 47 00 00 00 01 00 00 00 C0 00 00 00 08  .PKG.......À....
00000016  00 00 00 C0 00 00 00 1E 00 00 00 00 03 1D C4 90  ...À..........Ä.
00000032  00 00 00 00 00 00 01 80 00 00 00 00 03 1D C2 B0  .......€......°
00000048  55 50 30 30 30 31 2D 53 43 45 45 58 45 30 30 30  UP0001-SCEEXE000
00000064  5F 30 30 2D 46 55 4C 4C 50 41 43 4B 41 47 45 30  _00-FULLPACKAGE0
00000080  30 30 30 31 00 00 00 00 00 00 00 00 00 00 00 00  0001............
00000096  9A FC C2 54 53 A5 D6 91 51 AB 04 22 30 D6 E3 4E  šüÂTS¥Ö‘Q«."0ÖãN
00000112  4A A4 E6 A1 48 00 9A 3B F0 C9 F7 0D 75 B2 EE FF  J¤æ¡H.š;ðÉ÷.u²îÿ
00000128  76 E8 DD B6 0D D7 AA 43 AA 0B B5 D9 79 E1 96 88  vèݶ.תCª.µÙyá–ˆ
00000144  BC B3 C5 C6 28 B3 2D AD 2C 32 9E 52 3C 96 DB F2  ¼³ÅÆ(³-.,2žR<–Ûò
00000160  99 95 95 6A 88 E5 29 B7 70 01 66 AE DF 09 89 BE  ™••jˆå)·p.f®ß.‰¾
00000176  F8 74 0D BA 03 FF 12 7D 50 42 28 10 9E 8E C6 61  øt.º.ÿ.}PB(.žŽÆa

When opening the PKG with PSN_get_pkg_info, the following happens:

# >>>>>>>>>> PKG Source: C:\Users\Kemo\Downloads\TNT_RED_ASIA_UPD_NEWPCBONLY\VERSIONUP\DATA00012.BIN
[ALIGN] Unaligned encrypted offset 0xed0d9d023a95c702-0x2=0xed0d9d023a95c700(+0x180) for #0 item data. C:\Users\Kemo\Downloads\TNT_RED_ASIA_UPD_NEWPCBONLY\VERSIONUP\DATA00012.BIN
[ALIGN] Please report this issue at https://github.com/windsurfer1122/PSN_get_pkg_info
[ALIGN] Unaligned encrypted offset 0x95d691a035f5269e-0xe=0x95d691a035f52690(+0x180) for #1 item data. C:\Users\Kemo\Downloads\TNT_RED_ASIA_UPD_NEWPCBONLY\VERSIONUP\DATA00012.BIN
[ALIGN] Please report this issue at https://github.com/windsurfer1122/PSN_get_pkg_info
[ALIGN] Unaligned encrypted offset 0xacb4a33f8cdafe42-0x2=0xacb4a33f8cdafe40(+0x180) for #2 item data. C:\Users\Kemo\Downloads\TNT_RED_ASIA_UPD_NEWPCBONLY\VERSIONUP\DATA00012.BIN
[ALIGN] Please report this issue at https://github.com/windsurfer1122/PSN_get_pkg_info
[ALIGN] Unaligned encrypted offset 0xc5395ae828411ba1-0x1=0xc5395ae828411ba0(+0x180) for #3 item data. C:\Users\Kemo\Downloads\TNT_RED_ASIA_UPD_NEWPCBONLY\VERSIONUP\DATA00012.BIN
[ALIGN] Please report this issue at https://github.com/windsurfer1122/PSN_get_pkg_info
[ALIGN] Unaligned encrypted offset 0x6623beec4e47b95d-0xd=0x6623beec4e47b950(+0x180) for #4 item data. C:\Users\Kemo\Downloads\TNT_RED_ASIA_UPD_NEWPCBONLY\VERSIONUP\DATA00012.BIN
[ALIGN] Please report this issue at https://github.com/windsurfer1122/PSN_get_pkg_info
[ALIGN] Unaligned encrypted offset 0xb26e05bccbc0084b-0xb=0xb26e05bccbc00840(+0x180) for #5 item data. C:\Users\Kemo\Downloads\TNT_RED_ASIA_UPD_NEWPCBONLY\VERSIONUP\DATA00012.BIN
[ALIGN] Please report this issue at https://github.com/windsurfer1122/PSN_get_pkg_info
[ALIGN] Unaligned encrypted offset 0xfed03a7c96792125-0x5=0xfed03a7c96792120(+0x180) for #6 item data. C:\Users\Kemo\Downloads\TNT_RED_ASIA_UPD_NEWPCBONLY\VERSIONUP\DATA00012.BIN
[ALIGN] Please report this issue at https://github.com/windsurfer1122/PSN_get_pkg_info
[ALIGN] Unaligned encrypted offset 0xb8f47dc957b24ed-0xd=0xb8f47dc957b24e0(+0x180) for #7 item data. C:\Users\Kemo\Downloads\TNT_RED_ASIA_UPD_NEWPCBONLY\VERSIONUP\DATA00012.BIN
[ALIGN] Please report this issue at https://github.com/windsurfer1122/PSN_get_pkg_info
[ALIGN] Unaligned encrypted offset 0x396babe8fdb6b505-0x5=0x396babe8fdb6b500(+0x180) for #8 item data. C:\Users\Kemo\Downloads\TNT_RED_ASIA_UPD_NEWPCBONLY\VERSIONUP\DATA00012.BIN
[ALIGN] Please report this issue at https://github.com/windsurfer1122/PSN_get_pkg_info
[ALIGN] Unaligned encrypted offset 0xab39785eebd332fd-0xd=0xab39785eebd332f0(+0x180) for #9 item data. C:\Users\Kemo\Downloads\TNT_RED_ASIA_UPD_NEWPCBONLY\VERSIONUP\DATA00012.BIN
[ALIGN] Please report this issue at https://github.com/windsurfer1122/PSN_get_pkg_info
[ALIGN] Unaligned encrypted offset 0xad3b74caf91cf406-0x6=0xad3b74caf91cf400(+0x180) for #10 item data. C:\Users\Kemo\Downloads\TNT_RED_ASIA_UPD_NEWPCBONLY\VERSIONUP\DATA00012.BIN
[ALIGN] Please report this issue at https://github.com/windsurfer1122/PSN_get_pkg_info
[ALIGN] Unaligned encrypted offset 0x98a2f9f5060e4a9e-0xe=0x98a2f9f5060e4a90(+0x180) for #11 item data. C:\Users\Kemo\Downloads\TNT_RED_ASIA_UPD_NEWPCBONLY\VERSIONUP\DATA00012.BIN
[ALIGN] Please report this issue at https://github.com/windsurfer1122/PSN_get_pkg_info
[ALIGN] Unaligned encrypted offset 0x6043cdee934f9e27-0x7=0x6043cdee934f9e20(+0x180) for #12 item data. C:\Users\Kemo\Downloads\TNT_RED_ASIA_UPD_NEWPCBONLY\VERSIONUP\DATA00012.BIN
[ALIGN] Please report this issue at https://github.com/windsurfer1122/PSN_get_pkg_info
[ALIGN] Unaligned encrypted offset 0x38b8bd9bbfd5774b-0xb=0x38b8bd9bbfd57740(+0x180) for #13 item data. C:\Users\Kemo\Downloads\TNT_RED_ASIA_UPD_NEWPCBONLY\VERSIONUP\DATA00012.BIN
[ALIGN] Please report this issue at https://github.com/windsurfer1122/PSN_get_pkg_info
[ALIGN] Unaligned encrypted offset 0xe06d94d467e24182-0x2=0xe06d94d467e24180(+0x180) for #14 item data. C:\Users\Kemo\Downloads\TNT_RED_ASIA_UPD_NEWPCBONLY\VERSIONUP\DATA00012.BIN
[ALIGN] Please report this issue at https://github.com/windsurfer1122/PSN_get_pkg_info
[ALIGN] Unaligned encrypted offset 0xe1a709a90c65c0fa-0xa=0xe1a709a90c65c0f0(+0x180) for #15 item data. C:\Users\Kemo\Downloads\TNT_RED_ASIA_UPD_NEWPCBONLY\VERSIONUP\DATA00012.BIN
[ALIGN] Please report this issue at https://github.com/windsurfer1122/PSN_get_pkg_info
[ALIGN] Unaligned encrypted offset 0xa0216b52d5358322-0x2=0xa0216b52d5358320(+0x180) for #16 item data. C:\Users\Kemo\Downloads\TNT_RED_ASIA_UPD_NEWPCBONLY\VERSIONUP\DATA00012.BIN
[ALIGN] Please report this issue at https://github.com/windsurfer1122/PSN_get_pkg_info
[ALIGN] Unaligned encrypted offset 0x5f61a6fa869529e3-0x3=0x5f61a6fa869529e0(+0x180) for #17 item data. C:\Users\Kemo\Downloads\TNT_RED_ASIA_UPD_NEWPCBONLY\VERSIONUP\DATA00012.BIN
[ALIGN] Please report this issue at https://github.com/windsurfer1122/PSN_get_pkg_info
[ALIGN] Unaligned encrypted offset 0x7ba681dd9bd2935e-0xe=0x7ba681dd9bd29350(+0x180) for #19 item data. C:\Users\Kemo\Downloads\TNT_RED_ASIA_UPD_NEWPCBONLY\VERSIONUP\DATA00012.BIN
[ALIGN] Please report this issue at https://github.com/windsurfer1122/PSN_get_pkg_info
[ALIGN] Unaligned encrypted offset 0xc24d00026a528d6b-0xb=0xc24d00026a528d60(+0x180) for #20 item data. C:\Users\Kemo\Downloads\TNT_RED_ASIA_UPD_NEWPCBONLY\VERSIONUP\DATA00012.BIN
[ALIGN] Please report this issue at https://github.com/windsurfer1122/PSN_get_pkg_info
[ALIGN] Unaligned encrypted offset 0x2eb8416f1dbe08f-0xf=0x2eb8416f1dbe080(+0x180) for #21 item data. C:\Users\Kemo\Downloads\TNT_RED_ASIA_UPD_NEWPCBONLY\VERSIONUP\DATA00012.BIN
[ALIGN] Please report this issue at https://github.com/windsurfer1122/PSN_get_pkg_info
[ALIGN] Unaligned encrypted offset 0x1184b1666da1b7ed-0xd=0x1184b1666da1b7e0(+0x180) for #23 item data. C:\Users\Kemo\Downloads\TNT_RED_ASIA_UPD_NEWPCBONLY\VERSIONUP\DATA00012.BIN
[ALIGN] Please report this issue at https://github.com/windsurfer1122/PSN_get_pkg_info
[ALIGN] Unaligned encrypted offset 0xdb427537e80a8355-0x5=0xdb427537e80a8350(+0x180) for #24 item data. C:\Users\Kemo\Downloads\TNT_RED_ASIA_UPD_NEWPCBONLY\VERSIONUP\DATA00012.BIN
[ALIGN] Please report this issue at https://github.com/windsurfer1122/PSN_get_pkg_info
[ALIGN] Unaligned encrypted offset 0x8e5510fa46c84fab-0xb=0x8e5510fa46c84fa0(+0x180) for #25 item data. C:\Users\Kemo\Downloads\TNT_RED_ASIA_UPD_NEWPCBONLY\VERSIONUP\DATA00012.BIN
[ALIGN] Please report this issue at https://github.com/windsurfer1122/PSN_get_pkg_info
[ALIGN] Unaligned encrypted offset 0xc6d1d43ebcd0eecb-0xb=0xc6d1d43ebcd0eec0(+0x180) for #26 item data. C:\Users\Kemo\Downloads\TNT_RED_ASIA_UPD_NEWPCBONLY\VERSIONUP\DATA00012.BIN
[ALIGN] Please report this issue at https://github.com/windsurfer1122/PSN_get_pkg_info
[ALIGN] Unaligned encrypted offset 0xf523c9e9c7e814b4-0x4=0xf523c9e9c7e814b0(+0x180) for #27 item data. C:\Users\Kemo\Downloads\TNT_RED_ASIA_UPD_NEWPCBONLY\VERSIONUP\DATA00012.BIN
[ALIGN] Please report this issue at https://github.com/windsurfer1122/PSN_get_pkg_info
[ALIGN] Unaligned encrypted offset 0x15b1239468da7a54-0x4=0x15b1239468da7a50(+0x180) for #28 item data. C:\Users\Kemo\Downloads\TNT_RED_ASIA_UPD_NEWPCBONLY\VERSIONUP\DATA00012.BIN
[ALIGN] Please report this issue at https://github.com/windsurfer1122/PSN_get_pkg_info
[ALIGN] Unaligned encrypted offset 0xcb60494ebcd3b018-0x8=0xcb60494ebcd3b010(+0x180) for #29 item data. C:\Users\Kemo\Downloads\TNT_RED_ASIA_UPD_NEWPCBONLY\VERSIONUP\DATA00012.BIN
[ALIGN] Please report this issue at https://github.com/windsurfer1122/PSN_get_pkg_info
[UNKNOWN] Item Names with offset 0x13715896 are not directly following the Item Entries with size 0x3c0. C:\Users\Kemo\Downloads\TNT_RED_ASIA_UPD_NEWPCBONLY\VERSIONUP\DATA00012.BIN
[UNKNOWN] Please report this issue at https://github.com/windsurfer1122/PSN_get_pkg_info
[ERROR] Could not get PKG3 encrypted data at offset 0x540 with size 8265223184 from C:\Users\Kemo\Downloads\TNT_RED_ASIA_UPD_NEWPCBONLY\VERSIONUP\DATA00012.BIN

I've uploaded DATA00012.BIN here: https://anonfile.com/Q16cQeveb8/DATA00012_BIN (please feel free to edit out the link after you've downloaded it)

Could you possibly look into this and see if support can be added for these PKGs?

windsurfer1122 commented 5 years ago

Try with the just released version it now supports debug packages, and that should be the case here.

windsurfer1122 commented 5 years ago

Still fails. Right now all other tools I know also fail to open it. Does not install on Retail (CEX) PS3 with PS3HEN 2.3.1 https://www.psdevwiki.com/ps3/Namco_System_357 Content ID: UP0001-SCEEXE000_00-FULLPACKAGE00001 ITEMS_COUNT=30 ITEMS_FILE_OFS=0x0180 ITEMS_NAME_FILE_OFS=0x180 + (30 * 32) = 0x540

[debug] >>>>> parsePkg3Header results:
[debug] pkgheaderfields["MAGIC"       | 0]: 7f504b47
[debug] pkgheaderfields["REV"         | 1]: 0x0000 = 0
[debug] pkgheaderfields["TYPE"        | 2]: 0x0001 = 1
[debug] pkgheaderfields["MDOFS"       | 3]: 0x000000c0 = 192
[debug] pkgheaderfields["MDCNT"       | 4]: 0x00000008 = 8
[debug] pkgheaderfields["HDRSIZE"     | 5]: 0x000000c0 = 192
[debug] pkgheaderfields["ITEMCNT"     | 6]: 0x0000001e = 30
[debug] pkgheaderfields["TOTALSIZE"   | 7]: 0x00000000031dc490 = 52282512
[debug] pkgheaderfields["DATAOFS"     | 8]: 0x0000000000000180 = 384
[debug] pkgheaderfields["DATASIZE"    | 9]: 0x00000000031dc2b0 = 52282032
[debug] pkgheaderfields["CONTENT_ID"  |10]: UP0001-SCEEXE000_00-FULLPACKAGE00001
[debug] pkgheaderfields["DIGEST"      |11]: 9afcc25453a5d69151ab042230d6e34e
[debug] pkgheaderfields["DATARIV"     |12]: 4aa4e6a148009a3bf0c9f70d75b2eeff
[debug] pkgheaderfields["KEYINDEX"    |-1]: 0x0 = 0
[debug] pkgheaderfields["AES_CTR"     |-1][0]: 2e7b71d7c9c9a14ea3221f188828b8f8
[debug] pkgheaderfields["AES_CTR"     |-1][1]: 07f2c68290b50d2c33818d709b60e62b
[debug] pkgheaderfields["AES_CTR"     |-1][2]: dd6d774383388116d93ddbc4b375bd16
[debug] pkgheaderfields["AES_CTR"     |-1][3]: eea7802ffe571fd52946847987918d55
[debug] pkgheaderfields["AES_CTR"     |-1][4]: 79d91124fb8b84014ba223f75466c277
[debug] pkgheaderfields["XOR_CTR"     |-1]: 9afcc25453a5d6919afcc25453a5d69151ab042230d6e34e51ab042230d6e34e0000000000000000000000000000000000000000000000000000000000000000
[debug] pkgheaderfields["DEBUG_PKG"   |-1]: True
[debug] pkgheaderfields["PARAM.SFO"   |-1]: PARAM.SFO
[debug] pkgheaderfields["MDSIZE"      |-1]: 0x80 = 128
[debug] pkgmetadata[0x01]["DESC"]: DRM Type
[debug] pkgmetadata[0x01]["VALUE"]: 0x2 = 2
[debug] pkgmetadata[0x02]["DESC"]: Content Type
[debug] pkgmetadata[0x02]["VALUE"]: 0x5 = 5
[debug] pkgmetadata[0x03]["DESC"]: Package Type/Flags
[debug] pkgmetadata[0x03]["VALUE"]: 00 00 00 4e
[debug] pkgmetadata[0x04]["DESC"]: Package Size
[debug] pkgmetadata[0x04]["VALUE"]: 00 00 00 00 03 1d c2 b0
[debug] pkgmetadata[0x05]["VALUE"]: 19 70 01 00
[debug] pkgmetadata[0x07]["DESC"]: QA Digest
[debug] pkgmetadata[0x07]["VALUE"]: 00 00 00 00 00 00 00 00 52 bb 36 89 ad 7e d6 57 e7 4f f7 3f bc dd 54 62
[debug] pkgmetadata[0x08]["VALUE"]: 81 04 70 00 01 00 01 00
[debug] pkgmetadata[0x09]["VALUE"]: 00 00 00 00 00 00 00 00
despairoharmony commented 4 years ago

Someone reversed the arcade pkgs, you can see it here: https://www.arcade-projects.com/forums/index.php?thread/6132-system-357-pkg-decryption/

windsurfer1122 commented 4 years ago

@despairoharmony Thank you.

Had a quick look, looks manageable to implement. Keep fingers crossed and have some patience.

windsurfer1122 commented 4 years ago

Check out the latest commit c894d5d01a218e6154197c5e67b27130a3c55b36

If anyone can find out if there's something inside the headers to recognize such arcade packages, then please report.