Is it possible to change the address of a function in a DLL if it is loaded into the application?

I parsed the DLL and see some functions there. I found the function and address I need 0x10001340.

Will this address remain unchanged if I load this DLL into my application? So can I call this function at this address from my application?

I ask because I'm not sure: what if, when loading this DLL, some function in the main application already has the same address? Thus, it is possible that functions inside the dll can change addresses at boot, etc.

+5
source share
3 answers

Windows dll , , , . "rebasing".

" " (/BASE Microsoft), , , dll ; , DLL . (IIRC , dll )

, Windows Vista dll, , , - .

+8

, . default/BASE DLL - 0x10000000, . DLL, , . , , .

/BASE, , , .

+3

, DLL ( ImageBase IMAGE_OPTIONAL_HEADER). DLL, , ( ), "". , DLL , - DLL , .

So, to answer your question: There is no guarantee that the DLL will be loaded at its preferred address. After loading subsequent downloads, no more copies of the DLL are loaded, so the addresses will not change. However, as soon as the unloaded (DLL links are counted), there is no guarantee that it will be downloaded to the same address next time.

+2
source

All Articles