Skip to content

Go bindings to help run dlls that are embedded

License

Notifications You must be signed in to change notification settings

KnicKnic/temp-dll

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GOAL

Allow a golang library to be dependent on windows dlls and hide this from library consumers.

The reason I want to do this a lot of people prefer single file distributables. This code allows that. They embed the dll in the binary, and this will have some helper functions to load it. It accomplishes this by writing the binary to a temporary file. It remains for consideration in the future to use https://github.com/fancycode/MemoryModule.

Currently the code follows the pattern from https://www.drdobbs.com/packing-dlls-in-your-exe/184416443 (write file, open file with delete on close, load library). Cannot due this due to loadlibrary not allowing FILE_SHARE_DELETE

Currently this code copies the dll into windows temp directory. It does so with the following pattern.

    tempdirectory/(base32 ecoded sha256)-(originalfilename)

The copied dll stays there forever.

About

Go bindings to help run dlls that are embedded

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages