diff options
author | dusoleil <howcansocksbereal@gmail.com> | 2022-03-13 17:52:37 -0400 |
---|---|---|
committer | dusoleil <howcansocksbereal@gmail.com> | 2022-03-13 17:52:37 -0400 |
commit | ff3b871f75013748a66d1c0a4ee8de7e311d3281 (patch) | |
tree | d9f211af7004a7ed2dfea68031e7776399b7d124 | |
parent | 9469b96ded48d7425ecb8e82382b8bbed163b075 (diff) | |
download | lib-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.py | 12 |
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__) |