• Welcome to Valhalla Legends Archive.
 

Loading a library at desired base address

Started by warz, November 13, 2006, 04:31 AM

Previous topic - Next topic

warz

Is it possible to specify the base address of a library that you're about to load with LoadLibrary? I have been looking at ReBaseImage64, but am not sure if this is the best way to go about doing so.

My call to ReBaseImage64 returns success, and the returned NewImageBase says it's what I told it to be, but my debugger says it's not loaded at that base address.

Skywing

Not with LoadLibrary.  LoadLibrary will try the preferred address burned into the image header first, and then the first available slot large enough for the image given alignment and allocation granularity constraints.

On Windows Vista or downlevel systems with a third-party ASLR implementation, this behavior may be different.

MyndFyre

Quote from: Skywing on November 14, 2006, 12:03 PM
On Windows Vista or downlevel systems with a third-party ASLR implementation, this behavior may be different.
Specifically, in executables with relocation information, Windows Vista will load libraries into randomized addresses.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.