# havenoverflow/smiko architecture

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

- Interactive diagram: https://gitdiagram.com/havenoverflow/smiko
- Repository: https://github.com/havenoverflow/smiko

## Overview

Smiko is a collection of Google Security Chip research utilities: users provide firmware images or connect to a chip through supported hardware or TPM links, then inspect, extract, or modify firmware and chip state. Its main runtime branches are Smiko, RMASmoke, Shaft, firmware carving, and ChromeOS image/GPT tools. Edges are limited to relationships shown in excerpts or the README; unsampled implementations and integrations are not inferred.

Main entry points: [`src/smiko/src/vendor_cmds.c`](https://github.com/havenoverflow/smiko/blob/main/src/smiko/src/vendor_cmds.c) (Smiko commands), [`src/shaft/src/shaft.c`](https://github.com/havenoverflow/smiko/blob/main/src/shaft/src/shaft.c) (Shaft utility), [`lib/image_tool.py`](https://github.com/havenoverflow/smiko/blob/main/lib/image_tool.py) (ChromeOS image tools), [`src/rmasmoke/src/rmasmoke.cc`](https://github.com/havenoverflow/smiko/blob/main/src/rmasmoke/src/rmasmoke.cc) (RMASmoke exploit)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_chip["Chip interaction"]
  node_smiko["Smiko commands<br/>[vendor_cmds.c]"]
  node_smiko_app["Nugget applications<br/>[app_nugget.h]"]
  node_smiko_api["Application transport API<br/>[application.h]"]
  node_usb["USB transport<br/>[usb.c]"]
  node_tpm["TPM transport<br/>[trunks.c]"]
  node_sysinfo["Chip sysinfo<br/>[sysinfo.c]"]
  node_verify["Firmware verification<br/>[verify.c]"]
  node_rmasmoke["RMASmoke exploit<br/>[rmasmoke.cc]"]
  node_rma_context["TPM context<br/>[tss_context.h]"]
end

subgraph group_firmware["Firmware utilities"]
  node_shaft["Shaft utility<br/>[shaft.c]"]
  node_shaft_transfer["Flash transfer<br/>[transfer.c]"]
  node_mpsse["MPSSE driver<br/>[mpsse.c]"]
  node_rescue["Rescue operations<br/>[rescue.c]"]
  node_carver["Firmware carver<br/>[carver.c]"]
end

subgraph group_images["Image tooling"]
  node_image_tool["ChromeOS image tools<br/>[image_tool.py]"]
  node_netboot["Netboot settings"]
  node_fmap["Flash map parser<br/>[fmap.py]"]
  node_gpt["GPT utility<br/>[pygpt.py]"]
end

subgraph group_shared["Shared formats"]
  node_common["Shared definitions<br/>[common.h]"]
  node_signed_header["Signed header format<br/>[signed_header.h]"]
  node_chip_config["Chip layout config<br/>[chip_config.h]"]
end

node_user(("Researcher"))
node_firmware_image["Firmware image"]
node_gsc["Google Security Chip"]
node_debug_accessory["Debug accessory"]
node_tpm_link["TPM link"]

node_user -->|"runs"| node_smiko
node_user -->|"runs"| node_rmasmoke
node_user -->|"runs"| node_shaft
node_user -->|"extracts with"| node_carver
node_user -->|"manipulates"| node_image_tool
node_smiko -->|"sends commands"| node_usb
node_smiko -->|"sends commands"| node_tpm
node_smiko -->|"validates headers"| node_signed_header
node_smiko -->|"interacts via SuzyQ"| node_gsc
node_smiko -->|"interacts via"| node_tpm_link
node_rmasmoke -->|"uses"| node_tpm_link
node_rmasmoke -->|"uses context"| node_rma_context
node_shaft -.->|"uses"| node_shaft_transfer
node_shaft -.->|"supports rescue"| node_rescue
node_shaft_transfer -->|"uses driver"| node_mpsse
node_shaft -->|"accesses via Servo"| node_gsc
node_carver -->|"reads and carves"| node_firmware_image
node_carver -->|"parses header"| node_signed_header
node_image_tool -->|"uses GPT tools"| node_gpt
node_image_tool -->|"uses settings"| node_netboot
node_netboot -->|"uses map parser"| node_fmap
node_image_tool -.->|"manipulates"| node_firmware_image

click node_smiko "https://github.com/havenoverflow/smiko/blob/main/src/smiko/src/vendor_cmds.c"
click node_smiko_app "https://github.com/havenoverflow/smiko/blob/main/src/smiko/include/app_nugget.h"
click node_smiko_api "https://github.com/havenoverflow/smiko/blob/main/src/smiko/include/application.h"
click node_usb "https://github.com/havenoverflow/smiko/blob/main/src/smiko/src/usb.c"
click node_tpm "https://github.com/havenoverflow/smiko/blob/main/src/smiko/src/trunks.c"
click node_sysinfo "https://github.com/havenoverflow/smiko/blob/main/src/smiko/src/sysinfo.c"
click node_verify "https://github.com/havenoverflow/smiko/blob/main/src/smiko/src/verify.c"
click node_rmasmoke "https://github.com/havenoverflow/smiko/blob/main/src/rmasmoke/src/rmasmoke.cc"
click node_rma_context "https://github.com/havenoverflow/smiko/blob/main/src/rmasmoke/include/tss_context.h"
click node_shaft "https://github.com/havenoverflow/smiko/blob/main/src/shaft/src/shaft.c"
click node_shaft_transfer "https://github.com/havenoverflow/smiko/blob/main/src/shaft/src/transfer.c"
click node_mpsse "https://github.com/havenoverflow/smiko/blob/main/src/shaft/src/mpsse.c"
click node_rescue "https://github.com/havenoverflow/smiko/blob/main/src/shaft/src/rescue.c"
click node_carver "https://github.com/havenoverflow/smiko/blob/main/src/carver/src/carver.c"
click node_image_tool "https://github.com/havenoverflow/smiko/blob/main/lib/image_tool.py"
click node_netboot "https://github.com/havenoverflow/smiko/blob/main/lib/netboot_firmware_settings.py"
click node_fmap "https://github.com/havenoverflow/smiko/blob/main/lib/fmap.py"
click node_gpt "https://github.com/havenoverflow/smiko/blob/main/lib/pygpt.py"
click node_common "https://github.com/havenoverflow/smiko/blob/main/include/common.h"
click node_signed_header "https://github.com/havenoverflow/smiko/blob/main/include/signed_header.h"
click node_chip_config "https://github.com/havenoverflow/smiko/blob/main/include/chip_config.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_smiko,node_smiko_app,node_smiko_api,node_usb,node_tpm,node_sysinfo,node_verify,node_rmasmoke,node_rma_context toneBlue
class node_shaft,node_shaft_transfer,node_mpsse,node_rescue,node_carver toneAmber
class node_image_tool,node_netboot,node_fmap,node_gpt toneMint
class node_common,node_signed_header,node_chip_config toneRose
class node_user,node_firmware_image,node_gsc,node_debug_accessory,node_tpm_link toneIndigo
```

## Components

### Chip interaction

- [Smiko commands](https://github.com/havenoverflow/smiko/blob/main/src/smiko/src/vendor_cmds.c): `src/smiko/src/vendor_cmds.c`
- [Nugget applications](https://github.com/havenoverflow/smiko/blob/main/src/smiko/include/app_nugget.h): `src/smiko/include/app_nugget.h`
- [Application transport API](https://github.com/havenoverflow/smiko/blob/main/src/smiko/include/application.h): `src/smiko/include/application.h`
- [USB transport](https://github.com/havenoverflow/smiko/blob/main/src/smiko/src/usb.c): `src/smiko/src/usb.c`
- [TPM transport](https://github.com/havenoverflow/smiko/blob/main/src/smiko/src/trunks.c): `src/smiko/src/trunks.c`
- [Chip sysinfo](https://github.com/havenoverflow/smiko/blob/main/src/smiko/src/sysinfo.c): `src/smiko/src/sysinfo.c`
- [Firmware verification](https://github.com/havenoverflow/smiko/blob/main/src/smiko/src/verify.c): `src/smiko/src/verify.c`
- [RMASmoke exploit](https://github.com/havenoverflow/smiko/blob/main/src/rmasmoke/src/rmasmoke.cc): `src/rmasmoke/src/rmasmoke.cc`
- [TPM context](https://github.com/havenoverflow/smiko/blob/main/src/rmasmoke/include/tss_context.h): `src/rmasmoke/include/tss_context.h`

### Firmware utilities

- [Shaft utility](https://github.com/havenoverflow/smiko/blob/main/src/shaft/src/shaft.c): `src/shaft/src/shaft.c`
- [Flash transfer](https://github.com/havenoverflow/smiko/blob/main/src/shaft/src/transfer.c): `src/shaft/src/transfer.c`
- [MPSSE driver](https://github.com/havenoverflow/smiko/blob/main/src/shaft/src/mpsse.c): `src/shaft/src/mpsse.c`
- [Rescue operations](https://github.com/havenoverflow/smiko/blob/main/src/shaft/src/rescue.c): `src/shaft/src/rescue.c`
- [Firmware carver](https://github.com/havenoverflow/smiko/blob/main/src/carver/src/carver.c): `src/carver/src/carver.c`

### Image tooling

- [ChromeOS image tools](https://github.com/havenoverflow/smiko/blob/main/lib/image_tool.py): `lib/image_tool.py`
- [Netboot settings](https://github.com/havenoverflow/smiko/blob/main/lib/netboot_firmware_settings.py): `lib/netboot_firmware_settings.py`
- [Flash map parser](https://github.com/havenoverflow/smiko/blob/main/lib/fmap.py): `lib/fmap.py`
- [GPT utility](https://github.com/havenoverflow/smiko/blob/main/lib/pygpt.py): `lib/pygpt.py`

### Shared formats

- [Shared definitions](https://github.com/havenoverflow/smiko/blob/main/include/common.h): `include/common.h`
- [Signed header format](https://github.com/havenoverflow/smiko/blob/main/include/signed_header.h): `include/signed_header.h`
- [Chip layout config](https://github.com/havenoverflow/smiko/blob/main/include/chip_config.h): `include/chip_config.h`

### Other components

- **Researcher**
- **Firmware image**
- **Google Security Chip**
- **Debug accessory**
- **TPM link**

## Connections

- Researcher → Smiko commands: runs (evidence: `README.md`)
- Researcher → RMASmoke exploit: runs (evidence: `README.md`)
- Researcher → Shaft utility: runs (evidence: `README.md`)
- Researcher → Firmware carver: extracts with (evidence: `src/carver/src/carver.c`)
- Researcher → ChromeOS image tools: manipulates (evidence: `lib/image_tool.py`)
- Smiko commands → USB transport: sends commands (evidence: `src/smiko/src/vendor_cmds.c`)
- Smiko commands → TPM transport: sends commands (evidence: `src/smiko/src/vendor_cmds.c`)
- Smiko commands → Signed header format: validates headers (evidence: `src/smiko/src/vendor_cmds.c`)
- Smiko commands → Google Security Chip: interacts via SuzyQ (evidence: `README.md`)
- Smiko commands → TPM link: interacts via (evidence: `README.md`)
- RMASmoke exploit → TPM link: uses (evidence: `README.md`)
- RMASmoke exploit → TPM context: uses context (evidence: `src/rmasmoke/src/rmasmoke.cc`)
- Shaft utility → Flash transfer: uses
- Shaft utility → Rescue operations: supports rescue
- Flash transfer → MPSSE driver: uses driver (evidence: `src/shaft/src/transfer.c`)
- Shaft utility → Google Security Chip: accesses via Servo (evidence: `README.md`)
- Firmware carver → Firmware image: reads and carves (evidence: `src/carver/src/carver.c`)
- Firmware carver → Signed header format: parses header (evidence: `src/carver/src/carver.c`)
- ChromeOS image tools → GPT utility: uses GPT tools (evidence: `lib/image_tool.py`)
- ChromeOS image tools → Netboot settings: uses settings (evidence: `lib/image_tool.py`)
- Netboot settings → Flash map parser: uses map parser (evidence: `lib/netboot_firmware_settings.py`)
- ChromeOS image tools → Firmware image: manipulates
