# s12cybersecurity/windefenderkiller architecture

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

- Interactive diagram: https://gitdiagram.com/s12cybersecurity/windefenderkiller
- Repository: https://github.com/s12cybersecurity/windefenderkiller

## Overview

##### Project type and purpose
- This is a small native C++ utility whose sole purpose is to disable (and re-enable) Windows Defender by writing specific keys into the Windows Registry.
- It is not a multi-tier web app or microservice; rather, it is a single executable CLI tool that interacts directly with the OS.

##### File structure
- Top-level files:
- disableWinDef.cpp   → source for the “disable” binary
- reverseDisableWinDef.cpp → source for the “re-enable” binary
- winDefKiller.exe, RevWinDefKiller.exe → compiled executables
- README.md                → project description and build instructions
- No subdirectories, no external services or libraries beyond the standard C++ runtime and OS registry API.

##### README for additional insights
- Confirms usage of MinGW-w64 to compile a static C++ binary.
- The binary uses Windows API calls to modify registry keys under HKLM\SOFTWARE\Policies\Microsoft\Windows Defender (and related branches).
- No database, network, or UI components—pure command-line, registry manipulation.

a. Main components
- CLI Application (“WinDefenderKiller” binary)
- Windows Registry (target hive and keys)
- Windows Defender Service (reads policy on startup)
- Windows OS kernel and API layer (regulates registry calls)
b. Relationships and interactions
- The CLI App makes Windows API calls (RegOpenKeyEx, RegSetValueEx, etc.) → writes to Registry.
- Registry changes take effect when the Defender service reads its configuration (on restart or policy refresh).
- Defender service then disables its real-time protection engine.
c. Architectural patterns / design principles
- Single responsibility: one tool, one job.
- Direct system call: no abstraction layers, purely native OS API.
- Static linking for portability.
d. Relevant technologies
- C++ (compiled with x86_64-w64-mingw32-g++)
- Windows Registry API
- Windows Defender service (built-in OS component)

##### Detailed guidance
- That Defender only re-reads policies on reboot or service restart.
- Registry hive paths altered (HKLM\…\Windows Defender\DisableAntiSpyware).

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "CLI Tools"
        SRC1["disableWinDef.cpp"]:::userland
        BIN1["winDefKiller.exe\n(static C++ runtime)"]:::userland
        SRC2["reverseDisableWinDef.cpp"]:::userland
        BIN2["RevWinDefKiller.exe\n(static C++ runtime)"]:::userland
    end

    API["Windows OS Kernel/API Layer"]:::os
    REG["Windows Registry\n(HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\DisableAntiSpyware)"]:::os
    WD["Windows Defender Service\n(Real-time Protection)"]:::service
    DOC["README.md"]:::userland

    SRC1 -->|"compile"| BIN1
    SRC2 -->|"compile"| BIN2
    BIN1 -->|"RegOpenKeyEx / RegSetValueEx"| API
    BIN2 -->|"RegOpenKeyEx / RegSetValueEx"| API
    API -->|"Modify Keys"| REG
    REG -->|"Policy Refresh on Reboot/Restart"| WD

    click SRC1 "https://github.com/s12cybersecurity/windefenderkiller/blob/main/disableWinDef.cpp"
    click BIN1 "https://github.com/s12cybersecurity/windefenderkiller/blob/main/winDefKiller.exe"
    click SRC2 "https://github.com/s12cybersecurity/windefenderkiller/blob/main/reverseDisableWinDef.cpp"
    click BIN2 "https://github.com/s12cybersecurity/windefenderkiller/blob/main/RevWinDefKiller.exe"
    click DOC "https://github.com/s12cybersecurity/windefenderkiller/blob/main/README.md"

    classDef userland fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef os fill:#FFA500,stroke:#333,stroke-width:1px
    classDef service fill:#FF6347,stroke:#333,stroke-width:1px
```
