From 93f9b12007b61493e2f89554440d853a1bc14486 Mon Sep 17 00:00:00 2001 From: disconnect3d Date: Tue, 17 Aug 2021 00:45:17 +0000 Subject: [PATCH] Fix context when reg value deref fails --- pwndbg/enhance.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pwndbg/enhance.py b/pwndbg/enhance.py index b98bd33b0..70fb18018 100644 --- a/pwndbg/enhance.py +++ b/pwndbg/enhance.py @@ -106,6 +106,10 @@ def enhance(value, code = True): if szval: szval = E.string(repr(szval)) + # Fix for case we can't read the end address anyway (#946) + if value + pwndbg.arch.ptrsize > page.end: + return E.integer(int_str(value)) + intval = int(pwndbg.memory.poi(pwndbg.typeinfo.pvoid, value)) intval0 = intval if 0 <= intval < 10: