PSPReverse / PSPTool

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

Rework rom-size detection #19

Open RobertBuhren opened 4 years ago

RobertBuhren commented 4 years ago

Problem:

The PSP firmware filesystem is part of the UEFI image that (usually) resides on an SPI attached flash chip. Depending on the size of the flash, the AMD bootloader applies a mask to any flash address that is used in the firmware filesystem. E.g. 0x7FFFFF for 8MB flash chips and 0xFFFFFF for 16MB flash images. In order to parse the firmware entries, we need to apply the correct mask to all addresses used within the directories.

PSPTool currently allows to parse firmware images that are embedded in larger files. E.g. a UEFI flash image that is part of an ISO file. We can't determine the correct mask just based on the input file size. We need to determine the size of the UEFI image within the input file.

Solution

  1. Assume a default of 16MB (most common these days) and provide an option to manually specify the UEFI image size.

See: #11