diff --git a/dist/src/custom-nodes/unicode-array-nodes/UnicodeArrayDecodeNode.js b/dist/src/custom-nodes/unicode-array-nodes/UnicodeArrayDecodeNode.js index 12f9d292..51af38ac 100644 --- a/dist/src/custom-nodes/unicode-array-nodes/UnicodeArrayDecodeNode.js +++ b/dist/src/custom-nodes/unicode-array-nodes/UnicodeArrayDecodeNode.js @@ -49,7 +49,7 @@ class UnicodeArrayDecodeNode extends Node_1.Node { var ${tempArrayName} = []; for (var ${indexVariableName} in ${this.unicodeArrayName}) { - ${tempArrayName}[${Utils_1.Utils.stringToUnicode('push')}](atob(${this.unicodeArrayName}[${indexVariableName}])); + ${tempArrayName}[${Utils_1.Utils.stringToUnicode('push')}](decodeURI(atob(${this.unicodeArrayName}[${indexVariableName}]))); } ${this.unicodeArrayName} = ${tempArrayName}; diff --git a/dist/src/node-obfuscators/NodeObfuscator.js b/dist/src/node-obfuscators/NodeObfuscator.js index 92760d47..2e455c12 100644 --- a/dist/src/node-obfuscators/NodeObfuscator.js +++ b/dist/src/node-obfuscators/NodeObfuscator.js @@ -32,7 +32,7 @@ class NodeObfuscator { replaceLiteralStringByUnicodeArrayCall(nodeValue) { let value = nodeValue; if (this.options['encodeUnicodeArray']) { - value = new Buffer(value).toString('base64'); + value = new Buffer(encodeURI(value)).toString('base64'); } value = Utils_1.Utils.stringToUnicode(value); let unicodeArray = this.nodes.get('unicodeArrayNode').getNodeData(), sameIndex = unicodeArray.indexOf(value), index, hexadecimalIndex; diff --git a/src/custom-nodes/unicode-array-nodes/UnicodeArrayDecodeNode.ts b/src/custom-nodes/unicode-array-nodes/UnicodeArrayDecodeNode.ts index 21a12cde..5e12ecea 100644 --- a/src/custom-nodes/unicode-array-nodes/UnicodeArrayDecodeNode.ts +++ b/src/custom-nodes/unicode-array-nodes/UnicodeArrayDecodeNode.ts @@ -95,7 +95,7 @@ export class UnicodeArrayDecodeNode extends Node { var ${tempArrayName} = []; for (var ${indexVariableName} in ${this.unicodeArrayName}) { - ${tempArrayName}[${Utils.stringToUnicode('push')}](atob(${this.unicodeArrayName}[${indexVariableName}])); + ${tempArrayName}[${Utils.stringToUnicode('push')}](decodeURI(atob(${this.unicodeArrayName}[${indexVariableName}]))); } ${this.unicodeArrayName} = ${tempArrayName}; diff --git a/src/node-obfuscators/NodeObfuscator.ts b/src/node-obfuscators/NodeObfuscator.ts index ebbbba33..1a1a7b92 100644 --- a/src/node-obfuscators/NodeObfuscator.ts +++ b/src/node-obfuscators/NodeObfuscator.ts @@ -89,7 +89,7 @@ export abstract class NodeObfuscator implements INodeObfuscator { let value: string = nodeValue; if (this.options['encodeUnicodeArray']) { - value = new Buffer(value).toString('base64'); + value = new Buffer(encodeURI(value)).toString('base64'); } value = Utils.stringToUnicode(value);