diff --git a/omnivore/_omnivore_version.py b/omnivore/_omnivore_version.py index b2b90876..2ded3fc2 100644 --- a/omnivore/_omnivore_version.py +++ b/omnivore/_omnivore_version.py @@ -1 +1 @@ -version = "0.9.2" +version = "0.9.3" diff --git a/omnivore/tasks/hex_edit/disassembly.py b/omnivore/tasks/hex_edit/disassembly.py index bab00072..be612b15 100644 --- a/omnivore/tasks/hex_edit/disassembly.py +++ b/omnivore/tasks/hex_edit/disassembly.py @@ -94,11 +94,14 @@ def set_grid_cell_attr(self, grid, col, attr): def get_index_range(self, r, c): try: - line = self.lines[r] - except: - line = self.lines[-1] - index = line[0] - self.start_addr - return index, index + line[4] + try: + line = self.lines[r] + except: + line = self.lines[-1] + index = line[0] - self.start_addr + return index, index + line[4] + except IndexError: + return 0, 0 def is_index_valid(self, index): return index < len(self.segment) diff --git a/omnivore/utils/wx/bytegrid.py b/omnivore/utils/wx/bytegrid.py index 4895a39e..4ade13fe 100644 --- a/omnivore/utils/wx/bytegrid.py +++ b/omnivore/utils/wx/bytegrid.py @@ -755,9 +755,10 @@ def on_motion_update_status(self, evt): row = self.YToRow(y) col = self.XToCol(x) index, _ = self.table.get_index_range(row, col) - label = self.table.get_label_at_index(index) - message = self.get_status_message_at_index(index, row, col) - self.editor.task.status_bar.message = "%s: %s %s" % (self.short_name, label, message) + if self.table.is_index_valid(index): + label = self.table.get_label_at_index(index) + message = self.get_status_message_at_index(index, row, col) + self.editor.task.status_bar.message = "%s: %s %s" % (self.short_name, label, message) def get_status_message_at_index(self, index, row, col): return "r=%d,c=%d" % (row, col)