From 0df5b7e39a137077de0bd091e2011b9ff3865ac9 Mon Sep 17 00:00:00 2001 From: Zach Riggle Date: Mon, 20 Jul 2015 17:37:55 -0400 Subject: [PATCH] Bail nicely if AUXV is unreadable --- pwndbg/auxv.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pwndbg/auxv.py b/pwndbg/auxv.py index 9ff7e14cf..67fe916ae 100644 --- a/pwndbg/auxv.py +++ b/pwndbg/auxv.py @@ -81,7 +81,12 @@ class AUXV(dict): name = AT_CONSTANTS.get(const, "AT_UNKNOWN%i" % const) if name in ['AT_EXECFN', 'AT_PLATFORM']: - value = gdb.Value(value).cast(pwndbg.typeinfo.pchar).string() + try: + value = gdb.Value(value) + value = value.cast(pwndbg.typeinfo.pchar) + value = value.string() + except: + value = 'couldnt read AUXV!' self[name] = value def __getattr__(self, attr):