From ccd9253263bd80942ff0da45baaabc9c1bc427ed Mon Sep 17 00:00:00 2001 From: Zach Riggle Date: Mon, 19 Dec 2016 17:07:24 -0500 Subject: [PATCH] Add RelativeMemLeak alias for MemLeak(..., relative=True) --- pwn/toplevel.py | 2 +- pwnlib/memleak.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pwn/toplevel.py b/pwn/toplevel.py index 8aedf8314..cef11db31 100644 --- a/pwn/toplevel.py +++ b/pwn/toplevel.py @@ -32,7 +32,7 @@ from pwnlib.flag import * from pwnlib.fmtstr import FmtStr, fmtstr_payload from pwnlib.log import getLogger -from pwnlib.memleak import MemLeak +from pwnlib.memleak import MemLeak, RelativeMemLeak from pwnlib.regsort import * from pwnlib.replacements import * from pwnlib.rop import ROP diff --git a/pwnlib/memleak.py b/pwnlib/memleak.py index 396ad7393..da82f3f5e 100644 --- a/pwnlib/memleak.py +++ b/pwnlib/memleak.py @@ -625,3 +625,8 @@ def string_wrapper(address, *a, **kw): p32 = setd p16 = setw p8 = setb + +class RelativeMemLeak(MemLeak): + def __init__(self, *a, **kw): + kw.setdefault('relative', True) + return super(RelativeMemLeak, self).__init__(*a, **kw)