This is a Visual Studio project which generates (pseudo) version.dll. Since it passes all arguments to genuine version.dll, virtually both of them have same functionality as version.dll.
Since almost all Windows executables load version.dll, you can use this project to add functionalities/hooks/hacks to target executable.
For hooking purpose, you may also interest in API hook library minhook.
- Open
version.slnwith Visual Studio 2017 - Build
x64/Debugorx64/Release x64/Debug/version.dllorx64/Release/version.dllwill be produced.
- Copy
C:\Windows\notepad.exetoC:\mytest\notepad.exe - Create directory
C:\mytest\notepad.exe.plugins - Open and release build
version.sln.- Copy
x64\Release\version.dlltoC:\mytest\version.dll
- Copy
- Open and release build
example_plugin\example_plugin.sln.- Copy
example_plugin\x64\Release\example_plugin.dlltoC:\mytest\notepad.exe.plugins\example_plugin.dll
- Copy
- Open DebugView
- Run
C:\mytest\notepad.exeand open or save some text file.- DebugView shows
CreateFileW()activities which is hooked byexample_plugin.dll.
- DebugView shows
version.dllloads all DLLs which are placed inYOUR-TARGET.exe-PATH/YOUR-TARGET.exe.plugins/.- DLLs are loaded from mutiple directories recursively.
- If directory's or file's name is started with
., they're ignored. e.g..my-private-dir/,.my-private-file.dll, etc.
- If directory's or file's name is started with
- DLL loading order is decided by
std::sort()forstd::wstringpaths of DLLs.- e.g.
YOUR-PATH\01\*.dllis loaded beforeYOUR-PATH\99\*.dll
- e.g.
- DLLs are loaded from mutiple directories recursively.