How to implicitly load only signed DLL s

2019-02-11 02:28发布

I have an application which is linked with set of dll files. I am loading the DLL s implicitly without going through insecure LoadLibrary() calls. I am thinking of signing the DLL s with a certificate file to avoid DLL hijacking. I have a doubt that how can implicit linking checks whether my DLL s are signed or not.

标签: c++ windows dll
1条回答
▲ chillily
2楼-- · 2019-02-11 02:38

You should add a manifest dependency using the MANIFESTDEPENDENCY linker option and set publicKeyToken to the key used to sign the dlls.

E.g. something like:

/manifestdependancy:type='win32' name='mydll' language='*' publicKeyToken='1234567890ABCDEF0'

Windows will then refuse to load your application unless the dll matching the above conditions is present.

查看更多
登录 后发表回答