Some development notes about detecting the PSID, User ID and Account ID for the current console/user:
To properly resign saves, you need to know those IDs (among other things), but I couldn’t find a simple way to gather them all in a consistent way across firmware versions (CFW, HEN, DEX, CEX, et al.)
For example, the PSID can be recovered with lv2 peeks, but the address depends on the firmware version/type, so you must keep an address table and update the tool every time a new firmware shows up.
But… there’s a place where the PS3 always stores all those IDs already, and it’s a save-game’s PARAM.SFO
so I used that in my advantage, to create a firmware-independent way to acquire the ids.
Since I already needed to save the Apollo app settings, I decided to:
- on first run: create my own save-game file, using the internal PS3 save functions
- read my own save-game’s PARAM.SFO, and get the PSID, User ID, and Account ID
- save the detected IDs back into the App settings (so I can speed up the process next time)
- on next launch: just read the app settings, and load the IDs
The code for this trick can be found here (based on the psl1ght example by Kakaroto).
Regarding the PFD/SFO tools source code that I used for Apollo:
- be sure to check for proper definitions in types.h . E.g.: instead of “long long int”, use “int64_t”. It could bring issues when building depending on the platform. (on macOS x64 I ended up having wrong data length for the types)
- be sure to check for proper endianness. The original source is meant for little-endian. When I was porting the code to the PS3 (big-endian), I had to remove or add endianness swaps as needed.
- the source depends on the polarSSL lib
The code itself is very modular (kudos to flatz!) and it could be easily converted to a pfd/sfo handling library without too much work. Right now is embedded in Apollo but I might end up creating the library anyways. (I think it could be used in other PS3 homebrew apps as well)