I've found a unit with functions that allow to Load a DLL directly from memory, but I don't know how can I use it..
This is the unit: http://www.delphibasics.info/home/delphibasicssnippets/udllfrommem-loadadllfrommemory
I know that the function is:
function memLoadLibrary(FileBase : Pointer) : Pointer;
But I don't know how can I use it, what is the FileBase that I need to define, etc.
Can anyone help-me?
You simply need to put the DLL into memory and pass to memLoadLibrary the pointer to the location of the DLL in memory.
For example, from a resource:
hRes := LoadResource(HInstance, 'MYRESNAME');
if hres=0 then
RaiseLastOSError;
BaseAddress := LockResource(hRes);
if BaseAddress=nil then
RaiseLastOSError;
lib := memLoadLibrary(BaseAddress);
.....
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With