Skip to content

Commit

Permalink
Add RelativeMemLeak alias for MemLeak(..., relative=True)
Browse files Browse the repository at this point in the history
  • Loading branch information
zachriggle committed Dec 19, 2016
1 parent 8d3cf83 commit ccd9253
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pwn/toplevel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions pwnlib/memleak.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit ccd9253

Please sign in to comment.