Skip to content

HeroesToolChest/Heroes.MpqTool

Repository files navigation

Heroes Mpq Tool

Build and Test Release NuGet

Heroes Mpq Tool is a .NET library that is specifically designed for parsing Heroes of the Storm MPQ files.

Usage

To parse an mpq file, such as a .StormReplay or .s2ma file, use MpqHeroesFile.Open(string fileName) by providing the path to the file. It will provide a MpqHeroesArchive object to allow access to the files inside of the archive.

Example:

// parse the mpq file
using MpqHeroesArchive mpqHeroesArchive = MpqHeroesFile.Open("path/to/file");

// get an entry, such as replay.initData for a replay file
if (mpqHeroesArchive.TryGetEntry("replay.initData", out MpqHeroesArchiveEntry? mpqHeroesArchiveEntry))
{
    // decompress the entry and do something with it
    using Stream stream = mpqHeroesArchive.DecompressEntry(mpqHeroesArchiveEntry.Value);
}

Developing

To build and compile the code, it is recommended to use the latest version of Visual Studio 2022 or Visual Studio Code.

Another option is to use the dotnet CLI tools from the .NET 8.0 SDK.

License

MIT license