Skip to main content
ToolPublished

Open-source research: Detecting manually mapped images in Windows processes

Source Reddit Cybersecurity

0

Discussion

MappedImagesDetector is an open-source Windows memory scanner tool designed to detect manually mapped DLLs and suspicious in-memory images that evade traditional antivirus detection. It inspects process memory directly, identifying anomalies such as erased PE headers, fake import address tables, and executable regions not registered with the Windows loader. The tool uses heuristics focusing on import thunk patterns to detect manually mapped images. It is intended for antivirus, EDR developers, blue teams, and malware researchers to improve detection of in-memory malware techniques. This project is research-focused and not an offensive tool.

r/cybersecurity (opens in a new tab)u/Last_Operation25270 points0 comments

I’ve been spending some time researching different techniques for detecting manually mapped (reflectively loaded) PE images in user mode, and I decided to open-source one of the approaches I’ve been experimenting with.

The detector avoids relying on traditional module enumeration (e.g. PEB/LDR lists or EnumProcessModules). Instead, it walks the target process’s virtual address space with NtQueryVirtualMemory, identifies executable memory regions, and reads them using NtReadVirtualMemory.

The current heuristic focuses on import thunk patterns. After scanning an executable region, it looks for contiguous sequences of x64 import stubs (FF 25), which are commonly emitted by the compiler for imported functions. A sufficiently large cluster of these thunks inside executable memory can indicate the presence of a manually mapped PE image that was never registered with the Windows loader.

The goal isn’t to claim this is a universal detection technique, it’s a research project exploring one heuristic and its effectiveness.

The repository is here:
https://github.com/adem-hosni/MappedImagesDetector

I’m hoping this can serve as a useful discussion point and maybe evolve into a more robust detection technique with community feedback.

References

Community reviews

Loading reviews…