Jump to content

Check if INF file is signed using SetupVerifyInfFileA


Jaque
 Share

Recommended Posts

Hi,

I want to check if a driver is digital signed (without WMI). I am confused how to use the dllstruct functions. I can't get it working. Can anyone give me some advise?

Code I tried:

; Check if INF file is signed using SetupVerifyInfFileA
; http://msdn.microsoft.com/library/default.asp?url=/library/en-us/setupapi/setup/setupverifyinffile.asp

$INFFileStruct=DllStructCreate("char[256]")
DllStructSetData($INFFileStruct,1,"c:\Windows\inf\machine.inf")

$ptr3=DllStructCreate("dword;ptr;ptr;ptr")

$signed=DllCall("setupapi.dll","bool","SetupVerifyInfFile","ptr",DllStructGetPtr($INFFileStruct,1),"ptr",0,"ptr",DllStructGetPtr($ptr3))
If $signed Then
  MsgBox(0,"Signed","Signed")
Else
  MsgBox(0,"Signed","Unsigned")
Endif
Link to comment
Share on other sites

  • 2 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...