Hello
I would greatly appreciate any help regarding this.
This code works fine but it takes about 10 minutes to search through all processes, which is too slow. It should not take more than a minute.
> It works very slow but not sure why, maybe because i call ReadProcessMemory for every block.
Yes.
If we try to read every block in the virtual address space of another process, a lot of the pages that we want would be pages that have been paged out. To satisfy the request, the kernel would have to put the thread into a wait state, read the data from the paging/mapped file into that processes address space, before it can copy those pages into our address space. To make space for these pages, other pages which are in the working set of that process may have to be paged out first (and we could be asking for those pages to be copied into our address space next).
By not looking at every block of memory? Only those blocks which may contain the information of interest.
I'm sure that a kernel mode driver which has access to MDLs could be gainfully employed. However, my knowledge about anything after NT 4.1 is very sketchy, woefully inadequate.