Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
K

KernelSharp

> 编程语言
Open source

C# Kernel Mode Driver example using NativeAOT

192 stars0 likes1 views
WebsiteGitHub

About

C# Kernel Mode Driver example using NativeAOT

KernelSharp

This is an example of how to use NativeAOT to compile C# code to a Windows Kernel Mode driver. This repository contains parts of https://github.com/ZeroLP/ZeroKernel.

If you want to see an example of a full memory R/W Driver using this, check out my repo https://github.com/VollRagm/KernelBypassSharp.

Compiling

Open the build.bat and fix the file paths. ILCPATH is located at C:\Users\\username\.nuget\packages\runtime.win-x64.microsoft.dotnet.ilcompiler\7.0.0-alpha.1.21430.2\tools, ntoskrnl.lib is located in the WDK install path. Run x64 Native Tools Command Prompt for VS 2019, cd into the project directory and run build.bat. You can load the driver or map it with kdmapper.

Creating a project

Follow the Quick start guide to create a new native project. After that simply edit the project file itself and add all properties from the project in this repository. After including WDK.cs and the Runtime folder in your project you will be able to compile it.

Features

  • Call any kernel export
  • Convert C# strings to multibyte characters
  • Reading cr3

Limitations

  • No support for variadic arguments
  • No managed multibyte character string type, conversion is required
  • The native compiler misplaces globally declared strings wrongly, causing a bluescreen when referenced

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C#

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言