An impish, cross-platform binary parsing crate, written in Rust
Add to your
[dependencies] goblin = "0.2"
libgoblinaims to be your one-stop shop for binary parsing, loading, and analysis.
Goblin primarily supports the following important use cases:
#[repr(C)]structs, tiny compile time, 32/64 (or both) at your leisure.
Type punning. Define a function once on a type, but have it work on 32 or 64-bit variants - without really changing anything, and no macros! See
examples/automagic.rsfor a basic example.
stdmode. This throws in read and write impls via
Pwrite, reading from file, convenience allocations, extra methods, etc. This is for clients who can allocate and want to read binaries off disk.
Endian_fd. A truly terrible name :laughing: this is for binary analysis like in panopticon or falcon which needs to read binaries of foreign endianness, or as a basis for constructing cross platform foreign architecture binutils, e.g. cargo-sym and bingrep are simple examples of this, but the sky is the limit.
Here are some things you could do with this crate (or help to implement so they could be done):
no_stdcfg. I.e., it is essentially just struct and const defs (like a C header) - no fd, no output, no std.
libgoblinis designed to be massively configurable. The current flags are:
Thank you all :heart: !
In lexicographic order: