This project is a comprehensive tool designed for interacting with a game at a low level, primarily intended for creating cheats or mods. It consists of a kernel driver located in the "KernelReadWriteDriver" directory and a user mode application with a graphical user interface, located in the "KernelReadWriteDriver_UserMode_IMGUI" directory.
The kernel driver provides essential functionality for reading from and writing to virtual memory, enabling users to manipulate various aspects of the game's state. Meanwhile, the user mode application utilizes this functionality to implement a range of features, including an aimbot, while also offering a user-friendly interface for configuring these features.
To maintain organization and ease of use, the project is neatly structured with separate directories for the kernel driver and the user mode application. Additionally, it comes with several supplementary resources, such as a font file named "arial.ttf", a Cheat Engine table named "assaultcube.CT", and a PowerShell script for automated installation labeled "autoinstall.ps1".
Hello and welcome to this comprehensive guide. Please read through carefully to avoid any mistakes. This guide is designed to provide a straightforward walkthrough for creating a simple kernel driver for Windows. If you would like to support this project and don't feel like compiling the binaries yourself, go to patreon to get the pre-compiled binaries.
You can watch a showcase video here.
The process of running the applications in the correct order involves the following steps:
- Start the Driver
- Run the Game
- Start the User Mode Application
The flowchart below illustrates this process:
Each step is represented by a box, and the arrows represent the flow from one step to the next. The boxes filled with light green color indicate that the corresponding application is running.
Important
Before you begin, ensure that you have the following:
- A Windows machine with Secure Boot disabled
- At least 4 GB RAM on your Windows machine
- Windows Redistributable
- DirectX
- Restart your computer: Access the BIOS/UEFI settings by pressing F2, F10, or Delete (based on your computer's manufacturer).
- Locate Secure Boot: Find the Secure Boot setting in the "Security" or "Trusted Platform Module (TPM)" section.
- Disable Secure Boot: Save the settings and boot into Windows.
Tip
Back up your data before disabling Secure Boot.
Important
Disable Secure Boot only when necessary, such as running virtual machines or specific software.
Caution
Re-enable Secure Boot to protect your computer once done with the required tasks.
To develop a kernel driver, set up your environment by downloading the following requirements:
1.1 Install Visual Studio 2022: Download Link
1.2 - Install Desktop Development With C++ 1.3 Install Individual components listed:
- C++ ATL for latest v143 build tools with Spectre Mitigations (ARM64/ARM64EC)
- C++ ATL for latest v143 build tools with Spectre Mitigations (x86 & x86)
- C++ MFC for latest v143 build tools with Spectre Mitigations (ARM64/ARM64EC)
- MSVC v143 - VS 2022 C++ ARM64/ARM64EC Spectre-mitigated libs (Latest)
- MSVC v143 - VS 2022 C++ x64/x86 Spectre-mitigated libs (Latest)
2 Install Windows SDK: Download Link 3 Install Windows Driver Kit (WDK): Download Link
- Follow this tutorial if the above WDK link is outdated.
- When installing components for Visual Studio 2022, select "Desktop development with C++" and specific individual components as listed in the guide.
- Download Debug View: Direct Link or Sysinternals Website
- Create a new kernel mode driver project: Choose "Kernel Mode Driver, Empty (KMDF)" in Visual Studio.
- Right-click on the project.
- Activate "Use Local Time" and Enable Active(Release).
- Navigate to "Linker" -> "Command Line" and add "/INTEGRITYCHECK".
- Add a class with the same name as the project.
- Add a new header file: Name it "messages.h" in the Header Files folder.
- Define a function: Create a function called
debug_message
that takes a string and extra parameters. - Include the header file: Add "messages.h" in your source file.
- Create functions:
driver_entry
that takes aPDRIVER_OBJECT
and aPUNICODE_STRING
.unload_driver
that takes aPDRIVER_OBJECT
.- Call
debug_message
to print a message when the driver starts and stops.
- Compile the driver.
-
Set Kernel driver Bin Path: Use
sc create
command.- Replace "computer name" with your actual computer name and "KernelReadWriteDriver.sys" with your .sys file name.
sc create KernelReadWriteDriver type= Kernel Binpath="C:\Users\computer name\source\repos\KernelReadWriteDriver\x64\Release\KernelReadWriteDriver.sys"
-
Enable test signing: Use the command:
bcdedit /set testsigning on
-
Start DebugView in ADMIN mode.
-
Enable Capture Kernel In Debug View.
-
Load the driver using the sc command:
sc start "kernel driver name"
Tip
When and if encountering an error do the following:
5.1
Run the following command in ADMIN cmd and restart:
bcdedit /set nointegritychecks on
- Stop the driver using the sc command:
sc stop "kernel driver name"
Before we congratulate you on completing The-Kernel-Driver-Tutorial, let's understand how everything works:
- Secure Boot: Disabled to allow the execution of kernel drivers.
- Visual Studio Setup: Establishes a development environment.
- WDK and SDK: Essential tools for kernel mode driver development.
- Debug View: Monitors debug output from the driver.
- Driver Entry: Initializes the kernel driver when loaded into the Windows kernel.
- Unload Driver: Handles cleanup when the driver is unloaded.
- Debug Message: Prints diagnostic messages for debugging purposes.
- Driver Setup: The kernel driver is compiled and integrated into the Windows kernel using
sc create
command. - User Space Application: Develop a user-space application that communicates with the kernel driver.
- Communication Mechanism: Use Windows API or custom communication mechanisms like IOCTLs for communication between user and kernel space.
- Test Signing: Enabled to allow the loading of the kernel driver during development.
- DebugView: Captures debug messages for monitoring driver execution.
- Driver Load and Unload: The driver is loaded and unloaded using the
sc start
andsc stop
commands.
Congratulations on completing The-Kernel-Driver-Tutorial! You've successfully set up your development environment, disabled Secure Boot, created a simple kernel driver for Windows, and gained insights into kernel-to-user communication. This foundation opens doors to advanced driver development and system-level interactions.
- Cheat entries can be found in cheat-entries.md or by downloading the assaultcube.CT file. Run it with Cheat Engine while playing the game.
Special thanks to the following resources and explanation videos: