
https://docs.rs/goblin/
Goblin requires rustc 1.16.
Add to your Cargo.toml
toml
[dependencies]
goblin = "0.0.11"
libgoblin aims to be your one-stop shop for binary parsing, loading,
and analysis.
Goblin primarily supports the following important use cases:
Core, std-free #[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.rs for a basic example.
std mode. This throws in read and write impls via Pread and 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):
Pwrite derived)no_std cfg. I.e., it is essentially just struct and const defs (like a C header) - no fd, no output, no std.libgoblin is designed to be massively configurable. The current flags are:
repr(C) struct defsrepr(C) struct defsrepr(C) struct defsrepr(C) struct defsrepr(C) struct defsrepr(C) struct defsno_std environmentsThank you all :heart: !
In alphabetic order: