Small Bug Fix

This commit is contained in:
MengYX 2020-04-26 11:13:50 +08:00
parent e7b86a4779
commit f9543965b6
No known key found for this signature in database
GPG Key ID: E63F9C7303E8F604
2 changed files with 2 additions and 3 deletions

View File

@ -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);
} }
} }

View File

@ -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;
} }