# razvanmf/ranskril architecture

> Architecture diagram of the GitHub repository razvanmf/ranskril, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/razvanmf/ranskril
- Repository: https://github.com/razvanmf/ranskril

## Overview

##### Project type and purpose
- This is a multi‐layered security solution for real‐time ransomware detection and protection.
- It consists of a kernel‐mode minifilter driver (K_DecoyMon), a user‐mode service/“mainframe” controller (RANskril_Mainframe), and a Windows GUI front end (RANskril_GUI).

##### File structure
- Top‐level solution (bachelor_thesis_solution.sln) includes three projects:
- K_DecoyMon (Windows Driver, C++)
- RANskril_Mainframe (User‐mode service, C++)
- RANskril_GUI (UWP/WPF desktop client, C# MVVM)
- K_DecoyMon contains minifilter callbacks, decoy resource managers, hash tables.
- RANskril_Mainframe implements detection handlers (filesystem, registry, threads), a kernel communicator, logging, and helper binaries (explorer_helper.exe, foreground_helper.exe).
- RANskril_GUI follows MVVM: Pages/Views, ViewModels, Models; Middleware for Named Pipes and ETW tracing.

##### README
- Confirms: “Real‐Time, Kernel‐Based Ransomware Detection & Protection Solution.”

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Kernel Mode Layer"
        KMDriver["Minifilter Driver (K_DecoyMon)"]:::kernel
        DRM["Decoy Resource Manager"]:::kernel
    end

    subgraph "User Mode Service Layer"
        KC["KernelCommunicator\n(DeviceIoControl)"]:::service
        DH["Detection Handlers\n(filesystem, registry, threads)"]:::service
        LOG["Logger Module"]:::service
        HP1["explorer_helper.exe"]:::external
        HP2["foreground_helper.exe"]:::external
    end

    subgraph "Presentation Layer"
        ETWK["KernelEtwTrace Listener"]:::gui
        ETWS["ServiceEtwTrace Listener"]:::gui
        NP1["SenderPipe"]:::gui
        NP2["VerdictPipeListener"]:::gui
        NP3["StatusPingPipe"]:::gui
        MVVM["MVVM Components\n(Models, ViewModels, Views)"]:::gui
    end

    KMDriver -->|"DeviceIoControl: decoy alert"| KC
    KC -->|"spawns"| HP1
    KC -->|"spawns"| HP2
    KC -->|"commands/status"| MVVM
    MVVM -->|"requests"| KC
    KC -->|"logs events"| LOG
    KC -->|"writes trace events"| ETWS
    KMDriver -->|"writes ETW events"| ETWK
    ETWK -->|"reads kernel events"| MVVM
    ETWS -->|"reads service events"| MVVM

    click KMDriver "https://github.com/razvanmf/ranskril/tree/main/K_DecoyMon/"
    click KMDriver "https://github.com/razvanmf/ranskril/blob/main/K_DecoyMon/driver.cpp"
    click KMDriver "https://github.com/razvanmf/ranskril/blob/main/K_DecoyMon/minifilter.cpp"
    click DRM "https://github.com/razvanmf/ranskril/blob/main/K_DecoyMon/UNICODE_STRING_HASH_TABLE.h"
    click DRM "https://github.com/razvanmf/ranskril/blob/main/K_DecoyMon/UNICODE_STRING_ITERABLE_LIST.h"
    click DRM "https://github.com/razvanmf/ranskril/blob/main/K_DecoyMon/STRUCT_ERESOURCE.cpp"
    click DRM "https://github.com/razvanmf/ranskril/blob/main/K_DecoyMon/decoymon_public.h"

    click KC "https://github.com/razvanmf/ranskril/blob/main/RANskril_Mainframe/kernelcommunicator.cpp"
    click DH "https://github.com/razvanmf/ranskril/blob/main/RANskril_Mainframe/decoyhandlerv2.cpp"
    click DH "https://github.com/razvanmf/ranskril/blob/main/RANskril_Mainframe/registryhandlerv2.cpp"
    click DH "https://github.com/razvanmf/ranskril/blob/main/RANskril_Mainframe/threadheads.cpp"
    click LOG "https://github.com/razvanmf/ranskril/blob/main/RANskril_Mainframe/logger.cpp"
    click HP1 "https://github.com/razvanmf/ranskril/blob/main/RANskril_Mainframe/helpers/explorer_helper.exe"
    click HP2 "https://github.com/razvanmf/ranskril/blob/main/RANskril_Mainframe/helpers/foreground_helper.exe"

    click MVVM "https://github.com/razvanmf/ranskril/blob/main/RANskril_GUI/ViewModel/HomeViewModel.cs"
    click MVVM "https://github.com/razvanmf/ranskril/blob/main/RANskril_GUI/Models/DecoyPageState.cs"
    click MVVM "https://github.com/razvanmf/ranskril/blob/main/RANskril_GUI/Pages/HomePage.xaml"
    click MVVM "https://github.com/razvanmf/ranskril/blob/main/RANskril_GUI/App.xaml"
    click NP1 "https://github.com/razvanmf/ranskril/blob/main/RANskril_GUI/Middleware/SenderPipe.cs"
    click NP2 "https://github.com/razvanmf/ranskril/blob/main/RANskril_GUI/Middleware/VerdictPipeListener.cs"
    click NP3 "https://github.com/razvanmf/ranskril/blob/main/RANskril_GUI/Middleware/StatusPingPipe.cs"
    click ETWK "https://github.com/razvanmf/ranskril/blob/main/RANskril_GUI/Middleware/KernelEtwTrace.cs"
    click ETWS "https://github.com/razvanmf/ranskril/blob/main/RANskril_GUI/Middleware/ServiceEtwTrace.cs"

    classDef kernel fill:#faa,stroke:#800,color:#600
    classDef service fill:#aaf,stroke:#008,color:#005
    classDef gui fill:#afa,stroke:#080,color:#050
    classDef external fill:#ccc,stroke:#666,color:#333
```
