Skip to main content

managed_overload_module

Function managed_overload_module 

Source
pub fn managed_overload_module(
    file_content: Vec<u8>,
    decoy_module_path: &str,
) -> Result<(Vec<u8>, usize), String>
Available on Windows only.
Expand description

Locate and load a decoy module into memory creating a legitimate file-backed memory section within the process. Afterwards overload that module by manually mapping a payload (from memory) that will appear to be file-backed by the legitimate decoy module.

It will return either a pair (Vec<u8>,i64) containing the decoy content and the payload base address or a string with a descriptive error message.

§Examples

ⓘ
use std::fs;

let payload_content = fs::read("c:\\temp\\payload.dll").expect("[x] Error opening the specified file.");
let module = overload::managed_overload_module(payload_content,"");

match module {
    Ok(x) => println!("File-backed payload is located at 0x{:X}.", x.1),
    Err(e) => println!("An error has occurred: {}", e),
}