Fixed a couple issue in the decryption and de-compression of audio files in D2 MPQ archives
-The encryption key was only valid for the first block of data. The encryption key for a specific block should be encryption key plus the index of the block (EncryptionKey + 1).
-The compression functions were designed to be called one after another, passing the output buffer from one to another. The issue was, it was not correctly passing the output buffer and the number of bytes written to the output buffer.
I tested this with the intro music that plays when you start D2 and it works perfectly
("data\global\music\introedit.wav" in "d2xmusic.mpq").
-The encryption key was only valid for the first block of data. The encryption key for a specific block should be encryption key plus the index of the block (EncryptionKey + 1). -The compression functions were designed to be called one after another, passing the output buffer from one to another. The issue was, it was not correctly passing the output buffer and the number of bytes written to the output buffer.
I tested this with the intro music that plays when you start D2 and it works perfectly ("data\global\music\introedit.wav" in "d2xmusic.mpq").