# mcmilk/7-zip architecture

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

- Interactive diagram: https://gitdiagram.com/mcmilk/7-zip
- Repository: https://github.com/mcmilk/7-zip

## Overview

This is the source tree for 7-Zip: a multi-format archive manager and compression toolkit with console, file-manager, plugin, and self-extracting front ends. The principal workflow is opening an archive, inspecting its contents, then extracting them; archive creation and updates are another major stage. Format handlers interpret archive metadata and invoke codecs for packed data. The README only describes this repository’s history and discontinuation, so product capabilities are inferred from the tree; connections beyond the supplied excerpts are shown only where the source structure or excerpt supports them.

Main entry points: [`CPP/7zip/Archive/ArchiveExports.cpp`](https://github.com/mcmilk/7-zip/blob/master/CPP/7zip/Archive/ArchiveExports.cpp) (Format registry), [`CPP/7zip/UI/Console/Main.cpp`](https://github.com/mcmilk/7-zip/blob/master/CPP/7zip/UI/Console/Main.cpp) (Console commands), [`CPP/7zip/UI/Common/Update.cpp`](https://github.com/mcmilk/7-zip/blob/master/CPP/7zip/UI/Common/Update.cpp) (Create and update), [`CPP/7zip/Archive/Zip/ZipHandler.cpp`](https://github.com/mcmilk/7-zip/blob/master/CPP/7zip/Archive/Zip/ZipHandler.cpp) (ZIP handler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontends["User interfaces"]
  node_console["Console commands<br/>[Main.cpp]"]
  node_filemanager["File manager<br/>[App.cpp]"]
  node_far_plugin["FAR plugin<br/>[Plugin.cpp]"]
  node_sfx["SFX extractor<br/>[ExtractEngine.cpp]"]
end

subgraph group_archive["Archive operations"]
  node_open["Open archive<br/>[OpenArchive.cpp]"]
  node_extract["Extract workflow<br/>[Extract.cpp]"]
  node_update["Create and update<br/>[Update.cpp]"]
  node_archive_agent["Archive agent<br/>[Agent.cpp]"]
end

subgraph group_formats["Format handlers"]
  node_seven_handler["7z handler<br/>[7zHandler.cpp]"]
  node_zip_handler["ZIP handler<br/>[ZipHandler.cpp]"]
  node_cab_handler["CAB handler<br/>[CabHandler.cpp]"]
  node_rar_handler["RAR handler<br/>[Rar5Handler.cpp]"]
  node_wim_handler["WIM handler<br/>[WimHandlerOut.cpp]"]
  node_format_registry["Format registry<br/>[ArchiveExports.cpp]"]
end

subgraph group_codecs["Compression and crypto"]
  node_coder_factory["Coder factory<br/>[CreateCoder.cpp]"]
  node_compressors["Compression codecs<br/>[LzmaDecoder.cpp]"]
  node_crypto["Archive crypto<br/>[7zAes.cpp]"]
end

subgraph group_runtime["Runtime utilities"]
  node_stream_runtime["Stream utilities<br/>[StreamUtils.cpp]"]
  node_c_core["C codec core<br/>[7zDec.c]"]
end

node_cli_user(("CLI user"))
node_gui_user(("GUI user"))
node_filesystem[("Filesystem")]

node_cli_user -->|"issues commands"| node_console
node_gui_user -->|"uses"| node_filemanager
node_gui_user -->|"uses"| node_far_plugin
node_console -->|"opens archives"| node_open
node_console -->|"requests extraction"| node_extract
node_console -->|"requests updates"| node_update
node_filemanager -->|"delegates archive work"| node_archive_agent
node_far_plugin -->|"delegates archive work"| node_archive_agent
node_sfx -->|"opens archive"| node_open
node_sfx -->|"creates destination and extracts"| node_filesystem
node_open -->|"selects format handler"| node_format_registry
node_format_registry -->|"dispatches"| node_seven_handler
node_format_registry -->|"dispatches"| node_zip_handler
node_format_registry -->|"dispatches"| node_cab_handler
node_format_registry -->|"dispatches"| node_rar_handler
node_format_registry -->|"dispatches"| node_wim_handler
node_seven_handler -->|"requests coders"| node_coder_factory
node_zip_handler -->|"requests coders"| node_coder_factory
node_coder_factory -->|"creates coder"| node_compressors
node_zip_handler -->|"uses decryption"| node_crypto
node_extract -->|"writes extracted files"| node_filesystem
node_update -->|"reads input files"| node_filesystem
node_update -->|"writes 7z archives"| node_seven_handler
node_update -->|"writes WIM archives"| node_wim_handler
node_compressors -.->|"uses C implementations"| node_c_core

click node_console "https://github.com/mcmilk/7-zip/blob/master/CPP/7zip/UI/Console/Main.cpp"
click node_filemanager "https://github.com/mcmilk/7-zip/blob/master/CPP/7zip/UI/FileManager/App.cpp"
click node_far_plugin "https://github.com/mcmilk/7-zip/blob/master/CPP/7zip/UI/Far/Plugin.cpp"
click node_sfx "https://github.com/mcmilk/7-zip/blob/master/CPP/7zip/Bundles/SFXSetup/ExtractEngine.cpp"
click node_open "https://github.com/mcmilk/7-zip/blob/master/CPP/7zip/UI/Common/OpenArchive.cpp"
click node_extract "https://github.com/mcmilk/7-zip/blob/master/CPP/7zip/UI/Common/Extract.cpp"
click node_update "https://github.com/mcmilk/7-zip/blob/master/CPP/7zip/UI/Common/Update.cpp"
click node_archive_agent "https://github.com/mcmilk/7-zip/blob/master/CPP/7zip/UI/Agent/Agent.cpp"
click node_seven_handler "https://github.com/mcmilk/7-zip/blob/master/CPP/7zip/Archive/7z/7zHandler.cpp"
click node_zip_handler "https://github.com/mcmilk/7-zip/blob/master/CPP/7zip/Archive/Zip/ZipHandler.cpp"
click node_cab_handler "https://github.com/mcmilk/7-zip/blob/master/CPP/7zip/Archive/Cab/CabHandler.cpp"
click node_rar_handler "https://github.com/mcmilk/7-zip/blob/master/CPP/7zip/Archive/Rar/Rar5Handler.cpp"
click node_wim_handler "https://github.com/mcmilk/7-zip/blob/master/CPP/7zip/Archive/Wim/WimHandlerOut.cpp"
click node_format_registry "https://github.com/mcmilk/7-zip/blob/master/CPP/7zip/Archive/ArchiveExports.cpp"
click node_coder_factory "https://github.com/mcmilk/7-zip/blob/master/CPP/7zip/Common/CreateCoder.cpp"
click node_compressors "https://github.com/mcmilk/7-zip/blob/master/CPP/7zip/Compress/LzmaDecoder.cpp"
click node_crypto "https://github.com/mcmilk/7-zip/blob/master/CPP/7zip/Crypto/7zAes.cpp"
click node_stream_runtime "https://github.com/mcmilk/7-zip/blob/master/CPP/7zip/Common/StreamUtils.cpp"
click node_c_core "https://github.com/mcmilk/7-zip/blob/master/C/7zDec.c"

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_console,node_filemanager,node_far_plugin,node_sfx,node_cli_user,node_gui_user toneBlue
class node_open,node_extract,node_update,node_archive_agent,node_filesystem toneAmber
class node_seven_handler,node_zip_handler,node_cab_handler,node_rar_handler,node_wim_handler,node_format_registry toneMint
class node_coder_factory,node_compressors,node_crypto toneRose
class node_stream_runtime,node_c_core toneIndigo
```

## Components

### User interfaces

- [Console commands](https://github.com/mcmilk/7-zip/blob/master/CPP/7zip/UI/Console/Main.cpp): `CPP/7zip/UI/Console/Main.cpp`
- [File manager](https://github.com/mcmilk/7-zip/blob/master/CPP/7zip/UI/FileManager/App.cpp): `CPP/7zip/UI/FileManager/App.cpp`
- [FAR plugin](https://github.com/mcmilk/7-zip/blob/master/CPP/7zip/UI/Far/Plugin.cpp): `CPP/7zip/UI/Far/Plugin.cpp`
- [SFX extractor](https://github.com/mcmilk/7-zip/blob/master/CPP/7zip/Bundles/SFXSetup/ExtractEngine.cpp): `CPP/7zip/Bundles/SFXSetup/ExtractEngine.cpp`

### Archive operations

- [Open archive](https://github.com/mcmilk/7-zip/blob/master/CPP/7zip/UI/Common/OpenArchive.cpp): `CPP/7zip/UI/Common/OpenArchive.cpp`
- [Extract workflow](https://github.com/mcmilk/7-zip/blob/master/CPP/7zip/UI/Common/Extract.cpp): `CPP/7zip/UI/Common/Extract.cpp`
- [Create and update](https://github.com/mcmilk/7-zip/blob/master/CPP/7zip/UI/Common/Update.cpp): `CPP/7zip/UI/Common/Update.cpp`
- [Archive agent](https://github.com/mcmilk/7-zip/blob/master/CPP/7zip/UI/Agent/Agent.cpp): `CPP/7zip/UI/Agent/Agent.cpp`

### Format handlers

- [7z handler](https://github.com/mcmilk/7-zip/blob/master/CPP/7zip/Archive/7z/7zHandler.cpp): `CPP/7zip/Archive/7z/7zHandler.cpp`
- [ZIP handler](https://github.com/mcmilk/7-zip/blob/master/CPP/7zip/Archive/Zip/ZipHandler.cpp): `CPP/7zip/Archive/Zip/ZipHandler.cpp`
- [CAB handler](https://github.com/mcmilk/7-zip/blob/master/CPP/7zip/Archive/Cab/CabHandler.cpp): `CPP/7zip/Archive/Cab/CabHandler.cpp`
- [RAR handler](https://github.com/mcmilk/7-zip/blob/master/CPP/7zip/Archive/Rar/Rar5Handler.cpp): `CPP/7zip/Archive/Rar/Rar5Handler.cpp`
- [WIM handler](https://github.com/mcmilk/7-zip/blob/master/CPP/7zip/Archive/Wim/WimHandlerOut.cpp): `CPP/7zip/Archive/Wim/WimHandlerOut.cpp`
- [Format registry](https://github.com/mcmilk/7-zip/blob/master/CPP/7zip/Archive/ArchiveExports.cpp): `CPP/7zip/Archive/ArchiveExports.cpp`

### Compression and crypto

- [Coder factory](https://github.com/mcmilk/7-zip/blob/master/CPP/7zip/Common/CreateCoder.cpp): `CPP/7zip/Common/CreateCoder.cpp`
- [Compression codecs](https://github.com/mcmilk/7-zip/blob/master/CPP/7zip/Compress/LzmaDecoder.cpp): `CPP/7zip/Compress/LzmaDecoder.cpp`
- [Archive crypto](https://github.com/mcmilk/7-zip/blob/master/CPP/7zip/Crypto/7zAes.cpp): `CPP/7zip/Crypto/7zAes.cpp`

### Runtime utilities

- [Stream utilities](https://github.com/mcmilk/7-zip/blob/master/CPP/7zip/Common/StreamUtils.cpp): `CPP/7zip/Common/StreamUtils.cpp`
- [C codec core](https://github.com/mcmilk/7-zip/blob/master/C/7zDec.c): `C/7zDec.c`

### Other components

- **CLI user**
- **GUI user**
- **Filesystem**

## Connections

- CLI user → Console commands: issues commands
- GUI user → File manager: uses
- GUI user → FAR plugin: uses
- Console commands → Open archive: opens archives
- Console commands → Extract workflow: requests extraction
- Console commands → Create and update: requests updates
- File manager → Archive agent: delegates archive work
- FAR plugin → Archive agent: delegates archive work
- SFX extractor → Open archive: opens archive
- SFX extractor → Filesystem: creates destination and extracts
- Open archive → Format registry: selects format handler
- Format registry → 7z handler: dispatches
- Format registry → ZIP handler: dispatches
- Format registry → CAB handler: dispatches
- Format registry → RAR handler: dispatches
- Format registry → WIM handler: dispatches
- 7z handler → Coder factory: requests coders
- ZIP handler → Coder factory: requests coders
- Coder factory → Compression codecs: creates coder
- ZIP handler → Archive crypto: uses decryption
- Extract workflow → Filesystem: writes extracted files
- Create and update → Filesystem: reads input files
- Create and update → 7z handler: writes 7z archives
- Create and update → WIM handler: writes WIM archives
- Compression codecs → C codec core: uses C implementations
