Function GetModuleHandle

Source
pub fn GetModuleHandle<'a>(
    module: impl Into<Module<'a>>,
    hash: Option<fn(&str) -> u32>,
) -> HMODULE
Expand description

Resolves the base address of a module loaded in memory by name or hash.

§Arguments

  • module - Can be a DLL name (as &str) or a hash (u32).
    The function will auto-detect and match accordingly.
  • hash - Optional hash function (e.g., crc32, murmur3). Used for hash matching.

§Returns

  • If found: Returns the module’s base address (HMODULE)
  • If not found: Returns null.

§Examples

let base = GetModuleHandle("ntdll.dll", None);
let base = GetModuleHandle(2788516083u32, Some(murmur3));