From c17f835b3ee3e817f109e3dc371363560bc66fa9 Mon Sep 17 00:00:00 2001 From: peace-maker Date: Wed, 21 Feb 2024 15:21:57 +0100 Subject: [PATCH] pwn template: Don't search for challenge binary when already given (#2354) --- pwnlib/commandline/template.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pwnlib/commandline/template.py b/pwnlib/commandline/template.py index 6e5f74655..5cd6c7341 100644 --- a/pwnlib/commandline/template.py +++ b/pwnlib/commandline/template.py @@ -47,10 +47,11 @@ def detect_missing_binaries(args): else: if os.access(filename, os.X_OK): other_files.append(filename) - if len(other_files) == 1: - exe = other_files[0] - elif len(other_files) > 1: - log.warning("Failed to find challenge binary. There are multiple binaries in the current directory: %s", other_files) + if not exe: + if len(other_files) == 1: + exe = other_files[0] + elif len(other_files) > 1: + log.warning("Failed to find challenge binary. There are multiple binaries in the current directory: %s", other_files) if exe != args.exe: log.success("Found challenge binary %r", exe)