🚧 Some more possible decryption fixes

This commit is contained in:
C-3PO 2018-07-08 22:32:08 +02:00
parent ddeb9f190f
commit 32b0c39444
Signed by: c3po
GPG key ID: 62993C4BB4D86F24
2 changed files with 2 additions and 2 deletions

View file

@ -12,7 +12,7 @@ export default function getDecryptor(decryptionKeys: [number, number, number]) {
let curChar = encryptedChunk.readUInt8(i); let curChar = encryptedChunk.readUInt8(i);
//decrypt byte //decrypt byte
const keyPart = (key2 | 2) & 0xFFFF; const keyPart = ((key2 | 2) >>> 0) & 0xFFFF;
const decryptedByte = int32Mul(keyPart, keyPart ^ 1) >>> 8; const decryptedByte = int32Mul(keyPart, keyPart ^ 1) >>> 8;
curChar = (curChar ^ (decryptedByte & 0xFF)) & 0xFF; curChar = (curChar ^ (decryptedByte & 0xFF)) & 0xFF;

View file

@ -3,7 +3,7 @@ import int32Mul from './int32Mul';
export default function updateKeys([key0, key1, key2]: [number, number, number], curChar: number): [number, number, number] { export default function updateKeys([key0, key1, key2]: [number, number, number], curChar: number): [number, number, number] {
key0 = getCrc(key0, curChar); key0 = getCrc(key0, curChar);
key1 = ((int32Mul(((key1 + (key0 & 0xFF)) >>> 0), 134775813) >>> 0) + 1) >>> 0; key1 = ((int32Mul((((key1 >>> 0) + ((key0 >>> 0) & 0xFF)) >>> 0), 134775813) >>> 0) + 1) >>> 0;
key2 = getCrc(key2, key1 >>> 24); key2 = getCrc(key2, key1 >>> 24);
return [key0, key1, key2]; return [key0, key1, key2];