Skip to content

Commit

Permalink
fix: if prolog size is 0, do not display address
Browse files Browse the repository at this point in the history
  • Loading branch information
EliseZeroTwo committed Feb 19, 2022
1 parent 2f18e07 commit 3527cae
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@ def mouseReleaseEvent(self, event: QMouseEvent) -> None:

def setAddr(self, addr):
self.addr = addr
if self.addr != None:
if self.opt_text != None:
self.setText(self.opt_text + hex(self.addr))
else:
self.setText(hex(self.addr))
if self.addr != None and self.opt_text != None:
self.setText(self.opt_text + hex(self.addr))
elif self.addr != None:
self.setText(hex(self.addr))
elif self.opt_text != None:
self.setText(self.opt_text)
else:
self.clear()

Expand Down Expand Up @@ -236,11 +237,12 @@ def listItemClicked(self, clickedItem):
if clickedItem.entry.unwindinfo.SizeOfProlog != 0:
self.unwind_prolog_size.setOptText(
str(clickedItem.entry.unwindinfo.SizeOfProlog) + " bytes, ends at: ")
self.unwind_prolog_size.setAddr(self.file.OPTIONAL_HEADER.ImageBase + clickedItem.entry.struct.BeginAddress + clickedItem.entry.unwindinfo.SizeOfProlog)
else:
self.unwind_prolog_size.setOptText(
str(clickedItem.entry.unwindinfo.SizeOfProlog) + " bytes")
self.unwind_prolog_size.setAddr(None)

self.unwind_prolog_size.setAddr(self.file.OPTIONAL_HEADER.ImageBase + clickedItem.entry.struct.BeginAddress + clickedItem.entry.unwindinfo.SizeOfProlog)
self.unwind_code_count.setText(
str(clickedItem.entry.unwindinfo.CountOfCodes))
self.unwind_frame_register.setText(
Expand Down

0 comments on commit 3527cae

Please sign in to comment.