| Crates.io | goblin |
| lib.rs | goblin |
| version | 0.10.1 |
| created_at | 2016-05-13 09:42:57.45343+00 |
| updated_at | 2025-08-15 03:49:56.736766+00 |
| 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 | 1,199,138 |

Goblin requires rustc 1.85.0 (Rust 2024 edition).
Add to your Cargo.toml
[dependencies]
goblin = "0.10"
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 environmentsMaintainers are first contact reviewers for that particular backend. They are chosen based on prior contributions, activity, base knowledge, and amicable and gregarious behavior :D
Currently, I (@m4b) only have merge rights for all PRs. In the future it is likely, that the maintainer(s) for that given backend will also have merge rights as well.
Lastly, I will still likely give cursory reviews to all PRs, but will mostly/entirely default to the maintainer for that backend.
And always remember the wisdom of Bill and Ted: "Be excellent to each other!"
Thank 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).