https://github.com/valveresourceformat/valvepak
📦 Fully fledged library to work with Valve's Pak archives in .NET
https://github.com/valveresourceformat/valvepak
csharp dotnet source2 steam valve vpk
Last synced: 27 days ago
JSON representation
📦 Fully fledged library to work with Valve's Pak archives in .NET
- Host: GitHub
- URL: https://github.com/valveresourceformat/valvepak
- Owner: ValveResourceFormat
- License: mit
- Created: 2016-09-18T06:30:55.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-11-18T12:49:13.000Z (5 months ago)
- Last Synced: 2025-03-29T07:09:24.138Z (about 1 month ago)
- Topics: csharp, dotnet, source2, steam, valve, vpk
- Language: C#
- Homepage: https://www.nuget.org/packages/ValvePak/
- Size: 228 KB
- Stars: 126
- Watchers: 7
- Forks: 19
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Valve Pak (vpk) for .NET
[](https://github.com/ValveResourceFormat/ValvePak/actions)
[](https://www.nuget.org/packages/ValvePak/)
[](https://app.codecov.io/gh/ValveResourceFormat/ValvePak)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:
```csharp
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`.