Browse Source

Small Bug Fix

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

1
src/decrypt/qmc.js

@ -92,6 +92,7 @@ async function queryKeyInfo(keyData, filename, format) {
let data = await resp.json(); let data = await resp.json();
return QmcMaskCreate58(data.Matrix58, data.Super58A, data.Super58B); return QmcMaskCreate58(data.Matrix58, data.Super58A, data.Super58B);
} catch (e) { } catch (e) {
console.log(e);
} }
} }

4
src/decrypt/qmcMask.js

@ -41,7 +41,6 @@ class QmcMask {
if (matrix.length === 44) { if (matrix.length === 44) {
this.Matrix44 = matrix this.Matrix44 = matrix
this.generateMask128from44() this.generateMask128from44()
debugger
} else { } else {
this.Matrix128 = matrix this.Matrix128 = matrix
this.generateMask44from128() this.generateMask44from128()
@ -104,7 +103,7 @@ class QmcMask {
mapping.forEach(it256 => { mapping.forEach(it256 => {
let it256Len = it256.length let it256Len = it256.length
for (let i = 1; i < it256Len; i++) { for (let i = 1; i < it256Len; i++) {
if (this.Matrix128[it256[0]] !== q.Matrix128[it256[i]]) { if (this.Matrix128[it256[0]] !== this.Matrix128[it256[i]]) {
throw "decode mask-128 to mask-44 failed" throw "decode mask-128 to mask-44 failed"
} }
} }
@ -189,7 +188,6 @@ export function QmcMaskDetectMgg(data) {
const mask = new QmcMask(matrix); const mask = new QmcMask(matrix);
let dx = mask.Decrypt(data.slice(0, OGG_HEADER.length)); let dx = mask.Decrypt(data.slice(0, OGG_HEADER.length));
if (!IsBytesEqual(OGG_HEADER, dx)) { if (!IsBytesEqual(OGG_HEADER, dx)) {
debugger
return; return;
} }

Loading…
Cancel
Save