Crates.io | houdini |
lib.rs | houdini |
version | 2.0.0 |
source | src |
created_at | 2021-08-31 10:59:16.15353 |
updated_at | 2023-03-24 08:18:29.126479 |
description | A library that allows you to delete your executable while it's running. |
homepage | https://github.com/yamakadi/houdini |
repository | https://github.com/yamakadi/houdini |
max_upload_size | |
id | 445052 |
size | 19,563 |
Houdini
is a rust library that allows you to delete your executable while it's running.
This is fairly straightforward for unix systems, since the executable is released after getting mapped to the memory. We just need to find where it is and unlink it.
On Windows, we use a method discovered by @jonasLyk.
My implementation heavily references @byt3bl33d3r's Nim implementation in OffensiveNim
and in turn LloydLabs' initial C
PoC.
// With a default placeholder value on windows (`svcmsrpc`)
use houdini;
fn main() {
match houdini::disappear() {
Ok(_) => println!("Pulled a Houdini!!"),
Err(e) => println!("Nope! => {}", e),
};
}
// With a placeholder you provide
use houdini::disappear;
fn main() {
#[cfg(target_os = "windows")]
match houdini::disappear_with_placeholder("temporary") {
Ok(_) => println!("Pulled a Houdini!!"),
Err(e) => println!("Nope! => {}", e),
};
}