PAK extractor / repacker and native Lua 5.3 decompiler for Tencent / PUBG Mobile-style archives — written entirely in Rust, shipped as a single yargi.exe.
YARGI ENGINE unpacks, verifies and repacks PAK v11–v14 archives and
decompiles the game's obfuscated Lua 5.3 bytecode in-process — no JVM, no
Java, no Python and no sidecar binaries. The reverse-engineered bytecode restore
runs natively in Rust and feeds a vendored, patched unluac crate.
yargi.exe --version
YARGI ENGINE 1.0.0
- One file, zero setup. Copy
yargi.exe, run it. No Python, pip, Java, JVM, DLLs or VC++ redistributable. - Native decompiler. The PUBG Mobile bytecode transform was reverse-engineered and reimplemented in Rust; decompilation happens inside the process.
- All CPU cores. Extraction and decompilation are parallelised with
rayon. - PAK v11 → v14. Index/footer parsing, extraction, verification, manifest and slot-safe repacking, including unaligned encrypted slots.
- Honest progress. Live bars show done/total, files per second and ETA while the work is running.
- Hardened. Bounds-checked parsing, per-file isolation, 8 MiB worker stacks and post-write verification — a bad file cannot take down the batch.
The previous tool was a Python wrapper around external bytecode/decompiler
scripts plus a Java unluac jar. This is the same feature set, reimplemented in
Rust and shipped as one binary.
| Old Python pipeline | YARGI ENGINE (Rust) | |
|---|---|---|
| Run | python main.py + 4 helper scripts + Java |
yargi.exe — one file |
| Setup | Python, pip packages, Java runtime | none |
| PAK versions | v11 / v12 | v11 – v14 |
| Lua decompile | external Python front-end + unluac.jar (JVM) |
embedded native Rust engine |
| Decompile speed | single core, external process per file | all CPU cores, in-process |
| Error handling | assert / traceback aborts the run |
per-file isolation + report |
| Verification | partial | hash verification after every repack |
| Worker sizing | fixed | automatic: all cores (CPU) / SSD-aware (I/O) |
| Long paths | limited | \\?\ handling |
| Distribution | folder of scripts + jar | single ~23 MB exe |
Reference numbers below were measured on the project's test machine. They are representative, not a guarantee — hardware and antivirus settings change I/O throughput.
| Workload | Result |
|---|---|
| Full corpus decompile (27,562 real Lua chunks) | ~6.8 min on 12 threads — vs ~2 h 20 m for the old Python + Java pipeline (≈20×) |
| Real PAK Lua extraction (24,906 files, 172.5 MiB) | 8.7 s → ~2,710 files/s |
| Small-file write ceiling (system, no exclusions) | ~339 files/s |
| Decompile throughput (6 logical cores, release) | ~32 chunks/s |
| Startup | instant (single native binary) |
Tip — big speed win: Windows Defender real-time scanning is the bottleneck for dumps of many small files. Excluding your output folder (
Add-MpPreference -ExclusionPath "<folder>", administrator PowerShell) measured 3.3× faster raw small-file writes and ~8× faster real extraction. Only exclude folders you trust.
- Download
yargi.exefrom Releases. - Put it in a folder and double-click it (or run it from a terminal).
- Put
.pakfiles into1-PAK_Extractor\PAKS\, or drag & drop a.pakfile ontoyargi.exe.
Interactive menu:
1. Unpack PAK
2. Repack with manifest
3. Selective extraction (pattern)
4. View manifest
5. Lua decompile
6. PAK info + verify
7. Help
8. Exit
Folder layout (created automatically):
YARGI\
├── yargi.exe
├── 1-PAK_Extractor\
│ ├── PAKS\ <- .pak archives go here
│ ├── unpacked\<pak>\ <- extracted files + manifest.json + edited\
│ ├── repacked_obb\ <- repacked .pak
│ └── extracted\ <- selective extraction output
└── 3-Decompiled_Lua_Files\ <- decompiled Lua source
# Info / listing / verification
yargi.exe info PAKS\game.pak
yargi.exe info PAKS\game.pak --json
yargi.exe list PAKS\game.pak --pattern "*Lua*" --long
yargi.exe verify PAKS\game.pak
# Extraction
yargi.exe unpack --all
yargi.exe unpack PAKS\game.pak --pattern "*.lua"
yargi.exe unpack --all --block-split
yargi.exe unpack --all --out D:\dump --jobs 16
# Repacking (patch modified files back into the original slots)
yargi.exe repack 1-PAK_Extractor\unpacked\game --dry-run
yargi.exe repack 1-PAK_Extractor\unpacked\game
# Lua decompilation (embedded engine)
yargi.exe decompile --jobs 0
yargi.exe decompile --input unpacked --output 3-Decompiled_Lua_Files
yargi.exe decompile --fix-failed
# Interactive menu
yargi.exeExit codes: 0 success, 1 hard error, 2 finished with some failures.
| Option | Meaning |
|---|---|
--jobs N |
Worker threads (0 = automatic: all cores / SSD-aware) |
--pattern GLOB |
Only extract PAK paths matching the glob (repeatable) |
--block-split |
Extract compressed files as 64 KiB _block_N parts |
--dry-run |
Show the repack plan, write nothing |
--fast / --no-reuse |
Faster compression / force recompression |
--no-verify |
Skip post-write verification |
--strict |
Treat integrity warnings as errors |
--allow-unknown-version |
Try PAK versions newer than supported |
game .lua chunk
│ restore: XOR strings, opcode permutation, Lua 5.4-style debug lines
▼
restored Lua 5.3 chunk
│ vendored unluac-rs (patched for SETLIST, loop labels, negative lines)
▼
Lua source (strict pass)
└─ recovery ladder: ignore debug info → permissive diagnostic pseudocode
- Empty stub modules (a bare
RETURN) are emitted as a faithful-- empty module+returnbody instead of an empty file. - Already-restored / plain Lua 5.3 chunks are detected and parsed directly.
- The reverse-engineered format is documented in rust/docs/lua-bytecode-restore.md and the local patches in rust/vendor/unluac/PATCHES.md.
Requirements: Windows 10/11 x64 and a Rust toolchain (1.94+; the vendored
unluac crate uses edition 2024). A C toolchain (MSVC build tools or MinGW-w64)
is needed only for the bundled zstd C library.
.\build-release.cmd # builds and copies yargi.exe to the project rootor directly:
cd rust
cargo build --release -p yargi-cli
# -> rust\target\release\yargi.exeTest and lint:
cd rust
cargo test --workspace # 135 tests
cargo clippy --workspace --all-targets
cargo fmt --all --check├── build-release.cmd / .ps1 # reproducible release build
├── CHANGELOG.md
├── rust/
│ ├── crates/yargi-core # PAK container + bytecode restore
│ ├── crates/yargi-lua # Lua 5.3 parser + native decompiler
│ ├── crates/yargi-decompile # batch orchestration
│ ├── crates/yargi-cli # yargi.exe (clap + interactive menu)
│ ├── vendor/unluac # patched unluac-rs (MIT)
│ └── docs/ # format / porting notes
├── LICENSE # Apache-2.0
└── NOTICE # third-party notices (unluac-rs, MIT)
Local-only folders are ignored by git: game PAK files (1-PAK_Extractor/), build
output (rust/target/), scratch data (.tmp/) and the compiled yargi.exe.
Licensed under the Apache License, Version 2.0 — see LICENSE.
Third-party notices (notably the MIT-licensed unluac-rs) are in NOTICE.
This project is not affiliated with Tencent, PUBG Mobile, or any game publisher. Only process files you own or are otherwise authorised to modify. No game assets, PAK archives or license keys are included in this repository.