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 »

Python 3.12 x86: https://www.python.org/ftp/python/3.12. … 3.12.9.exe

32bit DLL in attachment.
Attachments
32.7z
Imported Redump attachment 21851
(67.56 KiB) Downloaded 1 time
sarami
Posts: 1762
Joined: Mon Jun 08, 2026 1:27 am

Re: CDArchive - Improved support for ring based protections

Post by sarami »

reentrant wrote:32bit DLL in attachment.
Thanks. I implemented it but error occurs.

Code: Select all

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?

Code: Select all

    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;
            }
        }
    }
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 »

> Could not find platform independent libraries <prefix>

This is critical problem - I'll test it over the weekend but in the meantime, did you adjust the path in C2Corrector.ini?
sarami
Posts: 1762
Joined: Mon Jun 08, 2026 1:27 am

Re: CDArchive - Improved support for ring based protections

Post by sarami »

reentrant wrote:did you adjust the path in C2Corrector.ini?
I set it.

Code: Select all

PYTHONHOME = C:\Users\xxx\AppData\Local\Programs\Python\Python312-32
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 »

Maybe there's some problem with config file encoding (by default it expects UTF 16-LE with BOM). Added debugprint (C2Corrector.7z). I have also added testing script which invokes functions from reedsolo.py directly.

Usage:

Code: Select all

"c:\Program Files (x86)\Python312-32\python.exe" c2.py
Does it show you any errors?
Attachments
Test.7z
Imported Redump attachment 21873
(22.5 KiB) Downloaded 1 time
C2Corrector.7z
Imported Redump attachment 21874
(17.07 KiB) Downloaded 1 time
Last edited by reentrant on Sun Mar 30, 2025 12:14 pm, edited 1 time in total.
sarami
Posts: 1762
Joined: Mon Jun 08, 2026 1:27 am

Re: CDArchive - Improved support for ring based protections

Post by sarami »

It seems that PYTHONHOME is set.

Code: Select all

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.

Code: Select all

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?
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 »

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

No, these DLLs are loaded automatically.

I can trigger this message (Could not find platform independent libraries <prefix>) when PYTHONHOME variable is not set by SetEnvironmentVariableW or when it is set to the wrong path. There are few options left.

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.

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. You can also try setting system wide / user wide PYTHONHOME variable and check which case works.
Attachments
C2Corrector.7z
Imported Redump attachment 21888
(16.95 KiB) Downloaded 1 time
sarami
Posts: 1762
Joined: Mon Jun 08, 2026 1:27 am

Re: CDArchive - Improved support for ring based protections

Post by sarami »

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".
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 »

Hmmm. Maybe commit the codes to github branch and I'll debug it locally? Something is not right...
sarami
Posts: 1762
Joined: Mon Jun 08, 2026 1:27 am

Re: CDArchive - Improved support for ring based protections

Post by sarami »

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.
Last edited by sarami on Thu Apr 03, 2025 12:28 am, edited 1 time in total.
DiscImageCreator, UmdImageCreator, Conv2multiBin, bin2wav, PS3Auth (needs login), [url=http://www.mediafire.com/file/5cgoy11x6ahc7qh/%2523recompressTo7z_20150109.bat/file]recompressTo7z_20150109.bat[/url]
Post Reply