# hitamlegit6777/cfast architecture

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

- Interactive diagram: https://gitdiagram.com/hitamlegit6777/cfast
- Repository: https://github.com/hitamlegit6777/cfast

## Overview

cfast is a browserless Cloudflare Turnstile and managed-challenge solver: it replays a recorded browser profile over HTTP, analyzes challenge JavaScript and VM programs, then obtains a token or clearance cookie. The graph follows that workflow and retains the documented capture and compatible-API capabilities. Relationships grounded in README statements or SOURCE INDEX references are cited; unverified runtime links are dashed. Several internals are represented at subsystem level because their source was not sampled.

Main entry points: [`source/src/session`](https://github.com/hitamlegit6777/cfast/tree/main/source/src/session) (Challenge session replay), [`source/src/http/client.rs`](https://github.com/hitamlegit6777/cfast/blob/main/source/src/http/client.rs) (HTTP client and requests), [`solver_api.py`](https://github.com/hitamlegit6777/cfast/blob/main/solver_api.py) (Compatible solve API), [`source/src/script.rs`](https://github.com/hitamlegit6777/cfast/blob/main/source/src/script.rs) (Parsed script and VM recovery)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User entry points"]
  node_cli["Challenge CLI<br/>[main.rs]"]
  node_api["Compatible solve API<br/>[solver_api.py]"]
end

subgraph group_capture["Profile capture"]
  node_capture_tool["Capture proxy<br/>[main.rs]"]
  node_capture_runtime["Traffic and profile capture"]
  node_profile["Recorded browser profile"]
end

subgraph group_protocol["HTTP challenge protocol"]
  node_http["HTTP client and requests<br/>[client.rs]"]
  node_session["Challenge session replay"]
  node_embedding["Challenge page parsing<br/>[page.rs]"]
  node_orchestrator["Managed challenge orchestration<br/>[orchestrator.rs]"]
end

subgraph group_analysis["Challenge analysis"]
  node_deobfuscate["Script deobfuscation<br/>[pipeline.rs]"]
  node_script["Parsed script and VM recovery<br/>[script.rs]"]
  node_encoder["Encoder and payload extraction<br/>[program.rs]"]
  node_challenge_analysis["Challenge program analysis"]
  node_stage2["Stage-two probes and analysis"]
end

subgraph group_runtime["VM and solving"]
  node_vm_session["VM session recovery<br/>[session.rs]"]
  node_vm["VM disassembly and interpretation<br/>[vm.rs]"]
  node_engine["Browser behavior emulation<br/>[engine.rs]"]
  node_solver["Token and clearance solving<br/>[solver.rs]"]
end

node_user(("Solver user"))
node_target(("Cloudflare challenge service"))
node_result["Token or clearance cookie"]

node_user -->|"runs solve"| node_cli
node_user -->|"submits task"| node_api
node_capture_tool -.->|"captures traffic"| node_capture_runtime
node_capture_runtime -.->|"records profile"| node_profile
node_cli -.->|"starts replay"| node_session
node_api -.->|"dispatches solve"| node_cli
node_session -.->|"loads profile"| node_profile
node_session -.->|"sends requests"| node_http
node_http -->|"fetches challenge"| node_target
node_target -->|"returns scripts"| node_http
node_http -.->|"provides page"| node_embedding
node_embedding -.->|"discovers flow"| node_orchestrator
node_session -.->|"processes script"| node_deobfuscate
node_deobfuscate -.->|"parses output"| node_script
node_script -->|"extracts constants"| node_encoder
node_script -->|"recovers definition"| node_vm_session
node_vm_session -->|"initializes VM"| node_vm
node_vm -->|"disassembles program"| node_challenge_analysis
node_challenge_analysis -.->|"analyzes probes"| node_stage2
node_session -.->|"emulates behavior"| node_engine
node_session -.->|"coordinates solve"| node_solver
node_orchestrator -->|"posts challenge answers"| node_target
node_solver -->|"posts proof"| node_http
node_solver -->|"returns token or cookie"| node_result
node_api -->|"responds with token"| node_result

click node_cli "https://github.com/hitamlegit6777/cfast/blob/main/source/src/bin/challenge/main.rs"
click node_api "https://github.com/hitamlegit6777/cfast/blob/main/solver_api.py"
click node_capture_tool "https://github.com/hitamlegit6777/cfast/blob/main/source/src/bin/capture-proxy/main.rs"
click node_capture_runtime "https://github.com/hitamlegit6777/cfast/tree/main/source/src/capture"
click node_http "https://github.com/hitamlegit6777/cfast/blob/main/source/src/http/client.rs"
click node_session "https://github.com/hitamlegit6777/cfast/tree/main/source/src/session"
click node_embedding "https://github.com/hitamlegit6777/cfast/blob/main/source/src/embedding_page/page.rs"
click node_orchestrator "https://github.com/hitamlegit6777/cfast/blob/main/source/src/challenge/orchestrator.rs"
click node_deobfuscate "https://github.com/hitamlegit6777/cfast/blob/main/source/src/deobfuscate/pipeline.rs"
click node_script "https://github.com/hitamlegit6777/cfast/blob/main/source/src/script.rs"
click node_encoder "https://github.com/hitamlegit6777/cfast/blob/main/source/src/challenge/program.rs"
click node_challenge_analysis "https://github.com/hitamlegit6777/cfast/tree/main/source/src/challenge"
click node_stage2 "https://github.com/hitamlegit6777/cfast/tree/main/source/src/stage2"
click node_vm_session "https://github.com/hitamlegit6777/cfast/blob/main/source/src/vm/session.rs"
click node_vm "https://github.com/hitamlegit6777/cfast/blob/main/source/src/vm.rs"
click node_engine "https://github.com/hitamlegit6777/cfast/blob/main/source/src/engine.rs"
click node_solver "https://github.com/hitamlegit6777/cfast/blob/main/source/src/solver.rs"

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_cli,node_api,node_user toneBlue
class node_capture_tool,node_capture_runtime,node_profile toneAmber
class node_http,node_session,node_embedding,node_orchestrator toneMint
class node_deobfuscate,node_script,node_encoder,node_challenge_analysis,node_stage2 toneRose
class node_vm_session,node_vm,node_engine,node_solver,node_target,node_result toneIndigo
```

## Components

### User entry points

- [Challenge CLI](https://github.com/hitamlegit6777/cfast/blob/main/source/src/bin/challenge/main.rs): `source/src/bin/challenge/main.rs`
- [Compatible solve API](https://github.com/hitamlegit6777/cfast/blob/main/solver_api.py): `solver_api.py`

### Profile capture

- [Capture proxy](https://github.com/hitamlegit6777/cfast/blob/main/source/src/bin/capture-proxy/main.rs): `source/src/bin/capture-proxy/main.rs`
- [Traffic and profile capture](https://github.com/hitamlegit6777/cfast/tree/main/source/src/capture): `source/src/capture`
- **Recorded browser profile**

### HTTP challenge protocol

- [HTTP client and requests](https://github.com/hitamlegit6777/cfast/blob/main/source/src/http/client.rs): `source/src/http/client.rs`
- [Challenge session replay](https://github.com/hitamlegit6777/cfast/tree/main/source/src/session): `source/src/session`
- [Challenge page parsing](https://github.com/hitamlegit6777/cfast/blob/main/source/src/embedding_page/page.rs): `source/src/embedding_page/page.rs`
- [Managed challenge orchestration](https://github.com/hitamlegit6777/cfast/blob/main/source/src/challenge/orchestrator.rs): `source/src/challenge/orchestrator.rs`

### Challenge analysis

- [Script deobfuscation](https://github.com/hitamlegit6777/cfast/blob/main/source/src/deobfuscate/pipeline.rs): `source/src/deobfuscate/pipeline.rs`
- [Parsed script and VM recovery](https://github.com/hitamlegit6777/cfast/blob/main/source/src/script.rs): `source/src/script.rs`
- [Encoder and payload extraction](https://github.com/hitamlegit6777/cfast/blob/main/source/src/challenge/program.rs): `source/src/challenge/program.rs`
- [Challenge program analysis](https://github.com/hitamlegit6777/cfast/tree/main/source/src/challenge): `source/src/challenge`
- [Stage-two probes and analysis](https://github.com/hitamlegit6777/cfast/tree/main/source/src/stage2): `source/src/stage2`

### VM and solving

- [VM session recovery](https://github.com/hitamlegit6777/cfast/blob/main/source/src/vm/session.rs): `source/src/vm/session.rs`
- [VM disassembly and interpretation](https://github.com/hitamlegit6777/cfast/blob/main/source/src/vm.rs): `source/src/vm.rs`
- [Browser behavior emulation](https://github.com/hitamlegit6777/cfast/blob/main/source/src/engine.rs): `source/src/engine.rs`
- [Token and clearance solving](https://github.com/hitamlegit6777/cfast/blob/main/source/src/solver.rs): `source/src/solver.rs`

### Other components

- **Solver user**
- **Cloudflare challenge service**
- **Token or clearance cookie**

## Connections

- Solver user → Challenge CLI: runs solve
- Solver user → Compatible solve API: submits task
- Capture proxy → Traffic and profile capture: captures traffic (evidence: `source/src/bin/capture-proxy/main.rs`)
- Traffic and profile capture → Recorded browser profile: records profile
- Challenge CLI → Challenge session replay: starts replay
- Compatible solve API → Challenge CLI: dispatches solve
- Challenge session replay → Recorded browser profile: loads profile
- Challenge session replay → HTTP client and requests: sends requests
- HTTP client and requests → Cloudflare challenge service: fetches challenge
- Cloudflare challenge service → HTTP client and requests: returns scripts
- HTTP client and requests → Challenge page parsing: provides page
- Challenge page parsing → Managed challenge orchestration: discovers flow
- Challenge session replay → Script deobfuscation: processes script
- Script deobfuscation → Parsed script and VM recovery: parses output
- Parsed script and VM recovery → Encoder and payload extraction: extracts constants (evidence: `source/src/challenge/program.rs`)
- Parsed script and VM recovery → VM session recovery: recovers definition (evidence: `source/src/script.rs`)
- VM session recovery → VM disassembly and interpretation: initializes VM (evidence: `source/src/vm/session.rs`)
- VM disassembly and interpretation → Challenge program analysis: disassembles program (evidence: `source/src/challenge/program.rs`)
- Challenge program analysis → Stage-two probes and analysis: analyzes probes
- Challenge session replay → Browser behavior emulation: emulates behavior
- Challenge session replay → Token and clearance solving: coordinates solve
- Managed challenge orchestration → Cloudflare challenge service: posts challenge answers
- Token and clearance solving → HTTP client and requests: posts proof
- Token and clearance solving → Token or clearance cookie: returns token or cookie
- Compatible solve API → Token or clearance cookie: responds with token
