Jump to content
Sign in to follow this  
Jaque

Check if INF file is signed using SetupVerifyInfFileA

Recommended Posts

Jaque

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

Share this post


Link to post
Share on other sites
Micha1405

Thanks Larry for fast answer but it will not work. :think: I attach 2 drivers one is signed and the other not.

I dont unterstand the dllcall function Please help me

Edited by Micha1405

Share this post


Link to post
Share on other sites
Micha1405

Sorry it doesn't work

Here is a unsigned driver

Edited by Micha1405

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.