Three-Tier Architecture

RnW-Drv uses a layered design that separates kernel access from user interface through a well-defined API:

┌─────────────────┐
│  Python GUI     │  User interface with tkinter
│  (frontend.py)  │  Handles user interactions
└────────┬────────┘
         │ HTTP API (localhost:8080)
         ▼
┌─────────────────┐
│  Backend Server │  C++ HTTP server
│  (backend.cpp) │  Bridges user/kernel
└────────┬────────┘
         │ IOCTL
         ▼
┌─────────────────┐
│  RnW-Drv        │  Kernel driver
│  (kernel)       │  Memory R/W operations
└─────────────────┘

Layer 1: Kernel Driver

The kernel driver provides primitive memory operations:

Driver Design

Unlike stealth-focused drivers, RnW-Drv is designed for usability:

Layer 2: Backend Server

The C++ backend bridges the kernel driver to HTTP:

HTTP API

EndpointMethodDescription
/processesGETList all processes
/attachPOSTAttach to process by PID/name
/readPOSTRead memory at address
/writePOSTWrite value to address
/statusGETServer/driver status

Example Request

POST /read
{
  "pid": 1234,
  "address": "0x7FF6A0000000",
  "type": "int32"
}

Response:
{
  "value": 12345,
  "success": true
}
Using HTTP as the inter-process protocol makes the system language-agnostic. The Python frontend could be replaced with a web UI, mobile app, or automation scripts without changing the kernel driver.

Layer 3: Python Frontend

The GUI provides a user-friendly interface built with tkinter:

Features

Data Types Supported

Why This Architecture?

Separation of Concerns

Each layer has a single responsibility:

Language Flexibility

The HTTP API allows the frontend to be rewritten in any language without touching kernel code. This is valuable for:

Safety

The backend can implement additional validations before passing requests to the kernel:

Comparison to Direct Driver Access

AspectDirect DriverRnW-Drv System
SpeedFastestFast
SafetyLowMedium
Ease of UseHardEasy
FlexibilityLimitedHigh
Remote AccessNoPossible

Building and Running

Driver

# Build with WDK
cd RnW-Drv
# Open in Visual Studio with WDK, build Release|x64

# Load with kdmapper
kdmapper.exe RnW-Drv.sys

Backend

# Compile backend
cd Standard/Usermode
cl backend_server_simple.cpp ws2_32.lib

# Run
backend_server_simple.exe

Frontend

# Install dependencies
pip install requests

# Run
python frontend.py

What I Learned

This project taught me about designing APIs that cross privilege boundaries. The HTTP layer seems like overhead but provides valuable abstraction: the kernel driver stays simple while the backend handles complexity like session management and request validation.

The multi-language approach (C++ driver, C++ server, Python client) is more maintainable than a monolithic C++ solution. Each language is used where it excels: C++ for kernel/driver code, Python for UI.

Use Cases