Skip to content

This project describes a technique how a NATIVE dynamic link library (DLL) can be loaded from memory (In C#) without storing it on the hard-disk first.

Notifications You must be signed in to change notification settings

dretax/DynamicDllLoader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

DynamicDllLoader

DynamicDllLoader in C# for native dlls (C / C++)

Loading a DLL from memory

This project describes a technique how a dynamic link library (DLL) can be loaded from memory without storing it on the hard-disk first.

Overview

The default windows API functions to load external libraries into a program (LoadLibrary, LoadLibraryEx) only work with files on the filesystem. It’s therefore "impossible" to load a DLL from memory. (You could do a similar way of managed injection) But sometimes, you need exactly this functionality (e.g. you don’t want to distribute a lot of files or want to make disassembling harder). Common workarounds for these problems are to write the DLL into a temporary file first and import it from there. We could also store the byte array in our program, or in an encrypted temp file. When the program terminates, the temporary file gets deleted.

C++ Source

https://www.joachim-bauch.de/tutorials/loading-a-dll-from-memory/

About

This project describes a technique how a NATIVE dynamic link library (DLL) can be loaded from memory (In C#) without storing it on the hard-disk first.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages