Hot loading a DLL from memory

I'm wondering if we can "load" a dll while its still in the memory(after compilation) so that we can do our hot-loading without the disk access?
Yes, you can do it. But as explained on stream, you will loose ability to debug source code - debugger will have no information about this virtual "dll file". Of course you will still have ability to debug machine code (assembly).

For example code see this library: https://github.com/fancycode/MemoryModule It is very small and easy to understand. It basically provides similar functions to "LoadLibrary" and "GetProcAddress" to operate on dll file in memory.

Here's the description how it works: http://www.joachim-bauch.de/tutorials/loading-a-dll-from-memory/
can we use LoadLibrary on the first load, then overwrite its memory with the new recompiled dlls, then call ReBaseImage to fix the debugging information.

Edited by ambiguous panda on
It is unlikely there will be a disk access anyway. Since the compiler just wrote it, it's probably in the Windows IO cache.

- Casey