# nyan-x-cat/csharp-runpe architecture

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

- Interactive diagram: https://gitdiagram.com/nyan-x-cat/csharp-runpe
- Repository: https://github.com/nyan-x-cat/csharp-runpe

## Overview

RunPE is a small Windows process-manipulation library. A caller supplies an executable path and payload bytes to `RunPE.Execute`; it creates a suspended process, replaces its image contents, updates the thread context, and resumes it. Failures trigger process termination and a retry. The implementation dynamically binds Windows APIs. The repository has no README, and the sampled source is the sole runtime module, so the graph keeps these operations within that component rather than inventing separate subsystem boundaries.

Main entry points: [`RunPE/RunPE.cs`](https://github.com/nyan-x-cat/csharp-runpe/blob/master/RunPE/RunPE.cs) (RunPE execution)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_caller(("Library caller"))
node_runpe["RunPE execution<br/>[RunPE.cs]"]
node_windows["Windows APIs"]

node_caller -->|"calls Execute"| node_runpe
node_runpe -->|"creates and modifies process"| node_windows

click node_runpe "https://github.com/nyan-x-cat/csharp-runpe/blob/master/RunPE/RunPE.cs"

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_caller toneIndigo
class node_runpe toneTeal
class node_windows toneMint
```

## Components

### Other components

- **Library caller**
- [RunPE execution](https://github.com/nyan-x-cat/csharp-runpe/blob/master/RunPE/RunPE.cs): `RunPE/RunPE.cs`
- **Windows APIs**

## Connections

- Library caller → RunPE execution: calls Execute (evidence: `RunPE/RunPE.cs`)
- RunPE execution → Windows APIs: creates and modifies process (evidence: `RunPE/RunPE.cs`)
