# truetemm/bedrock-fingerprint architecture

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

- Interactive diagram: https://gitdiagram.com/truetemm/bedrock-fingerprint
- Repository: https://github.com/truetemm/bedrock-fingerprint

## Overview

`bfp` is a command-line fingerprinting tool for Minecraft: Bedrock servers. Its main workflow resolves a server address, collects RakNet status and handshake signals, optionally probes protocol acceptance and captures login network settings, then scores the observations against known core signatures and prints text or JSON. The graph separates probing, session capture, fingerprinting, and CLI/reporting, with packet/channel helpers shown as an internal layer. Some target orchestration is supported only by the source index and README; unsampled implementation details are not expanded.

Main entry points: [`src/main.rs`](https://github.com/truetemm/bedrock-fingerprint/blob/main/src/main.rs) (Command workflow), [`src/fingerprint.rs`](https://github.com/truetemm/bedrock-fingerprint/blob/main/src/fingerprint.rs) (Observation collection), [`src/target.rs`](https://github.com/truetemm/bedrock-fingerprint/blob/main/src/target.rs) (Server target), [`src/session.rs`](https://github.com/truetemm/bedrock-fingerprint/blob/main/src/session.rs) (Network settings capture)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI and reporting"]
  node_cli["Argument parsing<br/>[cli.rs]"]
  node_main["Command workflow<br/>[main.rs]"]
  node_report["Text and JSON<br/>[report.rs]"]
end

subgraph group_probes["Wire probes"]
  node_target["Server target<br/>[target.rs]"]
  node_resolver["Address resolver<br/>[raknet.rs]"]
  node_pong["Status ping<br/>[pong.rs]"]
  node_handshake["Handshake probe<br/>[handshake.rs]"]
  node_reply1["Reply1 parser<br/>[reply1.rs]"]
  node_protocolrange["Protocol range<br/>[protocol_range.rs]"]
  node_deep["Deep protocol probe<br/>[probe.rs]"]
end

subgraph group_session["Session capture"]
  node_login["Network settings capture<br/>[session.rs]"]
  node_channel["Reliable channel<br/>[channel.rs]"]
  node_packets["Session packets<br/>[packets.rs]"]
  node_wire["Wire encoding<br/>[wire.rs]"]
end

subgraph group_identify["Fingerprinting"]
  node_observations["Observation collection<br/>[fingerprint.rs]"]
  node_database["Known core signatures<br/>[database.rs]"]
  node_signature["Weighted matching<br/>[signature.rs]"]
end

node_user(("CLI user"))

node_user -->|"provides arguments"| node_cli
node_cli -->|"parses commands"| node_main
node_main -->|"resolves address"| node_resolver
node_main -->|"runs probes"| node_target
node_target -.->|"pings server"| node_pong
node_target -.->|"probes handshake"| node_handshake
node_target -.->|"checks acceptance"| node_protocolrange
node_target -.->|"probes protocol"| node_deep
node_target -.->|"captures settings"| node_login
node_handshake -->|"requests reply"| node_reply1
node_main -->|"checks range"| node_protocolrange
node_main -->|"optionally probes"| node_deep
node_main -->|"collects signals"| node_observations
node_main -->|"loads signatures"| node_database
node_main -->|"prints result"| node_report
node_login -->|"opens connection"| node_reply1
node_login -->|"sends datagrams"| node_channel
node_login -->|"builds and parses"| node_packets
node_login -->|"encodes fields"| node_wire
node_observations -->|"reads status"| node_pong
node_observations -->|"reads signals"| node_handshake
node_observations -->|"reads settings"| node_login
node_observations -->|"reads acceptance"| node_protocolrange
node_observations -->|"scores checks"| node_signature
node_database -->|"defines checks"| node_signature
node_report -->|"formats signals"| node_observations

click node_cli "https://github.com/truetemm/bedrock-fingerprint/blob/main/src/cli.rs"
click node_main "https://github.com/truetemm/bedrock-fingerprint/blob/main/src/main.rs"
click node_report "https://github.com/truetemm/bedrock-fingerprint/blob/main/src/report.rs"
click node_target "https://github.com/truetemm/bedrock-fingerprint/blob/main/src/target.rs"
click node_resolver "https://github.com/truetemm/bedrock-fingerprint/blob/main/src/raknet.rs"
click node_pong "https://github.com/truetemm/bedrock-fingerprint/blob/main/src/raknet/pong.rs"
click node_handshake "https://github.com/truetemm/bedrock-fingerprint/blob/main/src/handshake.rs"
click node_reply1 "https://github.com/truetemm/bedrock-fingerprint/blob/main/src/handshake/reply1.rs"
click node_protocolrange "https://github.com/truetemm/bedrock-fingerprint/blob/main/src/handshake/protocol_range.rs"
click node_deep "https://github.com/truetemm/bedrock-fingerprint/blob/main/src/handshake/probe.rs"
click node_login "https://github.com/truetemm/bedrock-fingerprint/blob/main/src/session.rs"
click node_channel "https://github.com/truetemm/bedrock-fingerprint/blob/main/src/session/channel.rs"
click node_packets "https://github.com/truetemm/bedrock-fingerprint/blob/main/src/session/packets.rs"
click node_wire "https://github.com/truetemm/bedrock-fingerprint/blob/main/src/session/wire.rs"
click node_observations "https://github.com/truetemm/bedrock-fingerprint/blob/main/src/fingerprint.rs"
click node_database "https://github.com/truetemm/bedrock-fingerprint/blob/main/src/fingerprint/database.rs"
click node_signature "https://github.com/truetemm/bedrock-fingerprint/blob/main/src/fingerprint/signature.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_main,node_report,node_user toneBlue
class node_target,node_resolver,node_pong,node_handshake,node_reply1,node_protocolrange,node_deep toneAmber
class node_login,node_channel,node_packets,node_wire toneMint
class node_observations,node_database,node_signature toneRose
```

## Components

### CLI and reporting

- [Argument parsing](https://github.com/truetemm/bedrock-fingerprint/blob/main/src/cli.rs): `src/cli.rs`
- [Command workflow](https://github.com/truetemm/bedrock-fingerprint/blob/main/src/main.rs): `src/main.rs`
- [Text and JSON](https://github.com/truetemm/bedrock-fingerprint/blob/main/src/report.rs): `src/report.rs`

### Wire probes

- [Server target](https://github.com/truetemm/bedrock-fingerprint/blob/main/src/target.rs): `src/target.rs`
- [Address resolver](https://github.com/truetemm/bedrock-fingerprint/blob/main/src/raknet.rs): `src/raknet.rs`
- [Status ping](https://github.com/truetemm/bedrock-fingerprint/blob/main/src/raknet/pong.rs): `src/raknet/pong.rs`
- [Handshake probe](https://github.com/truetemm/bedrock-fingerprint/blob/main/src/handshake.rs): `src/handshake.rs`
- [Reply1 parser](https://github.com/truetemm/bedrock-fingerprint/blob/main/src/handshake/reply1.rs): `src/handshake/reply1.rs`
- [Protocol range](https://github.com/truetemm/bedrock-fingerprint/blob/main/src/handshake/protocol_range.rs): `src/handshake/protocol_range.rs`
- [Deep protocol probe](https://github.com/truetemm/bedrock-fingerprint/blob/main/src/handshake/probe.rs): `src/handshake/probe.rs`

### Session capture

- [Network settings capture](https://github.com/truetemm/bedrock-fingerprint/blob/main/src/session.rs): `src/session.rs`
- [Reliable channel](https://github.com/truetemm/bedrock-fingerprint/blob/main/src/session/channel.rs): `src/session/channel.rs`
- [Session packets](https://github.com/truetemm/bedrock-fingerprint/blob/main/src/session/packets.rs): `src/session/packets.rs`
- [Wire encoding](https://github.com/truetemm/bedrock-fingerprint/blob/main/src/session/wire.rs): `src/session/wire.rs`

### Fingerprinting

- [Observation collection](https://github.com/truetemm/bedrock-fingerprint/blob/main/src/fingerprint.rs): `src/fingerprint.rs`
- [Known core signatures](https://github.com/truetemm/bedrock-fingerprint/blob/main/src/fingerprint/database.rs): `src/fingerprint/database.rs`
- [Weighted matching](https://github.com/truetemm/bedrock-fingerprint/blob/main/src/fingerprint/signature.rs): `src/fingerprint/signature.rs`

### Other components

- **CLI user**

## Connections

- CLI user → Argument parsing: provides arguments (evidence: `README.md`)
- Argument parsing → Command workflow: parses commands (evidence: `src/main.rs`)
- Command workflow → Address resolver: resolves address (evidence: `src/main.rs`)
- Command workflow → Server target: runs probes (evidence: `src/main.rs`)
- Server target → Status ping: pings server
- Server target → Handshake probe: probes handshake (evidence: `src/target.rs`)
- Server target → Protocol range: checks acceptance
- Server target → Deep protocol probe: probes protocol
- Server target → Network settings capture: captures settings (evidence: `src/target.rs`)
- Handshake probe → Reply1 parser: requests reply (evidence: `src/handshake.rs`)
- Command workflow → Protocol range: checks range (evidence: `src/main.rs`)
- Command workflow → Deep protocol probe: optionally probes (evidence: `src/main.rs`)
- Command workflow → Observation collection: collects signals (evidence: `src/main.rs`)
- Command workflow → Known core signatures: loads signatures (evidence: `src/main.rs`)
- Command workflow → Text and JSON: prints result (evidence: `src/main.rs`)
- Network settings capture → Reply1 parser: opens connection (evidence: `src/session.rs`)
- Network settings capture → Reliable channel: sends datagrams (evidence: `src/session.rs`)
- Network settings capture → Session packets: builds and parses (evidence: `src/session.rs`)
- Network settings capture → Wire encoding: encodes fields (evidence: `src/session.rs`)
- Observation collection → Status ping: reads status (evidence: `src/fingerprint.rs`)
- Observation collection → Handshake probe: reads signals (evidence: `src/fingerprint.rs`)
- Observation collection → Network settings capture: reads settings (evidence: `src/fingerprint.rs`)
- Observation collection → Protocol range: reads acceptance (evidence: `src/fingerprint.rs`)
- Observation collection → Weighted matching: scores checks (evidence: `src/fingerprint.rs`)
- Known core signatures → Weighted matching: defines checks (evidence: `src/fingerprint/database.rs`)
- Text and JSON → Observation collection: formats signals (evidence: `src/report.rs`)
