I was wondering if there was any way I could incorporate my Keyboard Hook DLL into my executable. Is there any relatively simple way I could load a DLL dynamically from memory? Thanks
Sure, several ways. The LoadLibrary/FreeLibrary calls work just fine, but I prefer to let MASM do all it can for me and do that work. Iczelion has some excellent tuts on dlls. I suggest you read them.
But how can I load a DLL from memory, rather than a file?
It can be done but not easy. You must allocate enough address space for the DLL with VirtualAlloc then write the dll to the allocated block section by section. You also need to modify the PE header of the dll and you must use the information in the reloc section to relocate the whole dll.