From f0147dda4339b8d67af03a682acbaba607cc0b30 Mon Sep 17 00:00:00 2001 From: dusoleil Date: Sat, 12 Mar 2022 18:39:03 -0500 Subject: sploit: move adjust and rebase into member funcs Signed-off-by: dusoleil --- tools/sploit/sploit/mem.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tools/sploit/sploit/mem.py b/tools/sploit/sploit/mem.py index e257c03..0392fa9 100644 --- a/tools/sploit/sploit/mem.py +++ b/tools/sploit/sploit/mem.py @@ -2,6 +2,12 @@ class Symtbl: def __init__(self, **kwargs): self.__dict__ = {**kwargs} + def adjust(self, off): + self.__dict__ = {k:v+off for k,v in self.__dict__.items()} + + def rebase(self, sym): + self.adjust(-sym) + def __str__(self): tbl_format = '\n{:<20} {:<20}' s = 'len: ' + str(len(self.__dict__)) @@ -34,10 +40,3 @@ class Memmap: s += tbl_format.format(hex(addr+self.base),sym) return s -def adjust(tbl, off): - tbl.__dict__ = {k:v+off for k,v in tbl.__dict__.items()} - -def rebase(tbl, sym): - off = -getattr(tbl, sym) - adjust(tbl, off) - -- cgit v1.2.3