Deadlock Research
verifiednote 0003build 66792026-08-15toolingvrfdecompile

Decompilation toolchain

Question

What tool turns Source 2 compiled resources (*_c) into readable data, and what is the exact invocation for the files we care about?

Summary

Findings

Obtaining the CLI

Release assets at https://github.com/ValveResourceFormat/ValveResourceFormat/releases/latest:

assetsize
cli-windows-x64.zip48.5 MB
cli-linux-x64.zip48.9 MB
cli-macos-arm64.zip49.7 MB
Source2Viewer.exe (GUI)94.1 MB
ValveResourceFormat.nupkg (library)0.8 MB

Unzipping cli-windows-x64.zip gives Source2Viewer-CLI.exe plus four native dependencies (libSkiaSharp.dll, spirv-cross.dll, TinyEXRNative.dll, blake3_dotnet.dll). Keep them together.

The .nupkg is the library — relevant if we ever want to call VRF in-process from C# instead of shelling out.

Flags that matter

flagpurpose
-iinput file, folder, or VPK
-ooutput folder
-d / --decompiledecompile rather than dump raw
-f / --vpk_filepathpath filter, e.g. scripts/
-e / --vpk_extensionsextension filter, e.g. vdata_c
-l / --vpk_listlist matching resources
--vpk_dirprint the VPK file table
--threadsparallelism
--vpk_cacheonly write files changed since last run — useful across patches
-b DATAprint one resource block instead of writing files

Verified invocation

Source2Viewer-CLI.exe \
  -i "<game>/citadel/pak01_dir.vpk" \
  -o out \
  -f "scripts/" -e "vdata_c" -d --threads 4

Produces out/scripts/*.vdata as KV3 text. Sizes at build 6679:

filedecompiled
abilities.vdata7.0 MB
heroes.vdata2.1 MB
npc_units.vdata179.5 KB
misc.vdata122.4 KB

Output begins with a KV3 header line naming the encoding and format GUIDs:

<!-- kv3 encoding:text:version{e21c7f3c-8a33-41c5-9977-a76d3a32aa0d} format:generic:version{7412167c-06e9-4698-aff2-e63eb59037e7} -->

Reproduce

# 1. Fetch the CLI into the gitignored vendor dir (adjust asset for your OS)
mkdir -p tools/vendor
curl -L -o tools/vendor/cli.zip \
  https://github.com/ValveResourceFormat/ValveResourceFormat/releases/download/19.2/cli-windows-x64.zip
unzip -o tools/vendor/cli.zip -d tools/vendor/vrf

# 2. Confirm the install and build stamp
python tools/find_game.py

# 3. Extract + decompile gameplay data
tools/vendor/vrf/Source2Viewer-CLI.exe \
  -i "$(python tools/find_game.py --json | python -c 'import json,sys;print(json.load(sys.stdin)["game_dir"])')/citadel/pak01_dir.vpk" \
  -o out -f "scripts/" -e "vdata_c" -d --threads 4

# 4. Sanity check
ls -la out/scripts/heroes.vdata out/scripts/abilities.vdata
head -3 out/scripts/heroes.vdata

On Windows PowerShell, invoke the exe with & and quote the path.

Gotchas

Open questions

Sources