Skip to content

VHSgunzo/sharun

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sharun

Run dynamically linked ELF binaries everywhere (musl and glibc are supported).

sharun

  • Its works with userland-execve by mapping the interpreter (such as ld-linux-x86-64.so.2) into memory, creating a stack for it (containing the auxiliary vector, arguments, and environment variables), and then jumping to the entry point with the new stack.
  • lib4bin pulls out the binary file and all the libraries on which it depends, strip it and forms the bin, shared/{bin,lib,lib32} directories (see screenshots) and generate a file shared/{lib,lib32}/lib.path with a list of all directories that contain libraries for pass it to interpreter --library-path. The paths in this file are specified on a new line with a + at the beginning and relative to the directory in which it is located.

Supported architectures:

  • aarch64
  • x86_64

To get started:

  • Download the latest revision
git clone https://github.com/VHSgunzo/sharun.git && cd sharun
  • Compile a binary
rustup default nightly
rustup target add $(uname -m)-unknown-linux-musl
rustup component add rust-src --toolchain nightly
cargo build --release
cp ./target/$(uname -m)-unknown-linux-musl/release/sharun .
./sharun --help
./sharun lib4bin --help
  • Or take an already precompiled binary file from the releases

Usage sharun: