PSPReverse / PSPTool

Display, extract, and manipulate PSP firmware inside UEFI images
GNU General Public License v3.0
612 stars 62 forks source link

PSPTool does not support reading "Dragon Range" UEFI/PSP firmware #63

Open moldimolt opened 1 month ago

moldimolt commented 1 month ago

Hello,

It appears PSPTool does not support reading/extracting/etc. the attached UEFI ROMs from ASUS GX650PY (7945HX) and G733PYV (7945HX3D). The ROM images/PSP data within appears to be intact/undamaged, as AM5 SMU Checker v0.8 and IOActive's efs_parser.py can read them. Please see the attached files and the error output:

noellemercer@Noelles-MacBook-Pro Downloads % psptool G733PYV323.rom
Warning: Couldn't parse entry at: 0x123000. Type: 0x48. Size 0x100
Warning: Couldn't parse entry at: 0x124000. Type: 0x4a. Size 0x100
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.13/bin/psptool", line 8, in <module>
    sys.exit(main())
             ~~~~^^
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/psptool/__main__.py", line 105, in main
    psp = PSPTool.from_file(args.file, verbose=args.verbose)
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/psptool/psptool.py", line 33, in from_file
    pt = PSPTool(file_bytes, verbose=verbose)
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/psptool/psptool.py", line 41, in __init__
    self.blob = Blob(rom_bytes, len(rom_bytes), self)
                ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/psptool/blob.py", line 68, in __init__
    potential_rom = Rom(self, rom_size, rom_offset, fet_offset, psptool)
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/psptool/rom.py", line 20, in __init__
    self.fet = Fet(self, fet_offset, psptool)
               ~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/psptool/fet.py", line 45, in __init__
    self._parse_entry_table()
    ~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/psptool/fet.py", line 121, in _parse_entry_table
    self._create_directory(rom_addr, dir_magic, zen_generation='unknown')
    ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/psptool/fet.py", line 92, in _create_directory
    secondary_dir = Directory(self.rom, secondary_directory_address, 'secondary', self.psptool, zen_generation)
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/psptool/directory.py", line 76, in __init__
    self._parse_entries()
    ~~~~~~~~~~~~~~~~~~~^^
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/psptool/directory.py", line 140, in _parse_entries
    entry_fields['offset'] &= self.rom.addr_mask
    ~~~~~~~~~~~~^^^^^^^^^^
KeyError: 'offset'
noellemercer@Noelles-MacBook-Pro Downloads % psptool GX650PY319.rom
Warning: Couldn't parse entry at: 0x123000. Type: 0x48. Size 0x100
Warning: Couldn't parse entry at: 0x124000. Type: 0x4a. Size 0x100
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.13/bin/psptool", line 8, in <module>
    sys.exit(main())
             ~~~~^^
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/psptool/__main__.py", line 105, in main
    psp = PSPTool.from_file(args.file, verbose=args.verbose)
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/psptool/psptool.py", line 33, in from_file
    pt = PSPTool(file_bytes, verbose=verbose)
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/psptool/psptool.py", line 41, in __init__
    self.blob = Blob(rom_bytes, len(rom_bytes), self)
                ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/psptool/blob.py", line 68, in __init__
    potential_rom = Rom(self, rom_size, rom_offset, fet_offset, psptool)
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/psptool/rom.py", line 20, in __init__
    self.fet = Fet(self, fet_offset, psptool)
               ~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/psptool/fet.py", line 45, in __init__
    self._parse_entry_table()
    ~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/psptool/fet.py", line 121, in _parse_entry_table
    self._create_directory(rom_addr, dir_magic, zen_generation='unknown')
    ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/psptool/fet.py", line 92, in _create_directory
    secondary_dir = Directory(self.rom, secondary_directory_address, 'secondary', self.psptool, zen_generation)
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/psptool/directory.py", line 76, in __init__
    self._parse_entries()
    ~~~~~~~~~~~~~~~~~~~^^
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/psptool/directory.py", line 140, in _parse_entries
    entry_fields['offset'] &= self.rom.addr_mask
    ~~~~~~~~~~~~^^^^^^^^^^
KeyError: 'offset'

Thank you.

cwerling commented 4 weeks ago

Thanks! Please try out the zen5 branch. It's still in development though and I cannot give an ETA of when it will be finished/hit the main branch.

python3 -m psptool /Users/cwerling/Downloads/GX650PY319.rom
Warning: Input  file is 0x2000000, will assume ROM size of 32M
Warning: ParseError from DirectoryEntry(self.type=0x8d, self.type_flags=0x0, self.size=0x30, self.offset=0x1ce000, self.rsv0=0x80000000):
  File should not have both sha256 and sha384 checksum bits set!
Warning: ParseError from BiosDirectoryEntry(self.type=0x62, self.type_flags=0xb, self.size=0x500020, self.offset=0x1e02000, self.rsv0=0x40000000, self.destination=0x9afffe0):
  Cannot create child buffer: overflows parent buffer's bounds!
Warning: ParseError from BiosDirectoryEntry(self.type=0x62, self.type_flags=0x1b, self.size=0x500020, self.offset=0x1c02000, self.rsv0=0x40000000, self.destination=0x9afffe0):
  Cannot create child buffer: overflows parent buffer's bounds!
Warning: ParseError from DirectoryEntry(self.type=0x8d, self.type_flags=0x0, self.size=0x30, self.offset=0x1ce000, self.rsv0=0x80000000):
  File should not have both sha256 and sha384 checksum bits set!
Warning: ParseError from BiosDirectoryEntry(self.type=0x62, self.type_flags=0xb, self.size=0x500020, self.offset=0x1e02000, self.rsv0=0x40000000, self.destination=0x9afffe0):
  Cannot create child buffer: overflows parent buffer's bounds!
Warning: ParseError from BiosDirectoryEntry(self.type=0x62, self.type_flags=0x1b, self.size=0x500020, self.offset=0x1c02000, self.rsv0=0x40000000, self.destination=0x9afffe0):
  Cannot create child buffer: overflows parent buffer's bounds!
Warning: FET entry 0x1ffffff not found or invalid, skipping ...
+-----+------+-----------+---------+---------------+
| ROM | Addr |    Size   |   FET   |     AGESA     |
+-----+------+-----------+---------+---------------+
|  0  | 0x0  | 0x2000000 | 0x20000 | AGESA_UNKNOWN |
+-----+------+-----------+---------+---------------+
+--+-----------+----------+------------+-------+---------------------+
|  | Directory |   Addr   | Generation | Magic | Secondary Directory |
+--+-----------+----------+------------+-------+---------------------+
|  |     0     | 0x121000 |    None    |  $PSP |                     |
+--+-----------+----------+------------+-------+---------------------+
+--+---+-------+----------+------+------+----------+--------------+-----------+
|  |   | Entry |  Address | Size | Type | Magic/ID | File Version | File Info |
+--+---+-------+----------+------+------+----------+--------------+-----------+
|  |   |     0 | 0x123000 |  0x0 | 0x48 |          |              |           |
|  |   |     1 | 0x124000 |  0x0 | 0x4a |          |              |           |
+--+---+-------+----------+------+------+----------+--------------+-----------+

+--+-----------+----------+------------+-------+---------------------+
|  | Directory |   Addr   | Generation | Magic | Secondary Directory |
+--+-----------+----------+------------+-------+---------------------+
|  |     1     | 0x19d000 |    None    |  $PL2 |       0x51d000      |
+--+-----------+----------+------------+-------+---------------------+
Warning: Could not verify sha256 checksum for HeaderFile(type=0x42, address=0x2b8500, size=0xcdb0, len(references)=1)
+--+---+-------+----------+---------+-----------------------------+----------+--------------+------------------------------------------+
|  |   | Entry |  Address |    Size |                        Type | Magic/ID | File Version |                                File Info |
+--+---+-------+----------+---------+-----------------------------+----------+--------------+------------------------------------------+
|  |   |     0 | 0x19d400 |   0x440 |          AMD_PUBLIC_KEY~0x0 |     879E |            1 |                            AMD_CODE_SIGN |
|  |   |     1 | 0x19d900 |  0x1ec0 |      PSP_FW_BOOT_LOADER~0x1 |     $PS1 |    0.2B.0.4D |                verified(879E), sha256_ok |
|  |   |     2 | 0x19f800 | 0x12600 |     PSP_FW_BOOT_LOADER~0x73 |     $PS1 |    0.2B.0.4D |                verified(1753), sha256_ok |
|  |   |     3 | 0x1b1e00 |   0x210 |                        0x76 |     $PS1 |      3.0.1.4 |                verified(75CA), sha256_ok |
|  |   |     4 | 0x1b3100 | 0x16470 |       PSP_FW_TRUSTED_OS~0x2 |     $PS1 |    0.2B.0.4D |                verified(BD5B), sha256_ok |
|  |   |     5 | 0x1c9600 | 0x21840 |   PSP_SMU_FN_FIRMWARE~0x108 |     $PS1 |    0.54.62.0 | compressed, veri-failed(D63D), sha256_ok |
|  |   |     6 | 0x1eaf00 |   0x440 |      SEC_DBG_PUBLIC_KEY~0x9 |     CEFB |            1 |     verified(879E), unknown_key_usage(3) |
|  |   |     7 |   0xc041 |     0x0 |      SOFT_FUSE_CHAIN_01~0xb |          |              |                                          |
|  |   |     8 | 0x1eb400 | 0x23100 | PSP_BOOT_TIME_TRUSTLETS~0xc |     $PS1 |     6.1D.0.6 |                verified(CC7D), sha256_ok |
|  |   |     9 | 0x20e500 |  0x2180 |           DEBUG_UNLOCK~0x13 |     $PS1 |    0.2B.0.4D |                verified(7CC9), sha256_ok |
|  |   |    10 | 0x210700 |   0x610 |     HARDWARE_IP_CONFIG~0x20 |     $PS1 |      0.0.0.3 |                verified(3AEB), sha256_ok |
|  |   |    11 | 0x210e00 |    0x30 |           WRAPPED_IKEK~0x21 |          |              |                                          |
|  |   |    12 | 0x211000 |  0x1000 |           TOKEN_UNLOCK~0x22 |          |              |                                          |
|  |   |    13 | 0x212000 |  0x4c20 |             SEC_GASKET~0x24 |     $PS1 |    D.26.0.49 |                verified(972D), sha256_ok |
|  |   |    14 | 0x216d00 | 0x23890 |         DRIVER_ENTRIES~0x28 |     $PS1 |    0.2B.0.4D |                verified(BD5B), sha256_ok |
|  |   |    15 | 0x23a600 |  0xe020 |                       0x12a |     $PS1 |    0.54.62.0 | compressed, veri-failed(D63D), sha256_ok |
|  |   |    16 | 0x248700 |  0x3100 |            S0I3_DRIVER~0x2d |     $PS1 |  26.10.90.10 |                verified(CC7D), sha256_ok |
|  |   |    17 | 0x24b800 |   0x2a0 |                   ABL0~0x30 |     $PS1 |   32.3.90.20 |                verified(3E13), sha256_ok |
|  |   |    18 | 0x2b6c00 |  0x1900 |          VBIOS_PRELOAD~0x3c |     $PS1 |    20.13.0.7 |                verified(ACE2), sha256_ok |
|  |   |    19 | 0x2b8500 |  0xcdb0 |                 FW_GEC~0x42 |     $PS1 |     0.1.2D.0 |      verified(3C23), sha256_inconsistent |
|  |   |    20 | 0x2c5300 |   0x210 |             FW_INVALID~0x44 |     $PS1 |      0.3.0.2 |                verified(511F), sha256_ok |
|  |   |    21 | 0x2cba00 |  0x2450 |    TOS_SECURITY_POLICY~0x45 |     $PS1 |   D.26.40.49 |                verified(972D), sha256_ok |
|  |   |    22 | 0x2cdf00 |  0x5100 |                DRTM_TA~0x47 |     $PS1 |    4.11.0.33 |                verified(61CE), sha256_ok |
|  |   |    23 | 0x51d000 |   0x400 |                        0x49 |          |              |                                          |
|  |   |    24 | 0x2d3000 |  0x1df0 |           KEY_DATABASE~0x50 |     $PS1 |            1 |                verified(879E), sha256_ok |
|  |   |    25 | 0x2d4e00 |  0x1310 |         TOS_PUBLIC_KEY~0x51 |     $PS1 |            1 |                verified(879E), sha256_ok |
|  |   |    26 | 0x2d6200 |   0x6a0 |        BL_ROLLBACK_SPL~0x55 |     $PS1 |    5.2B.0.4C |                verified(879E), sha256_ok |
|  |   |    27 | 0x2d6900 |   0x520 |          MSMU_BINARY_0~0x5a |     $PS1 |    FF.54.5.0 | compressed, veri-failed(5E2F), sha256_ok |
|  |   |    28 | 0x2d6f00 |   0xb20 |                   WMOS~0x5c |     $PS1 |    0.19.40.1 |                verified(8A19), sha256_ok |
|  |   |    29 | 0x2d7b00 | 0x13130 |                        0x5d |          |     A0.A.9.0 |                verified(DB85), sha256_ok |
|  |   |    30 | 0x2ead00 | 0x60000 |          FW_PSP_SMUSCS~0x5f |          |              |                                          |
|  |   |    31 | 0x34ad00 | 0x20290 |              DMCUB_INS~0x71 |     $PS1 |     5.0.6.42 |                verified(45B9), sha256_ok |
|  |   |    32 | 0x36b100 |  0x5560 |                        0x91 |     $PS1 |    AB.3.55.0 | compressed, veri-failed(3C23), sha256_ok |
|  |   |    33 | 0x14d000 | 0x20250 |                        0x93 |     $PS1 |    0.0.10.14 |                verified(4ABA), sha256_ok |
|  |   |    34 | 0x175000 | 0x20250 |                        0x93 |     $PS1 |    0.0.10.14 |                verified(4ABA), sha256_ok |
|  |   |    35 |  0xc1000 | 0x20000 |             PSP_NV_DATA~0x4 |          |              |                                          |
|  |   |    36 |  0xe1000 | 0x40000 |              PSP_NVRAM~0x54 |          |              |                                          |
+--+---+-------+----------+---------+-----------------------------+----------+--------------+------------------------------------------+

+--+-----------+----------+------------+-------+---------------------+
|  | Directory |   Addr   | Generation | Magic | Secondary Directory |
+--+-----------+----------+------------+-------+---------------------+
|  |     2     | 0x51d000 |    None    |  $BL2 |                     |
+--+-----------+----------+------------+-------+---------------------+
+--+---+-------+-----------+---------+----------------------+----------+--------------+------------------------------------------+
|  |   | Entry |   Address |    Size |                 Type | Magic/ID | File Version |                                File Info |
+--+---+-------+-----------+---------+----------------------+----------+--------------+------------------------------------------+
|  |   |     0 |  0x51d400 |  0x4000 |       APCB_COPY~0x68 |          |              |                                          |
|  |   |     1 |  0x522000 |  0x3000 |            APCB~0x60 |          |              |                                          |
|  |   |     2 |  0x525000 |  0x3000 |       APCB_COPY~0x68 |          |              |                                          |
|  |   |     3 |       0x0 |     0x0 |            APOB~0x61 |          |              |                                          |
|  |   |     4 |  0x125000 | 0x28000 |    APOB_NV_COPY~0x63 |          |              |                                          |
|  |   |     5 |  0x528000 |  0x5f10 |        PMU_CODE~0x64 |     $PS1 |     0.0.A0.4 | compressed, veri-failed(9048), sha256_ok |
|  |   |     6 |  0x52e000 |   0x4d0 |        PMU_DATA~0x65 |     $PS1 |     0.0.A0.4 | compressed, veri-failed(9048), sha256_ok |
|  |   |     7 |  0x52e500 |  0x58e0 |        PMU_CODE~0x64 |     $PS1 |     0.0.A0.4 | compressed, veri-failed(9048), sha256_ok |
|  |   |     8 |  0x533e00 |   0x250 |        PMU_DATA~0x65 |     $PS1 |     0.0.A0.4 | compressed, veri-failed(9048), sha256_ok |
|  |   |     9 |  0x534100 |  0x2ce0 |        PMU_CODE~0x64 |     $PS1 |     0.0.0.10 | compressed, veri-failed(9048), sha256_ok |
|  |   |    10 |  0x536e00 |   0x3b0 |        PMU_DATA~0x65 |     $PS1 |     0.0.0.10 | compressed, veri-failed(9048), sha256_ok |
|  |   |    11 | 0x1020000 | 0x20000 |                 0x6d |          |              |                                          |
|  |   |    12 | 0x1000000 | 0x20000 |                 0x6d |          |              |                                          |
|  |   |    13 | 0x1040000 | 0x10000 |                 0x6d |          |              |                                          |
|  |   |    14 |  0x537200 |  0x15c0 | MICROCODE_PATCH~0x66 |          |              |                                          |
|  |   |    15 |  0x538800 |  0x15c0 | MICROCODE_PATCH~0x66 |          |              |                                          |
+--+---+-------+-----------+---------+----------------------+----------+--------------+------------------------------------------+

+--+-----------+----------+------------+-------+---------------------+
|  | Directory |   Addr   | Generation | Magic | Secondary Directory |
+--+-----------+----------+------------+-------+---------------------+
|  |     3     | 0x565000 |    None    |  $PL2 |       0x8e5000      |
+--+-----------+----------+------------+-------+---------------------+
Warning: Could not verify sha256 checksum for HeaderFile(type=0x42, address=0x680500, size=0xcdb0, len(references)=1)
+--+---+-------+----------+---------+-----------------------------+----------+--------------+------------------------------------------+
|  |   | Entry |  Address |    Size |                        Type | Magic/ID | File Version |                                File Info |
+--+---+-------+----------+---------+-----------------------------+----------+--------------+------------------------------------------+
|  |   |     0 | 0x565400 |   0x440 |          AMD_PUBLIC_KEY~0x0 |     879E |            1 |                            AMD_CODE_SIGN |
|  |   |     1 | 0x565900 |  0x1ec0 |      PSP_FW_BOOT_LOADER~0x1 |     $PS1 |    0.2B.0.4D |                verified(879E), sha256_ok |
|  |   |     2 | 0x567800 | 0x12600 |     PSP_FW_BOOT_LOADER~0x73 |     $PS1 |    0.2B.0.4D |                verified(1753), sha256_ok |
|  |   |     3 | 0x579e00 |   0x210 |                        0x76 |     $PS1 |      3.0.1.4 |                verified(75CA), sha256_ok |
|  |   |     4 | 0x57b100 | 0x16470 |       PSP_FW_TRUSTED_OS~0x2 |     $PS1 |    0.2B.0.4D |                verified(BD5B), sha256_ok |
|  |   |     5 | 0x591600 | 0x21840 |   PSP_SMU_FN_FIRMWARE~0x108 |     $PS1 |    0.54.62.0 | compressed, veri-failed(D63D), sha256_ok |
|  |   |     6 | 0x5b2f00 |   0x440 |      SEC_DBG_PUBLIC_KEY~0x9 |     CEFB |            1 |     verified(879E), unknown_key_usage(3) |
|  |   |     7 |   0xc041 |     0x0 |      SOFT_FUSE_CHAIN_01~0xb |          |              |                                          |
|  |   |     8 | 0x5b3400 | 0x23100 | PSP_BOOT_TIME_TRUSTLETS~0xc |     $PS1 |     6.1D.0.6 |                verified(CC7D), sha256_ok |
|  |   |     9 | 0x5d6500 |  0x2180 |           DEBUG_UNLOCK~0x13 |     $PS1 |    0.2B.0.4D |                verified(7CC9), sha256_ok |
|  |   |    10 | 0x5d8700 |   0x610 |     HARDWARE_IP_CONFIG~0x20 |     $PS1 |      0.0.0.3 |                verified(3AEB), sha256_ok |
|  |   |    11 | 0x5d8e00 |    0x30 |           WRAPPED_IKEK~0x21 |          |              |                                          |
|  |   |    12 | 0x5d9000 |  0x1000 |           TOKEN_UNLOCK~0x22 |          |              |                                          |
|  |   |    13 | 0x5da000 |  0x4c20 |             SEC_GASKET~0x24 |     $PS1 |    D.26.0.49 |                verified(972D), sha256_ok |
|  |   |    14 | 0x5ded00 | 0x23890 |         DRIVER_ENTRIES~0x28 |     $PS1 |    0.2B.0.4D |                verified(BD5B), sha256_ok |
|  |   |    15 | 0x602600 |  0xe020 |                       0x12a |     $PS1 |    0.54.62.0 | compressed, veri-failed(D63D), sha256_ok |
|  |   |    16 | 0x610700 |  0x3100 |            S0I3_DRIVER~0x2d |     $PS1 |  26.10.90.10 |                verified(CC7D), sha256_ok |
|  |   |    17 | 0x613800 |   0x2a0 |                   ABL0~0x30 |     $PS1 |   32.3.90.20 |                verified(3E13), sha256_ok |
|  |   |    18 | 0x67ec00 |  0x1900 |          VBIOS_PRELOAD~0x3c |     $PS1 |    20.13.0.7 |                verified(ACE2), sha256_ok |
|  |   |    19 | 0x680500 |  0xcdb0 |                 FW_GEC~0x42 |     $PS1 |     0.1.2D.0 |      verified(3C23), sha256_inconsistent |
|  |   |    20 | 0x68d300 |   0x210 |             FW_INVALID~0x44 |     $PS1 |      0.3.0.2 |                verified(511F), sha256_ok |
|  |   |    21 | 0x693a00 |  0x2450 |    TOS_SECURITY_POLICY~0x45 |     $PS1 |   D.26.40.49 |                verified(972D), sha256_ok |
|  |   |    22 | 0x695f00 |  0x5100 |                DRTM_TA~0x47 |     $PS1 |    4.11.0.33 |                verified(61CE), sha256_ok |
|  |   |    23 | 0x8e5000 |   0x400 |                        0x49 |          |              |                                          |
|  |   |    24 | 0x69b000 |  0x1df0 |           KEY_DATABASE~0x50 |     $PS1 |            1 |                verified(879E), sha256_ok |
|  |   |    25 | 0x69ce00 |  0x1310 |         TOS_PUBLIC_KEY~0x51 |     $PS1 |            1 |                verified(879E), sha256_ok |
|  |   |    26 | 0x69e200 |   0x6a0 |        BL_ROLLBACK_SPL~0x55 |     $PS1 |    5.2B.0.4C |                verified(879E), sha256_ok |
|  |   |    27 | 0x69e900 |   0x520 |          MSMU_BINARY_0~0x5a |     $PS1 |    FF.54.5.0 | compressed, veri-failed(5E2F), sha256_ok |
|  |   |    28 | 0x69ef00 |   0xb20 |                   WMOS~0x5c |     $PS1 |    0.19.40.1 |                verified(8A19), sha256_ok |
|  |   |    29 | 0x69fb00 | 0x13130 |                        0x5d |          |     A0.A.9.0 |                verified(DB85), sha256_ok |
|  |   |    30 | 0x6b2d00 | 0x60000 |          FW_PSP_SMUSCS~0x5f |          |              |                                          |
|  |   |    31 | 0x712d00 | 0x20290 |              DMCUB_INS~0x71 |     $PS1 |     5.0.6.42 |                verified(45B9), sha256_ok |
|  |   |    32 | 0x733100 |  0x5560 |                        0x91 |     $PS1 |    AB.3.55.0 | compressed, veri-failed(3C23), sha256_ok |
|  |   |    33 | 0x14d000 | 0x20250 |                        0x93 |     $PS1 |    0.0.10.14 |                verified(4ABA), sha256_ok |
|  |   |    34 | 0x175000 | 0x20250 |                        0x93 |     $PS1 |    0.0.10.14 |                verified(4ABA), sha256_ok |
|  |   |    35 |  0xc1000 | 0x20000 |             PSP_NV_DATA~0x4 |          |              |                                          |
|  |   |    36 |  0xe1000 | 0x40000 |              PSP_NVRAM~0x54 |          |              |                                          |
+--+---+-------+----------+---------+-----------------------------+----------+--------------+------------------------------------------+

+--+-----------+----------+------------+-------+---------------------+
|  | Directory |   Addr   | Generation | Magic | Secondary Directory |
+--+-----------+----------+------------+-------+---------------------+
|  |     4     | 0x8e5000 |    None    |  $BL2 |                     |
+--+-----------+----------+------------+-------+---------------------+
+--+---+-------+-----------+---------+----------------------+----------+--------------+------------------------------------------+
|  |   | Entry |   Address |    Size |                 Type | Magic/ID | File Version |                                File Info |
+--+---+-------+-----------+---------+----------------------+----------+--------------+------------------------------------------+
|  |   |     0 |  0x8e5400 |  0x4000 |       APCB_COPY~0x68 |          |              |                                          |
|  |   |     1 |  0x8ea000 |  0x3000 |            APCB~0x60 |          |              |                                          |
|  |   |     2 |  0x8ed000 |  0x3000 |       APCB_COPY~0x68 |          |              |                                          |
|  |   |     3 |       0x0 |     0x0 |            APOB~0x61 |          |              |                                          |
|  |   |     4 |  0x125000 | 0x28000 |    APOB_NV_COPY~0x63 |          |              |                                          |
|  |   |     5 |  0x8f0000 |  0x5f10 |        PMU_CODE~0x64 |     $PS1 |     0.0.A0.4 | compressed, veri-failed(9048), sha256_ok |
|  |   |     6 |  0x8f6000 |   0x4d0 |        PMU_DATA~0x65 |     $PS1 |     0.0.A0.4 | compressed, veri-failed(9048), sha256_ok |
|  |   |     7 |  0x8f6500 |  0x58e0 |        PMU_CODE~0x64 |     $PS1 |     0.0.A0.4 | compressed, veri-failed(9048), sha256_ok |
|  |   |     8 |  0x8fbe00 |   0x250 |        PMU_DATA~0x65 |     $PS1 |     0.0.A0.4 | compressed, veri-failed(9048), sha256_ok |
|  |   |     9 |  0x8fc100 |  0x2ce0 |        PMU_CODE~0x64 |     $PS1 |     0.0.0.10 | compressed, veri-failed(9048), sha256_ok |
|  |   |    10 |  0x8fee00 |   0x3b0 |        PMU_DATA~0x65 |     $PS1 |     0.0.0.10 | compressed, veri-failed(9048), sha256_ok |
|  |   |    11 | 0x1020000 | 0x20000 |                 0x6d |          |              |                                          |
|  |   |    12 | 0x1000000 | 0x20000 |                 0x6d |          |              |                                          |
|  |   |    13 | 0x1040000 | 0x10000 |                 0x6d |          |              |                                          |
|  |   |    14 |  0x8ff200 |  0x15c0 | MICROCODE_PATCH~0x66 |          |              |                                          |
|  |   |    15 |  0x900800 |  0x15c0 | MICROCODE_PATCH~0x66 |          |              |                                          |
+--+---+-------+-----------+---------+----------------------+----------+--------------+------------------------------------------+

+--+-----------+----------+------------+-------+---------------------+
|  | Directory |   Addr   | Generation | Magic | Secondary Directory |
+--+-----------+----------+------------+-------+---------------------+
|  |     5     | 0x122000 |    None    |  $PSP |                     |
+--+-----------+----------+------------+-------+---------------------+
+--+---+-------+----------+------+------+----------+--------------+-----------+
|  |   | Entry |  Address | Size | Type | Magic/ID | File Version | File Info |
+--+---+-------+----------+------+------+----------+--------------+-----------+
|  |   |     0 | 0x123000 |  0x0 | 0x48 |          |              |           |
|  |   |     1 | 0x124000 |  0x0 | 0x4a |          |              |           |
+--+---+-------+----------+------+------+----------+--------------+-----------+
moldimolt commented 4 weeks ago

Hello,

Thank you! My apologies for not trying it earlier, I should have.

moldimolt commented 3 weeks ago

Here's some output I received when trying to extract these ROMs with the latest zen5 branch commit of psptool, if it's helpful for development:

noellemercer@Noelles-MacBook-Pro UEFI Dumps % psptool -Xunk GX650PY319.rom    
Warning: Input  file is 0x2000000, will assume ROM size of 32M
Warning: ParseError from DirectoryEntry(self.type=0x8d, self.type_flags=0x0, self.size=0x30, self.offset=0x1ce000, self.rsv0=0x80000000): 
  File should not have both sha256 and sha384 checksum bits set!
Warning: ParseError from BiosDirectoryEntry(self.type=0x62, self.type_flags=0xb, self.size=0x500020, self.offset=0x1e02000, self.rsv0=0x40000000, self.destination=0x9afffe0): 
  Cannot create child buffer: overflows parent buffer's bounds!
Warning: ParseError from BiosDirectoryEntry(self.type=0x62, self.type_flags=0x1b, self.size=0x500020, self.offset=0x1c02000, self.rsv0=0x40000000, self.destination=0x9afffe0): 
  Cannot create child buffer: overflows parent buffer's bounds!
Warning: ParseError from DirectoryEntry(self.type=0x8d, self.type_flags=0x0, self.size=0x30, self.offset=0x1ce000, self.rsv0=0x80000000): 
  File should not have both sha256 and sha384 checksum bits set!
Warning: ParseError from BiosDirectoryEntry(self.type=0x62, self.type_flags=0xb, self.size=0x500020, self.offset=0x1e02000, self.rsv0=0x40000000, self.destination=0x9afffe0): 
  Cannot create child buffer: overflows parent buffer's bounds!
Warning: ParseError from BiosDirectoryEntry(self.type=0x62, self.type_flags=0x1b, self.size=0x500020, self.offset=0x1c02000, self.rsv0=0x40000000, self.destination=0x9afffe0): 
  Cannot create child buffer: overflows parent buffer's bounds!
Warning: FET entry 0x1ffffff not found or invalid, skipping ...
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.13/bin/psptool", line 8, in <module>
    sys.exit(main())
             ~~~~^^
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/psptool/__main__.py", line 127, in main
    if args.entry_index is None:  # if neither directory_index nor entry_index are specified
       ^^^^^^^^^^^^^^^^
AttributeError: 'Namespace' object has no attribute 'entry_index'
noellemercer@Noelles-MacBook-Pro UEFI Dumps % psptool -Xunk G733PYV323.rom 
Warning: Input  file is 0x2000000, will assume ROM size of 32M
Warning: ParseError from DirectoryEntry(self.type=0x8d, self.type_flags=0x0, self.size=0x30, self.offset=0x1ce000, self.rsv0=0x80000000): 
  File should not have both sha256 and sha384 checksum bits set!
Warning: ParseError from BiosDirectoryEntry(self.type=0x62, self.type_flags=0xb, self.size=0x500020, self.offset=0x1e02000, self.rsv0=0x40000000, self.destination=0x9afffe0): 
  Cannot create child buffer: overflows parent buffer's bounds!
Warning: ParseError from BiosDirectoryEntry(self.type=0x62, self.type_flags=0x1b, self.size=0x500020, self.offset=0x1c02000, self.rsv0=0x40000000, self.destination=0x9afffe0): 
  Cannot create child buffer: overflows parent buffer's bounds!
Warning: ParseError from DirectoryEntry(self.type=0x8d, self.type_flags=0x0, self.size=0x30, self.offset=0x1ce000, self.rsv0=0x80000000): 
  File should not have both sha256 and sha384 checksum bits set!
Warning: ParseError from BiosDirectoryEntry(self.type=0x62, self.type_flags=0xb, self.size=0x500020, self.offset=0x1e02000, self.rsv0=0x40000000, self.destination=0x9afffe0): 
  Cannot create child buffer: overflows parent buffer's bounds!
Warning: ParseError from BiosDirectoryEntry(self.type=0x62, self.type_flags=0x1b, self.size=0x500020, self.offset=0x1c02000, self.rsv0=0x40000000, self.destination=0x9afffe0): 
  Cannot create child buffer: overflows parent buffer's bounds!
Warning: FET entry 0x1ffffff not found or invalid, skipping ...
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.13/bin/psptool", line 8, in <module>
    sys.exit(main())
             ~~~~^^
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/psptool/__main__.py", line 127, in main
    if args.entry_index is None:  # if neither directory_index nor entry_index are specified
       ^^^^^^^^^^^^^^^^
AttributeError: 'Namespace' object has no attribute 'entry_index'
noellemercer@Noelles-MacBook-Pro UEFI Dumps % psptool -Xunk G733PYV334.rom
Warning: Input  file is 0x2000000, will assume ROM size of 32M
Warning: ParseError from DirectoryEntry(self.type=0x8d, self.type_flags=0x0, self.size=0x30, self.offset=0x1d1f00, self.rsv0=0x80000000): 
  File should not have both sha256 and sha384 checksum bits set!
Warning: ParseError from BiosDirectoryEntry(self.type=0x62, self.type_flags=0xb, self.size=0x500020, self.offset=0x1e02000, self.rsv0=0x40000000, self.destination=0x9afffe0): 
  Cannot create child buffer: overflows parent buffer's bounds!
Warning: ParseError from BiosDirectoryEntry(self.type=0x62, self.type_flags=0x1b, self.size=0x500020, self.offset=0x1c02000, self.rsv0=0x40000000, self.destination=0x9afffe0): 
  Cannot create child buffer: overflows parent buffer's bounds!
Warning: ParseError from DirectoryEntry(self.type=0x8d, self.type_flags=0x0, self.size=0x30, self.offset=0x1d1f00, self.rsv0=0x80000000): 
  File should not have both sha256 and sha384 checksum bits set!
Warning: ParseError from BiosDirectoryEntry(self.type=0x62, self.type_flags=0xb, self.size=0x500020, self.offset=0x1e02000, self.rsv0=0x40000000, self.destination=0x9afffe0): 
  Cannot create child buffer: overflows parent buffer's bounds!
Warning: ParseError from BiosDirectoryEntry(self.type=0x62, self.type_flags=0x1b, self.size=0x500020, self.offset=0x1c02000, self.rsv0=0x40000000, self.destination=0x9afffe0): 
  Cannot create child buffer: overflows parent buffer's bounds!
Warning: FET entry 0x1ffffff not found or invalid, skipping ...
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.13/bin/psptool", line 8, in <module>
    sys.exit(main())
             ~~~~^^
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/psptool/__main__.py", line 127, in main
    if args.entry_index is None:  # if neither directory_index nor entry_index are specified
       ^^^^^^^^^^^^^^^^
AttributeError: 'Namespace' object has no attribute 'entry_index'
fox8091 commented 3 weeks ago

Here's some output I received when trying to extract these ROMs with the latest zen5 branch commit of psptool, if it's helpful for development:

\<snip>

The issues here should be handled by #64, though file replacement still isn't implemented.