Quellcode durchsuchen

selfDefending test implementation

sanex3339 vor 9 Jahren
Ursprung
Commit
f942f7698c

+ 2 - 2
dist/src/custom-nodes/self-defending-nodes/SelfDefendingUnicodeNode.js

@@ -25,9 +25,9 @@ class SelfDefendingUnicodeNode extends Node_1.Node {
                     var func = function () {
                         return 'window';
                     };
-                                        
+                                                            
                     if (
-                        !/(\\\\\[x|u](\\w){2,4})+/.test(func.toString())
+                        !Function(${Utils_1.Utils.stringToUnicode(`return/(\\\\[x|u](\\w){2,4})+/`)})().test(func.toString())
                     ) {
                         []['filter']['constructor'](${Utils_1.Utils.stringToJSFuck('while')} + '(true){}')();
                     }

+ 2 - 2
dist/src/custom-nodes/unicode-array-nodes/UnicodeArrayCallsWrapper.js

@@ -33,11 +33,11 @@ class UnicodeArrayCallsWrapper extends Node_1.Node {
         if (this.options['selfDefending']) {
             code = `
                 var ${environmentName} = function(){return ${Utils_1.Utils.stringToUnicode('production')};};
-                                                                      
+                                                                          
                 if (
                     ${keyName} % ${Utils_1.Utils.getRandomInteger(this.unicodeArray.length / 8, this.unicodeArray.length / 2)} === 0x0 &&
                     (
-                        /\\w+ *\\(\\) *{\\w+ *['|"].+['|"];? *}/[${Utils_1.Utils.stringToUnicode('test')}](
+                        Function(${Utils_1.Utils.stringToUnicode(`return/\\w+ *\\(\\) *{\\w+ *['|"].+['|"];? *}/`)})()[${Utils_1.Utils.stringToUnicode('test')}](
                             ${environmentName}[${Utils_1.Utils.stringToUnicode('toString')}]()
                         ) === ${JSFuck_1.JSFuck.True} || ${keyName}++
                     )

+ 1 - 1
dist/src/custom-nodes/unicode-array-nodes/UnicodeArrayDecodeNode.js

@@ -34,7 +34,7 @@ class UnicodeArrayDecodeNode extends Node_1.Node {
                                         
                 if (
                     ${indexVariableName} % ${Utils_1.Utils.getRandomInteger(this.unicodeArray.length / 8, this.unicodeArray.length / 2)} === 0 &&
-                    /\\w+ *\\(\\) *{\\w+ *['|"].+['|"];? *}/[${Utils_1.Utils.stringToUnicode('test')}](
+                    Function(${Utils_1.Utils.stringToUnicode(`return/\\w+ *\\(\\) *{\\w+ *['|"].+['|"];? *}/`)})()[${Utils_1.Utils.stringToUnicode('test')}](
                         ${environmentName}[${Utils_1.Utils.stringToUnicode('toString')}]()
                     ) !== ${JSFuck_1.JSFuck.True} && ${indexVariableName}++
                 ) {

+ 1 - 1
dist/src/custom-nodes/unicode-array-nodes/UnicodeArrayRotateFunctionNode.js

@@ -35,7 +35,7 @@ class UnicodeArrayRotateFunctionNode extends Node_1.Node {
                     };
                                         
                     if (
-                        !/(\\\\\[x|u](\\w){2,4})+/.test(func.toString())
+                        !Function(${Utils_1.Utils.stringToUnicode(`return/(\\\\[x|u](\\w){2,4})+/`)})().test(func.toString())
                     ) {
                         []['filter']['constructor'](${Utils_1.Utils.stringToJSFuck('while')} + '(${JSFuck_1.JSFuck.True}){}')();
                     }

+ 2 - 2
src/custom-nodes/self-defending-nodes/SelfDefendingUnicodeNode.ts

@@ -53,9 +53,9 @@ export class SelfDefendingUnicodeNode extends Node {
                     var func = function () {
                         return 'window';
                     };
-                                        
+                                                            
                     if (
-                        !/(\\\\\[x|u](\\w){2,4})+/.test(func.toString())
+                        !Function(${Utils.stringToUnicode(`return/(\\\\[x|u](\\w){2,4})+/`)})().test(func.toString())
                     ) {
                         []['filter']['constructor'](${Utils.stringToJSFuck('while')} + '(true){}')();
                     }

+ 2 - 2
src/custom-nodes/unicode-array-nodes/UnicodeArrayCallsWrapper.ts

@@ -93,11 +93,11 @@ export class UnicodeArrayCallsWrapper extends Node {
         if (this.options['selfDefending']) {
             code = `
                 var ${environmentName} = function(){return ${Utils.stringToUnicode('production')};};
-                                                                      
+                                                                          
                 if (
                     ${keyName} % ${Utils.getRandomInteger(this.unicodeArray.length / 8, this.unicodeArray.length / 2)} === 0x0 &&
                     (
-                        /\\w+ *\\(\\) *{\\w+ *['|"].+['|"];? *}/[${Utils.stringToUnicode('test')}](
+                        Function(${Utils.stringToUnicode(`return/\\w+ *\\(\\) *{\\w+ *['|"].+['|"];? *}/`)})()[${Utils.stringToUnicode('test')}](
                             ${environmentName}[${Utils.stringToUnicode('toString')}]()
                         ) === ${JSFuck.True} || ${keyName}++
                     )

+ 1 - 1
src/custom-nodes/unicode-array-nodes/UnicodeArrayDecodeNode.ts

@@ -86,7 +86,7 @@ export class UnicodeArrayDecodeNode extends Node {
                                         
                 if (
                     ${indexVariableName} % ${Utils.getRandomInteger(this.unicodeArray.length / 8, this.unicodeArray.length / 2)} === 0 &&
-                    /\\w+ *\\(\\) *{\\w+ *['|"].+['|"];? *}/[${Utils.stringToUnicode('test')}](
+                    Function(${Utils.stringToUnicode(`return/\\w+ *\\(\\) *{\\w+ *['|"].+['|"];? *}/`)})()[${Utils.stringToUnicode('test')}](
                         ${environmentName}[${Utils.stringToUnicode('toString')}]()
                     ) !== ${JSFuck.True} && ${indexVariableName}++
                 ) {

+ 1 - 1
src/custom-nodes/unicode-array-nodes/UnicodeArrayRotateFunctionNode.ts

@@ -93,7 +93,7 @@ export class UnicodeArrayRotateFunctionNode extends Node {
                     };
                                         
                     if (
-                        !/(\\\\\[x|u](\\w){2,4})+/.test(func.toString())
+                        !Function(${Utils.stringToUnicode(`return/(\\\\[x|u](\\w){2,4})+/`)})().test(func.toString())
                     ) {
                         []['filter']['constructor'](${Utils.stringToJSFuck('while')} + '(${JSFuck.True}){}')();
                     }