用vc2013+wdk如何入手實作以下的驅動?不吝賜教 謝謝!
//--------------------------------------------------------------------------------------
驅動兼容性:
Win7/Win8/Win8.1/Win10 32bit/64bit全支持
主要功能:
全域hook指定exe名稱串列中的所有行程,并獲取所有引數,同時判斷引數內容進行指定內容替換。
例如:
1)用戶啟動netbardaemon.exe,獲取引數串列為空,所以hook后改變引數為netbardaemon.exe --with-feature=feature1,feature2
用戶通過快捷方式啟動netbardaemon.exe,該快捷方式附帶引數 --disable-heartbeat=true --disable-feature,hook后改變引數為netbardaemon.exe --disable-heartbeat=true --with-feature=feature1,feature2
uj5u.com熱心網友回復:
費那事兒!僅供參考:
用除錯器(OD,WINDBG等)除錯服務程式
To debug the initialization code of a service application, the debugger must be attached when the service is started. This is accomplished by creating a registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\ProgramName
The ProgramName is the image file for the service application you are debugging. Do not specify a path. For example, the ProgramName might look like MyService.exe.
Under this key create a string data value called Debugger. The value of this string should be set to the full path of the debugger that will be used. For example,
c:\Debuggers\windbg.exe
In addition to setting this registry key, the service application must be marked as "interactive". This allows your service to interact with the desktop, and allows the debugger window to appear on your desktop.
This again requires modifying a registry key: you must bitwise-or the type entry for your service with 0x100 (this is the value for SERVICE_INTERACTIVE_PROCESS according to Winnt.h). The exact location and name of this registry entry varies. For example:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MyServiceKey
Finally, you need to adjust the service application timeout. Otherwise, the service application will kill the debugger within 20 seconds after starting. Adjusting the timeout involves setting an entry in the following registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control
Under this key, create a DWORD data value called ServicesPipeTimeout. Set this entry to the amount of time in milliseconds that you want the service to wait before timing out. For example, 60,000 is one minute, while 86,400,000 is 24 hours.
設定ServicesPipeTimeout后需要重啟系統才生效
Now, when the service is started, the debugger will also start. When the debugger starts, it will stop at the initial process breakpoint, before the service has begun running. This allows you to set breakpoints or otherwise configure your debugging session to let you monitor the startup of your service. Another option is to place calls to the DebugBreak function in your service from the point at which you would like to break into the debugger. (For more information, see DebugBreak in the Platform SDK documentation.)
If your service is running with other services in a Service Host Process, you may need to isolate the service into its own Service Host Process.
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/153506.html
標籤:進程/線程/DLL
上一篇:想獲取到一個.net程式某一個變數的值,能做到嗎,求解
下一篇:EXCEL繪制表格并列印表格
