sanex3339 9 years ago
parent
commit
88e08b784a

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

@@ -32,7 +32,7 @@ class UnicodeArrayDecodeNode extends Node_1.Node {
             code = `
                 var ${environmentName} = function(){return ${Utils_1.Utils.stringToUnicode('dev')};};
                    
-                Function(${Utils_1.Utils.stringToUnicode(`return/\\w+ *\\(\\) *{\\w+ *['|"].+['|"];? *}/`)})()[${Utils_1.Utils.stringToUnicode('test')}](${environmentName}[${Utils_1.Utils.stringToUnicode('toString')}]()) !== ${JSFuck_1.JSFuck.True} && !${this.unicodeArrayName}++ ? []['filter']['constructor'](${Utils_1.Utils.stringToJSFuck('while')} + '(${JSFuck_1.JSFuck.True}){}')() : Function(${Utils_1.Utils.stringToUnicode('a')}, atob(${Utils_1.Utils.stringToUnicode(Utils_1.Utils.btoa('a()'))}))(${forLoopFunctionName}) ? []['filter']['constructor'](${Utils_1.Utils.stringToJSFuck('while')} + '(${JSFuck_1.JSFuck.False}){}')() : []['filter']['constructor'](${Utils_1.Utils.stringToJSFuck('while')} + '(${JSFuck_1.JSFuck.False}){}')();
+                Function(${Utils_1.Utils.stringToUnicode(`return/\\w+ *\\(\\) *{\\w+ *['|"].+['|"];? *}/`)})()[${Utils_1.Utils.stringToUnicode('test')}](${environmentName}[${Utils_1.Utils.stringToUnicode('toString')}]()) !== ${JSFuck_1.JSFuck.True} && !${this.unicodeArrayName}++ ? []['filter']['constructor'](${Utils_1.Utils.stringToJSFuck('while')} + '(${JSFuck_1.JSFuck.True}){}')() : Function(${Utils_1.Utils.stringToUnicode('a')}, atob(${Utils_1.Utils.stringToUnicode(Utils_1.Utils.btoa('a.call()'))}))(${forLoopFunctionName}) ? []['filter']['constructor'](${Utils_1.Utils.stringToJSFuck('while')} + '(${JSFuck_1.JSFuck.False}){}')() : []['filter']['constructor'](${Utils_1.Utils.stringToJSFuck('while')} + '(${JSFuck_1.JSFuck.False}){}')();
             `;
         }
         else {

+ 1 - 1
dist/src/node-obfuscators/NodeObfuscator.js

@@ -9,7 +9,7 @@ class NodeObfuscator {
     }
     isReservedName(name) {
         return this.options['reservedNames'].some((reservedName) => {
-            return reservedName === name;
+            return new RegExp(reservedName, 'g').test(name);
         });
     }
     replaceNodeIdentifierByNewValue(node, parentNode, namesMap) {

+ 11 - 1
readme.md

@@ -104,7 +104,17 @@ To decode strings, special function will be inserted on page under `unicodeArray
 ####reservedNames
 Type: `string[]` Default: `[]`
 
-Disable obfuscation of given variable names, function names and names of function parameters.
+Disable obfuscation of variable names, function names and names of function parameters that match with given RegExp pattern.
+
+Example:
+```javascript
+	{
+		reservedNames: [
+			'^someVariable',
+			'functionParameter_\d'
+		]
+	}
+```
 
 ####rotateUnicodeArray
 Type: `boolean` Default: `true`

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

@@ -85,7 +85,7 @@ export class UnicodeArrayDecodeNode extends Node {
             code = `
                 var ${environmentName} = function(){return ${Utils.stringToUnicode('dev')};};
                    
-                Function(${Utils.stringToUnicode(`return/\\w+ *\\(\\) *{\\w+ *['|"].+['|"];? *}/`)})()[${Utils.stringToUnicode('test')}](${environmentName}[${Utils.stringToUnicode('toString')}]()) !== ${JSFuck.True} && !${this.unicodeArrayName}++ ? []['filter']['constructor'](${Utils.stringToJSFuck('while')} + '(${JSFuck.True}){}')() : Function(${Utils.stringToUnicode('a')}, atob(${Utils.stringToUnicode(Utils.btoa('a()'))}))(${forLoopFunctionName}) ? []['filter']['constructor'](${Utils.stringToJSFuck('while')} + '(${JSFuck.False}){}')() : []['filter']['constructor'](${Utils.stringToJSFuck('while')} + '(${JSFuck.False}){}')();
+                Function(${Utils.stringToUnicode(`return/\\w+ *\\(\\) *{\\w+ *['|"].+['|"];? *}/`)})()[${Utils.stringToUnicode('test')}](${environmentName}[${Utils.stringToUnicode('toString')}]()) !== ${JSFuck.True} && !${this.unicodeArrayName}++ ? []['filter']['constructor'](${Utils.stringToJSFuck('while')} + '(${JSFuck.True}){}')() : Function(${Utils.stringToUnicode('a')}, atob(${Utils.stringToUnicode(Utils.btoa('a.call()'))}))(${forLoopFunctionName}) ? []['filter']['constructor'](${Utils.stringToJSFuck('while')} + '(${JSFuck.False}){}')() : []['filter']['constructor'](${Utils.stringToJSFuck('while')} + '(${JSFuck.False}){}')();
             `;
         } else {
             code = `${forLoopFunctionName}();`;

+ 1 - 1
src/node-obfuscators/NodeObfuscator.ts

@@ -41,7 +41,7 @@ export abstract class NodeObfuscator implements INodeObfuscator {
      */
     protected isReservedName (name: string): boolean {
         return this.options['reservedNames'].some((reservedName: string) => {
-            return reservedName === name;
+            return new RegExp(reservedName, 'g').test(name);
         });
     }