I am trying to scan memory of a 3rd party application. I have already found out the address; right now is at 0x0643FB78. The thing is, I can never get up there since LPMODULEENTRY32->modBaseAddr is 0x00400000 and LPMODULEENTRY32->modBaseSize is merely 0x006FF000, thus the max address I can scan for this module is 0x00AFF000.
Does that mean the address I seek does live inside another process/module/thread/something? I am quite confident the process I have does contain the address though. How should I access the memory then? Thank you.
At least in my opinion, if you have an
LPMODULEENTRYinvolved, you’re probably starting in the wrong direction. I’d walk through the blocks of memory in the target process withVirtualQueryExinstead. This will give you aMEMORY_BASIC_INFORMATIONabout each block in that process. You can then useReadProcessMemoryand scan through the blocks to find what you’re looking for.Here’s some old code I wrote to do roughly the same thing, but looking for a string rather than a pointer: