Lattyware / unrpa

A program to extract files from the RPA archive format.
http://www.lattyware.co.uk/projects/unrpa/
GNU General Public License v3.0
584 stars 76 forks source link

Unpacking of very old RPA not working #24

Open madeddy opened 4 years ago

madeddy commented 4 years ago

Describe the bug

UnRPA is unable to unpack old Renpy archives with rpi extension (RPA-1.0 possibly)

Konsole output:

$  python3.7 -m unrpa /home/olli/Development/rpy/tstrpa/old/images.rpi
Extracting files from /home/olli/Development/rpy/tstrpa/old/images.rpi.                                                  

There was an error while trying to extract a file from the archive.                                                      
If you wish to try and extract as much from the archive as possible, please use --continue-on-error.                     
Error Detail: Traceback (most recent call last):                                                                         
  File "/home/olli/.local/lib/python3.7/site-packages/unrpa/__init__.py", line 134, in extract_files                     
    version.postprocess(file_view, output_file)                                                                          
  File "/home/olli/.local/lib/python3.7/site-packages/unrpa/versions/version.py", line 24, in postprocess                
    for segment in iter(source.read1, b""):                                                                              
  File "/home/olli/.local/lib/python3.7/site-packages/unrpa/view.py", line 20, in read1                                  
    return self.base_read(lambda source: source.read1, amount)                                                           
  File "/home/olli/.local/lib/python3.7/site-packages/unrpa/view.py", line 34, in base_read                              
    return self.base_read(method, amount)                                                                                
  File "/home/olli/.local/lib/python3.7/site-packages/unrpa/view.py", line 37, in base_read                              
    raise Exception("End of archive reached before the file should end.")                                                
Exception: End of archive reached before the file should end.

How to reproduce the bug

Steps to reproduce the behaviour:

  1. Open my terminal in the directory 'cd /home/olli/.local/lib/python3.7/site-packages/unrpa/'
  2. Run the command 'python3 -m unrpa /home/olli/Development/rpy/tstrpa/old/images.rpi'
  3. Getting cited error

Alternate trys with a random location brings same outcome. e.g.

  1. Open my terminal in the directory: location of *rpi file
  2. Run the command 'unrpa images.rpi'
  3. Getting cited error

Expected behaviour

Successful extraction of archive content.

Files needed to demonstrate the issue

Can be acquired here: Games|Renpy Good examples from this source would be "Wings" or "Dual Hearts". (DL < 10 MiB)

How are you running unrpa

Additional context

There are two Archive files for this RPA version: 'images.rpa' and 'images.rpi' rpi holds imo the index values and .rpa the file data. It looks for me like UnRPA expects the data content in the rpi file.

Lattyware commented 4 years ago

Thanks for the report, I'll take a look when I get a chance.

madeddy commented 4 years ago

Take your time. I just reported it for completeness. I noticed by chance.

RPA1 was last time used 15 years ago and i truly doubt many people want to unpack the somewhat 20 images of this old VNs. IMHO v1 could even be removed.

Lattyware commented 4 years ago

I think it's useful to have tooling for working with old formats, if nothing else, it helps support archival projects and history keeping, which is valuable, so I'll definitely take a look at fixing up support when I get a chance.