In order to defend my products against sideload attacks, I would like to verify that the DLLs that I load into the the application, are really the DLLs that I expect, and not a compromised DLL with the same name.
I've considering generering hashes of all DLLs on build, and verifying a DLLs hash every time it's loaded/accessed.
What's the best way to do this? Are there tools I can just plug into my applications, or do I need to write something myself?