feat: got PE injection working

This commit is contained in:
Andrew Rioux
2025-02-08 20:51:03 -05:00
parent cd2890ee36
commit 8d47ac128d
12 changed files with 784 additions and 18 deletions

View File

@@ -3,6 +3,8 @@ name = "sparse-windows-beacon"
edition = "2024"
version.workspace = true
[lib]
crate-type = ["cdylib"]
[dependencies]
windows = { version = "0.59.0", features = ["Win32_System_SystemServices", "Win32_UI_WindowsAndMessaging"] }

View File

@@ -0,0 +1,32 @@
#[unsafe(no_mangle)]
pub extern "C" fn compute_hash() {}
use windows::{
core::*,
Win32::{System::SystemServices::DLL_PROCESS_ATTACH, UI::WindowsAndMessaging::*},
};
#[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);
});
}
1
}
#[unsafe(no_mangle)]
pub extern "C" fn md4sum() {}
#[unsafe(no_mangle)]
pub extern "C" fn md5sum() {}
#[unsafe(no_mangle)]
pub extern "C" fn sha256sum() {}
#[unsafe(no_mangle)]
pub extern "C" fn sha384sum() {}
#[unsafe(no_mangle)]
pub extern "C" fn sha512sum() {}
#[unsafe(no_mangle)]
pub extern "C" fn sha1sum() {}
#[unsafe(no_mangle)]
pub extern "C" fn sha2sum() {}

View File

@@ -1 +0,0 @@
fn main() {}