diff --git a/pate_binja/pate.py b/pate_binja/pate.py index cb193727..e15d1189 100644 --- a/pate_binja/pate.py +++ b/pate_binja/pate.py @@ -723,6 +723,17 @@ def __init__(self, raw: dict): self.equalityTraceCollection = TraceCollection('Equality', ltv['value']) self.sharedEnv = raw['shared_env'] + def prettyLoc(self, loc: dict) -> str: + id = loc.get('ptr',{}).get('offset',{}).get('symbolic_ident') + if not id: + return '1 ' + str(loc) + matches = [x['symbolic_expr'] for x in self.sharedEnv if x['symbolic_ident'] == id] + if not matches: + return '2 ' + str(loc) + with io.StringIO() as out: + pprint_symbolic(out, matches[0]) + return out.getvalue() + class CFARNode: exits: list[CFARNode] @@ -1842,6 +1853,7 @@ def run_pate_demo(): replay = file.endswith('.replay') user = TtyUserInteraction(not replay) pate = PateWrapper(file, user) + #pate.debug_cfar = True pate.run() diff --git a/pate_binja/view.py b/pate_binja/view.py index 1febeddd..7376a95c 100644 --- a/pate_binja/view.py +++ b/pate_binja/view.py @@ -1049,8 +1049,7 @@ def updateEqValSelection(self): item.setData(Qt.UserRole, traces) for (loc, traces) in traceCollection.cellTraces: - locStr = str(loc) - #locStr = pate.get_mem_desc(m) + locStr = wInfo.prettyLoc(loc) item = QListWidgetItem(locStr, self.locList) item.setData(Qt.UserRole, traces)