Howdy again,
This is something initially thought up by Jackal and (I think) iR0b0t.
What it does is trying to fix a mode 2 form 2 sector, which can be found on CD-ROM XA discs, like PSX and CD-i Discs.
These sectors have no ECC code, only a EDC code to check the validity of the sector.
We can try to fix these sectors by brute forcing all the data bytes until we find a match.
That is basically what this program is used for.
It can only fix a single byte for 2 reasons:
1. finding 2 random errors on 2 random places takes 6 days, even with the fast crc routines I am using.
2. trying to fix more then 1 byte means that the possible fixes increase to a level where it is just a random guess as to which is the right fix.
Although, if the demand is there, an option to fix 2 consecutive bytes could be added.
The speed hit then will only be x256 (around 2 minutes on my workstation) and false positives would also be more manageable.
The readme:
What:
This is a not yet idiotproof version of cdxafix.
It is to be used to try to fix Mode 2 Form 2 sectors in Playstation 1 or CD-i CD images.
How:
cdxafix <file> <sector>
File is a PSX, CD-i or other CDXA image file.
Sector is the sector to try to fix.
You get the sector number from CDmage or another CD Image checking utility.
After (or rather, if) cdxafix finds one or more fixes, then you can use applyfix to apply them.
applyfix <file> <sector> <offset> <new data>
First off, there is no undo!
Make a backup first, or re-apply the original data you got from cdxafix (2nd number).
Offset is the first number you got from cdxafix, new data is the 3th (in hex).
Try the fix with the lowest number of bits first, or, if it is availiable, an 8 bit fix.
After fixing, check the image as a whole with redump to see if you get a match.
If you don't, then:
- you have a different pressing.
- and/or there might be other, more subtle errors.
- and/or the error is part of the image.
- and/or redump has faulthy (probably not validated yet) information.
(yes, all 4 could apply too).
A special case is when cdxafix finds a mismatch in the subheader and it's copy.
Then you have to apply all the fixes that are in the list (cdxafix will tell you when this happens).
Why:
Mode 2 Form 2 sectors are only protected by an EDC block and not by ECC.
This means that data errors can not be fixed, only found by CRC checks.
What cdxafix does is try to bruteforce every databyte to find some dataset which matches the EDC.
Warning:
This software is not yet idiotproof!
- It does not check arguments for validity yet.
Also, do NOT, I repeat, DO NOT use this to 'fix' sectors where you have no other means to
check validity of the data (such as a redump.org entry).
ESPECIALLY, do NOT use this to actually 'fix' sectors before submitting a result to redump!
Some CD's deliberately introduce errors in EDC as part of the on disc data,
for instance for copy protection or other means.
This also goes for validity / confirmation entries to redump!
ALWAYS use the proper redump guides to dump images and NEVER rely on fixes like these!
Compiling:
Use "make" on any linux/unix/bsd console nearby, or if you must, an msys or cygwin environment.
You need to use a relatively recent gcc (4.5.0+ ish I guess).
On windows, if you have a 64bit MinGW, you can use "make 64=1" to build a (much faster) 64bit version.
This software uses crcutil-1.0 for providing fast crc calculations.
crcutil is made by Andrew Kadatch and Bob Jenkins and can be found on http://code.google.com/p/crcutil/
Do not contact them for support on findcrcs.
The Makefile will try to pull in version 1.0 through wget if it is not supplied yet.
Contact:
At the moment, see the redump.org forum thread where you got this.
-V.
And an example run:
~/cdxafix-0.1$ cdxafix kidclown2.bin 24908
Possible fixes:
771 45 -> 44 (1 bit fix)
1026 0c -> 5d (3 bit fix)
~/cdxafix-0.1$ applyfix kidclown2.bin 24908 771 44
45 -> 44
~/cdxafix-0.1$ cdxafix kidclown2.bin 24908
Sector ECD matches sector data. No fix required.
~/cdxafix-0.1$
Standard disclaimer:
I write my tools mainly for myself to use in a specific way.
If however someone has some issues using this, or has some suggestions, i MIGHT be able to change, fix or add things, but only if time and effort are permitting (which is not usually the case).
ps.
--> READ THE SECOND PART OF THE WARNING IN THE README ABOVE! <--
--> DO NOT USE THIS TO 'FIX' IMAGES WHICH YOU PLAN TO SEND TO REDUMP! <--
Source: http://winaoe.org/redump/cdxafix-0.2.tar.gz
Win32 binary: http://winaoe.org/redump/cdxafix-0.2-bin-win32.zip