Skip to content

Instantly share code, notes, and snippets.

@ConnorBP
Created September 18, 2024 13:17
Show Gist options
  • Save ConnorBP/9831b68b9c63e37fcd0377063f22747e to your computer and use it in GitHub Desktop.
Save ConnorBP/9831b68b9c63e37fcd0377063f22747e to your computer and use it in GitHub Desktop.
fastfail.rs
// 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