From f0cba0e9559bd0c39555b0a636b1edcb6cb4fffa Mon Sep 17 00:00:00 2001 From: C-3PO Date: Thu, 5 Jul 2018 17:03:56 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Remove=20dataview=20from=20decry?= =?UTF-8?q?ptChunk?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ssn/decryption/decryptChunk.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ssn/decryption/decryptChunk.ts b/src/ssn/decryption/decryptChunk.ts index b625c70..9424ed3 100644 --- a/src/ssn/decryption/decryptChunk.ts +++ b/src/ssn/decryption/decryptChunk.ts @@ -24,7 +24,7 @@ export default function getDecryptor([key0, key1, key2]: [number, number, number return (encryptedChunk: Buffer) => { const decryptedChunk = Buffer.alloc(encryptedChunk.length); - const dvOut = new DataView(decryptedChunk.buffer); + //const dvOut = new DataView(decryptedChunk.buffer); for (let i = 0; i < encryptedChunk.length; i += 1) { //read byte @@ -39,9 +39,11 @@ export default function getDecryptor([key0, key1, key2]: [number, number, number if (position + i < 12) { //do nothing } else if (position + i >= 12 && position < 12) { - dvOut.setUint8(position + i - 12, curChar); + //dvOut.setUint8(position + i - 12, curChar); + decryptedChunk.writeUInt8(curChar, position + i - 12); } else { - dvOut.setUint8(i, curChar); + //dvOut.setUint8(i, curChar); + decryptedChunk.writeUInt8(curChar, i); } //update keys