Skip to content

pravic/winapi-kmd-rs

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
April 12, 2016 16:39
April 12, 2016 21:50
April 18, 2016 11:52

Windows Kernel-Mode Drivers written in Rust

Join the chat at https://gitter.im/pravic/winapi-kmd-rs

This library is just a proof-of-concept of the windows kernel-mode drivers, which can be written in Rust programming language.

It contains the types, constants and bindings for the Windows Driver Kit with target OS starting from Windows XP (x86/x64).

Getting started

To compile you need the following:

  • Nightly Rust with MSVC ABI starting from 2016-04-12 (?), which supports "is-like-msvc" target flavor.
  • MSVC itself, either VS 2015 or just MSVC Build Tools.
  • Rust environment for the Windows drivers: kmd-env-rs.

As workaround you can compile drivers as #[crate_type="staticlib"] and link them manually (see examples/03.urandom/build.cmd).

Setting up:

git clone https://github.com/pravic/kmd-env-rs .
git submodule init
git submodule update --recursive

Set the nightly-msvc Rust toolchain for this repository:

rustup override add nightly-i686-msvc

Try to compile example:

cd km\examples\01.minimal\
cargo build --release

By default, it compiles to x86 mode. If you need x64, either change kmd-env-rs/.cargo/config as following:

[build]
target = "x86_64-sys-windows-msvc"
...

or use RUST_TARGET_PATH:

set RUST_TARGET_PATH=C:/path/to/kmd-env-rs/.cargo`
cargo build --release --target i686-sys-windows-msvc
cargo build --release --target x86_64-sys-windows-msvc

Examples

See examples folder with a driver samples and screenshots.

Reference documentation.

Acknowledges

In memory of Four-F - the author of tutorials about kernel mode drivers development in assembly language (2002-2005).

About

Windows Kernel-Mode Drivers written in Rust

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages