winverifytrust

Memory Leak while verifying Authenticode Signature of Executables?

谁都会走 提交于 2019-12-22 07:52:27
问题 I am using WinVerifyTrust to verify the validity of some Windows executables with the following function, called in a loop from _tmain : int signature_is_valid(const wchar_t *filepath) { GUID guid = WINTRUST_ACTION_GENERIC_VERIFY_V2; WINTRUST_FILE_INFO file_info = { 0 }; WINTRUST_DATA wd; file_info.cbStruct = sizeof(file_info); file_info.pcwszFilePath = filepath; file_info.hFile = NULL; file_info.pgKnownSubject = NULL; ZeroMemory(&wd, sizeof(wd)); wd.cbStruct = sizeof(wd); wd.dwUIChoice = WTD

Memory Leak while verifying Authenticode Signature of Executables?

人盡茶涼 提交于 2019-12-22 07:51:30
问题 I am using WinVerifyTrust to verify the validity of some Windows executables with the following function, called in a loop from _tmain : int signature_is_valid(const wchar_t *filepath) { GUID guid = WINTRUST_ACTION_GENERIC_VERIFY_V2; WINTRUST_FILE_INFO file_info = { 0 }; WINTRUST_DATA wd; file_info.cbStruct = sizeof(file_info); file_info.pcwszFilePath = filepath; file_info.hFile = NULL; file_info.pgKnownSubject = NULL; ZeroMemory(&wd, sizeof(wd)); wd.cbStruct = sizeof(wd); wd.dwUIChoice = WTD

Verify digital signature within system32/drivers folder

做~自己de王妃 提交于 2019-12-13 18:17:52
问题 I've spent all night researching this without a solution. I'm trying to verify the digital signature of a file in the drives folder (C:\Windows\System32\drivers*.sys) pick whatever one you want. I know that the code is correct because if you move the file from that folder to C:\ the test works. WinVerifyTrust gives error 80092003 http://pastebin.com/nLR7rvZe CryptQueryObject gives error 80092009 http://pastebin.com/45Ra6eL4 What's the deal? 回答1: 0x80092003 = CRYPT_E_FILE_ERROR = An error

How to identify an Isolated Network

僤鯓⒐⒋嵵緔 提交于 2019-12-11 11:19:29
问题 I am developing a c# .Net3.5 application. The applications checks the signature of files using WinVerifyTrust. The problem is that on isolated networks (i.e. no Internet access but machine still has an IP address) it takes a very long time (~20 seconds) until WinVerifyTrust returns. Is there a way to identify this situation? 回答1: Have you tried using the Windows API - using System; using System.Runtime; using System.Runtime.InteropServices; public class InternetCS { //Creating the extern

Detect a digital signature without WinVerifyTrust

醉酒当歌 提交于 2019-12-06 09:04:28
问题 I have a large number of EXE files and need to figure out which ones have digital signatures. Does anyone know if there is a way to check without access to WinVerifyTrust (they're all on a Unix server). I can't seem to find any information on where the digital signature actually is inside the EXE. If I could find out where it is I might be able to open the file and fseek to a location to test. I don't need to do "real" verification on the certificate, I just want to see if a digital signature

Memory Leak while verifying Authenticode Signature of Executables?

限于喜欢 提交于 2019-12-05 11:58:49
I am using WinVerifyTrust to verify the validity of some Windows executables with the following function, called in a loop from _tmain : int signature_is_valid(const wchar_t *filepath) { GUID guid = WINTRUST_ACTION_GENERIC_VERIFY_V2; WINTRUST_FILE_INFO file_info = { 0 }; WINTRUST_DATA wd; file_info.cbStruct = sizeof(file_info); file_info.pcwszFilePath = filepath; file_info.hFile = NULL; file_info.pgKnownSubject = NULL; ZeroMemory(&wd, sizeof(wd)); wd.cbStruct = sizeof(wd); wd.dwUIChoice = WTD_UI_NONE; wd.fdwRevocationChecks = WTD_REVOCATION_CHECK_NONE; wd.dwUnionChoice = WTD_CHOICE_FILE; wd

Detect a digital signature without WinVerifyTrust

一世执手 提交于 2019-12-04 13:04:37
I have a large number of EXE files and need to figure out which ones have digital signatures. Does anyone know if there is a way to check without access to WinVerifyTrust (they're all on a Unix server). I can't seem to find any information on where the digital signature actually is inside the EXE. If I could find out where it is I might be able to open the file and fseek to a location to test. I don't need to do "real" verification on the certificate, I just want to see if a digital signature is present (or, more importantly, NOT present) without having to use WinVerifyTrust. As mentioned

How to verify that my orgainization signed a trusted windows binary?

别说谁变了你拦得住时间么 提交于 2019-11-30 07:12:54
This is a followup question to question 1072540, 'WinVerifyTrust to check for a specific signature?' . I want to write a C++ function Lets call it TrustedByUs of the form: bool TrustedByUs(std::string pathToBinary, std::string pathToPublicKey) The idea is that we give this function a path to a binary .dll or .exe file that has been signed with a digital signature. The pathToPublicKey string is the path to a public key of our particular signing certificate. Using the code in http://support.microsoft.com/kb/323809 it's pretty straight forward to verify that the pathToBinary file is in fact

How to verify that my orgainization signed a trusted windows binary?

纵饮孤独 提交于 2019-11-29 09:44:34
问题 This is a followup question to question 1072540, 'WinVerifyTrust to check for a specific signature?'. I want to write a C++ function Lets call it TrustedByUs of the form: bool TrustedByUs(std::string pathToBinary, std::string pathToPublicKey) The idea is that we give this function a path to a binary .dll or .exe file that has been signed with a digital signature. The pathToPublicKey string is the path to a public key of our particular signing certificate. Using the code in http://support

WinVerifyTrust to check for a specific signature?

冷暖自知 提交于 2019-11-27 14:06:06
I'm implementing a process elevation helper for Windows. It's a program that will run in elevated mode and launch other programs with administrator privileges without displaying additional UAC prompts. For security reasons, I want to make sure only binaries that are digitally signed with my company's Authenticode key can be executed. The WinVerifyTrust function gets me halfway there, but it only ensures that a binary is signed by some key that is part of Microsoft's chain of trust. Is there a relatively simple way to perform the Authenticode verification AND ensure that it is signed by our