summaryrefslogtreecommitdiffstats
path: root/sploit/rev/ldd.py
diff options
context:
space:
mode:
authordusoleil <howcansocksbereal@gmail.com>2022-03-12 19:18:28 -0500
committerdusoleil <howcansocksbereal@gmail.com>2022-03-13 23:27:30 -0400
commit509a8cfcadcca94d336fe08be897f62a721079d2 (patch)
tree0b729aaf72aebfd9d57deea07192e82fc225ad9b /sploit/rev/ldd.py
parentfc1c413bc6b0054cc9c079dbdd2e74eefd75557a (diff)
downloadnsploit-509a8cfcadcca94d336fe08be897f62a721079d2.tar.gz
nsploit-509a8cfcadcca94d336fe08be897f62a721079d2.zip
sploit: cache results of external commands
rather than cacheing ELF instantiations, just cache the results of external commands Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
Diffstat (limited to '')
-rw-r--r--sploit/rev/ldd.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/sploit/rev/ldd.py b/sploit/rev/ldd.py
index 60306f1..d162207 100644
--- a/sploit/rev/ldd.py
+++ b/sploit/rev/ldd.py
@@ -1,9 +1,10 @@
+from sploit.util import run_cmd_cached
+
import re
-from subprocess import run
from collections import namedtuple as nt
def get_libraries(elf):
- out = run(['ldd',elf],capture_output=True).stdout.decode('utf-8').split('\n')[:-1]
+ out = run_cmd_cached(['ldd',elf])
out = [re.split(r'\s+',lib)[1:] for lib in out]
Lib = nt("Lib", "name path addr")
out = {l[0]:Lib(l[0],l[0] if l[0][0]=='/' else l[2] if l[1]=='=>' else None,l[-1]) for l in out}