From 088fb8fadd8e2862544d34ba916b59e4cdf6e52b Mon Sep 17 00:00:00 2001 From: JMenCode <39919286+JMenCode@users.noreply.github.com> Date: Tue, 31 Jul 2018 20:30:17 +0400 Subject: [PATCH] Fix byte The error that they did not read the files --- src/encryption/MPQEncryption.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/encryption/MPQEncryption.php b/src/encryption/MPQEncryption.php index 2dd1c9e..e13f2c0 100644 --- a/src/encryption/MPQEncryption.php +++ b/src/encryption/MPQEncryption.php @@ -62,7 +62,7 @@ static function DecryptStream($stream, $datalen, $key, $outFile) for($i = 0; $i < $datalen; $i++) { - $seed = (int)($seed + self::$CryptTable[0x400 + ($key & 0xFF)]); + $seed = uPlus($seed, self::$table[0x400 + ($key & 0xFF)]); $ch = unpack("V", $data[$i * 4] . $data[($i * 4) + 1] . $data[($i * 4) + 2] . $data[($i * 4) + 3])[1] ^ (int)($key + $seed); $key = (((~$key) << 0x15) + 0x11111111) | (rShift($key,0x0B)); @@ -135,4 +135,4 @@ function uPlus($o1, $o2) // right shift without preserving the sign(leftmost) bit function rShift($num,$bits) { return (($num >> 1) & 0x7FFFFFFF) >> ($bits - 1); } -?> \ No newline at end of file +?>