Skip to content

Commit 2748c3a

Browse files
committed
Fixed regex bugs in type2 decoder
1 parent bd38611 commit 2748c3a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

functions/xDecoder.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ module.exports = function () {
7676
}
7777

7878
const decode = eval(targetName);
79-
const quoType = code.match(new RegExp(`${targetName}\\((.)[a-zA-Z0-9]+.,.[^']+.\\)`))[1];
79+
const quoType = code.match(new RegExp(`${targetName}\\((.)[a-zA-Z0-9]+.,\\s*.[^']+.\\)`))[1];
8080
// there are 2 types like _0x4763("0x120b","EEc$") or _0x4763('0x120b','EEc$')
8181
// so quotation type check is needed
8282
const regArg = `${targetName}\\(.([a-zA-Z0-9]+).,\\s*.([^${quoType}]+).\\)`;
@@ -107,7 +107,7 @@ module.exports = function () {
107107
.replace(/\]/g, "\\]")
108108
.replace(/\^/g, "\\^")
109109
.replace(/\*/g, "\\*");
110-
regex = new RegExp(`${targetName}\\(.${m[1]}.,.${m[2]}.\\)`, "g");
110+
regex = new RegExp(`${targetName}\\(.${m[1]}.,\\s*.${m[2]}.\\)`, "g");
111111
code = code.replace(regex, `'${val}'`);
112112
regex = defaultRegex;
113113
}

0 commit comments

Comments
 (0)