virtualquery

Is there a better way than parsing /proc/self/maps to figure out memory protection?

On Linux (or Solaris) is there a better way than hand parsing /proc/self/maps repeatedly to figure out whether or not you can read, write or execute whatever is stored at one or more addresses in memory? For instance, in Windows you have VirtualQuery. In Linux, I can mprotect to change those values, but I can't read them back. Furthe...

VirtualQuery gives illegal result. Is it a bug?

My code: MEMORY_BASIC_INFORMATION meminf; ::VirtualQuery(box.pBits, &meminf, sizeof(meminf)); The results: meminf: BaseAddress 0x40001000 void * AllocationBase 0x00000000 void * AllocationProtect 0x00000000 unsigned long RegionSize 0x0de0f000 unsigned long State ...

Win API VirtualQueryEx Function,ERROR_BAD_LENGTH

Hi I try to call the VirtualQueryEx function to get some Information about Memory Protection, however my code gives me error 0x18 (ERROR_BAD_LENGTH) and i dont know whats wrong with my code; code snippet: PMEMORY_BASIC_INFORMATION alte; VirtualQueryEx(processhandle,(LPVOID) (address),alte,sizeof(PMEMORY_BASIC_INFORMATION)); thanks fo...