diff options
author | dusoleil <howcansocksbereal@gmail.com> | 2022-03-12 18:39:53 -0500 |
---|---|---|
committer | dusoleil <howcansocksbereal@gmail.com> | 2022-03-12 18:39:53 -0500 |
commit | b8b16e8e94e555c3a735079cbe1ba92813c85685 (patch) | |
tree | 795da24ad8e65a15a71a960645bda621fb8b1a5f /tools | |
parent | f0147dda4339b8d67af03a682acbaba607cc0b30 (diff) | |
download | lib-des-gnux-b8b16e8e94e555c3a735079cbe1ba92813c85685.tar.gz lib-des-gnux-b8b16e8e94e555c3a735079cbe1ba92813c85685.zip |
sploit: add len func to mem
len() will calculate the length of the symtbl in bytes rather than the
number of symbols
Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/sploit/sploit/mem.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/sploit/sploit/mem.py b/tools/sploit/sploit/mem.py index 0392fa9..f0b93fd 100644 --- a/tools/sploit/sploit/mem.py +++ b/tools/sploit/sploit/mem.py @@ -8,6 +8,14 @@ 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): tbl_format = '\n{:<20} {:<20}' s = 'len: ' + str(len(self.__dict__)) @@ -31,6 +39,9 @@ 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): tbl_format = '\n{:<20} {:<20}' s = 'len: ' + str(len(self.__tbl__.__dict__)+1) |