summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/sploit/sploit/__init__.py2
-rw-r--r--tools/sploit/sploit/mem.py15
2 files changed, 16 insertions, 1 deletions
diff --git a/tools/sploit/sploit/__init__.py b/tools/sploit/sploit/__init__.py
index d9ea6b0..836bb30 100644
--- a/tools/sploit/sploit/__init__.py
+++ b/tools/sploit/sploit/__init__.py
@@ -1 +1 @@
-__all__ = ["log","comm","until","arch"]
+__all__ = ["log","comm","until","arch","mem"]
diff --git a/tools/sploit/sploit/mem.py b/tools/sploit/sploit/mem.py
new file mode 100644
index 0000000..6de32f8
--- /dev/null
+++ b/tools/sploit/sploit/mem.py
@@ -0,0 +1,15 @@
+class Symtbl:
+ def __init__(self, base=0, **kwargs):
+ self.__dict__ = {'base' : base, **kwargs}
+
+ def __getattribute__(self, sym):
+ a = object.__getattribute__(self, sym)
+ if sym in object.__getattribute__(self,'__dict__') and sym != 'base':
+ return self.base + a
+ else:
+ return a
+
+ def addr(self, sym, addr):
+ if sym == 'base' : self.base = addr
+ else: self.base = addr - object.__getattribute__(self, sym)
+