We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
const
1 parent 73b7cfb commit a629da1Copy full SHA for a629da1
functions/xDecoder.js
@@ -4,6 +4,7 @@ module.exports = function () {
4
const Decoder = {};
5
6
Decoder.decode = function decode(type, targetName, code) {
7
+ code = this.replaceConstant(targetName, code);
8
switch (type) {
9
case 0:
10
return Decoder.decodeType0(targetName, code);
@@ -25,6 +26,11 @@ module.exports = function () {
25
26
return code;
27
}
28
29
+ Decoder.replaceConstant = function (targetName, code) {
30
+ // replace const to var if target func is constant
31
+ return code.replace(new RegExp(`const ${targetName}\\s*=`), `var ${targetName}=`);
32
+ }
33
+
34
Decoder.decodeType0 = function (targetName, code) { // array like _0xf13b[274] not func
35
eval(`var ${targetName} = null`);
36
try {
0 commit comments