Skip to content

Commit

Permalink
fix visual: reload asm: specific case for decompilation mode
Browse files Browse the repository at this point in the history
  • Loading branch information
plasma-disassembler committed Dec 18, 2016
1 parent 79d040e commit d714ab8
Showing 1 changed file with 28 additions and 9 deletions.
37 changes: 28 additions & 9 deletions plasma/lib/ui/disasmbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -849,17 +849,36 @@ def main_cmd_switch_mode(self):


def reload_asm(self):
if self.mode == MODE_DECOMPILE:
ad = self.first_addr
else:
line = self.win_y + self.cursor_y
while line not in self.output.line_addr:
if line >= len(self.output.lines):
break
line += 1

if line == len(self.output.lines):
line = self.win_y + self.cursor_y
while line not in self.output.line_addr:
line += 1
ad = self.output.line_addr[line]
self.exec_disasm(ad)
self.win_y = self.dump_update_up(0)
self.goto_address(ad)
self.main_cmd_line_middle()
if line == -1:
return
line -= 1

ad_disasm = self.output.line_addr[line]
ad_goto = ad_disasm
win_y = self.win_y
cursor_y = self.cursor_y

if self.mode == MODE_DECOMPILE:
ad_disasm = self.first_addr

self.exec_disasm(ad_disasm)

if self.mode == MODE_DECOMPILE:
self.win_y = win_y
self.cursor_y = cursor_y
else:
self.win_y = self.dump_update_up(0)
self.goto_address(ad_goto)
self.main_cmd_line_middle()


def main_cmd_set_code(self):
Expand Down

0 comments on commit d714ab8

Please sign in to comment.