-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathProgram.cs
More file actions
32 lines (26 loc) · 777 Bytes
/
Copy pathProgram.cs
File metadata and controls
32 lines (26 loc) · 777 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System.Runtime;
using System.Runtime.InteropServices;
using WDK.NET;
using WDK.NET.Kernel;
using WDK.NET.Enums;
using WDK.NET.SafeHelpers;
using WDK.NET.CStd;
namespace SampleDriver
{
public unsafe class Program
{
//Dummy main entrypoint method for CSC
static void Main() { }
//Dummy winmain method for linker
[RuntimeExport("wmainCRTStartup")]
static void wmainCRTStartup() { }
[RuntimeExport("DriverEntry")]
static NTSTATUS DriverEntry()
{
var memPool = SafeMemoryHelper.AllocateNonPagedPoolMemory(0x1000);
Wdm.DbgPrintEx(0, 0,StdString.c_str("Hello World!"), memPool, 0);
Wdm.ExFreePool(memPool);
return NTSTATUS.Success;
}
}
}