6 releases

0.2.1 Jul 3, 2021
0.2.0 Jul 3, 2021
0.1.1 Sep 7, 2020
0.0.1 Aug 11, 2020

#455 in Parser implementations

Download history 408/week @ 2022-08-17 488/week @ 2022-08-24 445/week @ 2022-08-31 520/week @ 2022-09-07 601/week @ 2022-09-14 566/week @ 2022-09-21 601/week @ 2022-09-28 729/week @ 2022-10-05 616/week @ 2022-10-12 863/week @ 2022-10-19 1430/week @ 2022-10-26 12854/week @ 2022-11-02 12459/week @ 2022-11-09 12155/week @ 2022-11-16 8062/week @ 2022-11-23 7859/week @ 2022-11-30

42,633 downloads per month
Used in 6 crates (2 directly)

MIT license

94KB
2.5K SLoC

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".

No runtime deps