windowsdll64-bitrelocationvirtual-address-space

Windows 64-bit address space


I am developing a 64-bit application with a couple of dll's.

Coming from win 32, where the default base address of the loaded dll's was 0x10.000.000 and then they were moved, when conflicts arose.

John Robbins from Wintellect recommended to set the dll's with unique addresses, so the memory space use was the same on different runs.

He suggested in the book on debugging .NET 2.0 applications that the base addresses should be guided by the first letter of the dll's name.

a-c 0x60.000.000
d-f 0x61.000.000
g-i 0x62.000.000
j-l 0x63.000.000
m-o 0x64.000.000
p-r 0x65.000.000
s-u 0x66.000.000
v-x 0x67.000.000
y-z 0x68.000.000

I am thinking that has changed with 64-bit (at least the addresses). Has anyone found a better solution?

(so the address from one run on another PC, can be mapped to mine?


Solution

  • Since you move to 64 bit, my guess is that you're targeting Windows Vista or higher, since XP 64 bit was never that popular (and extended support ended).

    With Windows Vista, address space randomization (ASLR) was introduced, which increases security, because guessing memory locations became harder.

    ASLR will randomize the base address and is enabled with /DYNAMICBASE (MSDN). Thus, there is no need to generate or calculate a base address yourself anymore.

    As you said, rebasing could happen in 32 bit applications already. This and ASLR will not have an impact on debugging crash dumps. The debugger will be able to resolve the symbols.