use windows_sys::Win32::UI::WindowsAndMessaging::MB_OK; use stealth::{ debug::{check_being_debugged, check_debug_port, check_nt_global_flag}, hash::fnv1a_ci, import::{get_function, get_module}, string::hs, }; type LoadLibraryA = unsafe extern "system" fn(windows_sys::core::PCSTR) -> windows_sys::Win32::Foundation::HMODULE; type MessageBoxA = unsafe extern "system" fn( windows_sys::Win32::Foundation::HWND, windows_sys::core::PCSTR, windows_sys::core::PCSTR, windows_sys::Win32::UI::WindowsAndMessaging::MESSAGEBOX_STYLE, ) -> windows_sys::Win32::UI::WindowsAndMessaging::MESSAGEBOX_RESULT; fn main() { #[cfg(target_os = "windows")] unsafe { if check_being_debugged() && check_nt_global_flag() && check_debug_port() { let load_library_a: LoadLibraryA = std::mem::transmute( get_function( get_module(fnv1a_ci(b"kernel32.dll")).unwrap(), fnv1a_ci(b"LoadLibraryA"), ) .unwrap(), ); load_library_a(hs!("user32.dll").as_ptr()); let message_box_a: MessageBoxA = std::mem::transmute( get_function( get_module(fnv1a_ci(b"user32.dll")).unwrap(), fnv1a_ci(b"MessageBoxA"), ) .unwrap(), ); message_box_a( 0, hs!("This is a very secret message").as_ptr(), hs!("Secret Title").as_ptr(), MB_OK, ); } } }