mirror of
https://github.com/0xROOTPLS/PEBwalker
synced 2026-06-06 15:04:30 +00:00
833 B
833 B
PEBwalker
A PEB walker that resolves function addresses via runtime hash comparison, avoiding static imports.
Flow
- Calculates hash for target module & function
- Access process environment block (PEB)
- Walk loaded module list
- Match module via hash
- Parses module exports
- Resolves functions via hash
- Returns function pointer of target
- Profit
Detections
At the time of writing, no engines detect this code snippet as malicious, as it is really not by itself.
Example Usage
//Create UTF-16 hash for module
let target_lib: Vec<u16> = "ntdll.dll".encode_utf16().collect();
let lib_sum = calc_wide_checksum(&target_lib);
//Create hash for target function
let target_func = calc_checksum(b"NtAllocateVirtualMemory");
//Resolve func pointer
let routine_ptr = find_routine(lib_sum, target_func);