CDArchive - Improved support for ring based protections

reentrant
Posts: 719
Joined: Mon Jun 08, 2026 1:28 am

Re: CDArchive - Improved support for ring based protections

Post by reentrant »

All calls to Python functions are enclosed in try/catch blocks (boost::python::error_already_set) with retVal set to ERROR_ACCESS_DENIED - this value is chosen arbitrarily. What do you mean by "comment-out"?

In case sector cannot be repaired (for example because corruption is too big, exception will be thrown, retVal = 5).

HandleC2 can only handle data sectors (data sectors with ECC blocks, mode 2 sectors without ECC are not supported)...
sarami
Posts: 1762
Joined: Mon Jun 08, 2026 1:27 am

Re: CDArchive - Improved support for ring based protections

Post by sarami »

reentrant wrote:All calls to Python functions are enclosed in try/catch blocks (boost::python::error_already_set) with retVal set to ERROR_ACCESS_DENIED - this value is chosen arbitrarily. What do you mean by "comment-out"?
Doxygen style is useful for me.

Code: Select all

/**
 * @brief  -> Description of this function
 *
 * @param  -> Description of parameter
 * @return -> Description what value is returned
 */
typedef DWORD (WINAPI *pInitC2)(PC2_CORRECTOR_INIT c2InitBlock);
reentrant wrote:In case sector cannot be repaired (for example because corruption is too big, exception will be thrown, retVal = 5).
Is the return value of HandleC2 only 0 and 5? It seems that same as system error code(https://learn.microsoft.com/en-us/windo … es--0-499-)
reentrant wrote:HandleC2 can only handle data sectors (data sectors with ECC blocks, mode 2 sectors without ECC are not supported)...
Ok. This dll can repair mode 1 and mode 2 form 1 sector.
DiscImageCreator, UmdImageCreator, Conv2multiBin, bin2wav, PS3Auth (needs login), [url=http://www.mediafire.com/file/5cgoy11x6ahc7qh/%2523recompressTo7z_20150109.bat/file]recompressTo7z_20150109.bat[/url]
reentrant
Posts: 719
Joined: Mon Jun 08, 2026 1:28 am

Re: CDArchive - Improved support for ring based protections

Post by reentrant »

HandleC2:
ERROR_ACCESS_DENIED - error in ECC logic (too many errors)
ERROR_INVALID_PARAMETER - error in ECC logic (parameters checking for Python function)
ERROR_INVALID_DATA - error in ECC logic (Python function returned not enough data)

The last two error codes shouldn't happen - these are sanity checks.

Under normal circumstances HandleC2 returns either 0 if repair is successful or ERROR_ACCESS_DENIED (5) when it fails.
All return values are the same as system error codes.
Last edited by reentrant on Sat Apr 05, 2025 4:36 pm, edited 1 time in total.
StriderSkorpion
Posts: 747
Joined: Mon Jun 08, 2026 1:31 am

Re: CDArchive - Improved support for ring based protections

Post by StriderSkorpion »

I have been using this version of CDArchive to get some sectors from problematic discs and noticed that it won't save the sector if the data section matches, but the ECC Q doesn't. The problem is in the .bin file, as verified by scanning with CDMage. Would it be possible for CDArchive to (force) save the sector in such cases?
reentrant
Posts: 719
Joined: Mon Jun 08, 2026 1:28 am

Re: CDArchive - Improved support for ring based protections

Post by reentrant »

Added new command line switch:
extrforceecc: 0/1 - this option forces correction of ECC even when EDC is correct. Old version skipped ECC correction when EDC was ok. Default value is 0.

But... after looking at: /viewtopic.php?t=55852 … -redumper/ @ sector 25701.bad things get complicated. The bad sector internally gets corrected but it zeroes out M/S/F/Track bytes. It looks like ECC is deliberately corrupted. After all even with extrforceecc = 1, repaired sector is not merged into the image.

So, this version does what you want but not for this specific sector...
What do you think about all of this?
Attachments
Imported Redump attachment 22910
Imported Redump attachment 22910
Screenshot 2025-05-26 211508.png (5.68 KiB) Viewed 10 times
Last edited by reentrant on Mon May 26, 2025 2:09 pm, edited 1 time in total.
StriderSkorpion
Posts: 747
Joined: Mon Jun 08, 2026 1:31 am

Re: CDArchive - Improved support for ring based protections

Post by StriderSkorpion »

This seems to have worked. The sectors are saved with the correct ECC Q data. I'm not having any issues with MSF section of the header that you mentioned.

I'm not sure what happened when dumping the disc initially, but apparently the drive told redumper that the C2 error was corrected despite the ECC Q parity data being corrupted.
reentrant
Posts: 719
Joined: Mon Jun 08, 2026 1:28 am

Re: CDArchive - Improved support for ring based protections

Post by reentrant »

Ok, I'm glad it worked.
Post Reply