# saintarthur/warklock-etw architecture

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

- Interactive diagram: https://gitdiagram.com/saintarthur/warklock-etw
- Repository: https://github.com/saintarthur/warklock-etw

## Overview

##### Main Components
- ETW Patcher Module – This is the heart of the project. It is responsible for “patching” or disabling ETW, as shown in the output messages.
- Ntdll Unhook Module – Although integrated closely with ETW bypassing, this module deals specifically with unhooking ntdll in order to avoid hooked functions that security tools might rely on.
- Console / User Interface – Since the project waits for an <Enter> key press and then prints status messages such as “ETW Patched, No Logs No Crime!”, this component handles user interaction.
- Core Definitions and Structures – Represented by files like Common.h and Structs.h, this part contains common types and definitions used across the patching routines.
- Visual Studio Project Infrastructure – The solution file and project configuration files (etw-fuck.sln, .vcxproj, etc.) indicate that the build and dependency management leverage Visual Studio, which might be noted as an external dependency for compilation and deployment.

##### Relationships and Interactions
- The Console UI collects input from the user (e.g., pressing <Enter>) and triggers the patching operation.
- The ETW Patcher component interacts with both the Windows API (to gather base addresses for ETW and ntdll) and the Ntdll Unhook module.
- The Ntdll Unhook module, likely using routines declared in Structs.h and Common.h, manipulates memory or function pointers to disable hooks.
- Post-patching, status messages are displayed back to the user, confirming operations like “ETW Patched, No Logs No Crime!”.

##### Architectural Patterns and Design Principles
- Modularization – Although this is a small project, the separation into header files for common functions/structs and a main executable file suggests a separation of concerns.
- Windows API Integration – Since key base addresses are logged and the tool depends on Windows internals, indicate that there is a dependency on Windows system libraries/APIs.

##### Incorporate Relevant Technologies/Frameworks
- C++ as the programming language.
- Windows APIs for operations related to ETW and ntdll.
- Visual Studio as the build environment and project management tool.

##### Elements
- Labeled components:
- Console UI (Input/Output)
- ETW Patcher Module (Core Logic)
- Ntdll Unhook Module (Secondary Logic)
- Windows API / System Libraries (External Dependency)
- Definition/Utility Layer (Common.h, Structs.h)
- How the user action triggers the patching routine.
- How the ETW Patcher interacts with system libraries to obtain addresses.
- How the Ntdll Unhook module is called from the patcher.
- Flow of status and error messages back to the Console UI.

- Branch off from the ETW Patcher to show its two main operations: one branch to “Retrieve/Display ETW base address” and another branch to “Unhook Ntdll”.
- Link both operations with a common dependency symbol indicating they use the “Definition & Utility Layer” (Common.h/Structs.h).
- Optionally, include an external “Visual Studio Environment” block to indicate how the project’s build and configuration are managed.

## Diagram (Mermaid)

```mermaid
flowchart TD
    UI["Console UI (User Input/Output)"]:::UI
    ETWP["ETW Patcher Module"]:::core
    NTDL["Ntdll Unhook Module"]:::core
    API["Windows API/System Libraries"]:::external

    UI -->|"triggers"| ETWP
    ETWP -->|"calls"| NTDL
    ETWP -->|"retrievesETWbase"| API
    ETWP -->|"displaysStatus"| UI

    subgraph "Core Definitions and Structures"
        comm["Common.h"]:::util
        struct["Structs.h"]:::util
    end
    ETWP -->|"uses"| comm
    NTDL -->|"uses"| comm
    ETWP -->|"uses"| struct
    NTDL -->|"uses"| struct

    subgraph "Visual Studio Project Infrastructure"
        SOL["Solution File"]:::env
        VCP["Project File"]:::env
        VCPF["Project Filters"]:::env
        VCPU["User Config"]:::env
    end
    SOL --- VCP --- VCPF --- VCPU
    SOL ---|"builds"| ETWP
    VCP ---|"builds"| ETWP
    VCPF ---|"builds"| ETWP
    VCPU ---|"builds"| ETWP

    classDef UI fill:#f9c,stroke:#333,stroke-width:2px
    classDef core fill:#bbf,stroke:#333,stroke-width:2px
    classDef util fill:#dfd,stroke:#333,stroke-width:2px
    classDef external fill:#fcc,stroke:#333,stroke-width:2px
    classDef env fill:#cfc,stroke:#333,stroke-width:2px

    click UI "https://github.com/saintarthur/warklock-etw/blob/main/etw-fuck.cpp"
    click ETWP "https://github.com/saintarthur/warklock-etw/blob/main/etw-fuck.cpp"
    click NTDL "https://github.com/saintarthur/warklock-etw/blob/main/etw-fuck.cpp"
    click comm "https://github.com/saintarthur/warklock-etw/blob/main/Common.h"
    click struct "https://github.com/saintarthur/warklock-etw/blob/main/Structs.h"
    click SOL "https://github.com/saintarthur/warklock-etw/blob/main/etw-fuck.sln"
    click VCP "https://github.com/saintarthur/warklock-etw/blob/main/etw-fuck.vcxproj"
    click VCPF "https://github.com/saintarthur/warklock-etw/blob/main/etw-fuck.vcxproj.filters"
    click VCPU "https://github.com/saintarthur/warklock-etw/blob/main/etw-fuck.vcxproj.user"
```
