# 0xciel/unitedgooninglib architecture

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

- Interactive diagram: https://gitdiagram.com/0xciel/unitedgooninglib
- Repository: https://github.com/0xciel/unitedgooninglib

## Overview

UGlib is a small C++ runtime library that simplifies IL2CPP game-memory access. The main workflow is: a caller initializes against a game module, uses offsets to create callable addresses or field handles, then invokes methods or reads and writes instance fields. Pointer-chain dereferencing and runtime-offset conversion support related memory tasks. The README also documents hook usage and includes MinHook and Detours examples. The map reflects the sampled header and implementation; example integrations are shown as optional usage, not built-in hook engines.

Main entry points: [`include/UGlib.cpp`](https://github.com/0xciel/unitedgooninglib/blob/main/include/UGlib.cpp) (Module Initialization), [`include/UGlib.h`](https://github.com/0xciel/unitedgooninglib/blob/main/include/UGlib.h) (Method Addresses), [`examples/minhook_example.cpp`](https://github.com/0xciel/unitedgooninglib/blob/main/examples/minhook_example.cpp) (MinHook Example), [`examples/detours_example.cpp`](https://github.com/0xciel/unitedgooninglib/blob/main/examples/detours_example.cpp) (Detours Example)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Initialization"]
  node_init["Module Initialization<br/>[UGlib.cpp]"]
  node_state["Base and Status<br/>[UGlib.h]"]
end

subgraph group_memory["Memory Access"]
  node_addresses["Method Addresses<br/>[UGlib.h]"]
  node_fields["Instance Fields<br/>[UGlib.h]"]
  node_bound["Bound Objects<br/>[UGlib.h]"]
  node_deref["Pointer Chains<br/>[UGlib.h]"]
  node_offset["Offset Conversion<br/>[UGlib.h]"]
end

subgraph group_examples["Hook Examples"]
  node_minhook["MinHook Example"]
  node_detours["Detours Example"]
end

node_caller(("Library User"))
node_game["Game Module"]

node_caller -->|"initializes"| node_init
node_init -->|"resolves module"| node_game
node_init -->|"sets base and status"| node_state
node_caller -->|"defines and calls"| node_addresses
node_addresses -->|"uses module base"| node_state
node_caller -->|"reads and writes"| node_fields
node_caller -->|"binds instance"| node_bound
node_caller -->|"dereferences chain"| node_deref
node_caller -->|"converts offset"| node_offset
node_caller -.->|"uses example"| node_minhook
node_caller -.->|"uses example"| node_detours

click node_init "https://github.com/0xciel/unitedgooninglib/blob/main/include/UGlib.cpp"
click node_state "https://github.com/0xciel/unitedgooninglib/blob/main/include/UGlib.h"
click node_addresses "https://github.com/0xciel/unitedgooninglib/blob/main/include/UGlib.h"
click node_fields "https://github.com/0xciel/unitedgooninglib/blob/main/include/UGlib.h"
click node_bound "https://github.com/0xciel/unitedgooninglib/blob/main/include/UGlib.h"
click node_deref "https://github.com/0xciel/unitedgooninglib/blob/main/include/UGlib.h"
click node_offset "https://github.com/0xciel/unitedgooninglib/blob/main/include/UGlib.h"
click node_minhook "https://github.com/0xciel/unitedgooninglib/blob/main/examples/minhook_example.cpp"
click node_detours "https://github.com/0xciel/unitedgooninglib/blob/main/examples/detours_example.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_init,node_state,node_caller toneBlue
class node_addresses,node_fields,node_bound,node_deref,node_offset toneAmber
class node_minhook,node_detours toneMint
class node_game toneIndigo
```

## Components

### Initialization

- [Module Initialization](https://github.com/0xciel/unitedgooninglib/blob/main/include/UGlib.cpp): `include/UGlib.cpp`
- [Base and Status](https://github.com/0xciel/unitedgooninglib/blob/main/include/UGlib.h): `include/UGlib.h`

### Memory Access

- [Method Addresses](https://github.com/0xciel/unitedgooninglib/blob/main/include/UGlib.h): `include/UGlib.h`
- [Instance Fields](https://github.com/0xciel/unitedgooninglib/blob/main/include/UGlib.h): `include/UGlib.h`
- [Bound Objects](https://github.com/0xciel/unitedgooninglib/blob/main/include/UGlib.h): `include/UGlib.h`
- [Pointer Chains](https://github.com/0xciel/unitedgooninglib/blob/main/include/UGlib.h): `include/UGlib.h`
- [Offset Conversion](https://github.com/0xciel/unitedgooninglib/blob/main/include/UGlib.h): `include/UGlib.h`

### Hook Examples

- [MinHook Example](https://github.com/0xciel/unitedgooninglib/blob/main/examples/minhook_example.cpp): `examples/minhook_example.cpp`
- [Detours Example](https://github.com/0xciel/unitedgooninglib/blob/main/examples/detours_example.cpp): `examples/detours_example.cpp`

### Other components

- **Library User**
- **Game Module**

## Connections

- Library User → Module Initialization: initializes (evidence: `README.md`)
- Module Initialization → Game Module: resolves module (evidence: `include/UGlib.cpp`)
- Module Initialization → Base and Status: sets base and status (evidence: `include/UGlib.cpp`)
- Library User → Method Addresses: defines and calls (evidence: `README.md`)
- Method Addresses → Base and Status: uses module base (evidence: `include/UGlib.h`)
- Library User → Instance Fields: reads and writes (evidence: `README.md`)
- Library User → Bound Objects: binds instance (evidence: `include/UGlib.h`)
- Library User → Pointer Chains: dereferences chain (evidence: `README.md`)
- Library User → Offset Conversion: converts offset (evidence: `README.md`)
- Library User → MinHook Example: uses example (evidence: `README.md`)
- Library User → Detours Example: uses example (evidence: `README.md`)
