cnvogelg / amitools

Various tools for using AmigaOS programs on other platforms
250 stars 69 forks source link

hunktool crashes (maybe related to HUNK_OVERLAY, HUNK_BREAK) #188

Open BartmanAbyss opened 1 year ago

BartmanAbyss commented 1 year ago

mm2.zip

barto@barto10:~$ .local/bin/hunktool info /mnt/c/Users/bwodok/Downloads/mm2 -v
/mnt/c/Users/bwodok/Downloads/mm2 (0.0005s)
  hunks:     [HEADER,CODE,ABSRELOC32,END,DATA,ABSRELOC32,END,BSS,END,OVERLAY,HEADER,CODE,END,BREAK]
  type:      Traceback (most recent call last):
  File ".local/bin/hunktool", line 8, in <module>
    sys.exit(main())
  File "/home/barto/.local/lib/python3.8/site-packages/amitools/tools/hunktool.py", line 315, in main
    res = cmd.run()
  File "/home/barto/.local/lib/python3.8/site-packages/amitools/tools/hunktool.py", line 126, in run
    ok = scanner.scan(path)
  File "/home/barto/.local/lib/python3.8/site-packages/amitools/scan/FileScanner.py", line 38, in scan
    return self._scan_file(path)
  File "/home/barto/.local/lib/python3.8/site-packages/amitools/scan/FileScanner.py", line 80, in _scan_file
    return self.scan_obj(sf, False)
  File "/home/barto/.local/lib/python3.8/site-packages/amitools/scan/FileScanner.py", line 56, in scan_obj
    ok = self._call_handler(sf)
  File "/home/barto/.local/lib/python3.8/site-packages/amitools/scan/FileScanner.py", line 100, in _call_handler
    return self.handler(scan_file)
  File "/home/barto/.local/lib/python3.8/site-packages/amitools/tools/hunktool.py", line 106, in process_file
    return self.handle_file(path, hunk_file, result, delta)
  File "/home/barto/.local/lib/python3.8/site-packages/amitools/tools/hunktool.py", line 63, in handle_file
    ok = hunk_file.build_segments()
  File "/home/barto/.local/lib/python3.8/site-packages/amitools/binfmt/hunk/HunkReader.py", line 1026, in build_segments
    return self.build_loadseg()
  File "/home/barto/.local/lib/python3.8/site-packages/amitools/binfmt/hunk/HunkReader.py", line 772, in build_loadseg
    e["alloc_size"] = self.header["hunks"][hunk_no]["size"]
IndexError: list index out of range
cnvogelg commented 6 months ago

Yeah, overlays are currently not supported and lead to unexpected crashes. A proper overlay handling needs to implemented (some day)...