1

(3,536 replies, posted in General discussion)

https://github.com/saramibreak/DiscImag … g/20250501
*2025-05-01
- added /fdesc option to descramble sync/edc/ecc error sector
- added /c2new option to recover the sector using c2 error bit
- changed descramble algorithm (use edc and ecc)
- fixed subQ channel when 1st pregap sector is MCN
- fixed SACD log

2

(3,536 replies, posted in General discussion)

sarami wrote:
reentrant wrote:

Sarami, have a read at this post: http://forum.redump.org/post/125014/#p125014

It'd be nice if you could support this C2 Corrector (plugin support in general, in CDArchive it's optional - app works without it if you delete plugins directory). I think it could greatly enhance C2 error support and save our lasers for a bit longer...

Good works, thanks. I'll try it.

If audio sector and mode 2 form 2 sector are also supported, I would use it.

I added /c2new option instead. /c2new recovers the sector using c2 bit.
https://www.mediafire.com/file/eq80y20l … st.7z/file

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.

/**
 * @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.

reentrant wrote:

Hmmm. Maybe commit the codes to github branch and I'll debug it locally? Something is not right...

Thanks, but I'll try to do it myself a little more.

Could you upload C2.hpp with all return value of InitC2 and HandleC2 in the comment-out? When boost::python::error_already_set occurs, HandleC2 returns 5.

Edit:
Can HandleC2 only handle a data sector? boost::python::error_already_set occurs when audio sector with c2 error is set.

The following was tried in debug mode of Visual Studio.

reentrant wrote:

1) After InitC2 function is called pause the app under debugger. Use tool like ProcessExplorer and view process environment variables. Check how PYTHONHOME looks like.

I confirmed that PYTHONHOME is set correctly using ProcessExplorer and HandleC2 func throws the exception in the "boost::python::error_already_set".

reentrant wrote:

2) In the attachment I put a DLL without a call to SetEnvironmentVariableW. Try to call SetEnvironmentVariableW / SetEnvironmentVariableA with path to your Python install directory (C:\Users\xxx\AppData\Local\Programs\Python\Python312-32) before InitC2 function

If "C:\Users\xxx\AppData\Local\Programs\Python\Python312-32" is set using SetEnvironmentVariable, HandleC2 func throws the exception in the "boost::python::error_already_set".

If incorrect directory is set, InitC2 func returns the message, "Fatal Python error: failed to get the Python codec of the filesystem encoding".

It seems that PYTHONHOME is set.

PYTHONHOME: C:\Users\xxx\AppData\Local\Programs\Python\Python312-32
Could not find platform independent libraries <prefix>
Need to reread sector:  13183LBA: 13183, C2 error count; 0
Need to reread sector:  13201Exception ignored in garbage collection:
Traceback (most recent call last):
  File "E:\source\repos\DiscImageCreator\Release_ANSI\Plugins\C2Corrector\reedsolo.py", line 984, in decode
    total_chunks = int(math.ceil(float(len(data)) / float(chunk_size)))  # need to convert to floats first to get an accurate floating division, or else we assume implicit conversion and it will cause an error on Python 2
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SystemError: <class 'int'> returned a result with an exception set
LBA: 13201, C2 error count; 0
Need to reread sector:  13211Exception ignored in garbage collection:
Traceback (most recent call last):
  File "E:\source\repos\DiscImageCreator\Release_ANSI\Plugins\C2Corrector\reedsolo.py", line 984, in decode
    total_chunks = int(math.ceil(float(len(data)) / float(chunk_size)))  # need to convert to floats first to get an accurate floating division, or else we assume implicit conversion and it will cause an error on Python 2
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SystemError: <class 'int'> returned a result with an exception set
LBA: 13211, C2 error count; 0
Need to reread sector:  13220LBA: 13220, C2 error count; 0
Need to reread sector:  13229Exception ignored in garbage collection:
Traceback (most recent call last):
  File "E:\source\repos\DiscImageCreator\Release_ANSI\Plugins\C2Corrector\reedsolo.py", line 984, in decode
    total_chunks = int(math.ceil(float(len(data)) / float(chunk_size)))  # need to convert to floats first to get an accurate floating division, or else we assume implicit conversion and it will cause an error on Python 2
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SystemError: <class 'int'> returned a result with an exception set
LBA: 13229, C2 error count; 0
Need to reread sector:  13257Exception ignored in garbage collection:
Traceback (most recent call last):
  File "E:\source\repos\DiscImageCreator\Release_ANSI\Plugins\C2Corrector\reedsolo.py", line 984, in decode
    total_chunks = int(math.ceil(float(len(data)) / float(chunk_size)))  # need to convert to floats first to get an accurate floating division, or else we assume implicit conversion and it will cause an error on Python 2
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SystemError: <class 'int'> returned a result with an exception set
LBA: 13257, C2 error count; 0
Need to reread sector:  13266LBA: 13266, C2 error count; 0
Need to reread sector:  13267Exception ignored in garbage collection:
Traceback (most recent call last):
  File "E:\source\repos\DiscImageCreator\Release_ANSI\Plugins\C2Corrector\reedsolo.py", line 984, in decode
    total_chunks = int(math.ceil(float(len(data)) / float(chunk_size)))  # need to convert to floats first to get an accurate floating division, or else we assume implicit conversion and it will cause an error on Python 2
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SystemError: <class 'int'> returned a result with an exception set
LBA: 13267, C2 error count; 0
Need to reread sector:  13276Exception ignored in garbage collection:
Traceback (most recent call last):
  File "E:\source\repos\DiscImageCreator\Release_ANSI\Plugins\C2Corrector\reedsolo.py", line 984, in decode
    total_chunks = int(math.ceil(float(len(data)) / float(chunk_size)))  # need to convert to floats first to get an accurate floating division, or else we assume implicit conversion and it will cause an error on Python 2
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SystemError: <class 'int'> returned a result with an exception set
LBA: 13276, C2 error count; 0
Need to reread sector:  13285Exception ignored in garbage collection:
Traceback (most recent call last):
  File "E:\source\repos\DiscImageCreator\Release_ANSI\Plugins\C2Corrector\reedsolo.py", line 984, in decode
    total_chunks = int(math.ceil(float(len(data)) / float(chunk_size)))  # need to convert to floats first to get an accurate floating division, or else we assume implicit conversion and it will cause an error on Python 2
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SystemError: <class 'int'> returned a result with an exception set
LBA: 13285, C2 error count; 0
Need to reread sector:  13294LBA: 13294, C2 error count; 0
Need to reread sector:  13295Exception ignored in garbage collection:
Traceback (most recent call last):
  File "E:\source\repos\DiscImageCreator\Release_ANSI\Plugins\C2Corrector\reedsolo.py", line 984, in decode
    total_chunks = int(math.ceil(float(len(data)) / float(chunk_size)))  # need to convert to floats first to get an accurate floating division, or else we assume implicit conversion and it will cause an error on Python 2
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SystemError: <class 'int'> returned a result with an exception set
LBA: 13295, C2 error count; 0
Need to reread sector:  13313Exception ignored in garbage collection:
Traceback (most recent call last):
  File "E:\source\repos\DiscImageCreator\Release_ANSI\Plugins\C2Corrector\reedsolo.py", line 984, in decode
    total_chunks = int(math.ceil(float(len(data)) / float(chunk_size)))  # need to convert to floats first to get an accurate floating division, or else we assume implicit conversion and it will cause an error on Python 2
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SystemError: <class 'int'> returned a result with an exception set
LBA: 13313, C2 error count; 0
Need to reread sector:  99785LBA: 99785, C2 error count; 0
Need to reread sector:  99786Exception ignored in garbage collection:
Traceback (most recent call last):
  File "E:\source\repos\DiscImageCreator\Release_ANSI\Plugins\C2Corrector\reedsolo.py", line 984, in decode
    total_chunks = int(math.ceil(float(len(data)) / float(chunk_size)))  # need to convert to floats first to get an accurate floating division, or else we assume implicit conversion and it will cause an error on Python 2
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SystemError: <class 'int'> returned a result with an exception set
LBA: 99786, C2 error count; 0
Need to reread sector:  99880Exception ignored in garbage collection:
Traceback (most recent call last):
  File "E:\source\repos\DiscImageCreator\Release_ANSI\Plugins\C2Corrector\reedsolo.py", line 984, in decode
    total_chunks = int(math.ceil(float(len(data)) / float(chunk_size)))  # need to convert to floats first to get an accurate floating division, or else we assume implicit conversion and it will cause an error on Python 2
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SystemError: <class 'int'> returned a result with an exception set
LBA: 99880, C2 error count; 0
Need to reread sector:  99892LBA: 99892, C2 error count; 0
Need to reread sector:  99893Exception ignored in garbage collection:
Traceback (most recent call last):
  File "E:\source\repos\DiscImageCreator\Release_ANSI\Plugins\C2Corrector\reedsolo.py", line 984, in decode
    total_chunks = int(math.ceil(float(len(data)) / float(chunk_size)))  # need to convert to floats first to get an accurate floating division, or else we assume implicit conversion and it will cause an error on Python 2
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SystemError: <class 'int'> returned a result with an exception set
LBA: 99893, C2 error count; 0
Need to reread sector:  99933Exception ignored in garbage collection:
Traceback (most recent call last):
  File "E:\source\repos\DiscImageCreator\Release_ANSI\Plugins\C2Corrector\reedsolo.py", line 984, in decode
    total_chunks = int(math.ceil(float(len(data)) / float(chunk_size)))  # need to convert to floats first to get an accurate floating division, or else we assume implicit conversion and it will cause an error on Python 2
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SystemError: <class 'int'> returned a result with an exception set
LBA: 99933, C2 error count; 0
Need to reread sector: 100108LBA: 100108, C2 error count; 0
Need to reread sector: 100162Exception ignored in garbage collection:
Traceback (most recent call last):
  File "E:\source\repos\DiscImageCreator\Release_ANSI\Plugins\C2Corrector\reedsolo.py", line 984, in decode
    total_chunks = int(math.ceil(float(len(data)) / float(chunk_size)))  # need to convert to floats first to get an accurate floating division, or else we assume implicit conversion and it will cause an error on Python 2
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SystemError: <class 'int'> returned a result with an exception set
LBA: 100162, C2 error count; 0
Need to reread sector: 100163Exception ignored in garbage collection:
Traceback (most recent call last):
  File "E:\source\repos\DiscImageCreator\Release_ANSI\Plugins\C2Corrector\reedsolo.py", line 984, in decode
    total_chunks = int(math.ceil(float(len(data)) / float(chunk_size)))  # need to convert to floats first to get an accurate floating division, or else we assume implicit conversion and it will cause an error on Python 2
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SystemError: <class 'int'> returned a result with an exception set
LBA: 100163, C2 error count; 0
Need to reread sector: 100175LBA: 100175, C2 error count; 0
Need to reread sector: 100176Exception ignored in garbage collection:
Traceback (most recent call last):
  File "E:\source\repos\DiscImageCreator\Release_ANSI\Plugins\C2Corrector\reedsolo.py", line 984, in decode
    total_chunks = int(math.ceil(float(len(data)) / float(chunk_size)))  # need to convert to floats first to get an accurate floating division, or else we assume implicit conversion and it will cause an error on Python 2
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SystemError: <class 'int'> returned a result with an exception set
LBA: 100176, C2 error count; 0
Need to reread sector: 100189Exception ignored in garbage collection:
Traceback (most recent call last):
  File "E:\source\repos\DiscImageCreator\Release_ANSI\Plugins\C2Corrector\reedsolo.py", line 984, in decode
    total_chunks = int(math.ceil(float(len(data)) / float(chunk_size)))  # need to convert to floats first to get an accurate floating division, or else we assume implicit conversion and it will cause an error on Python 2
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SystemError: <class 'int'> returned a result with an exception set
LBA: 100189, C2 error count; 0
Need to reread sector: 100203LBA: 100203, C2 error count; 0
Need to reread sector: 100215Exception ignored in garbage collection:
Traceback (most recent call last):
  File "E:\source\repos\DiscImageCreator\Release_ANSI\Plugins\C2Corrector\reedsolo.py", line 984, in decode
    total_chunks = int(math.ceil(float(len(data)) / float(chunk_size)))  # need to convert to floats first to get an accurate floating division, or else we assume implicit conversion and it will cause an error on Python 2
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SystemError: <class 'int'> returned a result with an exception set
LBA: 100215, C2 error count; 0
Need to reread sector: 100216Exception ignored in garbage collection:
Traceback (most recent call last):
  File "E:\source\repos\DiscImageCreator\Release_ANSI\Plugins\C2Corrector\reedsolo.py", line 984, in decode
    total_chunks = int(math.ceil(float(len(data)) / float(chunk_size)))  # need to convert to floats first to get an accurate floating division, or else we assume implicit conversion and it will cause an error on Python 2
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SystemError: <class 'int'> returned a result with an exception set
LBA: 100216, C2 error count; 0
reentrant wrote:

I have also added testing script which invokes functions from reedsolo.py directly.

Here.

E:\MyDownloadedApp\RippingTools\redump.org\reentrant>C:\Users\xxx\AppData\Local\Programs\Python\Python312-32\python.exe c2.py
P
0
[2, 0, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 167, 233]
bytearray(b'\x00\x00N\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00N\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa7\xe9')
bytearray(b'\x00')
Q
0
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 137, 239, 8, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 184, 152]
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x89\xef\x08N\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x89\xef\x08N\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb8\x98')
bytearray(b'')

Btw, python312.dll and boost_python312-vc143-mt-x32-1_87.dll also need to call using LoadLibrary?

reentrant wrote:

did you adjust the path in C2Corrector.ini?

I set it.

PYTHONHOME = C:\Users\xxx\AppData\Local\Programs\Python\Python312-32
reentrant wrote:

32bit DLL in attachment.

Thanks. I implemented it but error occurs.

Could not find platform independent libraries <prefix>
Need to reread sector:  13164LBA: 13164, C2 error count; 0
Need to reread sector:  13201Exception ignored in garbage collection:
Traceback (most recent call last):
  File "E:\source\repos\DiscImageCreator\Release_ANSI\Plugins\C2Corrector\reedsolo.py", line 984, in decode
    total_chunks = int(math.ceil(float(len(data)) / float(chunk_size)))  # need to convert to floats first to get an accurate floating division, or else we assume implicit conversion and it will cause an error on Python 2
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SystemError: <class 'int'> returned a result with an exception set
LBA: 13201, C2 error count; 0
Need to reread sector:  13211Exception ignored in garbage collection:
Traceback (most recent call last):
  File "E:\source\repos\DiscImageCreator\Release_ANSI\Plugins\C2Corrector\reedsolo.py", line 984, in decode
    total_chunks = int(math.ceil(float(len(data)) / float(chunk_size)))  # need to convert to floats first to get an accurate floating division, or else we assume implicit conversion and it will cause an error on Python 2
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SystemError: <class 'int'> returned a result with an exception set
LBA: 13211, C2 error count; 0
Need to reread sector:  13248LBA: 13248, C2 error count; 0
Need to reread sector:  13257Exception ignored in garbage collection:
Traceback (most recent call last):
  File "E:\source\repos\DiscImageCreator\Release_ANSI\Plugins\C2Corrector\reedsolo.py", line 984, in decode
    total_chunks = int(math.ceil(float(len(data)) / float(chunk_size)))  # need to convert to floats first to get an accurate floating division, or else we assume implicit conversion and it will cause an error on Python 2
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SystemError: <class 'int'> returned a result with an exception set
LBA: 13257, C2 error count; 0
Need to reread sector:  13266Exception ignored in garbage collection:
Traceback (most recent call last):
  File "E:\source\repos\DiscImageCreator\Release_ANSI\Plugins\C2Corrector\reedsolo.py", line 984, in decode
    total_chunks = int(math.ceil(float(len(data)) / float(chunk_size)))  # need to convert to floats first to get an accurate floating division, or else we assume implicit conversion and it will cause an error on Python 2
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SystemError: <class 'int'> returned a result with an exception set
LBA: 13266, C2 error count; 0
Need to reread sector:  13267LBA: 13267, C2 error count; 0
Need to reread sector:  13285Exception ignored in garbage collection:
Traceback (most recent call last):
  File "E:\source\repos\DiscImageCreator\Release_ANSI\Plugins\C2Corrector\reedsolo.py", line 984, in decode
    total_chunks = int(math.ceil(float(len(data)) / float(chunk_size)))  # need to convert to floats first to get an accurate floating division, or else we assume implicit conversion and it will cause an error on Python 2
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SystemError: <class 'int'> returned a result with an exception set
LBA: 13285, C2 error count; 0
Need to reread sector:  13294Exception ignored in garbage collection:
Traceback (most recent call last):
  File "E:\source\repos\DiscImageCreator\Release_ANSI\Plugins\C2Corrector\reedsolo.py", line 984, in decode
    total_chunks = int(math.ceil(float(len(data)) / float(chunk_size)))  # need to convert to floats first to get an accurate floating division, or else we assume implicit conversion and it will cause an error on Python 2
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SystemError: <class 'int'> returned a result with an exception set
LBA: 13294, C2 error count; 0
Need to reread sector:  13295Exception ignored in garbage collection:
Traceback (most recent call last):
  File "E:\source\repos\DiscImageCreator\Release_ANSI\Plugins\C2Corrector\reedsolo.py", line 984, in decode
    total_chunks = int(math.ceil(float(len(data)) / float(chunk_size)))  # need to convert to floats first to get an accurate floating division, or else we assume implicit conversion and it will cause an error on Python 2
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SystemError: <class 'int'> returned a result with an exception set
LBA: 13295, C2 error count; 0
Need to reread sector:  13322LBA: 13322, C2 error count; 0
Need to reread sector:  99879Exception ignored in garbage collection:
Traceback (most recent call last):
  File "E:\source\repos\DiscImageCreator\Release_ANSI\Plugins\C2Corrector\reedsolo.py", line 984, in decode
    total_chunks = int(math.ceil(float(len(data)) / float(chunk_size)))  # need to convert to floats first to get an accurate floating division, or else we assume implicit conversion and it will cause an error on Python 2
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SystemError: <class 'int'> returned a result with an exception set
LBA: 99879, C2 error count; 0
Need to reread sector:  99880Exception ignored in garbage collection:
Traceback (most recent call last):
  File "E:\source\repos\DiscImageCreator\Release_ANSI\Plugins\C2Corrector\reedsolo.py", line 984, in decode
    total_chunks = int(math.ceil(float(len(data)) / float(chunk_size)))  # need to convert to floats first to get an accurate floating division, or else we assume implicit conversion and it will cause an error on Python 2
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SystemError: <class 'int'> returned a result with an exception set
LBA: 99880, C2 error count; 0
Need to reread sector:  99892LBA: 99892, C2 error count; 0
Need to reread sector:  99893Exception ignored in garbage collection:
Traceback (most recent call last):
  File "E:\source\repos\DiscImageCreator\Release_ANSI\Plugins\C2Corrector\reedsolo.py", line 984, in decode
    total_chunks = int(math.ceil(float(len(data)) / float(chunk_size)))  # need to convert to floats first to get an accurate floating division, or else we assume implicit conversion and it will cause an error on Python 2
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SystemError: <class 'int'> returned a result with an exception set
LBA: 99893, C2 error count; 0
Need to reread sector: 100108Exception ignored in garbage collection:
Traceback (most recent call last):
  File "E:\source\repos\DiscImageCreator\Release_ANSI\Plugins\C2Corrector\reedsolo.py", line 984, in decode
    total_chunks = int(math.ceil(float(len(data)) / float(chunk_size)))  # need to convert to floats first to get an accurate floating division, or else we assume implicit conversion and it will cause an error on Python 2
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SystemError: <class 'int'> returned a result with an exception set
LBA: 100108, C2 error count; 0
Need to reread sector: 100162LBA: 100162, C2 error count; 0
Need to reread sector: 100163Exception ignored in garbage collection:
Traceback (most recent call last):
  File "E:\source\repos\DiscImageCreator\Release_ANSI\Plugins\C2Corrector\reedsolo.py", line 984, in decode
    total_chunks = int(math.ceil(float(len(data)) / float(chunk_size)))  # need to convert to floats first to get an accurate floating division, or else we assume implicit conversion and it will cause an error on Python 2
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SystemError: <class 'int'> returned a result with an exception set
LBA: 100163, C2 error count; 0
Need to reread sector: 100175Exception ignored in garbage collection:
Traceback (most recent call last):
  File "E:\source\repos\DiscImageCreator\Release_ANSI\Plugins\C2Corrector\reedsolo.py", line 984, in decode
    total_chunks = int(math.ceil(float(len(data)) / float(chunk_size)))  # need to convert to floats first to get an accurate floating division, or else we assume implicit conversion and it will cause an error on Python 2
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SystemError: <class 'int'> returned a result with an exception set
LBA: 100175, C2 error count; 0
Need to reread sector: 100176LBA: 100176, C2 error count; 0
Need to reread sector: 100189Exception ignored in garbage collection:
Traceback (most recent call last):
  File "E:\source\repos\DiscImageCreator\Release_ANSI\Plugins\C2Corrector\reedsolo.py", line 984, in decode
    total_chunks = int(math.ceil(float(len(data)) / float(chunk_size)))  # need to convert to floats first to get an accurate floating division, or else we assume implicit conversion and it will cause an error on Python 2
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SystemError: <class 'int'> returned a result with an exception set
LBA: 100189, C2 error count; 0
Need to reread sector: 100215Exception ignored in garbage collection:
Traceback (most recent call last):
  File "E:\source\repos\DiscImageCreator\Release_ANSI\Plugins\C2Corrector\reedsolo.py", line 984, in decode
    total_chunks = int(math.ceil(float(len(data)) / float(chunk_size)))  # need to convert to floats first to get an accurate floating division, or else we assume implicit conversion and it will cause an error on Python 2
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SystemError: <class 'int'> returned a result with an exception set
LBA: 100215, C2 error count; 0
Need to reread sector: 100216LBA: 100216, C2 error count; 0

code is here. What am I wrong?

    C2_CORRECTOR_INIT c2InitBlock = {};

    DWORD retVal = pDisc->C2.InitC2(&c2InitBlock);
    if (!retVal) {
        C2_CORRECTOR_HANDLE c2HandleBlock = {};
        c2HandleBlock.pythonEccP = c2InitBlock.pythonEccP;
        c2HandleBlock.pythonEccQ = c2InitBlock.pythonEccQ;
        c2HandleBlock.sectorData = pDiscPerSector->data.current;
        c2HandleBlock.c2Pointers = pDiscPerSector->data.next + CD_RAW_READ_C2_294_SIZE;
        c2HandleBlock.c2Repaired = c2Repaired;
        for (UINT h = 0; h < pExtArg->uiMaxRereadNum; h++) {
            nErrCnt = 0;
            retVal = pDisc->C2.HandleC2(&c2HandleBlock);
            for (INT i = 0; i < CD_RAW_READ_C2_294_SIZE; i++) {
                if (c2HandleBlock.c2Repaired[i] != 0) {
                    INT nBit = 0x80;
                    for (INT n = 0; n < CHAR_BIT; n++) {
                        if (c2HandleBlock.c2Repaired[i] & nBit) {
                            nErrCnt++;
                        }
                        nBit >>= 1;
                    }
                }
            }
            OutputLog(standardError | fileC2Error, "LBA: %d, C2 error count; %d\n", nLBA, nErrCnt);
            if (!nErrCnt) {
                break;
            }
        }
    }
reentrant wrote:

Configuration:
- Install Python 3.12 (exactly this major version)
- Adjust PYTHONHOME variable in config file: Plugins\C2Corrector\C2Corrector.ini
- Copy python312.dll from Python installation directory to Plugins\C2Corrector directory

Is python312.dll 64-bit only? Or does it work in 32bit dll? Are C2Corrector.dll and boost_python312-vc143-mt-x64-1_87.dll also 64bit only? It fails to load using LoadLibrary.

reentrant wrote:

Steps:
1) Call InitC2 once in main
2) Call HandleC2 multiple times on each re-read

If possible, please show me the sample code to call these func.

11

(3,536 replies, posted in General discussion)

reentrant wrote:

Sarami, have a read at this post: http://forum.redump.org/post/125014/#p125014

It'd be nice if you could support this C2 Corrector (plugin support in general, in CDArchive it's optional - app works without it if you delete plugins directory). I think it could greatly enhance C2 error support and save our lasers for a bit longer...

Good works, thanks. I'll try it.

Deterous wrote:

Sarami, a verification for http://redump.org/disc/74375/ was recently dumped using 20250101 which had a different pregap for Track 4 (00:02:49). I have attached the logs.

Thanks. 00:02:50 is correct.

LBA[068994, 0x10d82]: P[00], Q[01030101225200152169cd7e]{Audio, 2ch, Copy NG, Pre-emphasis No, Track[03], Idx[01], RMSF[01:22:52], AMSF[15:21:69]}, RtoW[0, 0, 0, 0]
LBA[068995, 0x10d83]: P[00], Q[02200591111171600070cac6]{Audio, 2ch, Copy NG, Pre-emphasis No, MediaCatalogNumber [2005911111716], AMSF[     :70]}, RtoW[0, 0, 0, 0]
LBA[068996, 0x10d84]: P[ff], Q[0104000002480015217167a2]{Audio, 2ch, Copy NG, Pre-emphasis No, Track[04], Idx[00], RMSF[00:02:48], AMSF[15:21:71]}, RtoW[0, 0, 0, 0]

test version: https://www.mediafire.com/file/eq80y20l … st.7z/file

12

(35 replies, posted in General discussion)

reentrant wrote:

ULONGLONG performanceFrequency = 0;
ULONGLONG performanceCounter = KeQueryPerformanceCounter(&performanceFrequency);
ULONGLONG ticksMicroSeconds = 1000000 * performanceCounter / performanceFrequency;

I implemented the following in a test version(http://forum.redump.org/post/78821/#p78821).

    LARGE_INTEGER freq = {}, current = {}, end = {};
    QueryPerformanceFrequency(&freq);
    double time = 0;

    QueryPerformanceCounter(&current);
    (Read the CD multiple times)
    QueryPerformanceCounter(&end);
    time = static_cast<double>(end.QuadPart - current.QuadPart) * 1000 / static_cast<double>(freq.QuadPart);

13

(35 replies, posted in General discussion)

Nemok wrote:

The DPM sample itself I guess.

Ah, yes. I don't know yet how A120% outputs these values.

Nemok wrote:

These timings look inconsistent.

Yes. It's a research phase and useless.

14

(35 replies, posted in General discussion)

@Nemok, reentrant
Good work. If only I could figure out how to calculate the 4 byte enumeration in the DPM block, I could support mdf/mds...

By the way, can anyone upload a sector without sync header of a cdi disc? I want to know if it's "mode2 form1" or "mode2 form2" or "mode2 no edc".

I decided to simply check edc/ecc if sync or mode was irregular. It is nonsense to change behavior depending on CD-i or not.

If mode bit1 is 0 and bit0 is 1, it deems to the mode1 and calc edc/ecc.
If mode bit1 is 1 and bit0 is 0, it deems to the mode2 form1/2 and calc edc/ecc.
If edc/ecc is correct, the sector is unscrambled, otherwise is not unscrambled.

If mode bit1 is 0 and bit0 is 0, it deems to the mode0 and the sector is unscrambled if sync and msf is correct.
If mode bit1 is 1 and bit0 is 1, it deems to unknown and the sector is not unscrambled.

The result would be the same as redumper's test(01..46), perhaps.

To:superg
Thanks for the answer. I still have a question.
Redumper unscrambles the sector if sync is broken but msf and mode are normal. Why? Optical drive treats the broken sync sector as error, do not unscramble.

To:Deterous

01_invalid_sync.0.pass
10_invalid_mode_zeroed_intermediate.0.pass
11_invalid_mode_non_zeroed_intermediate.0.pass
12_invalid_mode_non_zeroed_intermediate_last_byte.0.pass

Can you explain from the CD specifications why this sector is unscrambled?

03_mode0_zeroed_data.0.pass
04_mode0_non_zeroed_data.0.pass
05_mode0_non_zeroed_data_last_byte.0.pass

User area of the mode 0 sector is all zero. It's CD specifications. But I confirmed that other software also treats as no error sector. I'll fix this case.

16_msf_mismatch_invalid_sync.42.fail
:
:
45_no_msf_invalid_mode_no_intermediate_max.null.fail

What is the "msf_mismatch" and what is the "no_msf"? It seems msf of test data is normal (00:02:00).

Urk wrote:

I'm not expert enough to decide which dumps are to be considered corrects ^^

As far as the logs are concerned, DIC is correct.

Urk wrote:

And again, I get consistent differents dumps between Redumper & DiscImageCreator.

Pregap length of track 30 and 32 is different.

Urk wrote:

All the discs are in a good shape, no scratches, no moisture.

Last subQ all tracks and second subQ from the last of all tracks is weird. It seems a mastering issue.

21

(3,536 replies, posted in General discussion)

Novicami wrote:

The link for the Windows version is the one for the MAC version. Could you fix it?

Sorry, fixed it.

darksabre76 wrote:

The `C2ErrorProtect.txt` file seems to be different than the one in the repo as well. Not sure if that was from testing or not, but figured I'd mention it.

Ah, thanks. These filenames written in it are sample.

22

(3,536 replies, posted in General discussion)

https://github.com/saramibreak/DiscImag … g/20250101
*2025-01-01
- added /toc option for bad IDE-to-USB adapter (e.g. UGREEN's adapter)
- added /fulltoc option for PX-W4824
- improved subQ channel fixing
- fixed do not request CD-Text on PX-32TS and PX-20TS
- fixed fail to dump PS2 unlicensed discs since 20231201
- fixed PIC.bin when XBOX One disc is dumped

23

(3,536 replies, posted in General discussion)

napa8475 wrote:

The application shows missing some files

MPFlog.txt says

There were files missing from the output:
vol000000AF_SS.bin

But bd command doesn't output _SS.bin.

Try to dump the disc using DIC directly. If it's ok, this is MPF problem, I think.
Or are there security sectors in xbox one disc? If yes, it must be supported.

24

(3,536 replies, posted in General discussion)

napa8475 wrote:

Test version still failed

What is failed?

25

(3,536 replies, posted in General discussion)

Deterous wrote:

I dumped Diablo II (Korea) (Play Disc) just fine with my 4824

OK perhaps your PX-4824 is correct, if you or someone dump S7092920 with no error using PX-4824, I'll edit README.

Deterous wrote:

However the Full TOC shouldn't be used by default, redump uses TOC splits.

I'll add /fulltoc option for the drive returning broken TOC. TOC is default, Full TOC is 2nd choice.