diff options
author | Malfurious <m@lfurio.us> | 2025-03-24 02:17:39 -0400 |
---|---|---|
committer | Malfurious <m@lfurio.us> | 2025-03-24 02:53:46 -0400 |
commit | bfedfd013474c04b1980d295fcb5c5e5379a240a (patch) | |
tree | 754ade8e85969e3a9e8e9b55e2fb137bbf4bd6a4 | |
parent | 0b05d7a8a3c9254a731910efe0b0d2d3f4ca56f7 (diff) | |
download | nsploit-no-rev-cache.tar.gz nsploit-no-rev-cache.zip |
WIP Disable rev/elf cachingno-rev-cache
-rw-r--r-- | nsploit/rev/r2.py | 3 | ||||
-rw-r--r-- | nsploit/util/cmd.py | 10 |
2 files changed, 2 insertions, 11 deletions
diff --git a/nsploit/rev/r2.py b/nsploit/rev/r2.py index 765d2a7..5849e74 100644 --- a/nsploit/rev/r2.py +++ b/nsploit/rev/r2.py @@ -78,7 +78,6 @@ def rop_json(binary): # ] return json.loads("\n".join(run_cmd(binary, "/Rj"))) -@cache def rop_gadgets(binary, *regexes, cont=False): ilog(f"Searching {binary} for {'; '.join(regexes)} gadgets with r2...") gadgets = rop_json(binary) @@ -120,7 +119,6 @@ def rop_gadget(binary, *regexes): raise LookupError(f"Could not find gadget for: {'; '.join(regexes)}") return results[0] -@cache def get_call_returns(binary,xref_from,xref_to): ilog(f'Getting return addresses of calls from {hex(xref_from)} to {hex(xref_to)} in {binary} with r2...') @@ -136,7 +134,6 @@ def get_call_returns(binary,xref_from,xref_to): rets.append(CallRet(xref_from,xref_to,int(x[0],0),int(ret[0],0))) return rets -@cache def get_bin_info(binary): ilog(f'Retrieving binary and security info about {binary} with r2...') diff --git a/nsploit/util/cmd.py b/nsploit/util/cmd.py index 5025a55..0a1333b 100644 --- a/nsploit/util/cmd.py +++ b/nsploit/util/cmd.py @@ -3,12 +3,6 @@ from subprocess import run def run_cmd(cmd,cwd=None): return run(cmd,cwd=cwd,capture_output=True,text=True,check=True).stdout.split('\n')[:-1] -__RUN_CACHE__ = {} def run_cmd_cached(cmd,cwd=None): - key = ''.join(cmd) - if key in __RUN_CACHE__: - return __RUN_CACHE__[key] - else: - result = run_cmd(cmd,cwd) - __RUN_CACHE__[key] = result - return result + result = run_cmd(cmd,cwd) + return result |