forked from trickster0/OffensiveRust
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlib.rs
30 lines (25 loc) · 715 Bytes
/
lib.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#![cfg(windows)]
use std::ptr::null_mut;
use winapi::um::winuser::MessageBoxA;
#[no_mangle]
#[allow(non_snake_case, unused_variables)]
pub extern "C" fn popit() {
unsafe {MessageBoxA(null_mut(),"Rust DLL Test\0".as_ptr() as *const i8,"Rust DLL Test\0".as_ptr() as *const i8,0x00004000);}
}
//#[no_mangle]
//#[allow(non_snake_case, unused_variables)]
// fn DllMain(
// dll_module: HINSTANCE,
// call_reason: DWORD,
// reserved: LPVOID)
// -> BOOL
// {
// const DLL_PROCESS_ATTACH: DWORD = 1;
// const DLL_PROCESS_DETACH: DWORD = 0;
// match call_reason {
// DLL_PROCESS_ATTACH => popit(),
// DLL_PROCESS_DETACH => (),
// _ => ()
// }
// TRUE
// }