3

In today x86-64 processors, the usable address space is 48 bits long and is separated into two halves. One is from 00000000`00000000 to 00007fff`ffffffff, another one is from ffff8000`00000000 to ffffffff`ffffffff.

Now I'm writing a program to catch memory access violation. Here is my code.

UINT64 *Test1 = (UINT64 *) 0x0000000000000000;
UINT64 Test2;
AddVectoredExceptionHandler(TRUE,(PVECTORED_EXCEPTION_HANDLER)ExceptionHandler);
Test2 = *Test1;

ExceptionHandler is a VEH exception handler. I can get the address that cannot access in the ExceptionInfo->ExceptionRecord->ExceptionInformation[1] (The second array element specifies the virtual address of the inaccessible data.(Here)). At this case, it is 0, same as Test1.

If you are trying to access any address between 00007fff`ffffffff and ffff8000`00000000, ExceptionInfo->ExceptionRecord->ExceptionInformation[1] will be -1. This isn't out of my expectation. But the interesting part is, when I putted 0x00007fffffffffff in the Test1, I also got -1. It didn't take my very long to find that from 00007fff`fffffff8 to 00007fff`ffffffff also return -1, which should be legal address in the system.

Can somebody explain this to me please?

Excalibur
  • 61
  • 4
  • http://www.alex-ionescu.com/?p=50, found in http://stackoverflow.com/questions/4563297/behind-windows-x64s-44-bit-virtual-memory-address-limit?rq=1 – Ken White Apr 06 '13 at 00:16

0 Answers0