ValveResourceFormat 7.0.2479

.NET 8.0
dotnet add package ValveResourceFormat --version 7.0.2479
NuGet\Install-Package ValveResourceFormat -Version 7.0.2479
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ValveResourceFormat" Version="7.0.2479" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ValveResourceFormat --version 7.0.2479
#r "nuget: ValveResourceFormat, 7.0.2479"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install ValveResourceFormat as a Cake Addin
#addin nuget:?package=ValveResourceFormat&version=7.0.2479

// Install ValveResourceFormat as a Cake Tool
#tool nuget:?package=ValveResourceFormat&version=7.0.2479

VRF / Valve Resource Format

🔗 View VRF website

Valve's Source 2 resource file format parser, decompiler, and exporter. Source 2 files usually files end with _c, for example .vmdl_c.

Basic usage:

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 Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
7.0.2479 107 11/17/2023
6.0.2421 137 10/12/2023
5.0.2120 191 8/8/2023
0.4.0.1839 314 6/25/2023
0.3.2.1621 212 4/4/2023
0.3.1.1553 189 3/23/2023
0.3.0.1412 269 12/29/2022
0.2.2.1057 415 9/5/2022
0.2.1.963 195 4/7/2022
0.2.0.864 302 12/29/2021
0.1.10.766 416 8/3/2021
0.1.9.731 375 6/28/2021
0.1.6.515 510 9/16/2020
0.1.5.1316 465 8/15/2020
0.1.4.1244 507 7/12/2020
0.1.3.1226 477 6/23/2020
0.1.3.1215 496 5/16/2020
0.1.2.1122 292 3/30/2020
0.1.1.1058 491 3/9/2020
0.1.0.1006 473 3/2/2020
0.0.16.828 565 9/19/2019
0.0.15.777 556 6/22/2019
0.0.13.685 583 5/31/2019
0.0.11.553-AppVeyor 744 1/20/2018
0.0.10.450 1,064 6/11/2017
0.0.9.401 1,255 7/4/2016
0.0.6.317 1,217 4/6/2016
0.0.0.34849 1,223 2/9/2016