summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordusoleil <howcansocksbereal@gmail.com>2022-03-12 18:39:03 -0500
committerdusoleil <howcansocksbereal@gmail.com>2022-03-12 18:39:03 -0500
commitf0147dda4339b8d67af03a682acbaba607cc0b30 (patch)
tree18fdf9990036686c48305a85f4549be7e4a197ef
parenta1a1c6151dc23a32d9f19da8cd721ed82495b86e (diff)
downloadlib-des-gnux-f0147dda4339b8d67af03a682acbaba607cc0b30.tar.gz
lib-des-gnux-f0147dda4339b8d67af03a682acbaba607cc0b30.zip
sploit: move adjust and rebase into member funcs
Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
-rw-r--r--tools/sploit/sploit/mem.py13
1 files 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)
-