Skip to main content

resolve_binary_path

Function resolve_binary_path 

Source
pub fn resolve_binary_path(command: &str) -> Result<String, String>
Expand description

Resolve a command name/path to the real ELF binary that should be passed to sslsniff as --binary-path.

Handles three cases automatically:

  1. A command on $PATH (e.g. claude, node) -> located via PATH search.
  2. A symlink (e.g. ~/.local/bin/claude -> .../versions/2.1.150) -> followed.
  3. A shebang wrapper script (#!/usr/bin/env node) -> the interpreter ELF.

Returns the canonical path of the underlying ELF executable, or an error describing why discovery failed.