How do you disable ASLR (address space layout randomization) on Windows 7 x64?

user541686 picture user541686 · Mar 5, 2012 · Viewed 61.7k times · Source

How do you disable ASLR on Windows 7 x64 so that my program will always load the shared CRT at the same address?

Answer

Mr. S picture Mr. S · Mar 5, 2012

Previously you had to opt in to allowing the linker to use ASLR. Now, you have to opt out:

/DYNAMICBASE[:NO]

(Visual Studio 2012: Configuration Properties -> Linker -> Advanced -> "Randomized Base Address")

You can also do it programmatically.