Show subheader copy differences as warnings. Show if failure is in EDC/ECC. Bump to version 1.20.

This commit is contained in:
2014-03-06 23:19:13 +00:00
parent 3d380b769c
commit d75d082cdf
5 changed files with 42 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
edccchk v1.11 edccchk v1.20
============= =============
EDC/ECC checker for RAW (2352 bytes/sector) CD images EDC/ECC checker for RAW (2352 bytes/sector) CD images
@@ -39,6 +39,11 @@ Changelog
2014/03/02 v1.11 2014/03/02 v1.11
* Corrected sum of total errors. * Corrected sum of total errors.
2014/03/06 v1.20
* When an error is detected, will tell if the error was detected with ECC P, ECC Q or EDC. Useful to detect EDC/ECC field corruption.
* Shows a warning when mode 2 subheader copies differ. Other tools detect this as an error, but if both ECC and EDC are ok it's intentional.
* Shows summary of total warnings and total errors+warnings.
To-Do To-Do
===== =====

Binary file not shown.

BIN
bin/edccchk-v1.20-win32.zip Normal file

Binary file not shown.

View File

@@ -82,10 +82,13 @@ static uint32_t mode1sectors;
static uint32_t mode1errors; static uint32_t mode1errors;
static uint32_t mode2f1sectors; static uint32_t mode2f1sectors;
static uint32_t mode2f1errors; static uint32_t mode2f1errors;
static uint32_t mode2f1warnings;
static uint32_t mode2f2sectors; static uint32_t mode2f2sectors;
static uint32_t mode2f2errors; static uint32_t mode2f2errors;
static uint32_t mode2f2warnings;
static uint32_t totalsectors; static uint32_t totalsectors;
static uint32_t totalerrors; static uint32_t totalerrors;
static uint32_t totalwarnings;
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// //
@@ -276,8 +279,10 @@ static int8_t ecmify(
mode1errors= 0; mode1errors= 0;
mode2f1sectors= 0; mode2f1sectors= 0;
mode2f1errors= 0; mode2f1errors= 0;
mode2f1warnings = 0;
mode2f2sectors= 0; mode2f2sectors= 0;
mode2f2errors= 0; mode2f2errors= 0;
mode2f2warnings = 0;
totalsectors= 0; totalsectors= 0;
totalerrors= 0; totalerrors= 0;
@@ -389,6 +394,12 @@ static int8_t ecmify(
mode1errors++; mode1errors++;
totalerrors++; totalerrors++;
fprintf(stderr, "Mode 1 sector with error at address: %02X:%02X:%02X\n", sector[0x00C], sector[0x00D], sector[0x00E]); fprintf(stderr, "Mode 1 sector with error at address: %02X:%02X:%02X\n", sector[0x00C], sector[0x00D], sector[0x00E]);
if(edc_compute(0, sector, 0x810) != get32lsb(sector + 0x810))
fprintf(stderr, "%02X:%02X:%02X: Failed EDC\n", sector[0x00C], sector[0x00D], sector[0x00E]);
if(!ecc_checkpq(sector + 0xC, sector + 0x10, 86, 24, 2, 86, sector + 0x81C))
fprintf(stderr, "%02X:%02X:%02X: Failed ECC P\n", sector[0x00C], sector[0x00D], sector[0x00E]);
if(!ecc_checkpq(sector + 0xC, sector + 0x10, 52, 43, 86, 88, sector + 0x81C + 0xAC))
fprintf(stderr, "%02X:%02X:%02X: Failed ECC Q\n", sector[0x00C], sector[0x00D], sector[0x00E]);
} }
} }
else if(sector[0x00F] == 0x02) // mode (1 byte) else if(sector[0x00F] == 0x02) // mode (1 byte)
@@ -401,9 +412,17 @@ static int8_t ecmify(
if(edc_compute(0, m2sec, 0x91C) != get32lsb(m2sec + 0x91C) && get32lsb(m2sec + 0x91C) != 0) if(edc_compute(0, m2sec, 0x91C) != get32lsb(m2sec + 0x91C) && get32lsb(m2sec + 0x91C) != 0)
{ {
fprintf(stderr, "Mode 2 form 2 sector with error at address: %02X:%02X:%02X\n", sector[0x00C], sector[0x00D], sector[0x00E]); fprintf(stderr, "Mode 2 form 2 sector with error at address: %02X:%02X:%02X\n", sector[0x00C], sector[0x00D], sector[0x00E]);
if(edc_compute(0, m2sec, 0x91C) != get32lsb(m2sec + 0x91C))
fprintf(stderr, "%02X:%02X:%02X: Failed EDC\n", sector[0x00C], sector[0x00D], sector[0x00E]);
mode2f2errors++; mode2f2errors++;
totalerrors++; totalerrors++;
} }
if(sector[0x010] != sector[0x014] || sector[0x011] != sector[0x015] || sector[0x012] != sector[0x016] || sector[0x013] != sector[0x017])
{
mode2f2warnings++;
totalwarnings++;
fprintf(stderr, "Subheader copies differ in mode 2 form 2 sector at address: %02X:%02X:%02X\n", sector[0x00C], sector[0x00D], sector[0x00E]);
}
} }
else else
{ {
@@ -417,9 +436,21 @@ static int8_t ecmify(
edc_compute(0, m2sec, 0x808) != get32lsb(m2sec + 0x808)) edc_compute(0, m2sec, 0x808) != get32lsb(m2sec + 0x808))
{ {
fprintf(stderr, "Mode 2 form 1 sector with error at address: %02X:%02X:%02X\n", sector[0x00C], sector[0x00D], sector[0x00E]); fprintf(stderr, "Mode 2 form 1 sector with error at address: %02X:%02X:%02X\n", sector[0x00C], sector[0x00D], sector[0x00E]);
if(edc_compute(0, m2sec, 0x808) != get32lsb(m2sec + 0x808))
fprintf(stderr, "%02X:%02X:%02X: Failed EDC\n", sector[0x00C], sector[0x00D], sector[0x00E]);
if(!ecc_checkpq(zeroaddress, m2sec, 86, 24, 2, 86, m2sec + 0x80C))
fprintf(stderr, "%02X:%02X:%02X: Failed ECC P\n", sector[0x00C], sector[0x00D], sector[0x00E]);
if(!ecc_checkpq(zeroaddress, m2sec, 52, 43, 86, 88, m2sec + 0x80C))
fprintf(stderr, "%02X:%02X:%02X: Failed ECC Q\n", sector[0x00C], sector[0x00D], sector[0x00E]);
mode2f1errors++; mode2f1errors++;
totalerrors++; totalerrors++;
} }
if(sector[0x010] != sector[0x014] || sector[0x011] != sector[0x015] || sector[0x012] != sector[0x016] || sector[0x013] != sector[0x017])
{
mode2f1warnings++;
totalwarnings++;
fprintf(stderr, "Subheader copies differ in mode 2 form 1 sector at address: %02X:%02X:%02X\n", sector[0x00C], sector[0x00D], sector[0x00E]);
}
} }
} }
else // Unknown sector mode!!! else // Unknown sector mode!!!
@@ -458,10 +489,14 @@ static int8_t ecmify(
printf("\twith errors..... %d\n", mode1errors); printf("\twith errors..... %d\n", mode1errors);
printf("Mode 2 form 1 sectors... %d\n", mode2f1sectors); printf("Mode 2 form 1 sectors... %d\n", mode2f1sectors);
printf("\twith errors..... %d\n", mode2f1errors); printf("\twith errors..... %d\n", mode2f1errors);
printf("\twith warnings... %d\n", mode2f1warnings);
printf("Mode 2 form 2 sectors... %d\n", mode2f2sectors); printf("Mode 2 form 2 sectors... %d\n", mode2f2sectors);
printf("\twith errors..... %d\n", mode2f2errors); printf("\twith errors..... %d\n", mode2f2errors);
printf("\twith warnings... %d\n", mode2f2warnings);
printf("Total sectors........... %d\n", totalsectors); printf("Total sectors........... %d\n", totalsectors);
printf("Total errors............ %d\n", totalerrors); printf("Total errors............ %d\n", totalerrors);
printf("Total warnings.......... %d\n", totalwarnings);
printf("Total errors+warnings... %d\n", totalerrors + totalwarnings);
// //
// Success // Success
// //

View File

@@ -1 +1 @@
"v1.11" "v1.20"