Skip to content

Commit 5724c39

Browse files
committed
Return path to cache file if not extract
1 parent 3496d98 commit 5724c39

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pwnlib/asm.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -780,8 +780,11 @@ def asm(shellcode, vma = 0, extract = True, shared = False):
780780
asm_hash = sha1sumhex(_encode(shellcode) + _encode(hash_params))
781781
cache_file = os.path.join(cache_dir, asm_hash)
782782
if os.path.exists(cache_file):
783-
with open(cache_file, 'rb') as f:
784-
return f.read()
783+
if extract:
784+
with open(cache_file, 'rb') as f:
785+
return f.read()
786+
else:
787+
return cache_file
785788

786789
assembler = _assembler()
787790
linker = _linker()

0 commit comments

Comments
 (0)