# epersic/dllparty architecture

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

- Interactive diagram: https://gitdiagram.com/epersic/dllparty
- Repository: https://github.com/epersic/dllparty

## Overview

DLLParty is a Windows research proof of concept for loading a DLL into a target process through its thread-pool worker machinery. The operator supplies a process ID; the program finds a worker factory and pool, recovers callback-instance slots, stages a DLL path and direct callback structure, then signals the pool’s completion port. A worker invokes LoadLibraryA, and the loaded DLL’s entry point displays a message. The implementation depends on undocumented, version-specific Windows internals. The README documents the overall technique; the graph’s implementation links are limited to the supplied source excerpts.

Main entry points: [`DLLParty.cpp`](https://github.com/epersic/dllparty/blob/main/DLLParty.cpp) (Injection coordinator), [`pool_worker_instances.cpp`](https://github.com/epersic/dllparty/blob/main/pool_worker_instances.cpp) (Callback slot scan), [`pool_worker_instances.hpp`](https://github.com/epersic/dllparty/blob/main/pool_worker_instances.hpp) (Slot scan interface), [`testDll.c`](https://github.com/epersic/dllparty/blob/main/testDll.c) (Test DLL)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Target discovery"]
  node_injector["Injection coordinator<br/>[DLLParty.cpp]"]
  node_type_defs["Native type definitions<br/>[types.hpp]"]
  node_worker_factory["Worker factory lookup<br/>[DLLParty.cpp]"]
  node_pool_layout["Pool metadata<br/>[types.hpp]"]
  node_slot_scan["Callback slot scan"]
  node_slot_interface["Slot scan interface"]
end

subgraph group_dispatch["Callback dispatch"]
  node_path_stage["DLL path staging<br/>[DLLParty.cpp]"]
  node_direct_callback["Direct callback setup<br/>[DLLParty.cpp]"]
  node_completion_dispatch["Completion dispatch<br/>[DLLParty.cpp]"]
end

subgraph group_payload["Loaded payload"]
  node_payload_dll["Test DLL<br/>[testDll.c]"]
  node_dll_entry["DLL entry point<br/>[testDll.c]"]
end

node_operator(("Operator"))
node_windows_native["Windows native APIs"]
node_worker_thread(("Pool worker thread"))
node_load_library["LoadLibraryA"]

node_operator -->|"supplies PID"| node_injector
node_injector -->|"uses definitions"| node_type_defs
node_injector -->|"queries handles"| node_windows_native
node_injector -->|"scans handles"| node_worker_factory
node_worker_factory -->|"queries factory"| node_windows_native
node_worker_factory -->|"reads pool"| node_pool_layout
node_injector -->|"requests slots"| node_slot_interface
node_slot_interface -->|"declares scan"| node_slot_scan
node_slot_scan -->|"reads remote memory"| node_windows_native
node_injector -->|"stages DLL path"| node_path_stage
node_path_stage -->|"writes remote memory"| node_windows_native
node_injector -->|"configures callback"| node_direct_callback
node_injector -->|"writes and signals"| node_completion_dispatch
node_completion_dispatch -->|"signals completion"| node_windows_native
node_completion_dispatch -.->|"queues callback"| node_worker_thread
node_worker_thread -->|"invokes callback"| node_load_library
node_load_library -->|"loads DLL"| node_payload_dll
node_payload_dll -->|"runs entry point"| node_dll_entry

click node_injector "https://github.com/epersic/dllparty/blob/main/DLLParty.cpp"
click node_type_defs "https://github.com/epersic/dllparty/blob/main/types.hpp"
click node_worker_factory "https://github.com/epersic/dllparty/blob/main/DLLParty.cpp"
click node_pool_layout "https://github.com/epersic/dllparty/blob/main/types.hpp"
click node_slot_scan "https://github.com/epersic/dllparty/blob/main/pool_worker_instances.cpp"
click node_slot_interface "https://github.com/epersic/dllparty/blob/main/pool_worker_instances.hpp"
click node_path_stage "https://github.com/epersic/dllparty/blob/main/DLLParty.cpp"
click node_direct_callback "https://github.com/epersic/dllparty/blob/main/DLLParty.cpp"
click node_completion_dispatch "https://github.com/epersic/dllparty/blob/main/DLLParty.cpp"
click node_payload_dll "https://github.com/epersic/dllparty/blob/main/testDll.c"
click node_dll_entry "https://github.com/epersic/dllparty/blob/main/testDll.c"

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_injector,node_type_defs,node_worker_factory,node_pool_layout,node_slot_scan,node_slot_interface toneBlue
class node_path_stage,node_direct_callback,node_completion_dispatch toneAmber
class node_payload_dll,node_dll_entry,node_windows_native toneMint
class node_operator,node_load_library toneIndigo
class node_worker_thread toneRose
```

## Components

### Target discovery

- [Injection coordinator](https://github.com/epersic/dllparty/blob/main/DLLParty.cpp): `DLLParty.cpp`
- [Native type definitions](https://github.com/epersic/dllparty/blob/main/types.hpp): `types.hpp`
- [Worker factory lookup](https://github.com/epersic/dllparty/blob/main/DLLParty.cpp): `DLLParty.cpp`
- [Pool metadata](https://github.com/epersic/dllparty/blob/main/types.hpp): `types.hpp`
- [Callback slot scan](https://github.com/epersic/dllparty/blob/main/pool_worker_instances.cpp): `pool_worker_instances.cpp`
- [Slot scan interface](https://github.com/epersic/dllparty/blob/main/pool_worker_instances.hpp): `pool_worker_instances.hpp`

### Callback dispatch

- [DLL path staging](https://github.com/epersic/dllparty/blob/main/DLLParty.cpp): `DLLParty.cpp`
- [Direct callback setup](https://github.com/epersic/dllparty/blob/main/DLLParty.cpp): `DLLParty.cpp`
- [Completion dispatch](https://github.com/epersic/dllparty/blob/main/DLLParty.cpp): `DLLParty.cpp`

### Loaded payload

- [Test DLL](https://github.com/epersic/dllparty/blob/main/testDll.c): `testDll.c`
- [DLL entry point](https://github.com/epersic/dllparty/blob/main/testDll.c): `testDll.c`

### Other components

- **Operator**
- **Windows native APIs**
- **Pool worker thread**
- **LoadLibraryA**

## Connections

- Operator → Injection coordinator: supplies PID (evidence: `DLLParty.cpp`)
- Injection coordinator → Native type definitions: uses definitions (evidence: `DLLParty.cpp`)
- Injection coordinator → Windows native APIs: queries handles (evidence: `DLLParty.cpp`)
- Injection coordinator → Worker factory lookup: scans handles (evidence: `DLLParty.cpp`)
- Worker factory lookup → Windows native APIs: queries factory (evidence: `DLLParty.cpp`)
- Worker factory lookup → Pool metadata: reads pool (evidence: `DLLParty.cpp`)
- Injection coordinator → Slot scan interface: requests slots (evidence: `DLLParty.cpp`)
- Slot scan interface → Callback slot scan: declares scan (evidence: `pool_worker_instances.hpp`)
- Callback slot scan → Windows native APIs: reads remote memory (evidence: `pool_worker_instances.cpp`)
- Injection coordinator → DLL path staging: stages DLL path (evidence: `DLLParty.cpp`)
- DLL path staging → Windows native APIs: writes remote memory (evidence: `DLLParty.cpp`)
- Injection coordinator → Direct callback setup: configures callback (evidence: `DLLParty.cpp`)
- Injection coordinator → Completion dispatch: writes and signals (evidence: `DLLParty.cpp`)
- Completion dispatch → Windows native APIs: signals completion (evidence: `DLLParty.cpp`)
- Completion dispatch → Pool worker thread: queues callback
- Pool worker thread → LoadLibraryA: invokes callback (evidence: `README.md`)
- LoadLibraryA → Test DLL: loads DLL (evidence: `README.md`)
- Test DLL → DLL entry point: runs entry point (evidence: `testDll.c`)
