7eRoM
7eRoM

Reputation: 453

C++ - VirtualQueryEx for x64 processes

Here is my code I use for memory scanning of x86 processes:

    unsigned char *p = NULL;
    MEMORY_BASIC_INFORMATION info;

    for (p = NULL;
        VirtualQueryEx(process, p, &info, sizeof(info)) == sizeof(info);
        p += info.RegionSize)
    {

... 

     }

The code works correctly. But when I use this code for memory scanning of x64 processes, the result is not correct!

I tried to change MEMORY_BASIC_INFORMATION to MEMORY_BASIC_INFORMATION64but:

'SIZE_T VirtualQueryEx(HANDLE,LPCVOID,PMEMORY_BASIC_INFORMATION,SIZE_T)': cannot convert argument 3 from 'MEMORY_BASIC_INFORMATION64 *' to 'PMEMORY_BASIC_INFORMATION'

I`ve searched a lot but could not understand how to resolve it.

Upvotes: 0

Views: 1046

Answers (0)

Related Questions