mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
dev
This commit is contained in:
@@ -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
@@ -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) {
|
||||
|
||||
@@ -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`
|
||||
|
||||
@@ -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}();`;
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user