redumper icon indicating copy to clipboard operation
redumper copied to clipboard

Add XGD support for Kreon Drives

Open tbejos opened this issue 6 months ago • 7 comments

This adds the ability to dump the security sector from a drive flashed with the Kreon drive, unlock the drive to read the full game partition, and lock the drive again to dump the L1 Video portion.

Security Sector Files:

When dumping an XGD there will now be a .raw_ss file which is the security sector as it was read from the drive. For XGD1 discs this will be copied as a .ss file as well. For XGD2 and XGD3 files it performs the angle cleanup and saves the cleaned version as a .ssv1 file. This allows for both the "raw" and "processed" version of the security sector to be present in the dump.

Testing Status:

All of the following tests were done by myself, unless otherwise noted, using a TS-H353B (SH-D163B after flashing). My dumps had no errors so I manually manipulated the state file to test refine. I have added this modified state file as <image-name>-refine.state in the zip files.

These were all tested on Windows 11, I will retest on Linux and update this line when I do so.

XGD1: (http://redump.org/disc/13538/)

  • [x] DUMP
  • [x] REFINE
  • [x] VERIFY
  • [x] SS Matches

XGD2: (http://redump.org/disc/11809/)

  • [x] DUMP
  • [x] REFINE
  • [x] VERIFY
  • [x] SSv1 Matches

XGD3: (http://redump.org/disc/37091/)

  • [x] DUMP
  • [x] REFINE
  • [x] VERIFY
  • [ ] SSv1 Matches (Could not find SSv1 listed for any XGD3 games I own so nothing to compare to)

PS2: (http://redump.org/disc/22865/)

  • [x] DUMP
  • [x] REFINE
  • [x] VERIFY

Important Information

Linux Fix:

For the vendor specific command to set the lock state of the drive it would normally fit fine into a CDB 6, however a bug was discovered where for opcodes with a group code of 6 or 7 (opcodes 0xC0 - 0xFF) libata in the kernel checks a table which expects the CDB to have a length of 10 and will refuse to send the command to the device. This did not affect drives connected via USB-Attached SCSI, but affected all drives connected via SATA or IDE. Both Windows and Linux work when sending it as a CDB 10 so the change was made to make it that even though not all of the bytes are strictly needed. I have reached out to the Linux kernel mailing list to possibly remedy this issue in the future, however there is no guarantee the change will happen, and if it did only distros that run the newest kernel releases or back-port this patch would see it fixed so this change will likely need to remain for the foreseeable future.

(As a note the CDB is currently a uint8_t [] but if a structure for Generic CDB10 is known I could switch to using that)

Things Missing:

  • No changes were made for the info command. @Deterous has plans to add these changes as a follow on PR.
  • On some drives there sometimes seem to be issues sending the full security sector dump command sequence, however they seem to be able to send some of the commands with success (so far this has only been reported for XGD2). I will look into adding additional checks so that instead of failing the dump it can save the partial SS in it's own file (or maybe not write to a file at all) but still allow dumping of the ISO to complete.

tbejos avatar Aug 18 '24 06:08 tbejos