# joasasantos/syswhispers4 architecture

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

- Interactive diagram: https://gitdiagram.com/joasasantos/syswhispers4
- Repository: https://github.com/joasasantos/syswhispers4

## Overview

SysWhispers4 is a Python generator for Windows NT syscall stubs. A user selects syscall functions and generation options through the CLI; the tool builds a configuration, uses repository data and generation helpers, and emits C headers/source plus assembly where applicable. The generated code supports multiple SSN-resolution and syscall-invocation strategies, alongside optional evasion features. The graph also shows the prototype, preset, and syscall-number data used by the tool. Source excerpts are partial, so runtime links beyond documented capabilities are omitted where their wiring is not shown.

Main entry points: [`core/utils.py`](https://github.com/joasasantos/syswhispers4/blob/main/core/utils.py) (Data Utilities), [`core/generator.py`](https://github.com/joasasantos/syswhispers4/blob/main/core/generator.py) (Stub Generator), [`syswhispers.py`](https://github.com/joasasantos/syswhispers4/blob/main/syswhispers.py) (CLI), [`core/models.py`](https://github.com/joasasantos/syswhispers4/blob/main/core/models.py) (Generator Config)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["CLI and Configuration"]
  node_cli["CLI<br/>[syswhispers.py]"]
  node_config["Generator Config<br/>[models.py]"]
end

subgraph group_generation["Code Generation"]
  node_generator["Stub Generator<br/>[generator.py]"]
  node_obfuscator["Obfuscation Helpers<br/>[obfuscator.py]"]
  node_artifacts["Generated C and ASM<br/>[generator.py]"]
end

subgraph group_catalog["Function and SSN Data"]
  node_utilities["Data Utilities<br/>[utils.py]"]
  node_prototypes["Syscall Prototypes<br/>[prototypes.json]"]
  node_presets["Function Presets<br/>[presets.json]"]
  node_ssn64["x64 SSN Table"]
  node_ssn86["x86 SSN Table"]
end

subgraph group_runtime["Generated Runtime"]
  node_resolution["SSN Resolution<br/>[generator.py]"]
  node_invocation["Syscall Invocation<br/>[generator.py]"]
  node_evasion["Evasion Features<br/>[generator.py]"]
end

node_user(("User"))
node_ntdll["Windows ntdll"]
node_kernel["Windows NT Kernel"]

node_user -->|"runs"| node_cli
node_cli -->|"builds"| node_config
node_cli -->|"loads selections"| node_utilities
node_cli -->|"configures"| node_generator
node_generator -->|"uses"| node_config
node_generator -->|"uses"| node_obfuscator
node_generator -->|"uses"| node_utilities
node_utilities -->|"loads"| node_prototypes
node_utilities -->|"loads"| node_presets
node_utilities -->|"loads"| node_ssn64
node_utilities -->|"loads"| node_ssn86
node_generator -->|"generates"| node_artifacts
node_artifacts -->|"includes"| node_resolution
node_artifacts -->|"includes"| node_invocation
node_artifacts -->|"optionally includes"| node_evasion
node_resolution -->|"reads SSNs"| node_ntdll
node_evasion -.->|"may remap"| node_ntdll
node_invocation -->|"invokes NT calls"| node_kernel

click node_cli "https://github.com/joasasantos/syswhispers4/blob/main/syswhispers.py"
click node_config "https://github.com/joasasantos/syswhispers4/blob/main/core/models.py"
click node_generator "https://github.com/joasasantos/syswhispers4/blob/main/core/generator.py"
click node_obfuscator "https://github.com/joasasantos/syswhispers4/blob/main/core/obfuscator.py"
click node_utilities "https://github.com/joasasantos/syswhispers4/blob/main/core/utils.py"
click node_prototypes "https://github.com/joasasantos/syswhispers4/blob/main/data/prototypes.json"
click node_presets "https://github.com/joasasantos/syswhispers4/blob/main/data/presets.json"
click node_ssn64 "https://github.com/joasasantos/syswhispers4/blob/main/data/syscalls_nt_x64.json"
click node_ssn86 "https://github.com/joasasantos/syswhispers4/blob/main/data/syscalls_nt_x86.json"
click node_artifacts "https://github.com/joasasantos/syswhispers4/blob/main/core/generator.py"
click node_resolution "https://github.com/joasasantos/syswhispers4/blob/main/core/generator.py"
click node_invocation "https://github.com/joasasantos/syswhispers4/blob/main/core/generator.py"
click node_evasion "https://github.com/joasasantos/syswhispers4/blob/main/core/generator.py"

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_config,node_user toneBlue
class node_generator,node_obfuscator,node_artifacts toneAmber
class node_utilities,node_prototypes,node_presets,node_ssn64,node_ssn86 toneMint
class node_resolution,node_invocation,node_evasion toneRose
class node_ntdll,node_kernel toneIndigo
```

## Components

### CLI and Configuration

- [CLI](https://github.com/joasasantos/syswhispers4/blob/main/syswhispers.py): `syswhispers.py`
- [Generator Config](https://github.com/joasasantos/syswhispers4/blob/main/core/models.py): `core/models.py`

### Code Generation

- [Stub Generator](https://github.com/joasasantos/syswhispers4/blob/main/core/generator.py): `core/generator.py`
- [Obfuscation Helpers](https://github.com/joasasantos/syswhispers4/blob/main/core/obfuscator.py): `core/obfuscator.py`
- [Generated C and ASM](https://github.com/joasasantos/syswhispers4/blob/main/core/generator.py): `core/generator.py`

### Function and SSN Data

- [Data Utilities](https://github.com/joasasantos/syswhispers4/blob/main/core/utils.py): `core/utils.py`
- [Syscall Prototypes](https://github.com/joasasantos/syswhispers4/blob/main/data/prototypes.json): `data/prototypes.json`
- [Function Presets](https://github.com/joasasantos/syswhispers4/blob/main/data/presets.json): `data/presets.json`
- [x64 SSN Table](https://github.com/joasasantos/syswhispers4/blob/main/data/syscalls_nt_x64.json): `data/syscalls_nt_x64.json`
- [x86 SSN Table](https://github.com/joasasantos/syswhispers4/blob/main/data/syscalls_nt_x86.json): `data/syscalls_nt_x86.json`

### Generated Runtime

- [SSN Resolution](https://github.com/joasasantos/syswhispers4/blob/main/core/generator.py): `core/generator.py`
- [Syscall Invocation](https://github.com/joasasantos/syswhispers4/blob/main/core/generator.py): `core/generator.py`
- [Evasion Features](https://github.com/joasasantos/syswhispers4/blob/main/core/generator.py): `core/generator.py`

### Other components

- **User**
- **Windows ntdll**
- **Windows NT Kernel**

## Connections

- User → CLI: runs (evidence: `README.md`)
- CLI → Generator Config: builds (evidence: `syswhispers.py`)
- CLI → Data Utilities: loads selections (evidence: `syswhispers.py`)
- CLI → Stub Generator: configures (evidence: `syswhispers.py`)
- Stub Generator → Generator Config: uses (evidence: `core/generator.py`)
- Stub Generator → Obfuscation Helpers: uses (evidence: `core/generator.py`)
- Stub Generator → Data Utilities: uses (evidence: `core/generator.py`)
- Data Utilities → Syscall Prototypes: loads (evidence: `core/utils.py`)
- Data Utilities → Function Presets: loads (evidence: `core/utils.py`)
- Data Utilities → x64 SSN Table: loads (evidence: `core/utils.py`)
- Data Utilities → x86 SSN Table: loads (evidence: `core/utils.py`)
- Stub Generator → Generated C and ASM: generates (evidence: `README.md`)
- Generated C and ASM → SSN Resolution: includes (evidence: `README.md`)
- Generated C and ASM → Syscall Invocation: includes (evidence: `README.md`)
- Generated C and ASM → Evasion Features: optionally includes (evidence: `syswhispers.py`)
- SSN Resolution → Windows ntdll: reads SSNs (evidence: `README.md`)
- Evasion Features → Windows ntdll: may remap (evidence: `README.md`)
- Syscall Invocation → Windows NT Kernel: invokes NT calls (evidence: `README.md`)
