Skip to main content

extract_libs_from_binary

Function extract_libs_from_binary 

Source
pub fn extract_libs_from_binary(
    exe_path: &Path,
    debug: bool,
) -> Result<Option<PathBuf>>
Expand description

Extract runtime libraries from a packed stub binary.

Reads the last 32 bytes of the executable looking for a SMOLLIBS footer. If found, extracts the compressed libs bundle to a cache directory and returns the path to the lib/ directory containing libkrun/libkrunfw.

Returns None if the binary has no embedded libs (e.g., the base smolvm binary).