Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
BartmanAbyss opened this issue Jul 6, 2023 · 1 comment
Open
Labels

Comments

@BartmanAbyss
Copy link

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
Copy link
Owner

cnvogelg commented Jan 3, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants