Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update README.md #19

Merged
merged 1 commit into from
Jul 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 19 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
[![Crates.io](https://img.shields.io/crates/v/libsui.svg)](https://crates.io/crates/libsui)
# `libsui`

[Documentation](https://docs.rs/libsui) | [Usage](cli.rs)
[![Crates.io](https://img.shields.io/crates/v/libsui.svg)](https://crates.io/crates/libsui)

_Sui (सुई)_ is a injection tool for executable formats (ELF, PE, Mach-O) that
allows you to embed files into existing binary and extract them at runtime.

It produces valid executables that can be code signed on macOS and Windows.

### Usage
[Documentation](https://docs.rs/libsui) | [Usage](cli.rs)

## Usage

```
cargo add libsui
Expand Down Expand Up @@ -41,9 +43,9 @@ use libsui::find_section;
let data = find_section("hello.txt")?;
```

### Design
## Design

#### Mach-O
### Mach-O

Resource is added as section in a new segment, load commands are updated and
offsets are adjusted. `__LINKEDIT` is kept at the end of the file.
Expand Down Expand Up @@ -84,19 +86,28 @@ Sealed Resources=none
Internal requirements=none
```

#### PE
### PE

Resource is added into a new PE resource directory as `RT_RCDATA` type and
extracted using `FindResource` and `LoadResource` at run-time.

#### ELF
### ELF

Data is simply appended to the end of the file and extracted from
`current_exe()` at run-time.

This is subject to change and may use ELF linker notes (`PT_NOTE`) in the
future.

### License
## Testing

This crate is fuzzed with LLVM's libFuzzer. See [fuzz/](fuzz/).

`exec_*` executables in `tests/` are compiled from `tests/exec.rs`:
```
rustc exec.rs -o exec_elf64 --target x86_64-unknown-linux-gnu
```

## License

MIT
Loading