PS3 HDD Decryption Helper

PS3 PS3 HDD Decryption Helper 2023-12-07

Berion

Developer
Berion submitted a new resource:

PS3 HDD Decryption Helper - Bunch of bash scripts for automate PS3 HDD decryption, mounting and unmounting.

Bunch of bash scripts for automate PS3 HDD decryption, mounting and unmounting.
  1. Unpack them in Your home dir, don't change any folder or file names.
  2. Drop ERK into /keys dir as "eid_root_key.bin".
  3. Drop bswap16-ecb and ufs (optionally) kernel module in ps3 dir.
  4. Run keygen script.
  5. Run mounter script.
  6. Have fun under /storage (root privileges needed).
  7. Run umounter script.
Download latest version...

ps3hdd_script_dir-png.38487
 
Last edited:
2022-09-05

TODO:
  • mounter and umounter script update to covering up OOS environments.
  • ufs.ko and -rw support
Changes of PS3 HDD Keygen since version 1.8b:
  • keys are now read from /keys dir, so keygen will not make mess in ps3 dir producing tons of seeds and keys involved in the ata and vflash forging (and I do not deleting them for a reason)
  • keys path are no longer hardcoded, instead using home variable

You do not need to afraid of disk initialization because none of the Linux distributions doing that and even not asked about that.
What are those NAND/NOR models You can read here (the same for debug and devkits models):
https://www.psdevwiki.com/ps3/SKU_Models

Do NOT mix keys creation and different models! It will not work. All three supported model series using different key set and in different way encrypting HDD, so You CANNOT make mistake, or else You will not decrypt and mount anything but garbage.
In case of problems, run reporter script and post here the output from it. This will save a lot of Your and our time to diagnose Your environment and mistakes. ;p

All partitions mounted will be in "~/ps3/storage/", inside folder corresponding to CellOS mount points name (eg. "~/ps3/storage/dev_hdd0/"). Browse as root, NOT as normal user. Do NOT change files permissions and ownership, they must stays the same as was, or else You will experience problems in PS3.
 
Last edited:
2022-09-07

I have updated script. Besides few cleaning code, added possibility to mount UFS2 partition with write privilege if ufs.ko will be found (otherwise, it will be read only as usually).

Big thanks to @gmipf for ufs kernel module compilation.
 
@Ronnie Sahlberg Would save a lot of hassle to end user but fuse allows access only to mountable filesystem, while not everything have any fs.

If You are interested, there is HDD Reader (read only access, write only by sectors replacement) written by 3141card which dealing with decryption, BigEndian and posix from UFS2. Source available. And FuseUFS2+BE fork made by the same programmer from FuseUFS which dealing with BigEndian and offer writing, yet it is highly unstable (can destroy fs easily).
 
Seems really helpful! I'll keep this in case the YLOD comes back on this system and I need to migrate to a new console. "Bswap16 and ufs are placed in the ps3 dir" - do I do this ahead of time or is it done when I run the helper?
 
@puddii Everything is in "/docs/readme.md". ;) You need three things:
  1. bswap16-ecb kernel module which means You need compile it yourself or use matched for it kernel version from Linux distributions. As I'm Mint user, in the archive there are compiled versions for Mint live sessions from last few years.
  2. ufs kernel module, but only if you want write data to HDD, for reading alone, You don't need it. The same like above, but currently compiled there is only for Ubuntu 19.10.
  3. EID Root Key (ERK in short, some people call it also EID0). Mandatory because HDD is encrypted and from this one further keys are calculated. ERK is per console unit and this is the reason You cannot put HDD from one PS3 to another and read it without formatting - encryption keys are different so another PS3 cannot decrypt data from different PS3. ERK can be obtained only on CFW (so not on HEN and HAN, at least not today).
- - -
Decryption giving You a lot more freedom than just access to Your data alone, like eg:
  • removing OtherOS (in case of OOS bootloop caused by damaged Petitboot or Linux on dev_hdd2)
  • changing UFS2 preservation space to 1% (but easier to do by PS3 Unlock HDD)
  • changing maximum size of HDD (handy for HDD which exceeding supported size)
  • backup partition table (handy for situation when Windows will initialize PS3 HDD, allows You avoiding formatting)
  • fixing bootloop (in case cache partition is broken and/or update file unpacked damaged, this allows You avoid formatting)
  • access to VFLASH raw area
  • access to whole disk raw sections
- - -

If You want know more:
https://www.psx-place.com/threads/h...on-3-hdd-on-pc-tutorials-tools-hub-faq.36261/

If You want know how to do it manually:
https://www.psx-place.com/threads/tutorial-hdd-mounting-and-decryption-on-linux.23308/

- - -

If You want only retrieve data, it is easier to use PS3 HDD Reader written by 3141card.
 
Last edited:
Initially, an HDD reader would work for backup purposes, but then I'd like to switch the HDD to a new console and move all the files back over (including dev_flash2 from what I've read) which would require write access.

It seems like your tool definitely overshoots what I would need haha. But it definitely would help with moving the large amount of files without going through the ps3. I found a very annoying issue with moving many small files via FTP which I would like to avoid if I were to move the backups to a freshly formatted drive.

I would probably not connect the drive to Windows. I have a tower PC that I use a USB drive with Ubuntu to boot it up as I don't have another OS on a hard drive to use. I'll have to look into it when this PS3's YLOD comes back and I need to switch it to a new console.
 
Actually my is toolkit (scripts and organizing). Tools are written by other people. ^^

For dev_flash/2/3 access You don't need ufs.ko because all those partitions are on FAT16 and FAT32. But for UFS2 is mandatory.

So only thing missing for You now is ERK from both consoles (source and target). :) Good luck.

BTW: Maybe in next year I will thinking about "PS3 HDD Cloner" script. Should be doable but this needs a lot of tests. Or maybe You volunteer? :D Nah, impossible, I forgot about HDD assigning in NAND/NOR.
 
Last edited:
Anyone volunteer to test cloning script? :) No brick risk but data loss risk on HDD, and potential problems to be fixed via fw update/reinstall (so be sure You are able to perform it!).

Requirements:
  • Basic Linux knowledge (to know how to run Linux in live mode, run script and determine device name).
  • ERK for both consoles, for source HDD and for target HDD.
  • CFW to be able to read ERK (EID Root Key).
  • Due to disk assigning, it means also sacrificing data for target console.
Limitations:
  • If fw was different on both NOR models, or if disk clone is for target NOR, then fw reinstall is high probably mandatory.
  • BSOD on first and/or second run on target console.
  • Target HDD cannot be smaller than source HDD. Target HDD if larger, cannot use whole space. This is because of we don't have any tool to manipulate UFS2 filesystem on Linux.
  • Not possible to use WSL or WSL2. VMs needs physical access to disks. So best avoid it and just run Linux in live mode or already installed.
- - -
Also in next update I will add script which compiling bswap16-ecb kernel module and experimental compiling for ufs module (but the last one for me outputting (probably) set up ufs in -ro anyway, I don't know how to check this and in config I've turned on writing).
 
Last edited:
That's surprising and really good news. I've tested on default Ubuntu kernel for WSL2 in time when it was added, and wasn't compile to be precisely.

Would You kindly volunteer to test if You can decrypt it and write there on UFS2? I can send to You my test disk image (4GiB).
 

Similar threads

Back
Top