# ph33nx/winmasterblocker architecture

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

- Interactive diagram: https://gitdiagram.com/ph33nx/winmasterblocker
- Repository: https://github.com/ph33nx/winmasterblocker

## Overview

##### Project type and purpose
- This is an open-source Windows CLI tool consisting of a single batch script (WinMasterBlocker.bat) that automates adding/removing Windows Firewall rules (via netsh) to block “phone-home” behavior for various vendor applications (Adobe, Corel, Autodesk, Maxon, etc.). There are no external dependencies—only built-in Windows commands.

##### File structure
- Top level:
- README.md – project description, usage, contribution guide
- WinMasterBlocker.bat – the only source file containing:
– An array of vendor names (`vendors[]`)
– An array of install paths (`paths[]`)
– CLI menu logic (block inbound/outbound/both, remove rules)
– netsh calls to add/remove firewall rules

##### README for additional insights
- It outlines the features (block/unblock, menu options), implementation detail (uses netsh only), and contribution workflow (fork, clone, branch, edit arrays, PR).

a. Main components
1. Administrator/User (invokes the script)
2. WinMasterBlocker.bat (batch script)
3. Configuration arrays (vendors[] & paths[]) inside the script
4. netsh CLI (Windows firewall command-line tool)
5. Windows Firewall Subsystem (OS component applying rules)
6. Target Applications (executables at configured paths)
7. (Optional) GitHub repository for contributions

b. Relationships and interactions
- The Administrator/User launches the batch script with elevated privileges.
- The script reads its internal arrays (vendors & paths), presents a menu, and based on user choice, formulates `netsh advfirewall firewall add rule` or `delete rule` commands.
- The script invokes netsh CLI calls.
- netsh communicates with the Windows Firewall subsystem, which updates rule sets at the OS kernel level.
- The new rules prevent network traffic for the target application executables.
- For contributions: a developer forks the GitHub repo, clones, edits arrays in the .bat file, and submits a PR.

c. Architectural patterns or principles
- Single responsibility: one script performs configuration, presentation (CLI menu), and invocation.
- Layered interaction: CLI → netsh → Firewall API → OS kernel.
- Extensibility point: the `vendors[]` & `paths[]` arrays can be extended by contributors.

d. Relevant technologies/frameworks
- Windows Batch scripting (cmd.exe)
- netsh (built-in firewall CLI)
- Git/GitHub for version control and contributions

##### Detail
- Every element: user elevation requirement, menu choices (inbound/outbound/both), the internal arrays as key extensibility points, and the netsh/firewall boundary.
- Don’t omit the GitHub contribution side-flow—this is central to how the tool evolves.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Actors
    User("Administrator/User"):::actor
    Contributor("Contributor"):::actor

    %% Core Script
    Script["WinMasterBlocker.bat"]:::script
    Config["Config Arrays\n(vendors[] & paths[])"]:::config
    CLI["netsh CLI"]:::cli
    FW["Windows Firewall Subsystem"]:::os
    Apps["Target Applications"]:::app

    %% GitHub Contribution Model
    subgraph "GitHub Contribution Model"
        Repo["GitHub Repo"]:::github
        Doc["README.md"]:::github
    end

    %% Runtime Flow
    User -->|"Invoke (elevated)"| Script
    Script -->|"Read config"| Config
    Script -->|"Execute rules"| CLI
    CLI -->|"Apply rules"| FW
    FW -->|"Block traffic"| Apps

    %% Contribution Flow
    Contributor -->|"Fork/Clone/Edit"| Repo
    Repo -->|"Edit arrays & PR"| Script
    Repo -->|"View docs"| Doc

    %% Click Events
    click Script "https://github.com/ph33nx/winmasterblocker/blob/main/WinMasterBlocker.bat"
    click Config "https://github.com/ph33nx/winmasterblocker/blob/main/WinMasterBlocker.bat"
    click Doc "https://github.com/ph33nx/winmasterblocker/blob/main/README.md"
    click Repo "https://github.com/ph33nx/winmasterblocker/blob/main/."

    %% Styles
    classDef actor fill:#9f6,stroke:#080;
    classDef script fill:#6cf,stroke:#039;
    classDef config fill:#9df,stroke:#059;
    classDef cli fill:#fc6,stroke:#c60;
    classDef os fill:#f96,stroke:#f30;
    classDef app fill:#ccc,stroke:#999;
    classDef github fill:#c9c,stroke:#939;
```
