我写了简单的64位kmdf驱动程序(wfp/inspect)。此驱动程序位于:
%WinDir%\System32\Drivers\Inspect.sys
我可以使用以下命令加载此驱动程序: net start inspect。
现在我想在Windows启动时加载这个驱动程序,所以我准备了这个inf文件:
版本
 Signature   = "$Windows NT$" Class       = WFPCALLOUTS ClassGuid   = {57465043-616C-6C6F-7574-5F636C617373} Provider    = %ProviderString% CatalogFile = Inspect.cat DriverVer = 09/20/2018,19.58.54.237SourceDisksNames
1 = %InspectDisk%,,,""SourceDisksFiles
Inspect.sys = 1,,DestinationDirs
 DefaultDestDir      = 12                                               ; %WinDir%\System32\Drivers Inspect.DriverFiles = 12                                               ; %WinDir%\System32\DriversDefaultInstall
 OptionDesc = %InspectServiceDesc% CopyFiles  = Inspect.DriverFilesDefaultInstall.Services
 AddService = %InspectServiceName%,,Inspect.ServiceDefaultUninstall
 DelFiles = Inspect.DriverFilesDefaultUninstall.Services
 DelService = %InspectServiceName%,0x200                                ; SPSVCINST\_STOPSERVICE DelReg     = Inspect.DelRegistryInspect.DriverFiles
 Inspect.sys,,,0x00000040                                               ; COPYFLG\_OVERWRITE\_OLDER\_ONLYInspect.Service
 DisplayName   = %InspectServiceName% Description   = %InspectServiceDesc% ServiceType   = 1                                                      ; SERVICE\_KERNEL\_DRIVER StartType     = 0                                                      ; SERVICE\_BOOT\_START ErrorControl  = 1                                                      ; SERVICE\_ERROR\_NORMAL ServiceBinary = %12%\Inspect.sys                                       ; %WinDir%\System32\Drivers\Inspect.sys  AddReg        = Inspect.AddRegistryInspect.AddRegistry
 HKR,"Parameters","BlockTraffic",0x00010001,"0"                         ; FLG\_ADDREG\_TYPE\_DWORD HKR,"Parameters","RemoteAddressToInspect",0x00000000,"10.0.0.1"        ; FLG\_ADDREG\_TYPE\_SZInspect.DelRegistry
 HKR,"Parameters",,,Strings = "TODO-Set-Provider“
 InspectDisk        = "Traffic Inspect Installation Disk" InspectServiceDesc = "Traffic Inspect Callout Driver" InspectServiceName = "Inspect"但是驱动程序不会在启动时加载。
正如我在开头提到的,它是64位的kmdf驱动程序。
我是不是忘了什么?有什么建议/提示问题在哪里吗?
谢谢你的帮助。
发布于 2019-01-15 04:28:04
请参阅以下question。TL;DR:
使用sc创建服务名binPath= .sys文件的路径type=内核创建内核模式服务,使用sc启动服务名将其启动
https://stackoverflow.com/questions/52475710
复制相似问题