# g0ttfrid/steal365 architecture

> Architecture diagram of the GitHub repository g0ttfrid/steal365, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/g0ttfrid/steal365
- Repository: https://github.com/g0ttfrid/steal365

## Overview

##### Project type and purpose
- This is a small command-line memory-dumping tool (written in C#) whose sole purpose is to locate and extract Office 365 access tokens from the memory of running Office desktop applications. It ships as a console executable (`Steal365.exe`) and includes an accompanying PowerShell wrapper (`Steal365.ps1`) for ease of invocation.

##### File structure
- Top level:
– Program.cs – entry point & orchestration logic
– Class1.cs – contains one or more classes (likely encapsulating memory-scanning or token-parsing logic)
– Steal365.ps1 – PowerShell bootstrap that invokes the compiled EXE with any required parameters or environment setup
– README.md – documents purpose and usage
- No subdirectories indicates a single-module, library-light, console application
- No external config files – all behavior is embedded in code
- Build/deploy target: .NET runtime on Windows

##### README for additional insights
- We see the runtime workflow: iterate a hard-coded list of Office process names, attempt to “dump” memory if the process is running, scan for valid tokens, then print them to the console.
- No mention of network calls or dependencies on outside services at runtime – purely local memory scanning and pattern matching.

##### Diagramming recommendations
– Blue for internal modules
– Green for external OS & Office processes
– Yellow for scripting layer (PowerShell)
– Rounded rectangles for modules
– Clouds for external systems

##### Detail is critical but keep it focused
- Six components above.
[PowerShell Wrapper] → [CLI Entry Point] → [Memory Scanner] → [Token Parser] → [Console Output]

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Scripting Layer
    PS["PowerShell Wrapper"]:::scripting
    CLI["CLI / Entry Point"]:::internal
    Scanner["Memory Scanner Module"]:::internal
    Parser["Token Parser & Validator Module"]:::internal
    Output["Console Output / Logger"]:::internal

    subgraph "Office Processes" 
        direction TB
        OP["Office Processes\n(Word, Outlook, OneDrive)"]:::external
    end

    %% Flow
    PS -->|"invokes"| CLI
    CLI -->|"for each app calls"| Scanner
    Scanner -->|"ReadProcessMemory"| OP
    Scanner -->|"raw data"| Parser
    Parser -->|"valid tokens"| Output

    %% Click events
    click PS "https://github.com/g0ttfrid/steal365/blob/main/Steal365.ps1"
    click CLI "https://github.com/g0ttfrid/steal365/blob/main/Program.cs"
    click Scanner "https://github.com/g0ttfrid/steal365/blob/main/Class1.cs"
    click Parser "https://github.com/g0ttfrid/steal365/blob/main/Class1.cs"
    click Output "https://github.com/g0ttfrid/steal365/blob/main/Program.cs"
    click README "https://github.com/g0ttfrid/steal365/blob/main/README.md"

    %% Styles
    classDef internal fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef external fill:#90EE90,stroke:#000,stroke-width:1px
    classDef scripting fill:#FFD700,stroke:#000,stroke-width:1px
```
