[原創]淺談如何使用gcc開發NT核心驅動程序
[原創]淺談如何使用gcc開發NT核心驅動程序
;****************************************************************
.code INIT
;****************************************************************
pusRegistryPath:PUNICODE_STRING
local status:NTSTATUS
invoke DbgPrint,$CTA0("enter driverentry")
invoke DbgPrint,addr szenter
invoke DbgPrint,addr szleave
mov eax, status
DriverEntry endp
;****************************************************************
end DriverEntry
;****************************************************************
.code INIT
;****************************************************************
DriverEntry proc pDriverObject:PDRIVER_OBJECT,/
pusRegistryPath:PUNICODE_STRING
local status:NTSTATUS
jmp Real_Start
szenter db "enter driverentry",0
szleave db "leave driverentry",0
Real_Start:
mov status,STATUS_DEVICE_CONFIGURATION_ERROR
invoke DbgPrint,addr szenter
;do someting you want!
invoke DbgPrint,addr szleave
mov eax, status
ret
DriverEntry endp
;****************************************************************
end DriverEntry
invoke DbgPrint,$CTA0("enter driverentry")
invoke DbgPrint,$CTA0("leave driverentry")
puts("So Cool!");
#include <stdio.h>
#include "ddk/ntddk.h"
_stdcall NTSTATUS DriverEntry(PDRIVER_OBJECT pDriverObject,/
PUNICODE_STRING pRegistryPath)
{
NTSTATUS status = STATUS_DEVICE_CONFIGURATION_ERROR;
DbgPrint("enter DriverEntry,I'm Hopy!/n");
DbgPrint("Leave DriverEntry,byb :)!/n");
return status;
}
總結如下:
使用gcc編寫NT下的驅動十分方便,隻需要
gcc 包 + MS link + 一個好用的編輯器 即可。 :)
最後更新:2017-04-02 00:06:27