DLL in memory
-
Can a DLL loaded into a memory table be used like a DLL into a file with
LoadLibrary()
?36. When you surround an army, leave an outlet free. ... Do not press a desperate foe too hard. SUN-TZU - Art of War
Are you wanting to know the difference between implicit and explicit linking?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
-
Can a DLL loaded into a memory table be used like a DLL into a file with
LoadLibrary()
?36. When you surround an army, leave an outlet free. ... Do not press a desperate foe too hard. SUN-TZU - Art of War
LoadLibrary
requires the DLL to be on the disk. So you will need to write the contents of the memory to a disk file and then callLoadLibrary
on it.«_Superman_» I love work. It gives me something to do between weekends.
Microsoft MVP (Visual C++) -
Can a DLL loaded into a memory table be used like a DLL into a file with
LoadLibrary()
?36. When you surround an army, leave an outlet free. ... Do not press a desperate foe too hard. SUN-TZU - Art of War
-
Are you wanting to know the difference between implicit and explicit linking?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
-
LoadLibrary
requires the DLL to be on the disk. So you will need to write the contents of the memory to a disk file and then callLoadLibrary
on it.«_Superman_» I love work. It gives me something to do between weekends.
Microsoft MVP (Visual C++) -
I think I don't understand. The problem is that I want to avoid
LoadLibrary()
.36. When you surround an army, leave an outlet free. ... Do not press a desperate foe too hard. SUN-TZU - Art of War
RomTibi wrote:
The problem is that I want to avoid LoadLibrary().
Then you must link implicitly.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
-
RomTibi wrote:
The problem is that I want to avoid LoadLibrary().
Then you must link implicitly.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
-
I think I don't know the difference between
implicit
andexplicit
. I think I need an example.36. When you surround an army, leave an outlet free. ... Do not press a desperate foe too hard. SUN-TZU - Art of War
RomTibi wrote:
I think I need an example.
Google is your friend. See here.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
-
RomTibi wrote:
I think I need an example.
Google is your friend. See here.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
-
Can a DLL loaded into a memory table be used like a DLL into a file with
LoadLibrary()
?36. When you surround an army, leave an outlet free. ... Do not press a desperate foe too hard. SUN-TZU - Art of War
Firstly, it's far from clear what you mean by "loaded into a memory table". It sounds like your want to re-implement the loader. In general I'm not sure if this is possible from user mode. There's a lot more to getting a module into memory in a executable state then simply having the module in memory: relocating, recursively loading all dependent modules, resolving imports (building the Import Address Table, for example), etc... Even if you did do all these things (and more that I've forgotten) it's far from clear that "unusual" things, for example code that enumerated all loaded modules, would work.
Steve