elfkit 0.0.1

an elf parser and manipulation library in pure rust
Documentation

Build Status codecov crates.io MIT licensed docs

Elfkit

an elf read and manipulation library in pure rust (no bfd, no gnu code), intended to be used in binary manipulation utils such as strip, objcopy, link editors, etc.

Some binutils replacements are included as example code.

cargo run --example readelf ./tests/samples/amd64_exe

screenshot

api design

low level

Every type implements from_reader and to_writer. You can use them invdividually, but you'll always need a Header to tell the de/serializers about things like endianness, bitwidth,..

structured elf

the most versatile api is propably Elf::from_reader/to_writer. You can use it as is, which will hold all sectionc content in Vec or call Elf::load_all() which will parse the sections into their detailed specific structures, such as symbols, relocations, dynamic linker instructions, etc..

implementation status

section specific parsers

type read write
symtab ok ok
rela ok ok
dynamic ok ok
rel - -
note - -
gnu_hash - -
versym - -
verneed - -

architectures

abi headers relocations
x86_64 ok wip
mips32r2 o32 ok
arm eabi ok

references