Since I was not clear before I will rewrite my question.
I need to get the absolute base address of a section of memory that was allocated with VirtualAllocEx()
.
For example, if I allocate 0x20000 bytes and get the address 0x5000000.
I need a method of getting the address 0x5000000 using the value 0x5015000.
VirtualQuery() returns the page address that the value 0x5015000 resides in and not the base address of the allocated section of memory.
So I need a different method to find the base address of any allocated section of memory.