# pangbox/rebang architecture

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

- Interactive diagram: https://gitdiagram.com/pangbox/rebang
- Repository: https://github.com/pangbox/rebang

## Overview

Rebang is an educational matching-decompilation project for an early-2000s Windows game client. Its repository contains reconstructed client code alongside analysis utilities; the README describes delinked objects as aids to rebuilding the original executable, not as a general-purpose relocatable toolchain. The client’s user-facing flow and many gameplay subsystems are apparent from the tree, but most implementation excerpts were not supplied, so those connections are left unverified. Solid edges are limited to relationships visible in the provided excerpts or SOURCE INDEX.

Main entry points: [`source/client/ProjectG`](https://github.com/pangbox/rebang/tree/master/source/client/ProjectG) (ProjectG client), [`source/client/Fresh/source/frwndmanager.cpp`](https://github.com/pangbox/rebang/blob/master/source/client/Fresh/source/frwndmanager.cpp) (Window manager), [`source/client/ProjectG/lobbymain.cpp`](https://github.com/pangbox/rebang/blob/master/source/client/ProjectG/lobbymain.cpp) (Lobby and social), [`source/rebang/rebang.h`](https://github.com/pangbox/rebang/blob/master/source/rebang/rebang.h) (Delinked objects)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["UI and rendering"]
  node_elementdoc["UI element document<br/>[frelement.h]"]
  node_wndmanager["Window manager<br/>[frwndmanager.cpp]"]
  node_desktop["UI desktop<br/>[frdesktop.cpp]"]
  node_graphic["UI graphics"]
  node_texturecache[("Texture cache<br/>[tcachemanager.cpp]")]
end

subgraph group_game["Game client"]
  node_client["ProjectG client"]
  node_input["Input handling<br/>[inputmanager.cpp]"]
  node_network["Networking<br/>[networksystem.cpp]"]
  node_golf["Golf gameplay<br/>[golfrulebase.cpp]"]
  node_lobby["Lobby and social<br/>[lobbymain.cpp]"]
  node_friends["Friend management<br/>[buddymanager.cpp]"]
end

subgraph group_shared["Shared services"]
  node_catalog[("Item catalog<br/>[itemmanager.cpp]")]
  node_scripts["Lua scripting"]
  node_audio["Sound playback<br/>[soundmanager.cpp]"]
end

subgraph group_analysis["Decompilation aids"]
  node_delink["Delinked objects<br/>[rebang.h]"]
  node_pdbinfo["PDB inspection<br/>[pdbinfo.py]"]
  node_coffsym["COFF symbols<br/>[coffsym.py]"]
end

node_player(("Player"))
node_resourcefiles["Game resources"]
node_server(("Game servers"))

node_player -.->|"uses"| node_client
node_client -.->|"handles input"| node_input
node_client -.->|"enters lobby"| node_lobby
node_lobby -.->|"starts gameplay"| node_golf
node_client -.->|"communicates"| node_network
node_network -.->|"exchanges data"| node_server
node_lobby -.->|"offers social features"| node_friends
node_client -.->|"uses item data"| node_catalog
node_client -.->|"runs scripts"| node_scripts
node_client -.->|"plays sound"| node_audio
node_client -.->|"uses UI"| node_wndmanager
node_wndmanager -->|"creates"| node_desktop
node_wndmanager -->|"creates"| node_graphic
node_wndmanager -.->|"loads layouts"| node_elementdoc
node_wndmanager -.->|"loads resources"| node_resourcefiles
node_client -.->|"caches textures"| node_texturecache
node_scripts -->|"loads root.lua"| node_resourcefiles
node_delink -.->|"supports analysis"| node_pdbinfo
node_delink -.->|"uses symbols"| node_coffsym

click node_client "https://github.com/pangbox/rebang/tree/master/source/client/ProjectG"
click node_input "https://github.com/pangbox/rebang/blob/master/source/client/ProjectG/inputmanager.cpp"
click node_network "https://github.com/pangbox/rebang/blob/master/source/client/ProjectG/networksystem.cpp"
click node_golf "https://github.com/pangbox/rebang/blob/master/source/client/ProjectG/golfrulebase.cpp"
click node_lobby "https://github.com/pangbox/rebang/blob/master/source/client/ProjectG/lobbymain.cpp"
click node_friends "https://github.com/pangbox/rebang/blob/master/source/client/ProjectG/buddymanager.cpp"
click node_catalog "https://github.com/pangbox/rebang/blob/master/source/shared/itemmanager.cpp"
click node_scripts "https://github.com/pangbox/rebang/blob/master/source/shared/LuaSystem/luascriptmanager.cpp"
click node_audio "https://github.com/pangbox/rebang/blob/master/source/client/ProjectG/soundmanager.cpp"
click node_elementdoc "https://github.com/pangbox/rebang/blob/master/source/client/Fresh/include/frelement.h"
click node_wndmanager "https://github.com/pangbox/rebang/blob/master/source/client/Fresh/source/frwndmanager.cpp"
click node_desktop "https://github.com/pangbox/rebang/blob/master/source/client/Fresh/source/frdesktop.cpp"
click node_graphic "https://github.com/pangbox/rebang/blob/master/source/client/Fresh/source/frgraphicinterface.cpp"
click node_texturecache "https://github.com/pangbox/rebang/blob/master/source/client/Fresh/texturecache/tcachemanager.cpp"
click node_delink "https://github.com/pangbox/rebang/blob/master/source/rebang/rebang.h"
click node_pdbinfo "https://github.com/pangbox/rebang/blob/master/tools/pdbinfo.py"
click node_coffsym "https://github.com/pangbox/rebang/blob/master/tools/coffsym.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_elementdoc,node_wndmanager,node_desktop,node_graphic,node_texturecache toneBlue
class node_client,node_input,node_network,node_golf,node_lobby,node_friends toneAmber
class node_catalog,node_scripts,node_audio,node_server toneMint
class node_delink,node_pdbinfo,node_coffsym toneRose
class node_player,node_resourcefiles toneIndigo
```

## Components

### UI and rendering

- [UI element document](https://github.com/pangbox/rebang/blob/master/source/client/Fresh/include/frelement.h): `source/client/Fresh/include/frelement.h`
- [Window manager](https://github.com/pangbox/rebang/blob/master/source/client/Fresh/source/frwndmanager.cpp): `source/client/Fresh/source/frwndmanager.cpp`
- [UI desktop](https://github.com/pangbox/rebang/blob/master/source/client/Fresh/source/frdesktop.cpp): `source/client/Fresh/source/frdesktop.cpp`
- [UI graphics](https://github.com/pangbox/rebang/blob/master/source/client/Fresh/source/frgraphicinterface.cpp): `source/client/Fresh/source/frgraphicinterface.cpp`
- [Texture cache](https://github.com/pangbox/rebang/blob/master/source/client/Fresh/texturecache/tcachemanager.cpp): `source/client/Fresh/texturecache/tcachemanager.cpp`

### Game client

- [ProjectG client](https://github.com/pangbox/rebang/tree/master/source/client/ProjectG): `source/client/ProjectG`
- [Input handling](https://github.com/pangbox/rebang/blob/master/source/client/ProjectG/inputmanager.cpp): `source/client/ProjectG/inputmanager.cpp`
- [Networking](https://github.com/pangbox/rebang/blob/master/source/client/ProjectG/networksystem.cpp): `source/client/ProjectG/networksystem.cpp`
- [Golf gameplay](https://github.com/pangbox/rebang/blob/master/source/client/ProjectG/golfrulebase.cpp): `source/client/ProjectG/golfrulebase.cpp`
- [Lobby and social](https://github.com/pangbox/rebang/blob/master/source/client/ProjectG/lobbymain.cpp): `source/client/ProjectG/lobbymain.cpp`
- [Friend management](https://github.com/pangbox/rebang/blob/master/source/client/ProjectG/buddymanager.cpp): `source/client/ProjectG/buddymanager.cpp`

### Shared services

- [Item catalog](https://github.com/pangbox/rebang/blob/master/source/shared/itemmanager.cpp): `source/shared/itemmanager.cpp`
- [Lua scripting](https://github.com/pangbox/rebang/blob/master/source/shared/LuaSystem/luascriptmanager.cpp): `source/shared/LuaSystem/luascriptmanager.cpp`
- [Sound playback](https://github.com/pangbox/rebang/blob/master/source/client/ProjectG/soundmanager.cpp): `source/client/ProjectG/soundmanager.cpp`

### Decompilation aids

- [Delinked objects](https://github.com/pangbox/rebang/blob/master/source/rebang/rebang.h): `source/rebang/rebang.h`
- [PDB inspection](https://github.com/pangbox/rebang/blob/master/tools/pdbinfo.py): `tools/pdbinfo.py`
- [COFF symbols](https://github.com/pangbox/rebang/blob/master/tools/coffsym.py): `tools/coffsym.py`

### Other components

- **Player**
- **Game resources**
- **Game servers**

## Connections

- Player → ProjectG client: uses
- ProjectG client → Input handling: handles input (evidence: `source/client/ProjectG/inputmanager.cpp`)
- ProjectG client → Lobby and social: enters lobby
- Lobby and social → Golf gameplay: starts gameplay
- ProjectG client → Networking: communicates
- Networking → Game servers: exchanges data
- Lobby and social → Friend management: offers social features
- ProjectG client → Item catalog: uses item data (evidence: `source/shared/itemmanager.cpp`)
- ProjectG client → Lua scripting: runs scripts (evidence: `source/shared/LuaSystem/luascriptmanager.cpp`)
- ProjectG client → Sound playback: plays sound (evidence: `source/client/ProjectG/soundmanager.cpp`)
- ProjectG client → Window manager: uses UI (evidence: `source/client/Fresh/source/frwndmanager.cpp`)
- Window manager → UI desktop: creates (evidence: `source/client/Fresh/source/frwndmanager.cpp`)
- Window manager → UI graphics: creates (evidence: `source/client/Fresh/source/frwndmanager.cpp`)
- Window manager → UI element document: loads layouts
- Window manager → Game resources: loads resources
- ProjectG client → Texture cache: caches textures
- Lua scripting → Game resources: loads root.lua (evidence: `source/shared/LuaSystem/luascriptmanager.cpp`)
- Delinked objects → PDB inspection: supports analysis
- Delinked objects → COFF symbols: uses symbols
