Browse Source

Fix Decrypt Algorithm Error

20230320
MengYX 5 years ago
parent
commit
ce251e3c9e
No known key found for this signature in database GPG Key ID: E63F9C7303E8F604
  1. 7
      src/decrypt/qmcMask.js

7
src/decrypt/qmcMask.js

@ -90,10 +90,15 @@ class QmcMask {
Decrypt(data) {
let dst = data.slice(0);
let index = -1;
let maskIdx = -1;
for (let cur = 0; cur < data.length; cur++) {
index++;
maskIdx++;
if (cur === 0x8001 || (cur > 0x8001 && cur % 0x8000 === 0)) maskIdx++;
if (index === 0x8000 || (index > 0x8000 && (index + 1) % 0x8000 === 0)) {
index++;
maskIdx++;
}
if (maskIdx >= 128) maskIdx -= 128;
dst[cur] ^= this.Matrix128[maskIdx];
}

Loading…
Cancel
Save