#windows #executable #delete #unix #running #systems #released

houdini

A library that allows you to delete your executable while it's running

4 stable releases

2.0.0 Mar 24, 2023
1.0.2 Nov 14, 2021
1.0.1 Aug 31, 2021

#473 in Unix APIs

Download history 16/week @ 2024-07-28 1/week @ 2024-08-11 21/week @ 2024-08-18 20/week @ 2024-08-25 8/week @ 2024-09-01 25/week @ 2024-09-08 5/week @ 2024-09-15 14/week @ 2024-09-22 10/week @ 2024-09-29 34/week @ 2024-10-06 71/week @ 2024-10-13 57/week @ 2024-10-20 50/week @ 2024-10-27 76/week @ 2024-11-03

259 downloads per month

MIT license

16KB
285 lines

Houdini

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.

Usage

// 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),
    };
}

Dependencies

~0–38MB
~525K SLoC