You want to verify the signatures loaded DLL. Once they are downloaded, they have already managed to run arbitrary code in your process (see. DllMain ), and you lose.
You might want to delay the loading of DLL. Thus, you do not need to manually do LoadLibrary / GetProcAddress for every function, but you still have a chance to run some code before loading the DLL and will fail if the test fails.
No, WinVerifyTrust not require an Internet connection in real time. Each Windows machine has a list of trusted root certificates. In some checking it extracts the signature and certificates attached to a binary file, verifies that the signature is valid (the contents of the file is actually consistent with what has been signed), and that the certificates form a real chain that leads to one of the trusted roots.
Note that WinVerifyTrust does not check that the file is signed by your own, since it was signed by someone who bought a certificate from a known certificate authorities, and was not then intervened. If you want to confirm that the file actually belongs to you, additional steps need to be taken.
source share