Created
September 18, 2024 13:17
-
-
Save ConnorBP/9831b68b9c63e37fcd0377063f22747e to your computer and use it in GitHub Desktop.
fastfail.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// fast fail helper function | |
// kills the process fast (useful for anti-debug) | |
pub fn fastfail() { | |
#[cfg(target_os="windows")] | |
{ | |
unsafe{asm!("int 29h");} | |
} | |
#[cfg(not(target_os="windows"))] | |
{ | |
// exits "immediately" on linux | |
std::process::exit(2) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment