Available on Windows only.
Expand description
Manual PE mapping: relocations, IAT rewrite, section permissions, TLS.
read_and_map_module loads a file, maps it, and returns
(PeMetadata, base). manually_map_module does the same from a
buffer. Set clean_dos_header to wipe MZ / DOS stub IOCs.
ⓘ
let (_pe, base) = manualmap::read_and_map_module(
r"C:\Windows\System32\ntdll.dll",
true,
false,
).unwrap();Functions§
- add_
runtime_ table - get_
pe_ metadata - Retrieves PE headers information from the module base address.
- get_
runtime_ table - Returns a pair containing a pointer to the Exception data of an arbitrary module and the size of the
corresponding PE section (.pdata). In case that it fails to retrieve this information, it returns null values. - manually_
map_ module - Manually maps a PE into the current process.
- map_
module_ to_ memory - Maps a module to a valid memory space in the current process.
- map_
to_ allocated_ memory - map_
to_ section - Map a module to a memory section.
- read_
and_ map_ module - Manually maps a PE from disk to the memory of the current process.
- relocate_
module - Relocates a module in memory.
- rewrite_
module_ iat - Rewrites the IAT of a manually mapped module.
- run_
tls_ callbacks - Executes any registered TLS Callback function.
- set_
module_ section_ permissions - Sets correct module section permissions for a manually mapped module.