mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
dev
This commit is contained in:
+2
-9
@@ -26,7 +26,7 @@ class UnicodeArrayRotateFunctionNode extends Node_1.Node {
|
||||
return super.getNode();
|
||||
}
|
||||
getNodeStructure() {
|
||||
let arrayName = Utils_1.Utils.getRandomVariableName(), code = '', timesName = Utils_1.Utils.getRandomVariableName(), timesArgumentName = Utils_1.Utils.getRandomVariableName(), tempArrayName = Utils_1.Utils.getRandomVariableName(), whileFunctionName = Utils_1.Utils.getRandomVariableName(), node;
|
||||
let arrayName = Utils_1.Utils.getRandomVariableName(), code = '', timesName = Utils_1.Utils.getRandomVariableName(), timesArgumentName = Utils_1.Utils.getRandomVariableName(), whileFunctionName = Utils_1.Utils.getRandomVariableName(), node;
|
||||
if (this.options['selfDefending']) {
|
||||
code = JavaScriptObfuscator_1.JavaScriptObfuscator.obfuscate(`
|
||||
(function () {
|
||||
@@ -41,16 +41,9 @@ class UnicodeArrayRotateFunctionNode extends Node_1.Node {
|
||||
}
|
||||
node = esprima.parse(`
|
||||
(function (${arrayName}, ${timesName}) {
|
||||
if (${timesName} < 0x${Utils_1.Utils.decToHex(0)}) {
|
||||
return;
|
||||
}
|
||||
|
||||
var ${tempArrayName};
|
||||
|
||||
var ${whileFunctionName} = function (${timesArgumentName}) {
|
||||
while (--${timesArgumentName}) {
|
||||
${tempArrayName} = ${arrayName}[${Utils_1.Utils.stringToUnicode('shift')}]();
|
||||
${arrayName}[${Utils_1.Utils.stringToUnicode('push')}](${tempArrayName});
|
||||
${arrayName}[${Utils_1.Utils.stringToUnicode('push')}](${arrayName}[${Utils_1.Utils.stringToUnicode('shift')}]());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -83,7 +83,6 @@ export class UnicodeArrayRotateFunctionNode extends Node {
|
||||
code: string = '',
|
||||
timesName: string = Utils.getRandomVariableName(),
|
||||
timesArgumentName: string = Utils.getRandomVariableName(),
|
||||
tempArrayName: string = Utils.getRandomVariableName(),
|
||||
whileFunctionName: string = Utils.getRandomVariableName(),
|
||||
node: INode;
|
||||
|
||||
@@ -101,16 +100,9 @@ export class UnicodeArrayRotateFunctionNode extends Node {
|
||||
|
||||
node = esprima.parse(`
|
||||
(function (${arrayName}, ${timesName}) {
|
||||
if (${timesName} < 0x${Utils.decToHex(0)}) {
|
||||
return;
|
||||
}
|
||||
|
||||
var ${tempArrayName};
|
||||
|
||||
var ${whileFunctionName} = function (${timesArgumentName}) {
|
||||
while (--${timesArgumentName}) {
|
||||
${tempArrayName} = ${arrayName}[${Utils.stringToUnicode('shift')}]();
|
||||
${arrayName}[${Utils.stringToUnicode('push')}](${tempArrayName});
|
||||
${arrayName}[${Utils.stringToUnicode('push')}](${arrayName}[${Utils.stringToUnicode('shift')}]());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user