From 3527caeddea3e49c65c7f5857fad7bf5d61a92e7 Mon Sep 17 00:00:00 2001 From: EliseZeroTwo Date: Sat, 19 Feb 2022 07:50:54 +0100 Subject: [PATCH] fix: if prolog size is 0, do not display address --- __init__.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/__init__.py b/__init__.py index 576fd92..5b134cf 100644 --- a/__init__.py +++ b/__init__.py @@ -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() @@ -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(