Crates.io | goblin |
lib.rs | goblin |
version | 0.9.2 |
source | src |
created_at | 2016-05-13 09:42:57.45343 |
updated_at | 2024-10-27 00:46:01.080465 |
description | An impish, cross-platform, ELF, Mach-o, and PE binary parsing and loading crate |
homepage | |
repository | https://github.com/m4b/goblin |
max_upload_size | |
id | 5054 |
size | 890,554 |
Goblin requires rustc
1.63.0 (Rust 2021 edition).
Add to your Cargo.toml
[dependencies]
goblin = "0.9"
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 defsrepr(C)
struct defsno_std
environmentsThank you all :heart: !
In lexicographic order:
Unless explicitly stated otherwise, you agree that your contributions are licensed as described in the accompanying LICENSE file (MIT).