# school-cheating/sebpatch architecture

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

- Interactive diagram: https://gitdiagram.com/school-cheating/sebpatch
- Repository: https://github.com/school-cheating/sebpatch

## Overview

##### Project type and purpose
- This is a small Windows desktop patch-utility (WinForms) that loads Safe Exam Browser executables (x86/x64), applies byte-level patches, and writes out modified binaries. It’s an open-source tool intended to bypass SEB restrictions.

##### File structure
- The entire patch utility lives under the “patch-seb” folder.
- Program.cs – application entry point.
- Form1.cs/.Designer.cs – WinForms UI (buttons, dialogs).
- Resources/x64 and x86 – original SEB .exe files embedded.
- Settings, Resources, manifest – configuration and embedded resources.
- No backend or external services—this is a single-process, single-UI desktop app.
- No build scripts beyond the .csproj, and no database or network.

##### README
- Confirms it’s a patch for SEB version 3.9.0.787.
- No complex dependencies; uses standard .NET WinForms.

##### Be detailed
- Call out the manifest/configuration to show how resources are embedded.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Subgraphs
    subgraph "User Interface Layer"
        direction TB
        UI1["Form1.cs"]:::ui
        UI2["Form1.Designer.cs"]:::ui
        UI3["Form1.resx"]:::ui
    end

    subgraph "Application Entry Point"
        direction TB
        Entry["Program.cs"]:::ui
    end

    subgraph "Core Logic"
        direction TB
        Engine["Patch Engine"]:::core
    end

    subgraph "Resource Manager"
        direction TB
        ResX86Exe["SafeExamBrowser.exe (x86)"]:::data
        ResX86Client["SafeExamBrowser.Client.exe (x86)"]:::data
        ResX64Exe["SafeExamBrowser.exe (x64)"]:::data
        ResX64Client["SafeExamBrowser.Client.exe (x64)"]:::data
    end

    subgraph "File System I/O"
        direction TB
        FSIO["File Read/Write"]:::data
    end

    subgraph "Configuration & Settings"
        direction TB
        ConfigRes["Resources.resx"]:::data
        ConfigResDesigner["Resources.Designer.cs"]:::data
        SettingsFile["Settings.settings"]:::data
        SettingsDesigner["Settings.Designer.cs"]:::data
        CSProj["patch-seb.csproj"]:::data
        Manifest["app.manifest"]:::data
        AppConfig["App.config"]:::data
        AssemblyInfo["AssemblyInfo.cs"]:::data
    end

    ExternalOS["Windows OS"]:::external

    %% Connections
    Entry -->|"Start Application"| UI1
    UI1 -->|"Select Version"| ResX86Exe
    UI1 --> ResX86Client
    UI1 --> ResX64Exe
    UI1 --> ResX64Client
    UI1 -->|"Invoke Patch"| Engine
    Engine -->|"Return Patched Blob"| UI1
    UI1 -->|"Save File"| FSIO
    FSIO -->|"Write EXE"| ExternalOS
    UI1 -->|"Load/Save Preferences"| SettingsFile
    SettingsFile --> SettingsDesigner
    UI1 -->|"Embedded Resource Access"| ConfigRes
    ConfigRes --> ConfigResDesigner
    UI1 -->|"Uses Manifest & Config"| Manifest
    UI1 --> AppConfig
    UI1 --> CSProj
    UI1 --> AssemblyInfo
    UI1 --> ExternalOS

    %% Click Events
    click UI1 "https://github.com/school-cheating/sebpatch/blob/3.9.0.787/patch-seb/Form1.cs"
    click UI2 "https://github.com/school-cheating/sebpatch/blob/3.9.0.787/patch-seb/Form1.Designer.cs"
    click UI3 "https://github.com/school-cheating/sebpatch/blob/3.9.0.787/patch-seb/Form1.resx"
    click Entry "https://github.com/school-cheating/sebpatch/blob/3.9.0.787/patch-seb/Program.cs"
    click Engine "https://github.com/school-cheating/sebpatch/blob/3.9.0.787/patch-seb/Form1.cs"
    click ResX86Exe "https://github.com/school-cheating/sebpatch/blob/3.9.0.787/patch-seb/Resources/x86/SafeExamBrowser.exe"
    click ResX86Client "https://github.com/school-cheating/sebpatch/blob/3.9.0.787/patch-seb/Resources/x86/SafeExamBrowser.Client.exe"
    click ResX64Exe "https://github.com/school-cheating/sebpatch/blob/3.9.0.787/patch-seb/Resources/x64/SafeExamBrowser.exe"
    click ResX64Client "https://github.com/school-cheating/sebpatch/blob/3.9.0.787/patch-seb/Resources/x64/SafeExamBrowser.Client.exe"
    click ConfigRes "https://github.com/school-cheating/sebpatch/blob/3.9.0.787/patch-seb/Properties/Resources.resx"
    click ConfigResDesigner "https://github.com/school-cheating/sebpatch/blob/3.9.0.787/patch-seb/Properties/Resources.Designer.cs"
    click SettingsFile "https://github.com/school-cheating/sebpatch/blob/3.9.0.787/patch-seb/Properties/Settings.settings"
    click SettingsDesigner "https://github.com/school-cheating/sebpatch/blob/3.9.0.787/patch-seb/Properties/Settings.Designer.cs"
    click CSProj "https://github.com/school-cheating/sebpatch/blob/3.9.0.787/patch-seb/patch-seb.csproj"
    click Manifest "https://github.com/school-cheating/sebpatch/blob/3.9.0.787/patch-seb/app.manifest"
    click AppConfig "https://github.com/school-cheating/sebpatch/blob/3.9.0.787/patch-seb/App.config"
    click AssemblyInfo "https://github.com/school-cheating/sebpatch/blob/3.9.0.787/patch-seb/Properties/AssemblyInfo.cs"

    %% Styles
    classDef ui fill:#cce5ff,stroke:#004085,color:#004085
    classDef core fill:#d4edda,stroke:#155724,color:#155724
    classDef data fill:#fff3cd,stroke:#856404,color:#856404
    classDef external fill:#e2e3e5,stroke:#6c757d,color:#6c757d
```
