kanma / mpqextractor Goto Github PK
View Code? Open in Web Editor NEWA command-line tool to extract files from MPQ archives
License: Other
A command-line tool to extract files from MPQ archives
License: Other
Hi,
When compiling MPQExtractor following your instructions, I'm greeted with
Linking CXX shared library ../bin/libstorm.so
/usr/bin/ld: cannot find -lbz2
collect2: ld returned 1 exit status
make[2]: *** [bin/libstorm.so.8.10.0] Error 1
make[1]: *** [StormLib/CMakeFiles/storm.dir/all] Error 2
make: *** [all] Error 2
Here are the steps I followed :
$ cd ~/local/etc
$ git clone git://github.com/Kanma/MPQExtractor.git
$ cd MPQExtractor
$ git submodule init && git submodule update
$ mkdir ./build && cd ./build
$ cmake ~/local/etc/MPQExtractor
$ make
Maybe it's a missing package on my side, but I installed libzip2
through apt-get
to no avail.
Hi, I'm looking at maybe packaging this if it can extract MPQ files from Warcraft 3, since I'm trying to fix a package that used to automate GDI responses in order to wrap the installation of Warcraft 3 in a script.
But without releases, I'll basically have to improvise on the version. Please make a release.
Hi Kanma,
I wanted to test MPQExtractor in view to explore CoreData.mpq from Diablo 3.
I've been able to build the binary on Ubuntu following your README.
Unfortunately, when I run "./bin/MPQExtractor -l list.txt CoreData.mpq", list.txt is binary...
Would you have any idea why ?
Thanks,
Lxir
First of all, thank you so much! This is a great tool! So far the best I've tried when handling MPQ archives.
My use case is that I would like to use the original Warcraft 3 RoC CD, one of the free official patches, and free and open source tools, in order to install and patch Warcraft 3 RoC. The end goal of this exercise is to fix a package for Gentoo I made a couple years ago.
So here is my procedure so far:
e5369553b4e9752eed239aeeecef2ca7133c42e6eb66fe7a32ff60a9b9f428d9
once when it's dumped to a separate ISO9660 file. The inserted CD gets a different checksum for some reason, and trying to dump the thing with dd yields 4 sectors less than the ISO header claims the disc should have. Probably some SecuROM/TAO codgery at work here./var/tmp/war3roc-pl.iso
.mkdir -p Movies Maps/Scenario redist/miles
isoinfo -i /var/tmp/war3roc-pl.iso -x '/WAR3.MPQ;1' > war3.mpq
isoinfo -i /var/tmp/war3roc-pl.iso -x '/SETUP.MPQ;1' > setup.mpq
isoinfo -i /var/tmp/war3roc-pl.iso -x '/MOVIES/HUMANED.MPQ;1' > Movies/HumanEd.mpq
isoinfo -i /var/tmp/war3roc-pl.iso -x '/MOVIES/HUMANOP.MPQ;1' > Movies/HumanOp.mpq
isoinfo -i /var/tmp/war3roc-pl.iso -x '/MOVIES/NIGHTELFED.MPQ;1' > Movies/NightElfEd.mpq
isoinfo -i /var/tmp/war3roc-pl.iso -x '/MOVIES/ORCED.MPQ;1' > Movies/OrcEd.mpq
isoinfo -i /var/tmp/war3roc-pl.iso -x '/MOVIES/UNDEADED.MPQ;1' > Movies/UndeadEd.mpq
isoinfo -i /var/tmp/war3roc-pl.iso -x '/MOVIES/TUTORIALIN.MPQ;1' > Movies/TutorialIn.mpq
isoinfo -i /var/tmp/war3roc-pl.iso -x '/MOVIES/TUTORIALOP.MPQ;1' > Movies/TutorialOp.mpq
MPQExtractor -e 'File00000060.exe' -o . setup.mpq
mv File00000060.exe 'Warcraft III.exe'
MPQExtractor -e 'File00000061.exe' -o . setup.mpq
mv File00000061.exe 'World Editor.exe'
MPQExtractor -e 'File00000062.exe' -o . setup.mpq
mv File00000062.exe War3.exe
MPQExtractor -e 'File00000063.exe' -o . setup.mpq
mv File00000063.exe WorldEdit.exe
MPQExtractor -e 'File00000064.exe' -o . setup.mpq
mv File00000064.exe Mss32.dll
MPQExtractor -e 'File00000065.exe' -o . setup.mpq
mv File00000065.exe ijl15.dll
MPQExtractor -e 'File00000066.exe' -o . setup.mpq
mv File00000066.exe Game.dll
MPQExtractor -e 'File00000067.exe' -o . setup.mpq
mv File00000067.exe Storm.dll
MPQExtractor -e 'File00000069.w3x' -o . setup.mpq
mv File00000069.w3x Maps/(10)DustwallowKeys.w3m
MPQExtractor -e 'File00000070.w3x' -o . setup.mpq
mv File00000070.w3x Maps/(12)DivideAndConquer.w3m
MPQExtractor -e 'File00000071.w3x' -o . setup.mpq
mv File00000071.w3x Maps/(12)IceCrown.w3m
MPQExtractor -e 'File00000072.w3x' -o . setup.mpq
mv File00000072.w3x Maps/(2)BootyBay.w3m
MPQExtractor -e 'File00000073.w3x' -o . setup.mpq
mv File00000073.w3x Maps/(2)Harrow.w3m
MPQExtractor -e 'File00000074.w3x' -o . setup.mpq
mv File00000074.w3x Maps/(2)HillsOfGlory.w3m
MPQExtractor -e 'File00000075.w3x' -o . setup.mpq
mv File00000075.w3x Maps/(2)OgreMound.w3m
MPQExtractor -e 'File00000076.w3x' -o . setup.mpq
mv File00000076.w3x Maps/(2)PlunderIsle.w3m
MPQExtractor -e 'File00000077.w3x' -o . setup.mpq
mv File00000077.w3x Maps/(3)Forestwalk.w3m
MPQExtractor -e 'File00000078.w3x' -o . setup.mpq
mv File00000078.w3x Maps/(3)IsleOfDread.w3m
MPQExtractor -e 'File00000079.w3x' -o . setup.mpq
mv File00000079.w3x Maps/(3)Nighthaven.w3m
MPQExtractor -e 'File00000080.w3x' -o . setup.mpq
mv File00000080.w3x Maps/(4)Adrenaline.w3m
MPQExtractor -e 'File00000081.w3x' -o . setup.mpq
mv File00000081.w3x Maps/(4)Borderlands.w3m
MPQExtractor -e 'File00000082.w3x' -o . setup.mpq
mv File00000082.w3x Maps/(4)Deadwaterdrop.w3m
MPQExtractor -e 'File00000083.w3x' -o . setup.mpq
mv File00000083.w3x Maps/(4)DragonMountain.w3m
MPQExtractor -e 'File00000084.w3x' -o . setup.mpq
mv File00000084.w3x Maps/(4)Duskwood.w3m
MPQExtractor -e 'File00000085.w3x' -o . setup.mpq
mv File00000085.w3x Maps/(4)Frostsabre.w3m
MPQExtractor -e 'File00000086.w3x' -o . setup.mpq
mv File00000086.w3x Maps/(4)HarvestMoon.w3m
MPQExtractor -e 'File00000087.w3x' -o . setup.mpq
mv File00000087.w3x Maps/(4)Legends.w3m
MPQExtractor -e 'File00000088.w3x' -o . setup.mpq
mv File00000088.w3x Maps/(4)LostTemple.w3m
MPQExtractor -e 'File00000089.w3x' -o . setup.mpq
mv File00000089.w3x Maps/(4)MysticIsles.w3m
MPQExtractor -e 'File00000090.w3x' -o . setup.mpq
mv File00000090.w3x Maps/(4)TranquilPaths.w3m
MPQExtractor -e 'File00000091.w3x' -o . setup.mpq
mv File00000091.w3x Maps/(5)TheGlaive.w3m
MPQExtractor -e 'File00000092.w3x' -o . setup.mpq
mv File00000092.w3x Maps/(6)DarkForest.w3m
MPQExtractor -e 'File00000093.w3x' -o . setup.mpq
mv File00000093.w3x Maps/(6)DragonFire.w3m
MPQExtractor -e 'File00000094.w3x' -o . setup.mpq
mv File00000094.w3x Maps/(6)DrywaterGulch.w3m
MPQExtractor -e 'File00000095.w3x' -o . setup.mpq
mv File00000095.w3x Maps/(6)GnollWood.w3m
MPQExtractor -e 'File00000096.w3x' -o . setup.mpq
mv File00000096.w3x Maps/(6)Moonglade.w3m
MPQExtractor -e 'File00000097.w3x' -o . setup.mpq
mv File00000097.w3x Maps/(6)ScorchedBasin.w3m
MPQExtractor -e 'File00000098.w3x' -o . setup.mpq
mv File00000098.w3x Maps/(6)Stromguarde.w3m
MPQExtractor -e 'File00000099.w3x' -o . setup.mpq
mv File00000099.w3x Maps/(6)SwampOfSorrows.w3m
MPQExtractor -e 'File00000100.w3x' -o . setup.mpq
mv File00000100.w3x Maps/(6)TimbermawHold.w3m
MPQExtractor -e 'File00000101.w3x' -o . setup.mpq
mv File00000101.w3x Maps/(8)Battleground.w3m
MPQExtractor -e 'File00000102.w3x' -o . setup.mpq
mv File00000102.w3x Maps/(8)BlastedLands.w3m
MPQExtractor -e 'File00000103.w3x' -o . setup.mpq
mv File00000103.w3x Maps/(8)BloodvenomFalls.w3m
MPQExtractor -e 'File00000104.w3x' -o . setup.mpq
mv File00000104.w3x Maps/(8)GardenOfWar.w3m
MPQExtractor -e 'File00000105.w3x' -o . setup.mpq
mv File00000105.w3x Maps/(8)GolemsInTheMist.w3m
MPQExtractor -e 'File00000106.w3x' -o . setup.mpq
mv File00000106.w3x Maps/(8)PetrifiedForest.w3m
MPQExtractor -e 'File00000107.w3x' -o . setup.mpq
mv File00000107.w3x Maps/(8)Plaguelands.w3m
MPQExtractor -e 'File00000108.w3x' -o . setup.mpq
mv File00000108.w3x Maps/(8)PlainsOfSnow.w3m
MPQExtractor -e 'File00000109.w3x' -o . setup.mpq
mv File00000109.w3x Maps/(8)TheCrucible.w3m
MPQExtractor -e 'File00000110.w3x' -o . setup.mpq
mv File00000110.w3x Maps/(9)Riverrun.w3m
MPQExtractor -e 'File00000111.w3x' -o . setup.mpq
mv File00000111.w3x Maps/Scenario/(1)TheDeathSheep.w3m
MPQExtractor -e 'File00000112.w3x' -o . setup.mpq
mv File00000112.w3x Maps/Scenario/(4)WarChasers.w3m
MPQExtractor -e 'File00000113.exe' -o . setup.mpq
mv File00000113.exe redist/miles/Mp3dec.asi
MPQExtractor -e 'File00000114.exe' -o . setup.mpq
mv File00000114.exe redist/miles/Mssdolby.m3d
MPQExtractor -e 'File00000115.exe' -o . setup.mpq
mv File00000115.exe redist/miles/Msseax2.m3d
MPQExtractor -e 'File00000116.exe' -o . setup.mpq
mv File00000116.exe redist/miles/Mssfast.m3d
MPQExtractor -e 'File00000117.exe' -o . setup.mpq
mv File00000117.exe redist/miles/Reverb3.flt
At this point I'm left scratching my head because Warcraft 3 patches are self-extracting MPQ files with a PE32 stub. Here are the contents:
As we can see, inside the patch file there's more MPQ files and from studying the contents it appears that not all of them are even used.
Prepatch.lst reads:
extract BNUpdate.exe
extract Patch.txt
execute BNUpdate
At this point I'm not sure which way I should continue. Obviously Patch_War3.mpq contains the files I want to use, but some of them are not useful in patching War3.mpq. Like for instance:
How should I go about this if I want to continue using MPQExtractor?
Whenever the extractor extracts anything .wav is seems to mangle the file (file corruption?). I can barley hear the actual sound file, while the rest is simply loud high pitch static.
I am using Mac OSX 10.8.2 x64
Thanks
user@Mac-Studio build % cmake --build .
[ 0%] Building C object StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/rsa/rsa_verify_simple.c.o
/MPQExtractor/StormLib/src/libtomcrypt/src/pk/rsa/rsa_verify_simple.c:58:12: error: call to undeclared function 'LibTomMalloc'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
tmpbuf = XMALLOC(siglen);
^
/MPQExtractor/StormLib/src/libtomcrypt/src/pk/rsa/../../headers/tomcrypt_custom.h:27:18: note: expanded from macro 'XMALLOC'
#define XMALLOC LibTomMalloc
^
/MPQExtractor/StormLib/src/libtomcrypt/src/pk/rsa/rsa_verify_simple.c:58:10: warning: incompatible integer to pointer conversion assigning to 'unsigned char *' from 'int' [-Wint-conversion]
tmpbuf = XMALLOC(siglen);
^ ~~~~~~~~~~~~~~~
/MPQExtractor/StormLib/src/libtomcrypt/src/pk/rsa/rsa_verify_simple.c:66:6: error: call to undeclared function 'LibTomFree'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
XFREE(tmpbuf);
^
/MPQExtractor/StormLib/src/libtomcrypt/src/pk/rsa/../../headers/tomcrypt_custom.h:45:18: note: expanded from macro 'XFREE'
#define XFREE LibTomFree
^
/MPQExtractor/StormLib/src/libtomcrypt/src/pk/rsa/rsa_verify_simple.c:72:6: error: call to undeclared function 'LibTomFree'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
XFREE(tmpbuf);
^
/MPQExtractor/StormLib/src/libtomcrypt/src/pk/rsa/../../headers/tomcrypt_custom.h:45:18: note: expanded from macro 'XFREE'
#define XFREE LibTomFree
^
/MPQExtractor/StormLib/src/libtomcrypt/src/pk/rsa/rsa_verify_simple.c:83:3: error: call to undeclared function 'LibTomFree'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
XFREE(tmpbuf);
^
/MPQExtractor/StormLib/src/libtomcrypt/src/pk/rsa/../../headers/tomcrypt_custom.h:45:18: note: expanded from macro 'XFREE'
#define XFREE LibTomFree
^
1 warning and 4 errors generated.
make[2]: *** [StormLib/CMakeFiles/storm.dir/src/libtomcrypt/src/pk/rsa/rsa_verify_simple.c.o] Error 1
make[1]: *** [StormLib/CMakeFiles/storm.dir/all] Error 2
make: *** [all] Error 2
Could you add an overwrite function? So it overwrites files if there are multiple times the same file in different directories and we don't use the "full path" option.
I tried without the -f option and it just said "failed to extract"
I am trying to build this on Raspbian on a Pi 2, getting this error:
Linking CXX shared library ../bin/libstorm.so
/usr/bin/ld: cannot find -lbz2
collect2: ld returned 1 exit status
StormLib/CMakeFiles/storm.dir/build.make:5235: recipe for target 'bin/libstorm.so.9.0.0' failed
make[2]: *** [bin/libstorm.so.9.0.0] Error 1
CMakeFiles/Makefile2:110: recipe for target 'StormLib/CMakeFiles/storm.dir/all' failed
make[1]: *** [StormLib/CMakeFiles/storm.dir/all] Error 2
Makefile:113: recipe for target 'all' failed
make: *** [all] Error 2
Any ideas on the -lbz2? Seems something is missing bzip2 perhaps but I am not sure what.
I am in the need of a feature to extract all files in a MPQ missing the listfile. My plan with the files is to index hashes to cross reference with resources uploaded on hiveworkshop.com to create automated attributions to authors of uploaded resources.
I imagine this working in multiple ways:
Either way is fine with me.
I noticed this code hasn't been touched in quite a while, but I'm trying to extract some content from some MPQ fils and the tool is reporting a failure:
./MPQExtractor -e Character\BloodElf\Male\BloodElfMale0004-00.anim -o ~/Desktop/out /Users/bitson/Applications/World\ of\ Warcraft/Data/model.MPQ
Opening '/Users/bitson/Applications/World of Warcraft/Data/model.MPQ'...
Extracting files...
Failed to extract the file 'CharacterBloodElfMaleBloodElfMale0004-00.anim' in /Users/bitson/Desktop/out/CharacterBloodElfMaleBloodElfMale0004-00.anim
I'm able to list the contents of the MPQ but not extract the data.
Hello,
This seems to be a cool tool, but after installing it, when I try to use it it doesn't work.
The output says "Opening ''... and stops there.
The files I am trying to extract are w3m and w3x files, maps from Warcraft III. (not necessary Reforged)
I tried with ubuntu 18 and 20.
Thanks if you can help !
As far as I understand there is no command to extract all files in a MPQ archive, including paths.
Isn't this the most obvious thing for this tool to do?
Besides that, great tool, thanks for writing it.
No way to do this?
Hey, just ran into this repo while researching StarCraft/BroodWar tools on linux, compiled fine, but when running ./MPQExtractor -l brood.txt BroodWar.mpq
(where BroodWar.mpq is INSTALL.EXE copied from the install disk for cd-less play) I get:
Opening 'BroodWar.mpq'...
Failed to extract the list of files
Hi,
Your tool looks just awesome ! However, I'm trying to use it to extract some files from warcraft 3 mpqs and find difficulties knowing how to properly apply patches.
What I would like to do is to extract all files from both roc and tft separately.
There are some explanations about the 4 mpq files that I found here : http://world-editor-tutorials.thehelper.net/cat_usersubmit.php?view=42787. Maybe your understand better than me what those briefs descriptions mean (the difference between War3Patch.mpq and war3local.mpq).
Here are the commands I tried :
MPQExtractor -s "*" -f war3.mpq
MPQExtractor -s "*" -p War3Patch.mpq --prefix base -f war3.mpq
It seems to work (no error, I get a list generated). But I store the output in files and compute a diff between the two of them, I get this kind of non-sense (making me guess something has gone wrong) :
> - 0000711.xxx
> - 0000712.xxx
> - 0000713.xxx
> - 0000714.xxx
If you can suggest me a command from your tool that would help me understand what is going on and how to use those patches it would be much appreciated :)
It also requires these libs to compile:
sudo apt-get install libbz2-dev zlib1g-dev
PS: too bad it doesn't compress to MPQ as well, it's useful for linux users not to use a window GUI program but I didn't realize it was only an extractor lol
I did try to extract map images from the first version of WoW (1.12.1). But instead of clear title of files I have just hashes (338cbccd624193b9ef38100a0bf806d3.blp and so on). I found some listfiles, but they did not help.
Is it possible transform this hash-names to clear names like map_45_56.blp?
Or may be need another listifle.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.