diff --git a/src/patch_bin.rs b/src/patch_bin.rs index fc4e95d..33d9a20 100644 --- a/src/patch_bin.rs +++ b/src/patch_bin.rs @@ -125,7 +125,7 @@ fn bin_patched_path_from_bin(bin: &Path) -> Result { /// Add "_patched" to the end of the binary file name if the binary got patched. pub fn bin_patched_path(opts: &Opts) -> Option { - match opts.no_patch_bin { + match opts.no_patch_bin || opts.libc.is_none() { true => None, false => opts .bin diff --git a/src/pwninit.rs b/src/pwninit.rs index e518abf..8f57845 100644 --- a/src/pwninit.rs +++ b/src/pwninit.rs @@ -49,7 +49,7 @@ pub fn run(opts: Opts) -> Result { set_ld_exec(&opts).context(SetLdExecSnafu)?; - if !opts.no_patch_bin { + if !opts.no_patch_bin && opts.libc.is_some() { patch_bin::patch_bin(&opts).context(PatchBinSnafu)?; }