MCPcopy Index your code
hub / github.com/Shnatsel/binfarce

github.com/Shnatsel/binfarce @v0.2.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.2.1 ↗ · + Follow
144 symbols 324 edges 15 files 16 documented · 11%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

binfarce

Extremely minimal parser for ELF/PE/Mach-o/ar.

This crate is used mostly for sharing code between cargo-bloat and auditable-extract crates. It implements just enough features for those tools to work. If you're looking for a fully-featured parser, see goblin.

Goals:

  • 100% safe code all the way down. This includes all dependencies.
  • Simple code that's easy to audit. No fancy tricks such as proc macros.

Non-goals:

  • Highest possible performance. Parsing these things is stupidly cheap as it is.
  • Full format support.

Feature status

Header parsing and section extraction are used by both tools. They are zero-allocation and hardened against untrusted inputs.

#[forbid(unsafe_code)] ensures absence of code execution vulnerabilities. Absence of heap allocations ensures that it can't exhaust RAM. Static analysis via opt-in Clippy lints and fuzzing are used to ensure absence of panics.

Symbol extraction is used by cargo-bloat only. It allocates unbounded amounts of memory on the heap and may panic given an untrusted input.

PRs with functionality required for your own tool are welcome as long as they adhere to the above goals and keep existing tools working. However, you should consider using the full-featured goblin crate instead.

This project was briefly known as "kuduk".

Extension points exported contracts — how you extend this code

RawNumber (Interface)
(no doc) [6 implementers]
src/parser.rs

Core symbols most depended-on inside this repo

read
called by 90
src/parser.rs
eat
called by 33
src/demangle/v0.rs
skip_len
called by 15
src/parser.rs
read_bytes
called by 12
src/parser.rs
next
called by 12
src/demangle/v0.rs
parse_null_string
called by 10
src/parser.rs
demangle
called by 7
src/demangle/v0.rs
peek
called by 6
src/demangle/v0.rs

Shape

Method 77
Function 33
Class 28
Enum 5
Interface 1

Languages

Rust100%

Modules by API surface

src/demangle/v0.rs46 symbols
src/elf64.rs17 symbols
src/elf32.rs17 symbols
src/macho.rs16 symbols
src/parser.rs15 symbols
src/pe.rs10 symbols
src/demangle/mod.rs10 symbols
src/demangle/legacy.rs4 symbols
src/lib.rs3 symbols
src/error.rs3 symbols
src/ar.rs3 symbols

For agents

$ claude mcp add binfarce \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact