0

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 where 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?
- or a minidump made somewhere can be loaded by me.)

MSalters
  • 173,980
  • 10
  • 155
  • 350
kfn
  • 620
  • 1
  • 7
  • 26
  • The introduction of ASLR invalidates older arguments about base addresses, because (1) ASLR changes your base address randomly; you are rarely loaded at your nominal base address any more, and (2) along with ASLR came a more efficient relocation algorithm, so the cost of relocating a DLL is very low, TL;DR: That guidance is no longer applicable once you have ASLR. – Raymond Chen Nov 14 '16 at 05:46

1 Answers1

2

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.

Thomas Weller
  • 55,411
  • 20
  • 125
  • 222