Nmpq.Standard 1.0.0

dotnet add package Nmpq.Standard --version 1.0.0                
NuGet\Install-Package Nmpq.Standard -Version 1.0.0                
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="Nmpq.Standard" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Nmpq.Standard --version 1.0.0                
#r "nuget: Nmpq.Standard, 1.0.0"                
#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 Nmpq.Standard as a Cake Addin
#addin nuget:?package=Nmpq.Standard&version=1.0.0

// Install Nmpq.Standard as a Cake Tool
#tool nuget:?package=Nmpq.Standard&version=1.0.0                

Nmpq - A Fully-Managed C# MPQ Parser

####Nmpq is available via NuGet ####Standalone binaries can also be found here.

Rationale for a new MPQ parser

  • I was having trouble using MpqLib in its various incarnations because it relies on StormLib.
  • StormLib (and by extension, MpqLib) does not directly support parsing in-memory MPQ archives. You must save archives to a file before parsing them. (I supposed I could have added this features to StormLib, but I really didn't want to work with C that day).
  • StormLib does way more than I need - I do not need to compose MPQ files, only parse them efficiently.
  • I had a bunch of spare time and I was going through a coding dry-spell; I needed an interesting project to chew on.

Useful Information

MPQ File Format

Detailed documentation of the MPQ file format. I have noticed some inconsistencies with my own observations (e.g., regarding version numbers), but for the most part it's dead on.

StormLib

The native MPQ library that everyone uses.

MpqLib

C# bindings to StormLib. If you need to create/modify MPQ archives in a .NET language, you probably want to use this.

License

Nmpq is licensed under the Apache License, Version 2.0.

Features

  • Can directly parse in-memory MPQ archives from either a byte[] or a Stream. (Of course, it also supports parsing archives from disk)
  • Supports MPQ archives version "1" and "3".
  • Utility methods to parse serialized data structures from Starcraft 2 replay files.
  • Full suite of tests.

Limitations

I can't stress enough that Nmpq was originally designed with a specific use-case in mind. I need to parse MPQ archives uploaded as part of an HTTP request without saving them to disk. Specifically, I need to parse Starcraft 2 replay files. Thus, the library has the following limitations:

  • Only supports archives that use Deflate and BZip2 compression.
  • Only supports reading archives; there is no support for creating or modifying archives.

There are probably lots of other specific cases it doesn't support (e.g., older archives may have different hash table and block table formats/layouts that Nmpq wasn't designed to read). Again, this library was originally designed to fit my specific use case, not a general use case.

Contributing

Testing

Honestly, the easiest way to contribute is to send me files that Nmpq can't successfully parse. All of the MPQ files that I regularly work with parse perfectly, but I'm only using a limited subset of the possible MPQ configurations.

Code

If you would like to add a feature or fix a bug, please:

  • Write some code.
  • Write some tests.
  • Send me a pull request with a half-decent description of what your code does and why.

I will then:

  • Review your code.
  • Make sure you have good test coverage and that your tests pass.
  • Reformat your code to be consistent with the rest of the project, if necessary.
  • Merge your contribution into the main branch.
  • Give you kudos.

In general, I would like to make Nmpq more generic such that it supports more MPQ configurations. For the time being, I do not want to add features oriented around creating or modifying MPQ files; I want Nmpq to remain a read-only library for the sake of simplicity. As such, I will probably not accept contributions that add such features to Nmpq, unless they contain some really good rationale. If you think Nmpq would benefit from such features, send me a message and we'll chat.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser 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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
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
1.0.0 0 1/20/2025