onekey-sec / unblob

Extract files from any kind of container formats
https://unblob.org
Other
2.11k stars 80 forks source link

Exception in AR handler invalid literal for int() #767

Open AndrewFasano opened 5 months ago

AndrewFasano commented 5 months ago

Running unblob on https://static.tp-link.com/upload/firmware/2021/202107/20210729/ER7206(UN)_v1_1.1.1%20Build%2020210723.zip produces the following error in the ar extractor:

2024-02-14 01:02.45 [error    ] Unhandled Exception during chunk calculation handler=ar pid=21 severity=<Severity.ERROR: 'ERROR'> start_offset=0x0
Traceback (most recent call last):
  File "/unblob/unblob/finder.py", line 35, in _calculate_chunk
    return handler.calculate_chunk(file, real_offset)
  File "/unblob/unblob/handlers/archive/ar.py", line 37, in calculate_chunk
    ar.read_all_headers()
  File "/usr/local/lib/python3.10/dist-packages/arpy.py", line 403, in read_all_headers
    while self.read_next_header() is not None:
  File "/usr/local/lib/python3.10/dist-packages/arpy.py", line 378, in read_next_header
    header = self.__read_file_header(self.next_header_offset)
  File "/usr/local/lib/python3.10/dist-packages/arpy.py", line 299, in __read_file_header
    add_len = self.__fix_name(file_header)
  File "/usr/local/lib/python3.10/dist-packages/arpy.py", line 350, in __fix_name
    gnu_position = int(header.proxy_name[1:])
ValueError: invalid literal for int() with base 10: b'SYM64'
qkaiser commented 5 months ago

Upstream patch sent at https://github.com/viraptor/arpy/pull/21