Build the Project
This project is a kernel driver that provides functionality for [insert purpose here].
Before building and installing the driver, make sure you have the following:
To set up the environment variables for the WDK, follow these steps:
call "C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\setenv.bat" x64
To build the project, run the following command:
cargo build --release
To create a signing certificate for your application, you can use the following steps:
-
Open a command prompt and navigate to the directory where you want to generate the certificate.
-
Run the following command to generate a self-signed certificate:
makecert -r -pe -n "CN=Your Certificate Name" -ss My -sr LocalMachine -a sha256 -sky signature -cy end -sv MyCertificate.pvk MyCertificate.cer
This command will generate a private key file (`MyCertificate.pvk`) and a certificate file (`MyCertificate.cer`).
- Import the certificate into the certificate store by running the following command:
certutil -addstore My MyCertificate.cer
This will import the certificate into the "Personal" certificate store.
- Export the certificate with the private key by running the following command:
pvk2pfx -pvk MyCertificate.pvk -spc MyCertificate.cer -pfx MyCertificate.pfx
This will generate a PFX file (`MyCertificate.pfx`) that contains both the private key and the certificate.
- You can now use the generated certificate (
MyCertificate.pfx
) to sign your driver using thesigntool
utility as mentioned in the previous section.
Remember to keep the private key file (MyCertificate.pvk
) and the PFX file (MyCertificate.pfx
) secure.
For more information on certificate generation and management, refer to the Microsoft documentation.
To install the driver on modern Windows systems, it must be signed. Follow these steps:
- Obtain a code-signing certificate.
- Use the signtool utility provided by the WDK to sign your driver:
signtool sign /v /s My /n "Your Certificate Name" /t http://timestamp.verisign.com/scripts/timestamp.dll path\to\your\driver.sys
To install the driver, follow these steps:
- Use
sc
to create a new service for your driver:
sc create kernel_driver type= kernel binPath= path\to\your\driver.sys
- Start the driver service:
sc start kernel_driver
For more information, refer to the WDK documentation.