# learner098/pr-pak-tool architecture

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

- Interactive diagram: https://gitdiagram.com/learner098/pr-pak-tool
- Repository: https://github.com/learner098/pr-pak-tool

## Overview

PR Pak Tool is a cross-platform game-Pak extractor, documented for several PUBG-family formats and currently unpack-only. A user supplies a Pak path; the entry point loads and validates its game/version-specific index, then the unpacker processes entries and writes extracted files. The graph covers the evidenced loading, credentials, and extraction stages, plus the documented compression capability. Some compression and output internals were not shown, so those links are omitted or marked unverified.

Main entry points: [`Src/jni/EntryPoint/Handler/PakHandler.cpp`](https://github.com/learner098/pr-pak-tool/blob/main/Src/jni/EntryPoint/Handler/PakHandler.cpp) (Pak handler), [`Src/jni/Core/Pak/PakManager.cpp`](https://github.com/learner098/pr-pak-tool/blob/main/Src/jni/Core/Pak/PakManager.cpp) (Pak manager), [`Src/jni/Unpacker/Handler.hpp`](https://github.com/learner098/pr-pak-tool/blob/main/Src/jni/Unpacker/Handler.hpp) (Entry extraction), [`Src/jni/EntryPoint/PR_Pak_Tool.cpp`](https://github.com/learner098/pr-pak-tool/blob/main/Src/jni/EntryPoint/PR_Pak_Tool.cpp) (Tool entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Command entry"]
  node_cli["Tool entry<br/>[PR_Pak_Tool.cpp]"]
  node_pak_handler["Pak handler<br/>[PakHandler.cpp]"]
end

subgraph group_pak["Pak loading"]
  node_manager["Pak manager<br/>[PakManager.cpp]"]
  node_pak_structs["Pak structures<br/>[Structure.h]"]
end

subgraph group_security["Keys and game data"]
  node_game_offsets["Game offsets<br/>[Offsets.cpp]"]
  node_creds["Credential manager<br/>[CredsManager.cpp]"]
end

subgraph group_extract["Extraction"]
  node_unpacker["Unpacker<br/>[UnPacker.cpp]"]
  node_extract_handler["Entry extraction<br/>[Handler.hpp]"]
  node_compression["Compression support<br/>[Compression.cpp]"]
end

node_user(("CLI user"))
node_output["Extracted files"]

node_user -->|"supplies Pak"| node_cli
node_cli -->|"dispatches to"| node_pak_handler
node_pak_handler -->|"sets up Pak"| node_manager
node_pak_handler -->|"detects and initializes"| node_game_offsets
node_pak_handler -->|"starts unpacking"| node_unpacker
node_manager -->|"creates and uses"| node_creds
node_creds -->|"reads key data"| node_game_offsets
node_unpacker -->|"uses handler"| node_extract_handler
node_extract_handler -->|"reads and decrypts entries"| node_manager
node_extract_handler -->|"writes files"| node_output
node_manager -.->|"uses compression routines"| node_compression

click node_cli "https://github.com/learner098/pr-pak-tool/blob/main/Src/jni/EntryPoint/PR_Pak_Tool.cpp"
click node_pak_handler "https://github.com/learner098/pr-pak-tool/blob/main/Src/jni/EntryPoint/Handler/PakHandler.cpp"
click node_manager "https://github.com/learner098/pr-pak-tool/blob/main/Src/jni/Core/Pak/PakManager.cpp"
click node_pak_structs "https://github.com/learner098/pr-pak-tool/blob/main/Src/jni/Core/Pak/Structure.h"
click node_game_offsets "https://github.com/learner098/pr-pak-tool/blob/main/Src/jni/Game/Offsets.cpp"
click node_creds "https://github.com/learner098/pr-pak-tool/blob/main/Src/jni/Core/Cred/CredsManager.cpp"
click node_unpacker "https://github.com/learner098/pr-pak-tool/blob/main/Src/jni/Unpacker/UnPacker.cpp"
click node_extract_handler "https://github.com/learner098/pr-pak-tool/blob/main/Src/jni/Unpacker/Handler.hpp"
click node_compression "https://github.com/learner098/pr-pak-tool/blob/main/Src/jni/Core/Misc/Compression.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_cli,node_pak_handler,node_user toneBlue
class node_manager,node_pak_structs toneAmber
class node_game_offsets,node_creds toneMint
class node_unpacker,node_extract_handler,node_compression toneRose
class node_output toneIndigo
```

## Components

### Command entry

- [Tool entry](https://github.com/learner098/pr-pak-tool/blob/main/Src/jni/EntryPoint/PR_Pak_Tool.cpp): `Src/jni/EntryPoint/PR_Pak_Tool.cpp`
- [Pak handler](https://github.com/learner098/pr-pak-tool/blob/main/Src/jni/EntryPoint/Handler/PakHandler.cpp): `Src/jni/EntryPoint/Handler/PakHandler.cpp`

### Pak loading

- [Pak manager](https://github.com/learner098/pr-pak-tool/blob/main/Src/jni/Core/Pak/PakManager.cpp): `Src/jni/Core/Pak/PakManager.cpp`
- [Pak structures](https://github.com/learner098/pr-pak-tool/blob/main/Src/jni/Core/Pak/Structure.h): `Src/jni/Core/Pak/Structure.h`

### Keys and game data

- [Game offsets](https://github.com/learner098/pr-pak-tool/blob/main/Src/jni/Game/Offsets.cpp): `Src/jni/Game/Offsets.cpp`
- [Credential manager](https://github.com/learner098/pr-pak-tool/blob/main/Src/jni/Core/Cred/CredsManager.cpp): `Src/jni/Core/Cred/CredsManager.cpp`

### Extraction

- [Unpacker](https://github.com/learner098/pr-pak-tool/blob/main/Src/jni/Unpacker/UnPacker.cpp): `Src/jni/Unpacker/UnPacker.cpp`
- [Entry extraction](https://github.com/learner098/pr-pak-tool/blob/main/Src/jni/Unpacker/Handler.hpp): `Src/jni/Unpacker/Handler.hpp`
- [Compression support](https://github.com/learner098/pr-pak-tool/blob/main/Src/jni/Core/Misc/Compression.cpp): `Src/jni/Core/Misc/Compression.cpp`

### Other components

- **CLI user**
- **Extracted files**

## Connections

- CLI user → Tool entry: supplies Pak
- Tool entry → Pak handler: dispatches to (evidence: `Src/jni/EntryPoint/PR_Pak_Tool.cpp`)
- Pak handler → Pak manager: sets up Pak (evidence: `Src/jni/EntryPoint/Handler/PakHandler.cpp`)
- Pak handler → Game offsets: detects and initializes (evidence: `Src/jni/EntryPoint/Handler/PakHandler.cpp`)
- Pak handler → Unpacker: starts unpacking (evidence: `Src/jni/EntryPoint/Handler/PakHandler.cpp`)
- Pak manager → Credential manager: creates and uses (evidence: `Src/jni/Core/Pak/PakManager.cpp`)
- Credential manager → Game offsets: reads key data (evidence: `Src/jni/Core/Cred/CredsManager.cpp`)
- Unpacker → Entry extraction: uses handler (evidence: `Src/jni/Unpacker/UnPacker.cpp`)
- Entry extraction → Pak manager: reads and decrypts entries (evidence: `Src/jni/Unpacker/Handler.hpp`)
- Entry extraction → Extracted files: writes files (evidence: `Src/jni/Unpacker/Handler.hpp`)
- Pak manager → Compression support: uses compression routines
