win驱动开发(一)

0x01 说明

测试驱动开发HelloWorld


0x02文件准备

hello.c



#include <ntddk.h>

VOID DriverUnload(PDRIVER_OBJECT pDriverObject)
{
	DbgPrint("Goodbye Gyarmy\n");
}

NTSTATUS DriverEntry(PDRIVER_OBJECT pDriverObject, PUNICODE_STRING pRegPath)
{
	pDriverObject->DriverUnload = DriverUnload;
	DbgPrint("Hello Gyarmy!\n");
	return STATUS_SUCCESS;
}


makefile



!IF 0

Copyright (C) Microsoft Corporation, 1999 - 2002

Module Name:

    makefile.

Notes:

    DO NOT EDIT THIS FILE!!!  Edit .\sources. if you want to add a new source
    file to this component.  This file merely indirects to the real make file
    that is shared by all the components of Windows NT (DDK)

!ENDIF

!INCLUDE $(NTMAKEENV)\makefile.def





SOURCES


TARGETNAME=TestNew
TARGETPATH=Debug
TARGETTYPE=DRIVER

SOURCES=hello.c



0x03 执行

选择winddk的编译环境

定位到目录: bld 直接编译


0x04 监测运行

使用dbgview进行输出监测

使用驱动加载工具V1.3 进行运行

微信截图_20181101123129.png




原文链接: win驱动开发(一) 版权所有,转载时请注明出处,违者必究。
注明出处格式:流沙团 ( https://gyarmy.com/post-481.html )

发表评论

2则评论给“win驱动开发(一)”

  1. crack主动脉

    博主,你看的哪套教程

    回复
    • 流沙

      @crack主动脉:梦无极的驱动开发

      回复