robmcmullen / omnivore

Hex editor and debugging emulator, sponsored by the Player/Missile Podcast
Mozilla Public License 2.0
53 stars 7 forks source link

Find doesn't work on Atari DOS segments inside ATR images #246

Closed robmcmullen closed 5 years ago

robmcmullen commented 6 years ago

Using the example image ANALOG51.XFD, select one of the files and try to find a character. For instance, chose SLITHER.OBJ and try to find "j" for "jsr". Error:

Traceback (most recent call last):
  File "/home/rob/src/omnivore-old/omnivore/framework/minibuffer.py", line 163, in on_text
    self.perform()
  File "/home/rob/src/omnivore-old/omnivore/framework/minibuffer.py", line 326, in perform
    self.editor.process_command(cmd)
  File "/home/rob/src/omnivore-old/omnivore/framework/editor.py", line 675, in process_command
    undo = self.process_batch_command(command, f, batch)
  File "/home/rob/src/omnivore-old/omnivore/framework/editor.py", line 688, in process_batch_command
    undo = self.document.undo_stack.perform(command, self, batch)
  File "/home/rob/src/omnivore-old/omnivore/utils/command.py", line 89, in perform
    cmd.perform(editor, undo_info)
  File "/home/rob/src/omnivore-old/omnivore8bit/hex_edit/commands.py", line 587, in perform
    searcher = searcher_cls(editor, self.search_text)
  File "/home/rob/src/omnivore-old/omnivore8bit/utils/searchutil.py", line 13, in __init__
    self.matches = self.get_matches(editor)
  File "/home/rob/src/omnivore-old/omnivore8bit/utils/searchutil.py", line 86, in get_matches
    for index, comment in segment.iter_comments_in_segment():
  File "/code/venv/wx4/lib/python2.7/site-packages/atrcopy/segments.py", line 1026, in iter_comments_in_segment
    end_index = self.get_raw_index(len(self.rawdata))
  File "/code/venv/wx4/lib/python2.7/site-packages/atrcopy/segments.py", line 613, in get_raw_index
    return self.rawdata.get_raw_index(i)
  File "/code/venv/wx4/lib/python2.7/site-packages/atrcopy/segments.py", line 279, in get_raw_index
    return int(self.order[i])
IndexError: index 4255 is out of bounds for axis 0 with size 4255
robmcmullen commented 5 years ago

Whelp, this won't be a problem any more since atrcopy isn't used.