Skip to content

Commit c17f835

Browse files
authored
pwn template: Don't search for challenge binary when already given (#2354)
1 parent eb0043a commit c17f835

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

pwnlib/commandline/template.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,11 @@ def detect_missing_binaries(args):
4747
else:
4848
if os.access(filename, os.X_OK):
4949
other_files.append(filename)
50-
if len(other_files) == 1:
51-
exe = other_files[0]
52-
elif len(other_files) > 1:
53-
log.warning("Failed to find challenge binary. There are multiple binaries in the current directory: %s", other_files)
50+
if not exe:
51+
if len(other_files) == 1:
52+
exe = other_files[0]
53+
elif len(other_files) > 1:
54+
log.warning("Failed to find challenge binary. There are multiple binaries in the current directory: %s", other_files)
5455

5556
if exe != args.exe:
5657
log.success("Found challenge binary %r", exe)

0 commit comments

Comments
 (0)