# mibho/cascratch architecture

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

- Interactive diagram: https://gitdiagram.com/mibho/cascratch
- Repository: https://github.com/mibho/cascratch

## Overview

CAScratch is an old Combat Arms game cheat. Its runtime waits for game-related modules, hooks Direct3D presentation, then draws a configurable menu and runs hack routines from the presentation callback. The routines modify game memory or issue console commands; the menu also offers visual features such as ESP and a crosshair. The graph separates hook/setup, UI, hack behavior, and supporting internals. Edges reflect the sampled source and README; unsampled code limits detail about some feature implementations and menu-to-runtime state flow.

Main entry points: [`scratch/CAHackk/main.cpp`](https://github.com/mibho/cascratch/blob/main/scratch/CAHackk/main.cpp) (D3D Hooks), [`scratch/CAHackk/Menu.cpp`](https://github.com/mibho/cascratch/blob/main/scratch/CAHackk/Menu.cpp) (Cheat Menu), [`scratch/CAHackk/Tools.cpp`](https://github.com/mibho/cascratch/blob/main/scratch/CAHackk/Tools.cpp) (Hook and Scan Tools), [`scratch/CAHackk/HackClass.cpp`](https://github.com/mibho/cascratch/blob/main/scratch/CAHackk/HackClass.cpp) (Console Hacks)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Injection and Hooking"]
  node_injector["DLL Entry<br/>[main.cpp]"]
  node_hook["D3D Hooks<br/>[main.cpp]"]
  node_tools["Hook and Scan Tools<br/>[Tools.cpp]"]
end

subgraph group_ui["Menu and Rendering"]
  node_menu["Cheat Menu<br/>[Menu.cpp]"]
  node_rendering["Direct3D Rendering<br/>[Menu.cpp]"]
  node_colors["UI Colors<br/>[Colors.h]"]
end

subgraph group_hacks["Game Modifications"]
  node_memory["Memory Hacks<br/>[HackClass.cpp]"]
  node_console["Console Hacks<br/>[HackClass.cpp]"]
  node_visuals["Misc and Crosshair<br/>[HackClass.cpp]"]
end

subgraph group_support["Runtime Support"]
  node_addresses["Game Addresses<br/>[Addresses.h]"]
  node_timer["Console Timer<br/>[consoleTime.h]"]
  node_strings["Obfuscated Labels<br/>[EncryptedStrings.h]"]
  node_xor["XOR String Helper<br/>[XorStr.h]"]
end

node_game(("Combat Arms Process"))

node_injector -->|"starts thread"| node_hook
node_hook -->|"uses"| node_tools
node_hook -->|"hooks Direct3D"| node_game
node_hook -->|"calls"| node_menu
node_hook -->|"calls"| node_visuals
node_menu -->|"draws with"| node_rendering
node_menu -->|"uses"| node_colors
node_menu -->|"uses labels"| node_strings
node_strings -->|"decodes with"| node_xor
node_visuals -->|"draws crosshair"| node_menu
node_memory -->|"writes memory"| node_tools
node_console -->|"sends commands"| node_tools
node_memory -->|"uses addresses"| node_addresses
node_console -->|"uses commands"| node_strings
node_console -->|"checks timer"| node_timer
node_tools -->|"scans and modifies"| node_game

click node_injector "https://github.com/mibho/cascratch/blob/main/scratch/CAHackk/main.cpp"
click node_hook "https://github.com/mibho/cascratch/blob/main/scratch/CAHackk/main.cpp"
click node_tools "https://github.com/mibho/cascratch/blob/main/scratch/CAHackk/Tools.cpp"
click node_menu "https://github.com/mibho/cascratch/blob/main/scratch/CAHackk/Menu.cpp"
click node_rendering "https://github.com/mibho/cascratch/blob/main/scratch/CAHackk/Menu.cpp"
click node_colors "https://github.com/mibho/cascratch/blob/main/scratch/CAHackk/Colors.h"
click node_memory "https://github.com/mibho/cascratch/blob/main/scratch/CAHackk/HackClass.cpp"
click node_console "https://github.com/mibho/cascratch/blob/main/scratch/CAHackk/HackClass.cpp"
click node_visuals "https://github.com/mibho/cascratch/blob/main/scratch/CAHackk/HackClass.cpp"
click node_addresses "https://github.com/mibho/cascratch/blob/main/scratch/CAHackk/Addresses.h"
click node_timer "https://github.com/mibho/cascratch/blob/main/scratch/CAHackk/consoleTime.h"
click node_strings "https://github.com/mibho/cascratch/blob/main/scratch/CAHackk/EncryptedStrings.h"
click node_xor "https://github.com/mibho/cascratch/blob/main/scratch/CAHackk/XorStr.h"

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_injector,node_hook,node_tools toneBlue
class node_menu,node_rendering,node_colors toneAmber
class node_memory,node_console,node_visuals toneMint
class node_addresses,node_timer,node_strings,node_xor toneRose
class node_game toneIndigo
```

## Components

### Injection and Hooking

- [DLL Entry](https://github.com/mibho/cascratch/blob/main/scratch/CAHackk/main.cpp): `scratch/CAHackk/main.cpp`
- [D3D Hooks](https://github.com/mibho/cascratch/blob/main/scratch/CAHackk/main.cpp): `scratch/CAHackk/main.cpp`
- [Hook and Scan Tools](https://github.com/mibho/cascratch/blob/main/scratch/CAHackk/Tools.cpp): `scratch/CAHackk/Tools.cpp`

### Menu and Rendering

- [Cheat Menu](https://github.com/mibho/cascratch/blob/main/scratch/CAHackk/Menu.cpp): `scratch/CAHackk/Menu.cpp`
- [Direct3D Rendering](https://github.com/mibho/cascratch/blob/main/scratch/CAHackk/Menu.cpp): `scratch/CAHackk/Menu.cpp`
- [UI Colors](https://github.com/mibho/cascratch/blob/main/scratch/CAHackk/Colors.h): `scratch/CAHackk/Colors.h`

### Game Modifications

- [Memory Hacks](https://github.com/mibho/cascratch/blob/main/scratch/CAHackk/HackClass.cpp): `scratch/CAHackk/HackClass.cpp`
- [Console Hacks](https://github.com/mibho/cascratch/blob/main/scratch/CAHackk/HackClass.cpp): `scratch/CAHackk/HackClass.cpp`
- [Misc and Crosshair](https://github.com/mibho/cascratch/blob/main/scratch/CAHackk/HackClass.cpp): `scratch/CAHackk/HackClass.cpp`

### Runtime Support

- [Game Addresses](https://github.com/mibho/cascratch/blob/main/scratch/CAHackk/Addresses.h): `scratch/CAHackk/Addresses.h`
- [Console Timer](https://github.com/mibho/cascratch/blob/main/scratch/CAHackk/consoleTime.h): `scratch/CAHackk/consoleTime.h`
- [Obfuscated Labels](https://github.com/mibho/cascratch/blob/main/scratch/CAHackk/EncryptedStrings.h): `scratch/CAHackk/EncryptedStrings.h`
- [XOR String Helper](https://github.com/mibho/cascratch/blob/main/scratch/CAHackk/XorStr.h): `scratch/CAHackk/XorStr.h`

### Other components

- **Combat Arms Process**

## Connections

- DLL Entry → D3D Hooks: starts thread (evidence: `scratch/CAHackk/main.cpp`)
- D3D Hooks → Hook and Scan Tools: uses (evidence: `scratch/CAHackk/main.cpp`)
- D3D Hooks → Combat Arms Process: hooks Direct3D (evidence: `scratch/CAHackk/main.cpp`)
- D3D Hooks → Cheat Menu: calls (evidence: `scratch/CAHackk/main.cpp`)
- D3D Hooks → Misc and Crosshair: calls (evidence: `scratch/CAHackk/main.cpp`)
- Cheat Menu → Direct3D Rendering: draws with (evidence: `scratch/CAHackk/Menu.cpp`)
- Cheat Menu → UI Colors: uses (evidence: `scratch/CAHackk/Menu.cpp`)
- Cheat Menu → Obfuscated Labels: uses labels (evidence: `scratch/CAHackk/Menu.cpp`)
- Obfuscated Labels → XOR String Helper: decodes with (evidence: `scratch/CAHackk/EncryptedStrings.h`)
- Misc and Crosshair → Cheat Menu: draws crosshair (evidence: `scratch/CAHackk/HackClass.cpp`)
- Memory Hacks → Hook and Scan Tools: writes memory (evidence: `scratch/CAHackk/HackClass.cpp`)
- Console Hacks → Hook and Scan Tools: sends commands (evidence: `scratch/CAHackk/HackClass.cpp`)
- Memory Hacks → Game Addresses: uses addresses (evidence: `scratch/CAHackk/HackClass.cpp`)
- Console Hacks → Obfuscated Labels: uses commands (evidence: `scratch/CAHackk/HackClass.cpp`)
- Console Hacks → Console Timer: checks timer (evidence: `scratch/CAHackk/HackClass.cpp`)
- Hook and Scan Tools → Combat Arms Process: scans and modifies (evidence: `scratch/CAHackk/Tools.cpp`)
