# 0xdimas/bluehammer architecture

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

- Interactive diagram: https://gitdiagram.com/0xdimas/bluehammer
- Repository: https://github.com/0xdimas/bluehammer

## Overview

1. **Repository shape**  
   This is a single-purpose native Windows C++ project, not a multi-service system. The Visual Studio solution/project builds one main executable, `FunnyApp`, which appears to be a proof-of-concept harness for the “BlueHammer” vulnerability referenced in the README.

2. **Primary runtime boundary**  
   The core execution happens in a user-mode Windows process. From there, the code likely crosses into system-facing interfaces rather than using a network backend or web stack. The main architectural boundary is the local user process interacting with Windows components via generated interface bindings.

3. **Application entrypoint**  
   `FunnyApp.cpp` is the central source file and likely contains the program entry, command-line handling, and the exploit/PoC orchestration logic. This is the place where the major control flow begins.

4. **Generated interface layer**  
   `windefend.idl` plus the generated `windefend_h.h`, `windefend_c.c`, and `windefend_s.c` indicate a custom MIDL-defined RPC/COM-style interface. Architecturally, this is the main communication boundary between the PoC and the target component. The IDL-generated files are checked in, so the interface contract is part of the repo rather than being produced only at build time.

5. **System interaction surface**  
   The naming strongly suggests the PoC talks to a Windows “defend”/security-related component through that interface. In an architecture diagram, this should be shown as a local call path from the executable into an OS/service boundary exposed through RPC/COM stubs.

6. **Registry-related support**  
   `offreg.h` and `offreg.lib` bring in Microsoft’s Offline Registry API. That means the project has a registry manipulation or hive-processing dependency that is separate from the main exploit logic. If diagramming data flow, treat this as a helper subsystem used to prepare, inspect, or modify registry data.

7. **Resources and packaging**  
   `FunnyApp.rc`, `resource.h`, and `FunnyApp.aps` are standard Windows resource assets. They support binary resources such as version info, icons, dialogs, or embedded strings, but they are not separate runtime subsystems.

8. **Build and toolchain**  
   `FunnyApp.sln`, `FunnyApp.vcxproj`, and the `.filters/.user` files show a Visual Studio/MSVC build. The generated RPC files and the static `offreg.lib` imply the build is self-contained on Windows and depends on Microsoft toolchain conventions.

9. **Overall data flow**  
   The simplest architecture view is: `FunnyApp.exe` starts, uses its embedded resources and helper code, then invokes the `windefend` interface and possibly registry-related routines via `offreg`. The output of the PoC is whatever effect or state change occurs in the target Windows component; there is no separate database, backend service, or client/server tier in this repository.

10. **What is not present**  
   There are no signs of a web UI, daemon/service implementation, cloud dependencies, or multiple internal modules. The repository is essentially a compact exploit/PoC package centered on one executable and one generated system interface.

Main entry points: [`FunnyApp.cpp`](https://github.com/0xdimas/bluehammer/blob/main/FunnyApp.cpp) (Main code), [`FunnyApp.vcxproj`](https://github.com/0xdimas/bluehammer/blob/main/FunnyApp.vcxproj) (Project file), [`FunnyApp.rc`](https://github.com/0xdimas/bluehammer/blob/main/FunnyApp.rc) (Resources), [`windefend_c.c`](https://github.com/0xdimas/bluehammer/blob/main/windefend_c.c) (Client stub)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_funnyapp_exe["FunnyApp<br/>exe"]
  node_main_cpp["Main code<br/>entrypoint<br/>[FunnyApp.cpp]"]
  node_readme["README<br/>docs<br/>[README.md]"]
end

subgraph group_rpc["Interface"]
  node_windefend_idl["Interface IDL<br/>rpc-idl<br/>[windefend.idl]"]
  node_windefend_h["RPC header<br/>rpc-header<br/>[windefend_h.h]"]
  node_windefend_c["Client stub<br/>rpc-client<br/>[windefend_c.c]"]
  node_windefend_s["Server stub<br/>rpc-server<br/>[windefend_s.c]"]
end

subgraph group_support["Support"]
  node_offreg_h["OffReg API<br/>registry-api<br/>[offreg.h]"]
  node_offreg_lib[("OffReg lib<br/>static-lib<br/>[offreg.lib]")]
  node_resources["Resources<br/>[FunnyApp.rc]"]
  node_resource_h["Resource header<br/>resource-header<br/>[resource.h]"]
  node_aps["Resource cache<br/>ide-cache<br/>[FunnyApp.aps]"]
end

subgraph group_build["Build"]
  node_solution["Solution<br/>[FunnyApp.sln]"]
  node_vcxproj["Project file<br/>vs-project<br/>[FunnyApp.vcxproj]"]
  node_filters["Filters"]
  node_userprefs["User prefs<br/>vs-user"]
end

subgraph group_external["External"]
  node_target_windows(("Windows target<br/>system-boundary"))
end

node_solution -->|"opens"| node_vcxproj
node_vcxproj -->|"builds"| node_main_cpp
node_vcxproj -->|"includes"| node_windefend_h
node_vcxproj -->|"compiles"| node_windefend_c
node_vcxproj -->|"compiles"| node_windefend_s
node_vcxproj -->|"links"| node_offreg_lib
node_vcxproj -->|"embeds"| node_resources
node_resources -->|"uses"| node_resource_h
node_resources -.->|"edited by"| node_aps
node_main_cpp -->|"drives"| node_windefend_idl
node_main_cpp -->|"calls"| node_windefend_h
node_main_cpp -->|"marshals"| node_windefend_c
node_main_cpp -->|"uses"| node_offreg_h
node_main_cpp -->|"links"| node_offreg_lib
node_main_cpp -->|"targets"| node_target_windows
node_windefend_c -->|"rpc to"| node_target_windows
node_windefend_s -.->|"serves"| node_target_windows
node_readme -.->|"describes"| node_main_cpp

click node_main_cpp "https://github.com/0xdimas/bluehammer/blob/main/FunnyApp.cpp"
click node_readme "https://github.com/0xdimas/bluehammer/blob/main/README.md"
click node_windefend_idl "https://github.com/0xdimas/bluehammer/blob/main/windefend.idl"
click node_windefend_h "https://github.com/0xdimas/bluehammer/blob/main/windefend_h.h"
click node_windefend_c "https://github.com/0xdimas/bluehammer/blob/main/windefend_c.c"
click node_windefend_s "https://github.com/0xdimas/bluehammer/blob/main/windefend_s.c"
click node_offreg_h "https://github.com/0xdimas/bluehammer/blob/main/offreg.h"
click node_offreg_lib "https://github.com/0xdimas/bluehammer/blob/main/offreg.lib"
click node_resources "https://github.com/0xdimas/bluehammer/blob/main/FunnyApp.rc"
click node_resource_h "https://github.com/0xdimas/bluehammer/blob/main/resource.h"
click node_aps "https://github.com/0xdimas/bluehammer/blob/main/FunnyApp.aps"
click node_solution "https://github.com/0xdimas/bluehammer/blob/main/FunnyApp.sln"
click node_vcxproj "https://github.com/0xdimas/bluehammer/blob/main/FunnyApp.vcxproj"
click node_filters "https://github.com/0xdimas/bluehammer/blob/main/FunnyApp.vcxproj.filters"
click node_userprefs "https://github.com/0xdimas/bluehammer/blob/main/FunnyApp.vcxproj.user"

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_exe,node_main_cpp,node_readme toneBlue
class node_windefend_idl,node_windefend_h,node_windefend_c,node_windefend_s toneAmber
class node_offreg_h,node_offreg_lib,node_resources,node_resource_h,node_aps toneMint
class node_solution,node_vcxproj,node_filters,node_userprefs toneRose
class node_target_windows toneIndigo
```

## Components

### Application

Primary executable and orchestration code

- **FunnyApp**: exe · Main native Windows executable
- [Main code](https://github.com/0xdimas/bluehammer/blob/main/FunnyApp.cpp): entrypoint · Program entry and PoC orchestration · `FunnyApp.cpp`
- [README](https://github.com/0xdimas/bluehammer/blob/main/README.md): docs · Project overview and exploit context · `README.md`

### Interface

Generated RPC/COM contract and stubs

- [Interface IDL](https://github.com/0xdimas/bluehammer/blob/main/windefend.idl): rpc-idl · MIDL contract for the target interface · `windefend.idl`
- [RPC header](https://github.com/0xdimas/bluehammer/blob/main/windefend_h.h): rpc-header · Generated interface declarations · `windefend_h.h`
- [Client stub](https://github.com/0xdimas/bluehammer/blob/main/windefend_c.c): rpc-client · Generated client-side marshaling code · `windefend_c.c`
- [Server stub](https://github.com/0xdimas/bluehammer/blob/main/windefend_s.c): rpc-server · Generated server-side marshaling code · `windefend_s.c`

### Support

Registry and resource support code

- [OffReg API](https://github.com/0xdimas/bluehammer/blob/main/offreg.h): registry-api · Offline Registry helper header · `offreg.h`
- [OffReg lib](https://github.com/0xdimas/bluehammer/blob/main/offreg.lib): static-lib · Offline Registry import library · `offreg.lib`
- [Resources](https://github.com/0xdimas/bluehammer/blob/main/FunnyApp.rc): win-resources · Binary resources and resource definitions · `FunnyApp.rc`
- [Resource header](https://github.com/0xdimas/bluehammer/blob/main/resource.h): resource-header · Resource identifiers · `resource.h`
- [Resource cache](https://github.com/0xdimas/bluehammer/blob/main/FunnyApp.aps): ide-cache · Visual Studio resource editor state · `FunnyApp.aps`

### Build

Visual Studio project and packaging files

- [Solution](https://github.com/0xdimas/bluehammer/blob/main/FunnyApp.sln): vs-solution · Visual Studio solution container · `FunnyApp.sln`
- [Project file](https://github.com/0xdimas/bluehammer/blob/main/FunnyApp.vcxproj): vs-project · MSVC build configuration · `FunnyApp.vcxproj`
- [Filters](https://github.com/0xdimas/bluehammer/blob/main/FunnyApp.vcxproj.filters): vs-filters · IDE file grouping metadata · `FunnyApp.vcxproj.filters`
- [User prefs](https://github.com/0xdimas/bluehammer/blob/main/FunnyApp.vcxproj.user): vs-user · Per-user Visual Studio settings · `FunnyApp.vcxproj.user`

### External

Target Windows component boundary

- **Windows target**: system-boundary · Target security-related Windows component

## Connections

- Solution → Project file: opens · Solution loads the project
- Project file → Main code: builds · Project compiles the main source
- Project file → RPC header: includes · Project depends on generated interface declarations
- Project file → Client stub: compiles · Client stub is built into the executable
- Project file → Server stub: compiles · Server stub is built into the executable
- Project file → OffReg lib: links · Project links against Offline Registry library
- Project file → Resources: embeds · Project packages Windows resources
- Resources → Resource header: uses · Resource script references identifiers
- Resources → Resource cache: edited by · Visual Studio resource state supports editing
- Main code → Interface IDL: drives · Runtime logic follows the interface contract
- Main code → RPC header: calls · Uses generated interface declarations
- Main code → Client stub: marshals · Invokes client-side RPC path
- Main code → OffReg API: uses · Uses Offline Registry helpers
- Main code → OffReg lib: links · Runtime support from Offline Registry library
- Main code → Windows target: targets · PoC interacts with a local Windows component
- Client stub → Windows target: rpc to · Client stub reaches the target boundary
- Server stub → Windows target: serves · Server stub defines the other side of the interface
- README → Main code: describes · README explains the harness and flow
