# saya147/icf-editor architecture

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

- Interactive diagram: https://gitdiagram.com/saya147/icf-editor
- Repository: https://github.com/saya147/icf-editor
- Video tour (about a minute): https://gitdiagram.com/saya147/icf-editor/video

## Overview

ICF Editor is a Windows desktop tool for editing encrypted game ICF files. The main workflow is to open a file, edit its Pack/App/Patch/Opt and installed-patch records, inspect generated filename previews, then save the file with updated CRCs and encryption; overwriting also creates a .bak copy. The graph reflects the sampled UI, format, and codec code. Other README capabilities are represented where those sources support them; no separate unsampled subsystem is inferred.

Main entry points: [`IcfEditor/MainForm.cs`](https://github.com/saya147/icf-editor/blob/main/IcfEditor/MainForm.cs) (Editor window), [`IcfEditor/IcfFormat.cs`](https://github.com/saya147/icf-editor/blob/main/IcfEditor/IcfFormat.cs) (Document codec), [`IcfEditor/Program.cs`](https://github.com/saya147/icf-editor/blob/main/IcfEditor/Program.cs) (App startup), [`IcfEditor/NativeCodec.cs`](https://github.com/saya147/icf-editor/blob/main/IcfEditor/NativeCodec.cs) (Codec wrapper)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Desktop UI"]
  node_program["App startup<br/>[Program.cs]"]
  node_mainform["Editor window<br/>[MainForm.cs]"]
end

subgraph group_format["ICF Format"]
  node_record["Record model<br/>[IcfFormat.cs]"]
  node_document["Document codec<br/>[IcfFormat.cs]"]
end

subgraph group_codec["Native Codec"]
  node_nativewrapper["Codec wrapper<br/>[NativeCodec.cs]"]
  node_native["CRC and AES<br/>[IcfCodec.cpp]"]
end

node_user(("Editor user"))
node_icffile[("ICF files")]
node_backup[("Backup files")]

node_user -->|"launches"| node_program
node_program -->|"opens"| node_mainform
node_user -->|"edits and saves"| node_mainform
node_mainform -->|"loads and saves"| node_document
node_mainform -->|"previews names"| node_record
node_document -->|"parses and builds"| node_record
node_document -->|"reads and writes"| node_icffile
node_mainform -->|"copies before overwrite"| node_backup
node_document -->|"requests CRC and encryption"| node_nativewrapper
node_nativewrapper -->|"invokes"| node_native

click node_program "https://github.com/saya147/icf-editor/blob/main/IcfEditor/Program.cs"
click node_mainform "https://github.com/saya147/icf-editor/blob/main/IcfEditor/MainForm.cs"
click node_record "https://github.com/saya147/icf-editor/blob/main/IcfEditor/IcfFormat.cs"
click node_document "https://github.com/saya147/icf-editor/blob/main/IcfEditor/IcfFormat.cs"
click node_nativewrapper "https://github.com/saya147/icf-editor/blob/main/IcfEditor/NativeCodec.cs"
click node_native "https://github.com/saya147/icf-editor/blob/main/native/IcfCodec.cpp"

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_program,node_mainform,node_user toneBlue
class node_record,node_document,node_icffile,node_backup toneAmber
class node_nativewrapper,node_native toneMint
```

## Components

### Desktop UI

- [App startup](https://github.com/saya147/icf-editor/blob/main/IcfEditor/Program.cs): `IcfEditor/Program.cs`
- [Editor window](https://github.com/saya147/icf-editor/blob/main/IcfEditor/MainForm.cs): `IcfEditor/MainForm.cs`

### ICF Format

- [Record model](https://github.com/saya147/icf-editor/blob/main/IcfEditor/IcfFormat.cs): `IcfEditor/IcfFormat.cs`
- [Document codec](https://github.com/saya147/icf-editor/blob/main/IcfEditor/IcfFormat.cs): `IcfEditor/IcfFormat.cs`

### Native Codec

- [Codec wrapper](https://github.com/saya147/icf-editor/blob/main/IcfEditor/NativeCodec.cs): `IcfEditor/NativeCodec.cs`
- [CRC and AES](https://github.com/saya147/icf-editor/blob/main/native/IcfCodec.cpp): `native/IcfCodec.cpp`

### Other components

- **Editor user**
- **ICF files**
- **Backup files**

## Connections

- Editor user → App startup: launches
- App startup → Editor window: opens
- Editor user → Editor window: edits and saves
- Editor window → Document codec: loads and saves
- Editor window → Record model: previews names
- Document codec → Record model: parses and builds
- Document codec → ICF files: reads and writes
- Editor window → Backup files: copies before overwrite
- Document codec → Codec wrapper: requests CRC and encryption
- Codec wrapper → CRC and AES: invokes
