Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LoadLibrary

Status
Not open for further replies.

buzznick

IS-IT--Management
Dec 29, 2004
39
US
Hi, I'm trying to use LoadLibrary() in VC++ 6.0 to load a DLL in RAM. In other words, the DLL is not on disk but it's actually loaded into memory as a buffer of bytes. Does anyone know how I can trick LoadLibrary() into using the buffer as a disk file without me having to write the bytes to disk first?

It works fine if I write the bytes to disk, then call LoadLibrary(), the call the function, then FreeLibrary() then immediately delete the file on disk. However, I'd rather I could simply load the HINSTANCE from RAM rather than write to disk.

Thanks,
Nick
 
How did it get into RAM in the first place, if not from a file?

--
 
swapped-in text (code) segments are backed by their original code on disk; perhaps the swapper code simply doesn't support any other arrangement. just a guess.

let's see... load a dll from over the wire and execute its contents. no, i can't see ANY security issues THERE. <g>.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top