title: How can I programmatically find a suitable region to reload an unloaded module without overlap?
body: <p>I am working on a windbg extension for dump analysis that requires symbols from unloaded modules. I'm using the function <a href="https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/dbgeng/nf-dbgeng-idebugsymbols3-reload" rel="nofollow noreferrer">IDebugSymbols3::Reload</a>, which is analogous to the <code>.reload</code> command. In the case that the region originally occupied by the module is no longer available, I must explicitly specify a new base address to load into.</p>
  <p>If I were manually debugging, I would probably use the <code>!address</code> extension to list free regions and look for one that was large enough. How I can programmatically find an appropriate location in the target's address space to use?</p>