mirror of
https://codeberg.org/smukx/Rust-for-Malware-Development
synced 2026-06-06 20:22:59 +00:00
28e7fac1d3
Rust-for-Malware-Development is an collection of proof of concepts with techniques and advanced evasion methods
46 lines
1.3 KiB
Rust
46 lines
1.3 KiB
Rust
/*
|
|
This Program is to make familiar with DLL...
|
|
@5mukx
|
|
*/
|
|
|
|
use std::{ffi::CString, ptr::null_mut};
|
|
use winapi::um::winuser::{MessageBoxA, MB_OK};
|
|
|
|
/*
|
|
#[no_mangle] Short Explain
|
|
- no_mangle is used to interoperate with C code meaning we can call
|
|
these functions directly from C without any naming conflicts.
|
|
- It can also used to keep its original name during the compile time.
|
|
*/
|
|
|
|
use std::{ffi::CString, ptr::null_mut};
|
|
use winapi::um::winuser::{MessageBoxA, MB_ICONEXCLAMATION, MB_OK};
|
|
|
|
#[unsafe(no_mangle)]
|
|
pub extern "stdcall" fn msg_frm_vx() {
|
|
let msg = CString::new("Malware resources needs to be free and wide").expect("Failed");
|
|
let cap = CString::new("Message From Vx-Underground").expect("Error cap");
|
|
unsafe {
|
|
MessageBoxA(
|
|
null_mut(),
|
|
msg.as_ptr(),
|
|
cap.as_ptr(),
|
|
MB_OK | MB_ICONEXCLAMATION,
|
|
);
|
|
}
|
|
}
|
|
|
|
#[unsafe(no_mangle)]
|
|
pub extern "system" fn msg_frm_smukx() {
|
|
let msg = CString::new("Custom DLL's are always Cool. Bye").expect("Failed");
|
|
let cap = CString::new("Message From SMukx").expect("Error cap");
|
|
unsafe {
|
|
MessageBoxA(
|
|
null_mut(),
|
|
msg.as_ptr(),
|
|
cap.as_ptr(),
|
|
MB_OK | MB_ICONEXCLAMATION,
|
|
);
|
|
}
|
|
}
|