I am working on a windbg extension for dump analysis that requires symbols from unloaded modules. I'm using the function IDebugSymbols3::Reload, which is analogous to the .reload 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.
If I were manually debugging, I would probably use the !address 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?
GetNumberModules(), for count of loaded and unloaded modules
GetModuleParameters in a loop for base and size
or maybe IDebugDataSpaces2::QueryVirtual
compiled and linked with vs2017 dev cmd prompt on win7 x86 using 18362 includes
resulting in