# hashment/yaffs2-forensic-tool architecture

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

- Interactive diagram: https://gitdiagram.com/hashment/yaffs2-forensic-tool
- Repository: https://github.com/hashment/yaffs2-forensic-tool

## Overview

This is a standalone YAFFS2 forensic dumper and recovery tool. An investigator supplies a NAND image and format options through the CLI; the CLI configures the forensic engine, which analyzes YAFFS2 objects and supports metadata review, file-version reconstruction, and recovery of deleted or orphaned content. Results can be listed or restored to a filesystem. The engine’s unsampled internals are represented at the documented capability level; edges cite the README or the shown CLI and engine excerpts.

Main entry points: [`Yaffs2Forensic.py`](https://github.com/hashment/yaffs2-forensic-tool/blob/main/Yaffs2Forensic.py) (Forensic engine), [`yaffs2_parser.py`](https://github.com/hashment/yaffs2-forensic-tool/blob/main/yaffs2_parser.py) (CLI options)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_cli["CLI options<br/>[yaffs2_parser.py]"]
end

subgraph group_analysis["Image analysis"]
  node_engine["Forensic engine<br/>[Yaffs2Forensic.py]"]
  node_format["Format detection<br/>[Yaffs2Forensic.py]"]
  node_object_analysis["Object analysis<br/>[Yaffs2Forensic.py]"]
end

subgraph group_results["Forensic results"]
  node_history_recovery["History and recovery<br/>[Yaffs2Forensic.py]"]
  node_metadata["Metadata results<br/>[Yaffs2Forensic.py]"]
  node_restoration["Filesystem export<br/>[Yaffs2Forensic.py]"]
end

node_analyst(("Investigator"))
node_image[("NAND image")]

node_analyst -->|"sets options"| node_cli
node_cli -->|"configures and invokes"| node_engine
node_engine -->|"opens image"| node_image
node_engine -->|"detects format"| node_format
node_engine -->|"parses objects"| node_object_analysis
node_object_analysis -->|"reconstructs versions and recovers deleted or orphaned files"| node_history_recovery
node_object_analysis -->|"extracts metadata"| node_metadata
node_cli -->|"requests object restoration"| node_restoration
node_history_recovery -->|"exports recovered files"| node_restoration

click node_cli "https://github.com/hashment/yaffs2-forensic-tool/blob/main/yaffs2_parser.py"
click node_engine "https://github.com/hashment/yaffs2-forensic-tool/blob/main/Yaffs2Forensic.py"
click node_format "https://github.com/hashment/yaffs2-forensic-tool/blob/main/Yaffs2Forensic.py"
click node_object_analysis "https://github.com/hashment/yaffs2-forensic-tool/blob/main/Yaffs2Forensic.py"
click node_history_recovery "https://github.com/hashment/yaffs2-forensic-tool/blob/main/Yaffs2Forensic.py"
click node_metadata "https://github.com/hashment/yaffs2-forensic-tool/blob/main/Yaffs2Forensic.py"
click node_restoration "https://github.com/hashment/yaffs2-forensic-tool/blob/main/Yaffs2Forensic.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_cli toneBlue
class node_engine,node_format,node_object_analysis,node_image toneAmber
class node_history_recovery,node_metadata,node_restoration toneMint
class node_analyst toneIndigo
```

## Components

### User interface

- [CLI options](https://github.com/hashment/yaffs2-forensic-tool/blob/main/yaffs2_parser.py): `yaffs2_parser.py`

### Image analysis

- [Forensic engine](https://github.com/hashment/yaffs2-forensic-tool/blob/main/Yaffs2Forensic.py): `Yaffs2Forensic.py`
- [Format detection](https://github.com/hashment/yaffs2-forensic-tool/blob/main/Yaffs2Forensic.py): `Yaffs2Forensic.py`
- [Object analysis](https://github.com/hashment/yaffs2-forensic-tool/blob/main/Yaffs2Forensic.py): `Yaffs2Forensic.py`

### Forensic results

- [History and recovery](https://github.com/hashment/yaffs2-forensic-tool/blob/main/Yaffs2Forensic.py): `Yaffs2Forensic.py`
- [Metadata results](https://github.com/hashment/yaffs2-forensic-tool/blob/main/Yaffs2Forensic.py): `Yaffs2Forensic.py`
- [Filesystem export](https://github.com/hashment/yaffs2-forensic-tool/blob/main/Yaffs2Forensic.py): `Yaffs2Forensic.py`

### Other components

- **Investigator**
- **NAND image**

## Connections

- Investigator → CLI options: sets options (evidence: `README.md`)
- CLI options → Forensic engine: configures and invokes (evidence: `yaffs2_parser.py`)
- Forensic engine → NAND image: opens image (evidence: `Yaffs2Forensic.py`)
- Forensic engine → Format detection: detects format (evidence: `README.md`)
- Forensic engine → Object analysis: parses objects (evidence: `README.md`)
- Object analysis → History and recovery: reconstructs versions and recovers deleted or orphaned files (evidence: `README.md`)
- Object analysis → Metadata results: extracts metadata (evidence: `README.md`)
- CLI options → Filesystem export: requests object restoration (evidence: `yaffs2_parser.py`)
- History and recovery → Filesystem export: exports recovered files (evidence: `README.md`)
