From 53a7e3f85961ae2fb0bb93a5e4d2d4ef2df5aabe Mon Sep 17 00:00:00 2001 From: Zach Riggle Date: Wed, 19 Oct 2016 18:22:30 -0700 Subject: [PATCH] Mask pointer value before packing it (#130) Fixes #123 --- pwndbg/commands/search.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pwndbg/commands/search.py b/pwndbg/commands/search.py index ed5167dc9..854716730 100644 --- a/pwndbg/commands/search.py +++ b/pwndbg/commands/search.py @@ -12,6 +12,7 @@ import struct import gdb +import pwndbg.arch import pwndbg.color.memory as M import pwndbg.commands import pwndbg.config @@ -99,6 +100,7 @@ def search(type, hex, string, executable, writable, value, mapping, save, next): # Convert to an integer if needed, and pack to bytes if type not in ('string', 'bytes'): value = pwndbg.commands.fix_int(value) + value &= pwndbg.arch.ptrmask fmt = { 'little': '<', 'big': '>'