Changing the dll's load address

Hi All,

As you know that visual studio linker builds a program to load the .exe files at the virtual address of 0x00400000 and the dlls at 0x10000000. These are default settings. The loading addresses can be changed by using "/BASE" linker option while linking the program, i.e. building .exe or dlls. Is there a way that I could change the loading address of already built dlls . As an example, can I change the loading address of kernel32.dll

Thank you.



Answer this question

Changing the dll's load address

  • aoky

    Thank you Martin,

    However, it did not help me. I am still not able to reserve the virtual memory at 0x1000,0000 using "VirtualAlloc" which shows this address is already being used.

    Is there a way to locate a particular section of your code to a particular address


  • sunya2005

    There is a rebase.exe in the tools of the VS.

    I guess that rebasing the kernel32.dll is not possible because the load address hase much to do with the protected and non protected parts os the OS.



  • BOBSONATOR

    Use the debugger to see what elements are loaded at this address. The modules view should show it.

  • Changing the dll's load address