b28df3b531
This has the side effect of adding another version of uuid, which we'll upgrade for other dependencies subsequently. Differential Revision: https://phabricator.services.mozilla.com/D55911 --HG-- rename : third_party/rust/uuid/.cargo-checksum.json => third_party/rust/uuid-0.7.4/.cargo-checksum.json rename : third_party/rust/uuid/Cargo.toml => third_party/rust/uuid-0.7.4/Cargo.toml rename : third_party/rust/uuid/README.md => third_party/rust/uuid-0.7.4/README.md rename : third_party/rust/uuid/README.tpl => third_party/rust/uuid-0.7.4/README.tpl rename : third_party/rust/uuid/benches/format_str.rs => third_party/rust/uuid-0.7.4/benches/format_str.rs rename : third_party/rust/uuid/benches/invalid_parse_str.rs => third_party/rust/uuid-0.7.4/benches/invalid_parse_str.rs rename : third_party/rust/uuid/benches/mod.rs => third_party/rust/uuid-0.7.4/benches/mod.rs rename : third_party/rust/uuid/benches/serde_support.rs => third_party/rust/uuid-0.7.4/benches/serde_support.rs rename : third_party/rust/uuid/benches/slog_support/mod.rs => third_party/rust/uuid-0.7.4/benches/slog_support/mod.rs rename : third_party/rust/uuid/benches/slog_support/parse_str.rs => third_party/rust/uuid-0.7.4/benches/slog_support/parse_str.rs rename : third_party/rust/uuid/benches/valid_parse_str.rs => third_party/rust/uuid-0.7.4/benches/valid_parse_str.rs rename : third_party/rust/uuid/src/adapter/compact.rs => third_party/rust/uuid-0.7.4/src/adapter/compact.rs rename : third_party/rust/uuid/src/adapter/core_support/mod.rs => third_party/rust/uuid-0.7.4/src/adapter/core_support/mod.rs rename : third_party/rust/uuid/src/adapter/mod.rs => third_party/rust/uuid-0.7.4/src/adapter/mod.rs rename : third_party/rust/uuid/src/builder.rs => third_party/rust/uuid-0.7.4/src/builder.rs rename : third_party/rust/uuid/src/core_support.rs => third_party/rust/uuid-0.7.4/src/core_support.rs rename : third_party/rust/uuid/src/lib.rs => third_party/rust/uuid-0.7.4/src/lib.rs rename : third_party/rust/uuid/src/parser/core_support.rs => third_party/rust/uuid-0.7.4/src/parser/core_support.rs rename : third_party/rust/uuid/src/parser/mod.rs => third_party/rust/uuid-0.7.4/src/parser/mod.rs rename : third_party/rust/uuid/src/parser/std_support.rs => third_party/rust/uuid-0.7.4/src/parser/std_support.rs rename : third_party/rust/uuid/src/prelude.rs => third_party/rust/uuid-0.7.4/src/prelude.rs rename : third_party/rust/uuid/src/serde_support.rs => third_party/rust/uuid-0.7.4/src/serde_support.rs rename : third_party/rust/uuid/src/slog_support.rs => third_party/rust/uuid-0.7.4/src/slog_support.rs rename : third_party/rust/uuid/src/std_support.rs => third_party/rust/uuid-0.7.4/src/std_support.rs rename : third_party/rust/uuid/src/test_util.rs => third_party/rust/uuid-0.7.4/src/test_util.rs rename : third_party/rust/uuid/src/u128_support.rs => third_party/rust/uuid-0.7.4/src/u128_support.rs rename : third_party/rust/uuid/src/v1.rs => third_party/rust/uuid-0.7.4/src/v1.rs rename : third_party/rust/uuid/src/v3.rs => third_party/rust/uuid-0.7.4/src/v3.rs rename : third_party/rust/uuid/src/v4.rs => third_party/rust/uuid-0.7.4/src/v4.rs rename : third_party/rust/uuid/src/v5.rs => third_party/rust/uuid-0.7.4/src/v5.rs rename : third_party/rust/uuid/src/winapi_support.rs => third_party/rust/uuid-0.7.4/src/winapi_support.rs extra : moz-landing-system : lando |
||
---|---|---|
.. | ||
etc | ||
examples | ||
src | ||
tests | ||
.cargo-checksum.json | ||
CHANGELOG.md | ||
Cargo.lock | ||
Cargo.toml | ||
LICENSE | ||
README.md |
README.md
libgoblin
Documentation
Usage
Goblin requires rustc
1.31.1.
Add to your Cargo.toml
[dependencies]
goblin = "0.1"
Features
- awesome crate name
- zero-copy, cross-platform, endian-aware, ELF64/32 implementation - wow!
- zero-copy, cross-platform, endian-aware, 32/64 bit Mach-o parser - zoiks!
- PE 32/64-bit parser - bing!
- a Unix and BSD style archive parser (latter courtesy of @willglynn) - huzzah!
- many cfg options - it will make your head spin, and make you angry when reading the source!
- fuzzed - "I am happy to report that goblin withstood 100 million fuzzing runs, 1 million runs each for seed 1~100." - @sanxiyn
- tests
libgoblin
aims to be your one-stop shop for binary parsing, loading, and analysis.
Use-cases
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 viaPread
andPwrite
, 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):
- Write a compiler and use it to generate binaries (all the raw C structs have
Pwrite
derived). - Write a binary analysis tool which loads, parses, and analyzes various binary formats, e.g., panopticon or falcon.
- Write a semi-functioning dynamic linker.
- Write a kernel and load binaries using
no_std
cfg. I.e., it is essentially just struct and const defs (like a C header) - no fd, no output, no std. - Write a bin2json tool, because why shouldn't binary formats be in JSON?
Cfgs
libgoblin
is designed to be massively configurable. The current flags are:
- elf64 - 64-bit elf binaries,
repr(C)
struct defs - elf32 - 32-bit elf binaries,
repr(C)
struct defs - mach64 - 64-bit mach-o
repr(C)
struct defs - mach32 - 32-bit mach-o
repr(C)
struct defs - pe32 - 32-bit PE
repr(C)
struct defs - pe64 - 64-bit PE
repr(C)
struct defs - archive - a Unix Archive parser
- endian_fd - parses according to the endianness in the binary
- std - to allow
no_std
environments
Contributors
Thank you all ❤️ !
In lexicographic order:
- @amanieu
- @burjui
- @flanfly
- @ibabushkin
- @jan-auer
- @jdub
- @jrmuizel
- @jsgf
- @kjempelodott
- @le-jzr
- @lion128
- @llogiq
- @lzutao
- @lzybkr
- @m4b
- @mitsuhiko
- @mre
- @pchickey
- @philipc
- @Pzixel
- @raindev
- @rocallahan
- @sanxiyn
- @tathanhdinh
- @Techno-coder
- @ticki
- @wickerwacka
- @willglynn
- @wyxloading
- @xcoldhandsx
Contributing
- Please prefix commits with the affected binary component; the more specific the better, e.g., if you only modify relocations in the elf module, then do "elf.reloc: added new constants for Z80"
- Commit messages must explain their change, no generic "changed", or "fix"; if you push commits like this on a PR, be aware @m4b or someone will most likely squash them.
- If you are making a large change to a module, please raise an issue first and lets discuss; I don't want to waste your time if its not a good technical direction, or etc.
- If your PR is not getting attention, please respond to all relevant comments raised on the PR, and if still no response, ping @m4b, @philipc, or @willglynn in github and also feel free to email @m4b.
- Please add tests if you are adding a new feature. Feel free to add tests even if you are not, tests are awesome and easy in rust.
- Once cargo format is officially released, please format your patch using the default settings.