eagleflo / mpyq

Python library for reading MPQ archives.
BSD 2-Clause "Simplified" License
100 stars 23 forks source link

Support for encrypted MPQs #3

Open eagleflo opened 14 years ago

eagleflo commented 14 years ago

I still haven't encountered any, but according to references encrypted MPQs are possible. Possibly Warcraft III maps?

GraylinKim commented 13 years ago

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.

Download it here

RenolY2 commented 10 years ago

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).

TheSil commented 4 years ago

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)