Prev Previous Post   Next Post Next

Any way to disable Heap placement randomization (ASLR) for a singleexecutable?

Posted: 05-11-2007, 07:45 PM
Greetings,

This is more of a programming question, and doesn't appear to quite
fit into this newsgroup. Please feel free to direct me to a more
appropriate forum (if one exists).

I have an application (compiler) which dumps its whole parse
tree into a file, and then re-loads it later (for precompiled
header processing), via MapViewOfFileEx().

Because the parse tree contains pointers, it must be re-loaded at
the same address it was when it was saved [1].

This works fine everywhere, but breaks on Vista(R) due to address
space layout randomization (ASLR).

I can try to map the file at the same address it was when it was
saved, but there is a chance that some DLL has already created a
Heap in that space, and then the mapping will fail.

Questions:
1. Is there any address range that is "safe" from ASLR placing a
Heap there? (I could then hard-code that address).
2. Is there any way to tell Vista that "this executable's address
space should not be randomized" ?
3. Any other way for an executable to "reserve" certain fixed
address region?

Thanks,


[1]. Yes, I know I can save the parse tree in an alternative format
(using offsets instead of pointers), and then I would not care what
the mapping address is. But this is significantly slower.

--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
Reply With Quote

Responses to "Any way to disable Heap placement randomization (ASLR) for a singleexecutable?"

 
LinkBack Thread Tools Display Modes
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


Similar Threads
Thread Thread Starter Forum Replies Last Post
Swap-file placement? Ola A Johansson Windows XP Configuration & Management 3 03-09-2005 05:34 PM
Debugger: !heap command does not work on a checked xp system marcsnews Windows XP Device Drivers 0 04-16-2004 11:03 AM
Open icon placement David Candy Customize Windows XP 1 11-24-2003 03:25 PM
Title Animation Placement PapaJohn Windows XP Movie Maker 3 09-10-2003 11:36 PM
Battery Randomization debbie Windows XP Music 1 07-10-2003 07:49 PM