diff options
-rw-r--r-- | tools/sploit/sploit/mem.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/sploit/sploit/mem.py b/tools/sploit/sploit/mem.py index 1149e99..58c3d3d 100644 --- a/tools/sploit/sploit/mem.py +++ b/tools/sploit/sploit/mem.py @@ -2,6 +2,13 @@ class Symtbl: def __init__(self, **kwargs): self.__dict__ = {**kwargs} + def __str__(self): + tbl_format = '\n{:<20} {:<20}' + s = 'len: ' + str(len(self.__dict__)) + s += tbl_format.format('ADDRESS', 'SYMBOL') + for sym,addr in sorted(self.__dict__.items(),key=lambda x:x[1]): + s += tbl_format.format(hex(addr),sym) + return s class Memmap: def __init__(self, tbl, sym, addr): @@ -17,3 +24,12 @@ class Memmap: def __setattr__(self, k, v): raise TypeError('Memmaps are Read-Only! Modify offsets with Symtbl instead!') + + def __str__(self): + tbl_format = '\n{:<20} {:<20}' + s = 'len: ' + str(len(self.__tbl__.__dict__)+1) + s += tbl_format.format('ADDRESS', 'SYMBOL') + s += tbl_format.format(hex(self.base),'base') + for sym,addr in sorted(self.__tbl__.__dict__.items(),key=lambda x:x[1]): + s += tbl_format.format(hex(addr+self.base),sym) + return s |