• Stars
    star
    124
  • Rank 279,233 (Top 6 %)
  • Language
    C++
  • License
    Other
  • Created almost 13 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A command-line tool to extract files from MPQ archives

MPQExtractor

A command-line tool to extract files from MPQ archives (used by Blizzard games).

Works on MacOS X, Linux and Windows.

Dependencies

The following libraries are necessary to build the extractor:

To download the StormLib submodule, do:

somewhere$ cd <path/to/the/source/of/MPQExtractor>
MPQExtractor$ git submodule init
MPQExtractor$ git submodule update

Compilation

Requires cmake to build:

$ mkdir build
$ cd build
$ cmake <path/to/the/source/of/MPQExtractor>
$ cmake --build .

The executable will be put in build/bin/

Windows: To specify the compiler and build in Release mode:

mkdir build
cd build
cmake <path/to/the/source/of/MPQExtractor> -G "Visual Studio 15 2017 Win64" 
cmake --build . --config Release

Usage

See MPQExtractor --help for more details. All the examples below are shown using the World of Warcraft 4.3 files, as of Jan 2012.

Retrieve the list of files in a MPQ archive:

$ MPQExtractor -l list.txt /path/to/art.MPQ
$ cat list.txt
art-md5.lst
Cameras\Abyssal_Maw_CameraFly_01.M2
Cameras\Abyssal_Maw_CameraFly_0100.skin
Cameras\FlyBy_Maelstrom.M2
...

*Search all the .M2 files in a MPQ archive:

$ MPQExtractor -s *.M2 /path/to/art.MPQ
Opening 'path/to/art.MPQ'...

Searching for '*.M2'...

Found files:
  - PARTICLES\LoginFX.m2
  - Character\Worgen\Male\WorgenMale.M2
  - Character\Worgen\Female\WorgenFemale.M2
  - Character\Goblin\Female\GoblinFemale.M2
....

Extract a specific file from a MPQ archive:

IMPORTANT: Note that the file name is enclosed in "". This is to prevent the shell to try to interpret the backslashes (\) as the start of an escape sequence, which would result in invalid file names.

$ mkdir out
$ MPQExtractor -e "Character\Worgen\Male\WorgenMale.M2" -o out /path/to/art.MPQ
Opening '/path/to/art.MPQ'...

Extracting files...

$ ls out/
WorgenMale.M2

Extract some specific files from a MPQ archive, preserving the path hierarchy found inside the MPQ archive:

$ mkdir out
$ MPQExtractor -e "Character\Worgen\Male\WorgenMale*" -f -o out /path/to/art.MPQ
Opening '/path/to/art.MPQ'...

Searching for 'Character\Worgen\Male\WorgenMale*'...

Found files:
  - Character\Worgen\Male\WorgenMale.M2
  - Character\Worgen\Male\WorgenMaleSkin00_03.blp
  - Character\Worgen\Male\WorgenMaleSkin00_01.blp
  - Character\Worgen\Male\WorgenMaleSkin00_05.blp
  - Character\Worgen\Male\WorgenMaleNakedPelvisSkin00_05.blp
...

Extracting files...

$ ls out/Character/Worgen/Male/
WorgenMale.M2
WorgenMale00.skin
WorgenMale0060-00.anim
WorgenMale0060-01.anim
WorgenMale0061-00.anim
WorgenMale0062-00.anim
WorgenMale0064-00.anim
WorgenMale0065-00.anim
WorgenMale0066-00.anim
WorgenMale0067-00.anim
WorgenMale0068-00.anim
WorgenMale0069-00.anim
WorgenMale0069-01.anim
...

Apply some patches before extracting a specific file from a MPQ archive:

$ mkdir out
$ MPQExtractor -p /patches/wow-update-*.MPQ  \
               /patches/wow-update-base-1*.MPQ  \
               --prefix base
               -e "Character\Worgen\Male\WorgenMale.M2"  \
               -o out /path/to/art.MPQ
Opening '/path/to/art.MPQ'...
Applying patch '/patches/wow-update-13164.MPQ'...
Applying patch '/patches/wow-update-13205.MPQ'...
Applying patch '/patches/wow-update-13287.MPQ'...
Applying patch '/patches/wow-update-13329.MPQ'...
Applying patch '/patches/wow-update-13596.MPQ'...
Applying patch '/patches/wow-update-13623.MPQ'...
Applying patch '/patches/wow-update-base-13914.MPQ'...
Applying patch '/patches/wow-update-base-14007.MPQ'...
Applying patch '/patches/wow-update-base-14333.MPQ'...
Applying patch '/patches/wow-update-base-13914.MPQ'...
Applying patch '/patches/wow-update-base-14007.MPQ'...
Applying patch '/patches/wow-update-base-14333.MPQ'...

Extracting files...

$ ls out/
WorgenMale.M2

Apply patches with different bases, extract files in lowercase:

$ mkdir out
$ MPQExtractor -p /patches/wow-update-13164.MPQ,base  \
                /patches/wow-update-13205.MPQ,base  \
                /patches/wow-update-base-13914.MPQ
                -e "World\Minimaps\*" -f -c -o out  \
                /path/to/art.MPQ
Opening '/path/to/art.MPQ'...
Applying patch '/patches/wow-update-13164.MPQ' (prefix 'base')...
Applying patch '/patches/wow-update-13205.MPQ' (prefix 'base')...
Applying patch '/patches/wow-update-base-13914.MPQ' (no prefix)...

Extracting files...

$ ls out/
world/

License

MPQExtractor is is made available under the MIT License. The text of the license is in the file 'LICENSE'.

Under the MIT License you may use MPQExtractor for any purpose you wish, without warranty, and modify it if you require, subject to one condition:

"The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software."

In practice this means that whenever you distribute your application, whether as binary or as source code, you must include somewhere in your distribution the text in the file 'LICENSE'. This might be in the printed documentation, as a file on delivered media, or even on the credits / acknowledgements of the runtime application itself; any of those would satisfy the requirement.

Even if the license doesn't require it, please consider to contribute your modifications back to the community.

More Repositories

1

BLPConverter

A command-line tool to convert BLP image files to PNG or TGA
C++
79
star
2

FreeImage

A custom distribution of FreeImage, with a CMake-based build system. Used by the Athena Game Framework.
C
53
star
3

CASCExtractor

A command-line tool to extract files from CASC storages
C++
31
star
4

rapidjson

A custom distribution of rapidjson (a fast JSON parser/generator for C++ with both SAX/DOM style API). Used by the Athena Game Framework.
C
16
star
5

piano_fingering

A Python library to automatically determine the fingering of a serie of notes
Python
5
star
6

blender-addons

Custom addons for Blender
Python
4
star
7

Athena-Framework

The Athena Game Framework
C
4
star
8

zziplib

A custom distribution of zziplib, with a CMake-based build system. Used by the Athena Game Framework.
C
3
star
9

Athena-Scripting

The Scripting module of the Athena Game Framework
C++
3
star
10

XMake

XMake-related files
C++
3
star
11

Athena-Inputs

The Inputs module of the Athena Game Framework
C++
3
star
12

musicxml_toolbox

Tools to process a MusicXML file
Python
3
star
13

Athena-Entities

The Entities module of the Athena Game Framework
C++
2
star
14

WoWCharactersViewer

Script that generate a web page containing informations about the World of Warcraft characters you are interested in
Python
2
star
15

webgl-lab

Playground to test WebGL
JavaScript
2
star
16

Athena-Math

The Math module of the Athena Game Framework
JavaScript
2
star
17

sip

A custom distribution of SIP, a tool that makes it very easy to create Python bindings for C and C++ libraries.
C
2
star
18

Athena-Dependencies-Python

A custom distribution of Python. Used by the Athena Game Framework.
Python
1
star
19

Ogre

A custom distribution of OGRE (Object-Oriented Graphics Rendering Engine). Used by the Athena Game Framework.
C++
1
star
20

TitanPlayed

Played time recording add-on for World of Warcraft, with out-of-game visualisation script
JavaScript
1
star
21

zlib

A custom distribution of zlib, with a CMake-based build system. Used by the Athena Game Framework.
C
1
star
22

Athena-Physics

The Physics module of the Athena Game Framework
C++
1
star
23

pymc

Python Module Creator, a graphical tool to create python bindings for a C++ library
C
1
star
24

Athena-Core

The Core module of the Athena Game Framework
C++
1
star
25

Athena-Graphics

The Graphics module of the Athena Game Framework
C++
1
star
26

OIS

A custom distribution of OIS (Object Oriented Input Library System). Used by the Athena Game Framework.
C++
1
star
27

Saori

An Ogre3D mesh viewer for MacOS X. Based on the Athena Game Framework.
Objective-C
1
star
28

D3Calculator

Web-based Diablo 3 Character Calculator
JavaScript
1
star
29

tools

A collection of small utility scripts
Python
1
star
30

Athena-Builder

Helper script to setup and build a specific configuration of the Athena Game Framework during development
1
star
31

UnitTest-cpp

A custom distribution of UnitTest++, with a CMake-based build system. Used by the Athena Game Framework.
C++
1
star
32

Bullet

A custom distribution of the Bullet Physics Library. Used by the Athena Game Framework.
C++
1
star
33

FreeType

A custom distribution of FreeType, with a CMake-based build system. Used by the Athena Game Framework.
C
1
star