Skip to content

tatref/rust-hook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is this?

A Rust library / macro to help with the LD_PRELOAD trick

Setup

$ cargo new --lib foo/
$ cd foo/
$ git clone https://github.com/tatref/rust-hook

Add to Cargo.toml:

[dependencies]
"hook" = { path = "hook" }
libc = "*"

[lib]

Code your own lib, or copy examples

$ cp hook/examples/simple.rs src/lib.rs

Usage

$ cargo build --release
$ ls -l target/release/libfoo.so 
-rwxrwxr-x 2 yann yann 3398952 Oct  5 00:24 target/release/libfoo.so
$ LD_PRELOAD=./target/release/libfoo.so ls
[...]
We got: "Cargo.toml"
We got: "src"
We got: "target"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published