diff --git a/dist/src/custom-nodes/unicode-array-nodes/UnicodeArrayDecodeNode.js b/dist/src/custom-nodes/unicode-array-nodes/UnicodeArrayDecodeNode.js index 51af38ac..cdbf551c 100644 --- a/dist/src/custom-nodes/unicode-array-nodes/UnicodeArrayDecodeNode.js +++ b/dist/src/custom-nodes/unicode-array-nodes/UnicodeArrayDecodeNode.js @@ -24,27 +24,27 @@ class UnicodeArrayDecodeNode extends Node_1.Node { return super.getNode(); } getNodeStructure() { - const atobPolyfill = JavaScriptObfuscator_1.JavaScriptObfuscator.obfuscate(` - var object = []['filter']['constructor']('return this')(); - var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; - - object.atob || ( - object.atob = function(input) { - var str = String(input).replace(/=+$/, ''); - for ( - var bc = 0, bs, buffer, idx = 0, output = ''; - buffer = str.charAt(idx++); - ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer, - bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0 - ) { - buffer = chars.indexOf(buffer); - } - return output; - }); - `, NoCustomNodesPreset_1.NO_CUSTOM_NODES_PRESET), indexVariableName = Utils_1.Utils.getRandomVariableName(), tempArrayName = Utils_1.Utils.getRandomVariableName(); + const indexVariableName = Utils_1.Utils.getRandomVariableName(), tempArrayName = Utils_1.Utils.getRandomVariableName(); let node = esprima.parse(` (function () { - ${atobPolyfill} + ${JavaScriptObfuscator_1.JavaScriptObfuscator.obfuscate(` + var object = []['filter']['constructor']('return this')(); + var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; + + object.atob || ( + object.atob = function(input) { + var str = String(input).replace(/=+$/, ''); + for ( + var bc = 0, bs, buffer, idx = 0, output = ''; + buffer = str.charAt(idx++); + ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer, + bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0 + ) { + buffer = chars.indexOf(buffer); + } + return output; + }); + `, NoCustomNodesPreset_1.NO_CUSTOM_NODES_PRESET)} var ${tempArrayName} = []; diff --git a/src/custom-nodes/unicode-array-nodes/UnicodeArrayDecodeNode.ts b/src/custom-nodes/unicode-array-nodes/UnicodeArrayDecodeNode.ts index 5e12ecea..ba553c61 100644 --- a/src/custom-nodes/unicode-array-nodes/UnicodeArrayDecodeNode.ts +++ b/src/custom-nodes/unicode-array-nodes/UnicodeArrayDecodeNode.ts @@ -67,30 +67,29 @@ export class UnicodeArrayDecodeNode extends Node { * @returns {INode} */ protected getNodeStructure (): INode { - const atobPolyfill: string = JavaScriptObfuscator.obfuscate(` - var object = []['filter']['constructor']('return this')(); - var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; - - object.atob || ( - object.atob = function(input) { - var str = String(input).replace(/=+$/, ''); - for ( - var bc = 0, bs, buffer, idx = 0, output = ''; - buffer = str.charAt(idx++); - ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer, - bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0 - ) { - buffer = chars.indexOf(buffer); - } - return output; - }); - `, NO_CUSTOM_NODES_PRESET), - indexVariableName: string = Utils.getRandomVariableName(), + const indexVariableName: string = Utils.getRandomVariableName(), tempArrayName: string = Utils.getRandomVariableName(); let node: INode = esprima.parse(` (function () { - ${atobPolyfill} + ${JavaScriptObfuscator.obfuscate(` + var object = []['filter']['constructor']('return this')(); + var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; + + object.atob || ( + object.atob = function(input) { + var str = String(input).replace(/=+$/, ''); + for ( + var bc = 0, bs, buffer, idx = 0, output = ''; + buffer = str.charAt(idx++); + ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer, + bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0 + ) { + buffer = chars.indexOf(buffer); + } + return output; + }); + `, NO_CUSTOM_NODES_PRESET)} var ${tempArrayName} = [];