All Projects → aep → Elfkit

aep / Elfkit

Licence: mit
rust elf parsing, manipulation and (re)linking toolkit

Programming Languages

rust
11053 projects

Labels

Projects that are alternatives of or similar to Elfkit

Dithumb
Minimal ARM/Thumb linear sweep disassembler similar to objdump
Stars: ✭ 5 (-97.22%)
Mutual labels:  elf
Fbhookfork
从 fb 的 profilo 项目里提取出来的hook 库,自己用
Stars: ✭ 98 (-45.56%)
Mutual labels:  elf
Exodus
Painless relocation of Linux binaries–and all of their dependencies–without containers.
Stars: ✭ 2,560 (+1322.22%)
Mutual labels:  elf
Pivirus
sample linux x86_64 ELF virus
Stars: ✭ 45 (-75%)
Mutual labels:  elf
Elf Parser
Identifying/Extracting various sections of an ELF file
Stars: ✭ 88 (-51.11%)
Mutual labels:  elf
Filebytes
Library to read and edit files in the following formats: Executable and Linking Format (ELF), Portable Executable (PE), MachO and OAT (Android Runtime)
Stars: ✭ 105 (-41.67%)
Mutual labels:  elf
Die Engine
DIE engine
Stars: ✭ 648 (+260%)
Mutual labels:  elf
Mandibule
linux elf injector for x86 x86_64 arm arm64
Stars: ✭ 171 (-5%)
Mutual labels:  elf
Memrun
Small tool to run ELF binaries from memory with a given process name
Stars: ✭ 90 (-50%)
Mutual labels:  elf
Elfhooker
兼容Android 32位和64位。基于EFL文件格式Hook的demo,hook了SurfaceFlinger进程的eglSwapBuffers函数,替换为new_eglSwapBuffers
Stars: ✭ 138 (-23.33%)
Mutual labels:  elf
Hooking Template With Mod Menu
A small template for Android Hooking with Substrate. (Includes a mod menu written in Java)
Stars: ✭ 59 (-67.22%)
Mutual labels:  elf
Gloryhook
The first Linux hooking framework to allow merging two binary files into one!
Stars: ✭ 83 (-53.89%)
Mutual labels:  elf
Libebc
C++ Library and Tool for Extracting Embedded Bitcode
Stars: ✭ 122 (-32.22%)
Mutual labels:  elf
Userlandexec
userland exec for Linux x86_64
Stars: ✭ 23 (-87.22%)
Mutual labels:  elf
Rustig
A tool to detect code paths leading to Rust's panic handler
Stars: ✭ 145 (-19.44%)
Mutual labels:  elf
Open C Book
开源书籍:《C语言编程透视》,配套视频课程《360° 剖析 Linux ELF》已上线,视频讲解更为系统和深入,欢迎订阅:https://www.cctalk.com/m/group/88089283
Stars: ✭ 715 (+297.22%)
Mutual labels:  elf
Bingrep
like ~~grep~~ UBER, but for binaries
Stars: ✭ 1,395 (+675%)
Mutual labels:  elf
Elf Parser
Lightweight elf binary parser with no external dependencies - Sections, Symbols, Relocations, Segments
Stars: ✭ 172 (-4.44%)
Mutual labels:  elf
Elf Dump Fix
Utils use to dump android ELF from memory and do some fix including the ELF section header rebuilding
Stars: ✭ 166 (-7.78%)
Mutual labels:  elf
Pwninit
pwninit - automate starting binary exploit challenges
Stars: ✭ 127 (-29.44%)
Mutual labels:  elf

Build Status crates.io MIT licensed docs

DED

please note that i no longer work with rust and this is not maintained. If anyone has interest in maintaining this crate, feel free to open a github issue.

Elfkit

An elf read and manipulation library in pure Rust (written from scratch, no bfd, no gnu code, no license infections), intended to be used in binary manipulation utils such as strip, chrpath, objcopy and ld. The end goal is to build a well designed library that facilitates all sorts of binary manipulation magic.

elfkit can now link elfkit, so it's reasonably complete for x86_64. But it's definitely not stable yet and might produce incorrect code.

Using the linker

The quickest way to use elfkit with Rust is with korhal/stasis.

You can also either build from source or download binaries. GCC does not have an option to use a foreign linker, so we need to pretend we're ld.gold, like so:

curl -L https://github.com/aep/elfkit/releases/download/0.0.4/elfkit-0.0.4.tar.xz | tar xvjf -
export PATH="$PWD/elfkit-0.0.4/:$PATH"
musl-gcc -fuse-ld=gold main.c

For using elfkit for compiling Rust code, add the following to ~/.cargo/config:

[target.x86_64-unknown-linux-musl]
rustflags = [
    "-C", "link-arg=-fuse-ld=gold",
    "-C", "link-arg=-Wl,-dynamic-linker,/usr/local/musl/lib/libc.so",
]

When compiling from source, create the ld.gold symlink manually:

cargo build --release --bin ld
ln -s "$PWD/target/release/ld" /usr/local/bin/ld.gold

Other binutils

readelf: screenshot

implementation status

binutils

type status gnu compatible
ldd done no
readelf done no
ld wip wip
objdump - -
ar - -
as - -
nm - -
strip - -

section parsers

type read write
symbols done done
strtab done done
relocations done done
dynamic done done
note - -
gnu_hash - -
hash - mvp
versym - -
verneed - -

architectures

abi parser linker
x86_64 done wip
mips32r2 o32 done
arm eabi done

modular linker toolkit

  • Loader: loads elf objects from disk
  • Linker: produces a link graph of sections from a loader
  • Collector: bakes multiple sections into a single object
  • Relocator: applies relocations to a combined object

alternatives

  • goblin mach-o and archive support, no-std support, very low level
  • elf most popular, most generic use case, no writing, no section parsing
  • xmas-elf zero alloc (good for writing an OS), read only

references

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].