Skip to content

About

Vainglory: Community Edition 리플레이(.vgr) 바이너리 포맷을 리버스 엔지니어링해 매치 데이터를 추출하는 툴킷

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

309 Commits

Folders and files

Repository files navigation

VG Reverse Engineering

Offline tools for inspecting, comparing and archiving Vainglory: Community Edition replay families. The default decoder reconstructs recorded player names, heroes, K/D/A, items, gold and scoreboard CS at a common state boundary.

Start here

Use Python 3.12 or newer from the repository root. Python 3.12 is the syntax minimum, not a claim that every 3.12 runtime has been tested. The offline decoder, JSON/CSV exports, SQLite catalog and filesystem archive tools use the standard library. Windows screenshot capture needs Pillow and an interactive Windows desktop; native game probes have separate runtime requirements. See the runtime and verification ledger.

Run the self-contained smoke tests without a private replay, truth file, game client or Pillow:

python -X utf8 -B -m unittest discover -s tests -p "test_product_quickstart.py" -v

The tests generate synthetic framed recordings, execute the documented offline commands and check source hashes. They prove those software paths, not compatibility with every game recording. For a persistent disposable example and the complete command sequence, follow the offline quickstart.

For your own recording, keep its .0.vgr and numbered siblings together and use a separate output directory that already exists:

python -B -m vg.decoder_v2.decode_match "replays/match.0.vgr" -o "reports/match.json"
python -B -m vg.decoder_v2.decode_match "replays/match.0.vgr" --at-game-time 1551 -o "reports/capture.json"

For game 10:00, use --at-game-time 600. Add repeatable --player-id values from players[].native_actor_id to select players at the same inclusive boundary. query_timing reports the applied record time, projected game time and next record; it does not interpolate missing state. See the timed player query guide for CLI/API examples, failure states and a scoped 5v5 check.

Both commands return decoder_v2.player_state.v3. The default scope is recorded_end; a timed query returns capture. Players use recording-scoped 32-bit native actor IDs. gold_balance is spendable gold and net_worth is the native accumulated value. minion_kills is the client's displayed CS counter. items preserves held instances and quantities while native_items also includes HUD-hidden system items; inventory order is not a rendered slot claim. Check support_status and per-field provenance. Missing values remain null and measured zero remains zero. supported means the consumed records matched the validated payload layouts (and, where checked, catalog provenance); it does not identify which client wrote the recording. Recordings carry no client build identifier, so recording_client is always unverified and supported_client_sha256 names the reference build the layouts were derived from (evidence).

Default state, safe JSON and legacy JSON/CSV exports also mark definitive_analysis.eligible=false with explicit exclusion reasons. Batch reports automatically remove these recordings from definitive_analysis.matches; observed results remain available in states/matches and the existing observed statistics. Use the separate definitive subset and, for vg.analysis.batch_report, definitive_analysis.statistics for definitive aggregation. A completed decode or successful playback does not override this gate. Current recordings all remain excluded because no source-bound recording-build or final-result validator exists; manually declaring verified or supplying truth does not authorize inclusion. See the eligibility contract.

The CLI default changed from safe-json to state-json. Consumers of decoder_v2.match.v2 or decoder_v2.capture.v2 must pass --format safe-json. The Python decode_match(...) API retains those older contracts; decode_player_state(...) provides the new state model. Recorded-end state does not assert that gameplay finished, and cached scoreboard gold text can differ from the raw resource value. end_requests lists raw native end-match actions (03f1) inside the query boundary: winning_team_id uses the same team id as players[].team_id and end_reason 2 takes the native surrender path. An empty list means no end was recorded. A request is a client-recorded observation, not a server result (held-out check).

A single input may also be a directory containing exactly one replay family. Multiple families require an explicit .0.vgr selection or a batch command. Missing paths, unreadable sections, ambiguous selection and malformed input receive actionable errors.

State JSON also exposes compact recording_identity diagnostics: raw external-ID candidate summaries and recording-selected actor/team evidence. Full per-record histories are available through the existing native-roster report. Empty snapshots do not erase historical candidates; conflicts and unsupported layouts remain explicit. These fields do not authenticate accounts or uploaders, identify the recording client, or change result/eligibility decisions.

State JSON also exposes display_values (contract). Its raw values retain recording provenance. observed and reconstructed remain null without a compatible supplied runtime receipt. direct_raw_candidate is an estimate of one gold formatter call, not a reconstruction of the UI cache. --playback-speed 5 optionally estimates the playback clock after the last anchor; unknown clock mapping leaves it null. Neither display option changes definitive eligibility.

python -B -m vg.decoder_v2.decode_match "replays/match.0.vgr" --playback-speed 5 -o "reports/estimate.json"
python -B -m vg.decoder_v2.decode_match "replays/match.0.vgr" --display-evidence "receipts/terminal-display.json" -o "reports/observed.json"

Inspect a plaintext outgoing request

The separate offline outgoing request decoder accepts one explicitly untransformed Windows request frame, with exact lengths and typed raw fields for movement, ability and item activation. Use python -B -m vg.core.outgoing_requests --schema to inspect its bounded schema. This does not decode VGR records, decrypt traffic, contact a server or prove request success; existing replay interpretation and eligibility remain unchanged.

Running the regression suite

The complete offline suite requires Python 3.12+ and Node.js 18+ (node on PATH) for the cooldown observer's VM and syntax coverage. No npm packages, Frida, game process, Git executable or historical Git objects are required for those VM tests. Missing Node is a test failure, not skipped or passing coverage.

python -X utf8 -B -m unittest discover -s tests -v
python -X utf8 -B -m unittest discover -s tests -p "test_cooldown_probe.py" -v

The stock probe is checked against a pinned SHA-256 from commit 3361131, so source archives and shallow checkouts retain the same stock-source invariant. Git HEAD/status are optional report metadata (null when unavailable). The Python wrapper removes its default temporary evidence on success or failure. Set COOLDOWN_PROBE_EVIDENCE_DIR to an explicit directory to retain logs and receipts for inspection, including failed runs. These offline mocks do not establish native runtime correctness or decoded cooldown certainty.

Import offline VGNL payloads

Locally saved, complete VGNL binary WebSocket application payloads can be validated and imported with python -B -m vg.core.vgnl_importer. The importer retains exact input bytes and hashes, reports sequence/epoch/section/offset conflicts and gaps, and only reconstructs unambiguous contiguous observed bytes. It does not contact servers or promote account identity, replay completeness or final results. See the offline VGNL importer guide for CLI/API usage, resume/terminal metadata limits and the synthetic-only transport validation scope.

Choose the workflow

Need Entry point What to retain
Inspect one recording vg.decoder_v2.decode_match decoder_v2.player_state.v3, field provenance and replay_scope
Query a recorded moment decode_match --at-game-time SECONDS [--player-id ID] Common record boundary, requested/projected game time and native actor identity
Retain conservative final decisions decode_match --format safe-json Existing v2 decisions and final-index acceptance
Build a dataset vg.decoder_v2.batch_decode, vg.decoder_v2.index_export Every input result, scoped input_id, status/counts and withheld fields; --format state-json [--at-game-time S] runs every input through the single-replay player-state path
Use player/match spreadsheets vg.core.export_matches CSV provenance, blank unknowns, stable ordinals and export receipt
Use legacy metadata/statistics vg.core.vgr_parser, vg.core.unified_decoder, vg.analysis.batch_report Truth source, duration provenance and known/total sample counts
Maintain a SQLite catalog vg.core.vgr_database Catalog identities, nullable match values and catalog-only export coverage
Save and restore replay files vg.core.vgr_watcher, vg.core.vgr_loader Snapshot hashes, explicit target selection and any recovery path
Investigate protocol candidates 40-command v2 capability matrix Consumed truth/replay/OCR/manifest inputs and research-only scope

Product reliability guide covers Python APIs, exit codes, partial batches, transactions, recovery, database behavior and archive limits.

Read the evidence correctly

  • The Korean RE evidence dictionary groups curated findings by feature, exact artifact, address space, proof status and limitations. Its machine-readable catalog supports read-only search with python -B -m vg.research.dictionary search --opcode 0449; run python -B -m vg.research.dictionary validate --check-index to check repository source hashes and index consistency. External references remain explicitly unresolved unless their roots are supplied. Catalog validation does not repeat native experiments or validate a live server.
  • The reviewed research follow-up adds terminal callback, guarded combat-network and cooldown-modifier findings with synthetic models and explicit runtime limits; it does not change decoder inference.
  • The buff/status extension adds reviewed jungle buffs, 타격 강화제 / 수정 강화제, status contributors and action gates, and generic lifecycle findings. Historical extended payload layouts remain unsupported; no production buff/status decoder is enabled.
  • The progression/reward extension separates hero XP/level, skill investment, creature display attribution and individual resource updates from unverified reward credit or shared-reward formulas. Bounded models do not enable a production reducer.
  • The XP baseline/structure extension records reviewed snapshot/layer semantics, same-recording recurrence checks and structure death/cleanup/regeneration boundaries. Structure credit, payouts, rebuild scheduling and crystal-to-match-end causation remain unresolved.
  • The respawn/recall extension distinguishes existing-actor resets, timer display, runtime recall requests and stubbed channel behaviors. Successful recall, timer-triggered revival and control recovery remain unproved.
  • The 2026-10-04 player-state accuracy report documents exact native EOF comparisons for 8 recordings and 37 players across default CLI, Python API and legacy CLI (777/777 field groups), plus the separate 56-recording coverage audit and remaining event unknowns.
  • null means unavailable; measured zero remains zero. CSV uses a blank cell for null. A duration estimate or supplied truth retains its provenance and is not final-index approval.
  • Safe final output currently withholds final K/D/A, minion kills, gold, winner and exact duration. Captured K/D/A can be observed at a supported clock, but accepted_for_index remains false for those captured counters.
  • The C16 final-screen comparison and native integration history are narrowly scoped evidence. A comparison's matched status covers the named K/D/A/CS counters; gold, winner, duration and result labels remain observation-only.
  • Native balance and net-worth reconstruction is available for supported recorded states. End-time interpretation, cached final labels and broad replay compatibility remain separate questions. A complete filesystem snapshot does not prove completed gameplay, and a successful slot replacement does not prove game playback.

Historical research results

The original README advertised 100% for names, teams, modes, hero hashes, entity IDs, frame-count "match length" and weapon items. The underlying denominator and dataset were not recorded here, so those percentages are retained only as historical claims with undocumented scope. Frame coverage is not exact match duration. Its 99% winner claim cited one replay and cannot support a general accuracy rate. Current safe/index acceptance does not use those claims.

The earlier hero mapping listed 57 heroes, with 37 directly confirmed and 20 inferred. That is mapping coverage in the historical research, not a guarantee for all clients or recordings. The dated native capture study compared 294 K/D/A values across ten coherent fixtures; its exclusions and clock limits are preserved in the September integration record.

Current research references: bounded cooldown/charge event fields, event catalog, endgame boundaries, death-action sources, REA item-event timeline, REA item activation, 161-code candidate inventory, and postgame follow-up. They retain unresolved candidates rather than promoting them to accepted final statistics.

Historical binary research notes

The following layouts, ranges and heuristic rates describe the earlier research fixtures. They are not a current compatibility guarantee or authorization to publish final scores. Use the field decisions in current decoder output.

VGR Binary Format

File Structure

Filename: {match_uuid}-{session_uuid}.{frame_number}.vgr
Size per frame: 50-170 KB
Total per match: 5-20 MB (3v3), 10-30 MB (5v5)

The replay system uses input recording: player inputs and game events are recorded per frame, and the game engine reconstructs the full state during playback.

Player Block Structure

Player blocks are identified by marker DA 03 EE (or E0 03 EE). Block size is approximately 0xE2 bytes:

[Marker 3B] [Player Name (ASCII, variable length)] [padding...]
  +0xA5: Entity ID (uint16 LE) - unique per player, used in event stream
  +0xA7: 00 00
  +0xA9: Hero ID (uint16 LE) - maps to BINARY_HERO_ID_MAP
  +0xAB: Hero Hash (4 bytes) - unique per hero, consistent across replays
  +0xAF: Skin/Account Hash (4 bytes) - varies per player, not per hero
  +0xD4: 02
  +0xD5: Team ID (01=left/blue, 02=right/red)

Hero ID Encoding

Hero IDs use a uint16 LE format where the low byte encodes the hero number and the high byte encodes the release era:

Suffix (high byte) Era Examples
0x00 Original (2014) Catherine(0xF200), Ringo(0xF300), Skaarf(0xFF00), Joule(0xFD00)
0x01 Season 1-3 Ardan(0x0101), Baron(0x0501), Lorelai(0x9901), Kinetic(0xA401)
0x03 Season 4+ Caine(0x9303), Leo(0x9103), Ishtar(0x9A03), Karas(0x9D03)

Event Structure

[EntityID 2B LE] [00 00] [ActionCode 1B] [Payload 32B]

Action Codes by Game Phase

Code Phase Frame Range Accuracy Payload Entity Fields
0x42 Early game 3-12 59.0% 10 fields
0x43 Mid game 12-51 96.4% 3 fields
0x44 Late game 51+ 95.7% 12 fields

Special Action Codes

Code Entity Purpose
0xBC 0 (system) Item purchase trigger
0x3E 0 / 128 Skill level-up
0x05 varies Game tick / frame update
0x08 varies Movement related

Entity ID Ranges

Range Classification
0 System (game engine broadcasts)
1-1000 Infrastructure
1000-20000 Turrets / Objectives
20000-50000 Minions / Jungle camps
50000-60000 Players
60000-65535 Special entities

Item Storage

Items are stored with the FF FF FF FF marker pattern:

FF FF FF FF [item_id uint16 LE]

Item IDs range from 101 (Weapon Blade) to 423 (Stormcrown). See vgr_mapping.py for the full mapping.

Research Status

Previously investigated

  • Player identity (name, UUID, team, entity ID, hero)
  • Hero hash fingerprinting (4-byte unique identifier per hero)
  • Game phase detection via action code distribution
  • Item purchase event detection (0xBC)
  • Skill level-up detection (0x3E)
  • Historical winner candidates used turret clustering and crystal patterns; current safe/index output withholds final winner.

In Progress

  • K/D/A: Native snapshots and SET/ADD updates now restore observed counters. Ten coherent capture fixtures matched all 294 compared K/D/A values; this does not establish final-score accuracy for every replay. Mixed or unsupported clock profiles remain withheld. See the native integration evidence above.
  • Inferred hero validation (20 heroes at ~80% confidence via suffix pattern + release chronology)

Disclaimer

This project is for educational and research purposes only. It analyzes locally-stored replay files generated by the game client. No server exploitation, network interception, or game modification is involved.

This project is not affiliated with Super Evil Megacorp (SEMC) or the Vainglory Community Edition team. All game assets and trademarks belong to their respective owners.

License

MIT

About

Vainglory: Community Edition 리플레이(.vgr) 바이너리 포맷을 리버스 엔지니어링해 매치 데이터를 추출하는 툴킷

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages