6 releases

0.1.5 Jan 27, 2024
0.1.4 Jan 27, 2024

#22 in #pe

26 downloads per month
Used in 2 crates (via editres)

MPL-2.0 license

10MB
79K SLoC

C++ 64K SLoC // 0.1% comments Python 10K SLoC // 0.1% comments Bitbake 3.5K SLoC // 0.0% comments Shell 1K SLoC // 0.1% comments C 620 SLoC // 0.0% comments JavaScript 444 SLoC // 0.1% comments Rust 220 SLoC // 0.1% comments Forge Config 42 SLoC Objective-C 35 SLoC GNU Style Assembly 18 SLoC // 0.1% comments

Contains (ELF exe/lib, 11KB) KeygenMe, (ELF exe/lib, 6KB) hello_lief.bin, (ELF exe/lib, 7KB) hello_lief_aarch64.bin

editres

crates.io

Embed data into executables after build.

Documentation

Supported Executable Formats

  • Windows (PE)
  • Linux (ELF)
  • macOS (Mach-O)

Quick Start

1. Declare resources using editres::resource!

use editres::resource;
use std::str::from_utf8;

# fn main() {
let res = resource!("my_res"); // Option<&'static [u8]>
if let Some(res) = res {
    println!("{}", from_utf8(res).unwrap());
} else {
    println!("my_res is not injected yet");
}
# }

2. Inject data in the executable

You can inject data in executables using library editres or command line from editres_cli.

  • Library usage:
    1. Add editres as a dependency with feature injector enabled,
    2. Refer to injector::inject.
  • Command line usage:
    1. cargo install editres_cli, or download from the releases.
    2. Get command line help using editres help inject

Notes

editres is based on Node.js' single executable application implementation: postject.

Dependencies