Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3809898
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T15:22:36+00:00 2026-05-19T15:22:36+00:00

Rebasing a DLL means to fix up the DLL such, that it’s preferred load

  • 0

Rebasing a DLL means to fix up the DLL such, that it’s preferred load adress is the load address that the Loader is actually able to load the DLL at.

This can either be achieved by a tool such as Rebase.exe or by specifying default load addresses for all your (own) dlls so that they “fit” in your executable process.

The whole point of managing the DLL base addresses this way is to speed up application loads. (Or so I understand.)

The question is now: Is it worth the trouble?

I have the book Windows via C/C++ by Richter/Nazarre and they strongly recommend[a] making sure that the load addresses all match up so that the Loader doesn’t have to rebase the loaded DLLs.

They fail to argue however, if this speeds up application load times to any significant amount.

Also, with ASLR it seems dubious that this has any value at all, since the load addresses will be randomized anyway.

Are there any hard facts on the pro/cons of this?

[a]: In my WvC++/5th ed it is in the sections titled Rebasing Modules and Binding Modules on pages 568ff. in Chapter 20, DLL Advanced Techniques.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T15:22:36+00:00Added an answer on May 19, 2026 at 3:22 pm

    I’d like to provide one answer myself, although the answers of Hans Passant and others are describing the tradeoffs already pretty well.

    After recently fiddling with DLL base addresses in our application, I will here give my conclusion:

    I think that, unless you can prove otherwise, providing DLLs with a non-default Base Address is an exercise in futility. This includes rebasing my DLLs.

    • For the DLLs I control, given the average application, each DLL will be loaded into memory only once anyway, so the load on the paging file should be minimal. (But see the comment of Michal Burr in another answer about Terminal Server environment.)

    • If DLLs are provided with a fixed base address (without rebasing) it will actually increase address space fragmentation, as sooner or later these addresses won’t match anymore. In our app we had given all DLLs a fixed base address (for other legacy reasons, and not because of address space fragmentation) without using rebase.exe and this significantly increased address space fragmentation for us because you really can’t get this right manually.

    • Rebasing (via rebase.exe) is not cheap. It is another step in the build process that has to be maintained and checked, so it has to have some benefit.

    • A large application will always have some DLLs loaded where the base address does not match, because of some hook DLLs (AV) and because you don’t rebase 3rd party DLLs (or at least I wouldn’t).

    • If you’re using a RAM disk for the paging file, you might actually be better of if loaded DLLs get paged out 🙂

    So to sum up, I think that rebasing isn’t worth the trouble except for special cases like the system DLLs.


    I’d like to add a historical piece that I found on Old New Thing: How did Windows 95 rebase DLLs? —

    When a DLL needed to be rebased, Windows 95 would merely make a note
    of the DLL’s new base address, but wouldn’t do much else. The real
    work happened when the pages of the DLL ultimately got swapped in. The
    raw page was swapped off the disk, then the fix-ups were applied on
    the fly to the raw page, thereby relocating it. The fixed-up page was
    then mapped into the process’s address space and the program was
    allowed to continue.

    Looking at how this process is done (read the whole thing), I personally suspect that part of the “rebasing is evil” stance dates back to the olden days of Win9x and low memory conditions.


    Look, now there’s a non-historical piece on Old New Thing:

    How important is it nowadays to ensure that all my DLLs have non-conflicting base addresses?

    Back in the day, one of the things you were exhorted to do was rebase
    your DLLs so that they all had nonoverlapping address ranges, thereby
    avoiding the cost of runtime relocation. Is this still important
    nowadays?

    …

    In the presence of ASLR, rebasing your DLLs has no effect because ASLR is going to ignore your base address anyway and relocate the DLL into a location of its pseudo-random choosing.

    …

    Conclusion: It doesn’t hurt to rebase, just in case, but understand
    that the payoff will be extremely rare. Build your DLL with
    /DYNAMICBASE enabled (and with /HIGHENTROPYVA for good measure)
    and let ASLR do the work of ensuring that no base address collision
    occurs. That will cover pretty much all of the real-world scenarios.
    If you happen to fall into one of the very rare cases where ASLR is
    not available, then your program will still work. It just may run a
    little slower due to the relocation penalty.

    … ASLR actually does a better job of avoiding collisions than manual
    rebasing, since ASLR can view the system as a whole, whereas manual
    rebasing requires you to know all the DLLs that are loaded into your
    process, and coordinating base addresses across multiple vendors is
    generally not possible.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

According to this article rebasing is not necessary for .NET assemblies due to JIT
In this article , the author explains rebasing with this diagram: Rebase: If you
I am rebasing in git and am encountering many conflicts. I address each one
I have two branches that are different enough that rebasing seems to not work
This gives a good explanation of squashing multiple commits: http://git-scm.com/book/en/Git-Branching-Rebasing but it does not
I'm experimenting with Dll rebasing on a small test solution running on .net4 consisting
I am having some problems in rebasing. It is showing conflicts. Actually, I had
Does rebasing a stream in your snapshot view affect other users of that stream.
I'm rebasing in git, and one conflict I get is 'both added' - that
I'm a bit new to the whole rebasing feature within git. Let's say that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.