diff options
author | dusoleil <howcansocksbereal@gmail.com> | 2022-03-13 04:24:30 -0400 |
---|---|---|
committer | dusoleil <howcansocksbereal@gmail.com> | 2022-03-13 04:24:30 -0400 |
commit | 9469b96ded48d7425ecb8e82382b8bbed163b075 (patch) | |
tree | 85c4e9cb9ac186bac6033d4cb18fc5fdb8b94ce7 /tools | |
parent | d3f8148b0fd3e55f1839336ff555ef5418cbaf5e (diff) | |
download | lib-des-gnux-9469b96ded48d7425ecb8e82382b8bbed163b075.tar.gz lib-des-gnux-9469b96ded48d7425ecb8e82382b8bbed163b075.zip |
sploit: remove length calculation from Symtbl
length() fails on local stack frames (where it was originally intended
to be useful) when register based locals (like arguments) are present.
Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/sploit/sploit/mem.py | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/tools/sploit/sploit/mem.py b/tools/sploit/sploit/mem.py index cf138b3..fc8a4b3 100644 --- a/tools/sploit/sploit/mem.py +++ b/tools/sploit/sploit/mem.py @@ -8,14 +8,6 @@ class Symtbl: def rebase(self, sym): self.adjust(-sym) - def __len__(self): - vals = self.__dict__.values() - if len(vals)<1: - return 0 - hi = max(max(vals),0) - lo = min(min(vals),0) - return hi-lo - def __str__(self): return __str__(self,self.__dict__) @@ -34,13 +26,10 @@ class Memmap: def __setattr__(self, k, v): raise TypeError('Memmaps are Read-Only! Modify offsets with Symtbl instead!') - def __len__(self): - return len(self.__tbl__) - def __str__(self): s = __str__(self,self.__tbl__.__dict__) pos = -1 - for i in range(3): + for i in range(2): pos = s.find('\n',pos+1) s = s[:pos] + __tbl_format__.format(hex(self.base),'base') + s[pos:] return s @@ -48,7 +37,6 @@ class Memmap: __tbl_format__ = '\n{:<20} {:<20}' def __str__(self,tbl): s = 'symbols: ' + str(len(tbl)) - s += '\nlength: ' + str(len(self)) s += __tbl_format__.format('ADDRESS', 'SYMBOL') for sym,off in sorted(tbl.items(),key=lambda x:x[1]): s += __tbl_format__.format(hex(getattr(self,sym)),sym) |