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
commit8fbd167c1a6fedae7ca19eeed1f3ef8b0088727b (patch)
tree96ee79bcc0eeb0e4ea0fc8c36b85fa3affb0bf6b
parentd26f8ae0e4ed1c7664f1359c1ad3b333bc1207e9 (diff)
downloadsploit-8fbd167c1a6fedae7ca19eeed1f3ef8b0088727b.tar.gz
sploit-8fbd167c1a6fedae7ca19eeed1f3ef8b0088727b.zip
sploit: Instantiate Memmap with integer offset
Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
-rw-r--r--sploit/mem.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/sploit/mem.py b/sploit/mem.py
index fc8a4b3..932510d 100644
--- a/sploit/mem.py
+++ b/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__)