From 158ff535c4995f70a6fefddee5bc8775d3084ccb Mon Sep 17 00:00:00 2001 From: Malfurious Date: Sat, 11 Mar 2023 08:56:28 -0500 Subject: symtbl: Only print column headings if table is populated QoL change - Don't print the headings if the table is empty. Just report "0 symbols" and the base address. Signed-off-by: Malfurious Signed-off-by: dusoleil --- sploit/symtbl.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sploit/symtbl.py b/sploit/symtbl.py index e51b72d..ce57277 100644 --- a/sploit/symtbl.py +++ b/sploit/symtbl.py @@ -173,7 +173,8 @@ class SymtblImpl: """Return human-readable Symtbl""" FMT = "\n{:<20} {:<20}" s = f"{len(self)} symbols @ {hex(self)}" - s += FMT.format("ADDRESS", "SYMBOL") + if len(self) > 0: + s += FMT.format("ADDRESS", "SYMBOL") for symbol, offset in sorted(self, key=lambda v: int(v[1])): disp = f"[{symbol}]" if type(offset) is not int else symbol s += FMT.format(hex(offset), disp) -- cgit v1.2.3