summaryrefslogtreecommitdiffstats
path: root/sploit/rev/elf.py
diff options
context:
space:
mode:
authorMalfurious <m@lfurio.us>2022-03-15 23:04:16 -0400
committerMalfurious <m@lfurio.us>2022-03-17 03:48:43 -0400
commitd7c7c96b4ff932078d0399b5ec6b4f8b8d87f43e (patch)
tree303a890a9ca7e397ef7494021841846e3cec3fa0 /sploit/rev/elf.py
parent3eafa76164fcbd9eafece7cf51fcaf61bffca1c3 (diff)
downloadnsploit-d7c7c96b4ff932078d0399b5ec6b4f8b8d87f43e.tar.gz
nsploit-d7c7c96b4ff932078d0399b5ec6b4f8b8d87f43e.zip
sploit: Clean up use of __getattribute__
__getattribute__ is the low-level magic func and will intercept every attribute lookup, whereas __getattr__ is high-level, and is only invoked in specific conditions (such as __getattribute__'s failure). As such, any overload of __getattribute__ which preferentially falls back to object.__getattribute__() before serving a request, can more simply be replaced by a __getattr__ overload without the fallback. Signed-off-by: Malfurious <m@lfurio.us> Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
Diffstat (limited to '')
-rw-r--r--sploit/rev/elf.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/sploit/rev/elf.py b/sploit/rev/elf.py
index 7bfd31f..e099819 100644
--- a/sploit/rev/elf.py
+++ b/sploit/rev/elf.py
@@ -1,5 +1,4 @@
from sploit.rev import ldd, r2
-from sploit.util import __attr_filter__
class ELF:
def __init__(self, path):
@@ -38,9 +37,7 @@ class ELF:
class __LOCALS__:
def __init__(self, elf):
self.elf = elf
- def __getattribute__(self, sym):
- if(sym in (['elf'] + __attr_filter__)):
- return object.__getattribute__(self,sym)
+ def __getattr__(self, sym):
return r2.get_locals(self.elf.path, getattr(self.elf.sym, sym))
def retaddr(self, caller, callee):