Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/icza/mpq

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/icza/mpq

  • v0.0.0-20230330132843-d3cdc0b651b7
  • Source
  • Go
  • Socket score

Version published
Created
Source

mpq

Build Status Go Reference Go Report Card codecov

Package mpq is a decoder/parser of Blizzard's MPQ archive file format.

This is not a full MPQ implementation. It is primarily intended to parse StarCraft II replay files (*.SC2Replay), but that is fully supported.

Usage

Usage is simple. Opening an MPQ archive file:

m, err := mpq.NewFromFile("myreplay.SC2Replay")
if err != nil {
	// Handle error
	return
}
defer m.Close()

Getting a named file from the archive:

// Access a file inside the MPQ archive.
// Usually there is a file called "(listfile)" containing the list of other files:
if data, err := m.FileByName("(listfile)"); err == nil {
	fmt.Println("Files inside archive:")
	fmt.Println(string(data))
} else {
	// handle error
}

If you already have the MPQ data in memory:

mpqdata := []byte{} // MPQ data in memory
m, err := mpq.New(bytes.NewReader(mpqdata)))

Information sources

Example projects using this

License

Open-sourced under the Apache License 2.0.

FAQs

Package last updated on 30 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc