elfscope is a Rust command-line tool and library for static inspection of ELF files. It reads the file as data; it never executes or loads the target.
Repository: github.com/tac3t/elfscope.
- ELF32 and ELF64 metadata: class, byte order, architecture, entry point, and sorted section summaries.
- Evidence-based checks for PIE, NX, RELRO, stack canaries, FORTIFY, CET IBT/SHSTK, RPATH, RUNPATH, TEXTREL, stripped status, and static linking.
- Human-readable, versioned JSON (schema version 1), and SARIF 2.1.0 output.
- Optional experimental PE parsing and checks, enabled with the
pefeature. - Bounded parsing with configurable input, section, section-name, and symbol limits.
Symbol and dependency summaries, segment output, and DWARF summaries are not implemented. PE support is experimental; a reported Authenticode certificate blob is not signature verification.
Build the CLI from the workspace:
cargo build --release -p elfscope-cliInspect a file or choose a structured output format:
cargo run -p elfscope-cli -- inspect ./program
cargo run -p elfscope-cli -- inspect ./program --json --pretty
cargo run -p elfscope-cli -- checksec ./program --sarif
cargo run -p elfscope-cli -- checksec ./program --fail-on medium
cargo run -p elfscope-cli -- list-checksEnable experimental PE support at build time:
cargo run -p elfscope-cli --features pe -- inspect ./program.exe--checks selects comma-separated check IDs. --fail-on <none|low|medium|high> exits with code 1 when a finding meets the selected severity. --quiet suppresses human-readable output but does not suppress JSON or SARIF. JSON and SARIF are mutually exclusive.
Exit codes are 0 for success, 1 for a reached failure threshold, 2 for invalid CLI usage, 3 for file or parse errors, and 4 for serialization or internal output errors. The CLI limits input files to 512 MiB.
cargo fmt --all -- --check
cargo clippy --workspace --all-targets --all-features -- -D warnings
cargo test --workspace --all-featuresCompiler-built parser fixtures are generated rather than committed. See fixture instructions. CI checks Linux, macOS, and Windows, tests the declared Rust 1.74 MSRV, and runs seeded ELF and PE fuzz targets on Linux.
See architecture, check evidence and limitations, and the JSON contract. The workspace declares dual MIT or Apache-2.0 licensing.