# noxcis/xaiomi-bootlogo-editior architecture

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

- Interactive diagram: https://gitdiagram.com/noxcis/xaiomi-bootlogo-editior
- Repository: https://github.com/noxcis/xaiomi-bootlogo-editior

## Overview

This repository is a Xiaomi UEFI boot-logo extraction and replacement tool. Its main workflow is to obtain an imagefv partition dump, inspect its nested ELF/FV/FFS and compressed LOGO!!!! data, extract editable logos and metadata, then rebuild the image with replacements. The README also documents partition inspection and device dumping. The shell script’s implementation was not sampled, so its internal detection and dump steps are not expanded; flashing is an external user action.

Main entry points: [`logo_tool.py`](https://github.com/noxcis/xaiomi-bootlogo-editior/blob/main/logo_tool.py) (Command interface), [`dump_logo.sh`](https://github.com/noxcis/xaiomi-bootlogo-editior/blob/main/dump_logo.sh) (Partition dumper)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_acquisition["Device acquisition"]
  node_dump_script["Partition dumper<br/>[dump_logo.sh]"]
  node_image_dump["imagefv dump"]
end

subgraph group_imagefv["Image parsing"]
  node_cli["Command interface<br/>[logo_tool.py]"]
  node_image_parser["ELF / FV parser<br/>[logo_tool.py]"]
  node_fv_decoder["Inner FV decoder<br/>[logo_tool.py]"]
  node_ffs_locator["Logo FFS locator<br/>[logo_tool.py]"]
end

subgraph group_logos["Logo editing"]
  node_logo_decoder["LOGO decoder<br/>[logo_tool.py]"]
  node_metadata["Logo metadata<br/>[logo_tool.py]"]
  node_logo_files["BMP / PNG logos"]
end

subgraph group_rebuild["Image rebuilding"]
  node_logo_encoder["Logo encoder<br/>[logo_tool.py]"]
  node_ffs_patcher["FFS / FV patcher<br/>[logo_tool.py]"]
  node_lzma_encoder["LZMA encoder<br/>[logo_tool.py]"]
  node_elf_writer["ELF writer<br/>[logo_tool.py]"]
  node_output_image["Repacked imagefv"]
end

node_user(("Device owner"))
node_device["Xiaomi device"]
node_image_editor["Image editor"]
node_fastboot["Fastboot"]

node_user -->|"runs dump"| node_dump_script
node_dump_script -->|"reads partition"| node_device
node_dump_script -->|"writes dump"| node_image_dump
node_user -->|"runs command"| node_cli
node_image_dump -->|"provides input"| node_cli
node_cli -->|"parses structure"| node_image_parser
node_image_parser -->|"locates compressed FV"| node_fv_decoder
node_fv_decoder -->|"finds logo FFS"| node_ffs_locator
node_ffs_locator -->|"provides logo section"| node_logo_decoder
node_logo_decoder -->|"writes images"| node_logo_files
node_logo_decoder -->|"writes metadata"| node_metadata
node_user -->|"edits logos"| node_image_editor
node_logo_files -->|"opens images"| node_image_editor
node_image_editor -->|"saves replacements"| node_logo_files
node_cli -->|"repack command"| node_logo_encoder
node_logo_files -->|"reads replacements"| node_logo_encoder
node_metadata -->|"provides slot data"| node_logo_encoder
node_logo_encoder -->|"builds logo section"| node_ffs_patcher
node_ffs_patcher -->|"compresses inner FV"| node_lzma_encoder
node_lzma_encoder -->|"provides compressed FV"| node_elf_writer
node_elf_writer -->|"writes image"| node_output_image
node_output_image -->|"flashed by user"| node_fastboot

click node_dump_script "https://github.com/noxcis/xaiomi-bootlogo-editior/blob/main/dump_logo.sh"
click node_cli "https://github.com/noxcis/xaiomi-bootlogo-editior/blob/main/logo_tool.py"
click node_image_parser "https://github.com/noxcis/xaiomi-bootlogo-editior/blob/main/logo_tool.py"
click node_fv_decoder "https://github.com/noxcis/xaiomi-bootlogo-editior/blob/main/logo_tool.py"
click node_ffs_locator "https://github.com/noxcis/xaiomi-bootlogo-editior/blob/main/logo_tool.py"
click node_logo_decoder "https://github.com/noxcis/xaiomi-bootlogo-editior/blob/main/logo_tool.py"
click node_metadata "https://github.com/noxcis/xaiomi-bootlogo-editior/blob/main/logo_tool.py"
click node_logo_encoder "https://github.com/noxcis/xaiomi-bootlogo-editior/blob/main/logo_tool.py"
click node_ffs_patcher "https://github.com/noxcis/xaiomi-bootlogo-editior/blob/main/logo_tool.py"
click node_lzma_encoder "https://github.com/noxcis/xaiomi-bootlogo-editior/blob/main/logo_tool.py"
click node_elf_writer "https://github.com/noxcis/xaiomi-bootlogo-editior/blob/main/logo_tool.py"

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_dump_script,node_image_dump toneBlue
class node_cli,node_image_parser,node_fv_decoder,node_ffs_locator toneAmber
class node_logo_decoder,node_metadata,node_logo_files toneMint
class node_logo_encoder,node_ffs_patcher,node_lzma_encoder,node_elf_writer,node_output_image toneRose
class node_user,node_device,node_image_editor,node_fastboot toneIndigo
```

## Components

### Device acquisition

- [Partition dumper](https://github.com/noxcis/xaiomi-bootlogo-editior/blob/main/dump_logo.sh): `dump_logo.sh`
- **imagefv dump**

### Image parsing

- [Command interface](https://github.com/noxcis/xaiomi-bootlogo-editior/blob/main/logo_tool.py): `logo_tool.py`
- [ELF / FV parser](https://github.com/noxcis/xaiomi-bootlogo-editior/blob/main/logo_tool.py): `logo_tool.py`
- [Inner FV decoder](https://github.com/noxcis/xaiomi-bootlogo-editior/blob/main/logo_tool.py): `logo_tool.py`
- [Logo FFS locator](https://github.com/noxcis/xaiomi-bootlogo-editior/blob/main/logo_tool.py): `logo_tool.py`

### Logo editing

- [LOGO decoder](https://github.com/noxcis/xaiomi-bootlogo-editior/blob/main/logo_tool.py): `logo_tool.py`
- [Logo metadata](https://github.com/noxcis/xaiomi-bootlogo-editior/blob/main/logo_tool.py): `logo_tool.py`
- **BMP / PNG logos**

### Image rebuilding

- [Logo encoder](https://github.com/noxcis/xaiomi-bootlogo-editior/blob/main/logo_tool.py): `logo_tool.py`
- [FFS / FV patcher](https://github.com/noxcis/xaiomi-bootlogo-editior/blob/main/logo_tool.py): `logo_tool.py`
- [LZMA encoder](https://github.com/noxcis/xaiomi-bootlogo-editior/blob/main/logo_tool.py): `logo_tool.py`
- [ELF writer](https://github.com/noxcis/xaiomi-bootlogo-editior/blob/main/logo_tool.py): `logo_tool.py`
- **Repacked imagefv**

### Other components

- **Device owner**
- **Xiaomi device**
- **Image editor**
- **Fastboot**

## Connections

- Device owner → Partition dumper: runs dump (evidence: `README.md`)
- Partition dumper → Xiaomi device: reads partition (evidence: `README.md`)
- Partition dumper → imagefv dump: writes dump (evidence: `README.md`)
- Device owner → Command interface: runs command (evidence: `README.md`)
- imagefv dump → Command interface: provides input (evidence: `README.md`)
- Command interface → ELF / FV parser: parses structure (evidence: `logo_tool.py`)
- ELF / FV parser → Inner FV decoder: locates compressed FV (evidence: `logo_tool.py`)
- Inner FV decoder → Logo FFS locator: finds logo FFS (evidence: `logo_tool.py`)
- Logo FFS locator → LOGO decoder: provides logo section (evidence: `logo_tool.py`)
- LOGO decoder → BMP / PNG logos: writes images (evidence: `README.md`)
- LOGO decoder → Logo metadata: writes metadata (evidence: `README.md`)
- Device owner → Image editor: edits logos (evidence: `README.md`)
- BMP / PNG logos → Image editor: opens images (evidence: `README.md`)
- Image editor → BMP / PNG logos: saves replacements (evidence: `README.md`)
- Command interface → Logo encoder: repack command (evidence: `README.md`)
- BMP / PNG logos → Logo encoder: reads replacements (evidence: `README.md`)
- Logo metadata → Logo encoder: provides slot data (evidence: `README.md`)
- Logo encoder → FFS / FV patcher: builds logo section (evidence: `logo_tool.py`)
- FFS / FV patcher → LZMA encoder: compresses inner FV (evidence: `README.md`)
- LZMA encoder → ELF writer: provides compressed FV (evidence: `README.md`)
- ELF writer → Repacked imagefv: writes image (evidence: `README.md`)
- Repacked imagefv → Fastboot: flashed by user (evidence: `README.md`)
