Reconstruction fails for solid archives

Issue #50 new
Former user created an issue

FIFA.Football.2003.GERMAN-Souldrinker fails to reconstruct (using current pyReScene from source):

D:\Fifa>pysrr FIFA.Football.2003.GERMAN-Souldrinker.srr -z prep -o out -t temp -v

SRR file created with pyReScene Auto 0.5.
Recreating stored file: souldrinker-fifa2003.nfo
Recreating stored file: CD1/sd-f2k31.sfv
Recreating stored file: CD2/sd-f2k32.sfv
Re-creating RAR file: sd-f2k31.001
Trying to rebuild compressed file sd-f2k31.bin.
Grabbing large enough data piece size for testing.
Trying 2002-05-14 3.00.
Good RAR version detected: 2002-05-14 3.00
prep\2002-05-14_rar300.exe a -m3 -mdA -s- -ds -vn -o+ -ep -idcd -v13118637b temp\tmpmh_3xp_pyReScene\pyReScene_compressed.rar D:\Fifa\sd-f2k31.bin
Compressing sd-f2k31.bin...

RAR 3.00    Copyright (c) 1993-2002 Eugene Roshal    14 May 2002
Shareware version         Type RAR -? for help

Evaluation copy. Please register.

Creating archive temp\tmpmh_3xp_pyReScene\pyReScene_compressed.rar

Adding    D:\Fifa\sd-f2k31.bin

Creating archive temp\tmpmh_3xp_pyReScene\pyReScene_compressed.r00

...       sd-f2k31.bin

[.....]

Creating archive temp\tmpmh_3xp_pyReScene\pyReScene_compressed.r27

...       sd-f2k31.bin                                                OK
Done
369076195
369076211
Still not fine :(.
Traceback (most recent call last):
  File "C:\pyrescene_2aa5536\rescene\srr.py", line 482, in main
    parser.exit(manage_srr(options, infolder, infiles, working_dir))
  File "C:\pyrescene_2aa5536\rescene\srr.py", line 259, in manage_srr
    options.rar_executable_dir, options.temp_dir)
  File "C:\pyrescene_2aa5536\rescene\main.py", line 1153, in reconstruct
    in_folder, hints, auto_locate_renamed)
  File "C:\pyrescene_2aa5536\rescene\main.py", line 1502, in get_rar_data_object
    in_folder, hints, auto_locate_renamed))
  File "C:\pyrescene_2aa5536\rescene\main.py", line 1774, in compressed_rar_file_factory
    nblock, followup_src, solid=False)
  File "C:\pyrescene_2aa5536\rescene\main.py", line 1967, in __init__
    raise ValueError("Still not fine :(.")
ValueError: Still not fine :(.
Unexpected Error: Still not fine :(.

The original archive is solid, as you can see by checking the respective HEAD_FLAGS field of the archive header which is contained in the .srr file (HEAD_FLAGS & 0x8 != 0). pyReScene doesn't seem to consider this, since it tries to reconstruct by explicitly disabling solid archiving (-s- switch). This leads to the difference between expected and actual size (369076211 vs. 369076195 bytes).

Running the same version of WinRAR with enabled solid archiving (-s switch) and the correct volume size immediately yields the desired archives (assuming the modification timestamps of the .bin and .cue files are correct):

prep\2002-05-14_rar300.exe a -m3 -mdA -s -ds -vn -o+ -ep -idcd -v15000000b compressed.rar sd-f2k31.bin sd-f2k31.cue

I was able to reproduce the same issue with several other Souldrinker releases. I guess pyReScene compresses each file separately and then tries to concatenate the results. This will not work for solid archives. Solid archives should be reconstructed in one go if they are to match the original ones.

Comments (2)

  1. Gfy repo owner

    pyReScene takes into account solid archives, but this is indeed not how it should work. There are two algorithms to reconstruct, but the first one primarily works on the separate files and the solid stuff is hacked on later.

    It looks like it is using the first algorithm with the oldest code since the volume sizes aren't equal either: https://bitbucket.org/Gfy/pyrescene/src/2aa55365a75b1fce2ac8fb57776f4c8bf063cdfd/rescene/main.py?at=default#cl-1924

    I don't think volume sizes matter though. (only having them or not)

    then tries to concatenate the results. This will not work for solid archives.

    I already noticed it doesn't work for all other archives either. Hence that second algorithm. pyReScene will look at all those RAR archives and use that in the reconstruction code as if it was just any other regular file.

  2. Log in to comment