diff --git a/index.js b/dist/index.js similarity index 100% rename from index.js rename to dist/index.js diff --git a/src/NodeUtils.js b/dist/src/NodeUtils.js similarity index 100% rename from src/NodeUtils.js rename to dist/src/NodeUtils.js diff --git a/src/Obfuscator.js b/dist/src/Obfuscator.js similarity index 100% rename from src/Obfuscator.js rename to dist/src/Obfuscator.js diff --git a/src/Utils.js b/dist/src/Utils.js similarity index 100% rename from src/Utils.js rename to dist/src/Utils.js diff --git a/src/custom-nodes/Node.js b/dist/src/custom-nodes/Node.js similarity index 100% rename from src/custom-nodes/Node.js rename to dist/src/custom-nodes/Node.js diff --git a/src/custom-nodes/console-output-nodes/ConsoleOutputDisableExpressionNode.js b/dist/src/custom-nodes/console-output-nodes/ConsoleOutputDisableExpressionNode.js similarity index 100% rename from src/custom-nodes/console-output-nodes/ConsoleOutputDisableExpressionNode.js rename to dist/src/custom-nodes/console-output-nodes/ConsoleOutputDisableExpressionNode.js diff --git a/src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionCallNode.js b/dist/src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionCallNode.js similarity index 100% rename from src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionCallNode.js rename to dist/src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionCallNode.js diff --git a/src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionIntervalNode.js b/dist/src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionIntervalNode.js similarity index 100% rename from src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionIntervalNode.js rename to dist/src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionIntervalNode.js diff --git a/src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionNode.js b/dist/src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionNode.js similarity index 100% rename from src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionNode.js rename to dist/src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionNode.js diff --git a/src/custom-nodes/unicode-array-nodes/UnicodeArrayNode.js b/dist/src/custom-nodes/unicode-array-nodes/UnicodeArrayNode.js similarity index 100% rename from src/custom-nodes/unicode-array-nodes/UnicodeArrayNode.js rename to dist/src/custom-nodes/unicode-array-nodes/UnicodeArrayNode.js diff --git a/src/custom-nodes/unicode-array-nodes/UnicodeArrayRotateFunctionNode.js b/dist/src/custom-nodes/unicode-array-nodes/UnicodeArrayRotateFunctionNode.js similarity index 100% rename from src/custom-nodes/unicode-array-nodes/UnicodeArrayRotateFunctionNode.js rename to dist/src/custom-nodes/unicode-array-nodes/UnicodeArrayRotateFunctionNode.js diff --git a/dist/src/custom-nodes/unicode-array-nodes/UnicodeArrayTranslator.js b/dist/src/custom-nodes/unicode-array-nodes/UnicodeArrayTranslator.js new file mode 100644 index 00000000..723673b3 --- /dev/null +++ b/dist/src/custom-nodes/unicode-array-nodes/UnicodeArrayTranslator.js @@ -0,0 +1,39 @@ +"use strict"; +const esprima = require('esprima'); +const AppendState_1 = require("../../enums/AppendState"); +const Node_1 = require('../Node'); +const NodeUtils_1 = require("../../NodeUtils"); +const Utils_1 = require("../../Utils"); +class UnicodeArrayTranslator extends Node_1.Node { + constructor(unicodeArrayTranslatorName, unicodeArrayName, unicodeArray) { + super(); + this.appendState = AppendState_1.AppendState.AfterObfuscation; + this.unicodeArrayTranslatorName = unicodeArrayTranslatorName; + this.unicodeArrayName = unicodeArrayName; + this.unicodeArray = unicodeArray; + this.node = this.getNodeStructure(); + } + appendNode(blockScopeNode) { + NodeUtils_1.NodeUtils.insertNodeAtIndex(blockScopeNode.body, this.getNode(), 1); + } + getNodeIdentifier() { + return this.unicodeArrayTranslatorName; + } + ; + getNode() { + if (!this.unicodeArray.length) { + return; + } + return super.getNode(); + } + getNodeStructure() { + let keyName = Utils_1.Utils.getRandomVariableName(), node = esprima.parse(` + var ${this.unicodeArrayTranslatorName} = function (${keyName}) { + return ${this.unicodeArrayName}[[][${Utils_1.Utils.stringToUnicode('filter')}][${Utils_1.Utils.stringToUnicode('constructor')}](${Utils_1.Utils.stringToUnicode('return this')})()[${Utils_1.Utils.stringToUnicode('parseInt')}](${keyName})] + }; + `); + NodeUtils_1.NodeUtils.addXVerbatimPropertyToLiterals(node); + return NodeUtils_1.NodeUtils.getBlockScopeNodeByIndex(node); + } +} +exports.UnicodeArrayTranslator = UnicodeArrayTranslator; diff --git a/src/enums/AppendState.js b/dist/src/enums/AppendState.js similarity index 100% rename from src/enums/AppendState.js rename to dist/src/enums/AppendState.js diff --git a/src/enums/JSFuck.js b/dist/src/enums/JSFuck.js similarity index 100% rename from src/enums/JSFuck.js rename to dist/src/enums/JSFuck.js diff --git a/src/enums/NodeType.js b/dist/src/enums/NodeType.js similarity index 100% rename from src/enums/NodeType.js rename to dist/src/enums/NodeType.js diff --git a/src/node-groups/DebugProtectionNodesGroup.js b/dist/src/node-groups/DebugProtectionNodesGroup.js similarity index 100% rename from src/node-groups/DebugProtectionNodesGroup.js rename to dist/src/node-groups/DebugProtectionNodesGroup.js diff --git a/src/node-groups/NodesGroup.js b/dist/src/node-groups/NodesGroup.js similarity index 100% rename from src/node-groups/NodesGroup.js rename to dist/src/node-groups/NodesGroup.js diff --git a/src/node-groups/UnicodeArrayNodesGroup.js b/dist/src/node-groups/UnicodeArrayNodesGroup.js similarity index 100% rename from src/node-groups/UnicodeArrayNodesGroup.js rename to dist/src/node-groups/UnicodeArrayNodesGroup.js diff --git a/src/node-obfuscators/CatchClauseObfuscator.js b/dist/src/node-obfuscators/CatchClauseObfuscator.js similarity index 100% rename from src/node-obfuscators/CatchClauseObfuscator.js rename to dist/src/node-obfuscators/CatchClauseObfuscator.js diff --git a/src/node-obfuscators/FunctionDeclarationObfuscator.js b/dist/src/node-obfuscators/FunctionDeclarationObfuscator.js similarity index 100% rename from src/node-obfuscators/FunctionDeclarationObfuscator.js rename to dist/src/node-obfuscators/FunctionDeclarationObfuscator.js diff --git a/src/node-obfuscators/FunctionObfuscator.js b/dist/src/node-obfuscators/FunctionObfuscator.js similarity index 100% rename from src/node-obfuscators/FunctionObfuscator.js rename to dist/src/node-obfuscators/FunctionObfuscator.js diff --git a/src/node-obfuscators/LiteralObfuscator.js b/dist/src/node-obfuscators/LiteralObfuscator.js similarity index 100% rename from src/node-obfuscators/LiteralObfuscator.js rename to dist/src/node-obfuscators/LiteralObfuscator.js diff --git a/src/node-obfuscators/MemberExpressionObfuscator.js b/dist/src/node-obfuscators/MemberExpressionObfuscator.js similarity index 100% rename from src/node-obfuscators/MemberExpressionObfuscator.js rename to dist/src/node-obfuscators/MemberExpressionObfuscator.js diff --git a/src/node-obfuscators/MethodDefinitionObfuscator.js b/dist/src/node-obfuscators/MethodDefinitionObfuscator.js similarity index 100% rename from src/node-obfuscators/MethodDefinitionObfuscator.js rename to dist/src/node-obfuscators/MethodDefinitionObfuscator.js diff --git a/src/node-obfuscators/NodeObfuscator.js b/dist/src/node-obfuscators/NodeObfuscator.js similarity index 100% rename from src/node-obfuscators/NodeObfuscator.js rename to dist/src/node-obfuscators/NodeObfuscator.js diff --git a/src/node-obfuscators/ObjectExpressionObfuscator.js b/dist/src/node-obfuscators/ObjectExpressionObfuscator.js similarity index 100% rename from src/node-obfuscators/ObjectExpressionObfuscator.js rename to dist/src/node-obfuscators/ObjectExpressionObfuscator.js diff --git a/src/node-obfuscators/VariableDeclarationObfuscator.js b/dist/src/node-obfuscators/VariableDeclarationObfuscator.js similarity index 100% rename from src/node-obfuscators/VariableDeclarationObfuscator.js rename to dist/src/node-obfuscators/VariableDeclarationObfuscator.js diff --git a/tests/dev-test.js b/dist/tests/dev-test.js similarity index 100% rename from tests/dev-test.js rename to dist/tests/dev-test.js diff --git a/package.json b/package.json index 24050201..e6d6bd91 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "javascript obfuscator", "js obfuscator" ], - "main": "index.js", + "main": "dist/index.js", "dependencies": { "esprima": "^2.7.2", "escodegen": "^1.8.0", @@ -31,7 +31,7 @@ "tsc:w": "tsc -w", "lite": "lite-server", "start": "concurrent \"npm run tsc:w\" \"npm run lite\" ", - "tests": "node tests/dev-test.js" + "tests": "node dist/tests/dev-test.js" }, "author": { "name": "sanex3339" diff --git a/tsconfig.json b/tsconfig.json index e0b2e80b..e4f57a34 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,6 +2,7 @@ "compilerOptions": { "target": "ES6", "module": "commonjs", + "outDir": "dist/", "sourceMap": false, "emitDecoratorMetadata": true, "experimentalDecorators": true,