From 9818814a5155ec0c7bd6bf9133a8d4c8127e5abf Mon Sep 17 00:00:00 2001 From: Xmader Date: Thu, 19 Nov 2020 17:58:13 -0500 Subject: [PATCH] refactor: string matchAll compatibility --- src/file.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/file.ts b/src/file.ts index b6a83ce..dca4976 100644 --- a/src/file.ts +++ b/src/file.ts @@ -35,8 +35,10 @@ const magicHookConstr = async (type: FileType) => { const deObf = getObfuscationCtx(mod) const authExp = m[1] + const reg = new RegExp(OBFUSCATED_REG) let magic = '' - for (const r of authExp.matchAll(OBFUSCATED_REG)) { + let r: RegExpMatchArray | null + while ((r = reg.exec(authExp)) !== null) { magic += deObf(+r[2], r[3]) }