js-confuser 2.0.0-alpha.5 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/ISSUE_TEMPLATE/bug_report.md +43 -43
- package/.github/ISSUE_TEMPLATE/feature_request.md +20 -20
- package/.github/workflows/node.js.yml +28 -28
- package/.prettierrc +4 -4
- package/CHANGELOG.md +1015 -989
- package/CODE_OF_CONDUCT.md +131 -131
- package/CONTRIBUTING.md +52 -52
- package/LICENSE +21 -21
- package/Migration.md +72 -71
- package/README.md +86 -78
- package/dist/constants.js +43 -43
- package/dist/index.js +14 -23
- package/dist/obfuscator.js +31 -25
- package/dist/order.js +4 -4
- package/dist/presets.js +31 -31
- package/dist/templates/integrityTemplate.js +4 -4
- package/dist/templates/template.js +1 -2
- package/dist/transforms/astScrambler.js +1 -2
- package/dist/transforms/calculator.js +1 -2
- package/dist/transforms/controlFlowFlattening.js +93 -63
- package/dist/transforms/deadCode.js +1 -2
- package/dist/transforms/dispatcher.js +4 -5
- package/dist/transforms/extraction/duplicateLiteralsRemoval.js +1 -2
- package/dist/transforms/extraction/objectExtraction.js +1 -2
- package/dist/transforms/finalizer.js +1 -2
- package/dist/transforms/flatten.js +1 -2
- package/dist/transforms/identifier/globalConcealing.js +15 -2
- package/dist/transforms/identifier/movedDeclarations.js +8 -7
- package/dist/transforms/identifier/renameVariables.js +7 -7
- package/dist/transforms/lock/integrity.js +11 -10
- package/dist/transforms/lock/lock.js +2 -3
- package/dist/transforms/minify.js +11 -29
- package/dist/transforms/opaquePredicates.js +1 -2
- package/dist/transforms/pack.js +5 -2
- package/dist/transforms/plugin.js +18 -19
- package/dist/transforms/preparation.js +16 -16
- package/dist/transforms/renameLabels.js +1 -2
- package/dist/transforms/rgf.js +8 -9
- package/dist/transforms/shuffle.js +1 -2
- package/dist/transforms/string/encoding.js +1 -2
- package/dist/transforms/string/stringCompression.js +3 -4
- package/dist/transforms/string/stringConcealing.js +8 -3
- package/dist/transforms/string/stringEncoding.js +1 -2
- package/dist/transforms/variableMasking.js +1 -2
- package/dist/utils/NameGen.js +2 -2
- package/dist/utils/PredicateGen.js +1 -2
- package/dist/utils/ast-utils.js +87 -88
- package/dist/utils/function-utils.js +8 -8
- package/dist/utils/node.js +5 -6
- package/dist/utils/object-utils.js +4 -4
- package/dist/utils/random-utils.js +20 -20
- package/dist/utils/static-utils.js +1 -2
- package/dist/validateOptions.js +4 -7
- package/index.d.ts +17 -17
- package/package.json +61 -59
- package/src/constants.ts +168 -168
- package/src/index.ts +118 -118
- package/src/obfuscationResult.ts +49 -49
- package/src/obfuscator.ts +501 -497
- package/src/options.ts +407 -407
- package/src/order.ts +54 -54
- package/src/presets.ts +125 -125
- package/src/templates/bufferToStringTemplate.ts +57 -57
- package/src/templates/deadCodeTemplates.ts +1185 -1185
- package/src/templates/getGlobalTemplate.ts +76 -76
- package/src/templates/integrityTemplate.ts +64 -64
- package/src/templates/setFunctionLengthTemplate.ts +11 -11
- package/src/templates/stringCompressionTemplate.ts +20 -20
- package/src/templates/tamperProtectionTemplates.ts +120 -120
- package/src/templates/template.ts +224 -224
- package/src/transforms/astScrambler.ts +99 -99
- package/src/transforms/calculator.ts +99 -99
- package/src/transforms/controlFlowFlattening.ts +1716 -1664
- package/src/transforms/deadCode.ts +82 -82
- package/src/transforms/dispatcher.ts +450 -450
- package/src/transforms/extraction/duplicateLiteralsRemoval.ts +156 -158
- package/src/transforms/extraction/objectExtraction.ts +186 -186
- package/src/transforms/finalizer.ts +74 -74
- package/src/transforms/flatten.ts +421 -420
- package/src/transforms/identifier/globalConcealing.ts +315 -295
- package/src/transforms/identifier/movedDeclarations.ts +252 -251
- package/src/transforms/identifier/renameVariables.ts +328 -321
- package/src/transforms/lock/integrity.ts +117 -114
- package/src/transforms/lock/lock.ts +418 -425
- package/src/transforms/minify.ts +615 -629
- package/src/transforms/opaquePredicates.ts +100 -100
- package/src/transforms/pack.ts +239 -231
- package/src/transforms/plugin.ts +173 -173
- package/src/transforms/preparation.ts +349 -347
- package/src/transforms/renameLabels.ts +175 -175
- package/src/transforms/rgf.ts +322 -322
- package/src/transforms/shuffle.ts +82 -82
- package/src/transforms/string/encoding.ts +144 -144
- package/src/transforms/string/stringCompression.ts +128 -128
- package/src/transforms/string/stringConcealing.ts +312 -298
- package/src/transforms/string/stringEncoding.ts +80 -80
- package/src/transforms/string/stringSplitting.ts +77 -77
- package/src/transforms/variableMasking.ts +257 -257
- package/src/utils/IntGen.ts +33 -33
- package/src/utils/NameGen.ts +116 -116
- package/src/utils/PredicateGen.ts +61 -61
- package/src/utils/ast-utils.ts +663 -663
- package/src/utils/function-utils.ts +50 -50
- package/src/utils/gen-utils.ts +48 -48
- package/src/utils/node.ts +78 -78
- package/src/utils/object-utils.ts +21 -21
- package/src/utils/random-utils.ts +93 -93
- package/src/utils/static-utils.ts +66 -66
- package/src/validateOptions.ts +256 -259
- package/tsconfig.json +13 -14
- package/dist/probability.js +0 -1
- package/dist/transforms/functionOutlining.js +0 -230
- package/dist/utils/ControlObject.js +0 -125
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
import { NodePath } from "@babel/traverse";
|
|
2
|
-
import { PluginInstance } from "../transforms/plugin";
|
|
3
|
-
import Template from "./template";
|
|
4
|
-
import { UNSAFE } from "../constants";
|
|
5
|
-
import { isStrictMode } from "../utils/ast-utils";
|
|
6
|
-
|
|
7
|
-
export const createGetGlobalTemplate = (
|
|
8
|
-
pluginInstance: PluginInstance,
|
|
9
|
-
path: NodePath
|
|
10
|
-
) => {
|
|
11
|
-
if (
|
|
12
|
-
pluginInstance.options.lock?.tamperProtection &&
|
|
13
|
-
!path.find((p) => isStrictMode(p))
|
|
14
|
-
) {
|
|
15
|
-
return new Template(`
|
|
16
|
-
function {getGlobalFnName}(){
|
|
17
|
-
var localVar = false;
|
|
18
|
-
eval(__JS_CONFUSER_VAR__(localVar) + " = true")
|
|
19
|
-
if (!localVar) {
|
|
20
|
-
{countermeasures}
|
|
21
|
-
|
|
22
|
-
return {};
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const root = eval("this");
|
|
26
|
-
return root;
|
|
27
|
-
}
|
|
28
|
-
`)
|
|
29
|
-
.addSymbols(UNSAFE)
|
|
30
|
-
.setDefaultVariables({
|
|
31
|
-
countermeasures:
|
|
32
|
-
pluginInstance.globalState.lock.createCountermeasuresCode(),
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return GetGlobalTemplate;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
const GetGlobalTemplate = new Template(`
|
|
40
|
-
function {getGlobalFnName}(){
|
|
41
|
-
var array = [
|
|
42
|
-
function (){
|
|
43
|
-
return globalThis
|
|
44
|
-
},
|
|
45
|
-
function (){
|
|
46
|
-
return global
|
|
47
|
-
},
|
|
48
|
-
function (){
|
|
49
|
-
return window
|
|
50
|
-
},
|
|
51
|
-
function (){
|
|
52
|
-
return new Function("return this")()
|
|
53
|
-
}
|
|
54
|
-
];
|
|
55
|
-
|
|
56
|
-
var bestMatch
|
|
57
|
-
var itemsToSearch = []
|
|
58
|
-
try {
|
|
59
|
-
bestMatch = Object
|
|
60
|
-
itemsToSearch["push"](("")["__proto__"]["constructor"]["name"])
|
|
61
|
-
} catch(e) {
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
A: for(var i = 0; i < array["length"]; i++) {
|
|
65
|
-
try {
|
|
66
|
-
bestMatch = array[i]()
|
|
67
|
-
for(var j = 0; j < itemsToSearch["length"]; j++) {
|
|
68
|
-
if(typeof bestMatch[itemsToSearch[j]] === "undefined") continue A;
|
|
69
|
-
}
|
|
70
|
-
return bestMatch
|
|
71
|
-
} catch(e) {}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
return bestMatch || this;
|
|
75
|
-
}
|
|
76
|
-
`);
|
|
1
|
+
import { NodePath } from "@babel/traverse";
|
|
2
|
+
import { PluginInstance } from "../transforms/plugin";
|
|
3
|
+
import Template from "./template";
|
|
4
|
+
import { UNSAFE } from "../constants";
|
|
5
|
+
import { isStrictMode } from "../utils/ast-utils";
|
|
6
|
+
|
|
7
|
+
export const createGetGlobalTemplate = (
|
|
8
|
+
pluginInstance: PluginInstance,
|
|
9
|
+
path: NodePath
|
|
10
|
+
) => {
|
|
11
|
+
if (
|
|
12
|
+
pluginInstance.options.lock?.tamperProtection &&
|
|
13
|
+
!path.find((p) => isStrictMode(p))
|
|
14
|
+
) {
|
|
15
|
+
return new Template(`
|
|
16
|
+
function {getGlobalFnName}(){
|
|
17
|
+
var localVar = false;
|
|
18
|
+
eval(__JS_CONFUSER_VAR__(localVar) + " = true")
|
|
19
|
+
if (!localVar) {
|
|
20
|
+
{countermeasures}
|
|
21
|
+
|
|
22
|
+
return {};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const root = eval("this");
|
|
26
|
+
return root;
|
|
27
|
+
}
|
|
28
|
+
`)
|
|
29
|
+
.addSymbols(UNSAFE)
|
|
30
|
+
.setDefaultVariables({
|
|
31
|
+
countermeasures:
|
|
32
|
+
pluginInstance.globalState.lock.createCountermeasuresCode(),
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return GetGlobalTemplate;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const GetGlobalTemplate = new Template(`
|
|
40
|
+
function {getGlobalFnName}(){
|
|
41
|
+
var array = [
|
|
42
|
+
function (){
|
|
43
|
+
return globalThis
|
|
44
|
+
},
|
|
45
|
+
function (){
|
|
46
|
+
return global
|
|
47
|
+
},
|
|
48
|
+
function (){
|
|
49
|
+
return window
|
|
50
|
+
},
|
|
51
|
+
function (){
|
|
52
|
+
return new Function("return this")()
|
|
53
|
+
}
|
|
54
|
+
];
|
|
55
|
+
|
|
56
|
+
var bestMatch
|
|
57
|
+
var itemsToSearch = []
|
|
58
|
+
try {
|
|
59
|
+
bestMatch = Object
|
|
60
|
+
itemsToSearch["push"](("")["__proto__"]["constructor"]["name"])
|
|
61
|
+
} catch(e) {
|
|
62
|
+
|
|
63
|
+
}
|
|
64
|
+
A: for(var i = 0; i < array["length"]; i++) {
|
|
65
|
+
try {
|
|
66
|
+
bestMatch = array[i]()
|
|
67
|
+
for(var j = 0; j < itemsToSearch["length"]; j++) {
|
|
68
|
+
if(typeof bestMatch[itemsToSearch[j]] === "undefined") continue A;
|
|
69
|
+
}
|
|
70
|
+
return bestMatch
|
|
71
|
+
} catch(e) {}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return bestMatch || this;
|
|
75
|
+
}
|
|
76
|
+
`);
|
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
import { MULTI_TRANSFORM, SKIP } from "../constants";
|
|
2
|
-
import Template from "./template";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Hashing Algorithm for Integrity: `cyrb53`
|
|
6
|
-
* @param str
|
|
7
|
-
* @param seed
|
|
8
|
-
*/
|
|
9
|
-
export function HashFunction(str: string, seed: number) {
|
|
10
|
-
let h1 = 0xdeadbeef ^ seed,
|
|
11
|
-
h2 = 0x41c6ce57 ^ seed;
|
|
12
|
-
for (let i = 0, ch; i < str.length; i++) {
|
|
13
|
-
ch = str.charCodeAt(i);
|
|
14
|
-
h1 = Math.imul(h1 ^ ch, 2654435761);
|
|
15
|
-
h2 = Math.imul(h2 ^ ch, 1597334677);
|
|
16
|
-
}
|
|
17
|
-
h1 =
|
|
18
|
-
Math.imul(h1 ^ (h1 >>> 16), 2246822507) ^
|
|
19
|
-
Math.imul(h2 ^ (h2 >>> 13), 3266489909);
|
|
20
|
-
h2 =
|
|
21
|
-
Math.imul(h2 ^ (h2 >>> 16), 2246822507) ^
|
|
22
|
-
Math.imul(h1 ^ (h1 >>> 13), 3266489909);
|
|
23
|
-
return 4294967296 * (2097151 & h2) + (h1 >>> 0);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// In template form to be inserted into code
|
|
27
|
-
export const HashTemplate = new Template(`
|
|
28
|
-
// Must be Function Declaration for hoisting
|
|
29
|
-
// Math.imul polyfill for ES5
|
|
30
|
-
function MathImulPolyfill(opA, opB){
|
|
31
|
-
opB |= 0; // ensure that opB is an integer. opA will automatically be coerced.
|
|
32
|
-
// floating points give us 53 bits of precision to work with plus 1 sign bit
|
|
33
|
-
// automatically handled for our convienence:
|
|
34
|
-
// 1. 0x003fffff /*opA & 0x000fffff*/ * 0x7fffffff /*opB*/ = 0x1fffff7fc00001
|
|
35
|
-
// 0x1fffff7fc00001 < Number.MAX_SAFE_INTEGER /*0x1fffffffffffff*/
|
|
36
|
-
var result = (opA & 0x003fffff) * opB;
|
|
37
|
-
// 2. We can remove an integer coersion from the statement above because:
|
|
38
|
-
// 0x1fffff7fc00001 + 0xffc00000 = 0x1fffffff800001
|
|
39
|
-
// 0x1fffffff800001 < Number.MAX_SAFE_INTEGER /*0x1fffffffffffff*/
|
|
40
|
-
if (opA & 0xffc00000 /*!== 0*/) result += (opA & 0xffc00000) * opB |0;
|
|
41
|
-
return result |0;
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
var {imul} = Math["imul"] || MathImulPolyfill;
|
|
45
|
-
|
|
46
|
-
function {hashingUtilFnName}(str, seed) {
|
|
47
|
-
var h1 = 0xdeadbeef ^ seed;
|
|
48
|
-
var h2 = 0x41c6ce57 ^ seed;
|
|
49
|
-
for (var i = 0, ch; i < str.length; i++) {
|
|
50
|
-
ch = str.charCodeAt(i);
|
|
51
|
-
h1 = {imul}(h1 ^ ch, 2654435761);
|
|
52
|
-
h2 = {imul}(h2 ^ ch, 1597334677);
|
|
53
|
-
}
|
|
54
|
-
h1 = {imul}(h1 ^ (h1>>>16), 2246822507) ^ {imul}(h2 ^ (h2>>>13), 3266489909);
|
|
55
|
-
h2 = {imul}(h2 ^ (h2>>>16), 2246822507) ^ {imul}(h1 ^ (h1>>>13), 3266489909);
|
|
56
|
-
return 4294967296 * (2097151 & h2) + (h1>>>0);
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
// Simple function that returns .toString() value with spaces replaced out
|
|
60
|
-
function {name}(fnObject, seed, regex={sensitivityRegex}){
|
|
61
|
-
var fnStringed = fnObject["toString"]()["replace"](regex, "");
|
|
62
|
-
return {hashingUtilFnName}(fnStringed, seed);
|
|
63
|
-
}
|
|
64
|
-
`).addSymbols(SKIP, MULTI_TRANSFORM);
|
|
1
|
+
import { MULTI_TRANSFORM, SKIP } from "../constants";
|
|
2
|
+
import Template from "./template";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Hashing Algorithm for Integrity: `cyrb53`
|
|
6
|
+
* @param str
|
|
7
|
+
* @param seed
|
|
8
|
+
*/
|
|
9
|
+
export function HashFunction(str: string, seed: number) {
|
|
10
|
+
let h1 = 0xdeadbeef ^ seed,
|
|
11
|
+
h2 = 0x41c6ce57 ^ seed;
|
|
12
|
+
for (let i = 0, ch; i < str.length; i++) {
|
|
13
|
+
ch = str.charCodeAt(i);
|
|
14
|
+
h1 = Math.imul(h1 ^ ch, 2654435761);
|
|
15
|
+
h2 = Math.imul(h2 ^ ch, 1597334677);
|
|
16
|
+
}
|
|
17
|
+
h1 =
|
|
18
|
+
Math.imul(h1 ^ (h1 >>> 16), 2246822507) ^
|
|
19
|
+
Math.imul(h2 ^ (h2 >>> 13), 3266489909);
|
|
20
|
+
h2 =
|
|
21
|
+
Math.imul(h2 ^ (h2 >>> 16), 2246822507) ^
|
|
22
|
+
Math.imul(h1 ^ (h1 >>> 13), 3266489909);
|
|
23
|
+
return 4294967296 * (2097151 & h2) + (h1 >>> 0);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// In template form to be inserted into code
|
|
27
|
+
export const HashTemplate = new Template(`
|
|
28
|
+
// Must be Function Declaration for hoisting
|
|
29
|
+
// Math.imul polyfill for ES5
|
|
30
|
+
function MathImulPolyfill(opA, opB){
|
|
31
|
+
opB |= 0; // ensure that opB is an integer. opA will automatically be coerced.
|
|
32
|
+
// floating points give us 53 bits of precision to work with plus 1 sign bit
|
|
33
|
+
// automatically handled for our convienence:
|
|
34
|
+
// 1. 0x003fffff /*opA & 0x000fffff*/ * 0x7fffffff /*opB*/ = 0x1fffff7fc00001
|
|
35
|
+
// 0x1fffff7fc00001 < Number.MAX_SAFE_INTEGER /*0x1fffffffffffff*/
|
|
36
|
+
var result = (opA & 0x003fffff) * opB;
|
|
37
|
+
// 2. We can remove an integer coersion from the statement above because:
|
|
38
|
+
// 0x1fffff7fc00001 + 0xffc00000 = 0x1fffffff800001
|
|
39
|
+
// 0x1fffffff800001 < Number.MAX_SAFE_INTEGER /*0x1fffffffffffff*/
|
|
40
|
+
if (opA & 0xffc00000 /*!== 0*/) result += (opA & 0xffc00000) * opB |0;
|
|
41
|
+
return result |0;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
var {imul} = Math["imul"] || MathImulPolyfill;
|
|
45
|
+
|
|
46
|
+
function {hashingUtilFnName}(str, seed) {
|
|
47
|
+
var h1 = 0xdeadbeef ^ seed;
|
|
48
|
+
var h2 = 0x41c6ce57 ^ seed;
|
|
49
|
+
for (var i = 0, ch; i < str.length; i++) {
|
|
50
|
+
ch = str.charCodeAt(i);
|
|
51
|
+
h1 = {imul}(h1 ^ ch, 2654435761);
|
|
52
|
+
h2 = {imul}(h2 ^ ch, 1597334677);
|
|
53
|
+
}
|
|
54
|
+
h1 = {imul}(h1 ^ (h1>>>16), 2246822507) ^ {imul}(h2 ^ (h2>>>13), 3266489909);
|
|
55
|
+
h2 = {imul}(h2 ^ (h2>>>16), 2246822507) ^ {imul}(h1 ^ (h1>>>13), 3266489909);
|
|
56
|
+
return 4294967296 * (2097151 & h2) + (h1>>>0);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
// Simple function that returns .toString() value with spaces replaced out
|
|
60
|
+
function {name}(fnObject, seed, regex={sensitivityRegex}){
|
|
61
|
+
var fnStringed = fnObject["toString"]()["replace"](regex, "");
|
|
62
|
+
return {hashingUtilFnName}(fnStringed, seed);
|
|
63
|
+
}
|
|
64
|
+
`).addSymbols(SKIP, MULTI_TRANSFORM);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import Template from "./template";
|
|
2
|
-
|
|
3
|
-
export const SetFunctionLengthTemplate = new Template(`
|
|
4
|
-
function {fnName}(fn, length = 1){
|
|
5
|
-
Object["defineProperty"](fn, "length", {
|
|
6
|
-
"value": length,
|
|
7
|
-
"configurable": false
|
|
8
|
-
});
|
|
9
|
-
return fn;
|
|
10
|
-
}
|
|
11
|
-
`);
|
|
1
|
+
import Template from "./template";
|
|
2
|
+
|
|
3
|
+
export const SetFunctionLengthTemplate = new Template(`
|
|
4
|
+
function {fnName}(fn, length = 1){
|
|
5
|
+
Object["defineProperty"](fn, "length", {
|
|
6
|
+
"value": length,
|
|
7
|
+
"configurable": false
|
|
8
|
+
});
|
|
9
|
+
return fn;
|
|
10
|
+
}
|
|
11
|
+
`);
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import Template from "./template";
|
|
2
|
-
|
|
3
|
-
export const StringCompressionTemplate = new Template(
|
|
4
|
-
`
|
|
5
|
-
var {stringFn};
|
|
6
|
-
|
|
7
|
-
(function (){
|
|
8
|
-
var compressedString = {stringValue};
|
|
9
|
-
var utf8String = {StringCompressionLibrary}["decompressFromUTF16"](compressedString);
|
|
10
|
-
var stringArray = utf8String["split"]({stringDelimiter});
|
|
11
|
-
|
|
12
|
-
{stringFn} = function(index){
|
|
13
|
-
return stringArray[index];
|
|
14
|
-
}
|
|
15
|
-
})();
|
|
16
|
-
`
|
|
17
|
-
);
|
|
18
|
-
|
|
19
|
-
export const StringCompressionLibraryMinified = `
|
|
20
|
-
var {StringCompressionLibrary}=function(){var r=String.fromCharCode,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",e={};function t(r,o){if(!e[r]){e[r]={};for(var n=0;n<r.length;n++)e[r][r.charAt(n)]=n}return e[r][o]}var i={compressToBase64:function(r){if(null==r)return"";var n=i._compress(r,6,function(r){return o.charAt(r)});switch(n.length%4){default:case 0:return n;case 1:return n+"===";case 2:return n+"==";case 3:return n+"="}},decompressFromBase64:function(r){return null==r?"":""==r?null:i._decompress(r.length,32,function(n){return t(o,r.charAt(n))})},compressToUTF16:function(o){return null==o?"":i._compress(o,15,function(o){return r(o+32)})+" "},decompressFromUTF16:function(r){return null==r?"":""==r?null:i._decompress(r.length,16384,function(o){return r.charCodeAt(o)-32})},compressToUint8Array:function(r){for(var o=i.compress(r),n=new Uint8Array(2*o.length),e=0,t=o.length;e<t;e++){var s=o.charCodeAt(e);n[2*e]=s>>>8,n[2*e+1]=s%256}return n},decompressFromUint8Array:function(o){if(null==o)return i.decompress(o);for(var n=new Array(o.length/2),e=0,t=n.length;e<t;e++)n[e]=256*o[2*e]+o[2*e+1];var s=[];return n.forEach(function(o){s.push(r(o))}),i.decompress(s.join(""))},compressToEncodedURIComponent:function(r){return null==r?"":i._compress(r,6,function(r){return n.charAt(r)})},decompressFromEncodedURIComponent:function(r){return null==r?"":""==r?null:(r=r.replace(/ /g,"+"),i._decompress(r.length,32,function(o){return t(n,r.charAt(o))}))},compress:function(o){return i._compress(o,16,function(o){return r(o)})},_compress:function(r,o,n){if(null==r)return"";var e,t,i,s={},u={},a="",p="",c="",l=2,f=3,h=2,d=[],m=0,v=0;for(i=0;i<r.length;i+=1)if(a=r.charAt(i),Object.prototype.hasOwnProperty.call(s,a)||(s[a]=f++,u[a]=!0),p=c+a,Object.prototype.hasOwnProperty.call(s,p))c=p;else{if(Object.prototype.hasOwnProperty.call(u,c)){if(c.charCodeAt(0)<256){for(e=0;e<h;e++)m<<=1,v==o-1?(v=0,d.push(n(m)),m=0):v++;for(t=c.charCodeAt(0),e=0;e<8;e++)m=m<<1|1&t,v==o-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}else{for(t=1,e=0;e<h;e++)m=m<<1|t,v==o-1?(v=0,d.push(n(m)),m=0):v++,t=0;for(t=c.charCodeAt(0),e=0;e<16;e++)m=m<<1|1&t,v==o-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}0==--l&&(l=Math.pow(2,h),h++),delete u[c]}else for(t=s[c],e=0;e<h;e++)m=m<<1|1&t,v==o-1?(v=0,d.push(n(m)),m=0):v++,t>>=1;0==--l&&(l=Math.pow(2,h),h++),s[p]=f++,c=String(a)}if(""!==c){if(Object.prototype.hasOwnProperty.call(u,c)){if(c.charCodeAt(0)<256){for(e=0;e<h;e++)m<<=1,v==o-1?(v=0,d.push(n(m)),m=0):v++;for(t=c.charCodeAt(0),e=0;e<8;e++)m=m<<1|1&t,v==o-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}else{for(t=1,e=0;e<h;e++)m=m<<1|t,v==o-1?(v=0,d.push(n(m)),m=0):v++,t=0;for(t=c.charCodeAt(0),e=0;e<16;e++)m=m<<1|1&t,v==o-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}0==--l&&(l=Math.pow(2,h),h++),delete u[c]}else for(t=s[c],e=0;e<h;e++)m=m<<1|1&t,v==o-1?(v=0,d.push(n(m)),m=0):v++,t>>=1;0==--l&&(l=Math.pow(2,h),h++)}for(t=2,e=0;e<h;e++)m=m<<1|1&t,v==o-1?(v=0,d.push(n(m)),m=0):v++,t>>=1;for(;;){if(m<<=1,v==o-1){d.push(n(m));break}v++}return d.join("")},decompress:function(r){return null==r?"":""==r?null:i._decompress(r.length,32768,function(o){return r.charCodeAt(o)})},_decompress:function(o,n,e){var t,i,s,u,a,p,c,l=[],f=4,h=4,d=3,m="",v=[],g={val:e(0),position:n,index:1};for(t=0;t<3;t+=1)l[t]=t;for(s=0,a=Math.pow(2,2),p=1;p!=a;)u=g.val&g.position,g.position>>=1,0==g.position&&(g.position=n,g.val=e(g.index++)),s|=(u>0?1:0)*p,p<<=1;switch(s){case 0:for(s=0,a=Math.pow(2,8),p=1;p!=a;)u=g.val&g.position,g.position>>=1,0==g.position&&(g.position=n,g.val=e(g.index++)),s|=(u>0?1:0)*p,p<<=1;c=r(s);break;case 1:for(s=0,a=Math.pow(2,16),p=1;p!=a;)u=g.val&g.position,g.position>>=1,0==g.position&&(g.position=n,g.val=e(g.index++)),s|=(u>0?1:0)*p,p<<=1;c=r(s);break;case 2:return""}for(l[3]=c,i=c,v.push(c);;){if(g.index>o)return"";for(s=0,a=Math.pow(2,d),p=1;p!=a;)u=g.val&g.position,g.position>>=1,0==g.position&&(g.position=n,g.val=e(g.index++)),s|=(u>0?1:0)*p,p<<=1;switch(c=s){case 0:for(s=0,a=Math.pow(2,8),p=1;p!=a;)u=g.val&g.position,g.position>>=1,0==g.position&&(g.position=n,g.val=e(g.index++)),s|=(u>0?1:0)*p,p<<=1;l[h++]=r(s),c=h-1,f--;break;case 1:for(s=0,a=Math.pow(2,16),p=1;p!=a;)u=g.val&g.position,g.position>>=1,0==g.position&&(g.position=n,g.val=e(g.index++)),s|=(u>0?1:0)*p,p<<=1;l[h++]=r(s),c=h-1,f--;break;case 2:return v.join("")}if(0==f&&(f=Math.pow(2,d),d++),l[c])m=l[c];else{if(c!==h)return null;m=i+i.charAt(0)}v.push(m),l[h++]=i+m.charAt(0),i=m,0==--f&&(f=Math.pow(2,d),d++)}}};return i}();"function"==typeof define&&define.amd?define(function(){return {StringCompressionLibrary}}):"undefined"!=typeof module&&null!=module?module.exports={StringCompressionLibrary}:"undefined"!=typeof angular&&null!=angular&&angular.module("LZString",[]).factory("LZString",function(){return {StringCompressionLibrary}});`;
|
|
1
|
+
import Template from "./template";
|
|
2
|
+
|
|
3
|
+
export const StringCompressionTemplate = new Template(
|
|
4
|
+
`
|
|
5
|
+
var {stringFn};
|
|
6
|
+
|
|
7
|
+
(function (){
|
|
8
|
+
var compressedString = {stringValue};
|
|
9
|
+
var utf8String = {StringCompressionLibrary}["decompressFromUTF16"](compressedString);
|
|
10
|
+
var stringArray = utf8String["split"]({stringDelimiter});
|
|
11
|
+
|
|
12
|
+
{stringFn} = function(index){
|
|
13
|
+
return stringArray[index];
|
|
14
|
+
}
|
|
15
|
+
})();
|
|
16
|
+
`
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
export const StringCompressionLibraryMinified = `
|
|
20
|
+
var {StringCompressionLibrary}=function(){var r=String.fromCharCode,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",e={};function t(r,o){if(!e[r]){e[r]={};for(var n=0;n<r.length;n++)e[r][r.charAt(n)]=n}return e[r][o]}var i={compressToBase64:function(r){if(null==r)return"";var n=i._compress(r,6,function(r){return o.charAt(r)});switch(n.length%4){default:case 0:return n;case 1:return n+"===";case 2:return n+"==";case 3:return n+"="}},decompressFromBase64:function(r){return null==r?"":""==r?null:i._decompress(r.length,32,function(n){return t(o,r.charAt(n))})},compressToUTF16:function(o){return null==o?"":i._compress(o,15,function(o){return r(o+32)})+" "},decompressFromUTF16:function(r){return null==r?"":""==r?null:i._decompress(r.length,16384,function(o){return r.charCodeAt(o)-32})},compressToUint8Array:function(r){for(var o=i.compress(r),n=new Uint8Array(2*o.length),e=0,t=o.length;e<t;e++){var s=o.charCodeAt(e);n[2*e]=s>>>8,n[2*e+1]=s%256}return n},decompressFromUint8Array:function(o){if(null==o)return i.decompress(o);for(var n=new Array(o.length/2),e=0,t=n.length;e<t;e++)n[e]=256*o[2*e]+o[2*e+1];var s=[];return n.forEach(function(o){s.push(r(o))}),i.decompress(s.join(""))},compressToEncodedURIComponent:function(r){return null==r?"":i._compress(r,6,function(r){return n.charAt(r)})},decompressFromEncodedURIComponent:function(r){return null==r?"":""==r?null:(r=r.replace(/ /g,"+"),i._decompress(r.length,32,function(o){return t(n,r.charAt(o))}))},compress:function(o){return i._compress(o,16,function(o){return r(o)})},_compress:function(r,o,n){if(null==r)return"";var e,t,i,s={},u={},a="",p="",c="",l=2,f=3,h=2,d=[],m=0,v=0;for(i=0;i<r.length;i+=1)if(a=r.charAt(i),Object.prototype.hasOwnProperty.call(s,a)||(s[a]=f++,u[a]=!0),p=c+a,Object.prototype.hasOwnProperty.call(s,p))c=p;else{if(Object.prototype.hasOwnProperty.call(u,c)){if(c.charCodeAt(0)<256){for(e=0;e<h;e++)m<<=1,v==o-1?(v=0,d.push(n(m)),m=0):v++;for(t=c.charCodeAt(0),e=0;e<8;e++)m=m<<1|1&t,v==o-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}else{for(t=1,e=0;e<h;e++)m=m<<1|t,v==o-1?(v=0,d.push(n(m)),m=0):v++,t=0;for(t=c.charCodeAt(0),e=0;e<16;e++)m=m<<1|1&t,v==o-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}0==--l&&(l=Math.pow(2,h),h++),delete u[c]}else for(t=s[c],e=0;e<h;e++)m=m<<1|1&t,v==o-1?(v=0,d.push(n(m)),m=0):v++,t>>=1;0==--l&&(l=Math.pow(2,h),h++),s[p]=f++,c=String(a)}if(""!==c){if(Object.prototype.hasOwnProperty.call(u,c)){if(c.charCodeAt(0)<256){for(e=0;e<h;e++)m<<=1,v==o-1?(v=0,d.push(n(m)),m=0):v++;for(t=c.charCodeAt(0),e=0;e<8;e++)m=m<<1|1&t,v==o-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}else{for(t=1,e=0;e<h;e++)m=m<<1|t,v==o-1?(v=0,d.push(n(m)),m=0):v++,t=0;for(t=c.charCodeAt(0),e=0;e<16;e++)m=m<<1|1&t,v==o-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}0==--l&&(l=Math.pow(2,h),h++),delete u[c]}else for(t=s[c],e=0;e<h;e++)m=m<<1|1&t,v==o-1?(v=0,d.push(n(m)),m=0):v++,t>>=1;0==--l&&(l=Math.pow(2,h),h++)}for(t=2,e=0;e<h;e++)m=m<<1|1&t,v==o-1?(v=0,d.push(n(m)),m=0):v++,t>>=1;for(;;){if(m<<=1,v==o-1){d.push(n(m));break}v++}return d.join("")},decompress:function(r){return null==r?"":""==r?null:i._decompress(r.length,32768,function(o){return r.charCodeAt(o)})},_decompress:function(o,n,e){var t,i,s,u,a,p,c,l=[],f=4,h=4,d=3,m="",v=[],g={val:e(0),position:n,index:1};for(t=0;t<3;t+=1)l[t]=t;for(s=0,a=Math.pow(2,2),p=1;p!=a;)u=g.val&g.position,g.position>>=1,0==g.position&&(g.position=n,g.val=e(g.index++)),s|=(u>0?1:0)*p,p<<=1;switch(s){case 0:for(s=0,a=Math.pow(2,8),p=1;p!=a;)u=g.val&g.position,g.position>>=1,0==g.position&&(g.position=n,g.val=e(g.index++)),s|=(u>0?1:0)*p,p<<=1;c=r(s);break;case 1:for(s=0,a=Math.pow(2,16),p=1;p!=a;)u=g.val&g.position,g.position>>=1,0==g.position&&(g.position=n,g.val=e(g.index++)),s|=(u>0?1:0)*p,p<<=1;c=r(s);break;case 2:return""}for(l[3]=c,i=c,v.push(c);;){if(g.index>o)return"";for(s=0,a=Math.pow(2,d),p=1;p!=a;)u=g.val&g.position,g.position>>=1,0==g.position&&(g.position=n,g.val=e(g.index++)),s|=(u>0?1:0)*p,p<<=1;switch(c=s){case 0:for(s=0,a=Math.pow(2,8),p=1;p!=a;)u=g.val&g.position,g.position>>=1,0==g.position&&(g.position=n,g.val=e(g.index++)),s|=(u>0?1:0)*p,p<<=1;l[h++]=r(s),c=h-1,f--;break;case 1:for(s=0,a=Math.pow(2,16),p=1;p!=a;)u=g.val&g.position,g.position>>=1,0==g.position&&(g.position=n,g.val=e(g.index++)),s|=(u>0?1:0)*p,p<<=1;l[h++]=r(s),c=h-1,f--;break;case 2:return v.join("")}if(0==f&&(f=Math.pow(2,d),d++),l[c])m=l[c];else{if(c!==h)return null;m=i+i.charAt(0)}v.push(m),l[h++]=i+m.charAt(0),i=m,0==--f&&(f=Math.pow(2,d),d++)}}};return i}();"function"==typeof define&&define.amd?define(function(){return {StringCompressionLibrary}}):"undefined"!=typeof module&&null!=module?module.exports={StringCompressionLibrary}:"undefined"!=typeof angular&&null!=angular&&angular.module("LZString",[]).factory("LZString",function(){return {StringCompressionLibrary}});`;
|
|
@@ -1,120 +1,120 @@
|
|
|
1
|
-
import { NodePath } from "@babel/traverse";
|
|
2
|
-
import { PluginInstance } from "../transforms/plugin";
|
|
3
|
-
import Template from "./template";
|
|
4
|
-
import {
|
|
5
|
-
MULTI_TRANSFORM,
|
|
6
|
-
placeholderVariablePrefix,
|
|
7
|
-
UNSAFE,
|
|
8
|
-
} from "../constants";
|
|
9
|
-
|
|
10
|
-
export const StrictModeTemplate = new Template(`
|
|
11
|
-
(function(){
|
|
12
|
-
function isStrictMode(){
|
|
13
|
-
try {
|
|
14
|
-
var arr = []
|
|
15
|
-
delete arr["length"]
|
|
16
|
-
} catch(e) {
|
|
17
|
-
return true;
|
|
18
|
-
}
|
|
19
|
-
return false;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
if(isStrictMode()) {
|
|
23
|
-
{countermeasures}
|
|
24
|
-
{nativeFunctionName} = undefined;
|
|
25
|
-
}
|
|
26
|
-
})()
|
|
27
|
-
`);
|
|
28
|
-
|
|
29
|
-
export const IndexOfTemplate = new Template(`
|
|
30
|
-
function indexOf(str, substr) {
|
|
31
|
-
const len = str.length;
|
|
32
|
-
const sublen = substr.length;
|
|
33
|
-
let count = 0;
|
|
34
|
-
|
|
35
|
-
if (sublen > len) {
|
|
36
|
-
return -1;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
for (let i = 0; i <= len - sublen; i++) {
|
|
40
|
-
for (let j = 0; j < sublen; j++) {
|
|
41
|
-
if (str[i + j] === substr[j]) {
|
|
42
|
-
count++;
|
|
43
|
-
if (count === sublen) {
|
|
44
|
-
return i;
|
|
45
|
-
}
|
|
46
|
-
} else {
|
|
47
|
-
count = 0;
|
|
48
|
-
break;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return -1;
|
|
54
|
-
}
|
|
55
|
-
`);
|
|
56
|
-
|
|
57
|
-
export const NativeFunctionTemplate = new Template(`
|
|
58
|
-
function {nativeFunctionName}() {
|
|
59
|
-
{IndexOfTemplate}
|
|
60
|
-
|
|
61
|
-
function checkFunction(fn) {
|
|
62
|
-
if (
|
|
63
|
-
indexOf("" + fn, "{ [native code] }") === -1 ||
|
|
64
|
-
typeof Object.getOwnPropertyDescriptor(fn, "toString") !== "undefined"
|
|
65
|
-
) {
|
|
66
|
-
{countermeasures}
|
|
67
|
-
|
|
68
|
-
return undefined;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
return fn;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
var args = arguments;
|
|
75
|
-
if (args.length === 1) {
|
|
76
|
-
return checkFunction(args[0]);
|
|
77
|
-
} else if (args.length === 2) {
|
|
78
|
-
var object = args[0];
|
|
79
|
-
var property = args[1];
|
|
80
|
-
|
|
81
|
-
var fn = object[property];
|
|
82
|
-
fn = checkFunction(fn);
|
|
83
|
-
|
|
84
|
-
return fn.bind(object);
|
|
85
|
-
}
|
|
86
|
-
}`).addSymbols(UNSAFE, MULTI_TRANSFORM);
|
|
87
|
-
|
|
88
|
-
export const createEvalIntegrityTemplate = (
|
|
89
|
-
pluginInstance: PluginInstance,
|
|
90
|
-
path: NodePath
|
|
91
|
-
) => {
|
|
92
|
-
if (pluginInstance.options.lock?.tamperProtection) {
|
|
93
|
-
return new Template(`
|
|
94
|
-
function {EvalIntegrityName}(){
|
|
95
|
-
var localVar = false;
|
|
96
|
-
eval(__JS_CONFUSER_VAR__(localVar) + " = true")
|
|
97
|
-
|
|
98
|
-
if (!localVar) {
|
|
99
|
-
// Eval was tampered!
|
|
100
|
-
{countermeasures}
|
|
101
|
-
|
|
102
|
-
return false;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
return true;
|
|
106
|
-
}
|
|
107
|
-
`)
|
|
108
|
-
.addSymbols(UNSAFE)
|
|
109
|
-
.setDefaultVariables({
|
|
110
|
-
countermeasures:
|
|
111
|
-
pluginInstance.globalState.lock.createCountermeasuresCode(),
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
return new Template(`
|
|
116
|
-
function {EvalIntegrityName}(${placeholderVariablePrefix}_flag = true){
|
|
117
|
-
return ${placeholderVariablePrefix}_flag;
|
|
118
|
-
}
|
|
119
|
-
`);
|
|
120
|
-
};
|
|
1
|
+
import { NodePath } from "@babel/traverse";
|
|
2
|
+
import { PluginInstance } from "../transforms/plugin";
|
|
3
|
+
import Template from "./template";
|
|
4
|
+
import {
|
|
5
|
+
MULTI_TRANSFORM,
|
|
6
|
+
placeholderVariablePrefix,
|
|
7
|
+
UNSAFE,
|
|
8
|
+
} from "../constants";
|
|
9
|
+
|
|
10
|
+
export const StrictModeTemplate = new Template(`
|
|
11
|
+
(function(){
|
|
12
|
+
function isStrictMode(){
|
|
13
|
+
try {
|
|
14
|
+
var arr = []
|
|
15
|
+
delete arr["length"]
|
|
16
|
+
} catch(e) {
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if(isStrictMode()) {
|
|
23
|
+
{countermeasures}
|
|
24
|
+
{nativeFunctionName} = undefined;
|
|
25
|
+
}
|
|
26
|
+
})()
|
|
27
|
+
`);
|
|
28
|
+
|
|
29
|
+
export const IndexOfTemplate = new Template(`
|
|
30
|
+
function indexOf(str, substr) {
|
|
31
|
+
const len = str.length;
|
|
32
|
+
const sublen = substr.length;
|
|
33
|
+
let count = 0;
|
|
34
|
+
|
|
35
|
+
if (sublen > len) {
|
|
36
|
+
return -1;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
for (let i = 0; i <= len - sublen; i++) {
|
|
40
|
+
for (let j = 0; j < sublen; j++) {
|
|
41
|
+
if (str[i + j] === substr[j]) {
|
|
42
|
+
count++;
|
|
43
|
+
if (count === sublen) {
|
|
44
|
+
return i;
|
|
45
|
+
}
|
|
46
|
+
} else {
|
|
47
|
+
count = 0;
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return -1;
|
|
54
|
+
}
|
|
55
|
+
`);
|
|
56
|
+
|
|
57
|
+
export const NativeFunctionTemplate = new Template(`
|
|
58
|
+
function {nativeFunctionName}() {
|
|
59
|
+
{IndexOfTemplate}
|
|
60
|
+
|
|
61
|
+
function checkFunction(fn) {
|
|
62
|
+
if (
|
|
63
|
+
indexOf("" + fn, "{ [native code] }") === -1 ||
|
|
64
|
+
typeof Object.getOwnPropertyDescriptor(fn, "toString") !== "undefined"
|
|
65
|
+
) {
|
|
66
|
+
{countermeasures}
|
|
67
|
+
|
|
68
|
+
return undefined;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return fn;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
var args = arguments;
|
|
75
|
+
if (args.length === 1) {
|
|
76
|
+
return checkFunction(args[0]);
|
|
77
|
+
} else if (args.length === 2) {
|
|
78
|
+
var object = args[0];
|
|
79
|
+
var property = args[1];
|
|
80
|
+
|
|
81
|
+
var fn = object[property];
|
|
82
|
+
fn = checkFunction(fn);
|
|
83
|
+
|
|
84
|
+
return fn.bind(object);
|
|
85
|
+
}
|
|
86
|
+
}`).addSymbols(UNSAFE, MULTI_TRANSFORM);
|
|
87
|
+
|
|
88
|
+
export const createEvalIntegrityTemplate = (
|
|
89
|
+
pluginInstance: PluginInstance,
|
|
90
|
+
path: NodePath
|
|
91
|
+
) => {
|
|
92
|
+
if (pluginInstance.options.lock?.tamperProtection) {
|
|
93
|
+
return new Template(`
|
|
94
|
+
function {EvalIntegrityName}(){
|
|
95
|
+
var localVar = false;
|
|
96
|
+
eval(__JS_CONFUSER_VAR__(localVar) + " = true")
|
|
97
|
+
|
|
98
|
+
if (!localVar) {
|
|
99
|
+
// Eval was tampered!
|
|
100
|
+
{countermeasures}
|
|
101
|
+
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
107
|
+
`)
|
|
108
|
+
.addSymbols(UNSAFE)
|
|
109
|
+
.setDefaultVariables({
|
|
110
|
+
countermeasures:
|
|
111
|
+
pluginInstance.globalState.lock.createCountermeasuresCode(),
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return new Template(`
|
|
116
|
+
function {EvalIntegrityName}(${placeholderVariablePrefix}_flag = true){
|
|
117
|
+
return ${placeholderVariablePrefix}_flag;
|
|
118
|
+
}
|
|
119
|
+
`);
|
|
120
|
+
};
|