# n7on/dllspy architecture

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

- Interactive diagram: https://gitdiagram.com/n7on/dllspy
- Repository: https://github.com/n7on/dllspy

## Overview

DllSpy inspects compiled .NET assemblies without running them, discovering input surfaces and evaluating their authorization configuration for security issues. Users can start the scan through either the CLI or PowerShell: both invoke the shared scanner, which dispatches framework-specific discovery and produces an assembly report. The CLI filters and formats results; PowerShell emits surfaces or issues as objects. The README documents eight supported surface types, represented here as separate discovery branches. Some internal wiring is based on the scanner’s documented dispatch structure; unsampled details are left out.

Main entry points: [`src/DllSpy.Core/Services/AssemblyScanner.cs`](https://github.com/n7on/dllspy/blob/main/src/DllSpy.Core/Services/AssemblyScanner.cs) (Assembly scanner), [`src/DllSpy.Cli/Program.cs`](https://github.com/n7on/dllspy/blob/main/src/DllSpy.Cli/Program.cs) (CLI), [`src/DllSpy.PowerShell/Commands/SearchDllSpyCommand.cs`](https://github.com/n7on/dllspy/blob/main/src/DllSpy.PowerShell/Commands/SearchDllSpyCommand.cs) (Search cmdlet), [`src/DllSpy.PowerShell/Commands/TestDllSpyCommand.cs`](https://github.com/n7on/dllspy/blob/main/src/DllSpy.PowerShell/Commands/TestDllSpyCommand.cs) (Test cmdlet)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entrypoints["User interfaces"]
  node_cli["CLI<br/>[Program.cs]"]
  node_ps_search["Search cmdlet"]
  node_ps_test["Test cmdlet"]
end

subgraph group_scanning["Assembly scanning"]
  node_factory["Scanner factory<br/>[ScannerFactory.cs]"]
  node_scanner["Assembly scanner<br/>[AssemblyScanner.cs]"]
  node_reflection["Reflection helpers"]
end

subgraph group_discovery["Surface discovery"]
  node_http["HTTP discovery"]
  node_signalr["SignalR discovery"]
  node_wcf["WCF discovery<br/>[WcfDiscovery.cs]"]
  node_grpc["gRPC discovery<br/>[GrpcDiscovery.cs]"]
  node_razor["Razor discovery"]
  node_blazor["Blazor discovery<br/>[BlazorDiscovery.cs]"]
  node_azure["Azure Functions"]
  node_odata["OData discovery<br/>[ODataDiscovery.cs]"]
end

subgraph group_analysis["Security analysis"]
  node_attributes["Attribute analysis"]
  node_security["Security resolver"]
end

subgraph group_results["Reports and output"]
  node_report["Assembly report<br/>[AssemblyReport.cs]"]
  node_cli_output["CLI output<br/>[OutputWriter.cs]"]
  node_ps_output["PowerShell objects<br/>[SpyCmdletBase.cs]"]
end

node_user(("User"))
node_assembly[".NET assembly"]

node_user -->|"invokes"| node_cli
node_user -->|"invokes"| node_ps_search
node_user -->|"invokes"| node_ps_test
node_assembly -->|"scanned by"| node_scanner
node_cli -->|"creates scanner"| node_factory
node_ps_search -->|"creates scanner"| node_factory
node_ps_test -->|"creates scanner"| node_factory
node_factory -->|"creates"| node_scanner
node_cli -->|"scans assembly"| node_scanner
node_ps_search -->|"scans assembly"| node_scanner
node_ps_test -->|"scans assembly"| node_scanner
node_scanner -->|"dispatches discovery"| node_http
node_scanner -->|"dispatches discovery"| node_signalr
node_scanner -->|"dispatches discovery"| node_wcf
node_scanner -->|"dispatches discovery"| node_grpc
node_scanner -->|"dispatches discovery"| node_razor
node_scanner -->|"dispatches discovery"| node_blazor
node_scanner -->|"dispatches discovery"| node_azure
node_scanner -->|"dispatches discovery"| node_odata
node_http -->|"loads types"| node_reflection
node_http -->|"reads attributes"| node_attributes
node_http -->|"resolves authorization"| node_security
node_scanner -->|"builds report"| node_report
node_scanner -->|"analyzes issues"| node_attributes
node_cli -->|"prints results"| node_cli_output
node_ps_search -->|"emits surfaces"| node_ps_output
node_ps_test -->|"emits issues"| node_ps_output

click node_cli "https://github.com/n7on/dllspy/blob/main/src/DllSpy.Cli/Program.cs"
click node_ps_search "https://github.com/n7on/dllspy/blob/main/src/DllSpy.PowerShell/Commands/SearchDllSpyCommand.cs"
click node_ps_test "https://github.com/n7on/dllspy/blob/main/src/DllSpy.PowerShell/Commands/TestDllSpyCommand.cs"
click node_factory "https://github.com/n7on/dllspy/blob/main/src/DllSpy.Core/Services/ScannerFactory.cs"
click node_scanner "https://github.com/n7on/dllspy/blob/main/src/DllSpy.Core/Services/AssemblyScanner.cs"
click node_reflection "https://github.com/n7on/dllspy/blob/main/src/DllSpy.Core/Helpers/ReflectionHelper.cs"
click node_http "https://github.com/n7on/dllspy/blob/main/src/DllSpy.Core/Services/HttpEndpointDiscovery.cs"
click node_signalr "https://github.com/n7on/dllspy/blob/main/src/DllSpy.Core/Services/SignalRDiscovery.cs"
click node_wcf "https://github.com/n7on/dllspy/blob/main/src/DllSpy.Core/Services/WcfDiscovery.cs"
click node_grpc "https://github.com/n7on/dllspy/blob/main/src/DllSpy.Core/Services/GrpcDiscovery.cs"
click node_razor "https://github.com/n7on/dllspy/blob/main/src/DllSpy.Core/Services/RazorPageDiscovery.cs"
click node_blazor "https://github.com/n7on/dllspy/blob/main/src/DllSpy.Core/Services/BlazorDiscovery.cs"
click node_azure "https://github.com/n7on/dllspy/blob/main/src/DllSpy.Core/Services/AzureFunctionDiscovery.cs"
click node_odata "https://github.com/n7on/dllspy/blob/main/src/DllSpy.Core/Services/ODataDiscovery.cs"
click node_attributes "https://github.com/n7on/dllspy/blob/main/src/DllSpy.Core/Services/AttributeAnalyzer.cs"
click node_security "https://github.com/n7on/dllspy/blob/main/src/DllSpy.Core/Services/SecurityResolver.cs"
click node_report "https://github.com/n7on/dllspy/blob/main/src/DllSpy.Core/Contracts/AssemblyReport.cs"
click node_cli_output "https://github.com/n7on/dllspy/blob/main/src/DllSpy.Cli/OutputWriter.cs"
click node_ps_output "https://github.com/n7on/dllspy/blob/main/src/DllSpy.PowerShell/Commands/SpyCmdletBase.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_cli,node_ps_search,node_ps_test,node_user toneBlue
class node_factory,node_scanner,node_reflection toneAmber
class node_http,node_signalr,node_wcf,node_grpc,node_razor,node_blazor,node_azure,node_odata toneMint
class node_attributes,node_security toneRose
class node_report,node_cli_output,node_ps_output,node_assembly toneIndigo
```

## Components

### User interfaces

- [CLI](https://github.com/n7on/dllspy/blob/main/src/DllSpy.Cli/Program.cs): `src/DllSpy.Cli/Program.cs`
- [Search cmdlet](https://github.com/n7on/dllspy/blob/main/src/DllSpy.PowerShell/Commands/SearchDllSpyCommand.cs): `src/DllSpy.PowerShell/Commands/SearchDllSpyCommand.cs`
- [Test cmdlet](https://github.com/n7on/dllspy/blob/main/src/DllSpy.PowerShell/Commands/TestDllSpyCommand.cs): `src/DllSpy.PowerShell/Commands/TestDllSpyCommand.cs`

### Assembly scanning

- [Scanner factory](https://github.com/n7on/dllspy/blob/main/src/DllSpy.Core/Services/ScannerFactory.cs): `src/DllSpy.Core/Services/ScannerFactory.cs`
- [Assembly scanner](https://github.com/n7on/dllspy/blob/main/src/DllSpy.Core/Services/AssemblyScanner.cs): `src/DllSpy.Core/Services/AssemblyScanner.cs`
- [Reflection helpers](https://github.com/n7on/dllspy/blob/main/src/DllSpy.Core/Helpers/ReflectionHelper.cs): `src/DllSpy.Core/Helpers/ReflectionHelper.cs`

### Surface discovery

- [HTTP discovery](https://github.com/n7on/dllspy/blob/main/src/DllSpy.Core/Services/HttpEndpointDiscovery.cs): `src/DllSpy.Core/Services/HttpEndpointDiscovery.cs`
- [SignalR discovery](https://github.com/n7on/dllspy/blob/main/src/DllSpy.Core/Services/SignalRDiscovery.cs): `src/DllSpy.Core/Services/SignalRDiscovery.cs`
- [WCF discovery](https://github.com/n7on/dllspy/blob/main/src/DllSpy.Core/Services/WcfDiscovery.cs): `src/DllSpy.Core/Services/WcfDiscovery.cs`
- [gRPC discovery](https://github.com/n7on/dllspy/blob/main/src/DllSpy.Core/Services/GrpcDiscovery.cs): `src/DllSpy.Core/Services/GrpcDiscovery.cs`
- [Razor discovery](https://github.com/n7on/dllspy/blob/main/src/DllSpy.Core/Services/RazorPageDiscovery.cs): `src/DllSpy.Core/Services/RazorPageDiscovery.cs`
- [Blazor discovery](https://github.com/n7on/dllspy/blob/main/src/DllSpy.Core/Services/BlazorDiscovery.cs): `src/DllSpy.Core/Services/BlazorDiscovery.cs`
- [Azure Functions](https://github.com/n7on/dllspy/blob/main/src/DllSpy.Core/Services/AzureFunctionDiscovery.cs): `src/DllSpy.Core/Services/AzureFunctionDiscovery.cs`
- [OData discovery](https://github.com/n7on/dllspy/blob/main/src/DllSpy.Core/Services/ODataDiscovery.cs): `src/DllSpy.Core/Services/ODataDiscovery.cs`

### Security analysis

- [Attribute analysis](https://github.com/n7on/dllspy/blob/main/src/DllSpy.Core/Services/AttributeAnalyzer.cs): `src/DllSpy.Core/Services/AttributeAnalyzer.cs`
- [Security resolver](https://github.com/n7on/dllspy/blob/main/src/DllSpy.Core/Services/SecurityResolver.cs): `src/DllSpy.Core/Services/SecurityResolver.cs`

### Reports and output

- [Assembly report](https://github.com/n7on/dllspy/blob/main/src/DllSpy.Core/Contracts/AssemblyReport.cs): `src/DllSpy.Core/Contracts/AssemblyReport.cs`
- [CLI output](https://github.com/n7on/dllspy/blob/main/src/DllSpy.Cli/OutputWriter.cs): `src/DllSpy.Cli/OutputWriter.cs`
- [PowerShell objects](https://github.com/n7on/dllspy/blob/main/src/DllSpy.PowerShell/Commands/SpyCmdletBase.cs): `src/DllSpy.PowerShell/Commands/SpyCmdletBase.cs`

### Other components

- **User**
- **.NET assembly**

## Connections

- User → CLI: invokes
- User → Search cmdlet: invokes
- User → Test cmdlet: invokes
- .NET assembly → Assembly scanner: scanned by
- CLI → Scanner factory: creates scanner
- Search cmdlet → Scanner factory: creates scanner
- Test cmdlet → Scanner factory: creates scanner
- Scanner factory → Assembly scanner: creates
- CLI → Assembly scanner: scans assembly
- Search cmdlet → Assembly scanner: scans assembly
- Test cmdlet → Assembly scanner: scans assembly
- Assembly scanner → HTTP discovery: dispatches discovery
- Assembly scanner → SignalR discovery: dispatches discovery
- Assembly scanner → WCF discovery: dispatches discovery
- Assembly scanner → gRPC discovery: dispatches discovery
- Assembly scanner → Razor discovery: dispatches discovery
- Assembly scanner → Blazor discovery: dispatches discovery
- Assembly scanner → Azure Functions: dispatches discovery
- Assembly scanner → OData discovery: dispatches discovery
- HTTP discovery → Reflection helpers: loads types
- HTTP discovery → Attribute analysis: reads attributes
- HTTP discovery → Security resolver: resolves authorization
- Assembly scanner → Assembly report: builds report
- Assembly scanner → Attribute analysis: analyzes issues
- CLI → CLI output: prints results
- Search cmdlet → PowerShell objects: emits surfaces
- Test cmdlet → PowerShell objects: emits issues
