# umineko-project/umineko-scripting architecture

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

- Interactive diagram: https://gitdiagram.com/umineko-project/umineko-scripting
- Repository: https://github.com/umineko-project/umineko-scripting

## Overview

This repository contains supporting code for the Umineko Project port: file-extraction utilities, script-related tools, and selected generated subfunctions. The clearest workflow is invoking AlchemistUnpacker on a game asset: it identifies the file type and dispatches to a format-specific processor that produces an output image or file. Other extraction and parsing tools are separate branches. The excerpts establish only part of their wiring, so unverified links are omitted; the README describes the broader project purpose, not the detailed runtime relationships.

Main entry points: [`extraction/AlchemistUnpacker/AlchemistUnpacker/main.h`](https://github.com/umineko-project/umineko-scripting/blob/master/extraction/AlchemistUnpacker/AlchemistUnpacker/main.h) (Format APIs), [`extraction/AlchemistUnpacker/AlchemistUnpacker/main.cpp`](https://github.com/umineko-project/umineko-scripting/blob/master/extraction/AlchemistUnpacker/AlchemistUnpacker/main.cpp) (Unpacker CLI), [`extraction/higu/common.py`](https://github.com/umineko-project/umineko-scripting/blob/master/extraction/higu/common.py) (Chunk extraction), [`extraction/higu/decompress.py`](https://github.com/umineko-project/umineko-scripting/blob/master/extraction/higu/decompress.py) (Higu decompression)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_unpack["Asset unpacking"]
  node_cli["Unpacker CLI<br/>[main.cpp]"]
  node_api["Format APIs<br/>[main.h]"]
  node_higu_unpack["Higu formats<br/>[higu.cpp]"]
  node_snr_unpack["SNR formats<br/>[snr.cpp]"]
  node_sui_unpack["Sui formats<br/>[sui.cpp]"]
  node_umi_unpack["Umineko formats<br/>[umi.cpp]"]
  node_hou_unpack["Hou formats<br/>[hou.cpp]"]
  node_image_output["Image output<br/>[graphics.cpp]"]
end

subgraph group_python["Higurashi extraction"]
  node_higu_python["Chunk extraction<br/>[common.py]"]
  node_decompress["Higu decompression<br/>[decompress.py]"]
  node_python_tools["Dump helpers<br/>[tools.py]"]
  node_higu_formats["Higu asset scripts"]
end

subgraph group_snr["SNR tooling"]
  node_snr_parser["PS3 SNR parser<br/>[snrparser.php]"]
  node_xml_parser["XML parser<br/>[XMLParser.php]"]
  node_subfunctions["Script subfunctions"]
end

subgraph group_support["Port support code"]
  node_update_manager["Update manager<br/>[update-manager.php]"]
  node_sdl_headers["SDL interfaces"]
  node_compression_headers["PNG and zlib"]
end

node_user(("Tool user"))

node_user -->|"runs"| node_cli
node_cli -->|"dispatches formats"| node_higu_unpack
node_cli -->|"dispatches formats"| node_umi_unpack
node_cli -->|"dispatches formats"| node_sui_unpack
node_cli -.->|"selects SNR mode"| node_snr_unpack
node_api -->|"declares handlers"| node_higu_unpack
node_api -->|"declares handlers"| node_umi_unpack
node_api -->|"declares handlers"| node_sui_unpack
node_api -->|"declares handlers"| node_hou_unpack
node_higu_python -->|"uses decompressor"| node_decompress
node_higu_python -->|"imports helpers"| node_python_tools
node_decompress -->|"imports helpers"| node_python_tools
node_higu_formats -.->|"uses extraction code"| node_higu_python
node_snr_parser -->|"uses parser"| node_xml_parser
node_cli -->|"uses declarations"| node_api
node_api -->|"includes SDL"| node_sdl_headers
node_api -->|"includes image libraries"| node_compression_headers

click node_cli "https://github.com/umineko-project/umineko-scripting/blob/master/extraction/AlchemistUnpacker/AlchemistUnpacker/main.cpp"
click node_api "https://github.com/umineko-project/umineko-scripting/blob/master/extraction/AlchemistUnpacker/AlchemistUnpacker/main.h"
click node_higu_unpack "https://github.com/umineko-project/umineko-scripting/blob/master/extraction/AlchemistUnpacker/AlchemistUnpacker/higu.cpp"
click node_snr_unpack "https://github.com/umineko-project/umineko-scripting/blob/master/extraction/AlchemistUnpacker/AlchemistUnpacker/snr.cpp"
click node_sui_unpack "https://github.com/umineko-project/umineko-scripting/blob/master/extraction/AlchemistUnpacker/AlchemistUnpacker/sui.cpp"
click node_umi_unpack "https://github.com/umineko-project/umineko-scripting/blob/master/extraction/AlchemistUnpacker/AlchemistUnpacker/umi.cpp"
click node_hou_unpack "https://github.com/umineko-project/umineko-scripting/blob/master/extraction/AlchemistUnpacker/AlchemistUnpacker/hou.cpp"
click node_image_output "https://github.com/umineko-project/umineko-scripting/blob/master/extraction/AlchemistUnpacker/AlchemistUnpacker/graphics.cpp"
click node_higu_python "https://github.com/umineko-project/umineko-scripting/blob/master/extraction/higu/common.py"
click node_decompress "https://github.com/umineko-project/umineko-scripting/blob/master/extraction/higu/decompress.py"
click node_python_tools "https://github.com/umineko-project/umineko-scripting/blob/master/extraction/higu/tools.py"
click node_higu_formats "https://github.com/umineko-project/umineko-scripting/tree/master/extraction/higu"
click node_snr_parser "https://github.com/umineko-project/umineko-scripting/blob/master/extraction/ps3snr/snrparser.php"
click node_xml_parser "https://github.com/umineko-project/umineko-scripting/blob/master/extraction/ps3snr/lib/XMLParser.php"
click node_subfunctions "https://github.com/umineko-project/umineko-scripting/tree/master/snr/output"
click node_update_manager "https://github.com/umineko-project/umineko-scripting/blob/master/update-manager/update-manager.php"
click node_sdl_headers "https://github.com/umineko-project/umineko-scripting/tree/master/extraction/AlchemistUnpacker/headers/SDL"
click node_compression_headers "https://github.com/umineko-project/umineko-scripting/tree/master/extraction/AlchemistUnpacker/headers"

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_api,node_higu_unpack,node_snr_unpack,node_sui_unpack,node_umi_unpack,node_hou_unpack,node_image_output,node_user toneBlue
class node_higu_python,node_decompress,node_python_tools,node_higu_formats toneAmber
class node_snr_parser,node_xml_parser,node_subfunctions toneMint
class node_update_manager,node_sdl_headers,node_compression_headers toneRose
```

## Components

### Asset unpacking

- [Unpacker CLI](https://github.com/umineko-project/umineko-scripting/blob/master/extraction/AlchemistUnpacker/AlchemistUnpacker/main.cpp): `extraction/AlchemistUnpacker/AlchemistUnpacker/main.cpp`
- [Format APIs](https://github.com/umineko-project/umineko-scripting/blob/master/extraction/AlchemistUnpacker/AlchemistUnpacker/main.h): `extraction/AlchemistUnpacker/AlchemistUnpacker/main.h`
- [Higu formats](https://github.com/umineko-project/umineko-scripting/blob/master/extraction/AlchemistUnpacker/AlchemistUnpacker/higu.cpp): `extraction/AlchemistUnpacker/AlchemistUnpacker/higu.cpp`
- [SNR formats](https://github.com/umineko-project/umineko-scripting/blob/master/extraction/AlchemistUnpacker/AlchemistUnpacker/snr.cpp): `extraction/AlchemistUnpacker/AlchemistUnpacker/snr.cpp`
- [Sui formats](https://github.com/umineko-project/umineko-scripting/blob/master/extraction/AlchemistUnpacker/AlchemistUnpacker/sui.cpp): `extraction/AlchemistUnpacker/AlchemistUnpacker/sui.cpp`
- [Umineko formats](https://github.com/umineko-project/umineko-scripting/blob/master/extraction/AlchemistUnpacker/AlchemistUnpacker/umi.cpp): `extraction/AlchemistUnpacker/AlchemistUnpacker/umi.cpp`
- [Hou formats](https://github.com/umineko-project/umineko-scripting/blob/master/extraction/AlchemistUnpacker/AlchemistUnpacker/hou.cpp): `extraction/AlchemistUnpacker/AlchemistUnpacker/hou.cpp`
- [Image output](https://github.com/umineko-project/umineko-scripting/blob/master/extraction/AlchemistUnpacker/AlchemistUnpacker/graphics.cpp): `extraction/AlchemistUnpacker/AlchemistUnpacker/graphics.cpp`

### Higurashi extraction

- [Chunk extraction](https://github.com/umineko-project/umineko-scripting/blob/master/extraction/higu/common.py): `extraction/higu/common.py`
- [Higu decompression](https://github.com/umineko-project/umineko-scripting/blob/master/extraction/higu/decompress.py): `extraction/higu/decompress.py`
- [Dump helpers](https://github.com/umineko-project/umineko-scripting/blob/master/extraction/higu/tools.py): `extraction/higu/tools.py`
- [Higu asset scripts](https://github.com/umineko-project/umineko-scripting/tree/master/extraction/higu): `extraction/higu`

### SNR tooling

- [PS3 SNR parser](https://github.com/umineko-project/umineko-scripting/blob/master/extraction/ps3snr/snrparser.php): `extraction/ps3snr/snrparser.php`
- [XML parser](https://github.com/umineko-project/umineko-scripting/blob/master/extraction/ps3snr/lib/XMLParser.php): `extraction/ps3snr/lib/XMLParser.php`
- [Script subfunctions](https://github.com/umineko-project/umineko-scripting/tree/master/snr/output): `snr/output`

### Port support code

- [Update manager](https://github.com/umineko-project/umineko-scripting/blob/master/update-manager/update-manager.php): `update-manager/update-manager.php`
- [SDL interfaces](https://github.com/umineko-project/umineko-scripting/tree/master/extraction/AlchemistUnpacker/headers/SDL): `extraction/AlchemistUnpacker/headers/SDL`
- [PNG and zlib](https://github.com/umineko-project/umineko-scripting/tree/master/extraction/AlchemistUnpacker/headers): `extraction/AlchemistUnpacker/headers`

### Other components

- **Tool user**

## Connections

- Tool user → Unpacker CLI: runs (evidence: `extraction/AlchemistUnpacker/AlchemistUnpacker/main.cpp`)
- Unpacker CLI → Higu formats: dispatches formats (evidence: `extraction/AlchemistUnpacker/AlchemistUnpacker/main.cpp`)
- Unpacker CLI → Umineko formats: dispatches formats (evidence: `extraction/AlchemistUnpacker/AlchemistUnpacker/main.cpp`)
- Unpacker CLI → Sui formats: dispatches formats (evidence: `extraction/AlchemistUnpacker/AlchemistUnpacker/main.cpp`)
- Unpacker CLI → SNR formats: selects SNR mode
- Format APIs → Higu formats: declares handlers (evidence: `extraction/AlchemistUnpacker/AlchemistUnpacker/main.h`)
- Format APIs → Umineko formats: declares handlers (evidence: `extraction/AlchemistUnpacker/AlchemistUnpacker/main.h`)
- Format APIs → Sui formats: declares handlers (evidence: `extraction/AlchemistUnpacker/AlchemistUnpacker/main.h`)
- Format APIs → Hou formats: declares handlers (evidence: `extraction/AlchemistUnpacker/AlchemistUnpacker/main.h`)
- Chunk extraction → Higu decompression: uses decompressor (evidence: `extraction/higu/common.py`)
- Chunk extraction → Dump helpers: imports helpers (evidence: `extraction/higu/common.py`)
- Higu decompression → Dump helpers: imports helpers (evidence: `extraction/higu/decompress.py`)
- Higu asset scripts → Chunk extraction: uses extraction code (evidence: `extraction/higu/bup.py`)
- PS3 SNR parser → XML parser: uses parser (evidence: `extraction/ps3snr/snrparser.php`)
- Unpacker CLI → Format APIs: uses declarations (evidence: `extraction/AlchemistUnpacker/AlchemistUnpacker/main.cpp`)
- Format APIs → SDL interfaces: includes SDL (evidence: `extraction/AlchemistUnpacker/AlchemistUnpacker/main.h`)
- Format APIs → PNG and zlib: includes image libraries (evidence: `extraction/AlchemistUnpacker/AlchemistUnpacker/main.h`)
