https://github.com/branchseer/gimlet
https://github.com/branchseer/gimlet
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/branchseer/gimlet
- Owner: branchseer
- License: mpl-2.0
- Created: 2024-01-10T10:13:04.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-27T10:10:22.000Z (over 1 year ago)
- Last Synced: 2025-02-09T22:04:35.000Z (3 months ago)
- Language: Rust
- Size: 68.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# editres
[](https://crates.io/crates/editres)
Embed data into executables after build.
[Documentation](https://docs.rs/editres)
## Supported Executable Formats
- Windows (PE)
- Linux (ELF)
- macOS (Mach-O)## Quick Start
### 1. Declare resources using `editres::resource!`
```rust
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`](https://docs.rs/editres/latest/editres/injector/fn.inject.html).
- 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](https://github.com/nodejs/postject/).