js-confuser 2.0.0-alpha.4 → 2.0.0
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/workflows/node.js.yml +1 -1
- package/CHANGELOG.md +10 -12
- package/Migration.md +2 -1
- package/README.md +20 -12
- package/dist/constants.js +2 -4
- package/dist/index.js +6 -1
- package/dist/transforms/controlFlowFlattening.js +92 -64
- package/dist/transforms/lock/integrity.js +3 -1
- package/dist/transforms/lock/lock.js +1 -1
- package/dist/transforms/pack.js +4 -0
- package/dist/transforms/plugin.js +12 -3
- package/dist/transforms/string/stringConcealing.js +7 -1
- package/dist/utils/ast-utils.js +15 -33
- package/package.json +2 -2
- package/src/constants.ts +2 -2
- package/src/index.ts +6 -1
- package/src/templates/integrityTemplate.ts +1 -1
- package/src/transforms/controlFlowFlattening.ts +116 -86
- package/src/transforms/flatten.ts +0 -2
- package/src/transforms/lock/integrity.ts +5 -2
- package/src/transforms/lock/lock.ts +1 -8
- package/src/transforms/pack.ts +8 -0
- package/src/transforms/plugin.ts +19 -9
- package/src/transforms/string/stringConcealing.ts +15 -1
- package/src/utils/ast-utils.ts +10 -21
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
# `2.0.0
|
|
2
|
-
2.0 Rewrite
|
|
3
|
-
|
|
4
|
-
**⚠️ Warning: This an alpha release. This version is not stable and the likelihood of encountering bugs is significantly higher.**
|
|
1
|
+
# `2.0.0`
|
|
2
|
+
2.0 Rewrite 🎉
|
|
5
3
|
|
|
6
4
|
### Complete rewrite of JS-Confuser using Babel! 🎉
|
|
7
5
|
|
|
@@ -37,11 +35,11 @@ const options = {
|
|
|
37
35
|
|
|
38
36
|
### 2.0 Changes
|
|
39
37
|
|
|
40
|
-
- Added [Custom String Encoding](https://
|
|
38
|
+
- Added [Custom String Encoding](https://js-confuser.com/docs/options/customStringEncodings) and [Custom Lock Code](https://js-confuser.com/docs/options/customLocks) options
|
|
41
39
|
|
|
42
|
-
- Added `Rename Labels` [Learn more here](https://
|
|
40
|
+
- Added `Rename Labels` [Learn more here](https://js-confuser.com/docs/options/renamelabels#rename-labels)
|
|
43
41
|
|
|
44
|
-
- Added `Pack` [Learn more here](https://
|
|
42
|
+
- Added `Pack` [Learn more here](https://js-confuser.com/docs/options/pack#pack)
|
|
45
43
|
|
|
46
44
|
- RGF no longers uses `new Function` instead uses `eval`
|
|
47
45
|
|
|
@@ -71,7 +69,7 @@ const options = {
|
|
|
71
69
|
|
|
72
70
|
- New Comment Syntax
|
|
73
71
|
|
|
74
|
-
- - `/* @js-confuser-var */ "name"` for improved variable mappings
|
|
72
|
+
- - `/* @js-confuser-var */ "name"` for improved variable mappings, such as eval() calls
|
|
75
73
|
|
|
76
74
|
```js
|
|
77
75
|
// Input
|
|
@@ -83,19 +81,19 @@ var zC3PLKu = "Internet User";
|
|
|
83
81
|
eval("console.log(" + "zC3PLKu" + ")");
|
|
84
82
|
```
|
|
85
83
|
|
|
86
|
-
The function `__JS_CONFUSER_VAR__` is
|
|
84
|
+
Note: The function `__JS_CONFUSER_VAR__` is still supported.
|
|
87
85
|
|
|
88
86
|
### JS-Confuser.com Revamp
|
|
89
87
|
|
|
90
88
|
A new UI for [JS-Confuser.com](https://js-confuser.com), featuring an advanced playground and documentation pages.
|
|
91
89
|
|
|
92
|
-
The previous version will remain available
|
|
90
|
+
The previous version will remain available at [old--confuser.netlify.com](https://old--confuser.netlify.app/).
|
|
93
91
|
|
|
94
92
|
**Removed features**
|
|
95
93
|
|
|
96
94
|
- Removed `ES5` option - Use Babel Instead
|
|
97
95
|
|
|
98
|
-
- Removed `Browser Lock` and `OS Lock` - Use [Custom Locks](https://
|
|
96
|
+
- Removed `Browser Lock` and `OS Lock` - Use [Custom Locks](https://js-confuser.com/docs/options/customlocks#custom-locks) instead
|
|
99
97
|
|
|
100
98
|
- Removed `Shuffle`'s Hash option
|
|
101
99
|
|
|
@@ -134,7 +132,7 @@ eval('console.log(' + 'CA1HU0' + ')');
|
|
|
134
132
|
|
|
135
133
|
- Improve `String Compression`
|
|
136
134
|
|
|
137
|
-
- New Web UI sneak peak: https://
|
|
135
|
+
- New Web UI sneak peak: https://js-confuser.com/
|
|
138
136
|
|
|
139
137
|
|
|
140
138
|
# `1.7.2`
|
package/Migration.md
CHANGED
|
@@ -9,6 +9,7 @@ JS-Confuser 2.0 is complete rewrite of the original JS-Confuser created in 2020!
|
|
|
9
9
|
The method `JSConfuser.obfuscate()` resolves to a object now instead of a string. This result object contains a property `code` which is the obfuscated code.
|
|
10
10
|
|
|
11
11
|
```diff
|
|
12
|
+
const JSConfuser = require("js-confuser");
|
|
12
13
|
const sourceCode = `console.log("Hello World")`;
|
|
13
14
|
const options = {
|
|
14
15
|
target: "node",
|
|
@@ -47,7 +48,7 @@ These features have been removed but you can still add these locks using the `lo
|
|
|
47
48
|
// Must be placed in a Block or Switch Case body
|
|
48
49
|
`,
|
|
49
50
|
percentagePerBlock: 0.1, // = 10%
|
|
50
|
-
maxCount:
|
|
51
|
+
maxCount: 25, // Default = 25 - You probably don't want an excessive amount placed
|
|
51
52
|
minCount: 1 // Default = 1 - Ensures this custom lock is placed
|
|
52
53
|
}
|
|
53
54
|
]
|
package/README.md
CHANGED
|
@@ -1,29 +1,37 @@
|
|
|
1
1
|
# JS Confuser
|
|
2
2
|
|
|
3
|
-
**⚠️ Warning: This an alpha release. This version is not stable and the likelihood of encountering bugs is significantly higher.**
|
|
4
|
-
|
|
5
3
|
JS-Confuser is a JavaScript obfuscation tool to make your programs _impossible_ to read. [Try the web version](https://js-confuser.com).
|
|
6
4
|
|
|
7
5
|
[](https://npmjs.com/package/js-confuser) [](https://github.com/MichaelXF/js-confuser) [](https://js-confuser.com)
|
|
8
6
|
|
|
7
|
+
## Key features
|
|
8
|
+
|
|
9
|
+
- Variable renaming
|
|
10
|
+
- Control Flow obfuscation
|
|
11
|
+
- String concealing
|
|
12
|
+
- Function obfuscation
|
|
13
|
+
- Locks (domainLock, date)
|
|
14
|
+
- [Detect changes to source code](https://new--confuser.netlify.app/docs/options/integrity#integrity)
|
|
15
|
+
|
|
16
|
+
## Documentation
|
|
9
17
|
|
|
10
|
-
|
|
18
|
+
Get started in the [`JS-Confuser Docs`](https://js-confuser.com/docs/).
|
|
11
19
|
|
|
12
|
-
- [Getting Started](https://
|
|
20
|
+
- [Getting Started](https://js-confuser.com/docs)
|
|
13
21
|
|
|
14
|
-
- - [What is Obfuscation?](https://
|
|
22
|
+
- - [What is Obfuscation?](https://js-confuser.com/docs/getting-started/what-is-obfuscation)
|
|
15
23
|
|
|
16
|
-
- - [Playground](https://
|
|
24
|
+
- - [Playground](https://js-confuser.com/docs/getting-started/playground)
|
|
17
25
|
|
|
18
|
-
- - [Installation](https://
|
|
26
|
+
- - [Installation](https://js-confuser.com/docs/getting-started/installation)
|
|
19
27
|
|
|
20
|
-
- - [Usage](https://
|
|
28
|
+
- - [Usage](https://js-confuser.com/docs/getting-started/usage)
|
|
21
29
|
|
|
22
|
-
- - [FAQ](https://
|
|
30
|
+
- - [FAQ](https://js-confuser.com/docs/getting-started/faq)
|
|
23
31
|
|
|
24
|
-
- [Options](https://
|
|
32
|
+
- [Options](https://js-confuser.com/docs/options)
|
|
25
33
|
|
|
26
|
-
- [Presets](https://
|
|
34
|
+
- [Presets](https://js-confuser.com/docs/presets)
|
|
27
35
|
|
|
28
36
|
## API Usage
|
|
29
37
|
|
|
@@ -61,7 +69,7 @@ JsConfuser.obfuscate(`
|
|
|
61
69
|
})
|
|
62
70
|
|
|
63
71
|
/*
|
|
64
|
-
var AF59rI,ZgbbeaU,WDgj3I,gpR2qG,Ox61sk,pTNPNpX;AF59rI=[60,17,25,416,22,23,83,26,27,28,18,382,66,29,30,31,2,5,33,4,13,16,10,11,24,1,3,15,6,7,8,167,50,9,21,35,12,14,116],ZgbbeaU=AF59rI;for(var TlMIASm=62;TlMIASm;TlMIASm--)ZgbbeaU.unshift(ZgbbeaU.pop());WDgj3I=MBh_HcM("length1charCodeAt1slice1replaĕ1!ğğ1uģģ1<~A8bt#D.RU,~>Ħ~E,ol,ATMnijĵ@rH7+DertŀħDKTtlBhE[ŋ~@q]:k6Z6LHŖ6$*Ŗ7n#j;20AŖ;g3Cn<]'Ŗ<Fna!Cii#ŖAU&0.Eb0;TŖ4ƌĴħ3rƍ)eVMBK\\!Ŗ+=M;Q@;]UaŖž=3&.0Ŗ/M2-WEcYr5ŖD?ƯTqŸb>-Q:c8Ŗ?SF2m2*!WQŖ2)RIJƐ~ž<ƿĴmČuĀ1 (local)").split('1');function pprWr0(ZgbbeaU){var WDgj3I,gpR2qG,Ox61sk,pTNPNpX,TlMIASm,pprWr0,M1ClYmT,kHWl72,xw_ohrD,sT8e3fv,bxd0KVG;WDgj3I=void 0,gpR2qG=void 0,Ox61sk=void 0,pTNPNpX=void 0,TlMIASm=void 0,pprWr0=String,M1ClYmT=CVH25o3(0),kHWl72=255,xw_ohrD=CVH25o3(1),sT8e3fv=CVH25o3(AF59rI[0]),bxd0KVG=CVH25o3(3);for('<~'===ZgbbeaU[sT8e3fv](0,AF59rI[0])&&'~>'===ZgbbeaU[sT8e3fv](-AF59rI[0]),ZgbbeaU=ZgbbeaU[sT8e3fv](AF59rI[0],-AF59rI[0])[bxd0KVG](/s/g,'')[bxd0KVG]('z',CVH25o3(AF59rI[3])),WDgj3I=CVH25o3(AF59rI[1])[sT8e3fv](ZgbbeaU[M1ClYmT]%AF59rI[1]||AF59rI[1]),ZgbbeaU+=WDgj3I,Ox61sk=[],pTNPNpX=0,TlMIASm=ZgbbeaU[M1ClYmT];TlMIASm>pTNPNpX;pTNPNpX+=AF59rI[1])gpR2qG=52200625*(ZgbbeaU[xw_ohrD](pTNPNpX)-AF59rI[2])+614125*(ZgbbeaU[xw_ohrD](pTNPNpX+AF59rI[9])-AF59rI[2])+7225*(ZgbbeaU[xw_ohrD](pTNPNpX+AF59rI[0])-AF59rI[2])+85*(ZgbbeaU[xw_ohrD](pTNPNpX+AF59rI[10])-AF59rI[2])+(ZgbbeaU[xw_ohrD](pTNPNpX+AF59rI[3])-AF59rI[2]),Ox61sk.push(kHWl72&gpR2qG>>AF59rI[8],kHWl72&gpR2qG>>AF59rI[5],kHWl72&gpR2qG>>8,kHWl72&gpR2qG);return function(ZgbbeaU,Ox61sk){for(var WDgj3I=Ox61sk;WDgj3I>0;WDgj3I--)ZgbbeaU.pop()}(Ox61sk,WDgj3I[M1ClYmT]),pprWr0.fromCharCode.apply(pprWr0,Ox61sk)}gpR2qG=[CVH25o3(AF59rI[12]),CVH25o3(AF59rI[13]),CVH25o3(8),CVH25o3(AF59rI[17]),CVH25o3(AF59rI[6]),CVH25o3(AF59rI[7]),CVH25o3(AF59rI[20]),'<~AQO1jBl7V~>',CVH25o3(AF59rI[4]),CVH25o3(AF59rI[21]),CVH25o3(AF59rI[4]),CVH25o3(9),CVH25o3(AF59rI[11]),CVH25o3(AF59rI[5]),CVH25o3(AF59rI[24]),CVH25o3(AF59rI[33]),'<~E%u9/13QC~>',CVH25o3(AF59rI[6]),CVH25o3(AF59rI[7]),CVH25o3(19),CVH25o3(20),CVH25o3(AF59rI[18]),CVH25o3(AF59rI[27]),CVH25o3(AF59rI[28]),CVH25o3(AF59rI[8]),'<~?T9_t1,(IC~>','<~1bpf~>',CVH25o3(AF59rI[25]),CVH25o3(AF59rI[30]),CVH25o3(AF59rI[31]),CVH25o3(14),CVH25o3(AF59rI[8])];function M1ClYmT(AF59rI){return pprWr0(gpR2qG[AF59rI])}function kHWl72(){try{return global}catch(AF59rI){return this}}Ox61sk=kHWl72.call(this);function xw_ohrD(ZgbbeaU){switch(ZgbbeaU){case 608:return Ox61sk[M1ClYmT(0)];case-884:return Ox61sk[CVH25o3(AF59rI[32])];case AF59rI[26]:return Ox61sk[M1ClYmT(AF59rI[9])];case-AF59rI[35]:return Ox61sk[M1ClYmT(2)]}}function sT8e3fv(ZgbbeaU,WDgj3I,gpR2qG){var Ox61sk;Ox61sk=11;while(Ox61sk!=51){var pTNPNpX,TlMIASm,pprWr0,kHWl72;pTNPNpX=Ox61sk*-244+217;switch(pTNPNpX){case-2467:TlMIASm=false,Ox61sk+=37;break;case-4175:kHWl72=WDgj3I==M1ClYmT(AF59rI[10])&&ziPI9L.qzUvJu1[M1ClYmT(4)+M1ClYmT(AF59rI[1])](AF59rI[9])==48?function(...WDgj3I){var gpR2qG;gpR2qG=AF59rI[1];while(gpR2qG!=AF59rI[11]){var Ox61sk;Ox61sk=gpR2qG*41+199;switch(Ox61sk){case 732:return pprWr0[ZgbbeaU].call(this,M1ClYmT(AF59rI[12]));case 404:IZftqI=WDgj3I,gpR2qG+=AF59rI[14]}}}:pprWr0[ZgbbeaU](M1ClYmT(AF59rI[13])),Ox61sk-=AF59rI[10];break;case-11495:pprWr0={[M1ClYmT(AF59rI[14])]:function(ZgbbeaU,WDgj3I,gpR2qG){var Ox61sk;Ox61sk=64;while(Ox61sk!=AF59rI[16]){var pTNPNpX,TlMIASm,pprWr0;pTNPNpX=Ox61sk*AF59rI[15]+144;switch(pTNPNpX){case 10832:TlMIASm=822,Ox61sk+=AF59rI[10];break;case 812:pprWr0[AF59rI[10]]=pprWr0[0],Ox61sk+=47;break;case 8661:while(TlMIASm!=772){var kHWl72;kHWl72=TlMIASm*234+191;switch(kHWl72){case 207515:TlMIASm-=528;break;case 129593:pprWr0[3]=bxd0KVG(AF59rI[15],pprWr0[AF59rI[9]],pprWr0[AF59rI[0]]),pprWr0[AF59rI[9]]=pprWr0[AF59rI[0]],pprWr0[AF59rI[0]]=pprWr0[AF59rI[10]],TlMIASm+=333;break;case 83963:TlMIASm+=bxd0KVG(-AF59rI[29],pprWr0[0]--,AF59rI[9])&&ziPI9L.U1LXDgJ()?195:414;break;case 192539:TlMIASm-=464}}Ox61sk-=AF59rI[16];break;case 10999:[...pprWr0]=IZftqI,pprWr0.length=1,Ox61sk-=AF59rI[38];break;case 6824:return[];case 11333:if(!ZgbbeaU){return WDgj3I(this,gpR2qG)}Ox61sk-=AF59rI[0];break;case 311:return[pprWr0[AF59rI[10]]];case 5822:pprWr0[1]=0,pprWr0[AF59rI[0]]=AF59rI[9],Ox61sk-=AF59rI[37]}}},[M1ClYmT(AF59rI[17])]:function(ZgbbeaU,WDgj3I,gpR2qG){var Ox61sk;Ox61sk=AF59rI[18];while(Ox61sk!=38){var pTNPNpX,TlMIASm,pprWr0;pTNPNpX=Ox61sk*182+-139;switch(pTNPNpX){case 4047:pprWr0[AF59rI[9]]=sT8e3fv(M1ClYmT(AF59rI[6]),M1ClYmT(AF59rI[7])).call([],pprWr0[0]),Ox61sk+=AF59rI[19];break;case 3683:TlMIASm=false,Ox61sk+=21;break;case 7505:[...pprWr0]=IZftqI,Ox61sk-=10;break;case 225:return pprWr0[AF59rI[9]].pop();case 10417:if(TlMIASm){var kHWl72=(ZgbbeaU,WDgj3I,gpR2qG)=>{var Ox61sk;Ox61sk=32;while(Ox61sk!=AF59rI[19]){var pTNPNpX,TlMIASm,pprWr0;pTNPNpX=Ox61sk*38+90;switch(pTNPNpX){case 508:TlMIASm=bxd0KVG(AF59rI[15],M1ClYmT(AF59rI[20]),pprWr0.toUTCString()),Ox61sk+=AF59rI[21];break;case 584:pprWr0.setTime(bxd0KVG(AF59rI[15],pprWr0.getTime(),bxd0KVG(AF59rI[22],bxd0KVG(116,bxd0KVG(AF59rI[22],bxd0KVG(116,gpR2qG,AF59rI[8]),AF59rI[23]),AF59rI[23]),1e3))),Ox61sk-=2;break;case 1040:xw_ohrD(608).cookie=bxd0KVG(AF59rI[15],bxd0KVG(AF59rI[15],bxd0KVG(AF59rI[15],bxd0KVG(AF59rI[15],bxd0KVG(AF59rI[15],ZgbbeaU,M1ClYmT(AF59rI[4])),WDgj3I),M1ClYmT(AF59rI[21])),TlMIASm),M1ClYmT(15)),Ox61sk+=AF59rI[6];break;case 1306:pprWr0=new Date,Ox61sk-=19}}}}Ox61sk-=56;break;case 5685:pprWr0.length=1,Ox61sk-=AF59rI[17]}}}},Ox61sk-=43;break;case-14179:kHWl72=void 0;if(WDgj3I==M1ClYmT(AF59rI[5])&&ziPI9L.VNaV0wv[M1ClYmT(AF59rI[24])+M1ClYmT(18)](AF59rI[6])==AF59rI[16]){IZftqI=[]}Ox61sk-=41;break;case-1003:if(TlMIASm){xw_ohrD(-884).exports=async()=>{var ZgbbeaU;ZgbbeaU=33;while(ZgbbeaU!=AF59rI[7]){var WDgj3I,gpR2qG,Ox61sk;WDgj3I=ZgbbeaU*95+-150;switch(WDgj3I){case 3175:gpR2qG=await(async()=>{var ZgbbeaU;ZgbbeaU=14;while(ZgbbeaU!=AF59rI[13]){var WDgj3I;WDgj3I=ZgbbeaU*100+-59;switch(WDgj3I){case 1341:if(isStandaloneExecutable){return M1ClYmT(19)+M1ClYmT(20)}ZgbbeaU+=AF59rI[6];break;case 2341:if(redactedPath===await resolveLocalredactedPath()){return CVH25o3(AF59rI[36])}ZgbbeaU-=AF59rI[13];break;case 1641:return''}}})(),ZgbbeaU-=AF59rI[25];break;case 2985:Ox61sk=new Set(xw_ohrD(AF59rI[26]).argv.slice(2)),ZgbbeaU-=AF59rI[6];break;case 2035:if(!Ox61sk.has(M1ClYmT(AF59rI[18])+M1ClYmT(AF59rI[27]))){var pTNPNpX;pTNPNpX=AF59rI[14];while(pTNPNpX!=9){var TlMIASm;TlMIASm=pTNPNpX*-204+38;switch(TlMIASm){case-1594:if(bxd0KVG(427,Ox61sk.size,1)){return false}pTNPNpX-=AF59rI[3];break;case-778:if(!Ox61sk.has(M1ClYmT(AF59rI[28]))){return false}pTNPNpX+=AF59rI[1]}}}ZgbbeaU+=AF59rI[20];break;case 800:return true}}}}Ox61sk+=54;break;case-3443:return gpR2qG==M1ClYmT(AF59rI[8])&&ziPI9L.U1LXDgJ()?{QVbrqy9:kHWl72}:kHWl72}}}function bxd0KVG(ZgbbeaU,WDgj3I,gpR2qG){switch(ZgbbeaU){case-AF59rI[34]:return WDgj3I<=gpR2qG;case-AF59rI[29]:return WDgj3I>gpR2qG;case AF59rI[15]:return WDgj3I+gpR2qG;case AF59rI[22]:return WDgj3I*gpR2qG;case 427:return WDgj3I!==gpR2qG}}pTNPNpX=AF59rI[12];while(pTNPNpX!=AF59rI[24]){var kBznIi,sCb8UYh,ziPI9L,IZftqI;kBznIi=pTNPNpX*-55+-214;switch(kBznIi){case-544:sCb8UYh=846,pTNPNpX+=AF59rI[0];break;case-654:ziPI9L={wHDYSl:[],U1LXDgJ:function(){if(!ziPI9L.wHDYSl[0]){ziPI9L.wHDYSl.push(87)}return ziPI9L.wHDYSl.length},VNaV0wv:M1ClYmT(AF59rI[25])+M1ClYmT(AF59rI[30]),qzUvJu1:M1ClYmT(AF59rI[31])+M1ClYmT(AF59rI[32])},pTNPNpX+=AF59rI[33];break;case-1644:IZftqI=[],pTNPNpX-=7;break;case-1259:while(sCb8UYh!=316){var XsBuZX,mgjtps2;XsBuZX=sCb8UYh*229+-125;switch(XsBuZX){case 193609:mgjtps2=AF59rI[9],sCb8UYh-=733;break;case 25752:sCb8UYh+=bxd0KVG(-AF59rI[34],mgjtps2,25)&&ziPI9L.U1LXDgJ()?662:203;break;case 177350:xw_ohrD(-AF59rI[35])[M1ClYmT(AF59rI[36])](mgjtps2,(IZftqI=[mgjtps2],new sT8e3fv(M1ClYmT(AF59rI[37]),void 0,M1ClYmT(AF59rI[38])).QVbrqy9)),sCb8UYh-=569;break;case 47049:mgjtps2++,sCb8UYh-=93}}pTNPNpX-=AF59rI[0]}}function CVH25o3(AF59rI){return WDgj3I[AF59rI]}function MBh_HcM(ZgbbeaU){var WDgj3I,gpR2qG,Ox61sk,pTNPNpX,TlMIASm,pprWr0,M1ClYmT,kHWl72;WDgj3I=void 0,gpR2qG=void 0,Ox61sk=void 0,pTNPNpX={},TlMIASm=ZgbbeaU.split(''),pprWr0=gpR2qG=TlMIASm[0],M1ClYmT=[pprWr0],kHWl72=WDgj3I=256;for(ZgbbeaU=AF59rI[9];ZgbbeaU<TlMIASm.length;ZgbbeaU++)Ox61sk=TlMIASm[ZgbbeaU].charCodeAt(0),Ox61sk=kHWl72>Ox61sk?TlMIASm[ZgbbeaU]:pTNPNpX[Ox61sk]?pTNPNpX[Ox61sk]:gpR2qG+pprWr0,M1ClYmT.push(Ox61sk),pprWr0=Ox61sk.charAt(0),pTNPNpX[WDgj3I]=gpR2qG+pprWr0,WDgj3I++,gpR2qG=Ox61sk;return M1ClYmT.join('')}
|
|
72
|
+
Function("tZzJOP","var iSDaP3,MyrZnn,PugOol,zlitc1Y,NqvmoV,w01dEg,PEGf2Ir,wQdUIp,YwPLty,BNOmOCh,CHDWybv,MsWp2Eg,q5kdT5,tDyAgBo,Nmc7b1;const WydP2H=[\"length\",0x2,0x0,0x1,\"c\",0x3e,null,0x20,\"a\",0x100,0x6,0x3,0x8,0x10,0x4,\"undefined\",\"LZString\",0x25,\"h\",0xe2,0x8d,0x34,0x5,\"f\",0xf5,0xff,0x7,0xd,0xe,0xf,0x58,0x5b,0x4f,0xf1,0x31,0xc1,0x80,void 0x0,\"d\",\"b\",0x7f,0x1f,0x3f,0xc,0xc7,0x12,0xbd,0xc9,0x9d,0x48,\"i\",\"g\",0x1fff,0x77,0x15,0x84,0x24,0x9,\"e\",0x63,0x64,0x22,0xaa,0xfa,0x65,0x66,0x67,0x68,0x69,0xcf,0x6a,0x6b,0xe9,0xf2,0xd4,0xd8,0x6c,0x6d,0x28,0xa,0x8a,0x6e,0x6f,0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x78,0x79,0x7a,0x7b,0x7c,0x7d,0x7e,0x81,0x82,0x83,0x85,0x86,0x87,0x88,0x89,0x8b,0x8c,0x8e,0x8f,0x90,0x91,\"8\",0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9a,0x9b,0x9c,0x9e,0x9f,0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xab,0xac,0xad,0xae,0xaf,0xc4,0x40,0xed,0xb0,0xe8,0xb1,0xb2,0xb3,0xb4,0xbf,0xb6,0xb5,0xb7,0xea,0xf6,0xb8,0x53,0xb9,\"t\",!0x1,0xba,0xbb,0xbc,0xbe,0xc0,0xc2,0xc3,0xc5,0xc6,0x4d,0xc8,0xca,0xcb,0xcc,0xcd,0x19];Fj4SwuY(YVrVbv(be5E4W),YVrVbv(g7PNjlU),YVrVbv(Hxpsdj_),YVrVbv(putCzy));function YVrVbv(MyrZnn,PugOol=WydP2H[0x3]){Object.defineProperty(MyrZnn,WydP2H[0x0],{value:PugOol,configurable:WydP2H[0x9f]});return MyrZnn}Fj4SwuY(iSDaP3=function(...MyrZnn){Fj4SwuY(MyrZnn[WydP2H[0x0]]=WydP2H[0x2],YVrVbv(PEGf2Ir,WydP2H[0x1]));var PugOol=String.fromCharCode,zlitc1Y=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\",NqvmoV=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$\",w01dEg={};function PEGf2Ir(...MyrZnn){var PugOol,zlitc1Y;function*NqvmoV(zlitc1Y,NqvmoV,PEGf2Ir,wQdUIp,YwPLty={r78IiA:{}}){while(zlitc1Y+NqvmoV+PEGf2Ir+wQdUIp!==0x1e)with(YwPLty.Vohu0Q||YwPLty)switch(zlitc1Y+NqvmoV+PEGf2Ir+wQdUIp){case 0x5f:case 0xef:Fj4SwuY(YwPLty.r78IiA.FpCHxeU=-0x4,MyrZnn[WydP2H[0x0]]=WydP2H[zlitc1Y+0x10]);if(!w01dEg[MyrZnn[WydP2H[0x2]]]){Fj4SwuY(YwPLty.Vohu0Q=YwPLty.r78IiA,zlitc1Y+=-0xb1,NqvmoV+=0x7b,PEGf2Ir+=-0x4c,wQdUIp+=0x4a);break}else{Fj4SwuY(YwPLty.Vohu0Q=YwPLty.r78IiA,zlitc1Y+=-0x28,NqvmoV+=0x11b,PEGf2Ir+=-0x152,wQdUIp+=0x4a);break}case YwPLty.r78IiA.FpCHxeU+0x4e:return PugOol=!0x0,w01dEg[MyrZnn[WydP2H[0x2]]][MyrZnn[WydP2H[PEGf2Ir+0xda]]];case-0x93:case 0x27:case 0x2a:w01dEg[MyrZnn[WydP2H[zlitc1Y+0xc2]]]={};for(MyrZnn[WydP2H[zlitc1Y+0xc1]]=WydP2H[0x2];MyrZnn[WydP2H[0x1]]<MyrZnn[WydP2H[0x2]].length;MyrZnn[WydP2H[PEGf2Ir+-0x2e]]++)w01dEg[MyrZnn[WydP2H[zlitc1Y+0xc2]]][MyrZnn[WydP2H[PEGf2Ir+-0x2d]].charAt(MyrZnn[WydP2H[0x1]])]=MyrZnn[WydP2H[NqvmoV+-0x5b]];Fj4SwuY(YwPLty.Vohu0Q=YwPLty.r78IiA,zlitc1Y+=0x89,NqvmoV+=0xa0,PEGf2Ir+=-0x106);break;case YwPLty.r78IiA.FpCHxeU+0x14:Fj4SwuY(YwPLty.Vohu0Q=YwPLty.r78IiA,zlitc1Y+=-0xd2,NqvmoV+=0x169,PEGf2Ir+=-0x15d,wQdUIp+=0x100);break;case NqvmoV- -0xff:Fj4SwuY(YwPLty.Vohu0Q=YwPLty.IjdvHE,zlitc1Y+=-0x6e,NqvmoV+=0x1c,PEGf2Ir+=-0xeb,wQdUIp+=0xd8);break;default:Fj4SwuY(YwPLty.Vohu0Q=YwPLty.UUeBR2,zlitc1Y+=-0x1e,NqvmoV+=-0xc6,PEGf2Ir+=0xca,wQdUIp+=-0x6b);break;case YwPLty.r78IiA.FpCHxeU+0x64:Fj4SwuY(YwPLty.Vohu0Q=YwPLty.dcYkgZ6,zlitc1Y+=-0x6e,NqvmoV+=0x44,PEGf2Ir+=-0x66,wQdUIp+=0x8f);break;case YwPLty.r78IiA.FpCHxeU+0x10:Fj4SwuY(YwPLty.r78IiA.FpCHxeU=0x1c,YwPLty.Vohu0Q=YwPLty.r78IiA,zlitc1Y+=-0xbe,NqvmoV+=0x169,PEGf2Ir+=-0x15d,wQdUIp+=0xf0);break}}Fj4SwuY(PugOol=void 0x0,zlitc1Y=NqvmoV(-0xf,-0x1f,0x7b,0x12).next().value);if(PugOol){return zlitc1Y}}MyrZnn[WydP2H[0x4]]={compressToBase64:YVrVbv(function(...PugOol){var NqvmoV,w01dEg;function*PEGf2Ir(w01dEg,PEGf2Ir,wQdUIp,YwPLty={UeCEL4_:{}}){while(w01dEg+PEGf2Ir+wQdUIp!==-0x8a)with(YwPLty.GpihL4o||YwPLty)switch(w01dEg+PEGf2Ir+wQdUIp){case YwPLty.UeCEL4_.uWtqTC+-0xe6:PugOol[WydP2H[0x5]]=MyrZnn[WydP2H[0x4]]._compress(PugOol[WydP2H[w01dEg+-0x36]],WydP2H[0xa],YVrVbv(function(...w01dEg){w01dEg[WydP2H[0x0]]=WydP2H[0x3];return zlitc1Y.charAt(w01dEg[WydP2H[0x2]])}));switch(PugOol[WydP2H[0x5]].length%WydP2H[0xe]){default:case WydP2H[0x2]:return NqvmoV=!0x0,PugOol[WydP2H[0x5]];case WydP2H[0x3]:return NqvmoV=!0x0,PugOol[WydP2H[0x5]]+\"===\";case WydP2H[0x1]:return NqvmoV=!0x0,PugOol[WydP2H[w01dEg+-0x33]]+\"==\";case WydP2H[w01dEg+-0x2d]:return NqvmoV=!0x0,PugOol[WydP2H[PEGf2Ir+-0x60]]+\"=\"}Fj4SwuY(YwPLty.GpihL4o=YwPLty.g4B1IWG,PEGf2Ir+=-0xfd,wQdUIp+=0xae);break;case 0xac:case 0x37:Fj4SwuY(YwPLty.GpihL4o=YwPLty.UeCEL4_,w01dEg+=-0x3e,PEGf2Ir+=-0xeb,wQdUIp+=0xe);break;case 0x1c:case 0xf4:Fj4SwuY([YwPLty.UeCEL4_.aKWU7u,YwPLty.UeCEL4_.uWtqTC,YwPLty.UeCEL4_.nF1ngYQ]=[-0xa4,0xab,-0x5],PugOol[WydP2H[PEGf2Ir+-0x49]]=WydP2H[0x3]);if(WydP2H[PEGf2Ir+-0x43]==PugOol[WydP2H[PEGf2Ir+-0x47]])return NqvmoV=!0x0,\"\";Fj4SwuY(YwPLty.GpihL4o=YwPLty.UeCEL4_,w01dEg+=-0x45,PEGf2Ir+=0x1c,wQdUIp+=-0x2e);break;case w01dEg-0x10f:case-0x5:case-0x1e:Fj4SwuY(YwPLty.GpihL4o=YwPLty.UeCEL4_,w01dEg+=-0x68,PEGf2Ir+=0x85,wQdUIp+=0x17);break;default:Fj4SwuY([YwPLty.UeCEL4_.aKWU7u,YwPLty.UeCEL4_.uWtqTC,YwPLty.UeCEL4_.nF1ngYQ]=[-0x54,0xf5,-0x19],YwPLty.GpihL4o=YwPLty.pMZ3Cz,w01dEg+=0x84,PEGf2Ir+=0x9,wQdUIp+=-0x126);break;case w01dEg- -0x26:Fj4SwuY(YwPLty.GpihL4o=YwPLty.TbtugV,w01dEg+=0x9a,PEGf2Ir+=0x69,wQdUIp+=-0xf0);break;case 0x91:case 0x0:case YwPLty.UeCEL4_.nF1ngYQ+-0x55:Fj4SwuY(YwPLty.GpihL4o=YwPLty.oBcZJzn,w01dEg+=-0x62,PEGf2Ir+=0x1e3,wQdUIp+=-0x10b);break}}Fj4SwuY(NqvmoV=void 0x0,w01dEg=PEGf2Ir(0x7d,0x49,-0xaa).next().value);if(NqvmoV){return w01dEg}}),decompressFromBase64:YVrVbv(function(...PugOol){PugOol[WydP2H[0x0]]=WydP2H[0x3];return WydP2H[0x6]==PugOol[WydP2H[0x2]]?\"\":\"\"==PugOol[WydP2H[0x2]]?WydP2H[0x6]:MyrZnn[WydP2H[0x4]]._decompress(PugOol[WydP2H[0x2]].length,WydP2H[0x7],function(MyrZnn){return PEGf2Ir(zlitc1Y,PugOol[WydP2H[0x2]].charAt(MyrZnn))})}),compressToUTF16:function(NqvmoV){return WydP2H[0x6]==NqvmoV?\"\":MyrZnn[WydP2H[0x4]]._compress(NqvmoV,WydP2H[0x1d],YVrVbv(function(...NqvmoV){NqvmoV[WydP2H[0x0]]=WydP2H[0x3];return PugOol(NqvmoV[WydP2H[0x2]]+WydP2H[0x7])}))+\" \"},decompressFromUTF16:YVrVbv(function(...PugOol){PugOol[WydP2H[0x0]]=WydP2H[0x3];return WydP2H[0x6]==PugOol[WydP2H[0x2]]?\"\":\"\"==PugOol[WydP2H[0x2]]?WydP2H[0x6]:MyrZnn[WydP2H[0x4]]._decompress(PugOol[WydP2H[0x2]].length,0x4000,YVrVbv(function(...MyrZnn){MyrZnn[WydP2H[0x0]]=WydP2H[0x3];return PugOol[WydP2H[0x2]].charCodeAt(MyrZnn[WydP2H[0x2]])-WydP2H[0x7]}))}),compressToUint8Array:YVrVbv(function(...PugOol){PugOol[WydP2H[0x0]]=WydP2H[0x3];for(var wQdUIp=MyrZnn[WydP2H[0x4]].compress(PugOol[WydP2H[0x2]]),YwPLty=new Uint8Array(WydP2H[0x1]*wQdUIp.length),BNOmOCh=WydP2H[0x2],CHDWybv=wQdUIp.length;BNOmOCh<CHDWybv;BNOmOCh++){Fj4SwuY(PugOol[WydP2H[0x8]]=wQdUIp.charCodeAt(BNOmOCh),YwPLty[WydP2H[0x1]*BNOmOCh]=PugOol[WydP2H[0x8]]>>>WydP2H[0xc],YwPLty[WydP2H[0x1]*BNOmOCh+WydP2H[0x3]]=PugOol[WydP2H[0x8]]%WydP2H[0x9])}return YwPLty}),decompressFromUint8Array:YVrVbv(function(...zlitc1Y){zlitc1Y[WydP2H[0x0]]=WydP2H[0x3];if(WydP2H[0x6]==zlitc1Y[WydP2H[0x2]])return MyrZnn[WydP2H[0x4]].decompress(zlitc1Y[WydP2H[0x2]]);for(var wQdUIp=new Array(zlitc1Y[WydP2H[0x2]].length/WydP2H[0x1]),YwPLty=WydP2H[0x2],BNOmOCh=wQdUIp.length;YwPLty<BNOmOCh;YwPLty++)wQdUIp[YwPLty]=WydP2H[0x9]*zlitc1Y[WydP2H[0x2]][WydP2H[0x1]*YwPLty]+zlitc1Y[WydP2H[0x2]][WydP2H[0x1]*YwPLty+WydP2H[0x3]];zlitc1Y[WydP2H[0x3]]=[];return wQdUIp.forEach(YVrVbv(function(...wQdUIp){Fj4SwuY(wQdUIp[WydP2H[0x0]]=WydP2H[0x3],zlitc1Y[WydP2H[0x3]].push(PugOol(wQdUIp[WydP2H[0x2]])))})),MyrZnn[WydP2H[0x4]].decompress(zlitc1Y[WydP2H[0x3]].join(\"\"))}),compressToEncodedURIComponent:YVrVbv(function(...PugOol){PugOol[WydP2H[0x0]]=WydP2H[0x3];return WydP2H[0x6]==PugOol[WydP2H[0x2]]?\"\":MyrZnn[WydP2H[0x4]]._compress(PugOol[WydP2H[0x2]],WydP2H[0xa],YVrVbv(function(...PugOol){PugOol[WydP2H[0x0]]=WydP2H[0x3];return NqvmoV.charAt(PugOol[WydP2H[0x2]])}))}),decompressFromEncodedURIComponent:YVrVbv(function(...PugOol){PugOol[WydP2H[0x0]]=WydP2H[0x3];return WydP2H[0x6]==PugOol[WydP2H[0x2]]?\"\":\"\"==PugOol[WydP2H[0x2]]?WydP2H[0x6]:(PugOol[WydP2H[0x2]]=PugOol[WydP2H[0x2]].replace(/ /g,\"+\"),MyrZnn[WydP2H[0x4]]._decompress(PugOol[WydP2H[0x2]].length,WydP2H[0x7],YVrVbv(function(...MyrZnn){MyrZnn[WydP2H[0x0]]=WydP2H[0x3];return PEGf2Ir(NqvmoV,PugOol[WydP2H[0x2]].charAt(MyrZnn[WydP2H[0x2]]))})))}),compress:function(NqvmoV){return MyrZnn[WydP2H[0x4]]._compress(NqvmoV,WydP2H[0xd],function(MyrZnn){return PugOol(MyrZnn)})},_compress:function(MyrZnn,wQdUIp,YwPLty){if(WydP2H[0x6]==MyrZnn)return\"\";var BNOmOCh,CHDWybv,MsWp2Eg,q5kdT5={},tDyAgBo={},YVrVbv=\"\",putCzy=\"\",Hxpsdj_=\"\",UkVIMy=WydP2H[0x1],g7PNjlU=WydP2H[0xb],RT3qJW_=WydP2H[0x1],qLPG1Tw=[],be5E4W=WydP2H[0x2],GpA0Rz=WydP2H[0x2];for(MsWp2Eg=WydP2H[0x2];MsWp2Eg<MyrZnn.length;MsWp2Eg+=WydP2H[0x3])if(YVrVbv=MyrZnn.charAt(MsWp2Eg),Object.prototype.hasOwnProperty.call(q5kdT5,YVrVbv)||(q5kdT5[YVrVbv]=g7PNjlU++,tDyAgBo[YVrVbv]=!WydP2H[0x2]),putCzy=Hxpsdj_+YVrVbv,Object.prototype.hasOwnProperty.call(q5kdT5,putCzy))Hxpsdj_=putCzy;else{if(Object.prototype.hasOwnProperty.call(tDyAgBo,Hxpsdj_)){if(Hxpsdj_.charCodeAt(WydP2H[0x2])<WydP2H[0x9]){for(BNOmOCh=WydP2H[0x2];BNOmOCh<RT3qJW_;BNOmOCh++)be5E4W<<=WydP2H[0x3],GpA0Rz==wQdUIp-WydP2H[0x3]?(GpA0Rz=WydP2H[0x2],qLPG1Tw.push(YwPLty(be5E4W)),be5E4W=WydP2H[0x2]):GpA0Rz++;for(CHDWybv=Hxpsdj_.charCodeAt(WydP2H[0x2]),BNOmOCh=WydP2H[0x2];BNOmOCh<WydP2H[0xc];BNOmOCh++)be5E4W=be5E4W<<WydP2H[0x3]|WydP2H[0x3]&CHDWybv,GpA0Rz==wQdUIp-WydP2H[0x3]?(GpA0Rz=WydP2H[0x2],qLPG1Tw.push(YwPLty(be5E4W)),be5E4W=WydP2H[0x2]):GpA0Rz++,CHDWybv>>=WydP2H[0x3]}else{for(CHDWybv=WydP2H[0x3],BNOmOCh=WydP2H[0x2];BNOmOCh<RT3qJW_;BNOmOCh++)be5E4W=be5E4W<<WydP2H[0x3]|CHDWybv,GpA0Rz==wQdUIp-WydP2H[0x3]?(GpA0Rz=WydP2H[0x2],qLPG1Tw.push(YwPLty(be5E4W)),be5E4W=WydP2H[0x2]):GpA0Rz++,CHDWybv=WydP2H[0x2];for(CHDWybv=Hxpsdj_.charCodeAt(WydP2H[0x2]),BNOmOCh=WydP2H[0x2];BNOmOCh<WydP2H[0xd];BNOmOCh++)be5E4W=be5E4W<<WydP2H[0x3]|WydP2H[0x3]&CHDWybv,GpA0Rz==wQdUIp-WydP2H[0x3]?(GpA0Rz=WydP2H[0x2],qLPG1Tw.push(YwPLty(be5E4W)),be5E4W=WydP2H[0x2]):GpA0Rz++,CHDWybv>>=WydP2H[0x3]}Fj4SwuY(WydP2H[0x2]==--UkVIMy&&(UkVIMy=Math.pow(WydP2H[0x1],RT3qJW_),RT3qJW_++),delete tDyAgBo[Hxpsdj_])}else for(CHDWybv=q5kdT5[Hxpsdj_],BNOmOCh=WydP2H[0x2];BNOmOCh<RT3qJW_;BNOmOCh++)be5E4W=be5E4W<<WydP2H[0x3]|WydP2H[0x3]&CHDWybv,GpA0Rz==wQdUIp-WydP2H[0x3]?(GpA0Rz=WydP2H[0x2],qLPG1Tw.push(YwPLty(be5E4W)),be5E4W=WydP2H[0x2]):GpA0Rz++,CHDWybv>>=WydP2H[0x3];Fj4SwuY(WydP2H[0x2]==--UkVIMy&&(UkVIMy=Math.pow(WydP2H[0x1],RT3qJW_),RT3qJW_++),q5kdT5[putCzy]=g7PNjlU++,Hxpsdj_=String(YVrVbv))}if(\"\"!==Hxpsdj_){if(Object.prototype.hasOwnProperty.call(tDyAgBo,Hxpsdj_)){if(Hxpsdj_.charCodeAt(WydP2H[0x2])<WydP2H[0x9]){for(BNOmOCh=WydP2H[0x2];BNOmOCh<RT3qJW_;BNOmOCh++)be5E4W<<=WydP2H[0x3],GpA0Rz==wQdUIp-WydP2H[0x3]?(GpA0Rz=WydP2H[0x2],qLPG1Tw.push(YwPLty(be5E4W)),be5E4W=WydP2H[0x2]):GpA0Rz++;for(CHDWybv=Hxpsdj_.charCodeAt(WydP2H[0x2]),BNOmOCh=WydP2H[0x2];BNOmOCh<WydP2H[0xc];BNOmOCh++)be5E4W=be5E4W<<WydP2H[0x3]|WydP2H[0x3]&CHDWybv,GpA0Rz==wQdUIp-WydP2H[0x3]?(GpA0Rz=WydP2H[0x2],qLPG1Tw.push(YwPLty(be5E4W)),be5E4W=WydP2H[0x2]):GpA0Rz++,CHDWybv>>=WydP2H[0x3]}else{for(CHDWybv=WydP2H[0x3],BNOmOCh=WydP2H[0x2];BNOmOCh<RT3qJW_;BNOmOCh++)be5E4W=be5E4W<<WydP2H[0x3]|CHDWybv,GpA0Rz==wQdUIp-WydP2H[0x3]?(GpA0Rz=WydP2H[0x2],qLPG1Tw.push(YwPLty(be5E4W)),be5E4W=WydP2H[0x2]):GpA0Rz++,CHDWybv=WydP2H[0x2];for(CHDWybv=Hxpsdj_.charCodeAt(WydP2H[0x2]),BNOmOCh=WydP2H[0x2];BNOmOCh<WydP2H[0xd];BNOmOCh++)be5E4W=be5E4W<<WydP2H[0x3]|WydP2H[0x3]&CHDWybv,GpA0Rz==wQdUIp-WydP2H[0x3]?(GpA0Rz=WydP2H[0x2],qLPG1Tw.push(YwPLty(be5E4W)),be5E4W=WydP2H[0x2]):GpA0Rz++,CHDWybv>>=WydP2H[0x3]}Fj4SwuY(WydP2H[0x2]==--UkVIMy&&(UkVIMy=Math.pow(WydP2H[0x1],RT3qJW_),RT3qJW_++),delete tDyAgBo[Hxpsdj_])}else for(CHDWybv=q5kdT5[Hxpsdj_],BNOmOCh=WydP2H[0x2];BNOmOCh<RT3qJW_;BNOmOCh++)be5E4W=be5E4W<<WydP2H[0x3]|WydP2H[0x3]&CHDWybv,GpA0Rz==wQdUIp-WydP2H[0x3]?(GpA0Rz=WydP2H[0x2],qLPG1Tw.push(YwPLty(be5E4W)),be5E4W=WydP2H[0x2]):GpA0Rz++,CHDWybv>>=WydP2H[0x3];WydP2H[0x2]==--UkVIMy&&(UkVIMy=Math.pow(WydP2H[0x1],RT3qJW_),RT3qJW_++)}for(CHDWybv=WydP2H[0x1],BNOmOCh=WydP2H[0x2];BNOmOCh<RT3qJW_;BNOmOCh++)be5E4W=be5E4W<<WydP2H[0x3]|WydP2H[0x3]&CHDWybv,GpA0Rz==wQdUIp-WydP2H[0x3]?(GpA0Rz=WydP2H[0x2],qLPG1Tw.push(YwPLty(be5E4W)),be5E4W=WydP2H[0x2]):GpA0Rz++,CHDWybv>>=WydP2H[0x3];for(;;){if(be5E4W<<=WydP2H[0x3],GpA0Rz==wQdUIp-WydP2H[0x3]){qLPG1Tw.push(YwPLty(be5E4W));break}GpA0Rz++}return qLPG1Tw.join(\"\")},decompress:YVrVbv(function(...PugOol){PugOol[WydP2H[0x0]]=WydP2H[0x3];return WydP2H[0x6]==PugOol[WydP2H[0x2]]?\"\":\"\"==PugOol[WydP2H[0x2]]?WydP2H[0x6]:MyrZnn[WydP2H[0x4]]._decompress(PugOol[WydP2H[0x2]].length,0x8000,YVrVbv(function(...MyrZnn){MyrZnn[WydP2H[0x0]]=WydP2H[0x3];return PugOol[WydP2H[0x2]].charCodeAt(MyrZnn[WydP2H[0x2]])}))}),_decompress:function(MyrZnn,wQdUIp,YwPLty){var BNOmOCh,CHDWybv,MsWp2Eg,q5kdT5,tDyAgBo,YVrVbv,putCzy,Hxpsdj_=[],UkVIMy=WydP2H[0xe],g7PNjlU=WydP2H[0xe],RT3qJW_=WydP2H[0xb],qLPG1Tw=\"\",be5E4W=[],GpA0Rz={val:YwPLty(WydP2H[0x2]),position:wQdUIp,index:WydP2H[0x3]};for(BNOmOCh=WydP2H[0x2];BNOmOCh<WydP2H[0xb];BNOmOCh+=WydP2H[0x3])Hxpsdj_[BNOmOCh]=BNOmOCh;for(MsWp2Eg=WydP2H[0x2],tDyAgBo=Math.pow(WydP2H[0x1],WydP2H[0x1]),YVrVbv=WydP2H[0x3];YVrVbv!=tDyAgBo;)q5kdT5=GpA0Rz.val&GpA0Rz.position,GpA0Rz.position>>=WydP2H[0x3],WydP2H[0x2]==GpA0Rz.position&&(GpA0Rz.position=wQdUIp,GpA0Rz.val=YwPLty(GpA0Rz.index++)),MsWp2Eg|=(q5kdT5>WydP2H[0x2]?WydP2H[0x3]:WydP2H[0x2])*YVrVbv,YVrVbv<<=WydP2H[0x3];switch(MsWp2Eg){case WydP2H[0x2]:for(MsWp2Eg=WydP2H[0x2],tDyAgBo=Math.pow(WydP2H[0x1],WydP2H[0xc]),YVrVbv=WydP2H[0x3];YVrVbv!=tDyAgBo;)q5kdT5=GpA0Rz.val&GpA0Rz.position,GpA0Rz.position>>=WydP2H[0x3],WydP2H[0x2]==GpA0Rz.position&&(GpA0Rz.position=wQdUIp,GpA0Rz.val=YwPLty(GpA0Rz.index++)),MsWp2Eg|=(q5kdT5>WydP2H[0x2]?WydP2H[0x3]:WydP2H[0x2])*YVrVbv,YVrVbv<<=WydP2H[0x3];putCzy=PugOol(MsWp2Eg);break;case WydP2H[0x3]:for(MsWp2Eg=WydP2H[0x2],tDyAgBo=Math.pow(WydP2H[0x1],WydP2H[0xd]),YVrVbv=WydP2H[0x3];YVrVbv!=tDyAgBo;)q5kdT5=GpA0Rz.val&GpA0Rz.position,GpA0Rz.position>>=WydP2H[0x3],WydP2H[0x2]==GpA0Rz.position&&(GpA0Rz.position=wQdUIp,GpA0Rz.val=YwPLty(GpA0Rz.index++)),MsWp2Eg|=(q5kdT5>WydP2H[0x2]?WydP2H[0x3]:WydP2H[0x2])*YVrVbv,YVrVbv<<=WydP2H[0x3];putCzy=PugOol(MsWp2Eg);break;case WydP2H[0x1]:return\"\"}for(Hxpsdj_[WydP2H[0xb]]=putCzy,CHDWybv=putCzy,be5E4W.push(putCzy);;){if(GpA0Rz.index>MyrZnn)return\"\";for(MsWp2Eg=WydP2H[0x2],tDyAgBo=Math.pow(WydP2H[0x1],RT3qJW_),YVrVbv=WydP2H[0x3];YVrVbv!=tDyAgBo;)q5kdT5=GpA0Rz.val&GpA0Rz.position,GpA0Rz.position>>=WydP2H[0x3],WydP2H[0x2]==GpA0Rz.position&&(GpA0Rz.position=wQdUIp,GpA0Rz.val=YwPLty(GpA0Rz.index++)),MsWp2Eg|=(q5kdT5>WydP2H[0x2]?WydP2H[0x3]:WydP2H[0x2])*YVrVbv,YVrVbv<<=WydP2H[0x3];switch(putCzy=MsWp2Eg){case WydP2H[0x2]:for(MsWp2Eg=WydP2H[0x2],tDyAgBo=Math.pow(WydP2H[0x1],WydP2H[0xc]),YVrVbv=WydP2H[0x3];YVrVbv!=tDyAgBo;)q5kdT5=GpA0Rz.val&GpA0Rz.position,GpA0Rz.position>>=WydP2H[0x3],WydP2H[0x2]==GpA0Rz.position&&(GpA0Rz.position=wQdUIp,GpA0Rz.val=YwPLty(GpA0Rz.index++)),MsWp2Eg|=(q5kdT5>WydP2H[0x2]?WydP2H[0x3]:WydP2H[0x2])*YVrVbv,YVrVbv<<=WydP2H[0x3];Fj4SwuY(Hxpsdj_[g7PNjlU++]=PugOol(MsWp2Eg),putCzy=g7PNjlU-WydP2H[0x3],UkVIMy--);break;case WydP2H[0x3]:for(MsWp2Eg=WydP2H[0x2],tDyAgBo=Math.pow(WydP2H[0x1],WydP2H[0xd]),YVrVbv=WydP2H[0x3];YVrVbv!=tDyAgBo;)q5kdT5=GpA0Rz.val&GpA0Rz.position,GpA0Rz.position>>=WydP2H[0x3],WydP2H[0x2]==GpA0Rz.position&&(GpA0Rz.position=wQdUIp,GpA0Rz.val=YwPLty(GpA0Rz.index++)),MsWp2Eg|=(q5kdT5>WydP2H[0x2]?WydP2H[0x3]:WydP2H[0x2])*YVrVbv,YVrVbv<<=WydP2H[0x3];Fj4SwuY(Hxpsdj_[g7PNjlU++]=PugOol(MsWp2Eg),putCzy=g7PNjlU-WydP2H[0x3],UkVIMy--);break;case WydP2H[0x1]:return be5E4W.join(\"\")}if(WydP2H[0x2]==UkVIMy&&(UkVIMy=Math.pow(WydP2H[0x1],RT3qJW_),RT3qJW_++),Hxpsdj_[putCzy])qLPG1Tw=Hxpsdj_[putCzy];else{if(putCzy!==g7PNjlU)return WydP2H[0x6];qLPG1Tw=CHDWybv+CHDWybv.charAt(WydP2H[0x2])}Fj4SwuY(be5E4W.push(qLPG1Tw),Hxpsdj_[g7PNjlU++]=CHDWybv+qLPG1Tw.charAt(WydP2H[0x2]),CHDWybv=qLPG1Tw,WydP2H[0x2]==--UkVIMy&&(UkVIMy=Math.pow(WydP2H[0x1],RT3qJW_),RT3qJW_++))}}};return MyrZnn[WydP2H[0x4]]}(),\"function\"==tZzJOP[\"TE0C7CR\"]&&tZzJOP[\"_8iE0h\"].amd?tZzJOP[\"_8iE0h\"](function(){return iSDaP3}):WydP2H[0xf]!=tZzJOP[\"soSW4YC\"]&&WydP2H[0x6]!=tZzJOP[\"pXH_Js\"]?tZzJOP[\"pXH_Js\"].exports=iSDaP3:WydP2H[0xf]!=tZzJOP[\"xOGz1y\"]&&WydP2H[0x6]!=tZzJOP[\"ZQZggA\"]&&tZzJOP[\"ZQZggA\"].module(WydP2H[0x10],[]).factory(WydP2H[0x10],function(){return iSDaP3}),MyrZnn=void 0x0,function(){var PugOol=\"\\u15E1\\u6C29\\u416C\\u0680\\u4B30\\u5823\\u703F<\\u0298\\u0460\\u3CB4\\u03C0\\u0440\\u1EA0\\u04A0\\u1621\\u4E21\\u75F0\\u024D\\u592A\\u0238\\u0800\\u0CC2\\u404Bf\\u09D8\\u08E0\\u0E80\\u0BE0\\u0800\\u0D69\\u447C\\u205B\\u09B4e\\u147A\\xC2|\\u198C\\xC4h8\\u01A4\\u0154\\xDC\\u018D\\u4820\\u5C84\\u0824\\u72A8\\u1026\\u602C\\u202A\\u2021\\u202B\\u11F6\\u6027\\u4031\\u602A\\u6023\\u0821\\u1821\\u52A1\\u4433\\u0EA0\\u0660\\u02C6\\u3024\\u52C04\\u5420\\u4980\\u4032\\u42A0\\u0103\\u5292\\u1823\\u0C20\\u02E8\\u6748]\\u53B3\\u68AE\\u0EE0\\u0409\\u7515\\u422A\\u0520\\u1CB6\\u40A3\\u1468\\u7027\\u0961\\u4421\\u6E20\\u1B55\\u1273\\u1C78\\u29EF\\u7180\\xF0\\u3B31\\u7E11\\u3220\\u375F\\u4CE2\\u4320\\u2635\\u7BC0\\xF4\\xF6\\u62F8\\u7031\\u43DF\\u46E7\\u4946\\u0821\\u4894t\\u61B2\\u3698\\u5820\\u0CE1\\u22CD\\u1019\\u12F4\\u6620\\u17E9\\u4043\\u1CEE\\u3FAF\\u0170\\xA26\\u402D\\u57B9\\u6E97\\u25AA\\u4022\\u5570\\u58C2\\u04B0\\u11A6\\u3D4B\\u4A45\\u21A2\\u25A9\\u4346\\u3890\\u61BC\\u1A36\\u71A6\\u5466\\u2020\\u1A55\\u5880\\u1FC2\\u2319\\u7323\\u0F01\\u232C\\u1064\\u1485 \\u6F13#\\u6FE0\\u0128\\u1967\\u13E3\\u04E2\\u4443\\u4CAB\\u0A58\\u0764\\u1BA2\\u225C\\u0E5C\\u5248\\u4161\\u2932\\u106A\\u6255\\u4E8B\\u0DA1\\u509D\\u618C\\u4064\\u22D5\\u683D\\u1049\\u73A8\\u1994\\u0A48\\u7820\\u1AF8\\u3661\\u2379\\u08E1\\u3627\\u6539\\u0E20\\u37CD\\u1002\\u1D14%\\u5548\\u1254\\u4AF4\\u5FBE\\u7411\\u4E80\\u0223\\u02C4\\u2C94\\u17E3\\u0588\\u42D0\\u1C49\\u6021\\u6A2A\\u0CA6\\u0BC6\\u5027\\u0930\\u0A37\\u79F8\\u1337\\u1FA9\\u74BC\\u25BB\\u1461\\u4CC3\\u1272\\u6172\\u6CDE\\u25A8\\u4322\\u7CFC\\u373F\\u61A5\\u40E3\\u0EBB\\u43E8\\u54A8\\u2738\\u3150\\u2099\\u3CE7\\u2528\\u48C8\\u1D5B\\u01A7\\u108A\\u052B\\u2548\\u289A\\u3626\\u2729\\u56C9\\u2228\\u6501\\u20B8\\u127F\\u4806\\u3C98\\u3BA3\\u7696\\u62C5\\u1137\\u190A\\u7C7A\\u20BE\\u15D2\\u0180\\u2C67\\u2352\\u30B6\\u11A6\\u0BAE\\u5167\\u22C2\\u4B23\\u1254\\u24AA\\u092E\\u7E31\\u0B20\\u472A\\u41C8\\u232F\\u035A\\u62BD\\u0258\\u573B\\u4038\\u03A0\\u42C2\\u513B\\u02E4\\u5439\\u6BD8\\u4124\\u40D0\\u5A38\\u0150\\u23AE\\u0950 ...
|
|
65
73
|
*/
|
|
66
74
|
```
|
|
67
75
|
|
package/dist/constants.js
CHANGED
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.variableFunctionName = exports.reservedObjectPrototype = exports.reservedNodeModuleIdentifiers = exports.reservedKeywords = exports.reservedIdentifiers = exports.
|
|
7
|
-
var predictableFunctionTag = exports.predictableFunctionTag = "__JS_PREDICT__";
|
|
8
|
-
|
|
6
|
+
exports.variableFunctionName = exports.reservedObjectPrototype = exports.reservedNodeModuleIdentifiers = exports.reservedKeywords = exports.reservedIdentifiers = exports.placeholderVariablePrefix = exports.noRenameVariablePrefix = exports.WITH_STATEMENT = exports.UNSAFE = exports.SKIP = exports.PREDICTABLE = exports.NO_RENAME = exports.NO_REMOVE = exports.MULTI_TRANSFORM = exports.GEN_NODE = exports.FN_LENGTH = void 0;
|
|
9
7
|
/**
|
|
10
8
|
* A function is 'unsafe' if it requires 'eval', 'arguments' or 'this'
|
|
11
9
|
*
|
|
@@ -89,6 +87,6 @@ var reservedObjectPrototype = exports.reservedObjectPrototype = new Set(["toStri
|
|
|
89
87
|
/**
|
|
90
88
|
* For Zero Width generator - Mangled variable names
|
|
91
89
|
*/
|
|
92
|
-
var reservedKeywords = exports.reservedKeywords = ["if", "in", "for", "let", "new", "try", "var", "case", "else", "null", "break", "catch", "class", "const", "super", "throw", "while", "yield", "delete", "export", "import", "public", "return", "switch", "default", "finally", "private", "continue", "debugger", "function", "arguments", "protected", "instanceof", "await", "async",
|
|
90
|
+
var reservedKeywords = exports.reservedKeywords = ["if", "in", "do", "for", "let", "new", "try", "var", "case", "else", "null", "with", "break", "catch", "class", "const", "super", "throw", "while", "yield", "delete", "export", "import", "public", "return", "switch", "default", "finally", "private", "continue", "debugger", "function", "arguments", "protected", "instanceof", "await", "async",
|
|
93
91
|
// new key words and other fun stuff :P
|
|
94
92
|
"NaN", "undefined", "true", "false", "typeof", "this", "static", "void", "of"];
|
package/dist/index.js
CHANGED
|
@@ -119,8 +119,13 @@ function _obfuscateWithProfiler() {
|
|
|
119
119
|
changeData: {}
|
|
120
120
|
};
|
|
121
121
|
transformMap[log.currentTransform] = entry;
|
|
122
|
-
|
|
122
|
+
|
|
123
|
+
// (JS-Confuser.com can run performance benchmark tests here)
|
|
123
124
|
(_profiler$callback = _profiler.callback) === null || _profiler$callback === void 0 || _profiler$callback.call(_profiler, log, entry, ast);
|
|
125
|
+
|
|
126
|
+
// The profiler.callback() function may take a long time to execute,
|
|
127
|
+
// so we need to update the currentTransformTime here for accurate profiling.
|
|
128
|
+
currentTransformTime = performance.now();
|
|
124
129
|
}
|
|
125
130
|
});
|
|
126
131
|
obfuscator.plugins.forEach(function (_ref) {
|
|
@@ -76,21 +76,23 @@ var _default = exports["default"] = function _default(_ref) {
|
|
|
76
76
|
var mangleNumericalLiterals = true; // 50 => state + X
|
|
77
77
|
var mangleBooleanLiterals = true; // true => state == X
|
|
78
78
|
var addWithStatement = true; // Disabling not supported yet
|
|
79
|
+
var addGeneratorFunction = true; // Wrap in generator function?
|
|
79
80
|
|
|
80
81
|
var cffPrefix = me.getPlaceholder();
|
|
81
82
|
|
|
82
83
|
// Amount of blocks changed by Control Flow Flattening
|
|
83
84
|
var cffCounter = 0;
|
|
84
|
-
var functionsModified =
|
|
85
|
+
var functionsModified = [];
|
|
85
86
|
function flagFunctionToAvoid(path, reason) {
|
|
86
87
|
var fnOrProgram = (0, _astUtils.getParentFunctionOrProgram)(path);
|
|
87
88
|
fnOrProgram.node[CFF_UNSAFE] = reason;
|
|
88
89
|
}
|
|
89
90
|
return {
|
|
90
91
|
post: function post() {
|
|
91
|
-
functionsModified.
|
|
92
|
+
for (var _i = 0, _functionsModified = functionsModified; _i < _functionsModified.length; _i++) {
|
|
93
|
+
var node = _functionsModified[_i];
|
|
92
94
|
node[_constants.UNSAFE] = true;
|
|
93
|
-
}
|
|
95
|
+
}
|
|
94
96
|
},
|
|
95
97
|
visitor: {
|
|
96
98
|
// Unsafe detection
|
|
@@ -154,7 +156,6 @@ var _default = exports["default"] = function _default(_ref) {
|
|
|
154
156
|
if (functionPath.node.async || functionPath.node.generator) return;
|
|
155
157
|
}
|
|
156
158
|
programOrFunctionPath.scope.crawl();
|
|
157
|
-
var blockFnParent = (0, _astUtils.getParentFunctionOrProgram)(blockPath);
|
|
158
159
|
var hasIllegalNode = false;
|
|
159
160
|
var bindingNames = new Set();
|
|
160
161
|
blockPath.traverse({
|
|
@@ -204,6 +205,7 @@ var _default = exports["default"] = function _default(_ref) {
|
|
|
204
205
|
return withIdentifier("state_".concat(i));
|
|
205
206
|
});
|
|
206
207
|
var argVar = withIdentifier("_arg");
|
|
208
|
+
var usedArgVar = false;
|
|
207
209
|
var _didReturnVar = withIdentifier("return");
|
|
208
210
|
var basicBlocks = new Map();
|
|
209
211
|
|
|
@@ -220,11 +222,6 @@ var _default = exports["default"] = function _default(_ref) {
|
|
|
220
222
|
var withProperty = isDebug ? "with" : scopeNameGen.generate(false);
|
|
221
223
|
var withMemberExpression = new _template["default"]("".concat(scopeVar.name, "[\"").concat(withProperty, "\"]")).expression();
|
|
222
224
|
withMemberExpression.object[_constants.NO_RENAME] = cffIndex;
|
|
223
|
-
|
|
224
|
-
// Create 'resetWith' function - Safely resets the 'with' object to none
|
|
225
|
-
var resetWithProperty = isDebug ? "resetWith" : scopeNameGen.generate(false);
|
|
226
|
-
var resetWithMemberExpression = new _template["default"]("".concat(scopeVar.name, "[\"").concat(resetWithProperty, "\"]")).expression();
|
|
227
|
-
resetWithMemberExpression.object[_constants.NO_RENAME] = cffIndex;
|
|
228
225
|
var ScopeManager = /*#__PURE__*/function () {
|
|
229
226
|
function ScopeManager(scope, initializingBasicBlock) {
|
|
230
227
|
_classCallCheck(this, ScopeManager);
|
|
@@ -234,14 +231,17 @@ var _default = exports["default"] = function _default(_ref) {
|
|
|
234
231
|
_defineProperty(this, "nameGen", addWithStatement ? me.obfuscator.nameGen : new _NameGen.NameGen(me.options.identifierGenerator));
|
|
235
232
|
this.scope = scope;
|
|
236
233
|
this.initializingBasicBlock = initializingBasicBlock;
|
|
237
|
-
this.propertyName = isDebug ? "_" + scopeCounter++ : scopeNameGen.generate();
|
|
234
|
+
this.propertyName = isDebug ? "_" + cffIndex + "_" + scopeCounter++ : scopeNameGen.generate();
|
|
238
235
|
}
|
|
239
236
|
return _createClass(ScopeManager, [{
|
|
240
237
|
key: "findBestWithDiscriminant",
|
|
241
238
|
value: function findBestWithDiscriminant(basicBlock) {
|
|
242
239
|
var _this$parent;
|
|
240
|
+
// This initializing block is forbidden to have a with discriminant
|
|
241
|
+
// (As no previous code is able to prepare the with discriminant)
|
|
243
242
|
if (basicBlock !== this.initializingBasicBlock) {
|
|
244
|
-
|
|
243
|
+
// If no variables were defined in this scope, don't use it
|
|
244
|
+
if (Object.keys(this.scope.bindings).length > 0) return this;
|
|
245
245
|
}
|
|
246
246
|
return (_this$parent = this.parent) === null || _this$parent === void 0 ? void 0 : _this$parent.findBestWithDiscriminant(basicBlock);
|
|
247
247
|
}
|
|
@@ -290,7 +290,8 @@ var _default = exports["default"] = function _default(_ref) {
|
|
|
290
290
|
}, {
|
|
291
291
|
key: "getMemberExpression",
|
|
292
292
|
value: function getMemberExpression(name) {
|
|
293
|
-
var
|
|
293
|
+
var object = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getScopeObject();
|
|
294
|
+
var memberExpression = t.memberExpression(object, t.stringLiteral(name), true);
|
|
294
295
|
return memberExpression;
|
|
295
296
|
}
|
|
296
297
|
}, {
|
|
@@ -316,13 +317,6 @@ var _default = exports["default"] = function _default(_ref) {
|
|
|
316
317
|
for (var key in propertyMap) {
|
|
317
318
|
properties.push(t.objectProperty(t.stringLiteral(key), propertyMap[key], true));
|
|
318
319
|
}
|
|
319
|
-
if (this === mainScope) {
|
|
320
|
-
// Reset With logic
|
|
321
|
-
properties.push(t.objectProperty(t.stringLiteral(resetWithProperty), new _template["default"]("\n (function(newStateValues, alwaysUndefined){\n {withMemberExpression} = alwaysUndefined;\n {arrayPattern} = newStateValues\n })\n ").expression({
|
|
322
|
-
withMemberExpression: (0, _node.deepClone)(withMemberExpression),
|
|
323
|
-
arrayPattern: t.arrayPattern((0, _node.deepClone)(stateVars))
|
|
324
|
-
}), true));
|
|
325
|
-
}
|
|
326
320
|
return t.objectExpression(properties);
|
|
327
321
|
}
|
|
328
322
|
}, {
|
|
@@ -396,7 +390,7 @@ var _default = exports["default"] = function _default(_ref) {
|
|
|
396
390
|
return _createClass(BasicBlock, [{
|
|
397
391
|
key: "withDiscriminant",
|
|
398
392
|
get: function get() {
|
|
399
|
-
if (!this.allowWithDiscriminant) return
|
|
393
|
+
if (!this.allowWithDiscriminant) return;
|
|
400
394
|
return this.bestWithDiscriminant;
|
|
401
395
|
}
|
|
402
396
|
}, {
|
|
@@ -599,8 +593,9 @@ var _default = exports["default"] = function _default(_ref) {
|
|
|
599
593
|
fnTopBlock.body.unshift(t.expressionStatement(t.stringLiteral("Function " + statement.node.id.name + " -> Renamed to " + rename)));
|
|
600
594
|
}
|
|
601
595
|
|
|
602
|
-
// Unpack parameters
|
|
596
|
+
// Unpack parameters from the parameter 'argVar'
|
|
603
597
|
if (statement.node.params.length > 0) {
|
|
598
|
+
usedArgVar = true;
|
|
604
599
|
fnTopBlock.body.unshift(t.variableDeclaration("var", [t.variableDeclarator(t.arrayPattern(statement.node.params), (0, _node.deepClone)(argVar))]));
|
|
605
600
|
|
|
606
601
|
// Change bindings from 'param' to 'var'
|
|
@@ -748,7 +743,7 @@ var _default = exports["default"] = function _default(_ref) {
|
|
|
748
743
|
me.changeData.deadCode++;
|
|
749
744
|
}
|
|
750
745
|
};
|
|
751
|
-
for (var
|
|
746
|
+
for (var _i2 = 0; _i2 < cloneChunkCount; _i2++) {
|
|
752
747
|
_loop2();
|
|
753
748
|
}
|
|
754
749
|
}
|
|
@@ -838,6 +833,8 @@ var _default = exports["default"] = function _default(_ref) {
|
|
|
838
833
|
if (!(0, _astUtils.isVariableIdentifier)(path)) return;
|
|
839
834
|
if (me.isSkipped(path)) return;
|
|
840
835
|
if (path.node[_constants.NO_RENAME] === cffIndex) return;
|
|
836
|
+
// For identifiers using implicit with discriminant, skip
|
|
837
|
+
if (path.node[_constants.WITH_STATEMENT]) return;
|
|
841
838
|
var identifierName = path.node.name;
|
|
842
839
|
if (identifierName === gotoFunctionName) return;
|
|
843
840
|
var binding = path.scope.getBinding(identifierName);
|
|
@@ -847,22 +844,29 @@ var _default = exports["default"] = function _default(_ref) {
|
|
|
847
844
|
if (binding.kind === "var" || binding.kind === "let" || binding.kind === "const") {} else {
|
|
848
845
|
return;
|
|
849
846
|
}
|
|
850
|
-
|
|
851
|
-
// console.log("No binding found for " + identifierName);
|
|
852
|
-
|
|
853
847
|
var scopeManager = scopeToScopeManager.get(binding.scope);
|
|
854
848
|
if (!scopeManager) return;
|
|
855
849
|
var newName = scopeManager.getNewName(identifierName, path.node);
|
|
856
850
|
var memberExpression = scopeManager.getMemberExpression(newName);
|
|
857
851
|
scopeManager.isNotUsed = false;
|
|
852
|
+
|
|
853
|
+
// Scope object as with discriminant? Use identifier
|
|
854
|
+
if (typeof basicBlock.withDiscriminant === "undefined") {
|
|
855
|
+
var id = t.identifier(scopeManager.propertyName);
|
|
856
|
+
id[_constants.WITH_STATEMENT] = true;
|
|
857
|
+
id[_constants.NO_RENAME] = cffIndex;
|
|
858
|
+
memberExpression = scopeManager.getMemberExpression(newName, id);
|
|
859
|
+
}
|
|
858
860
|
if ((0, _astUtils.isDefiningIdentifier)(path)) {
|
|
859
861
|
(0, _astUtils.replaceDefiningIdentifierToMemberExpression)(path, memberExpression);
|
|
860
862
|
return;
|
|
861
863
|
}
|
|
862
864
|
if (!path.container) return;
|
|
863
|
-
var isModified = (0, _astUtils.isModifiedIdentifier)(path);
|
|
864
865
|
if (basicBlock.withDiscriminant && basicBlock.withDiscriminant === scopeManager && basicBlock.withDiscriminant.hasOwnName(identifierName)) {
|
|
865
|
-
|
|
866
|
+
// The defining mode must directly append to the scope object
|
|
867
|
+
// Subsequent uses can use the identifier
|
|
868
|
+
var isDefiningNode = path.node === binding.identifier;
|
|
869
|
+
if (!isDefiningNode) {
|
|
866
870
|
memberExpression = basicBlock.identifier(newName, scopeManager);
|
|
867
871
|
}
|
|
868
872
|
}
|
|
@@ -902,28 +906,28 @@ var _default = exports["default"] = function _default(_ref) {
|
|
|
902
906
|
var newStateValues = jumpBlock.stateValues,
|
|
903
907
|
newTotalState = jumpBlock.totalState;
|
|
904
908
|
var assignments = [];
|
|
905
|
-
var needsIndividualAssignments = true;
|
|
906
909
|
if (jumpBlock.withDiscriminant) {
|
|
907
910
|
assignments.push(t.assignmentExpression("=", (0, _node.deepClone)(withMemberExpression), jumpBlock.withDiscriminant.getScopeObject()));
|
|
908
911
|
} else if (basicBlock.withDiscriminant) {
|
|
909
|
-
|
|
910
|
-
|
|
912
|
+
// Reset the with discriminant to undefined using fake property
|
|
913
|
+
// scope["fake"] -> undefined
|
|
914
|
+
|
|
915
|
+
var fakeProperty = scopeNameGen.generate();
|
|
916
|
+
assignments.push(t.assignmentExpression("=", (0, _node.deepClone)(withMemberExpression), t.memberExpression((0, _node.deepClone)(scopeVar), t.stringLiteral(fakeProperty), true)));
|
|
911
917
|
}
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
assignment = t.assignmentExpression("+=", (0, _node.deepClone)(stateVars[_i8]), (0, _node.numericLiteral)(newValue - oldValue));
|
|
924
|
-
}
|
|
925
|
-
assignments.push(assignment);
|
|
918
|
+
for (var _i9 = 0; _i9 < stateVars.length; _i9++) {
|
|
919
|
+
var oldValue = currentStateValues[_i9];
|
|
920
|
+
var newValue = newStateValues[_i9];
|
|
921
|
+
|
|
922
|
+
// console.log(oldValue, newValue);
|
|
923
|
+
if (oldValue === newValue) continue; // No diff needed if the value doesn't change
|
|
924
|
+
|
|
925
|
+
var assignment = t.assignmentExpression("=", (0, _node.deepClone)(stateVars[_i9]), (0, _node.numericLiteral)(newValue));
|
|
926
|
+
if (!isDebug && addRelativeAssignments) {
|
|
927
|
+
// Use diffs to create confusing code
|
|
928
|
+
assignment = t.assignmentExpression("+=", (0, _node.deepClone)(stateVars[_i9]), (0, _node.numericLiteral)(newValue - oldValue));
|
|
926
929
|
}
|
|
930
|
+
assignments.push(assignment);
|
|
927
931
|
}
|
|
928
932
|
|
|
929
933
|
// Add debug label
|
|
@@ -960,8 +964,8 @@ var _default = exports["default"] = function _default(_ref) {
|
|
|
960
964
|
var mainScope = basicBlocks.get(startLabel).scopeManager;
|
|
961
965
|
var predicateNumbers = new Map();
|
|
962
966
|
var predicateNumberCount = isDebug || !addPredicateTests ? 0 : (0, _randomUtils.getRandomInteger)(1, 4);
|
|
963
|
-
for (var
|
|
964
|
-
var name = mainScope.getNewName(me.getPlaceholder("predicate_" +
|
|
967
|
+
for (var _i3 = 0; _i3 < predicateNumberCount; _i3++) {
|
|
968
|
+
var name = mainScope.getNewName(me.getPlaceholder("predicate_" + _i3));
|
|
965
969
|
var number = (0, _randomUtils.getRandomInteger)(-250, 250);
|
|
966
970
|
predicateNumbers.set(name, number);
|
|
967
971
|
}
|
|
@@ -982,7 +986,7 @@ var _default = exports["default"] = function _default(_ref) {
|
|
|
982
986
|
|
|
983
987
|
// Add random assignments to impossible blocks
|
|
984
988
|
var fakeAssignmentCount = (0, _randomUtils.getRandomInteger)(1, 3);
|
|
985
|
-
for (var
|
|
989
|
+
for (var _i4 = 0; _i4 < fakeAssignmentCount; _i4++) {
|
|
986
990
|
var impossibleBlock = (0, _randomUtils.choice)(getImpossibleBasicBlocks());
|
|
987
991
|
if (impossibleBlock) {
|
|
988
992
|
var _impossibleBlock$body;
|
|
@@ -1016,7 +1020,7 @@ var _default = exports["default"] = function _default(_ref) {
|
|
|
1016
1020
|
(0, _randomUtils.shuffle)(blocks);
|
|
1017
1021
|
}
|
|
1018
1022
|
var _loop3 = function _loop3() {
|
|
1019
|
-
var block = _blocks[
|
|
1023
|
+
var block = _blocks[_i5];
|
|
1020
1024
|
if (block.label === endLabel) {
|
|
1021
1025
|
// ok(block.body.length === 0);
|
|
1022
1026
|
return 1; // continue
|
|
@@ -1081,19 +1085,19 @@ var _default = exports["default"] = function _default(_ref) {
|
|
|
1081
1085
|
if (!isDebug && addFakeTests && (0, _randomUtils.chance)(50)) {
|
|
1082
1086
|
// Add fake tests
|
|
1083
1087
|
var fakeTestCount = (0, _randomUtils.getRandomInteger)(1, 3);
|
|
1084
|
-
for (var
|
|
1088
|
+
for (var _i6 = 0; _i6 < fakeTestCount; _i6++) {
|
|
1085
1089
|
tests.push((0, _node.numericLiteral)(stateIntGen.generate()));
|
|
1086
1090
|
}
|
|
1087
1091
|
(0, _randomUtils.shuffle)(tests);
|
|
1088
1092
|
}
|
|
1089
1093
|
var lastTest = tests.pop();
|
|
1090
|
-
for (var
|
|
1091
|
-
var _test = _tests[
|
|
1094
|
+
for (var _i7 = 0, _tests = tests; _i7 < _tests.length; _i7++) {
|
|
1095
|
+
var _test = _tests[_i7];
|
|
1092
1096
|
switchCases.push(t.switchCase(_test, []));
|
|
1093
1097
|
}
|
|
1094
1098
|
switchCases.push(t.switchCase(lastTest, block.thisPath.node.body));
|
|
1095
1099
|
};
|
|
1096
|
-
for (var
|
|
1100
|
+
for (var _i5 = 0, _blocks = blocks; _i5 < _blocks.length; _i5++) {
|
|
1097
1101
|
if (_loop3()) continue;
|
|
1098
1102
|
}
|
|
1099
1103
|
if (!isDebug && addFakeTests) {
|
|
@@ -1113,17 +1117,18 @@ var _default = exports["default"] = function _default(_ref) {
|
|
|
1113
1117
|
var switchStatement = t.labeledStatement(t.identifier(switchLabel), t.switchStatement(discriminant, switchCases));
|
|
1114
1118
|
var startStateValues = basicBlocks.get(startLabel).stateValues;
|
|
1115
1119
|
var endTotalState = basicBlocks.get(endLabel).totalState;
|
|
1116
|
-
var whileStatement = t.whileStatement(t.binaryExpression("!==", (0, _node.deepClone)(discriminant), (0, _node.numericLiteral)(endTotalState)), t.blockStatement([t.withStatement(new _template["default"]("{withDiscriminant} || {}").expression({
|
|
1117
|
-
withDiscriminant: (0, _node.deepClone)(withMemberExpression)
|
|
1120
|
+
var whileStatement = t.whileStatement(t.binaryExpression("!==", (0, _node.deepClone)(discriminant), (0, _node.numericLiteral)(endTotalState)), t.blockStatement([t.withStatement(new _template["default"]("{withDiscriminant} || {scopeVar}").expression({
|
|
1121
|
+
withDiscriminant: (0, _node.deepClone)(withMemberExpression),
|
|
1122
|
+
scopeVar: (0, _node.deepClone)(scopeVar)
|
|
1118
1123
|
}), t.blockStatement([switchStatement]))]));
|
|
1119
|
-
var parameters = [].concat(_toConsumableArray(stateVars), [
|
|
1124
|
+
var parameters = [].concat(_toConsumableArray(stateVars), [scopeVar, argVar]).map(function (id) {
|
|
1120
1125
|
return (0, _node.deepClone)(id);
|
|
1121
1126
|
});
|
|
1122
1127
|
var parametersNames = parameters.map(function (id) {
|
|
1123
1128
|
return id.name;
|
|
1124
1129
|
});
|
|
1125
|
-
for (var
|
|
1126
|
-
var _functionExpressions$ = _slicedToArray(_functionExpressions[
|
|
1130
|
+
for (var _i8 = 0, _functionExpressions = functionExpressions; _i8 < _functionExpressions.length; _i8++) {
|
|
1131
|
+
var _functionExpressions$ = _slicedToArray(_functionExpressions[_i8], 4),
|
|
1127
1132
|
originalFnName = _functionExpressions$[0],
|
|
1128
1133
|
fnLabel = _functionExpressions$[1],
|
|
1129
1134
|
basicBlock = _functionExpressions$[2],
|
|
@@ -1152,24 +1157,47 @@ var _default = exports["default"] = function _default(_ref) {
|
|
|
1152
1157
|
(0, _assert.ok)(false);
|
|
1153
1158
|
}
|
|
1154
1159
|
}
|
|
1160
|
+
|
|
1161
|
+
// Ensure parameter is added (No effect if not added in this case)
|
|
1155
1162
|
} catch (err) {
|
|
1156
1163
|
_iterator4.e(err);
|
|
1157
1164
|
} finally {
|
|
1158
1165
|
_iterator4.f();
|
|
1159
1166
|
}
|
|
1167
|
+
usedArgVar = true;
|
|
1160
1168
|
Object.assign(fn, new _template["default"]("\n (function (...".concat(argumentsRestName, "){\n ").concat(isDebug ? "\"Calling ".concat(originalFnName, ", Label: ").concat(fnLabel, "\";") : "", "\n return {callExpression}\n })\n \n ")).expression({
|
|
1161
|
-
callExpression:
|
|
1169
|
+
callExpression: createCallExpression(argumentsNodes)
|
|
1162
1170
|
}));
|
|
1163
1171
|
}
|
|
1164
1172
|
var startProgramObjectExpression = basicBlocks.get(startLabel).scopeManager.getObjectExpression(startLabel);
|
|
1165
1173
|
var mainParameters = parameters;
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1174
|
+
|
|
1175
|
+
// First state values use the default parameter for initialization
|
|
1176
|
+
// function main(..., scope = { mainScope: {} }, ...){...}
|
|
1177
|
+
mainParameters.splice(mainParameters.findIndex(function (p) {
|
|
1178
|
+
return p.name === scopeVar.name;
|
|
1179
|
+
}), 1, t.assignmentPattern((0, _node.deepClone)(scopeVar), startProgramObjectExpression));
|
|
1180
|
+
|
|
1181
|
+
// Remove parameter 'argVar' if never used (No function calls obfuscated)
|
|
1182
|
+
if (!usedArgVar) {
|
|
1183
|
+
mainParameters.pop();
|
|
1184
|
+
}
|
|
1185
|
+
var mainFnDeclaration = t.functionDeclaration((0, _node.deepClone)(mainFnName), parameters, t.blockStatement([whileStatement]), addGeneratorFunction);
|
|
1186
|
+
|
|
1187
|
+
// The main function is always called with same number of arguments
|
|
1169
1188
|
mainFnDeclaration[_constants.PREDICTABLE] = true;
|
|
1170
|
-
|
|
1189
|
+
function createCallExpression(argumentNodes) {
|
|
1190
|
+
var callExpression = t.callExpression((0, _node.deepClone)(mainFnName), argumentNodes);
|
|
1191
|
+
if (!addGeneratorFunction) {
|
|
1192
|
+
return callExpression;
|
|
1193
|
+
}
|
|
1194
|
+
return new _template["default"]("\n ({callExpression})[\"next\"]()[\"value\"];\n ").expression({
|
|
1195
|
+
callExpression: callExpression
|
|
1196
|
+
});
|
|
1197
|
+
}
|
|
1198
|
+
var startProgramExpression = createCallExpression(startStateValues.map(function (stateValue) {
|
|
1171
1199
|
return (0, _node.numericLiteral)(stateValue);
|
|
1172
|
-
}))
|
|
1200
|
+
}));
|
|
1173
1201
|
var _resultVar = withIdentifier("result");
|
|
1174
1202
|
var isTopLevel = blockPath.isProgram();
|
|
1175
1203
|
var allowReturns = !isTopLevel && blockPath.find(function (p) {
|
|
@@ -1186,7 +1214,7 @@ var _default = exports["default"] = function _default(_ref) {
|
|
|
1186
1214
|
}
|
|
1187
1215
|
});
|
|
1188
1216
|
blockPath.node.body = [].concat(prependNodes, [mainFnDeclaration], _toConsumableArray(startProgramStatements));
|
|
1189
|
-
functionsModified.
|
|
1217
|
+
functionsModified.push(programOrFunctionPath.node);
|
|
1190
1218
|
|
|
1191
1219
|
// Reset all bindings here
|
|
1192
1220
|
blockPath.scope.bindings = Object.create(null);
|
|
@@ -68,8 +68,10 @@ var _default = exports["default"] = function _default(_ref) {
|
|
|
68
68
|
|
|
69
69
|
// me.log(codeTrimmed, hashCode);
|
|
70
70
|
me.changeData.functions++;
|
|
71
|
-
|
|
71
|
+
var hashName = nameGen.generate();
|
|
72
|
+
funcDecPath.node.body = t.blockStatement(new _template["default"]("\n var {hashName} = ".concat(selfCacheString, " || (").concat(selfCacheString, " = ").concat(obfuscatedHashFnName, "(").concat(newFunctionDeclaration.id.name, ", ").concat(seed, "));\n if({hashName} === ").concat(hashCode, ") {\n {originalBody}\n } else {\n {countermeasures} \n }\n ")).compile({
|
|
72
73
|
originalBody: funcDecPath.node.body.body,
|
|
74
|
+
hashName: hashName,
|
|
73
75
|
countermeasures: function countermeasures() {
|
|
74
76
|
return me.globalState.lock.createCountermeasuresCode();
|
|
75
77
|
}
|
|
@@ -79,7 +79,7 @@ var _default = exports["default"] = function _default(_ref) {
|
|
|
79
79
|
}
|
|
80
80
|
if (me.options.lock.selfDefending) {
|
|
81
81
|
me.options.lock.customLocks.push({
|
|
82
|
-
code: "\n (\n function(){\n // Breaks any code formatter\n var namedFunction = function(){\n const test = function(){\n const regExp=new RegExp('\\n');\n return regExp['test'](namedFunction)\n };\n\n if(test()) {\n {countermeasures}\n }\n }\n\n
|
|
82
|
+
code: "\n (\n function(){\n // Breaks any code formatter\n var namedFunction = function(){\n const test = function(){\n const regExp= new RegExp('\\n');\n return regExp['test'](namedFunction)\n };\n\n if(test()) {\n {countermeasures}\n }\n }\n\n return namedFunction();\n }\n )();\n ",
|
|
83
83
|
percentagePerBlock: 0.5
|
|
84
84
|
});
|
|
85
85
|
}
|