1、下载地址
2、虚拟机调试环境
用来构造虚拟机远程环境,使用windbg调试内核,包括禁用驱动程序强制签名。
调试
加载、卸载驱动程序
3、编写驱动程序
(一)新建WDM项目
(二)新建main.c
3、添加以下代码
#include <ntddk.h>
void DriverUnload(PDRIVER_OBJECT pdriver)
{
DbgPrint("Unload\n");
}
NTSTATUS DriverEntry(PDRIVER_OBJECT pdriver, PUNICODE_STRING reg_path)
{
NTSTATUS status = STATUS_SUCCESS;
pdriver->DriverUnload = DriverUnload;
return status;
}
4、修改警告等级为 3
5、修改平台为 Windows7 Desktop
6、关闭 inf2cat
7、关闭为驱动添加数字签名
8、进行编译
1>------ Build started: Project: MyDriver2, Configuration: Debug Win32 ------
1> Building 'MyDriver2' with toolset 'WindowsKernelModeDriver10.0' and the 'Desktop' target platform.
1> Stamping Debug\MyDriver2.inf [Version] section with DriverVer=02/02/2021,0.3.53.857
1> main.c
1> MyDriver2.vcxproj -> d:\users\12138\documents\visual studio 2015\Projects\MyDriver2\Debug\MyDriver2.sys
1> MyDriver2.vcxproj -> d:\users\12138\documents\visual studio 2015\Projects\MyDriver2\Debug\MyDriver2.pdb (Full PDB)
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========