Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Format:Source 2 compiled resource (_c)

From ReverseEngineering.wiki
Format
Versions header version 12; resource version per type
Magic none; u32 file size then u16 12
Extensions *_c (vmdl_c, vtex_c, vmat_c, vpcf_c, vsnd_c, vmap_c ...)
Endianness little
On this wiki Facts · Code · Notes · Topics

Container of Source 2 compiled assets (Dota 2, CS2, Half-Life: Alyx, Deadlock): a file whose name ends in _c (model.vmdl_c, texture.vtex_c, material.vmat_c...) with a 16-byte header and a table of FourCC blocks such as RERL (external references), REDI (edit info), NTRO (introspection) and DATA (the payload, often binary KV3).

Identification

No magic string. The first u32 is the total file size, followed by u16 HeaderVersion = 12 and u16 resource Version (per resource type). ValveResourceFormat (MIT) Resource.cs rejects other header versions with 'You likely tried to read a file that is not actually a resource (usually ends in _c)'. The same reader refuses a file whose first u32 is the VPK magic 0x55AA1234 (Format:VPK (Valve package)) or the legacy compiled shader magic. Compiled files sit inside VPKs; the extension is the source extension plus _c.

Header and block table

Offset Size Field
0 4 FileSize
4 2 HeaderVersion (12)
6 2 Version (type specific)
8 4 BlockOffset: distance from this field to the block table (8 normally)
12 4 BlockCount

Each block table entry is 12 bytes: Type (u32, four ASCII chars), Offset (u32, relative to the position of this Offset field itself), Size (u32). The reader computes absolute offset = position of the offset field + value.

Block types

From ValveResourceFormat BlockType.cs: RERL resource external reference list, REDI resource edit info (dependencies, compiler identifiers; RED2 is the KV3 version), NTRO introspection manifest (struct and enum definitions of the payload; Valve has deprecated it), DATA main payload, VBIB vertex/index buffers, VXVS voxel visibility, SNAP particle snapshot, CTRL control data (KV3), MDAT mesh data, MRPH morph, MBUF and the newer MVTX/MIDX/MADJ/MSLT mesh buffers, ANIM, ASEQ, AGRP, PHYS physics, INSG input signature, SrMa/LaCo/STAT Panorama source map, layout and statistics, FLCI file/line info for vdata, DSTF distance field, TBUF tools buffer.

DATA block

The reader peeks the first u32 of DATA: if it matches a binary KV3 magic (Format:KeyValues3 binary) or the KV1 binary magic, it is parsed as KV3/KV1; otherwise the layout is type specific (textures, meshes, sounds are handled by dedicated classes) or described by NTRO.

RERL

At the block: offset u32 and count u32 (both relative like above), then per reference a u64 resource ID (hash of the path) and an offset to a NUL-terminated UTF-8 path, 16 bytes per entry. Paths name other compiled resources the file depends on (e.g. a model's materials), which tells which files must be extracted together.

Tools

Code & repositories

  • https://github.com/ValveResourceFormat/ValveResourceFormat @ 16a6e739da35664f974ca74d716480fe4a2fcda9 · license: MIT
    C# library, CLI and viewer for Source 2 resources: block table, KV3 binary, textures, models, maps
    Tested on: source read, not run: source read, not run · checked 2026-10-18; last activity 2026-10-18; Note: the latest release ships binaries; the wiki links only the source, never the binaries

Open questions

  • Texture (VTEX) and mesh (VBIB) payload layouts are not described here yet.