![]() |
VOOZH | about |
dotnet add package ValveResourceFormat --version 19.2.6339
NuGet\Install-Package ValveResourceFormat -Version 19.2.6339
<PackageReference Include="ValveResourceFormat" Version="19.2.6339" />
<PackageVersion Include="ValveResourceFormat" Version="19.2.6339" />Directory.Packages.props
<PackageReference Include="ValveResourceFormat" />Project file
paket add ValveResourceFormat --version 19.2.6339
#r "nuget: ValveResourceFormat, 19.2.6339"
#:package ValveResourceFormat@19.2.6339
#addin nuget:?package=ValveResourceFormat&version=19.2.6339Install as a Cake Addin
#tool nuget:?package=ValveResourceFormat&version=19.2.6339Install as a Cake Tool
Valve's Source 2 resource file format parser, decompiler, and exporter.
Source 2 files usually files end with _c, for example .vmdl_c.
The primary user of this library is the Source 2 Viewer. As such, updates may contain breaking changes and backwards incompatible API changes, as the viewer does not require backwards compatibility with older library versions. Additionally, Source 2 games themselves may update and change file formats at any time, which may necessitate breaking changes in this library. If you need to support newer file formats, you will need to update the library. That said, we do aim to support older file formats going back to the very first Source 2 project.
var file = "textures/debug.vtex_c";
using var resource = new Resource();
resource.Read(file);
// You can access blocks and data on `resource` object
Extract a texture as png bytes:
using var bitmap = ((Texture)resource.DataBlock).GenerateBitmap();
var bytes = TextureExtract.ToPngImage(bitmap);
Or use file extract helper which works for various resource types:
using var contentFile = FileExtract.Extract(resource, null);
var outFilePath = "dump";
DumpContentFile(outFilePath, contentFile);
void DumpContentFile(string path, ContentFile contentFile)
{
DumpFile(path, contentFile.Data);
foreach (var contentSubFile in contentFile.SubFiles)
{
DumpFile(Path.Combine(Path.GetDirectoryName(path), contentSubFile.FileName), contentSubFile.Extract.Invoke());
}
}
void DumpFile(string path, ReadOnlySpan<byte> data)
{
Directory.CreateDirectory(Path.GetDirectoryName(path));
File.WriteAllBytes(path, data.ToArray());
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 2 NuGet packages that depend on ValveResourceFormat:
| Package | Downloads |
|---|---|
|
ValveResourceFormat.Renderer
OpenGL-based rendering engine for Source 2 game assets. Supports models, maps, materials, particles, and animations with PBR lighting. |
|
|
CS2CalloutExtractor
A library for extracting callouts from Counter-Strike 2 `.vpk` files. |
Showing the top 1 popular GitHub repositories that depend on ValveResourceFormat:
| Repository | Stars |
|---|---|
|
MontagueM/Charm
Destiny 2 reverse engineering tool for extracting cool things from game files.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 19.2.6339 | 493 | 5/29/2026 |
| 19.1.6199 | 1,696 | 4/9/2026 |
| 18.0.5805 | 1,185 | 2/5/2026 |
| 17.0.5499 | 285 | 1/2/2026 |
| 16.0.5103 | 1,777 | 11/20/2025 |
| 15.0.4937 | 383 | 9/26/2025 |
| 14.1.4764 | 496 | 8/1/2025 |
| 14.1.4763 | 159 | 8/1/2025 |
| 14.0.4733 | 608 | 7/24/2025 |
| 13.0.4499 | 1,319 | 6/3/2025 |
| 12.0.4261 | 540 | 4/18/2025 |
| 11.1.4050 | 1,018 | 12/19/2024 |
| 11.0.3961 | 310 | 12/3/2024 |
| 10.2.3850 | 960 | 9/3/2024 |
| 10.1.3729 | 4,410 | 7/13/2024 |
| 10.0.3595 | 280 | 5/27/2024 |
| 9.2.3481 | 273 | 4/26/2024 |
| 9.1.3441 | 268 | 4/16/2024 |
| 9.0.3293 | 324 | 3/14/2024 |
| 8.1.3021 | 304 | 2/6/2024 |
View release notes at https://github.com/ValveResourceFormat/ValveResourceFormat/releases