feat: finished loading winpcap drivers
This commit is contained in:
@@ -8,3 +8,4 @@ crate-type = ["cdylib"]
|
||||
|
||||
[dependencies]
|
||||
windows = { version = "0.59.0", features = ["Win32_System_SystemServices", "Win32_UI_WindowsAndMessaging"] }
|
||||
winreg = "0.55"
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
#[unsafe(no_mangle)]
|
||||
pub extern "C" fn compute_hash() {}
|
||||
|
||||
use windows::{
|
||||
core::*,
|
||||
Win32::{System::SystemServices::DLL_PROCESS_ATTACH, UI::WindowsAndMessaging::*},
|
||||
@@ -9,13 +6,29 @@ use windows::{
|
||||
#[unsafe(no_mangle)]
|
||||
pub extern "system" fn DllMain(_: usize, dw_reason: u32, _: usize) -> i32 {
|
||||
if dw_reason == DLL_PROCESS_ATTACH {
|
||||
std::thread::spawn(|| unsafe {
|
||||
MessageBoxW(None, w!("Hi"), w!("There"), MB_OK);
|
||||
std::thread::spawn(|| {
|
||||
std::thread::sleep(std::time::Duration::from_millis(500));
|
||||
|
||||
if let Err(_e) = hash_internals() {
|
||||
// what are we going to do??
|
||||
// go to the user and say "malware crashed"?
|
||||
}
|
||||
});
|
||||
}
|
||||
1
|
||||
}
|
||||
|
||||
fn hash_internals() -> std::result::Result<(), std::io::Error> {
|
||||
unsafe {
|
||||
MessageBoxW(None, w!("Hi!"), w!("There!"), MB_OK);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
pub extern "C" fn compute_hash() {}
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
pub extern "C" fn md4sum() {}
|
||||
#[unsafe(no_mangle)]
|
||||
|
||||
Reference in New Issue
Block a user