# mesutd0nmez/kof-bot architecture

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

- Interactive diagram: https://gitdiagram.com/mesutd0nmez/kof-bot
- Repository: https://github.com/mesutd0nmez/kof-bot

## Overview

KOF is a Knight Online automation client: startup creates the Bot, which connects to KOF-Server; after game connection, ClientHandler manages the game process through Client. Its documented major capabilities include server communication, automation/UI, game-data tables, protection and optional compression/encryption. Edges below use README statements or shown calls/import references; unsampled subsystems are retained where documented, with uncertain wiring omitted.

Main entry points: [`KOF.Bot/Service.cpp`](https://github.com/mesutd0nmez/kof-bot/blob/main/KOF.Bot/Service.cpp) (Server service), [`KOF.Bot/Bot.cpp`](https://github.com/mesutd0nmez/kof-bot/blob/main/KOF.Bot/Bot.cpp) (Bot coordinator), [`KOF.Bot/ClientHandler.cpp`](https://github.com/mesutd0nmez/kof-bot/blob/main/KOF.Bot/ClientHandler.cpp) (Client handler), [`KOF.Bot/Packet.h`](https://github.com/mesutd0nmez/kof-bot/blob/main/KOF.Bot/Packet.h) (Packet encoding)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_startup["Startup and control"]
  node_entry["Application startup<br/>[main.cpp]"]
  node_bot["Bot coordinator<br/>[Bot.cpp]"]
end

subgraph group_server["Server communication"]
  node_service["Server service<br/>[Service.cpp]"]
  node_socket["Socket transport<br/>[Socket.cpp]"]
end

subgraph group_game["Game automation"]
  node_handler["Client handler<br/>[ClientHandler.cpp]"]
  node_client["Game client access<br/>[Client.cpp]"]
  node_memory["Process memory<br/>[Memory.h]"]
  node_drawing["Bot interface<br/>[Drawing.cpp]"]
  node_ui["UI controls<br/>[UI.cpp]"]
end

subgraph group_support["Runtime support"]
  node_tables["Game data tables<br/>[Table.h]"]
  node_config["Configuration<br/>[Ini.cpp]"]
  node_hardware["Hardware information"]
  node_packet["Packet encoding<br/>[Packet.h]"]
  node_compression["Compression<br/>[Compression.cpp]"]
  node_crypto["Encryption<br/>[Cryption.h]"]
  node_adapter["Adapter module<br/>[dllmain.cpp]"]
end

subgraph group_updater["Updater"]
  node_updater["Updater<br/>[main.cpp]"]
  node_archive["ZIP and deflate<br/>[miniz_zip.c]"]
end

node_user(("Operator"))
node_server_ext(("KOF-Server"))
node_game_ext(("Knight Online"))

node_user -->|"starts"| node_entry
node_entry -->|"creates"| node_bot
node_bot -->|"connects through"| node_service
node_service -->|"uses"| node_socket
node_service -->|"communicates with"| node_server_ext
node_bot -->|"manages"| node_handler
node_handler -->|"uses"| node_client
node_client -->|"reads and writes"| node_memory
node_handler -->|"manages processes"| node_game_ext
node_user -.->|"configures"| node_ui
node_ui -->|"controls"| node_bot
node_bot -->|"loads game data"| node_tables
node_bot -.->|"uses configuration"| node_config
node_service -->|"sends hardware data"| node_hardware
node_handler -->|"processes packets"| node_packet
node_service -->|"handles packets"| node_packet
node_service -->|"encrypts traffic"| node_crypto
node_service -.->|"compresses traffic"| node_compression
node_adapter -->|"uses packet format"| node_packet
node_updater -.->|"uses archive code"| node_archive

click node_entry "https://github.com/mesutd0nmez/kof-bot/blob/main/KOF.Bot/main.cpp"
click node_bot "https://github.com/mesutd0nmez/kof-bot/blob/main/KOF.Bot/Bot.cpp"
click node_service "https://github.com/mesutd0nmez/kof-bot/blob/main/KOF.Bot/Service.cpp"
click node_socket "https://github.com/mesutd0nmez/kof-bot/blob/main/KOF.Bot/Socket.cpp"
click node_handler "https://github.com/mesutd0nmez/kof-bot/blob/main/KOF.Bot/ClientHandler.cpp"
click node_client "https://github.com/mesutd0nmez/kof-bot/blob/main/KOF.Bot/Client.cpp"
click node_memory "https://github.com/mesutd0nmez/kof-bot/blob/main/KOF.Bot/Memory.h"
click node_drawing "https://github.com/mesutd0nmez/kof-bot/blob/main/KOF.Bot/Drawing.cpp"
click node_ui "https://github.com/mesutd0nmez/kof-bot/blob/main/KOF.Bot/UI.cpp"
click node_tables "https://github.com/mesutd0nmez/kof-bot/blob/main/KOF.Bot/Table.h"
click node_config "https://github.com/mesutd0nmez/kof-bot/blob/main/KOF.Bot/Ini.cpp"
click node_hardware "https://github.com/mesutd0nmez/kof-bot/blob/main/KOF.Bot/HardwareInformation.h"
click node_packet "https://github.com/mesutd0nmez/kof-bot/blob/main/KOF.Bot/Packet.h"
click node_compression "https://github.com/mesutd0nmez/kof-bot/blob/main/KOF.Bot/Compression.cpp"
click node_crypto "https://github.com/mesutd0nmez/kof-bot/blob/main/KOF.Bot/Cryption.h"
click node_adapter "https://github.com/mesutd0nmez/kof-bot/blob/main/KOF.Adapter/dllmain.cpp"
click node_updater "https://github.com/mesutd0nmez/kof-bot/blob/main/KOF.Updater/main.cpp"
click node_archive "https://github.com/mesutd0nmez/kof-bot/blob/main/KOF.Updater/miniz_zip.c"

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_entry,node_bot toneBlue
class node_service,node_socket toneAmber
class node_handler,node_client,node_memory,node_drawing,node_ui,node_server_ext toneMint
class node_tables,node_config,node_hardware,node_packet,node_compression,node_crypto,node_adapter toneRose
class node_updater,node_archive,node_user,node_game_ext toneIndigo
```

## Components

### Startup and control

- [Application startup](https://github.com/mesutd0nmez/kof-bot/blob/main/KOF.Bot/main.cpp): `KOF.Bot/main.cpp`
- [Bot coordinator](https://github.com/mesutd0nmez/kof-bot/blob/main/KOF.Bot/Bot.cpp): `KOF.Bot/Bot.cpp`

### Server communication

- [Server service](https://github.com/mesutd0nmez/kof-bot/blob/main/KOF.Bot/Service.cpp): `KOF.Bot/Service.cpp`
- [Socket transport](https://github.com/mesutd0nmez/kof-bot/blob/main/KOF.Bot/Socket.cpp): `KOF.Bot/Socket.cpp`

### Game automation

- [Client handler](https://github.com/mesutd0nmez/kof-bot/blob/main/KOF.Bot/ClientHandler.cpp): `KOF.Bot/ClientHandler.cpp`
- [Game client access](https://github.com/mesutd0nmez/kof-bot/blob/main/KOF.Bot/Client.cpp): `KOF.Bot/Client.cpp`
- [Process memory](https://github.com/mesutd0nmez/kof-bot/blob/main/KOF.Bot/Memory.h): `KOF.Bot/Memory.h`
- [Bot interface](https://github.com/mesutd0nmez/kof-bot/blob/main/KOF.Bot/Drawing.cpp): `KOF.Bot/Drawing.cpp`
- [UI controls](https://github.com/mesutd0nmez/kof-bot/blob/main/KOF.Bot/UI.cpp): `KOF.Bot/UI.cpp`

### Runtime support

- [Game data tables](https://github.com/mesutd0nmez/kof-bot/blob/main/KOF.Bot/Table.h): `KOF.Bot/Table.h`
- [Configuration](https://github.com/mesutd0nmez/kof-bot/blob/main/KOF.Bot/Ini.cpp): `KOF.Bot/Ini.cpp`
- [Hardware information](https://github.com/mesutd0nmez/kof-bot/blob/main/KOF.Bot/HardwareInformation.h): `KOF.Bot/HardwareInformation.h`
- [Packet encoding](https://github.com/mesutd0nmez/kof-bot/blob/main/KOF.Bot/Packet.h): `KOF.Bot/Packet.h`
- [Compression](https://github.com/mesutd0nmez/kof-bot/blob/main/KOF.Bot/Compression.cpp): `KOF.Bot/Compression.cpp`
- [Encryption](https://github.com/mesutd0nmez/kof-bot/blob/main/KOF.Bot/Cryption.h): `KOF.Bot/Cryption.h`
- [Adapter module](https://github.com/mesutd0nmez/kof-bot/blob/main/KOF.Adapter/dllmain.cpp): `KOF.Adapter/dllmain.cpp`

### Updater

- [Updater](https://github.com/mesutd0nmez/kof-bot/blob/main/KOF.Updater/main.cpp): `KOF.Updater/main.cpp`
- [ZIP and deflate](https://github.com/mesutd0nmez/kof-bot/blob/main/KOF.Updater/miniz_zip.c): `KOF.Updater/miniz_zip.c`

### Other components

- **Operator**
- **KOF-Server**
- **Knight Online**

## Connections

- Operator → Application startup: starts (evidence: `KOF.Bot/main.cpp`)
- Application startup → Bot coordinator: creates (evidence: `KOF.Bot/main.cpp`)
- Bot coordinator → Server service: connects through
- Server service → Socket transport: uses
- Server service → KOF-Server: communicates with
- Bot coordinator → Client handler: manages
- Client handler → Game client access: uses (evidence: `KOF.Bot/ClientHandler.cpp`)
- Game client access → Process memory: reads and writes (evidence: `KOF.Bot/Client.cpp`)
- Client handler → Knight Online: manages processes
- Operator → UI controls: configures
- UI controls → Bot coordinator: controls
- Bot coordinator → Game data tables: loads game data
- Bot coordinator → Configuration: uses configuration
- Server service → Hardware information: sends hardware data
- Client handler → Packet encoding: processes packets (evidence: `KOF.Bot/ClientHandler.cpp`)
- Server service → Packet encoding: handles packets
- Server service → Encryption: encrypts traffic
- Server service → Compression: compresses traffic
- Adapter module → Packet encoding: uses packet format
- Updater → ZIP and deflate: uses archive code
