The title really says it all, I want to have all the readable memory of another process in a buffer. I understand that I will have to use ReadProcessMemory()
, but If I'm correct I can't just use one call to ReadProcessMemory()
starting from address 0 for example, because there would be addresses that are non readable in the range.
I have one idea, which I believe should work, I would like to know if this is an actual solution and if there are any better solutions.
My idea would be to start from address 0 and use VirtualQueryEx
to check if the current range is readable, if yes I read it, and in both cases I jump forward the size of the range, and repeat until VirtualQueryEx
returns that my address is too high.
Would this actually get all the memory? Is there a better/different method?