# wozt/ch-tv-research architecture

> Architecture diagram of the GitHub repository wozt/ch-tv-research, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/wozt/ch-tv-research
- Repository: https://github.com/wozt/ch-tv-research

## Overview

CH-TV-Research is a curated security and reverse-engineering toolkit for the CHiQ U43H7L MStar television. The main operator workflow is to use the command-line/GUI tools or WebUI client to inspect and control a device, while separate research branches investigate boot and storage, recovery, hardware interfaces, and browser/media behavior. The graph includes the major documented capabilities and central WebUI modules; several subsystem links rely on README statements because their implementation files were not sampled.

Main entry points: [`mstar_webui/gtk_app.py`](https://github.com/wozt/ch-tv-research/blob/main/mstar_webui/gtk_app.py) (GTK dashboard), [`tools/dfbtest/rotating_line/curve.c`](https://github.com/wozt/ch-tv-research/blob/main/tools/dfbtest/rotating_line/curve.c) (Overlay animation), [`tools/dfbtest/dfb2i.c`](https://github.com/wozt/ch-tv-research/blob/main/tools/dfbtest/dfb2i.c) (DirectFB overlay), [`mstar_webui/client.py`](https://github.com/wozt/ch-tv-research/blob/main/mstar_webui/client.py) (Read-only client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_webui["WebUI control"]
  node_gtk["GTK dashboard<br/>[gtk_app.py]"]
  node_client["Read-only client<br/>[client.py]"]
  node_config["TV configuration<br/>[config.py]"]
  node_control["Control actions<br/>[control.py]"]
  node_discovery["TV discovery<br/>[discovery.py]"]
  node_ha["Home Assistant<br/>[home_assistant.py]"]
end

subgraph group_operator["Device operations"]
  node_tvtool["tvtool console<br/>[tvtool.c]"]
  node_tvctl["CLI controller<br/>[tvctl.py]"]
  node_recovery["Unbrick and flashing"]
  node_emmc["eMMC inspection<br/>[dump_emmc.py]"]
end

subgraph group_hardware["TV hardware tools"]
  node_irserv["IR proxy<br/>[irserv.c]"]
  node_overlay["DirectFB overlay<br/>[dfb2i.c]"]
  node_font["Bitmap font<br/>[font8x8_basic.h]"]
  node_curves["Overlay animation<br/>[curve.c]"]
  node_parametric["Parametric geometry<br/>[parametric.c]"]
  node_curveapi["Curve declarations<br/>[curve.h]"]
  node_paramapi["Geometry declarations<br/>[parametric.h]"]
  node_expression["Expression declarations<br/>[expression.h]"]
  node_hwprobes["Hardware probes"]
end

subgraph group_research["Platform research"]
  node_boot["Boot-chain analysis"]
  node_browser["Chromium audit"]
  node_media["Media edge cases"]
end

node_researcher(("Researcher"))
node_tv(("CHiQ television"))

node_researcher -->|"inspect or control"| node_gtk
node_gtk -->|"uses"| node_client
node_gtk -->|"uses"| node_config
node_gtk -->|"uses"| node_control
node_gtk -->|"uses"| node_discovery
node_gtk -->|"uses"| node_ha
node_client -->|"WebSocket queries"| node_tv
node_researcher -->|"run diagnostics"| node_tvtool
node_researcher -->|"drive console"| node_tvctl
node_tvtool -->|"UART, SSH, WebUI"| node_tv
node_tvctl -->|"device diagnostics"| node_tv
node_researcher -->|"recover device"| node_recovery
node_recovery -->|"flash partitions"| node_tv
node_researcher -->|"map storage"| node_emmc
node_researcher -->|"run IR proxy"| node_irserv
node_irserv -->|"forwards remote input"| node_tv
node_researcher -->|"show overlay"| node_overlay
node_overlay -->|"renders text with"| node_font
node_overlay -.->|"draws animation"| node_curves
node_curves -->|"uses geometry"| node_parametric
node_curves -->|"implements declarations"| node_curveapi
node_curves -->|"includes declarations"| node_expression
node_parametric -->|"implements declarations"| node_paramapi
node_paramapi -->|"includes declarations"| node_curveapi
node_researcher -->|"probe hardware"| node_hwprobes
node_researcher -->|"study boot and storage"| node_boot
node_researcher -->|"audit browser"| node_browser
node_researcher -->|"exercise playback"| node_media

click node_gtk "https://github.com/wozt/ch-tv-research/blob/main/mstar_webui/gtk_app.py"
click node_client "https://github.com/wozt/ch-tv-research/blob/main/mstar_webui/client.py"
click node_config "https://github.com/wozt/ch-tv-research/blob/main/mstar_webui/config.py"
click node_control "https://github.com/wozt/ch-tv-research/blob/main/mstar_webui/control.py"
click node_discovery "https://github.com/wozt/ch-tv-research/blob/main/mstar_webui/discovery.py"
click node_ha "https://github.com/wozt/ch-tv-research/blob/main/mstar_webui/home_assistant.py"
click node_tvtool "https://github.com/wozt/ch-tv-research/blob/main/tools/tvtool/tvtool.c"
click node_tvctl "https://github.com/wozt/ch-tv-research/blob/main/tools/tvtool/tvctl.py"
click node_recovery "https://github.com/wozt/ch-tv-research/tree/main/analysis/unbrick"
click node_emmc "https://github.com/wozt/ch-tv-research/blob/main/analysis/dump_emmc.py"
click node_irserv "https://github.com/wozt/ch-tv-research/blob/main/tools/irserv/irserv.c"
click node_overlay "https://github.com/wozt/ch-tv-research/blob/main/tools/dfbtest/dfb2i.c"
click node_font "https://github.com/wozt/ch-tv-research/blob/main/tools/dfbtest/font8x8_basic.h"
click node_curves "https://github.com/wozt/ch-tv-research/blob/main/tools/dfbtest/rotating_line/curve.c"
click node_parametric "https://github.com/wozt/ch-tv-research/blob/main/tools/dfbtest/rotating_line/parametric.c"
click node_curveapi "https://github.com/wozt/ch-tv-research/blob/main/tools/dfbtest/rotating_line/curve.h"
click node_paramapi "https://github.com/wozt/ch-tv-research/blob/main/tools/dfbtest/rotating_line/parametric.h"
click node_expression "https://github.com/wozt/ch-tv-research/blob/main/tools/dfbtest/rotating_line/expression.h"
click node_hwprobes "https://github.com/wozt/ch-tv-research/tree/main/tools/secprobe"
click node_boot "https://github.com/wozt/ch-tv-research/tree/main/analysis"
click node_browser "https://github.com/wozt/ch-tv-research/blob/main/analysis/probes/chromium47-offline-audit.py"
click node_media "https://github.com/wozt/ch-tv-research/tree/main/analysis/media-tests"

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_gtk,node_client,node_config,node_control,node_discovery,node_ha toneBlue
class node_tvtool,node_tvctl,node_recovery,node_emmc toneAmber
class node_irserv,node_overlay,node_font,node_curves,node_parametric,node_curveapi,node_paramapi,node_expression,node_hwprobes toneMint
class node_boot,node_browser,node_media toneRose
class node_researcher,node_tv toneIndigo
```

## Components

### WebUI control

- [GTK dashboard](https://github.com/wozt/ch-tv-research/blob/main/mstar_webui/gtk_app.py): `mstar_webui/gtk_app.py`
- [Read-only client](https://github.com/wozt/ch-tv-research/blob/main/mstar_webui/client.py): `mstar_webui/client.py`
- [TV configuration](https://github.com/wozt/ch-tv-research/blob/main/mstar_webui/config.py): `mstar_webui/config.py`
- [Control actions](https://github.com/wozt/ch-tv-research/blob/main/mstar_webui/control.py): `mstar_webui/control.py`
- [TV discovery](https://github.com/wozt/ch-tv-research/blob/main/mstar_webui/discovery.py): `mstar_webui/discovery.py`
- [Home Assistant](https://github.com/wozt/ch-tv-research/blob/main/mstar_webui/home_assistant.py): `mstar_webui/home_assistant.py`

### Device operations

- [tvtool console](https://github.com/wozt/ch-tv-research/blob/main/tools/tvtool/tvtool.c): `tools/tvtool/tvtool.c`
- [CLI controller](https://github.com/wozt/ch-tv-research/blob/main/tools/tvtool/tvctl.py): `tools/tvtool/tvctl.py`
- [Unbrick and flashing](https://github.com/wozt/ch-tv-research/tree/main/analysis/unbrick): `analysis/unbrick`
- [eMMC inspection](https://github.com/wozt/ch-tv-research/blob/main/analysis/dump_emmc.py): `analysis/dump_emmc.py`

### TV hardware tools

- [IR proxy](https://github.com/wozt/ch-tv-research/blob/main/tools/irserv/irserv.c): `tools/irserv/irserv.c`
- [DirectFB overlay](https://github.com/wozt/ch-tv-research/blob/main/tools/dfbtest/dfb2i.c): `tools/dfbtest/dfb2i.c`
- [Bitmap font](https://github.com/wozt/ch-tv-research/blob/main/tools/dfbtest/font8x8_basic.h): `tools/dfbtest/font8x8_basic.h`
- [Overlay animation](https://github.com/wozt/ch-tv-research/blob/main/tools/dfbtest/rotating_line/curve.c): `tools/dfbtest/rotating_line/curve.c`
- [Parametric geometry](https://github.com/wozt/ch-tv-research/blob/main/tools/dfbtest/rotating_line/parametric.c): `tools/dfbtest/rotating_line/parametric.c`
- [Curve declarations](https://github.com/wozt/ch-tv-research/blob/main/tools/dfbtest/rotating_line/curve.h): `tools/dfbtest/rotating_line/curve.h`
- [Geometry declarations](https://github.com/wozt/ch-tv-research/blob/main/tools/dfbtest/rotating_line/parametric.h): `tools/dfbtest/rotating_line/parametric.h`
- [Expression declarations](https://github.com/wozt/ch-tv-research/blob/main/tools/dfbtest/rotating_line/expression.h): `tools/dfbtest/rotating_line/expression.h`
- [Hardware probes](https://github.com/wozt/ch-tv-research/tree/main/tools/secprobe): `tools/secprobe`

### Platform research

- [Boot-chain analysis](https://github.com/wozt/ch-tv-research/tree/main/analysis): `analysis`
- [Chromium audit](https://github.com/wozt/ch-tv-research/blob/main/analysis/probes/chromium47-offline-audit.py): `analysis/probes/chromium47-offline-audit.py`
- [Media edge cases](https://github.com/wozt/ch-tv-research/tree/main/analysis/media-tests): `analysis/media-tests`

### Other components

- **Researcher**
- **CHiQ television**

## Connections

- Researcher → GTK dashboard: inspect or control
- GTK dashboard → Read-only client: uses (evidence: `mstar_webui/gtk_app.py`)
- GTK dashboard → TV configuration: uses (evidence: `mstar_webui/gtk_app.py`)
- GTK dashboard → Control actions: uses (evidence: `mstar_webui/gtk_app.py`)
- GTK dashboard → TV discovery: uses (evidence: `mstar_webui/gtk_app.py`)
- GTK dashboard → Home Assistant: uses (evidence: `mstar_webui/gtk_app.py`)
- Read-only client → CHiQ television: WebSocket queries (evidence: `mstar_webui/client.py`)
- Researcher → tvtool console: run diagnostics
- Researcher → CLI controller: drive console
- tvtool console → CHiQ television: UART, SSH, WebUI
- CLI controller → CHiQ television: device diagnostics
- Researcher → Unbrick and flashing: recover device
- Unbrick and flashing → CHiQ television: flash partitions
- Researcher → eMMC inspection: map storage
- Researcher → IR proxy: run IR proxy
- IR proxy → CHiQ television: forwards remote input
- Researcher → DirectFB overlay: show overlay
- DirectFB overlay → Bitmap font: renders text with (evidence: `tools/dfbtest/dfb2i.c`)
- DirectFB overlay → Overlay animation: draws animation
- Overlay animation → Parametric geometry: uses geometry (evidence: `tools/dfbtest/rotating_line/curve.c`)
- Overlay animation → Curve declarations: implements declarations (evidence: `tools/dfbtest/rotating_line/curve.c`)
- Overlay animation → Expression declarations: includes declarations (evidence: `tools/dfbtest/rotating_line/curve.c`)
- Parametric geometry → Geometry declarations: implements declarations (evidence: `tools/dfbtest/rotating_line/parametric.c`)
- Geometry declarations → Curve declarations: includes declarations (evidence: `tools/dfbtest/rotating_line/parametric.h`)
- Researcher → Hardware probes: probe hardware
- Researcher → Boot-chain analysis: study boot and storage
- Researcher → Chromium audit: audit browser
- Researcher → Media edge cases: exercise playback
