# yyax13/thedarkmark architecture

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

- Interactive diagram: https://gitdiagram.com/yyax13/thedarkmark
- Repository: https://github.com/yyax13/thedarkmark

## Overview

The Dark Mark is a terminal-driven C2 framework. An operator enters commands through the interactive shell, selects and configures a chamber, then casts it to build or manage an implant session; the framework also provides listings and session controls. Its runtime separates command handling, chamber orchestration, transport and encoding, and implant payloads. The excerpts show important registration and delegation points, but do not expose every command handler or session operation, so some documented capability links are omitted rather than inferred.

Main entry points: [`src/chambers/marauder.go`](https://github.com/yyax13/thedarkmark/blob/main/src/chambers/marauder.go) (Marauder listener), [`src/incantations`](https://github.com/yyax13/thedarkmark/tree/main/src/incantations) (Command handlers), [`src/incantations/revelio.go`](https://github.com/yyax13/thedarkmark/blob/main/src/incantations/revelio.go) (Capability listings), [`src/chambers/malfoy.go`](https://github.com/yyax13/thedarkmark/blob/main/src/chambers/malfoy.go) (Malfoy builder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shell["Operator shell"]
  node_cli["Interactive shell<br/>[main.go]"]
  node_commands["Command handlers"]
  node_listing["Capability listings<br/>[revelio.go]"]
end

subgraph group_control["C2 control"]
  node_malfoy["Malfoy builder<br/>[malfoy.go]"]
  node_marauder["Marauder listener<br/>[marauder.go]"]
  node_imperius["Imperius sessions<br/>[imperius.go]"]
  node_state["Shared runtime types<br/>[hogwarts.go]"]
  node_misc["Runtime utilities"]
end

subgraph group_transport["Transport and encoding"]
  node_rituals["Ritual registry<br/>[registry.go]"]
  node_tcp["TCP ritual<br/>[tcp.go]"]
  node_fidelius["Fidelius encoders<br/>[basic_xor.go]"]
  node_wrapper["C/Go bridge<br/>[wrapper.go]"]
end

subgraph group_payload["Implant payloads"]
  node_spellregistry["Spell registry<br/>[registry.go]"]
  node_spellconfig["Spell configuration"]
  node_basicimplant["Basic reverse shell<br/>[main.c]"]
  node_evasionimplant["Evasion reverse shell<br/>[main.c]"]
end

node_operator(("Operator"))

node_operator -->|"enters commands"| node_cli
node_cli -->|"dispatches"| node_commands
node_commands -->|"selects chamber"| node_malfoy
node_commands -->|"requests listings"| node_listing
node_listing -->|"lists spells"| node_spellregistry
node_listing -->|"lists rituals"| node_rituals
node_listing -->|"lists encoders"| node_fidelius
node_listing -->|"lists sessions"| node_marauder
node_malfoy -->|"resolves spell"| node_spellregistry
node_malfoy -->|"encodes options"| node_fidelius
node_malfoy -->|"compiles bridge"| node_wrapper
node_malfoy -->|"uses runtime types"| node_state
node_marauder -->|"selects ritual"| node_rituals
node_marauder -->|"selects spell"| node_spellregistry
node_marauder -->|"selects encoder"| node_fidelius
node_marauder -->|"handles links"| node_state
node_imperius -->|"uses session types"| node_state
node_rituals -.->|"registers transport"| node_tcp
node_tcp -->|"configures encoding"| node_fidelius
node_tcp -->|"creates links"| node_state
node_wrapper -->|"creates protocols"| node_rituals
node_wrapper -->|"encodes payload data"| node_fidelius
node_spellconfig -->|"points to payload"| node_evasionimplant
node_spellregistry -.->|"registers spell"| node_spellconfig
node_basicimplant -.->|"calls bridge"| node_wrapper
node_evasionimplant -.->|"calls bridge"| node_wrapper
node_commands -.->|"manages sessions"| node_imperius
node_commands -.->|"starts listener"| node_marauder
node_cli -->|"formats terminal"| node_misc

click node_cli "https://github.com/yyax13/thedarkmark/blob/main/src/main.go"
click node_commands "https://github.com/yyax13/thedarkmark/tree/main/src/incantations"
click node_listing "https://github.com/yyax13/thedarkmark/blob/main/src/incantations/revelio.go"
click node_malfoy "https://github.com/yyax13/thedarkmark/blob/main/src/chambers/malfoy.go"
click node_marauder "https://github.com/yyax13/thedarkmark/blob/main/src/chambers/marauder.go"
click node_imperius "https://github.com/yyax13/thedarkmark/blob/main/src/chambers/imperius.go"
click node_state "https://github.com/yyax13/thedarkmark/blob/main/src/types/hogwarts.go"
click node_rituals "https://github.com/yyax13/thedarkmark/blob/main/src/rituals/registry.go"
click node_tcp "https://github.com/yyax13/thedarkmark/blob/main/src/rituals/tcp.go"
click node_fidelius "https://github.com/yyax13/thedarkmark/blob/main/src/fidelius/basic_xor.go"
click node_wrapper "https://github.com/yyax13/thedarkmark/blob/main/src/wrappers/wrapper.go"
click node_spellregistry "https://github.com/yyax13/thedarkmark/blob/main/src/spells/registry.go"
click node_spellconfig "https://github.com/yyax13/thedarkmark/blob/main/src/spells/x86linux_evasion_reverse_shell.go"
click node_basicimplant "https://github.com/yyax13/thedarkmark/blob/main/src/spells/x86linux/basic/reverse_shell/main.c"
click node_evasionimplant "https://github.com/yyax13/thedarkmark/blob/main/src/spells/x86linux/evasion/reverse_shell/main.c"
click node_misc "https://github.com/yyax13/thedarkmark/tree/main/src/misc"

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_cli,node_commands,node_listing toneBlue
class node_malfoy,node_marauder,node_imperius,node_state,node_misc toneAmber
class node_rituals,node_tcp,node_fidelius,node_wrapper toneMint
class node_spellregistry,node_spellconfig,node_basicimplant,node_evasionimplant toneRose
class node_operator toneIndigo
```

## Components

### Operator shell

- [Interactive shell](https://github.com/yyax13/thedarkmark/blob/main/src/main.go): `src/main.go`
- [Command handlers](https://github.com/yyax13/thedarkmark/tree/main/src/incantations): `src/incantations`
- [Capability listings](https://github.com/yyax13/thedarkmark/blob/main/src/incantations/revelio.go): `src/incantations/revelio.go`

### C2 control

- [Malfoy builder](https://github.com/yyax13/thedarkmark/blob/main/src/chambers/malfoy.go): `src/chambers/malfoy.go`
- [Marauder listener](https://github.com/yyax13/thedarkmark/blob/main/src/chambers/marauder.go): `src/chambers/marauder.go`
- [Imperius sessions](https://github.com/yyax13/thedarkmark/blob/main/src/chambers/imperius.go): `src/chambers/imperius.go`
- [Shared runtime types](https://github.com/yyax13/thedarkmark/blob/main/src/types/hogwarts.go): `src/types/hogwarts.go`
- [Runtime utilities](https://github.com/yyax13/thedarkmark/tree/main/src/misc): `src/misc`

### Transport and encoding

- [Ritual registry](https://github.com/yyax13/thedarkmark/blob/main/src/rituals/registry.go): `src/rituals/registry.go`
- [TCP ritual](https://github.com/yyax13/thedarkmark/blob/main/src/rituals/tcp.go): `src/rituals/tcp.go`
- [Fidelius encoders](https://github.com/yyax13/thedarkmark/blob/main/src/fidelius/basic_xor.go): `src/fidelius/basic_xor.go`
- [C/Go bridge](https://github.com/yyax13/thedarkmark/blob/main/src/wrappers/wrapper.go): `src/wrappers/wrapper.go`

### Implant payloads

- [Spell registry](https://github.com/yyax13/thedarkmark/blob/main/src/spells/registry.go): `src/spells/registry.go`
- [Spell configuration](https://github.com/yyax13/thedarkmark/blob/main/src/spells/x86linux_evasion_reverse_shell.go): `src/spells/x86linux_evasion_reverse_shell.go`
- [Basic reverse shell](https://github.com/yyax13/thedarkmark/blob/main/src/spells/x86linux/basic/reverse_shell/main.c): `src/spells/x86linux/basic/reverse_shell/main.c`
- [Evasion reverse shell](https://github.com/yyax13/thedarkmark/blob/main/src/spells/x86linux/evasion/reverse_shell/main.c): `src/spells/x86linux/evasion/reverse_shell/main.c`

### Other components

- **Operator**

## Connections

- Operator → Interactive shell: enters commands (evidence: `README.md`)
- Interactive shell → Command handlers: dispatches (evidence: `src/main.go`)
- Command handlers → Malfoy builder: selects chamber (evidence: `src/incantations/wield.go`)
- Command handlers → Capability listings: requests listings (evidence: `src/incantations/revelio.go`)
- Capability listings → Spell registry: lists spells (evidence: `src/incantations/revelio.go`)
- Capability listings → Ritual registry: lists rituals (evidence: `src/incantations/revelio.go`)
- Capability listings → Fidelius encoders: lists encoders (evidence: `src/incantations/revelio.go`)
- Capability listings → Marauder listener: lists sessions (evidence: `src/incantations/revelio.go`)
- Malfoy builder → Spell registry: resolves spell (evidence: `src/chambers/malfoy.go`)
- Malfoy builder → Fidelius encoders: encodes options (evidence: `src/chambers/malfoy.go`)
- Malfoy builder → C/Go bridge: compiles bridge (evidence: `src/chambers/malfoy.go`)
- Malfoy builder → Shared runtime types: uses runtime types (evidence: `src/chambers/malfoy.go`)
- Marauder listener → Ritual registry: selects ritual (evidence: `src/chambers/marauder.go`)
- Marauder listener → Spell registry: selects spell (evidence: `src/chambers/marauder.go`)
- Marauder listener → Fidelius encoders: selects encoder (evidence: `src/chambers/marauder.go`)
- Marauder listener → Shared runtime types: handles links (evidence: `src/chambers/marauder.go`)
- Imperius sessions → Shared runtime types: uses session types (evidence: `src/chambers/imperius.go`)
- Ritual registry → TCP ritual: registers transport
- TCP ritual → Fidelius encoders: configures encoding (evidence: `src/rituals/tcp.go`)
- TCP ritual → Shared runtime types: creates links (evidence: `src/rituals/tcp.go`)
- C/Go bridge → Ritual registry: creates protocols (evidence: `src/wrappers/wrapper.go`)
- C/Go bridge → Fidelius encoders: encodes payload data (evidence: `src/wrappers/wrapper.go`)
- Spell configuration → Evasion reverse shell: points to payload (evidence: `src/spells/x86linux_evasion_reverse_shell.go`)
- Spell registry → Spell configuration: registers spell
- Basic reverse shell → C/Go bridge: calls bridge
- Evasion reverse shell → C/Go bridge: calls bridge
- Command handlers → Imperius sessions: manages sessions
- Command handlers → Marauder listener: starts listener
- Interactive shell → Runtime utilities: formats terminal (evidence: `src/main.go`)
