* The library component of Source 2 Viewer is called ValveResourceFormat (VRF).
Valve's Source 2 resource file format parser, decompiler, and exporter.
Source 2 files usually end with _c, for example .vmdl_c.
This repository is split into three components:
- CLI Decompiler - File data viewer, decompiler and a playground for testing new formats and features.
- GUI Viewer - A vpk archive viewer and extractor. Also supports viewing resources such as sounds, textures, models, maps, and much more.
- Library - Provides public API to parse resource files and some helpers.
â View the official website for downloads. âšī¸ View the library documentation here.
Join our Discord
Eye catchy screenshots
What's supported?
- VPK viewer which supports opening and exporting files
- Creating new vpk archives
- Model viewer and decompiler to glTF and modeldoc
- Map viewer and decompiler to glTF and vmap
- Material decompiler to vmat
- Sound player
- Binary KeyValues3 parser
- NTRO support
Limitations
This tool is based entirely on a reverse engineered effort because Valve does not provide any documentation or Source 2 code (SDK or engine code), while the Source 1 SDK and leaked engine code are helpful, a lot of systems and formats have changed.
The code contained in this repository is based on countless hours of reverse engineering Source 2 games and not all intricate details have been figured out.
If you are interested in helping, take a look at the open issues and join our Discord.
Not all formats are 100% supported, some parameters are still unknown and not fully understood.
Supported resource types
| Ext | Name | Support |
|---|---|---|
| vagrp | Animation Group | đ |
| vanim | Animation | đ |
| vanmgrph | Animation Graph | đ |
| vcd | Choreo | đ |
| vcdlist | Choreo Scene File Data | đ |
| vcompmat | Composite Material | đ |
| vcss | Panorama Style | đ |
| vdata | Data | đ |
| vents | EntityLump | đ |
| vjs | Panorama Script | đ |
| vmap | Map | đ |
| vmat | Material | đ |
| vmdl | Model | đ |
| vmesh | Mesh | đ |
| vmix | VMix | đ |
| vmorf | MorphSet | đ |
| vnmclip | NmClip | đ |
| vnmgrph | NmGraph | đ |
| vnmskel | NmSkeleton | đ |
| vnmvar | NmGraph Variation | đ |
| vpcf | Particle System | đ |
| vpdi | Panorama Dynamic Images | No |
| vphys | Physics Collision Mesh | đ |
| vpost | Postprocessing Settings | đ |
| vpram | Processing Graph Instance | đ |
| vpsf | Particle Snapshot | đ |
| vpulse | Pulse Graph Definition | đ |
| vrman | ResourceManifest | đ |
| vrmap | Resource Remap Table | No |
| vrr | Response Rules | đ |
| vseq | Sequence Group | No |
| vsmart | Smart Prop | Partially |
| vsnap | Particle Snapshot | đ |
| vsnd | Sound | đ |
| vsndevts | Sound Event Script | đ |
| vsndstck | Sound Stack Script | đ |
| vsurf | Surface Properties | No |
| vsvg | Panorama Vector Graphic | đ |
| vtex | Compiled Texture | đ |
| vts | Panorama TypeScript | đ |
| vvis | World Visibility | No |
| vwnod | World Node | đ |
| vwrld | World | đ |
| vxml | Panorama Layout | đ |
| csgoitem | CSGO Item | đ |
| econitem | CSGO Economy Item | đ |
| herolist | Dota Hero List | đ |
| item | Artifact Item | đ |
| vdpn | Dota Patch Notes | đ |
| vdvn | Dota Visual Novels | đ |
| bin | Tools Asset Info | đ Handled by ToolsAssetInfo |
| dat | Closed Captions | đ Handled by ClosedCaptions |
| vcs | Compiled Shader | đ Handled by CompiledShader |
| vdacdefs | DAC Game Defs Data | No |
| vfe | Flex Scene File | đ Handled by FlexSceneFile |
| vfont | Bitmap Font | đ Decrypts VFONT1, supported in Source 1 and Source 2. |
| vpk | Pak (package) | đ Handled by ValvePak |
List of supported magics
| Magic | Description |
|---|---|
0x03564B56 |
VKV\x03 - First binary keyvalues 3 encoding with custom block compression |
0x4B563301 |
KV3\x01 - Binary keyvalues 3 (version 1) |
0x4B563302 |
KV3\x02 - Binary keyvalues 3 (version 2) |
0x4B563303 |
KV3\x03 - Binary keyvalues 3 (version 3) |
0x4B563304 |
KV3\x04 - Binary keyvalues 3 (version 4) |
0x4B563305 |
KV3\x05 - Binary keyvalues 3 (version 5) |
0x564B4256 |
VBKV - binary keyvalues 1 (handled by ValveKeyvalue) |
0x55AA1234 |
VPK - valve package (handled by ValvePak) |
0x44434356 |
VCCD - closed captions |
0xC4CCACE8 |
tools asset info |
0xC4CCACE9 |
tools asset info (newer version) |
0x32736376 |
vcs2 - compiled shader |
0x31415926 |
murmurhash2 seed used by StringToken |
0xEDABCDEF |
murmurhash64 seed used to encode resource IDs |
VFONT1 |
"encrypted" font file |
0x00564645 |
VFE - flex scene file |
CLI
Command-line options
| Option | Description |
|---|---|
| Input | |
--input (or -i) |
Input file to be processed. With no additional arguments, a summary of the input(s) will be displayed. |
--recursive |
If specified and given input is a folder, all sub directories will be scanned too. |
--recursive_vpk |
If specified along with --recursive, will also recurse into VPK archives. |
--vpk_extensions (or -e) |
File extension(s) filter, example: "vcss_c,vjs_c,vxml_c". |
--vpk_filepath (or -f) |
File path filter, example: "panorama\" or "scripts/items/items_game.txt". |
--vpk_cache |
Use cached VPK manifest to keep track of updates. Only changed files will be written to disk. |
--vpk_verify |
Verify checksums and signatures. |
| Output | |
--output (or -o) |
Output path to write to. If input is a folder (or a VPK), this should be a folder. |
--all (or -a) |
Print the content of each resource block in the file. |
--block (or -b) |
Print the content of a specific block, example: DATA, RERL, REDI, NTRO. |
--vpk_decompile (or -d) |
Decompile supported resource files. |
--vpk_list (or -l) |
Lists all resources in given VPK. File extension and path filters apply. |
--vpk_dir |
Print a list of files in given VPK and information about them. |
| Type specific export | |
--gltf_export_format |
Exports meshes/models in given glTF format. Must be either 'gltf' or 'glb'. |
--gltf_export_materials |
Whether to export materials during glTF exports. |
--gltf_export_animations |
Whether to export animations during glTF exports. |
--gltf_textures_adapt |
Whether to perform any glTF spec adaptations on textures (e.g. split metallic map). |
--gltf_export_extras |
Export additional Mesh properties into glTF extras |
--tools_asset_info_short |
Whether to print only file paths for tools_asset_info files. |
| Other | |
--threads |
If higher than 1, files will be processed concurrently. |
--version |
Show version information. |
--help |
Show help information. |
There are also --stats related options, but they are not listed here as they are not relevant to most users.
Examples:
# List all files in the vpk # Use `--vpk_dir` to also print file metadata ./Source2Viewer-CLI.exe -i "core/pak01_dir.vpk" --vpk_list # Export the entire vpk as is ./Source2Viewer-CLI.exe -i "core/pak01_dir.vpk" --output "pak01_exported" # Export only the "panorama/layout" folder ./Source2Viewer-CLI.exe -i "core/pak01_dir.vpk" --output "pak01_exported" --vpk_filepath "panorama/layout" # Decompile and export all Panorama files to a folder named "exported" ./Source2Viewer-CLI.exe -i "core/pak01_dir.vpk" -e "vjs_c,vxml_c,vcss_c" -o "exported" -d # Print resource blocks for a specific file similar to resourceinfo.exe in Source 2 # Use `--block DATA` to only print a specific block ./Source2Viewer-CLI.exe -i "file.vtex_c" --all # Decompile a specific file on disk ./Source2Viewer-CLI.exe -i "file.vtex_c" -o exported.png
GUI
Source 2 Viewer keeps its settings in %LocalAppData%/Source2Viewer/settings.vdf.
GUI Keybinds
General
| Key | Action |
|---|---|
| Ctrl-O | Open a new file |
| Ctrl-F | Open find window (package or text viewer) |
| Ctrl-W | Close current tab |
| Ctrl-Q | Close all tabs |
| Ctrl-E | Close all tabs to the right of the current one |
| Ctrl-R or F5 | Reload current tab |
Map/model viewer
Camera
| Key | Action |
|---|---|
| Hold LMB | Rotate the camera |
| ShiftLeft+LMB | Pan the camera |
| AltLeft+LMB | Move camera forward or backwards |
| WASD | Move the camera |
| Q | Move the camera up |
| Z | Move the camera down |
| Hold Ctrl and LMB | Move the light position (in model viewer) |
Objects
| Key | Action |
|---|---|
| Click LMB | Pick an object |
| Ctrl+LMB | Toggle object selection |
| Double click LMB | Open entity info dialog |
| Double click Ctrl+LMB | Open object in a new tab |
| Delete | Temporarily hide the selected object (toggle world layers to restore) |
Other
| Key | Action |
|---|---|
| F11 | Enter/exit fullscreen |
| Ctrl-C | Copy viewport screenshot to clipboard |
Texture viewer
| Key | Action |
|---|---|
| Hold LMB | Move around the picture |
| Arrow keys | Move around the picture |
| Ctrl-0 | Reset zoom |
| Ctrl and + | Zoom in |
| Ctrl and - | Zoom out |
| Ctrl-C | Copy current texture to clipboard |
| Ctrl-S | Save current texture to disk |
| F11 | Enter/exit fullscreen |
Misc
License
Contents of this repository are available under MIT license, except for Tests/Files folder contains files which have likely come from Valve's games.
Code signing policy
Free code signing provided by SignPath.io, certificate by SignPath Foundation.
