ValveResourceFormat / ValvePak

📦 Fully fledged library to work with Valve's Pak archives in .NET

Home Page:https://www.nuget.org/packages/ValvePak/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Valve Pak (vpk) for .NET

Build Status (GitHub) NuGet Coverage Status

VPK (Valve Pak) files are uncompressed archives used to package game content. This library allows you to read and extract files out of these paks.

Usage:

using var package = new Package();

// Open a vpk file
package.Read("pak01_dir.vpk");

// Can also pass in a stream
package.Read(File.OpenRead("pak01_dir.vpk"));

// Optionally verify hashes and signatures of the file if there are any
package.VerifyHashes();

// Find a file, this returns a PackageEntry
var file = package.FindEntry("path/to/file.txt");

if (file != null) {
	// Read a file to a byte array
	package.ReadEntry(file, out byte[] fileContents);
}

Do note that files such as pak01_001.vpk are just data files, you have to open pak01_dir.vpk.

About

📦 Fully fledged library to work with Valve's Pak archives in .NET

https://www.nuget.org/packages/ValvePak/

License:MIT License


Languages

Language:C# 100.0%