Respective linker flags are:
ASLR -> /DYNAMICBASE
DEP -> /NXCOMPAT
From Wikipedia: Vista, Windows Server 2008, Windows 7, and Windows Server
2008 R2 have ASLR enabled by default, although only for
those executables and dynamic link libraries specifically
linked to be ASLR-enabled.
That's by default. You can also force ASLR to be applied to any app by installing EMET and configuring it respectively - http://www.microsoft.com/en-us/download/details.aspx?id=30424
EMET also allows changing DEP protection from Opt-In to Opt-Out, which is obviously a good thing.[1] ASLR -- http://en.wikipedia.org/wiki/Address_space_layout_randomizat...
[2] DEP -- http://en.wikipedia.org/wiki/Data_Execution_Prevention