/dllmain-rs

A proc macro attribute to generate dllmain

Primary LanguageRust

dllmain-rs

A proc macro to generate dllmain

Cargo.toml

dllmain-rs = { git = "https://github.com/zeon256/dllmain-rs" }
winapi = { version = "0.3.9", features = ["minwindef"]}

Example usage

use std::thread;
use winapi::shared::minwindef::{self, HINSTANCE, DWORD, LPVOID, BOOL};

#[dllmain_rs::entry]
fn real_entry() {
    // unsafe { consoleapi::AllocConsole(); }
    let base_addr = get_base_addr();
    println!("Found base address: {:#X?}", base_addr);
    thread::spawn(move || {
        // hack thread
    });
}