Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: about 15 hours 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 (about 8 years ago)
- Default Branch: master
- Last Pushed: 2024-05-09T11:07:08.000Z (6 months ago)
- Last Synced: 2024-05-10T11:01:16.842Z (6 months ago)
- Topics: csharp, dotnet, source2, steam, valve, vpk
- Language: C#
- Homepage: https://www.nuget.org/packages/ValvePak/
- Size: 225 KB
- Stars: 115
- Watchers: 8
- Forks: 18
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Valve Pak (vpk) for .NET[![Build Status (GitHub)](https://img.shields.io/github/actions/workflow/status/ValveResourceFormat/ValvePak/ci.yml?label=Build&style=flat-square&branch=master)](https://github.com/ValveResourceFormat/ValvePak/actions)
[![NuGet](https://img.shields.io/nuget/v/ValvePak.svg?label=NuGet&style=flat-square)](https://www.nuget.org/packages/ValvePak/)
[![Coverage Status](https://img.shields.io/codecov/c/github/ValveResourceFormat/ValvePak/master?label=Coverage&style=flat-square)](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`.