mpyq
mpyq copied to clipboard
Support for encrypted MPQs
I still haven't encountered any, but according to references encrypted MPQs are possible. Possibly Warcraft III maps?
I think I might have found one such replay.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/lib/python2.6/dist-packages/mpyq-0.1.5-py2.6.egg/mpyq.py", line 100, in __init__
self.files = self.read_file('(listfile)').splitlines()
File "/usr/local/lib/python2.6/dist-packages/mpyq-0.1.5-py2.6.egg/mpyq.py", line 201, in read_file
raise NotImplementedError("Encryption is not supported yet.")
NotImplementedError: Encryption is not supported yet.
Custom maps for WC3 are very likely to use encryption. But mpyq works great with WC3 maps which use no encryption, such as the melee maps that come preinstalled with WC3, if header skipping is added (WC3 maps have a 512 byte header before the MPQ data).
In my fork (https://github.com/TheSil/mpyq) I've added very basic support for encryption (method determined from https://github.com/ladislav-zezula/StormLib). Feel free to check it out, although its quite dirty (though works just for my case where I just wanted to print map commands, see https://github.com/TheSil/w3mpq/blob/master/get_commands.py)