# nightmare-eclipse/bluehammer architecture

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

- Interactive diagram: https://gitdiagram.com/nightmare-eclipse/bluehammer
- Repository: https://github.com/nightmare-eclipse/bluehammer

## Overview

This repository is a small Windows-native proof-of-concept project, not a multi-service system. The architecture is centered on a single Visual Studio C++ application plus a set of generated interface files and one third-party/static dependency.

1. **Overall shape**
   - The repo builds one desktop Windows executable, `FunnyApp`, from a Visual Studio solution/project.
   - The README frames it as a “BlueHammer” vulnerability PoC, so the executable is the main attack/demo harness rather than a user-facing product.

2. **Primary application**
   - `FunnyApp.cpp` is the main program source and is the likely entry point for all PoC logic.
   - `FunnyApp.rc`, `resource.h`, and `FunnyApp.aps` indicate the app also includes Windows resources such as icons, dialogs, strings, or version metadata.

3. **Interface contract layer**
   - `windefend.idl` defines a COM/RPC-style interface boundary.
   - The presence of both client and server stub files, `windefend_c.c` and `windefend_s.c`, suggests the project generates marshaling code for cross-process or RPC communication rather than using only in-process function calls.

4. **Generated transport artifacts**
   - `windefend_h.h` is the generated header for the IDL contract and is likely consumed by `FunnyApp.cpp`.
   - This split implies a clear separation between the PoC driver and the low-level interface definition used to reach the targeted Windows component.

5. **Native Windows dependency**
   - The naming `windefend` strongly suggests the PoC targets a Windows Defender-related interface or service boundary.
   - Architecturally, that means the executable is likely acting as a client to a Windows system component rather than implementing a backend itself.

6. **Offline registry dependency**
   - `offreg.h` and `offreg.lib` add a separate subsystem for offline registry manipulation.
   - This is a material architectural detail: the PoC likely reads, modifies, or inspects registry hives without relying only on live registry APIs, which is often used in exploit setups or system-state preparation.

7. **Build and toolchain**
   - `FunnyApp.sln`, `FunnyApp.vcxproj`, and `FunnyApp.vcxproj.filters` show a standard Visual Studio/MSVC build pipeline.
   - The repo is organized around Windows development conventions, with generated interface code checked in rather than produced at runtime.

8. **Runtime boundaries**
   - The executable boundary is local to Windows, with dependencies on system libraries and the checked-in `offreg` library.
   - There are no signs of web, database, or network-service architecture; the important boundary is between the PoC process and the Windows subsystem it interacts with.

9. **Data flow at a high level**
   - `FunnyApp.cpp` likely orchestrates the PoC flow.
   - It uses the `windefend` interface stubs to communicate with the targeted component and may use `offreg` to prepare or query registry state needed for the exploit path.
   - The resource files are ancillary and do not appear to carry business logic.

10. **What to draw in an architecture diagram**
   - One box for the `FunnyApp` executable.
   - One box for the generated `windefend` interface layer (IDL, client stub, server stub, header).
   - One box for the `offreg` static dependency.
   - One external box for the Windows/Defender-related target component or system service.
   - Connect `FunnyApp` to the interface layer and to `offreg`, with the interface layer bridging to the external Windows target.

11. **Repository maturity / caveat**
   - The README explicitly says there are bugs in the PoC that may prevent it from working.
   - That means the repo should be treated as a partially functional exploit prototype rather than a polished application.

12. **Concise architecture summary**
   - In short: this is a single-process Windows PoC with a generated RPC/COM interface contract, a small resource bundle, and an offline registry helper library, all wired together in a Visual Studio C++ project.

Main entry points: [`FunnyApp.cpp`](https://github.com/nightmare-eclipse/bluehammer/blob/main/FunnyApp.cpp) (FunnyApp), [`windefend.idl`](https://github.com/nightmare-eclipse/bluehammer/blob/main/windefend.idl) (windefend.idl), [`windefend_c.c`](https://github.com/nightmare-eclipse/bluehammer/blob/main/windefend_c.c) (client stub), [`FunnyApp.rc`](https://github.com/nightmare-eclipse/bluehammer/blob/main/FunnyApp.rc) (Resources)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["FunnyApp executable"]
  node_funnyapp["FunnyApp<br/>exe<br/>[FunnyApp.cpp]"]
  node_app_resources["Resources<br/>[FunnyApp.rc]"]
  node_app_aps["Compiled res<br/>resource-cache<br/>[FunnyApp.aps]"]
end

subgraph group_contract["Interface contract"]
  node_windefend_idl["windefend.idl<br/>idl contract<br/>[windefend.idl]"]
  node_windefend_h["windefend_h<br/>generated header<br/>[windefend_h.h]"]
  node_windefend_c["client stub<br/>generated stub<br/>[windefend_c.c]"]
  node_windefend_s["server stub<br/>generated stub<br/>[windefend_s.c]"]
end

subgraph group_deps["Native dependency"]
  node_offreg[("offreg<br/>static lib<br/>[offreg.lib]")]
end

subgraph group_target["Windows target"]
  node_windows_target(("Windows target<br/>system component"))
end

subgraph group_build["Build system"]
  node_solution["FunnyApp.sln<br/>vs solution<br/>[FunnyApp.sln]"]
  node_project["FunnyApp.vcxproj<br/>[FunnyApp.vcxproj]"]
end

node_solution -->|"opens"| node_project
node_project -->|"builds"| node_funnyapp
node_funnyapp -->|"includes"| node_windefend_h
node_funnyapp -->|"calls"| node_windefend_c
node_funnyapp -->|"links"| node_offreg
node_funnyapp -->|"packages"| node_app_resources
node_app_resources -.->|"cached as"| node_app_aps
node_windefend_idl -->|"generates"| node_windefend_h
node_windefend_idl -->|"generates"| node_windefend_c
node_windefend_idl -->|"generates"| node_windefend_s
node_windefend_c -->|"reaches"| node_windows_target
node_windefend_s -.->|"services"| node_windows_target
node_funnyapp -->|"drives"| node_windows_target
node_funnyapp -->|"depends on"| node_windefend_idl

click node_funnyapp "https://github.com/nightmare-eclipse/bluehammer/blob/main/FunnyApp.cpp"
click node_app_resources "https://github.com/nightmare-eclipse/bluehammer/blob/main/FunnyApp.rc"
click node_app_aps "https://github.com/nightmare-eclipse/bluehammer/blob/main/FunnyApp.aps"
click node_windefend_idl "https://github.com/nightmare-eclipse/bluehammer/blob/main/windefend.idl"
click node_windefend_h "https://github.com/nightmare-eclipse/bluehammer/blob/main/windefend_h.h"
click node_windefend_c "https://github.com/nightmare-eclipse/bluehammer/blob/main/windefend_c.c"
click node_windefend_s "https://github.com/nightmare-eclipse/bluehammer/blob/main/windefend_s.c"
click node_offreg "https://github.com/nightmare-eclipse/bluehammer/blob/main/offreg.lib"
click node_solution "https://github.com/nightmare-eclipse/bluehammer/blob/main/FunnyApp.sln"
click node_project "https://github.com/nightmare-eclipse/bluehammer/blob/main/FunnyApp.vcxproj"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_funnyapp,node_app_resources,node_app_aps toneBlue
class node_windefend_idl,node_windefend_h,node_windefend_c,node_windefend_s toneAmber
class node_offreg toneMint
class node_windows_target toneRose
class node_solution,node_project toneIndigo
```

## Components

### FunnyApp executable

Main Visual Studio C++ PoC application and its local resources.

- [FunnyApp](https://github.com/nightmare-eclipse/bluehammer/blob/main/FunnyApp.cpp): exe · Main Windows PoC executable and orchestration entry point. · `FunnyApp.cpp`
- [Resources](https://github.com/nightmare-eclipse/bluehammer/blob/main/FunnyApp.rc): win-resources · Resource script and related metadata used by the executable. · `FunnyApp.rc`
- [Compiled res](https://github.com/nightmare-eclipse/bluehammer/blob/main/FunnyApp.aps): resource-cache · Visual Studio resource cache for the application. · `FunnyApp.aps`

### Interface contract

Generated IDL and marshaling artifacts for the windefend boundary.

- [windefend.idl](https://github.com/nightmare-eclipse/bluehammer/blob/main/windefend.idl): idl contract · Interface definition for the COM/RPC-style boundary. · `windefend.idl`
- [windefend_h](https://github.com/nightmare-eclipse/bluehammer/blob/main/windefend_h.h): generated header · Generated header consumed by the application. · `windefend_h.h`
- [client stub](https://github.com/nightmare-eclipse/bluehammer/blob/main/windefend_c.c): generated stub · Client-side marshaling code for the interface. · `windefend_c.c`
- [server stub](https://github.com/nightmare-eclipse/bluehammer/blob/main/windefend_s.c): generated stub · Server-side marshaling code for the interface. · `windefend_s.c`

### Native dependency

Checked-in offline registry helper library used by the PoC.

- [offreg](https://github.com/nightmare-eclipse/bluehammer/blob/main/offreg.lib): static lib · Offline registry helper used for hive manipulation or inspection. · `offreg.lib`

### Windows target

External Windows/Defender-side component reached through the interface boundary.

- **Windows target**: system component · External Windows/Defender-related service or component targeted by the PoC.

### Build system

Visual Studio solution and project files that build the executable.

- [FunnyApp.sln](https://github.com/nightmare-eclipse/bluehammer/blob/main/FunnyApp.sln): vs solution · Visual Studio solution that ties the project together. · `FunnyApp.sln`
- [FunnyApp.vcxproj](https://github.com/nightmare-eclipse/bluehammer/blob/main/FunnyApp.vcxproj): vcxproj · MSVC project file defining the build of the executable. · `FunnyApp.vcxproj`

## Connections

- FunnyApp.sln → FunnyApp.vcxproj: opens · The solution drives the C++ project build.
- FunnyApp.vcxproj → FunnyApp: builds · MSVC compiles the project into the executable.
- FunnyApp → windefend_h: includes · The app uses the generated interface declarations.
- FunnyApp → client stub: calls · Client marshaling supports outbound interface calls.
- FunnyApp → offreg: links · The app links the offline registry helper library.
- FunnyApp → Resources: packages · Windows resources are compiled into the executable.
- Resources → Compiled res: cached as · Visual Studio maintains a resource cache alongside the script.
- windefend.idl → windefend_h: generates · The IDL produces the shared header.
- windefend.idl → client stub: generates · The IDL produces client-side stubs.
- windefend.idl → server stub: generates · The IDL produces server-side stubs.
- client stub → Windows target: reaches · Client marshaling communicates with the external Windows component.
- server stub → Windows target: services · Server-side contract matches the remote boundary.
- FunnyApp → Windows target: drives · The executable orchestrates the PoC against the target boundary.
- FunnyApp → windefend.idl: depends on · The application depends on the interface contract shape.
