From a8c2fb5342ca6738adbde6243d881b115b62dbe4 Mon Sep 17 00:00:00 2001 From: anthraxx Date: Fri, 2 Apr 2021 04:10:37 +0200 Subject: [PATCH] fix(ui): fix display of addrsz to be hex formated Currently this function is only used for the backtrace context and does not prefix the frame pointers in hex form, which can be annoying if the value is copied to be inspected or otherwise processed. --- pwndbg/ui.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pwndbg/ui.py b/pwndbg/ui.py index 67adb45d9..e0245093f 100644 --- a/pwndbg/ui.py +++ b/pwndbg/ui.py @@ -50,7 +50,7 @@ def banner(title, target=sys.stdin, width=None): def addrsz(address): address = int(address) & pwndbg.arch.ptrmask - return "%{}x".format(2*pwndbg.arch.ptrsize) % address + return "%#{}x".format(2*pwndbg.arch.ptrsize) % address def get_window_size(target=sys.stdin): fallback = (int(os.environ.get('LINES', 20)), int(os.environ.get('COLUMNS', 80)))