Goblin is an impish, cross-platform binary parsing crate, written in Rust. It supports:
Usage
rustc
1.31.1.Cargo.toml
[dependencies]
goblin = “0.1”
libgoblin
aims 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.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 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
environmentsModules
archive | Implements a simple parser and extractor for a Unix Archive. |
container | Binary container size information and byte-order context |
elf | The generic ELF module, which gives access to ELF constants and other helper functions, which are independent of ELF bithood. Also defines an Elf struct which implements a unified parser that returns a wrapped Elf64 or Elf32 binary. |
elf32 | The ELF 32-bit struct definitions and associated values, re-exported for easy “type-punning” |
elf64 | The ELF 64-bit struct definitions and associated values, re-exported for easy “type-punning” |
error | A custom Goblin error |
mach | The Mach-o, mostly zero-copy, binary format parser and raw struct definitions |
pe | A PE32 and PE32+ parser |
strtab | A byte-offset based string table. Commonly used in ELF binaries, Unix archives, and even PE binaries. |
Cybersecurity tools play a critical role in safeguarding digital assets, systems, and networks from malicious…
MODeflattener is a specialized tool designed to reverse OLLVM's control flow flattening obfuscation through static…
"My Awesome List" is a curated collection of tools, libraries, and resources spanning various domains…
CVE-2018-17463, a type confusion vulnerability in Chrome’s V8 JavaScript engine, allowed attackers to execute arbitrary…
The blog post "Chrome Browser Exploitation, Part 1: Introduction to V8 and JavaScript Internals" provides…
The exploitation of CVE-2018-17463, a type confusion vulnerability in Chrome’s V8 JavaScript engine, relies on…