# landonalts/lbd architecture

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

- Interactive diagram: https://gitdiagram.com/landonalts/lbd
- Repository: https://github.com/landonalts/lbd

## Overview

ldbwatch is a Windows console watcher that detects LockDown Browser, injects a process-hiding DLL, and restores window switching through keyboard hotkeys. The main runtime is the watcher: it polls for the target, chooses direct or WOW64-helper injection, and owns the input and window-control behavior. The payload loads the adjacent hide list and hooks process-enumeration APIs. Relationships shown here are supported by the README or excerpts; the configuration relationship is documented, while the helper-to-payload transfer is visible in the watcher’s command construction.

Main entry points: [`src/ldbwatch.cpp`](https://github.com/landonalts/lbd/blob/main/src/ldbwatch.cpp) (Target watcher), [`src/hide.cpp`](https://github.com/landonalts/lbd/blob/main/src/hide.cpp) (Injected payload), [`src/inject32.cpp`](https://github.com/landonalts/lbd/blob/main/src/inject32.cpp) (32-bit helper), [`config/hide.cfg`](https://github.com/landonalts/lbd/blob/main/config/hide.cfg) (Hide list)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_watcher["Detection and control"]
  node_watch["Target watcher<br/>[ldbwatch.cpp]"]
  node_input["Keyboard controls<br/>[ldbwatch.cpp]"]
end

subgraph group_injection["Payload injection"]
  node_direct["Direct injector<br/>[ldbwatch.cpp]"]
  node_helperdispatch["WOW64 dispatch<br/>[ldbwatch.cpp]"]
  node_helper["32-bit helper<br/>[inject32.cpp]"]
end

subgraph group_filter["Process hiding"]
  node_payload["Injected payload<br/>[hide.cpp]"]
  node_config["Hide list<br/>[hide.cfg]"]
  node_enumeration["Process API filters<br/>[hide.cpp]"]
end

node_user(("Administrator"))
node_windows["Windows windows"]
node_target["LockDown Browser"]

node_user -->|"starts elevated"| node_watch
node_watch -->|"polls processes"| node_target
node_watch -->|"injects 64-bit"| node_direct
node_watch -->|"dispatches 32-bit"| node_helperdispatch
node_helperdispatch -->|"starts helper"| node_helper
node_helper -->|"loads DLL"| node_target
node_direct -->|"loads DLL"| node_target
node_target -->|"loads payload"| node_payload
node_payload -->|"reads hide list"| node_config
node_payload -->|"installs hooks"| node_enumeration
node_enumeration -->|"filters results"| node_target
node_user -->|"presses hotkeys"| node_input
node_input -->|"cycles or peeks"| node_windows
node_input -->|"returns focus"| node_target

click node_watch "https://github.com/landonalts/lbd/blob/main/src/ldbwatch.cpp"
click node_input "https://github.com/landonalts/lbd/blob/main/src/ldbwatch.cpp"
click node_direct "https://github.com/landonalts/lbd/blob/main/src/ldbwatch.cpp"
click node_helperdispatch "https://github.com/landonalts/lbd/blob/main/src/ldbwatch.cpp"
click node_helper "https://github.com/landonalts/lbd/blob/main/src/inject32.cpp"
click node_payload "https://github.com/landonalts/lbd/blob/main/src/hide.cpp"
click node_config "https://github.com/landonalts/lbd/blob/main/config/hide.cfg"
click node_enumeration "https://github.com/landonalts/lbd/blob/main/src/hide.cpp"

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_watch,node_input,node_target toneBlue
class node_direct,node_helperdispatch,node_helper toneAmber
class node_payload,node_config,node_enumeration toneMint
class node_user,node_windows toneIndigo
```

## Components

### Detection and control

- [Target watcher](https://github.com/landonalts/lbd/blob/main/src/ldbwatch.cpp): `src/ldbwatch.cpp`
- [Keyboard controls](https://github.com/landonalts/lbd/blob/main/src/ldbwatch.cpp): `src/ldbwatch.cpp`

### Payload injection

- [Direct injector](https://github.com/landonalts/lbd/blob/main/src/ldbwatch.cpp): `src/ldbwatch.cpp`
- [WOW64 dispatch](https://github.com/landonalts/lbd/blob/main/src/ldbwatch.cpp): `src/ldbwatch.cpp`
- [32-bit helper](https://github.com/landonalts/lbd/blob/main/src/inject32.cpp): `src/inject32.cpp`

### Process hiding

- [Injected payload](https://github.com/landonalts/lbd/blob/main/src/hide.cpp): `src/hide.cpp`
- [Hide list](https://github.com/landonalts/lbd/blob/main/config/hide.cfg): `config/hide.cfg`
- [Process API filters](https://github.com/landonalts/lbd/blob/main/src/hide.cpp): `src/hide.cpp`

### Other components

- **Administrator**
- **Windows windows**
- **LockDown Browser**

## Connections

- Administrator → Target watcher: starts elevated (evidence: `README.md`)
- Target watcher → LockDown Browser: polls processes (evidence: `src/ldbwatch.cpp`)
- Target watcher → Direct injector: injects 64-bit (evidence: `src/ldbwatch.cpp`)
- Target watcher → WOW64 dispatch: dispatches 32-bit (evidence: `src/ldbwatch.cpp`)
- WOW64 dispatch → 32-bit helper: starts helper (evidence: `src/ldbwatch.cpp`)
- 32-bit helper → LockDown Browser: loads DLL (evidence: `src/inject32.cpp`)
- Direct injector → LockDown Browser: loads DLL (evidence: `src/ldbwatch.cpp`)
- LockDown Browser → Injected payload: loads payload (evidence: `README.md`)
- Injected payload → Hide list: reads hide list (evidence: `README.md`)
- Injected payload → Process API filters: installs hooks (evidence: `src/hide.cpp`)
- Process API filters → LockDown Browser: filters results (evidence: `README.md`)
- Administrator → Keyboard controls: presses hotkeys (evidence: `README.md`)
- Keyboard controls → Windows windows: cycles or peeks (evidence: `src/ldbwatch.cpp`)
- Keyboard controls → LockDown Browser: returns focus (evidence: `src/ldbwatch.cpp`)
