Delphi 2007 supports ASLR and NX

Posted by on in Blogs

Delphi 2007, available now, supports ASLR and NX.

The CodeGear Delphi 2007 compiler supports ASLR via any of these three techniques:

  • add the command-line switch --dynamicbase when compiling with dcc32
  • add the preprocessor command '{$DYNAMICBASE ON}' to the source code
  • manually OR in the bit in the header, with '{$SETPEOPTFLAGS $40}' in the source code

The CodeGear Delphi 2007 compiler supports NX via this technique:

  • manually OR in the bit in the header, with '{$SETPEOPTFLAGS $100}' in the source code

The easiest way to enable both ASLR and NX is to do this:

  • add '{$SETPEOPTFLAGS $140}' to the project source file (.dpr or .dpk)

Thanks to Barry Kelly for prodviding this information!

Comments are not available for public users. Please login first to view / add comments.