# klezvirus/silentmoonwalk architecture

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

- Interactive diagram: https://gitdiagram.com/klezvirus/silentmoonwalk
- Repository: https://github.com/klezvirus/silentmoonwalk

## Overview

The repository contains three Windows utilities: SilentMoonwalk demonstrates dynamic call-stack spoofing, UnwindInspector examines runtime-function unwind metadata, and Eclipse scans another process’s threads and return addresses for suspicious call sites. The principal spoofing workflow finds suitable unwind frames and gadgets, builds a spoof configuration, then makes an API call through the selected stack mode. The README documents synthetic and desynchronized modes and stack restoration. Edges reflect the excerpts and README; Eclipse’s details beyond the sampled scanner and disassembler are not inferred.

Main entry points: [`SilentMoonwalk/SilentMoonwalk.cpp`](https://github.com/klezvirus/silentmoonwalk/blob/master/SilentMoonwalk/SilentMoonwalk.cpp) (Spoof Demo), [`UnwindInspector/UnwindInspector.cpp`](https://github.com/klezvirus/silentmoonwalk/blob/master/UnwindInspector/UnwindInspector.cpp) (Inspector CLI), [`SilentMoonwalk/include/Spoof.h`](https://github.com/klezvirus/silentmoonwalk/blob/master/SilentMoonwalk/include/Spoof.h) (Spoof Config), [`Eclipse/Eclipse.cpp`](https://github.com/klezvirus/silentmoonwalk/blob/master/Eclipse/Eclipse.cpp) (Process Scanner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_spoof["Stack Spoofing"]
  node_sm_entry["Spoof Demo<br/>[SilentMoonwalk.cpp]"]
  node_sm_helpers["Unwind Helpers<br/>[Functions.h]"]
  node_sm_common["Runtime Types<br/>[Common.h]"]
  node_sm_hunt["Module Lookup<br/>[AddressHunter.h]"]
  node_sm_config["Spoof Config<br/>[Spoof.h]"]
  node_sm_asm["Call Stubs"]
end

subgraph group_unwind["Unwind Inspection"]
  node_ins_entry["Inspector CLI"]
  node_ins_helpers["Unwind Helpers<br/>[Functions.h]"]
  node_ins_common["Runtime Types<br/>[Common.h]"]
  node_ins_hunt["Module Lookup<br/>[AddressHunter.h]"]
end

subgraph group_scanner["Process Scanning"]
  node_eclipse_entry["Process Scanner<br/>[Eclipse.cpp]"]
  node_disassembler["x64 Disassembler<br/>[hde64.h]"]
  node_decode_tables["Decode Tables<br/>[table64.h]"]
  node_scan_helpers["Scan Helpers<br/>[Functions.h]"]
  node_timing["Timing<br/>[Performance.h]"]
end

node_user(("Operator"))
node_target_api["Windows API"]
node_module["Target DLL"]

node_user -->|"runs demo"| node_sm_entry
node_sm_entry -->|"finds frames"| node_sm_helpers
node_sm_entry -->|"spoofs call"| node_sm_config
node_sm_entry -->|"looks up modules"| node_sm_hunt
node_sm_common -->|"uses lookup"| node_sm_hunt
node_sm_config -->|"uses types"| node_sm_common
node_sm_config -.->|"dispatches call"| node_sm_asm
node_sm_asm -.->|"calls target"| node_target_api
node_user -->|"runs query"| node_ins_entry
node_ins_entry -->|"queries unwind data"| node_ins_helpers
node_ins_entry -->|"uses definitions"| node_ins_common
node_ins_common -->|"uses lookup"| node_ins_hunt
node_ins_entry -->|"inspects module"| node_module
node_user -->|"scans process"| node_eclipse_entry
node_eclipse_entry -->|"decodes call sites"| node_disassembler
node_eclipse_entry -->|"measures duration"| node_timing
node_disassembler -.->|"uses tables"| node_decode_tables

click node_sm_entry "https://github.com/klezvirus/silentmoonwalk/blob/master/SilentMoonwalk/SilentMoonwalk.cpp"
click node_sm_helpers "https://github.com/klezvirus/silentmoonwalk/blob/master/SilentMoonwalk/include/Functions.h"
click node_sm_common "https://github.com/klezvirus/silentmoonwalk/blob/master/SilentMoonwalk/include/Common.h"
click node_sm_hunt "https://github.com/klezvirus/silentmoonwalk/blob/master/SilentMoonwalk/include/AddressHunter.h"
click node_sm_config "https://github.com/klezvirus/silentmoonwalk/blob/master/SilentMoonwalk/include/Spoof.h"
click node_sm_asm "https://github.com/klezvirus/silentmoonwalk/tree/master/SilentMoonwalk/include/asm"
click node_ins_entry "https://github.com/klezvirus/silentmoonwalk/blob/master/UnwindInspector/UnwindInspector.cpp"
click node_ins_helpers "https://github.com/klezvirus/silentmoonwalk/blob/master/UnwindInspector/include/Functions.h"
click node_ins_common "https://github.com/klezvirus/silentmoonwalk/blob/master/UnwindInspector/include/Common.h"
click node_ins_hunt "https://github.com/klezvirus/silentmoonwalk/blob/master/UnwindInspector/include/AddressHunter.h"
click node_eclipse_entry "https://github.com/klezvirus/silentmoonwalk/blob/master/Eclipse/Eclipse.cpp"
click node_disassembler "https://github.com/klezvirus/silentmoonwalk/blob/master/Eclipse/hde64.h"
click node_decode_tables "https://github.com/klezvirus/silentmoonwalk/blob/master/Eclipse/table64.h"
click node_scan_helpers "https://github.com/klezvirus/silentmoonwalk/blob/master/Eclipse/Functions.h"
click node_timing "https://github.com/klezvirus/silentmoonwalk/blob/master/Eclipse/Performance.h"

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_sm_entry,node_sm_helpers,node_sm_common,node_sm_hunt,node_sm_config,node_sm_asm toneBlue
class node_ins_entry,node_ins_helpers,node_ins_common,node_ins_hunt toneAmber
class node_eclipse_entry,node_disassembler,node_decode_tables,node_scan_helpers,node_timing,node_target_api toneMint
class node_user,node_module toneIndigo
```

## Components

### Stack Spoofing

- [Spoof Demo](https://github.com/klezvirus/silentmoonwalk/blob/master/SilentMoonwalk/SilentMoonwalk.cpp): `SilentMoonwalk/SilentMoonwalk.cpp`
- [Unwind Helpers](https://github.com/klezvirus/silentmoonwalk/blob/master/SilentMoonwalk/include/Functions.h): `SilentMoonwalk/include/Functions.h`
- [Runtime Types](https://github.com/klezvirus/silentmoonwalk/blob/master/SilentMoonwalk/include/Common.h): `SilentMoonwalk/include/Common.h`
- [Module Lookup](https://github.com/klezvirus/silentmoonwalk/blob/master/SilentMoonwalk/include/AddressHunter.h): `SilentMoonwalk/include/AddressHunter.h`
- [Spoof Config](https://github.com/klezvirus/silentmoonwalk/blob/master/SilentMoonwalk/include/Spoof.h): `SilentMoonwalk/include/Spoof.h`
- [Call Stubs](https://github.com/klezvirus/silentmoonwalk/tree/master/SilentMoonwalk/include/asm): `SilentMoonwalk/include/asm`

### Unwind Inspection

- [Inspector CLI](https://github.com/klezvirus/silentmoonwalk/blob/master/UnwindInspector/UnwindInspector.cpp): `UnwindInspector/UnwindInspector.cpp`
- [Unwind Helpers](https://github.com/klezvirus/silentmoonwalk/blob/master/UnwindInspector/include/Functions.h): `UnwindInspector/include/Functions.h`
- [Runtime Types](https://github.com/klezvirus/silentmoonwalk/blob/master/UnwindInspector/include/Common.h): `UnwindInspector/include/Common.h`
- [Module Lookup](https://github.com/klezvirus/silentmoonwalk/blob/master/UnwindInspector/include/AddressHunter.h): `UnwindInspector/include/AddressHunter.h`

### Process Scanning

- [Process Scanner](https://github.com/klezvirus/silentmoonwalk/blob/master/Eclipse/Eclipse.cpp): `Eclipse/Eclipse.cpp`
- [x64 Disassembler](https://github.com/klezvirus/silentmoonwalk/blob/master/Eclipse/hde64.h): `Eclipse/hde64.h`
- [Decode Tables](https://github.com/klezvirus/silentmoonwalk/blob/master/Eclipse/table64.h): `Eclipse/table64.h`
- [Scan Helpers](https://github.com/klezvirus/silentmoonwalk/blob/master/Eclipse/Functions.h): `Eclipse/Functions.h`
- [Timing](https://github.com/klezvirus/silentmoonwalk/blob/master/Eclipse/Performance.h): `Eclipse/Performance.h`

### Other components

- **Operator**
- **Windows API**
- **Target DLL**

## Connections

- Operator → Spoof Demo: runs demo (evidence: `README.md`)
- Spoof Demo → Unwind Helpers: finds frames (evidence: `SilentMoonwalk/SilentMoonwalk.cpp`)
- Spoof Demo → Spoof Config: spoofs call (evidence: `README.md`)
- Spoof Demo → Module Lookup: looks up modules
- Runtime Types → Module Lookup: uses lookup (evidence: `SilentMoonwalk/include/Common.h`)
- Spoof Config → Runtime Types: uses types (evidence: `SilentMoonwalk/include/Spoof.h`)
- Spoof Config → Call Stubs: dispatches call
- Call Stubs → Windows API: calls target
- Operator → Inspector CLI: runs query (evidence: `README.md`)
- Inspector CLI → Unwind Helpers: queries unwind data (evidence: `UnwindInspector/UnwindInspector.cpp`)
- Inspector CLI → Runtime Types: uses definitions (evidence: `UnwindInspector/UnwindInspector.cpp`)
- Runtime Types → Module Lookup: uses lookup (evidence: `UnwindInspector/include/Common.h`)
- Inspector CLI → Target DLL: inspects module (evidence: `README.md`)
- Operator → Process Scanner: scans process (evidence: `Eclipse/Eclipse.cpp`)
- Process Scanner → x64 Disassembler: decodes call sites (evidence: `Eclipse/Eclipse.cpp`)
- Process Scanner → Timing: measures duration (evidence: `Eclipse/Eclipse.cpp`)
- x64 Disassembler → Decode Tables: uses tables
