summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordusoleil <howcansocksbereal@gmail.com>2022-03-13 17:52:37 -0400
committerdusoleil <howcansocksbereal@gmail.com>2022-03-13 17:52:37 -0400
commitff3b871f75013748a66d1c0a4ee8de7e311d3281 (patch)
treed9f211af7004a7ed2dfea68031e7776399b7d124
parent9469b96ded48d7425ecb8e82382b8bbed163b075 (diff)
downloadlib-des-gnux-ff3b871f75013748a66d1c0a4ee8de7e311d3281.tar.gz
lib-des-gnux-ff3b871f75013748a66d1c0a4ee8de7e311d3281.zip
sploit: Instantiate Memmap with integer offset
Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
-rw-r--r--tools/sploit/sploit/mem.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/sploit/sploit/mem.py b/tools/sploit/sploit/mem.py
index fc8a4b3..932510d 100644
--- a/tools/sploit/sploit/mem.py
+++ b/tools/sploit/sploit/mem.py
@@ -13,18 +13,18 @@ class Symtbl:
class Memmap:
def __init__(self, tbl, sym, addr):
- object.__setattr__(self,'__tbl__', tbl)
- base = addr if sym == 'base' else addr - getattr(self.__tbl__, sym)
- object.__setattr__(self,'base', base)
+ self.__tbl__ = tbl
+ self.base = addr - sym
def __getattribute__(self, sym):
- if sym == '__tbl__' or sym == 'base':
+ if(sym in ['__tbl__','base']):
return object.__getattribute__(self, sym)
a = getattr(self.__tbl__, sym)
return self.base + a
- def __setattr__(self, k, v):
- raise TypeError('Memmaps are Read-Only! Modify offsets with Symtbl instead!')
+ def __setattr__(self, sym, addr):
+ if(sym in ['__tbl__','base']):
+ return object.__setattr__(self,sym,addr)
def __str__(self):
s = __str__(self,self.__tbl__.__dict__)