Skip to content

Commit d1d3c23

Browse files
authored
Update README.md
1 parent 57a3da8 commit d1d3c23

File tree

1 file changed

+81
-112
lines changed

1 file changed

+81
-112
lines changed

README.md

Lines changed: 81 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -1,160 +1,129 @@
1+
# The-Kernel-Driver-GUIDE
2+
13
![banner](https://github.com/CollinEdward/The-Kernel-Driver-Tutorial/assets/66748817/998669c2-d062-4ce0-a671-2917e84058ca)
24

3-
# The-Kernel-Driver-GUIDE.
5+
## Welcome to The Kernel Driver Guide!
46

5-
Kernal Driver Tutorial For Getting Started With Kernel Drivers
7+
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.
68

7-
# Hello
8-
Hello and welcome to this GUIDE, remember to read everything carefully to not make any mistakes.
9-
This is a simple guide for getting started with Kernel Drivers.
10-
This was created to make an easy follow along guide on creating a simple kernel driver for windows.
9+
---
1110

12-
# Prerequisites
11+
## Prerequisites
1312

14-
Before you begin, you will need to make sure you have the following:
13+
Before you begin, ensure that you have the following:
1514

16-
- A Windows machine with Secure Boot Disabled
17-
- Windows Machine With at least 4 GB RAM
15+
- A Windows machine with Secure Boot disabled
16+
- At least 4 GB RAM on your Windows machine
1817
- [Windows Redistributable](https://download.visualstudio.microsoft.com/download/pr/a061be25-c14a-489a-8c7c-bb72adfb3cab/4DFE83C91124CD542F4222FE2C396CABEAC617BB6F59BDCBDF89FD6F0DF0A32F/VC_redist.x64.exe)
1918
- [DirectX](https://download.microsoft.com/download/1/7/1/1718CCC4-6315-4D8E-9543-8E28A4E18C4C/dxwebsetup.exe)
2019

21-
# Disabling Secure Boot
22-
23-
- a. Restart your computer: Restart your computer and keep pressing the F2, F10, or Delete key (depending on your computer's manufacturer) until you enter the BIOS/UEFI settings.
24-
25-
- b. Locte The Seucre Boot Feature: Once you have entered the BIOS, look for a section called "Security" or "Trusted Platform Module (TPM)". The Secure Boot setting should be within this section. If not, search for you rspecific manufacturer of motherboard.
20+
### Disabling Secure Boot
2621

27-
- c. Save Settings: Once Secure Boot is disabled, save and exit BIOS and boot into windows.
22+
1. **Restart your computer:** Access the BIOS/UEFI settings by pressing F2, F10, or Delete (based on your computer's manufacturer).
23+
2. **Locate Secure Boot:** Find the Secure Boot setting in the "Security" or "Trusted Platform Module (TPM)" section.
24+
3. **Disable Secure Boot:** Save the settings and boot into Windows.
2825

29-
# Additional tips for disabling Secure Boot:
26+
#### Additional Tips for Disabling Secure Boot:
3027

3128
- Back up your data before disabling Secure Boot.
29+
- Disable Secure Boot only when necessary, such as running virtual machines or specific software.
30+
- Re-enable Secure Boot to protect your computer once done with the required tasks.
3231

33-
- Disable Secure Boot only when you need to run a virtual machine or other software that requires it.
34-
35-
- Once you have finished using the virtual machine or software that requires Secure Boot to be disabled, re-enable Secure Boot to protect your computer.
36-
37-
# Download and Setup
38-
39-
When we want to develop a kernel driver we first need to setup our Enviroment.
40-
We need to download a few requirements, which are listed down below:
41-
42-
* Tip1: Remember to install "WDK" after installing Visual Studio 2022 as WDK is an extension to VS22
43-
* Tip2: Remember to Install all Individual Components when installing Visual Studio 2022
44-
45-
Step 1: Install Visual Studio 2022 Link: https://visualstudio.microsoft.com/downloads/
46-
47-
Step 2: Install SDK Link: https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/
48-
49-
Step 3: Install WDK Link: https://learn.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk
50-
51-
- a1. Follow This Tutorial For Installing Windows Driver Kit if the tutorial above is outdated: https://learn.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk
52-
- a2. When installing components for Visual Studio 2022 need to select "Desktop development with C++" with these individual components:
53-
54-
- C++ ATL for latest v143 build tools with Spectre Mitigations (ARM64/ARM64EC)
55-
- C++ ATL for latest v143 build tools with Spectre Mitigations (x86 & x86)
56-
- C++ MFC for latest v143 build tools with Spectre Mitigations (ARM64/ARM64EC)
57-
- MSVC v143 - VS 2022 C++ ARM64/ARM64EC Spectre-mitigated libs (Latest)
58-
- MSVC v143 - VS 2022 C++ x64/x86 Spectre-mitigated libs (Latest)
59-
60-
- **Installing Debug View**
61-
- * Download Debug View from this direct link: https://download.sysinternals.com/files/DebugView.zip
62-
* Or go here: https://learn.microsoft.com/en-us/sysinternals/downloads/debugview
63-
64-
65-
# Visual Studio 2022 Project Setup
66-
- 1 Create a new kernel mode driver project in Visual Studio. ( Kernel Mode Driver, Empty (KMDF).
67-
68-
![9](https://github.com/CollinEdward/The-Kernel-Driver-Tutorial/assets/66748817/51d10f13-6859-4d0b-876c-084859c57651)
69-
32+
---
7033

34+
## Download and Setup
7135

36+
To develop a kernel driver, set up your environment by downloading the following requirements:
7237

73-
Right click on the project
74-
75-
![5](https://github.com/CollinEdward/The-Kernel-Driver-Tutorial/assets/66748817/5d1dd955-ca81-4faf-be77-d41adca4c1ec)
76-
77-
- 2 Activate "Use Local Time" and Enable Active(Release)
78-
79-
![6](https://github.com/CollinEdward/The-Kernel-Driver-Tutorial/assets/66748817/44acad7f-24b8-4fdd-b756-b9631a7b4f61)
38+
1. **Install Visual Studio 2022:** [Download Link](https://visualstudio.microsoft.com/downloads/)
39+
2. **Install Windows SDK:** [Download Link](https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/)
40+
3. **Install Windows Driver Kit (WDK):** [Download Link](https://learn.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk)
8041

81-
- 3 Navigate to "Linker" -> "Command Line" and write
42+
- Follow [this tutorial](https://learn.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk) if the above WDK link is outdated.
43+
- When installing components for Visual Studio 2022, select "Desktop development with C++" and specific individual components as listed in the guide.
8244

83-
"/INTEGRITYCHECK"
45+
#### Installing Debug View
8446

85-
- 4 Add A Class
47+
- Download Debug View: [Direct Link](https://download.sysinternals.com/files/DebugView.zip) or [Sysinternals Website](https://learn.microsoft.com/en-us/sysinternals/downloads/debugview)
8648

87-
Tip: Name this the same name as the project
88-
89-
Right Click on Properties -> Hover on Add -> Click On Class
90-
![8](https://github.com/CollinEdward/The-Kernel-Driver-Tutorial/assets/66748817/ec977ceb-d804-4473-9b13-9b9bbc453c77)
49+
---
9150

92-
93-
# Creating And Running The Driver ( Using Debug View )
51+
## Visual Studio 2022 Project Setup
9452

95-
- 2 Add a new header file named "messages.h" ( In the Header Files Folder ).
96-
- 3 Define a function called debug_message that takes a string and some extra parameters.
97-
![1](https://github.com/CollinEdward/The-Kernel-Driver-Tutorial/assets/66748817/b111f975-b64c-4655-86a2-99a4e0c8a54c)
53+
1. **Create a new kernel mode driver project:** Choose "Kernel Mode Driver, Empty (KMDF)" in Visual Studio.
54+
- Right-click on the project.
55+
- Activate "Use Local Time" and Enable Active(Release).
56+
- Navigate to "Linker" -> "Command Line" and add "/INTEGRITYCHECK".
57+
- Add a class with the same name as the project.
9858

99-
100-
- 4 Include the "messages.h" header file in your source file.
59+
---
10160

102-
![2](https://github.com/CollinEdward/The-Kernel-Driver-Tutorial/assets/66748817/84ad28b7-291d-4f9e-93b4-873f4d95e5e0)
61+
## Creating and Running the Driver (Using Debug View)
10362

104-
- 5.1 Create a function called driver_entry that takes a PDRIVER_OBJECT and a PUNICODE_STRING.
105-
- 5.2 Create a function called unload_driver that takes a PDRIVER_OBJECT.
106-
- 5.3 Call the debug_message function to print a message when the driver starts and stops.
107-
![3](https://github.com/CollinEdward/The-Kernel-Driver-Tutorial/assets/66748817/a4a6cdf2-47d2-48a5-8870-1c414499f0ea)
63+
1. **Add a new header file:** Name it "messages.h" in the Header Files folder.
64+
2. **Define a function:** Create a function called `debug_message` that takes a string and extra parameters.
65+
3. **Include the header file:** Add "messages.h" in your source file.
66+
4. **Create functions:**
67+
- `driver_entry` that takes a `PDRIVER_OBJECT` and a `PUNICODE_STRING`.
68+
- `unload_driver` that takes a `PDRIVER_OBJECT`.
69+
- Call `debug_message` to print a message when the driver starts and stops.
70+
5. **Compile the driver.**
10871

109-
- 8 Compile the driver.
72+
---
11073

111-
- 9 Set Kernal driver Bin Path using sc create command.
112-
tip: Assuming you have the project on C drive, just replace the "computer name" with your actual computer name, and "KernalReadWriteDriver.sys" With the name if your .sys file.
74+
## Setting Up Kernel Driver (Using `sc create` command)
11375

114-
sc create KernelReadWriteDriver type= Kernel Binpath="C:\Users\computer name\source\repos\KernelReadWriteDriver\x64\Release\KernelReadWriteDriver.sys"
115-
116-
- 10 Enable test signing
117-
Using the cmd enable testsigning with the following command:
76+
1. **Set Kernel driver Bin Path:** Use `sc create` command.
77+
- Replace "computer name" with your actual computer name and "KernelReadWriteDriver.sys" with your .sys file name.
11878

119-
bcdedit /set testsigning on
79+
```bash
80+
sc create KernelReadWriteDriver type= Kernel Binpath="C:\Users\computer name\source\repos\KernelReadWriteDriver\x64\Release\KernelReadWriteDriver.sys"
81+
```
12082

121-
- 11 Start DebugView in ADMIN mode
122-
123-
- 12 Enable Capture Kernel In Debug View
124-
![4](https://github.com/CollinEdward/The-Kernel-Driver-Tutorial/assets/66748817/e00cb8ac-d070-43bd-b964-d3837a1b289e)
83+
2. **Enable test signing:** Use the command:
84+
```bash
85+
bcdedit /set testsigning on
86+
```
12587

126-
- 13.1 Load the driver using the sc command.
127-
Without the quotation marks and with the name of your kernel driver
88+
3. **Start DebugView in ADMIN mode.**
89+
4. **Enable Capture Kernel In Debug View.**
12890

129-
sc start "kernel driver name"
91+
5. **Load the driver using the sc command:**
92+
```bash
93+
sc start "kernel driver name"
94+
```
13095

131-
- 13.2 If you get an error when trying to start
132-
If you get an error when trying to start the service, try to enter this in to ADMIN cmd and restart.
133-
134-
bcdedit /set nointegritychecks on
96+
6. **If you encounter an error:**
97+
- Run the following command in ADMIN cmd and restart:
98+
```bash
99+
bcdedit /set nointegritychecks on
100+
```
135101

136-
- 14 Stop the driver using the sc command.
137-
Without the quotation marks and with the name of your kernel driver
102+
7. **Stop the driver using the sc command:**
103+
```bash
104+
sc stop "kernel driver name"
105+
```
138106

139-
sc stop "kernel driver name"
107+
---
140108

109+
## Congratulations!
141110

142111
Congratulations on completing The-Kernel-Driver-Tutorial! You've successfully set up your development environment, disabled Secure Boot, and created a simple kernel driver for Windows.
143112
144-
# Cheat Table Content for Assaulted Cube Process
145113
---
146114
147-
- * Cheat Entries Can be found in this md [cheat-entries.md](cheat-entries.md) or from downloading the [assaultcube.CT](assaultcube.CT) file, and running with cheat engine whilst running the [game](https://github.com/assaultcube/AC/releases/tag/v1.3.0.2).
115+
## Cheat Table Content for Assaulted Cube Process
148116
149-
Honerable mention of resouces and explenation videos / good to know sources:
117+
- Cheat entries can be found in [cheat-entries.md](cheat-entries.md) or by downloading the [assaultcube.CT](assaultcube.CT) file. Run it with Cheat Engine while playing the [game](https://github.com/assaultcube/AC/releases/tag/v1.3.0.2).
150118
151-
https://www.youtube.com/watch?v=6TBQ7lWYQ0g
152-
153-
https://www.youtube.com/watch?v=EaxaQYESDlM
154-
155-
https://www.youtube.com/watch?v=KzD_nc5B_8w
119+
---
156120
157-
https://www.youtube.com/watch?v=eumG222Efzs
121+
## Honorable Mentions
158122
159-
https://www.youtube.com/watch?v=8oC0w6WhZ1E
123+
Special thanks to the following resources and explanation videos:
160124
125+
- [Video 1](https://www.youtube.com/watch?v=6TBQ7lWYQ0g)
126+
- [Video 2](https://www.youtube.com/watch?v=EaxaQYESDlM)
127+
- [Video 3](https://www.youtube.com/watch?v=KzD_nc5B_8w)
128+
- [Video 4](https://www.youtube.com/watch?v=eumG222Efzs)
129+
- [Video 5](https://www.youtube.com/watch?v=8oC0w6WhZ1E)

0 commit comments

Comments
 (0)