Rust reconstruction of closed-source Windows kernel drivers after reverse engineering, preserving WDM/KMDF architecture, ABI layouts, IOCTL contracts, IRQL, concurrency, PnP/power, and observable behavior. Use for reimplementing or porting a reversed .sys driver with windows-drivers-rs, wdk-build, wdk-sys, wdk, or cargo-wdk. Do NOT use for ordinary Rust applications or source-available driver refactors.
Produce an evidence-backed Rust implementation of a Windows driver that
matches the original driver's required external behavior. This is semantic
reconstruction, not decompiler-to-Rust translation.
Load reverse-engineering first when the binary has not yet been mapped. Load
windows-driver-0day when the goal is vulnerability discovery rather than
behavioral reconstruction. Use the repository's normal driver-development
workflow for new designs that do not require compatibility with a reversed
binary.
Non-Negotiable Gates
Evidence gate: No behavior is implemented solely from decompiler
pseudocode.
Architecture gate: Identify the driver model and stack role before
selecting Rust project structure or APIs.
ABI gate: Every shared, IOCTL, DMA, MMIO, persisted, and callback layout
has verified size, alignment, offsets, and architecture variants.
IRQL gate: No allocation, blocking call, pageable access, or lock is used
at an IRQL where it is invalid.
Ownership gate: Request, object, allocation, handle, and teardown
ownership are explicit.
Unsafe gate: Each unsafe block states the local invariant that makes it
valid; the invariant must come from WDK semantics and recovered evidence.
Parity gate: Required behavior is compared against the original under the
same workload and environment.
Uncertainty gate: An unverified fact cannot control an unsafe access,
public ABI, IRQL decision, lock protocol, or completion path.
Required Artifacts
case/
|-- provenance.md # Original hash, signer, INF/CAT, versions, systems
|-- evidence.csv # Observed/inferred/unverified claims and sources
|-- architecture.md # Driver model, stack role, object graph, entry paths
|-- callbacks.csv # ABI, IRQL, ownership, synchronization, teardown
|-- ioctls.csv # Codes, methods, access, schemas, status semantics
|-- state-machines.md # Handles, requests, cancellation, PnP, power
|-- abi/ # Rust assertions and same-WDK C layout oracle
|-- traces/original/ # Baseline workloads and debugger/ETW traces
|-- traces/rust/ # Matching traces from the reconstruction
|-- harness/ # Deterministic differential exerciser
|-- rust/ # Rust driver workspace
`-- parity.md # Differences, rationale, and completion results
Scale this layout down for small targets, but do not omit the evidence,
contract, and parity artifacts.
Phase 1: Establish the Baseline
Before coding:
Preserve the .sys, INF, CAT, installer, symbols, companion services/DLLs,
firmware, and representative hardware or VM state.
Record hashes, signer, PE architecture, OS builds, WDK/WDF versions,
service configuration, VBS/HVCI state, test-signing state, and hardware IDs.
Capture repeatable workloads for install, load, open, normal I/O, invalid
I/O, cancel, close, stop, remove, sleep/resume, unload, and reload.
Record exact statuses, output bytes and lengths, side effects, completion
order, timing requirements, and externally visible names/security settings.
The original binary is the behavioral oracle, not a source-code oracle.
Phase 2: Classify the Driver
Identify both model and role:
Legacy NT control driver, WDM, KMDF, UMDF, minifilter, NDIS, Storport,
AVStream, USB/class extension, or another framework.
Bus, function, upper filter, lower filter, control device, software-only
driver, or mixed role.
PnP-aware versus legacy loading, hardware resources, DMA, interrupts, MMIO,
firmware interaction, and lower-stack forwarding.
Do not automatically modernize WDM into KMDF. KMDF changes defaults for
serialization, forwarding, cancellation, object lifetime, PnP/power, and
callback IRQL. A framework migration requires a separately documented
compatibility argument.
If classification identifies UMDF or another user-mode component rather than a
kernel .sys implementation, stop applying the kernel-only Rust baseline in
this skill and switch to a user-mode reconstruction workflow.
Request retrieval, completion, cancellation, forwarding, reuse, and object
context types.
Never identify a KMDF API from a guessed WdfFunctions index. Generate or use
bindings for the exact WDF configuration and resolve the call through those
bindings.
Input/output buffer locations, minimum and maximum lengths, validation order,
and aliasing.
Exact success and failure statuses, status precedence, returned byte count,
partial-output behavior, and initialization guarantees.
Synchronous versus pending behavior, cancellation, timeout, completion
context, and callback ordering.
State changes, hardware effects, lower-stack requests, persistent effects,
and cleanup behavior.
x64, ARM64, and WOW64 variants where pointer width or alignment changes the
contract.
IOCTL Transfer Methods
Method
Contract to Recover
METHOD_BUFFERED
Shared SystemBuffer, input/output aliasing, initialization, and Information length
METHOD_IN_DIRECT
Header in SystemBuffer, MDL-backed secondary input, mapping and length behavior
METHOD_OUT_DIRECT
Header in SystemBuffer, MDL-backed output, writable length, and partial completion
METHOD_NEITHER
Raw user pointers, requestor mode, process context, capture timing, SEH, and double-fetch behavior
Also preserve IOCTL access bits, device ACLs, open requirements, internal versus
external controls, and request sequencing.
For METHOD_NEITHER, probe user addresses in the originating caller context,
guard each later user-memory access with kernel structured exception handling,
and capture data before asynchronous processing. A successful probe does not
make a later dereference safe and does not prevent a double fetch.
Phase 4: Recover Concurrency, IRQL, and Lifetime
Create an IRQL call graph and a lock-order table. For each callback record:
Possible IRQL, thread/process context, reentrancy, and serialization source.
Pageable versus nonpageable code/data.
Allocation type, ownership transfer, reference rules, and failure cleanup.
Locks held, lock ordering, atomic fields, waiting behavior, and callbacks made
while locked.
Cancellation race, cleanup/close interaction, surprise removal, power
transition, and unload constraints.
Model cancellation and PnP removal as state machines. A happy-path call graph
is not sufficient for a correct driver reconstruction.
Phase 5: Prove the ABI
Use generated wdk-sys types for Windows structures. For proprietary boundary
types:
Use #[repr(C)], fixed-width integers, explicit unions/newtypes, and only
evidenced packing.
Assert size_of, align_of, and every recovered field offset.
Compile a small C layout oracle with the same WDK, target architecture, and
packing settings, then compare its output with Rust assertions.
Treat C enums, flags, and bitfields as integer newtypes/constants when invalid
values are possible; an invalid Rust enum discriminant is undefined behavior.
Use repr(packed) only when packing is proven. Never create references to
unaligned packed fields; use unaligned reads/writes.
Parse flexible arrays and variable tails as checked byte ranges rather than
casting an entire user buffer to a struct.
Keep architecture-specific schemas separate where layouts differ.
Raw pointers are the default at FFI boundaries unless non-nullness, alignment,
aliasing, and lifetime are all proven.
Phase 6: Choose and Pin the Rust Toolchain
Consult the current official documentation before scaffolding because the Rust
WDK ecosystem changes quickly. Prefer the Microsoft windows-drivers-rs
project and pin the known-good Rust toolchain, WDK/eWDK, LLVM/libclang, crate
versions, target, generated bindings, and Cargo lockfile.
Treat windows-drivers-rs and its tooling as early-stage until current official
documentation says otherwise. Confirm supported targets, WDF versions, DDIs,
packaging, signing, HLK, and production-support requirements before adopting it
for a shipping driver.
Raw generated WDM/WDF FFI, structures, constants, callbacks, WDF dispatch
wdk
Select safe conveniences only where their guarantees match the recovered contract
wdk-alloc
Optional kernel allocator after IRQL and alignment constraints are verified
wdk-panic
Kernel panic handler; understand and test its failure behavior
cargo-wdk
Build/package integration after pinning and validating the version used
Expected baseline:
#![no_std] kernel crate.
Driver-compatible crate type and linker configuration from current official
samples.
panic = "abort"; no unwinding across FFI.
No unwrap, expect, panic-prone indexing, unchecked size arithmetic, or
infallible allocation assumptions on kernel request paths.
Do not assume every WDK DDI has a complete safe wrapper. Use wdk-sys where
needed and keep missing C-only facilities behind minimal, reviewed WDK shims.
Native kernel structured exception handling may require such a shim for
specific user-buffer paths.
Before using wdk-alloc, verify its current minimum Windows version, permitted
IRQL, and alignment behavior. Do not use it for over-aligned allocations unless
the selected version explicitly guarantees the required alignment.
Phase 7: Design the Safety Boundary
Keep entry points and callbacks as thin unsafe extern "system" adapters:
Windows/WDF callback
-> validate raw handles, pointers, lengths, mode, and state
-> capture or map data according to the exact transfer contract
-> convert to owned/validated domain values
-> call safe core state machine
-> serialize output and complete/forward exactly once
Organize by responsibility, not by guessed original source files:
rust/
|-- build.rs
|-- Cargo.toml
`-- src/
|-- lib.rs # Driver entry and exports
|-- ffi.rs # Thin WDK/WDF adapters and local invariants
|-- abi.rs # Boundary layouts and assertions
|-- device.rs # Per-device state and lifecycle
|-- file.rs # Per-handle state
|-- ioctl.rs # Parsing, validation, serialization
|-- pnp_power.rs # Explicit lifecycle state machines
`-- core.rs # Safe semantic behavior where practical
Keep the structure smaller when the target is small. Add a module only when it
creates a meaningful safety or ownership boundary.
Phase 8: Implement Vertical Slices
Implement one complete path at a time:
Ingress and prerequisites.
Boundary parsing and validation.
State transition or hardware operation.
Output/status serialization.
Completion, cancellation, and cleanup.
Unit, integration, and differential tests.
Do not scaffold every decompiled function with guessed bodies. Do not preserve
compiler thunks, inlining boundaries, stack temporaries, tail-call artifacts,
or security-cookie paths as application architecture.
Security defects and undefined behavior are not copied by default. If exact
bug compatibility is required, isolate it, document it, and test it as an
explicit compatibility decision.
Phase 9: Differential Verification
Run identical scripted workloads against the original and Rust drivers on
equivalent snapshots or hardware. Compare:
Pool, IRQL, I/O, lock, DMA, WDF, and teardown checks as applicable
Compatibility matrix
Required OS builds, architectures, VBS/HVCI states, hardware/firmware versions
Use WinDbg and targeted Driver Verifier settings. For KMDF, include WDF
Verifier and !wdfkd evidence. Broad verifier settings can distort timing, so
record exact settings and isolate the class being tested.
Completion Gate
Original driver behavior is captured by repeatable workloads.
Driver model, stack role, WDF version, and lifecycle are established.
External contracts include exact layouts, statuses, lengths, and timing.
ABI checks pass against the same-WDK C oracle.
IRQL, lock order, ownership, cancellation, and teardown are explicit.
unsafe is localized and each operation has a documented invariant.
Unit, ABI, property, differential, integration, stress, and applicable
Verifier tests pass.
Required OS/architecture/hardware matrix is tested.
Intentional differences and unresolved uncertainty are documented.
Packaging, signing, deployment, and production certification requirements
are verified for the intended use.
1---2name: rust-driver-reconstruction3description: Rust reconstruction of closed-source Windows kernel drivers after reverse engineering, preserving WDM/KMDF architecture, ABI layouts, IOCTL contracts, IRQL, concurrency, PnP/power, and observable behavior. Use for reimplementing or porting a reversed .sys driver with windows-drivers-rs, wdk-build, wdk-sys, wdk, or cargo-wdk. Do NOT use for ordinary Rust applications or source-available driver refactors.4---56# Rust Driver Reconstruction78## Objective910Produce an evidence-backed Rust implementation of a Windows driver that11matches the original driver's required external behavior. This is semantic12reconstruction, not decompiler-to-Rust translation.1314Load `reverse-engineering` first when the binary has not yet been mapped. Load15`windows-driver-0day` when the goal is vulnerability discovery rather than16behavioral reconstruction. Use the repository's normal driver-development17workflow for new designs that do not require compatibility with a reversed18binary.1920## Non-Negotiable Gates2122- **Evidence gate:** No behavior is implemented solely from decompiler23 pseudocode.24- **Architecture gate:** Identify the driver model and stack role before25 selecting Rust project structure or APIs.26- **ABI gate:** Every shared, IOCTL, DMA, MMIO, persisted, and callback layout27 has verified size, alignment, offsets, and architecture variants.28- **IRQL gate:** No allocation, blocking call, pageable access, or lock is used29 at an IRQL where it is invalid.30- **Ownership gate:** Request, object, allocation, handle, and teardown31 ownership are explicit.32- **Unsafe gate:** Each `unsafe` block states the local invariant that makes it33 valid; the invariant must come from WDK semantics and recovered evidence.34- **Parity gate:** Required behavior is compared against the original under the35 same workload and environment.36- **Uncertainty gate:** An `unverified` fact cannot control an unsafe access,37 public ABI, IRQL decision, lock protocol, or completion path.3839## Required Artifacts4041```text42case/43|-- provenance.md # Original hash, signer, INF/CAT, versions, systems44|-- evidence.csv # Observed/inferred/unverified claims and sources45|-- architecture.md # Driver model, stack role, object graph, entry paths46|-- callbacks.csv # ABI, IRQL, ownership, synchronization, teardown47|-- ioctls.csv # Codes, methods, access, schemas, status semantics48|-- state-machines.md # Handles, requests, cancellation, PnP, power49|-- abi/ # Rust assertions and same-WDK C layout oracle50|-- traces/original/ # Baseline workloads and debugger/ETW traces51|-- traces/rust/ # Matching traces from the reconstruction52|-- harness/ # Deterministic differential exerciser53|-- rust/ # Rust driver workspace54`-- parity.md # Differences, rationale, and completion results55```5657Scale this layout down for small targets, but do not omit the evidence,58contract, and parity artifacts.5960## Phase 1: Establish the Baseline6162Before coding:63641. Preserve the `.sys`, INF, CAT, installer, symbols, companion services/DLLs,65 firmware, and representative hardware or VM state.662. Record hashes, signer, PE architecture, OS builds, WDK/WDF versions,67 service configuration, VBS/HVCI state, test-signing state, and hardware IDs.683. Capture repeatable workloads for install, load, open, normal I/O, invalid69 I/O, cancel, close, stop, remove, sleep/resume, unload, and reload.704. Record exact statuses, output bytes and lengths, side effects, completion71 order, timing requirements, and externally visible names/security settings.7273The original binary is the behavioral oracle, not a source-code oracle.7475## Phase 2: Classify the Driver7677Identify both model and role:7879- Legacy NT control driver, WDM, KMDF, UMDF, minifilter, NDIS, Storport,80 AVStream, USB/class extension, or another framework.81- Bus, function, upper filter, lower filter, control device, software-only82 driver, or mixed role.83- PnP-aware versus legacy loading, hardware resources, DMA, interrupts, MMIO,84 firmware interaction, and lower-stack forwarding.8586Do not automatically modernize WDM into KMDF. KMDF changes defaults for87serialization, forwarding, cancellation, object lifetime, PnP/power, and88callback IRQL. A framework migration requires a separately documented89compatibility argument.9091If classification identifies UMDF or another user-mode component rather than a92kernel `.sys` implementation, stop applying the kernel-only Rust baseline in93this skill and switch to a user-mode reconstruction workflow.9495### WDM Recovery Focus9697- `DriverEntry`, `DriverUnload`, `DriverExtension->AddDevice`.98- `MajorFunction[]`, minor functions, completion and cancel routines.99- Pending propagation, remove locks, stack forwarding, detach/delete order.100- Device/file extensions, spin locks, events, DPCs, timers, work items,101 interrupts, and reference counts.102103### KMDF Recovery Focus104105- `WdfDriverCreate`, device creation, queue topology, file-object setup, and106 callback registrations.107- Queue dispatch mode, synchronization scope, execution level, automatic108 serialization, parent-child ownership, and cleanup/destroy callbacks.109- Request retrieval, completion, cancellation, forwarding, reuse, and object110 context types.111112Never identify a KMDF API from a guessed `WdfFunctions` index. Generate or use113bindings for the exact WDF configuration and resolve the call through those114bindings.115116## Phase 3: Specify Observable Contracts117118For every ingress path, document:119120- Preconditions, required handle access, caller mode, security context, and121 device state.122- Input/output buffer locations, minimum and maximum lengths, validation order,123 and aliasing.124- Exact success and failure statuses, status precedence, returned byte count,125 partial-output behavior, and initialization guarantees.126- Synchronous versus pending behavior, cancellation, timeout, completion127 context, and callback ordering.128- State changes, hardware effects, lower-stack requests, persistent effects,129 and cleanup behavior.130- x64, ARM64, and WOW64 variants where pointer width or alignment changes the131 contract.132133### IOCTL Transfer Methods134135| Method | Contract to Recover |136|---|---|137| `METHOD_BUFFERED` | Shared `SystemBuffer`, input/output aliasing, initialization, and `Information` length |138| `METHOD_IN_DIRECT` | Header in `SystemBuffer`, MDL-backed secondary input, mapping and length behavior |139| `METHOD_OUT_DIRECT` | Header in `SystemBuffer`, MDL-backed output, writable length, and partial completion |140| `METHOD_NEITHER` | Raw user pointers, requestor mode, process context, capture timing, SEH, and double-fetch behavior |141142Also preserve IOCTL access bits, device ACLs, open requirements, internal versus143external controls, and request sequencing.144145For `METHOD_NEITHER`, probe user addresses in the originating caller context,146guard each later user-memory access with kernel structured exception handling,147and capture data before asynchronous processing. A successful probe does not148make a later dereference safe and does not prevent a double fetch.149150## Phase 4: Recover Concurrency, IRQL, and Lifetime151152Create an IRQL call graph and a lock-order table. For each callback record:153154- Possible IRQL, thread/process context, reentrancy, and serialization source.155- Pageable versus nonpageable code/data.156- Allocation type, ownership transfer, reference rules, and failure cleanup.157- Locks held, lock ordering, atomic fields, waiting behavior, and callbacks made158 while locked.159- Cancellation race, cleanup/close interaction, surprise removal, power160 transition, and unload constraints.161162Model cancellation and PnP removal as state machines. A happy-path call graph163is not sufficient for a correct driver reconstruction.164165## Phase 5: Prove the ABI166167Use generated `wdk-sys` types for Windows structures. For proprietary boundary168types:169170- Use `#[repr(C)]`, fixed-width integers, explicit unions/newtypes, and only171 evidenced packing.172- Assert `size_of`, `align_of`, and every recovered field offset.173- Compile a small C layout oracle with the same WDK, target architecture, and174 packing settings, then compare its output with Rust assertions.175- Treat C enums, flags, and bitfields as integer newtypes/constants when invalid176 values are possible; an invalid Rust enum discriminant is undefined behavior.177- Use `repr(packed)` only when packing is proven. Never create references to178 unaligned packed fields; use unaligned reads/writes.179- Parse flexible arrays and variable tails as checked byte ranges rather than180 casting an entire user buffer to a struct.181- Keep architecture-specific schemas separate where layouts differ.182183Raw pointers are the default at FFI boundaries unless non-nullness, alignment,184aliasing, and lifetime are all proven.185186## Phase 6: Choose and Pin the Rust Toolchain187188Consult the current official documentation before scaffolding because the Rust189WDK ecosystem changes quickly. Prefer the Microsoft `windows-drivers-rs`190project and pin the known-good Rust toolchain, WDK/eWDK, LLVM/libclang, crate191versions, target, generated bindings, and Cargo lockfile.192193Treat `windows-drivers-rs` and its tooling as early-stage until current official194documentation says otherwise. Confirm supported targets, WDF versions, DDIs,195packaging, signing, HLK, and production-support requirements before adopting it196for a shipping driver.197198Typical crate roles:199200| Crate/tool | Role |201|---|---|202| `wdk-build` | `build.rs`, WDK discovery, bindings/link configuration, driver metadata |203| `wdk-sys` | Raw generated WDM/WDF FFI, structures, constants, callbacks, WDF dispatch |204| `wdk` | Select safe conveniences only where their guarantees match the recovered contract |205| `wdk-alloc` | Optional kernel allocator after IRQL and alignment constraints are verified |206| `wdk-panic` | Kernel panic handler; understand and test its failure behavior |207| `cargo-wdk` | Build/package integration after pinning and validating the version used |208209Expected baseline:210211- `#![no_std]` kernel crate.212- Driver-compatible crate type and linker configuration from current official213 samples.214- `panic = "abort"`; no unwinding across FFI.215- No `unwrap`, `expect`, panic-prone indexing, unchecked size arithmetic, or216 infallible allocation assumptions on kernel request paths.217218Do not assume every WDK DDI has a complete safe wrapper. Use `wdk-sys` where219needed and keep missing C-only facilities behind minimal, reviewed WDK shims.220Native kernel structured exception handling may require such a shim for221specific user-buffer paths.222223Before using `wdk-alloc`, verify its current minimum Windows version, permitted224IRQL, and alignment behavior. Do not use it for over-aligned allocations unless225the selected version explicitly guarantees the required alignment.226227## Phase 7: Design the Safety Boundary228229Keep entry points and callbacks as thin `unsafe extern "system"` adapters:230231```text232Windows/WDF callback233 -> validate raw handles, pointers, lengths, mode, and state234 -> capture or map data according to the exact transfer contract235 -> convert to owned/validated domain values236 -> call safe core state machine237 -> serialize output and complete/forward exactly once238```239240Organize by responsibility, not by guessed original source files:241242```text243rust/244|-- build.rs245|-- Cargo.toml246`-- src/247 |-- lib.rs # Driver entry and exports248 |-- ffi.rs # Thin WDK/WDF adapters and local invariants249 |-- abi.rs # Boundary layouts and assertions250 |-- device.rs # Per-device state and lifecycle251 |-- file.rs # Per-handle state252 |-- ioctl.rs # Parsing, validation, serialization253 |-- pnp_power.rs # Explicit lifecycle state machines254 `-- core.rs # Safe semantic behavior where practical255```256257Keep the structure smaller when the target is small. Add a module only when it258creates a meaningful safety or ownership boundary.259260## Phase 8: Implement Vertical Slices261262Implement one complete path at a time:2632641. Ingress and prerequisites.2652. Boundary parsing and validation.2663. State transition or hardware operation.2674. Output/status serialization.2685. Completion, cancellation, and cleanup.2696. Unit, integration, and differential tests.270271Do not scaffold every decompiled function with guessed bodies. Do not preserve272compiler thunks, inlining boundaries, stack temporaries, tail-call artifacts,273or security-cookie paths as application architecture.274275Security defects and undefined behavior are not copied by default. If exact276bug compatibility is required, isolate it, document it, and test it as an277explicit compatibility decision.278279## Phase 9: Differential Verification280281Run identical scripted workloads against the original and Rust drivers on282equivalent snapshots or hardware. Compare:283284- Installation, device/interface names, ACLs, open/share/access behavior.285- Status values, status precedence, output length and bytes.286- Side effects, state transitions, hardware/firmware interactions.287- Pending/completion behavior, callback order, cancellation, and timing bounds.288- Multiple handles, malformed requests, low resources, repeated load/unload.289- PnP start/stop/remove/surprise-remove and sleep/resume where applicable.290291Record intentional differences and their rationale in `parity.md`. A single292successful IOCTL is not parity.293294## Test Ladder295296| Level | Required Evidence |297|---|---|298| Host unit tests | Pure parsers, checked arithmetic, serialization, state machines, status mapping |299| ABI tests | Compile-time Rust assertions plus same-WDK C layout oracle |300| Property/fuzz tests | Variable tails, offsets/counts, malformed records, parser/serializer round trips |301| Differential tests | Original versus Rust outputs, statuses, side effects, and ordering |302| VM integration | Install/load/open/I/O/cancel/unload and interface/security behavior |303| Stress tests | Parallel handles, cancellation/close races, low resources, repeated lifecycle transitions |304| Verifier tests | Pool, IRQL, I/O, lock, DMA, WDF, and teardown checks as applicable |305| Compatibility matrix | Required OS builds, architectures, VBS/HVCI states, hardware/firmware versions |306307Use WinDbg and targeted Driver Verifier settings. For KMDF, include WDF308Verifier and `!wdfkd` evidence. Broad verifier settings can distort timing, so309record exact settings and isolate the class being tested.310311## Completion Gate312313- [ ] Original driver behavior is captured by repeatable workloads.314- [ ] Driver model, stack role, WDF version, and lifecycle are established.315- [ ] External contracts include exact layouts, statuses, lengths, and timing.316- [ ] ABI checks pass against the same-WDK C oracle.317- [ ] IRQL, lock order, ownership, cancellation, and teardown are explicit.318- [ ] `unsafe` is localized and each operation has a documented invariant.319- [ ] Unit, ABI, property, differential, integration, stress, and applicable320 Verifier tests pass.321- [ ] Required OS/architecture/hardware matrix is tested.322- [ ] Intentional differences and unresolved uncertainty are documented.323- [ ] Packaging, signing, deployment, and production certification requirements324 are verified for the intended use.325326## Primary References327328- https://github.com/microsoft/windows-drivers-rs329- https://github.com/microsoft/Windows-rust-driver-samples330- https://learn.microsoft.com/windows-hardware/drivers/kernel/defining-i-o-control-codes331- https://learn.microsoft.com/windows-hardware/drivers/kernel/managing-hardware-priorities332- https://learn.microsoft.com/windows-hardware/drivers/kernel/handling-exceptions333- https://learn.microsoft.com/windows-hardware/drivers/wdf/using-automatic-synchronization334- https://learn.microsoft.com/windows-hardware/drivers/wdf/framework-object-life-cycle335- https://doc.rust-lang.org/reference/type-layout.html
Run npx skillmds@latest add netvar1337/rust-driver-reconstruction in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Rust reconstruction of closed-source Windows kernel drivers after reverse engineering, preserving WDM/KMDF architecture, ABI layouts, IOCTL contracts, IRQL, concurrency, PnP/power, and observable behavior. Use for reimplementing or porting a reversed .sys driver with windows-drivers-rs, wdk-build, wdk-sys, wdk, or cargo-wdk. Do NOT use for ordinary Rust applications or source-available driver refactors. It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
netvar1337 (@netvar1337) published this skill. Their other Agent Skills are listed on their SkillMD profile.