Przeglądaj źródła

Sync with master

sanex 3 lat temu
rodzic
commit
08e308e92c
22 zmienionych plików z 496 dodań i 381 usunięć
  1. 12 0
      CHANGELOG.md
  2. 222 203
      README.md
  3. 0 0
      dist/index.browser.js
  4. 0 0
      dist/index.cli.js
  5. 0 0
      dist/index.js
  6. 10 10
      package.json
  7. 1 1
      src/ASTParserFacade.ts
  8. 2 1
      src/custom-code-helpers/string-array/StringArrayCallsWrapperBase64CodeHelper.ts
  9. 9 0
      src/custom-code-helpers/string-array/StringArrayCallsWrapperCodeHelper.ts
  10. 6 2
      src/custom-code-helpers/string-array/StringArrayCallsWrapperRc4CodeHelper.ts
  11. 8 1
      src/custom-code-helpers/string-array/templates/string-array-calls-wrapper/AtobTemplate.ts
  12. 4 10
      src/custom-code-helpers/string-array/templates/string-array-calls-wrapper/Rc4Template.ts
  13. 9 20
      src/custom-code-helpers/string-array/templates/string-array-calls-wrapper/StringArrayBase64DecodeTemplate.ts
  14. 14 7
      src/custom-code-helpers/string-array/templates/string-array-calls-wrapper/StringArrayCallsWrapperTemplate.ts
  15. 5 7
      src/custom-code-helpers/string-array/templates/string-array-calls-wrapper/StringArrayRC4DecodeTemplate.ts
  16. 8 1
      src/node-transformers/dead-code-injection-transformers/DeadCodeInjectionTransformer.ts
  17. 3 2
      test/functional-tests/custom-code-helpers/string-array/StringArrayCallsWrapperCodeHelper.spec.ts
  18. 18 2
      test/functional-tests/custom-code-helpers/string-array/templates/string-array-calls-wrapper-node-template/StringArrayCallsWrapperTemplate.spec.ts
  19. 20 10
      test/functional-tests/generators/identifier-names-generators/dictionary-identifier-names-generator/DictionaryIdentifierNamesGenerator.spec.ts
  20. 2 1
      test/functional-tests/generators/identifier-names-generators/dictionary-identifier-names-generator/fixtures/string-array-storage-name-conflict-1.js
  21. 41 0
      test/functional-tests/node-transformers/dead-code-injection-transformers/DeadCodeInjectionTransformer.spec.ts
  22. 102 103
      yarn.lock

+ 12 - 0
CHANGELOG.md

@@ -4,6 +4,18 @@ v2.16.0
 ---
 ---
 * Added support of `es2022` features: private identifiers and class properties
 * Added support of `es2022` features: private identifiers and class properties
 
 
+v2.15.5
+---
+* Improved `stringArray` calls wrapper decode code
+
+v2.15.4
+---
+* Improved `stringArray` calls wrapper code
+
+v2.15.3
+---
+* Slightly improved integration between `deadCodeInjection` and `stringArrayWrappersChainedCalls` options
+
 v2.15.2
 v2.15.2
 ---
 ---
 * Fixed invalid behaviour of `transformObjectKeys` option when object values contains `this` references. Fixed https://github.com/javascript-obfuscator/javascript-obfuscator/issues/937
 * Fixed invalid behaviour of `transformObjectKeys` option when object values contains `this` references. Fixed https://github.com/javascript-obfuscator/javascript-obfuscator/issues/937

+ 222 - 203
README.md

@@ -120,103 +120,105 @@ var obfuscationResult = JavaScriptObfuscator.obfuscate(
 
 
 console.log(obfuscationResult.getObfuscatedCode());
 console.log(obfuscationResult.getObfuscatedCode());
 /*
 /*
-var _0x1139 = [
-    '250745hAZAIu',
-    'qyvdX',
-    '359787rBCuAH',
+var _0x9947 = [
     'map',
     'map',
-    'CAsQH',
-    '2yDlJiW',
-    'IzZqs',
-    '3|8|4|5|0|',
-    '975554pJYIxL',
-    '2sejBjT',
-    '258646CmEwYP',
-    '23651lJjzwJ',
-    'xqNJa',
-    '37rnYVXp',
     'log',
     'log',
-    'WudlX',
-    'cIfMd',
     'foo\x20',
     'foo\x20',
-    '2GUqEHE',
-    '2|6|7|9|1',
-    '238609DyHPrO',
-    'split',
-    '828371LpDRiJ'
+    'bvmqO',
+    '133039ViRMWR',
+    'xPfLC',
+    'ytpdx',
+    '1243717qSZCyh',
+    '2|7|4|6|9|',
+    '1ErtbCr',
+    '1608314VKvthn',
+    '1ZRaFKN',
+    'XBoAA',
+    '423266kQOYHV',
+    '3|0|5|8|1',
+    '235064xPNdKe',
+    '13RUDZfG',
+    '157gNPQGm',
+    '1639212MvnHZL',
+    'rDjOa',
+    'iBHph',
+    '9926iRHoRl',
+    'split'
 ];
 ];
-function _0x1054 (_0x14a2a4, _0x5a6b22) {
-    _0x14a2a4 = _0x14a2a4 - (0x1c48 + -0x1dd + 0x38f * -0x7);
-    var _0x581b0b = _0x1139[_0x14a2a4];
-    return _0x581b0b;
+function _0x33e4(_0x1809b5, _0x37ef6e) {
+    return _0x33e4 = function (_0x338a69, _0x39ad79) {
+        _0x338a69 = _0x338a69 - (0x1939 + -0xf * 0x1f3 + 0x1 * 0x469);
+        var _0x2b223a = _0x9947[_0x338a69];
+        return _0x2b223a;
+    }, _0x33e4(_0x1809b5, _0x37ef6e);
 }
 }
-(function (_0x190a1e, _0x14558c) {
-    var _0x59720b = _0x1054;
+(function (_0x431d87, _0x156c7f) {
+    var _0x10cf6e = _0x33e4;
     while (!![]) {
     while (!![]) {
         try {
         try {
-            var _0x3dab81 = parseInt(_0x59720b(0x196)) * parseInt(_0x59720b(0x191)) + parseInt(_0x59720b(0x193)) * parseInt(_0x59720b(0x184)) + parseInt(_0x59720b(0x198)) * parseInt(_0x59720b(0x188)) + parseInt(_0x59720b(0x18a)) * parseInt(_0x59720b(0x18c)) + -parseInt(_0x59720b(0x187)) + -parseInt(_0x59720b(0x189)) + -parseInt(_0x59720b(0x195));
-            if (_0x3dab81 === _0x14558c)
+            var _0x330ad1 = -parseInt(_0x10cf6e(0x6c)) * -parseInt(_0x10cf6e(0x6d)) + -parseInt(_0x10cf6e(0x74)) * -parseInt(_0x10cf6e(0x78)) + parseInt(_0x10cf6e(0x6a)) + -parseInt(_0x10cf6e(0x70)) + parseInt(_0x10cf6e(0x6e)) * -parseInt(_0x10cf6e(0x75)) + parseInt(_0x10cf6e(0x72)) + -parseInt(_0x10cf6e(0x67)) * parseInt(_0x10cf6e(0x73));
+            if (_0x330ad1 === _0x156c7f)
                 break;
                 break;
             else
             else
-                _0x190a1e['push'](_0x190a1e['shift']());
-        } catch (_0x58f14d) {
-            _0x190a1e['push'](_0x190a1e['shift']());
+                _0x431d87['push'](_0x431d87['shift']());
+        } catch (_0x9f878) {
+            _0x431d87['push'](_0x431d87['shift']());
         }
         }
     }
     }
-}(_0x1139, 0x2c5c * -0x7 + -0xdfdc6 + 0x16ff98), function () {
-    var _0x9b877 = _0x1054, _0x4add6f = {
-            'WudlX': _0x9b877(0x186) + _0x9b877(0x192),
-            'qyvdX': function (_0x552261, _0x28d3ee) {
-                return _0x552261 + _0x28d3ee;
+}(_0x9947, -0xb6270 + 0x4dfd2 * 0x2 + 0x75460 * 0x2), function () {
+    var _0x1f346d = _0x33e4, _0x860db8 = {
+            'ytpdx': _0x1f346d(0x6b) + _0x1f346d(0x71),
+            'bvmqO': function (_0x560787, _0x519b9e) {
+                return _0x560787 - _0x519b9e;
             },
             },
-            'xqNJa': function (_0x387474, _0x5602bf) {
-                return _0x387474 + _0x5602bf;
+            'rDjOa': function (_0x4501fe, _0x2b07a3) {
+                return _0x4501fe + _0x2b07a3;
             },
             },
-            'CAsQH': _0x9b877(0x190),
-            'IzZqs': function (_0x5d9fd2, _0x9f4faa) {
-                return _0x5d9fd2 - _0x9f4faa;
+            'xPfLC': function (_0x5f3c9b, _0x434936) {
+                return _0x5f3c9b + _0x434936;
             },
             },
-            'cIfMd': function (_0x5f18e0, _0x4c33c5) {
-                return _0x5f18e0 + _0x4c33c5;
-            }
-        }, _0x593549 = _0x4add6f[_0x9b877(0x18e)][_0x9b877(0x194)]('|'), _0x2acb4f = -0x94b + -0x2627 * -0x1 + 0xe6e * -0x2;
+            'XBoAA': function (_0x535b8a, _0x42eef4) {
+                return _0x535b8a + _0x42eef4;
+            },
+            'iBHph': _0x1f346d(0x65)
+        }, _0x346c55 = _0x860db8[_0x1f346d(0x69)][_0x1f346d(0x79)]('|'), _0x3bf817 = 0x4bb * 0x1 + 0x801 + -0xcbc;
     while (!![]) {
     while (!![]) {
-        switch (_0x593549[_0x2acb4f++]) {
+        switch (_0x346c55[_0x3bf817++]) {
         case '0':
         case '0':
-            var _0x10d015 = _0x4add6f[_0x9b877(0x197)](_0x4add6f[_0x9b877(0x18b)](_0x4add6f[_0x9b877(0x183)], -0x3d * -0xc + -0x6f1 * -0x1 + 0x42 * -0x26), 0x62f * 0x3 + 0x1046 * -0x1 + -0x246);
+            console[_0x1f346d(0x7b)](_0x4c96d8);
             continue;
             continue;
         case '1':
         case '1':
-            console[_0x9b877(0x18d)](_0x10d015);
+            console[_0x1f346d(0x7b)](_0x101028);
             continue;
             continue;
         case '2':
         case '2':
-            console[_0x9b877(0x18d)](_0x4cd6e2);
+            var _0x65977d = _0x860db8[_0x1f346d(0x66)]('5', -0x586 + -0x2195 + -0x6 * -0x685);
             continue;
             continue;
         case '3':
         case '3':
-            var _0x4cd6e2 = _0x4add6f[_0x9b877(0x185)]('5', -0x1bc + 0xf61 + 0x5 * -0x2ba);
+            console[_0x1f346d(0x7b)](_0x65977d);
             continue;
             continue;
         case '4':
         case '4':
-            var _0x2c3053 = _0x4add6f[_0x9b877(0x18b)]('5', -'2');
+            var _0x56d39b = _0x860db8[_0x1f346d(0x76)]('5', -'2');
             continue;
             continue;
         case '5':
         case '5':
-            var _0x372d29 = [
+            console[_0x1f346d(0x7b)](_0x56d39b);
+            continue;
+        case '6':
+            var _0x544285 = [
                 '10',
                 '10',
                 '10',
                 '10',
                 '10',
                 '10',
                 '10',
                 '10',
                 '10'
                 '10'
-            ][_0x9b877(0x182)](parseInt);
-            continue;
-        case '6':
-            console[_0x9b877(0x18d)](_0x109ffa);
+            ][_0x1f346d(0x7a)](parseInt);
             continue;
             continue;
         case '7':
         case '7':
-            console[_0x9b877(0x18d)](_0x2c3053);
+            var _0x4c96d8 = _0x860db8[_0x1f346d(0x68)]('5', 0x622 * -0x6 + 0x4a * 0x3 + 0x1 * 0x23f1);
             continue;
             continue;
         case '8':
         case '8':
-            var _0x109ffa = _0x4add6f[_0x9b877(0x18f)]('5', -0x1d70 + -0x1654 + -0xf1 * -0x37);
+            console[_0x1f346d(0x7b)](_0x544285);
             continue;
             continue;
         case '9':
         case '9':
-            console[_0x9b877(0x18d)](_0x372d29);
+            var _0x101028 = _0x860db8[_0x1f346d(0x6f)](_0x860db8[_0x1f346d(0x6f)](_0x860db8[_0x1f346d(0x77)], 0x6fb * 0x5 + 0x1ebf * 0x1 + -0x41a5), 0x209 * 0xa + 0x1314 + -0x276d);
             continue;
             continue;
         }
         }
         break;
         break;
@@ -333,17 +335,6 @@ To prevent this set the unique prefix for all global identifiers for each obfusc
 
 
 When using CLI this prefix will be added automatically.
 When using CLI this prefix will be added automatically.
 
 
-## Antiviruses false positive virus alerts
-
-Some input source code that will obfuscated with some obfuscation options can trigger false positive alerts in a few antiviruses. If you will get this false positive triggers, try to play with obfuscation options.
-
-* Try to change `stringArrayEncoding` option value between `rc4` and `base64` values or disable it completely;
-* Try to change `identifierNamesGenerator` option value from `hexadecimal` on `mangled`;
-* Try to disable `selfDefending`.
-
-If this wont help - attach your source code and describe your obfuscation options here:
-https://github.com/javascript-obfuscator/javascript-obfuscator/issues/51
-
 ## JavaScript Obfuscator Options
 ## JavaScript Obfuscator Options
 
 
 Following options are available for the JS Obfuscator:
 Following options are available for the JS Obfuscator:
@@ -569,92 +560,101 @@ Example:
     if (true) {
     if (true) {
         var foo = function () {
         var foo = function () {
             console.log('abc');
             console.log('abc');
-            console.log('cde');
-            console.log('efg');
-            console.log('hij');
         };
         };
-        
         var bar = function () {
         var bar = function () {
-            console.log('klm');
-            console.log('nop');
-            console.log('qrs');
+            console.log('def');
         };
         };
-    
         var baz = function () {
         var baz = function () {
-            console.log('tuv');
-            console.log('wxy');
-            console.log('z');
+            console.log('ghi');
         };
         };
-    
+        var bark = function () {
+            console.log('jkl');
+        };
+        var hawk = function () {
+            console.log('mno');
+        };
+
         foo();
         foo();
         bar();
         bar();
         baz();
         baz();
+        bark();
+        hawk();
     }
     }
 })();
 })();
 
 
 // output
 // output
-var _0x5024 = [
-    'zaU',
-    'log',
-    'tuv',
-    'wxy',
+var _0x37b8 = [
+    'YBCtz',
+    'GlrkA',
+    'urPbb',
     'abc',
     'abc',
-    'cde',
-    'efg',
-    'hij',
-    'QhG',
-    'TeI',
-    'klm',
-    'nop',
-    'qrs',
-    'bZd',
-    'HMx'
+    'NMIhC',
+    'yZgAj',
+    'zrAId',
+    'EtyJA',
+    'log',
+    'mno',
+    'jkl',
+    'def',
+    'Quzya',
+    'IWbBa',
+    'ghi'
 ];
 ];
-function _0x4502 (_0x1254b1, _0x583689) {
-    _0x1254b1 = _0x1254b1 - 0x0;
-    var _0x529b49 = _0x5024[_0x1254b1];
-    return _0x529b49;
+function _0x43a7(_0x12cf56, _0x587376) {
+    _0x43a7 = function (_0x2f87a8, _0x47eac2) {
+        _0x2f87a8 = _0x2f87a8 - (0x16a7 * 0x1 + 0x5 * 0x151 + -0x1c92);
+        var _0x341e03 = _0x37b8[_0x2f87a8];
+        return _0x341e03;
+    };
+    return _0x43a7(_0x12cf56, _0x587376);
 }
 }
 (function () {
 (function () {
     if (!![]) {
     if (!![]) {
-        var _0x16c18d = function () {
-            if (_0x4502('0x0') !== _0x4502('0x0')) {
-                console[_0x4502('0x1')](_0x4502('0x2'));
-                console[_0x4502('0x1')](_0x4502('0x3'));
-                console[_0x4502('0x1')]('z');
+        var _0xbbe28f = function () {
+            var _0x2fc85f = _0x43a7;
+            if (_0x2fc85f(0xaf) === _0x2fc85f(0xae)) {
+                _0x1dd94f[_0x2fc85f(0xb2)](_0x2fc85f(0xb5));
+            } else {
+                console[_0x2fc85f(0xb2)](_0x2fc85f(0xad));
+            }
+        };
+        var _0x5e46bc = function () {
+            var _0x15b472 = _0x43a7;
+            if (_0x15b472(0xb6) !== _0x15b472(0xaa)) {
+                console[_0x15b472(0xb2)](_0x15b472(0xb5));
+            } else {
+                _0x47eac2[_0x15b472(0xb2)](_0x15b472(0xad));
+            }
+        };
+        var _0x3669e8 = function () {
+            var _0x47a442 = _0x43a7;
+            if (_0x47a442(0xb7) !== _0x47a442(0xb0)) {
+                console[_0x47a442(0xb2)](_0x47a442(0xb8));
             } else {
             } else {
-                console[_0x4502('0x1')](_0x4502('0x4'));
-                console[_0x4502('0x1')](_0x4502('0x5'));
-                console[_0x4502('0x1')](_0x4502('0x6'));
-                console[_0x4502('0x1')](_0x4502('0x7'));
+                _0x24e0bf[_0x47a442(0xb2)](_0x47a442(0xb3));
             }
             }
         };
         };
-        var _0x1f7292 = function () {
-            if (_0x4502('0x8') === _0x4502('0x9')) {
-                console[_0x4502('0x1')](_0x4502('0xa'));
-                console[_0x4502('0x1')](_0x4502('0xb'));
-                console[_0x4502('0x1')](_0x4502('0xc'));
+        var _0x28b05a = function () {
+            var _0x497902 = _0x43a7;
+            if (_0x497902(0xb1) === _0x497902(0xb1)) {
+                console[_0x497902(0xb2)](_0x497902(0xb4));
             } else {
             } else {
-                console[_0x4502('0x1')](_0x4502('0xa'));
-                console[_0x4502('0x1')](_0x4502('0xb'));
-                console[_0x4502('0x1')](_0x4502('0xc'));
+                _0x59c9c6[_0x497902(0xb2)](_0x497902(0xb4));
             }
             }
         };
         };
-        var _0x33b212 = function () {
-            if (_0x4502('0xd') !== _0x4502('0xe')) {
-                console[_0x4502('0x1')](_0x4502('0x2'));
-                console[_0x4502('0x1')](_0x4502('0x3'));
-                console[_0x4502('0x1')]('z');
+        var _0x402a54 = function () {
+            var _0x1906b7 = _0x43a7;
+            if (_0x1906b7(0xab) === _0x1906b7(0xac)) {
+                _0xb89cd0[_0x1906b7(0xb2)](_0x1906b7(0xb8));
             } else {
             } else {
-                console[_0x4502('0x1')](_0x4502('0x4'));
-                console[_0x4502('0x1')](_0x4502('0x5'));
-                console[_0x4502('0x1')](_0x4502('0x6'));
-                console[_0x4502('0x1')](_0x4502('0x7'));
+                console[_0x1906b7(0xb2)](_0x1906b7(0xb3));
             }
             }
         };
         };
-        _0x16c18d();
-        _0x1f7292();
-        _0x33b212();
+        _0xbbe28f();
+        _0x5e46bc();
+        _0x3669e8();
+        _0x28b05a();
+        _0x402a54();
     }
     }
 }());
 }());
 ```
 ```
@@ -1174,33 +1174,36 @@ function test () {
 const eagle = 'eagle';
 const eagle = 'eagle';
 
 
 // Output, stringArrayWrappersCount: 5
 // Output, stringArrayWrappersCount: 5
-const _0x3018 = [
-    'foo',
-    'bar',
-    'baz',
+const _0x3f6c = [
     'bark',
     'bark',
+    'bar',
+    'foo',
+    'eagle',
     'hawk',
     'hawk',
-    'eagle'
+    'baz'
 ];
 ];
-function _0x380f (_0x30182a, _0x380f29) {
-    _0x30182a = _0x30182a - 0x0;
-    let _0x4e002c = _0x3018[_0x30182a];
-    return _0x4e002c;
+const _0x48f96e = _0x2e13;
+const _0x4dfed8 = _0x2e13;
+const _0x55e970 = _0x2e13;
+function _0x2e13(_0x33c4f5, _0x3f6c62) {
+    _0x2e13 = function (_0x2e1388, _0x60b1e) {
+        _0x2e1388 = _0x2e1388 - 0xe2;
+        let _0x53d475 = _0x3f6c[_0x2e1388];
+        return _0x53d475;
+    };
+    return _0x2e13(_0x33c4f5, _0x3f6c62);
 }
 }
-const _0xe4db7c = _0x380f;
-const _0x26ca42 = _0x380f;
-const _0x58c610 = _0x380f;
-const foo = _0x58c610('0x0');
-const bar = _0x26ca42('0x1');
+const foo = _0x48f96e(0xe4);
+const bar = _0x4dfed8(0xe3);
 function test() {
 function test() {
-    const _0x500eda = _0x380f;
-    const _0x1d1760 = _0x380f;
-    const _0x4ca8b0 = _0x380f;
-    const _0x4e002c = _0x4ca8b0('0x2');
-    const _0x573b1c = _0x1d1760('0x3');
-    const _0x1fb6ef = _0x500eda('0x4');
+    const _0x1c262f = _0x2e13;
+    const _0x54d7a4 = _0x2e13;
+    const _0x5142fe = _0x2e13;
+    const _0x1392b0 = _0x1c262f(0xe7);
+    const _0x201a58 = _0x1c262f(0xe2);
+    const _0xd3a7fb = _0x1c262f(0xe6);
 }
 }
-const eagle = _0x26ca42('0x5');
+const eagle = _0x48f96e(0xe5);
 ```
 ```
 
 
 ### `stringArrayWrappersChainedCalls`
 ### `stringArrayWrappersChainedCalls`
@@ -1227,33 +1230,36 @@ function test () {
 }
 }
 
 
 // Output, stringArrayWrappersCount: 5, stringArrayWrappersChainedCalls: true
 // Output, stringArrayWrappersCount: 5, stringArrayWrappersChainedCalls: true
-const _0x4714 = [
-    'foo',
+const _0x40c2 = [
     'bar',
     'bar',
-    'baz',
     'bark',
     'bark',
     'hawk',
     'hawk',
-    'eagle'
+    'eagle',
+    'foo',
+    'baz'
 ];
 ];
-function _0x2bdb (_0x471439, _0x2bdb71) {
-    _0x471439 = _0x471439 - 0x0;
-    let _0x6e47e6 = _0x4714[_0x471439];
-    return _0x6e47e6;
+const _0x31c087 = _0x3280;
+const _0x31759a = _0x3280;
+function _0x3280(_0x1f52ee, _0x40c2a2) {
+    _0x3280 = function (_0x3280a4, _0xf07b02) {
+        _0x3280a4 = _0x3280a4 - 0x1c4;
+        let _0x57a182 = _0x40c2[_0x3280a4];
+        return _0x57a182;
+    };
+    return _0x3280(_0x1f52ee, _0x40c2a2);
 }
 }
-const _0x1c3d52 = _0x2bdb;
-const _0xd81c2a = _0x2bdb;
-const foo = _0xd81c2a('0x0');
-const bar = _0x1c3d52('0x1');
+const foo = _0x31c087(0x1c8);
+const bar = _0x31c087(0x1c4);
 function test() {
 function test() {
-    const _0x21a0b4 = _0x1c3d52;
-    const _0x12842d = _0xd81c2a;
-    const _0x6e47e6 = _0x12842d('0x2');
-    const _0x4f3aef = _0x12842d('0x3');
-    function _0x40f1dc() {
-        const _0x468540 = _0x12842d;
-        const _0x1f4b05 = _0x21a0b4;
-        const _0x40a980 = _0x1f4b05('0x4');
-        const _0x4d1285 = _0x468540('0x5');
+    const _0x848719 = _0x31759a;
+    const _0x2693bf = _0x31c087;
+    const _0x2c08e8 = _0x848719(0x1c9);
+    const _0x359365 = _0x2693bf(0x1c5);
+    function _0x175e90() {
+        const _0x310023 = _0x848719;
+        const _0x2302ef = _0x2693bf;
+        const _0x237437 = _0x310023(0x1c6);
+        const _0x56145c = _0x310023(0x1c7);
     }
     }
 }
 }
 ```
 ```
@@ -1287,28 +1293,40 @@ const foo = 'foo';
 
 
 function test () {
 function test () {
     const bar = 'bar';
     const bar = 'bar';
+    console.log(foo, bar);
 }
 }
 
 
+test();
+
 // output
 // output
 const a = [
 const a = [
-    'foo',
-    'bar'
+    'log',
+    'bar',
+    'foo'
 ];
 ];
-const b = function (c, d) {
-    c = c - 0x0;
-    let e = a[c];
-    return e;
+const d = function (c, g) {
+    return b(g - 0x3e1, c);
 };
 };
-const d = function (c, f) {
-    return b(c - '0x372', f);
-};
-const foo = d('0x372');
+const foo = d(0x567, 0x568);
+function b(c, d) {
+    b = function (e, f) {
+        e = e - 0x185;
+        let g = a[e];
+        return g;
+    };
+    return b(c, d);
+}
 function test() {
 function test() {
-    const e = function (c, f) {
-        return d(c - -'0x260', f);
+    const e = function (c, g) {
+        return b(c - 0x396, g);
     };
     };
-    const c = e('0x113');
+    const f = function (c, g) {
+        return b(c - 0x396, g);
+    };
+    const c = e(0x51c, 0x51b);
+    console[f(0x51b, 0x51d)](foo, c);
 }
 }
+test();
 ```
 ```
     
     
 ### `stringArrayThreshold`
 ### `stringArrayThreshold`
@@ -1353,25 +1371,29 @@ Example:
 })();
 })();
 
 
 // output
 // output
-var _0x2fae = [
-    'baz',
-    'test2',
+var _0x4735 = [
     'foo',
     'foo',
+    'baz',
+    'bar',
     'test1',
     'test1',
-    'bar'
+    'test2'
 ];
 ];
-function _0x377c (_0x1fbd3f, _0x59c72f) {
-    _0x1fbd3f = _0x1fbd3f - 0x0;
-    var _0x14fada = _0x2fae[_0x1fbd3f];
-    return _0x14fada;
+function _0x390c(_0x33d6b6, _0x4735f4) {
+    _0x390c = function (_0x390c37, _0x1eed85) {
+        _0x390c37 = _0x390c37 - 0x198;
+        var _0x2275f8 = _0x4735[_0x390c37];
+        return _0x2275f8;
+    };
+    return _0x390c(_0x33d6b6, _0x4735f4);
 }
 }
 (function () {
 (function () {
-    var _0x8a12db = {};
-    _0x8a12db[_0x377c('0x0')] = _0x377c('0x1');
-    var _0xc75419 = {};
-    _0xc75419[_0x377c('0x2')] = _0x377c('0x3');
-    _0xc75419[_0x377c('0x4')] = _0x8a12db;
-    var _0x191393 = _0xc75419;
+    var _0x17d1b7 = _0x390c;
+    var _0xc9b6bb = {};
+    _0xc9b6bb[_0x17d1b7(0x199)] = _0x17d1b7(0x19c);
+    var _0x3d959a = {};
+    _0x3d959a[_0x17d1b7(0x198)] = _0x17d1b7(0x19b);
+    _0x3d959a[_0x17d1b7(0x19a)] = _0xc9b6bb;
+    var _0x41fd86 = _0x3d959a;
 }());
 }());
 ```
 ```
 
 
@@ -1537,9 +1559,6 @@ The README on the master branch might not match that of the latest stable releas
 
 
 Try to run `npm link javascript-obfuscator` command or install it globally with `npm i -g javascript-obfuscator`
 Try to run `npm link javascript-obfuscator` command or install it globally with `npm i -g javascript-obfuscator`
 
 
-### Error `maximum call stack size exceeded`
-Likely this is `selfDefending` mechanism. Something is changing source code after obfuscation with `selfDefending` option.
-
 ### Online version?
 ### Online version?
 
 
 [obfuscator.io](https://obfuscator.io)
 [obfuscator.io](https://obfuscator.io)

Plik diff jest za duży
+ 0 - 0
dist/index.browser.js


Plik diff jest za duży
+ 0 - 0
dist/index.cli.js


Plik diff jest za duży
+ 0 - 0
dist/index.js


+ 10 - 10
package.json

@@ -46,7 +46,7 @@
   },
   },
   "devDependencies": {
   "devDependencies": {
     "@istanbuljs/nyc-config-typescript": "1.0.1",
     "@istanbuljs/nyc-config-typescript": "1.0.1",
-    "@types/chai": "4.2.18",
+    "@types/chai": "4.2.19",
     "@types/chance": "1.1.2",
     "@types/chance": "1.1.2",
     "@types/escodegen": "0.0.6",
     "@types/escodegen": "0.0.6",
     "@types/eslint-scope": "3.7.0",
     "@types/eslint-scope": "3.7.0",
@@ -57,25 +57,25 @@
     "@types/mkdirp": "1.0.1",
     "@types/mkdirp": "1.0.1",
     "@types/mocha": "8.2.2",
     "@types/mocha": "8.2.2",
     "@types/multimatch": "4.0.0",
     "@types/multimatch": "4.0.0",
-    "@types/node": "15.12.2",
+    "@types/node": "15.12.4",
     "@types/rimraf": "3.0.0",
     "@types/rimraf": "3.0.0",
     "@types/sinon": "10.0.2",
     "@types/sinon": "10.0.2",
     "@types/string-template": "1.0.2",
     "@types/string-template": "1.0.2",
     "@types/webpack-env": "1.16.0",
     "@types/webpack-env": "1.16.0",
-    "@typescript-eslint/eslint-plugin": "4.26.1",
-    "@typescript-eslint/parser": "4.26.1",
+    "@typescript-eslint/eslint-plugin": "4.28.0",
+    "@typescript-eslint/parser": "4.28.0",
     "chai": "4.3.4",
     "chai": "4.3.4",
     "chai-exclude": "2.0.3",
     "chai-exclude": "2.0.3",
     "cross-env": "7.0.3",
     "cross-env": "7.0.3",
-    "eslint": "7.28.0",
+    "eslint": "7.29.0",
     "eslint-plugin-import": "2.23.4",
     "eslint-plugin-import": "2.23.4",
-    "eslint-plugin-jsdoc": "35.1.3",
+    "eslint-plugin-jsdoc": "35.4.0",
     "eslint-plugin-no-null": "1.0.2",
     "eslint-plugin-no-null": "1.0.2",
     "eslint-plugin-prefer-arrow": "1.2.3",
     "eslint-plugin-prefer-arrow": "1.2.3",
     "eslint-plugin-unicorn": "33.0.1",
     "eslint-plugin-unicorn": "33.0.1",
     "fork-ts-checker-notifier-webpack-plugin": "4.0.0",
     "fork-ts-checker-notifier-webpack-plugin": "4.0.0",
-    "fork-ts-checker-webpack-plugin": "6.2.10",
-    "mocha": "9.0.0",
+    "fork-ts-checker-webpack-plugin": "6.2.12",
+    "mocha": "9.0.1",
     "nyc": "15.1.0",
     "nyc": "15.1.0",
     "pjson": "1.0.9",
     "pjson": "1.0.9",
     "pre-commit": "1.2.2",
     "pre-commit": "1.2.2",
@@ -84,8 +84,8 @@
     "threads": "1.6.5",
     "threads": "1.6.5",
     "ts-loader": "9.2.3",
     "ts-loader": "9.2.3",
     "ts-node": "10.0.0",
     "ts-node": "10.0.0",
-    "typescript": "4.3.2",
-    "webpack": "5.38.1",
+    "typescript": "4.3.4",
+    "webpack": "5.40.0",
     "webpack-cli": "4.7.2",
     "webpack-cli": "4.7.2",
     "webpack-node-externals": "3.0.0"
     "webpack-node-externals": "3.0.0"
   },
   },

+ 1 - 1
src/ASTParserFacade.ts

@@ -70,7 +70,7 @@ export class ASTParserFacade {
             sourceType
             sourceType
         };
         };
 
 
-        const program: ESTree.Program = <any>acorn
+        const program: acorn.Node & ESTree.Program = <acorn.Node & ESTree.Program>acorn
             .parse(sourceCode, config);
             .parse(sourceCode, config);
 
 
         if (comments.length) {
         if (comments.length) {

+ 2 - 1
src/custom-code-helpers/string-array/StringArrayCallsWrapperBase64CodeHelper.ts

@@ -26,7 +26,8 @@ export class StringArrayCallsWrapperBase64CodeHelper extends StringArrayCallsWra
                 atobFunctionName,
                 atobFunctionName,
                 selfDefendingCode,
                 selfDefendingCode,
                 stringArrayName: this.stringArrayName,
                 stringArrayName: this.stringArrayName,
-                stringArrayCallsWrapperName: this.stringArrayCallsWrapperName
+                stringArrayCallsWrapperName: this.stringArrayCallsWrapperName,
+                stringArrayCacheName: this.stringArrayCacheName
             }
             }
         );
         );
     }
     }

+ 9 - 0
src/custom-code-helpers/string-array/StringArrayCallsWrapperCodeHelper.ts

@@ -38,6 +38,12 @@ export class StringArrayCallsWrapperCodeHelper extends AbstractCustomCodeHelper
     @initializable()
     @initializable()
     protected stringArrayCallsWrapperName!: string;
     protected stringArrayCallsWrapperName!: string;
 
 
+    /**
+     * @type {string}
+     */
+    @initializable()
+    protected stringArrayCacheName!: string;
+
     /**
     /**
      * @type {IEscapeSequenceEncoder}
      * @type {IEscapeSequenceEncoder}
      */
      */
@@ -84,6 +90,8 @@ export class StringArrayCallsWrapperCodeHelper extends AbstractCustomCodeHelper
         this.stringArrayName = stringArrayName;
         this.stringArrayName = stringArrayName;
         this.stringArrayCallsWrapperName = stringArrayCallsWrapperName;
         this.stringArrayCallsWrapperName = stringArrayCallsWrapperName;
         this.indexShiftAmount = indexShiftAmount;
         this.indexShiftAmount = indexShiftAmount;
+
+        this.stringArrayCacheName = this.randomGenerator.getRandomString(6);
     }
     }
 
 
     /**
     /**
@@ -107,6 +115,7 @@ export class StringArrayCallsWrapperCodeHelper extends AbstractCustomCodeHelper
                 decodeCodeHelperTemplate,
                 decodeCodeHelperTemplate,
                 stringArrayCallsWrapperName: this.stringArrayCallsWrapperName,
                 stringArrayCallsWrapperName: this.stringArrayCallsWrapperName,
                 stringArrayName: this.stringArrayName,
                 stringArrayName: this.stringArrayName,
+                stringArrayCacheName: this.stringArrayCacheName,
                 indexShiftAmount: this.indexShiftAmount
                 indexShiftAmount: this.indexShiftAmount
             }),
             }),
             {
             {

+ 6 - 2
src/custom-code-helpers/string-array/StringArrayCallsWrapperRc4CodeHelper.ts

@@ -13,12 +13,14 @@ export class StringArrayCallsWrapperRc4CodeHelper extends StringArrayCallsWrappe
      */
      */
     protected override getDecodeStringArrayTemplate (): string {
     protected override getDecodeStringArrayTemplate (): string {
         const atobFunctionName: string = this.randomGenerator.getRandomString(6);
         const atobFunctionName: string = this.randomGenerator.getRandomString(6);
+        const rc4FunctionName: string = this.randomGenerator.getRandomString(6);
 
 
         const atobPolyfill: string = this.customCodeHelperFormatter.formatTemplate(AtobTemplate(), {
         const atobPolyfill: string = this.customCodeHelperFormatter.formatTemplate(AtobTemplate(), {
             atobFunctionName
             atobFunctionName
         });
         });
         const rc4Polyfill: string = this.customCodeHelperFormatter.formatTemplate(Rc4Template(), {
         const rc4Polyfill: string = this.customCodeHelperFormatter.formatTemplate(Rc4Template(), {
-            atobFunctionName
+            atobFunctionName,
+            rc4FunctionName
         });
         });
 
 
         const selfDefendingCode: string = this.getSelfDefendingTemplate();
         const selfDefendingCode: string = this.getSelfDefendingTemplate();
@@ -27,10 +29,12 @@ export class StringArrayCallsWrapperRc4CodeHelper extends StringArrayCallsWrappe
             StringArrayRC4DecodeTemplate(this.randomGenerator),
             StringArrayRC4DecodeTemplate(this.randomGenerator),
             {
             {
                 atobPolyfill,
                 atobPolyfill,
+                rc4FunctionName,
                 rc4Polyfill,
                 rc4Polyfill,
                 selfDefendingCode,
                 selfDefendingCode,
                 stringArrayName: this.stringArrayName,
                 stringArrayName: this.stringArrayName,
-                stringArrayCallsWrapperName: this.stringArrayCallsWrapperName
+                stringArrayCallsWrapperName: this.stringArrayCallsWrapperName,
+                stringArrayCacheName: this.stringArrayCacheName
             }
             }
         );
         );
     }
     }

+ 8 - 1
src/custom-code-helpers/string-array/templates/string-array-calls-wrapper/AtobTemplate.ts

@@ -11,6 +11,8 @@ export function AtobTemplate (): string {
             const chars = '${base64alphabetSwapped}';
             const chars = '${base64alphabetSwapped}';
 
 
             let output = '';
             let output = '';
+            let tempEncodedString = '';
+            
             for (
             for (
                 let bc = 0, bs, buffer, idx = 0;
                 let bc = 0, bs, buffer, idx = 0;
                 buffer = input.charAt(idx++);
                 buffer = input.charAt(idx++);
@@ -19,7 +21,12 @@ export function AtobTemplate (): string {
             ) {
             ) {
                 buffer = chars.indexOf(buffer);
                 buffer = chars.indexOf(buffer);
             }
             }
-            return output;
+            
+             for (let k = 0, length = output.length; k < length; k++) {
+                tempEncodedString += '%' + ('00' + output.charCodeAt(k).toString(16)).slice(-2);
+            }
+        
+            return decodeURIComponent(tempEncodedString);
         };
         };
     `;
     `;
 }
 }

+ 4 - 10
src/custom-code-helpers/string-array/templates/string-array-calls-wrapper/Rc4Template.ts

@@ -3,17 +3,11 @@
  */
  */
 export function Rc4Template (): string {
 export function Rc4Template (): string {
     return `
     return `
-        const rc4 = function (str, key) {
-            let s = [], j = 0, x, res = '', newStr = '';
+        const {rc4FunctionName} = function (str, key) {
+            let s = [], j = 0, x, output = '';
            
            
             str = {atobFunctionName}(str);
             str = {atobFunctionName}(str);
                 
                 
-            for (let k = 0, length = str.length; k < length; k++) {
-                newStr += '%' + ('00' + str.charCodeAt(k).toString(16)).slice(-2);
-            }
-        
-            str = decodeURIComponent(newStr);
-                    	     
             let i;
             let i;
                     	        
                     	        
             for (i = 0; i < 256; i++) {
             for (i = 0; i < 256; i++) {
@@ -36,10 +30,10 @@ export function Rc4Template (): string {
                 x = s[i];
                 x = s[i];
                 s[i] = s[j];
                 s[i] = s[j];
                 s[j] = x;
                 s[j] = x;
-                res += String.fromCharCode(str.charCodeAt(y) ^ s[(s[i] + s[j]) % 256]);
+                output += String.fromCharCode(str.charCodeAt(y) ^ s[(s[i] + s[j]) % 256]);
             }
             }
                       
                       
-            return res;
+            return output;
         }
         }
     `;
     `;
 }
 }

+ 9 - 20
src/custom-code-helpers/string-array/templates/string-array-calls-wrapper/StringArrayBase64DecodeTemplate.ts

@@ -10,38 +10,27 @@ export function StringArrayBase64DecodeTemplate (
 ): string {
 ): string {
     const identifierLength: number = 6;
     const identifierLength: number = 6;
     const initializedIdentifier: string = randomGenerator.getRandomString(identifierLength);
     const initializedIdentifier: string = randomGenerator.getRandomString(identifierLength);
-    const base64DecodeFunctionIdentifier: string = randomGenerator.getRandomString(identifierLength);
-    const dataIdentifier: string = randomGenerator.getRandomString(identifierLength);
+    const base64Identifier: string = randomGenerator.getRandomString(identifierLength);
 
 
     return `
     return `
         if ({stringArrayCallsWrapperName}.${initializedIdentifier} === undefined) {
         if ({stringArrayCallsWrapperName}.${initializedIdentifier} === undefined) {
             {atobPolyfill}
             {atobPolyfill}
-            
-            {stringArrayCallsWrapperName}.${base64DecodeFunctionIdentifier} = function (str) {
-                const string = {atobFunctionName}(str);
-                let newStringChars = [];
-                
-                for (let i = 0, length = string.length; i < length; i++) {
-                    newStringChars += '%' + ('00' + string.charCodeAt(i).toString(16)).slice(-2);
-                }
-                
-                return decodeURIComponent(newStringChars);
-            };
-            
-            {stringArrayCallsWrapperName}.${dataIdentifier} = {};
+            {stringArrayCallsWrapperName}.${base64Identifier} = {atobFunctionName};
+
+            {stringArrayCacheName} = arguments;
             
             
             {stringArrayCallsWrapperName}.${initializedIdentifier} = true;
             {stringArrayCallsWrapperName}.${initializedIdentifier} = true;
         }
         }
                   
                   
         const firstValue = {stringArrayName}[0];
         const firstValue = {stringArrayName}[0];
         const cacheKey = index + firstValue;
         const cacheKey = index + firstValue;
-        const cachedValue = {stringArrayCallsWrapperName}.${dataIdentifier}[cacheKey];
-                        
-        if (cachedValue === undefined) {
+        const cachedValue = {stringArrayCacheName}[cacheKey];
+        
+        if (!cachedValue) {
             {selfDefendingCode}
             {selfDefendingCode}
             
             
-            value = {stringArrayCallsWrapperName}.${base64DecodeFunctionIdentifier}(value);
-            {stringArrayCallsWrapperName}.${dataIdentifier}[cacheKey] = value;
+            value = {stringArrayCallsWrapperName}.${base64Identifier}(value);
+            {stringArrayCacheName}[cacheKey] = value;
         } else {
         } else {
             value = cachedValue;
             value = cachedValue;
         }
         }

+ 14 - 7
src/custom-code-helpers/string-array/templates/string-array-calls-wrapper/StringArrayCallsWrapperTemplate.ts

@@ -1,16 +1,23 @@
 /**
 /**
+ * The first parameter of the outer stringArrayCallsWrapperName function will be used as an initial index
+ * and later as a cache variable that will be captured by the inner function
+ *
  * @returns {string}
  * @returns {string}
  */
  */
 export function StringArrayCallsWrapperTemplate (): string {
 export function StringArrayCallsWrapperTemplate (): string {
     return `
     return `
-         function {stringArrayCallsWrapperName} (index, key) {
-            index = index - {indexShiftAmount};
+        function {stringArrayCallsWrapperName} ({stringArrayCacheName}, key) {
+            {stringArrayCallsWrapperName} = function (index, key) {
+                index = index - {indexShiftAmount};
+                
+                let value = {stringArrayName}[index];
+                
+                {decodeCodeHelperTemplate}
             
             
-            let value = {stringArrayName}[index];
-            
-            {decodeCodeHelperTemplate}
-        
-            return value;
+                return value;
+            };
+         
+            return {stringArrayCallsWrapperName}({stringArrayCacheName}, key);
         }
         }
     `;
     `;
 }
 }

+ 5 - 7
src/custom-code-helpers/string-array/templates/string-array-calls-wrapper/StringArrayRC4DecodeTemplate.ts

@@ -11,26 +11,24 @@ export function StringArrayRC4DecodeTemplate (
     const identifierLength: number = 6;
     const identifierLength: number = 6;
     const initializedIdentifier: string = randomGenerator.getRandomString(identifierLength);
     const initializedIdentifier: string = randomGenerator.getRandomString(identifierLength);
     const rc4Identifier: string = randomGenerator.getRandomString(identifierLength);
     const rc4Identifier: string = randomGenerator.getRandomString(identifierLength);
-    const dataIdentifier: string = randomGenerator.getRandomString(identifierLength);
     const onceIdentifier: string = randomGenerator.getRandomString(identifierLength);
     const onceIdentifier: string = randomGenerator.getRandomString(identifierLength);
 
 
     return `
     return `
         if ({stringArrayCallsWrapperName}.${initializedIdentifier} === undefined) {
         if ({stringArrayCallsWrapperName}.${initializedIdentifier} === undefined) {
             {atobPolyfill}
             {atobPolyfill}
-            
             {rc4Polyfill}
             {rc4Polyfill}
-            {stringArrayCallsWrapperName}.${rc4Identifier} = rc4;
+            {stringArrayCallsWrapperName}.${rc4Identifier} = {rc4FunctionName};
             
             
-            {stringArrayCallsWrapperName}.${dataIdentifier} = {};
+            {stringArrayCacheName} = arguments;
             
             
             {stringArrayCallsWrapperName}.${initializedIdentifier} = true;
             {stringArrayCallsWrapperName}.${initializedIdentifier} = true;
         }
         }
   
   
         const firstValue = {stringArrayName}[0];
         const firstValue = {stringArrayName}[0];
         const cacheKey = index + firstValue;
         const cacheKey = index + firstValue;
-        const cachedValue = {stringArrayCallsWrapperName}.${dataIdentifier}[cacheKey];
+        const cachedValue = {stringArrayCacheName}[cacheKey];
 
 
-        if (cachedValue === undefined) {
+        if (!cachedValue) {
             if ({stringArrayCallsWrapperName}.${onceIdentifier} === undefined) {
             if ({stringArrayCallsWrapperName}.${onceIdentifier} === undefined) {
                 {selfDefendingCode}
                 {selfDefendingCode}
                 
                 
@@ -38,7 +36,7 @@ export function StringArrayRC4DecodeTemplate (
             }
             }
             
             
             value = {stringArrayCallsWrapperName}.${rc4Identifier}(value, key);
             value = {stringArrayCallsWrapperName}.${rc4Identifier}(value, key);
-            {stringArrayCallsWrapperName}.${dataIdentifier}[cacheKey] = value;
+            {stringArrayCacheName}[cacheKey] = value;
         } else {
         } else {
             value = cachedValue;
             value = cachedValue;
         }
         }

+ 8 - 1
src/node-transformers/dead-code-injection-transformers/DeadCodeInjectionTransformer.ts

@@ -52,6 +52,13 @@ export class DeadCodeInjectionTransformer extends AbstractNodeTransformer {
         NodeTransformer.ScopeIdentifiersTransformer
         NodeTransformer.ScopeIdentifiersTransformer
     ];
     ];
 
 
+    /**
+     * @type {NodeTransformer[]}
+     */
+    public override readonly runAfter: NodeTransformer[] = [
+        NodeTransformer.ScopeIdentifiersTransformer
+    ];
+
     /**
     /**
      * @type {Set <BlockStatement>}
      * @type {Set <BlockStatement>}
      */
      */
@@ -237,7 +244,7 @@ export class DeadCodeInjectionTransformer extends AbstractNodeTransformer {
                     }
                     }
                 };
                 };
 
 
-            case NodeTransformationStage.Finalizing:
+            case NodeTransformationStage.RenameIdentifiers:
                 if (!this.deadCodeInjectionRootAstHostNodeSet.size) {
                 if (!this.deadCodeInjectionRootAstHostNodeSet.size) {
                     return null;
                     return null;
                 }
                 }

+ 3 - 2
test/functional-tests/custom-code-helpers/string-array/StringArrayCallsWrapperCodeHelper.spec.ts

@@ -56,8 +56,9 @@ describe('StringArrayCallsWrapperCodeHelper', () => {
     describe('Preserve string array name', () => {
     describe('Preserve string array name', () => {
         const callsWrapperRegExp: RegExp = new RegExp(`` +
         const callsWrapperRegExp: RegExp = new RegExp(`` +
             `function *b *\\(c, *d\\) *{ *` +
             `function *b *\\(c, *d\\) *{ *` +
-            `c *= *c *- *0x0; *` +
-            `var e *= *a\\[c]; *` +
+                `b *= *function *\\(e, *f\\) *{` +
+                    `e *= *e *- *0x0; *` +
+                    `var g *= *a\\[e]; *` +
         ``);
         ``);
 
 
         let obfuscatedCode: string;
         let obfuscatedCode: string;

+ 18 - 2
test/functional-tests/custom-code-helpers/string-array/templates/string-array-calls-wrapper-node-template/StringArrayCallsWrapperTemplate.spec.ts

@@ -27,7 +27,9 @@ import { swapLettersCase } from '../../../../../helpers/swapLettersCase';
 describe('StringArrayCallsWrapperTemplate', () => {
 describe('StringArrayCallsWrapperTemplate', () => {
     const stringArrayName: string = 'stringArrayName';
     const stringArrayName: string = 'stringArrayName';
     const stringArrayCallsWrapperName: string = 'stringArrayCallsWrapperName';
     const stringArrayCallsWrapperName: string = 'stringArrayCallsWrapperName';
+    const stringArrayCacheName: string = 'stringArrayCache';
     const atobFunctionName: string = 'atob';
     const atobFunctionName: string = 'atob';
+    const rc4FunctionName: string = 'rc4';
 
 
     let cryptUtilsSwappedAlphabet: ICryptUtilsStringArray,
     let cryptUtilsSwappedAlphabet: ICryptUtilsStringArray,
         randomGenerator: IRandomGenerator;
         randomGenerator: IRandomGenerator;
@@ -62,12 +64,14 @@ describe('StringArrayCallsWrapperTemplate', () => {
                         atobPolyfill,
                         atobPolyfill,
                         atobFunctionName,
                         atobFunctionName,
                         selfDefendingCode: '',
                         selfDefendingCode: '',
+                        stringArrayCacheName,
                         stringArrayCallsWrapperName
                         stringArrayCallsWrapperName
                     }
                     }
                 );
                 );
                 const stringArrayCallsWrapperTemplate: string = format(StringArrayCallsWrapperTemplate(), {
                 const stringArrayCallsWrapperTemplate: string = format(StringArrayCallsWrapperTemplate(), {
                     decodeCodeHelperTemplate: atobDecodeTemplate,
                     decodeCodeHelperTemplate: atobDecodeTemplate,
                     indexShiftAmount,
                     indexShiftAmount,
+                    stringArrayCacheName,
                     stringArrayCallsWrapperName,
                     stringArrayCallsWrapperName,
                     stringArrayName
                     stringArrayName
                 });
                 });
@@ -105,12 +109,14 @@ describe('StringArrayCallsWrapperTemplate', () => {
                         atobPolyfill,
                         atobPolyfill,
                         atobFunctionName,
                         atobFunctionName,
                         selfDefendingCode: '',
                         selfDefendingCode: '',
+                        stringArrayCacheName,
                         stringArrayCallsWrapperName
                         stringArrayCallsWrapperName
                     }
                     }
                 );
                 );
                 const stringArrayCallsWrapperTemplate: string = format(StringArrayCallsWrapperTemplate(), {
                 const stringArrayCallsWrapperTemplate: string = format(StringArrayCallsWrapperTemplate(), {
                     decodeCodeHelperTemplate: atobDecodeTemplate,
                     decodeCodeHelperTemplate: atobDecodeTemplate,
                     indexShiftAmount,
                     indexShiftAmount,
+                    stringArrayCacheName,
                     stringArrayCallsWrapperName,
                     stringArrayCallsWrapperName,
                     stringArrayName
                     stringArrayName
                 });
                 });
@@ -146,12 +152,14 @@ describe('StringArrayCallsWrapperTemplate', () => {
                         atobPolyfill,
                         atobPolyfill,
                         atobFunctionName,
                         atobFunctionName,
                         selfDefendingCode: '',
                         selfDefendingCode: '',
+                        stringArrayCacheName,
                         stringArrayCallsWrapperName
                         stringArrayCallsWrapperName
                     }
                     }
                 );
                 );
                 const stringArrayCallsWrapperTemplate: string = format(StringArrayCallsWrapperTemplate(), {
                 const stringArrayCallsWrapperTemplate: string = format(StringArrayCallsWrapperTemplate(), {
                     decodeCodeHelperTemplate: atobDecodeTemplate,
                     decodeCodeHelperTemplate: atobDecodeTemplate,
                     indexShiftAmount,
                     indexShiftAmount,
+                    stringArrayCacheName,
                     stringArrayCallsWrapperName,
                     stringArrayCallsWrapperName,
                     stringArrayName
                     stringArrayName
                 });
                 });
@@ -190,20 +198,24 @@ describe('StringArrayCallsWrapperTemplate', () => {
                     atobFunctionName
                     atobFunctionName
                 });
                 });
                 const rc4Polyfill = format(Rc4Template(), {
                 const rc4Polyfill = format(Rc4Template(), {
-                    atobFunctionName
+                    atobFunctionName,
+                    rc4FunctionName
                 });
                 });
                 const rc4decodeCodeHelperTemplate: string = format(
                 const rc4decodeCodeHelperTemplate: string = format(
                     StringArrayRC4DecodeTemplate(randomGenerator),
                     StringArrayRC4DecodeTemplate(randomGenerator),
                     {
                     {
                         atobPolyfill,
                         atobPolyfill,
                         rc4Polyfill,
                         rc4Polyfill,
+                        rc4FunctionName,
                         selfDefendingCode: '',
                         selfDefendingCode: '',
+                        stringArrayCacheName,
                         stringArrayCallsWrapperName
                         stringArrayCallsWrapperName
                     }
                     }
                 );
                 );
                 const stringArrayCallsWrapperTemplate: string = format(StringArrayCallsWrapperTemplate(), {
                 const stringArrayCallsWrapperTemplate: string = format(StringArrayCallsWrapperTemplate(), {
                     decodeCodeHelperTemplate: rc4decodeCodeHelperTemplate,
                     decodeCodeHelperTemplate: rc4decodeCodeHelperTemplate,
                     indexShiftAmount,
                     indexShiftAmount,
+                    stringArrayCacheName,
                     stringArrayCallsWrapperName,
                     stringArrayCallsWrapperName,
                     stringArrayName
                     stringArrayName
                 });
                 });
@@ -237,20 +249,24 @@ describe('StringArrayCallsWrapperTemplate', () => {
                     atobFunctionName
                     atobFunctionName
                 });
                 });
                 const rc4Polyfill = format(Rc4Template(), {
                 const rc4Polyfill = format(Rc4Template(), {
-                    atobFunctionName
+                    atobFunctionName,
+                    rc4FunctionName
                 });
                 });
                 const rc4decodeCodeHelperTemplate: string = format(
                 const rc4decodeCodeHelperTemplate: string = format(
                     StringArrayRC4DecodeTemplate(randomGenerator),
                     StringArrayRC4DecodeTemplate(randomGenerator),
                     {
                     {
                         atobPolyfill,
                         atobPolyfill,
                         rc4Polyfill,
                         rc4Polyfill,
+                        rc4FunctionName,
                         selfDefendingCode: '',
                         selfDefendingCode: '',
+                        stringArrayCacheName,
                         stringArrayCallsWrapperName
                         stringArrayCallsWrapperName
                     }
                     }
                 );
                 );
                 const stringArrayCallsWrapperTemplate: string = format(StringArrayCallsWrapperTemplate(), {
                 const stringArrayCallsWrapperTemplate: string = format(StringArrayCallsWrapperTemplate(), {
                     decodeCodeHelperTemplate: rc4decodeCodeHelperTemplate,
                     decodeCodeHelperTemplate: rc4decodeCodeHelperTemplate,
                     indexShiftAmount,
                     indexShiftAmount,
+                    stringArrayCacheName,
                     stringArrayCallsWrapperName,
                     stringArrayCallsWrapperName,
                     stringArrayName
                     stringArrayName
                 });
                 });

+ 20 - 10
test/functional-tests/generators/identifier-names-generators/dictionary-identifier-names-generator/DictionaryIdentifierNamesGenerator.spec.ts

@@ -13,8 +13,9 @@ describe('DictionaryIdentifierNamesGenerator', () => {
     describe('generateWithPrefix', () => {
     describe('generateWithPrefix', () => {
         describe('Variant #1: should not generate same name for string array as existing name in code', () => {
         describe('Variant #1: should not generate same name for string array as existing name in code', () => {
             describe('Variant #1: `renameGlobals` option is disabled', () => {
             describe('Variant #1: `renameGlobals` option is disabled', () => {
-                const stringArrayStorageRegExp: RegExp = /const a[aB] *= *\['abc'];/;
-                const variableDeclarationIdentifierNameRegExp: RegExp = /const ab *= *a[abAB]\(0x0\);/;
+                const stringArrayStorageRegExp: RegExp = /const a[cABC] *= *\['_aa', *'_ab'];/;
+                const variableDeclarationIdentifierNameRegExp1: RegExp = /const aa *= *a[cABC]\(0x0\);/;
+                const variableDeclarationIdentifierNameRegExp2: RegExp = /const ab *= *a[cABC]\(0x1\);/;
 
 
                 let obfuscatedCode: string;
                 let obfuscatedCode: string;
 
 
@@ -26,7 +27,7 @@ describe('DictionaryIdentifierNamesGenerator', () => {
                         {
                         {
                             ...NO_ADDITIONAL_NODES_PRESET,
                             ...NO_ADDITIONAL_NODES_PRESET,
                             identifierNamesGenerator: IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator,
                             identifierNamesGenerator: IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator,
-                            identifiersDictionary: ['a', 'b'],
+                            identifiersDictionary: ['a', 'b', 'c'],
                             identifiersPrefix: 'a',
                             identifiersPrefix: 'a',
                             transformObjectKeys: true,
                             transformObjectKeys: true,
                             stringArray: true,
                             stringArray: true,
@@ -39,14 +40,19 @@ describe('DictionaryIdentifierNamesGenerator', () => {
                     assert.match(obfuscatedCode, stringArrayStorageRegExp);
                     assert.match(obfuscatedCode, stringArrayStorageRegExp);
                 });
                 });
 
 
-                it('Match #2: should keep identifier name for last variable declaration', () => {
-                    assert.match(obfuscatedCode, variableDeclarationIdentifierNameRegExp);
+                it('Match #2: should keep identifier name for existing variable declaration', () => {
+                    assert.match(obfuscatedCode, variableDeclarationIdentifierNameRegExp1);
+                });
+
+                it('Match #3: should keep identifier name for existing variable declaration', () => {
+                    assert.match(obfuscatedCode, variableDeclarationIdentifierNameRegExp2);
                 });
                 });
             });
             });
 
 
             describe('Variant #2: `renameGlobals` option is enabled', () => {
             describe('Variant #2: `renameGlobals` option is enabled', () => {
-                const stringArrayStorageRegExp: RegExp = /const a[aB] *= *\['abc'];/;
-                const lastVariableDeclarationIdentifierNameRegExp: RegExp = /const a[AB] *= *a[AB]\(0x0\);/;
+                const stringArrayStorageRegExp: RegExp = /const a[cABC] *= *\['_aa', *'_ab'];/;
+                const lastVariableDeclarationIdentifierNameRegExp1: RegExp = /const a[cABC] *= *a[cABC]\(0x0\);/;
+                const lastVariableDeclarationIdentifierNameRegExp2: RegExp = /const a[cABC] *= *a[cABC]\(0x1\);/;
 
 
                 let obfuscatedCode: string;
                 let obfuscatedCode: string;
 
 
@@ -58,7 +64,7 @@ describe('DictionaryIdentifierNamesGenerator', () => {
                         {
                         {
                             ...NO_ADDITIONAL_NODES_PRESET,
                             ...NO_ADDITIONAL_NODES_PRESET,
                             identifierNamesGenerator: IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator,
                             identifierNamesGenerator: IdentifierNamesGenerator.DictionaryIdentifierNamesGenerator,
-                            identifiersDictionary: ['a', 'b'],
+                            identifiersDictionary: ['a', 'b', 'c'],
                             identifiersPrefix: 'a',
                             identifiersPrefix: 'a',
                             renameGlobals: true,
                             renameGlobals: true,
                             transformObjectKeys: true,
                             transformObjectKeys: true,
@@ -72,8 +78,12 @@ describe('DictionaryIdentifierNamesGenerator', () => {
                     assert.match(obfuscatedCode, stringArrayStorageRegExp);
                     assert.match(obfuscatedCode, stringArrayStorageRegExp);
                 });
                 });
 
 
-                it('Match #2: should keep identifier name for last variable declaration', () => {
-                    assert.match(obfuscatedCode, lastVariableDeclarationIdentifierNameRegExp);
+                it('Match #2: should keep identifier name for existing variable declaration', () => {
+                    assert.match(obfuscatedCode, lastVariableDeclarationIdentifierNameRegExp1);
+                });
+
+                it('Match #3: should keep identifier name for existing variable declaration', () => {
+                    assert.match(obfuscatedCode, lastVariableDeclarationIdentifierNameRegExp2);
                 });
                 });
             });
             });
         });
         });

+ 2 - 1
test/functional-tests/generators/identifier-names-generators/dictionary-identifier-names-generator/fixtures/string-array-storage-name-conflict-1.js

@@ -1 +1,2 @@
-const ab = 'abc';
+const aa = '_aa';
+const ab = '_ab';

+ 41 - 0
test/functional-tests/node-transformers/dead-code-injection-transformers/DeadCodeInjectionTransformer.spec.ts

@@ -998,5 +998,46 @@ describe('DeadCodeInjectionTransformer', () => {
                 });
                 });
             });
             });
         });
         });
+
+        describe('Variant #12 - correct integration with `stringArrayWrappersChainedCalls` option', () => {
+            const regExp: RegExp = new RegExp(
+                `var ${variableMatch} *= *${variableMatch}; *` +
+                `if *\\(${variableMatch}\\(${hexMatch}\\) *[=|!]== *${variableMatch}\\(${hexMatch}\\)\\) *\\{`+
+                    `(?:console|${variableMatch})\\[${variableMatch}\\(${hexMatch}\\)\\]\\(${variableMatch}\\(${hexMatch}\\)\\);` +
+                `\\} *else *\\{`+
+                    `(?:console|${variableMatch})\\[${variableMatch}\\(${hexMatch}\\)\\]\\(${variableMatch}\\(${hexMatch}\\)\\);` +
+                `\\}`,
+                'g'
+            );
+            const expectedMatchesLength: number = 5;
+
+            let matchesLength: number = 0;
+
+            before(() => {
+                const code: string = readFileAsString(__dirname + '/fixtures/input-1.js');
+
+                const obfuscatedCode: string = JavaScriptObfuscator.obfuscate(
+                    code,
+                    {
+                        ...NO_ADDITIONAL_NODES_PRESET,
+                        deadCodeInjection: true,
+                        deadCodeInjectionThreshold: 1,
+                        stringArray: true,
+                        stringArrayThreshold: 1,
+                        stringArrayWrappersCount: 1,
+                        stringArrayWrappersChainedCalls: true
+                    }
+                ).getObfuscatedCode();
+                const matches: RegExpMatchArray = <RegExpMatchArray>obfuscatedCode.match(regExp);
+
+                if (matches) {
+                    matchesLength = matches.length;
+                }
+            });
+
+            it('should unwrap dead code injection root AST host node before the string array transformer', () => {
+                assert.equal(matchesLength, expectedMatchesLength);
+            });
+        });
     });
     });
 });
 });

+ 102 - 103
yarn.lock

@@ -560,10 +560,10 @@
   resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.1.tgz#a6ca6a9a0ff366af433f42f5f0e124794ff6b8f1"
   resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.1.tgz#a6ca6a9a0ff366af433f42f5f0e124794ff6b8f1"
   integrity sha512-FTgBI767POY/lKNDNbIzgAX6miIDBs6NTCbdlDb8TrWovHsSvaVIZDlTqym29C6UqhzwcJx4CYr+AlrMywA0cA==
   integrity sha512-FTgBI767POY/lKNDNbIzgAX6miIDBs6NTCbdlDb8TrWovHsSvaVIZDlTqym29C6UqhzwcJx4CYr+AlrMywA0cA==
 
 
-"@types/[email protected]8":
-  version "4.2.18"
-  resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.2.18.tgz#0c8e298dbff8205e2266606c1ea5fbdba29b46e4"
-  integrity sha512-rS27+EkB/RE1Iz3u0XtVL5q36MGDWbgYe7zWiodyKNUnthxY0rukK5V36eiUCtCisB7NN8zKYH6DO2M37qxFEQ==
+"@types/[email protected]9":
+  version "4.2.19"
+  resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.2.19.tgz#80f286b515897413c7a35bdda069cc80f2344233"
+  integrity sha512-jRJgpRBuY+7izT7/WNXP/LsMO9YonsstuL+xuvycDyESpoDoIAsMd7suwpB4h9oEWB+ZlPTqJJ8EHomzNhwTPQ==
 
 
 "@types/[email protected]":
 "@types/[email protected]":
   version "1.1.2"
   version "1.1.2"
@@ -693,10 +693,10 @@
   resolved "https://registry.npmjs.org/@types/node/-/node-13.9.3.tgz"
   resolved "https://registry.npmjs.org/@types/node/-/node-13.9.3.tgz"
   integrity sha512-01s+ac4qerwd6RHD+mVbOEsraDHSgUaefQlEdBbUolnQFjKwCr7luvAlEwW1RFojh67u0z4OUTjPn9LEl4zIkA==
   integrity sha512-01s+ac4qerwd6RHD+mVbOEsraDHSgUaefQlEdBbUolnQFjKwCr7luvAlEwW1RFojh67u0z4OUTjPn9LEl4zIkA==
 
 
-"@types/[email protected].2":
-  version "15.12.2"
-  resolved "https://registry.yarnpkg.com/@types/node/-/node-15.12.2.tgz#1f2b42c4be7156ff4a6f914b2fb03d05fa84e38d"
-  integrity sha512-zjQ69G564OCIWIOHSXyQEEDpdpGl+G348RAKY0XXy9Z5kU9Vzv1GMNnkar/ZJ8dzXB3COzD9Mo9NtRZ4xfgUww==
+"@types/[email protected].4":
+  version "15.12.4"
+  resolved "https://registry.yarnpkg.com/@types/node/-/node-15.12.4.tgz#e1cf817d70a1e118e81922c4ff6683ce9d422e26"
+  integrity sha512-zrNj1+yqYF4WskCMOHwN+w9iuD12+dGm0rQ35HLl9/Ouuq52cEtd0CH9qMgrdNmi5ejC1/V7vKEXYubB+65DkA==
 
 
 "@types/normalize-package-data@^2.4.0":
 "@types/normalize-package-data@^2.4.0":
   version "2.4.0"
   version "2.4.0"
@@ -738,74 +738,73 @@
   resolved "https://registry.npmjs.org/@types/webpack-env/-/webpack-env-1.16.0.tgz"
   resolved "https://registry.npmjs.org/@types/webpack-env/-/webpack-env-1.16.0.tgz"
   integrity sha512-Fx+NpfOO0CpeYX2g9bkvX8O5qh9wrU1sOF4g8sft4Mu7z+qfe387YlyY8w8daDyDsKY5vUxM0yxkAYnbkRbZEw==
   integrity sha512-Fx+NpfOO0CpeYX2g9bkvX8O5qh9wrU1sOF4g8sft4Mu7z+qfe387YlyY8w8daDyDsKY5vUxM0yxkAYnbkRbZEw==
 
 
-"@typescript-eslint/[email protected]6.1":
-  version "4.26.1"
-  resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.26.1.tgz#b9c7313321cb837e2bf8bebe7acc2220659e67d3"
-  integrity sha512-aoIusj/8CR+xDWmZxARivZjbMBQTT9dImUtdZ8tVCVRXgBUuuZyM5Of5A9D9arQPxbi/0rlJLcuArclz/rCMJw==
+"@typescript-eslint/[email protected]8.0":
+  version "4.28.0"
+  resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.28.0.tgz#1a66f03b264844387beb7dc85e1f1d403bd1803f"
+  integrity sha512-KcF6p3zWhf1f8xO84tuBailV5cN92vhS+VT7UJsPzGBm9VnQqfI9AsiMUFUCYHTYPg1uCCo+HyiDnpDuvkAMfQ==
   dependencies:
   dependencies:
-    "@typescript-eslint/experimental-utils" "4.26.1"
-    "@typescript-eslint/scope-manager" "4.26.1"
+    "@typescript-eslint/experimental-utils" "4.28.0"
+    "@typescript-eslint/scope-manager" "4.28.0"
     debug "^4.3.1"
     debug "^4.3.1"
     functional-red-black-tree "^1.0.1"
     functional-red-black-tree "^1.0.1"
-    lodash "^4.17.21"
     regexpp "^3.1.0"
     regexpp "^3.1.0"
     semver "^7.3.5"
     semver "^7.3.5"
     tsutils "^3.21.0"
     tsutils "^3.21.0"
 
 
-"@typescript-eslint/[email protected]6.1":
-  version "4.26.1"
-  resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.26.1.tgz#a35980a2390da9232aa206b27f620eab66e94142"
-  integrity sha512-sQHBugRhrXzRCs9PaGg6rowie4i8s/iD/DpTB+EXte8OMDfdCG5TvO73XlO9Wc/zi0uyN4qOmX9hIjQEyhnbmQ==
+"@typescript-eslint/[email protected]8.0":
+  version "4.28.0"
+  resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.28.0.tgz#13167ed991320684bdc23588135ae62115b30ee0"
+  integrity sha512-9XD9s7mt3QWMk82GoyUpc/Ji03vz4T5AYlHF9DcoFNfJ/y3UAclRsfGiE2gLfXtyC+JRA3trR7cR296TEb1oiQ==
   dependencies:
   dependencies:
     "@types/json-schema" "^7.0.7"
     "@types/json-schema" "^7.0.7"
-    "@typescript-eslint/scope-manager" "4.26.1"
-    "@typescript-eslint/types" "4.26.1"
-    "@typescript-eslint/typescript-estree" "4.26.1"
+    "@typescript-eslint/scope-manager" "4.28.0"
+    "@typescript-eslint/types" "4.28.0"
+    "@typescript-eslint/typescript-estree" "4.28.0"
     eslint-scope "^5.1.1"
     eslint-scope "^5.1.1"
     eslint-utils "^3.0.0"
     eslint-utils "^3.0.0"
 
 
-"@typescript-eslint/[email protected]6.1":
-  version "4.26.1"
-  resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.26.1.tgz#cecfdd5eb7a5c13aabce1c1cfd7fbafb5a0f1e8e"
-  integrity sha512-q7F3zSo/nU6YJpPJvQveVlIIzx9/wu75lr6oDbDzoeIRWxpoc/HQ43G4rmMoCc5my/3uSj2VEpg/D83LYZF5HQ==
+"@typescript-eslint/[email protected]8.0":
+  version "4.28.0"
+  resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.28.0.tgz#2404c16751a28616ef3abab77c8e51d680a12caa"
+  integrity sha512-7x4D22oPY8fDaOCvkuXtYYTQ6mTMmkivwEzS+7iml9F9VkHGbbZ3x4fHRwxAb5KeuSkLqfnYjs46tGx2Nour4A==
   dependencies:
   dependencies:
-    "@typescript-eslint/scope-manager" "4.26.1"
-    "@typescript-eslint/types" "4.26.1"
-    "@typescript-eslint/typescript-estree" "4.26.1"
+    "@typescript-eslint/scope-manager" "4.28.0"
+    "@typescript-eslint/types" "4.28.0"
+    "@typescript-eslint/typescript-estree" "4.28.0"
     debug "^4.3.1"
     debug "^4.3.1"
 
 
-"@typescript-eslint/[email protected]6.1":
-  version "4.26.1"
-  resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.26.1.tgz#075a74a15ff33ee3a7ed33e5fce16ee86689f662"
-  integrity sha512-TW1X2p62FQ8Rlne+WEShyd7ac2LA6o27S9i131W4NwDSfyeVlQWhw8ylldNNS8JG6oJB9Ha9Xyc+IUcqipvheQ==
+"@typescript-eslint/[email protected]8.0":
+  version "4.28.0"
+  resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.28.0.tgz#6a3009d2ab64a30fc8a1e257a1a320067f36a0ce"
+  integrity sha512-eCALCeScs5P/EYjwo6se9bdjtrh8ByWjtHzOkC4Tia6QQWtQr3PHovxh3TdYTuFcurkYI4rmFsRFpucADIkseg==
   dependencies:
   dependencies:
-    "@typescript-eslint/types" "4.26.1"
-    "@typescript-eslint/visitor-keys" "4.26.1"
+    "@typescript-eslint/types" "4.28.0"
+    "@typescript-eslint/visitor-keys" "4.28.0"
 
 
-"@typescript-eslint/[email protected]6.1":
-  version "4.26.1"
-  resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.26.1.tgz#9e7c523f73c34b04a765e4167ca5650436ef1d38"
-  integrity sha512-STyMPxR3cS+LaNvS8yK15rb8Y0iL0tFXq0uyl6gY45glyI7w0CsyqyEXl/Fa0JlQy+pVANeK3sbwPneCbWE7yg==
+"@typescript-eslint/[email protected]8.0":
+  version "4.28.0"
+  resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.28.0.tgz#a33504e1ce7ac51fc39035f5fe6f15079d4dafb0"
+  integrity sha512-p16xMNKKoiJCVZY5PW/AfILw2xe1LfruTcfAKBj3a+wgNYP5I9ZEKNDOItoRt53p4EiPV6iRSICy8EPanG9ZVA==
 
 
-"@typescript-eslint/[email protected]6.1":
-  version "4.26.1"
-  resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.26.1.tgz#b2ce2e789233d62283fae2c16baabd4f1dbc9633"
-  integrity sha512-l3ZXob+h0NQzz80lBGaykdScYaiEbFqznEs99uwzm8fPHhDjwaBFfQkjUC/slw6Sm7npFL8qrGEAMxcfBsBJUg==
+"@typescript-eslint/[email protected]8.0":
+  version "4.28.0"
+  resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.28.0.tgz#e66d4e5aa2ede66fec8af434898fe61af10c71cf"
+  integrity sha512-m19UQTRtxMzKAm8QxfKpvh6OwQSXaW1CdZPoCaQuLwAq7VZMNuhJmZR4g5281s2ECt658sldnJfdpSZZaxUGMQ==
   dependencies:
   dependencies:
-    "@typescript-eslint/types" "4.26.1"
-    "@typescript-eslint/visitor-keys" "4.26.1"
+    "@typescript-eslint/types" "4.28.0"
+    "@typescript-eslint/visitor-keys" "4.28.0"
     debug "^4.3.1"
     debug "^4.3.1"
     globby "^11.0.3"
     globby "^11.0.3"
     is-glob "^4.0.1"
     is-glob "^4.0.1"
     semver "^7.3.5"
     semver "^7.3.5"
     tsutils "^3.21.0"
     tsutils "^3.21.0"
 
 
-"@typescript-eslint/[email protected]6.1":
-  version "4.26.1"
-  resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.26.1.tgz#0d55ea735cb0d8903b198017d6d4f518fdaac546"
-  integrity sha512-IGouNSSd+6x/fHtYRyLOM6/C+QxMDzWlDtN41ea+flWuSF9g02iqcIlX8wM53JkfljoIjP0U+yp7SiTS1onEkw==
+"@typescript-eslint/[email protected]8.0":
+  version "4.28.0"
+  resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.28.0.tgz#255c67c966ec294104169a6939d96f91c8a89434"
+  integrity sha512-PjJyTWwrlrvM5jazxYF5ZPs/nl0kHDZMVbuIcbpawVXaDPelp3+S9zpOz5RmVUfS/fD5l5+ZXNKnWhNYjPzCvw==
   dependencies:
   dependencies:
-    "@typescript-eslint/types" "4.26.1"
+    "@typescript-eslint/types" "4.28.0"
     eslint-visitor-keys "^2.0.0"
     eslint-visitor-keys "^2.0.0"
 
 
 "@ungap/[email protected]":
 "@ungap/[email protected]":
@@ -1810,10 +1809,10 @@ es-abstract@^1.18.0-next.2:
     string.prototype.trimstart "^1.0.4"
     string.prototype.trimstart "^1.0.4"
     unbox-primitive "^1.0.1"
     unbox-primitive "^1.0.1"
 
 
-es-module-lexer@^0.4.0:
-  version "0.4.0"
-  resolved "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.4.0.tgz"
-  integrity sha512-iuEGihqqhKWFgh72Q/Jtch7V2t/ft8w8IPP2aEN8ArYKO+IWyo6hsi96hCdgyeEDQIV3InhYQ9BlwUFPGXrbEQ==
+es-module-lexer@^0.6.0:
+  version "0.6.0"
+  resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-0.6.0.tgz#e72ab05b7412e62b9be37c37a09bdb6000d706f0"
+  integrity sha512-f8kcHX1ArhllUtb/wVSyvygoKCznIjnxhLxy7TCvIiMdT7fL4ZDTIKaadMe6eLvOXg6Wk02UeoFgUoZ2EKZZUA==
 
 
 es-to-primitive@^1.2.1:
 es-to-primitive@^1.2.1:
   version "1.2.1"
   version "1.2.1"
@@ -1886,10 +1885,10 @@ [email protected]:
     resolve "^1.20.0"
     resolve "^1.20.0"
     tsconfig-paths "^3.9.0"
     tsconfig-paths "^3.9.0"
 
 
-eslint-plugin-jsdoc@35.1.3:
-  version "35.1.3"
-  resolved "https://registry.yarnpkg.com/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-35.1.3.tgz#ee9f8566eeb87a0e96fc52ec55897a2cb93ceea5"
-  integrity sha512-9AVpCssb7+cfEx3GJtnhJ8yLOVsHDKGMgngcfvwFBxdcOVPFhLENReL5aX1R2gNiG3psqIWFVBpSPnPQTrMZUA==
+eslint-plugin-jsdoc@35.4.0:
+  version "35.4.0"
+  resolved "https://registry.yarnpkg.com/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-35.4.0.tgz#4f4809ffa9430070aed10087fe691b9ededa2b05"
+  integrity sha512-0cr+NkPTxpTiMCtYOd8W5fd2IyC/CmaTHKb+0bzkpP9p8HfmJ3B2/M6FWj97rQJOLwLMkx+g2MIEZsrttpbFmQ==
   dependencies:
   dependencies:
     "@es-joy/jsdoccomment" "^0.8.0-alpha.2"
     "@es-joy/jsdoccomment" "^0.8.0-alpha.2"
     comment-parser "1.1.5"
     comment-parser "1.1.5"
@@ -1985,10 +1984,10 @@ eslint-visitor-keys@^2.0.0:
   resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz"
   resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz"
   integrity sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==
   integrity sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==
 
 
[email protected]8.0:
-  version "7.28.0"
-  resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.28.0.tgz#435aa17a0b82c13bb2be9d51408b617e49c1e820"
-  integrity sha512-UMfH0VSjP0G4p3EWirscJEQ/cHqnT/iuH6oNZOB94nBjWbMnhGEPxsZm1eyIW0C/9jLI0Fow4W5DXLjEI7mn1g==
[email protected]9.0:
+  version "7.29.0"
+  resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.29.0.tgz#ee2a7648f2e729485e4d0bd6383ec1deabc8b3c0"
+  integrity sha512-82G/JToB9qIy/ArBzIWG9xvvwL3R86AlCjtGw+A29OMZDqhTybz/MByORSukGxeI+YPCR4coYyITKk8BFH9nDA==
   dependencies:
   dependencies:
     "@babel/code-frame" "7.12.11"
     "@babel/code-frame" "7.12.11"
     "@eslint/eslintrc" "^0.4.2"
     "@eslint/eslintrc" "^0.4.2"
@@ -2252,10 +2251,10 @@ [email protected]:
   dependencies:
   dependencies:
     node-notifier "^6.0.0"
     node-notifier "^6.0.0"
 
 
[email protected]0:
-  version "6.2.10"
-  resolved "https://registry.yarnpkg.com/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-6.2.10.tgz#800ab1fa523c76011a3413bc4e7815e45b63e826"
-  integrity sha512-HveFCHWSH2WlYU1tU3PkrupvW8lNFMTfH3Jk0TfC2mtktE9ibHGcifhCsCFvj+kqlDfNIlwmNLiNqR9jnSA7OQ==
[email protected]2:
+  version "6.2.12"
+  resolved "https://registry.yarnpkg.com/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-6.2.12.tgz#b715297e39a77f31242d01a135a88d18c10d82ea"
+  integrity sha512-BzXGIfM47q1WFwXsNLl22dQVMFwSBgldL07lvqRJFxgrhT76QQ3nri5PX01Rxfa2RYvv/hqACULO8K5gT8fFuA==
   dependencies:
   dependencies:
     "@babel/code-frame" "^7.8.3"
     "@babel/code-frame" "^7.8.3"
     "@types/json-schema" "^7.0.5"
     "@types/json-schema" "^7.0.5"
@@ -2870,14 +2869,14 @@ istanbul-reports@^3.0.2:
     html-escaper "^2.0.0"
     html-escaper "^2.0.0"
     istanbul-lib-report "^3.0.0"
     istanbul-lib-report "^3.0.0"
 
 
-jest-worker@^26.6.2:
-  version "26.6.2"
-  resolved "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz"
-  integrity sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==
+jest-worker@^27.0.2:
+  version "27.0.2"
+  resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.0.2.tgz#4ebeb56cef48b3e7514552f80d0d80c0129f0b05"
+  integrity sha512-EoBdilOTTyOgmHXtw/cPc+ZrCA0KJMrkXzkrPGNwLmnvvlN1nj7MPrxpT7m+otSv2e1TLaVffzDnE/LB14zJMg==
   dependencies:
   dependencies:
     "@types/node" "*"
     "@types/node" "*"
     merge-stream "^2.0.0"
     merge-stream "^2.0.0"
-    supports-color "^7.0.0"
+    supports-color "^8.0.0"
 
 
 [email protected]:
 [email protected]:
   version "1.0.1"
   version "1.0.1"
@@ -3168,10 +3167,10 @@ [email protected]:
   resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz"
   resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz"
   integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==
   integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==
 
 
[email protected].0:
-  version "9.0.0"
-  resolved "https://registry.yarnpkg.com/mocha/-/mocha-9.0.0.tgz#67ce848170cb6426f9e84c57e38376dc9017bab4"
-  integrity sha512-GRGG/q9bIaUkHJB9NL+KZNjDhMBHB30zW3bZW9qOiYr+QChyLjPzswaxFWkI1q6lGlSL28EQYzAi2vKWNkPx+g==
[email protected].1:
+  version "9.0.1"
+  resolved "https://registry.yarnpkg.com/mocha/-/mocha-9.0.1.tgz#01e66b7af0012330c0a38c4b6eaa6d92b8a81bf9"
+  integrity sha512-9zwsavlRO+5csZu6iRtl3GHImAbhERoDsZwdRkdJ/bE+eVplmoxNKE901ZJ9LdSchYBjSCPbjKc5XvcAri2ylw==
   dependencies:
   dependencies:
     "@ungap/promise-all-settled" "1.1.2"
     "@ungap/promise-all-settled" "1.1.2"
     ansi-colors "4.1.1"
     ansi-colors "4.1.1"
@@ -4251,7 +4250,7 @@ strip-json-comments@^3.1.0:
   resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.0.tgz"
   resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.0.tgz"
   integrity sha512-e6/d0eBu7gHtdCqFt0xJr642LdToM5/cN4Qb9DbHjVx1CP5RyeM+zH7pbecEmDv/lBqb0QH+6Uqq75rxFPkM0w==
   integrity sha512-e6/d0eBu7gHtdCqFt0xJr642LdToM5/cN4Qb9DbHjVx1CP5RyeM+zH7pbecEmDv/lBqb0QH+6Uqq75rxFPkM0w==
 
 
[email protected]:
[email protected], supports-color@^8.0.0:
   version "8.1.1"
   version "8.1.1"
   resolved "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz"
   resolved "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz"
   integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==
   integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==
@@ -4265,13 +4264,6 @@ supports-color@^5.3.0:
   dependencies:
   dependencies:
     has-flag "^3.0.0"
     has-flag "^3.0.0"
 
 
-supports-color@^7.0.0, supports-color@^7.2.0:
-  version "7.2.0"
-  resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da"
-  integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==
-  dependencies:
-    has-flag "^4.0.0"
-
 supports-color@^7.1.0:
 supports-color@^7.1.0:
   version "7.1.0"
   version "7.1.0"
   resolved "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz"
   resolved "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz"
@@ -4279,6 +4271,13 @@ supports-color@^7.1.0:
   dependencies:
   dependencies:
     has-flag "^4.0.0"
     has-flag "^4.0.0"
 
 
+supports-color@^7.2.0:
+  version "7.2.0"
+  resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da"
+  integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==
+  dependencies:
+    has-flag "^4.0.0"
+
 table@^6.0.9:
 table@^6.0.9:
   version "6.7.1"
   version "6.7.1"
   resolved "https://registry.yarnpkg.com/table/-/table-6.7.1.tgz#ee05592b7143831a8c94f3cee6aae4c1ccef33e2"
   resolved "https://registry.yarnpkg.com/table/-/table-6.7.1.tgz#ee05592b7143831a8c94f3cee6aae4c1ccef33e2"
@@ -4306,22 +4305,22 @@ tapable@^2.2.0:
   resolved "https://registry.npmjs.org/tapable/-/tapable-2.2.0.tgz"
   resolved "https://registry.npmjs.org/tapable/-/tapable-2.2.0.tgz"
   integrity sha512-FBk4IesMV1rBxX2tfiK8RAmogtWn53puLOQlvO8XuwlgxcYbP4mVPS9Ph4aeamSyyVjOl24aYWAuc8U5kCVwMw==
   integrity sha512-FBk4IesMV1rBxX2tfiK8RAmogtWn53puLOQlvO8XuwlgxcYbP4mVPS9Ph4aeamSyyVjOl24aYWAuc8U5kCVwMw==
 
 
-terser-webpack-plugin@^5.1.1:
-  version "5.1.1"
-  resolved "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.1.1.tgz"
-  integrity sha512-5XNNXZiR8YO6X6KhSGXfY0QrGrCRlSwAEjIIrlRQR4W8nP69TaJUlh3bkuac6zzgspiGPfKEHcY295MMVExl5Q==
+terser-webpack-plugin@^5.1.3:
+  version "5.1.3"
+  resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.1.3.tgz#30033e955ca28b55664f1e4b30a1347e61aa23af"
+  integrity sha512-cxGbMqr6+A2hrIB5ehFIF+F/iST5ZOxvOmy9zih9ySbP1C2oEWQSOUS+2SNBTjzx5xLKO4xnod9eywdfq1Nb9A==
   dependencies:
   dependencies:
-    jest-worker "^26.6.2"
+    jest-worker "^27.0.2"
     p-limit "^3.1.0"
     p-limit "^3.1.0"
     schema-utils "^3.0.0"
     schema-utils "^3.0.0"
     serialize-javascript "^5.0.1"
     serialize-javascript "^5.0.1"
     source-map "^0.6.1"
     source-map "^0.6.1"
-    terser "^5.5.1"
+    terser "^5.7.0"
 
 
-terser@^5.5.1:
-  version "5.5.1"
-  resolved "https://registry.npmjs.org/terser/-/terser-5.5.1.tgz"
-  integrity sha512-6VGWZNVP2KTUcltUQJ25TtNjx/XgdDsBDKGt8nN0MpydU36LmbPPcMBd2kmtZNNGVVDLg44k7GKeHHj+4zPIBQ==
+terser@^5.7.0:
+  version "5.7.0"
+  resolved "https://registry.yarnpkg.com/terser/-/terser-5.7.0.tgz#a761eeec206bc87b605ab13029876ead938ae693"
+  integrity sha512-HP5/9hp2UaZt5fYkuhNBR8YyRcT8juw8+uFbAme53iN9hblvKnLUTKkmwJG6ocWpIKf8UK4DoeWG4ty0J6S6/g==
   dependencies:
   dependencies:
     commander "^2.20.0"
     commander "^2.20.0"
     source-map "~0.7.2"
     source-map "~0.7.2"
@@ -4471,10 +4470,10 @@ typedarray@^0.0.6:
   resolved "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz"
   resolved "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz"
   integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
   integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
 
 
[email protected].2:
-  version "4.3.2"
-  resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.2.tgz#399ab18aac45802d6f2498de5054fcbbe716a805"
-  integrity sha512-zZ4hShnmnoVnAHpVHWpTcxdv7dWP60S2FsydQLV8V5PbS3FifjWFFRiHSWpDJahly88PRyV5teTSLoq4eG7mKw==
[email protected].4:
+  version "4.3.4"
+  resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.4.tgz#3f85b986945bcf31071decdd96cf8bfa65f9dcbc"
+  integrity sha512-uauPG7XZn9F/mo+7MrsRjyvbxFpzemRjKEZXS4AK83oP2KKOJPvb+9cO/gmnv8arWZvhnjVOXz7B49m1l0e9Ew==
 
 
 unbox-primitive@^1.0.1:
 unbox-primitive@^1.0.1:
   version "1.0.1"
   version "1.0.1"
@@ -4591,10 +4590,10 @@ webpack-sources@^2.3.0:
     source-list-map "^2.0.1"
     source-list-map "^2.0.1"
     source-map "^0.6.1"
     source-map "^0.6.1"
 
 
-webpack@5.38.1:
-  version "5.38.1"
-  resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.38.1.tgz#5224c7f24c18e729268d3e3bc97240d6e880258e"
-  integrity sha512-OqRmYD1OJbHZph6RUMD93GcCZy4Z4wC0ele4FXyYF0J6AxO1vOSuIlU1hkS/lDlR9CDYBz64MZRmdbdnFFoT2g==
+webpack@5.40.0:
+  version "5.40.0"
+  resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.40.0.tgz#3182cfd324759d715252cf541901a226e57b5061"
+  integrity sha512-c7f5e/WWrxXWUzQqTBg54vBs5RgcAgpvKE4F4VegVgfo4x660ZxYUF2/hpMkZUnLjgytVTitjeXaN4IPlXCGIw==
   dependencies:
   dependencies:
     "@types/eslint-scope" "^3.7.0"
     "@types/eslint-scope" "^3.7.0"
     "@types/estree" "^0.0.47"
     "@types/estree" "^0.0.47"
@@ -4605,7 +4604,7 @@ [email protected]:
     browserslist "^4.14.5"
     browserslist "^4.14.5"
     chrome-trace-event "^1.0.2"
     chrome-trace-event "^1.0.2"
     enhanced-resolve "^5.8.0"
     enhanced-resolve "^5.8.0"
-    es-module-lexer "^0.4.0"
+    es-module-lexer "^0.6.0"
     eslint-scope "5.1.1"
     eslint-scope "5.1.1"
     events "^3.2.0"
     events "^3.2.0"
     glob-to-regexp "^0.4.1"
     glob-to-regexp "^0.4.1"
@@ -4616,7 +4615,7 @@ [email protected]:
     neo-async "^2.6.2"
     neo-async "^2.6.2"
     schema-utils "^3.0.0"
     schema-utils "^3.0.0"
     tapable "^2.1.1"
     tapable "^2.1.1"
-    terser-webpack-plugin "^5.1.1"
+    terser-webpack-plugin "^5.1.3"
     watchpack "^2.2.0"
     watchpack "^2.2.0"
     webpack-sources "^2.3.0"
     webpack-sources "^2.3.0"
 
 

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików