# ghostoraner/telegram-session-stealer architecture

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

- Interactive diagram: https://gitdiagram.com/ghostoraner/telegram-session-stealer
- Repository: https://github.com/ghostoraner/telegram-session-stealer

## Overview

This is a disguised Telegram-session collection and Dropbox upload program presented as a calculator. The user opens the calculator UI, which starts a background worker; that worker searches local drives for Telegram tdata, closes Telegram, archives each result, uploads the archives, deletes local copies, and restarts Telegram. The graph reflects calls visible in main.py and capabilities documented in the README; it does not assume additional behavior beyond those sources.

Main entry points: [`main.py`](https://github.com/ghostoraner/telegram-session-stealer/blob/main/main.py) (Main Workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Calculator Interface"]
  node_calculator["Calculator UI<br/>[main.py]"]
  node_worker["Background Worker<br/>[main.py]"]
end

subgraph group_collection["Collection Workflow"]
  node_orchestrator["Main Workflow<br/>[main.py]"]
  node_drive_scan["Drive Enumeration<br/>[main.py]"]
  node_folder_search["tdata Search<br/>[main.py]"]
  node_telegram_control["Telegram Process Control<br/>[main.py]"]
end

subgraph group_transfer["Archive and Transfer"]
  node_archive["Archive Creation<br/>[main.py]"]
  node_temporary_archive["Temporary ZIP<br/>[main.py]"]
  node_dropbox_upload["Dropbox Upload<br/>[main.py]"]
  node_local_cleanup["Local Archive Cleanup<br/>[main.py]"]
end

node_user(("User"))
node_telegram["Telegram Processes"]
node_dropbox["Dropbox"]

node_user -->|"opens"| node_calculator
node_calculator -->|"starts"| node_worker
node_worker -->|"runs"| node_orchestrator
node_orchestrator -->|"searches"| node_drive_scan
node_drive_scan -->|"scans"| node_folder_search
node_folder_search -->|"recurses"| node_folder_search
node_orchestrator -->|"closes and restarts"| node_telegram_control
node_telegram_control -->|"kills and launches"| node_telegram
node_orchestrator -->|"archives folders"| node_archive
node_archive -->|"writes ZIP"| node_temporary_archive
node_orchestrator -->|"uploads archive"| node_dropbox_upload
node_dropbox_upload -->|"sends file"| node_dropbox
node_orchestrator -->|"deletes archive"| node_local_cleanup
node_local_cleanup -->|"removes file"| node_temporary_archive

click node_calculator "https://github.com/ghostoraner/telegram-session-stealer/blob/main/main.py"
click node_worker "https://github.com/ghostoraner/telegram-session-stealer/blob/main/main.py"
click node_orchestrator "https://github.com/ghostoraner/telegram-session-stealer/blob/main/main.py"
click node_drive_scan "https://github.com/ghostoraner/telegram-session-stealer/blob/main/main.py"
click node_folder_search "https://github.com/ghostoraner/telegram-session-stealer/blob/main/main.py"
click node_telegram_control "https://github.com/ghostoraner/telegram-session-stealer/blob/main/main.py"
click node_archive "https://github.com/ghostoraner/telegram-session-stealer/blob/main/main.py"
click node_temporary_archive "https://github.com/ghostoraner/telegram-session-stealer/blob/main/main.py"
click node_dropbox_upload "https://github.com/ghostoraner/telegram-session-stealer/blob/main/main.py"
click node_local_cleanup "https://github.com/ghostoraner/telegram-session-stealer/blob/main/main.py"

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_calculator,node_worker,node_user toneBlue
class node_orchestrator,node_drive_scan,node_folder_search,node_telegram_control toneAmber
class node_archive,node_temporary_archive,node_dropbox_upload,node_local_cleanup toneMint
class node_telegram,node_dropbox toneIndigo
```

## Components

### Calculator Interface

- [Calculator UI](https://github.com/ghostoraner/telegram-session-stealer/blob/main/main.py): `main.py`
- [Background Worker](https://github.com/ghostoraner/telegram-session-stealer/blob/main/main.py): `main.py`

### Collection Workflow

- [Main Workflow](https://github.com/ghostoraner/telegram-session-stealer/blob/main/main.py): `main.py`
- [Drive Enumeration](https://github.com/ghostoraner/telegram-session-stealer/blob/main/main.py): `main.py`
- [tdata Search](https://github.com/ghostoraner/telegram-session-stealer/blob/main/main.py): `main.py`
- [Telegram Process Control](https://github.com/ghostoraner/telegram-session-stealer/blob/main/main.py): `main.py`

### Archive and Transfer

- [Archive Creation](https://github.com/ghostoraner/telegram-session-stealer/blob/main/main.py): `main.py`
- [Temporary ZIP](https://github.com/ghostoraner/telegram-session-stealer/blob/main/main.py): `main.py`
- [Dropbox Upload](https://github.com/ghostoraner/telegram-session-stealer/blob/main/main.py): `main.py`
- [Local Archive Cleanup](https://github.com/ghostoraner/telegram-session-stealer/blob/main/main.py): `main.py`

### Other components

- **User**
- **Telegram Processes**
- **Dropbox**

## Connections

- User → Calculator UI: opens (evidence: `README.md`)
- Calculator UI → Background Worker: starts (evidence: `main.py`)
- Background Worker → Main Workflow: runs (evidence: `main.py`)
- Main Workflow → Drive Enumeration: searches (evidence: `main.py`)
- Drive Enumeration → tdata Search: scans (evidence: `main.py`)
- tdata Search → tdata Search: recurses (evidence: `main.py`)
- Main Workflow → Telegram Process Control: closes and restarts (evidence: `main.py`)
- Telegram Process Control → Telegram Processes: kills and launches (evidence: `main.py`)
- Main Workflow → Archive Creation: archives folders (evidence: `main.py`)
- Archive Creation → Temporary ZIP: writes ZIP (evidence: `main.py`)
- Main Workflow → Dropbox Upload: uploads archive (evidence: `main.py`)
- Dropbox Upload → Dropbox: sends file (evidence: `main.py`)
- Main Workflow → Local Archive Cleanup: deletes archive (evidence: `main.py`)
- Local Archive Cleanup → Temporary ZIP: removes file (evidence: `main.py`)
