From ebfed57c9daf5736446d1d17ccda3e742ff84452 Mon Sep 17 00:00:00 2001 From: uh wot Date: Thu, 15 Jul 2021 19:19:00 +0200 Subject: [PATCH] changed hex decrypting to match deezer's shit prob doesn't matter anyways, but just in case --- dzunlock.user.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dzunlock.user.js b/dzunlock.user.js index daaca8a..bee93fe 100644 --- a/dzunlock.user.js +++ b/dzunlock.user.js @@ -3,7 +3,7 @@ // @namespace io.github.uhwot.dzunlock // @description enables deezer hifi features lol // @author uh wot -// @version 1.1.5 +// @version 1.1.6 // @license GPL-3.0-only // @homepageURL https://git.freezer.life/uhwot/dzunlock // @downloadURL https://git.freezer.life/uhwot/dzunlock/raw/branch/master/dzunlock.user.js @@ -100,10 +100,14 @@ function str2bin(str) { }) } +function bin2str(bin) { + return String.fromCharCode.apply(String, bin); +} + function decryptHex(hex, key) { hex = aesjs.utils.hex.toBytes(hex) let aesEcb = new aesjs.ModeOfOperation.ecb(key) - return aesjs.utils.utf8.fromBytes(aesEcb.decrypt(hex)).replace(/\0+$/, '') // removes zero-padding + return bin2str(aesEcb.decrypt(hex)).replace(/\0+$/, '') // removes zero-padding } function encryptHex(str, key) {