I’m currently looking into the way in which applications using memory-mapped files actually map data into memory. I’m using notepad as an example.
Here’s what I know. Normally, when a file is opened, there will be a handle within the process’s object table. However, notepad doesn’t create any handles in there for the file that it has open. This is confirmed by both Sysinternal tools, and some stuff that I’ve written.
However, there is a _FILE_OBJECT structure created for the file, which I’ve found by using the memory analysis software Volatility. In addition to the file object, there is also a _CONTROL_AREA structure for it, which I found using the WinDBG command ‘!ca 0’.
After opening the file, and examining the VAD tree for notepad, I found the file was actually mapped into what the Sysinternal tool VMMap tells me is the heap.
So my question is this; without a handle in the object table, is it possible to locate the _FILE_OBJECT or _CONTROL_AREA without simply brute force memory scanning of the pools (page/nonpaged). Is there some kind of kernel controlled linkedlist of control areas.
I did suspect that something, maybe a section object, could be found in the kernel object database, however I didn’t see anything in there that seemed helpful.
If anyone could offer any advice or insight into a possible solution, I’d appreciate it.
Thanks