diff --git a/dist/index.js b/dist/index.js index 51ea0cc2..4a0b9f9f 100644 --- a/dist/index.js +++ b/dist/index.js @@ -79,7 +79,7 @@ module.exports = /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 62); +/******/ return __webpack_require__(__webpack_require__.s = 66); /******/ }) /************************************************************************/ /******/ ([ @@ -93,7 +93,7 @@ var _createClass = function () { function defineProperties(target, props) { for function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -var chance_1 = __webpack_require__(57); +var chance_1 = __webpack_require__(60); var JSFuck_1 = __webpack_require__(9); var Utils = function () { @@ -1128,8 +1128,8 @@ var _createClass = function () { function defineProperties(target, props) { for function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -var fs = __webpack_require__(60); -var mkdirp = __webpack_require__(61); +var fs = __webpack_require__(64); +var mkdirp = __webpack_require__(65); var path = __webpack_require__(18); var Utils_1 = __webpack_require__(0); @@ -1215,7 +1215,7 @@ var _createClass = function () { function defineProperties(target, props) { for function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -var commander = __webpack_require__(59); +var commander = __webpack_require__(62); var path = __webpack_require__(18); var SourceMapMode_1 = __webpack_require__(11); var DefaultPreset_1 = __webpack_require__(16); @@ -1410,8 +1410,9 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +__webpack_require__(63); var AppendState_1 = __webpack_require__(2); -var DebufProtectionFunctionCallTemplate_1 = __webpack_require__(63); +var DebufProtectionFunctionCallTemplate_1 = __webpack_require__(50); var Node_1 = __webpack_require__(3); var NodeUtils_1 = __webpack_require__(1); @@ -1436,7 +1437,9 @@ var DebugProtectionFunctionCallNode = function (_Node_1$Node) { }, { key: "getNodeStructure", value: function getNodeStructure() { - return NodeUtils_1.NodeUtils.convertCodeToStructure(DebufProtectionFunctionCallTemplate_1.DebugProtectionFunctionCallTemplate(this.debugProtectionFunctionName)); + return NodeUtils_1.NodeUtils.convertCodeToStructure(DebufProtectionFunctionCallTemplate_1.DebugProtectionFunctionCallTemplate().formatUnicorn({ + debugProtectionFunctionName: this.debugProtectionFunctionName + })); } }]); @@ -1460,8 +1463,9 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +__webpack_require__(63); var AppendState_1 = __webpack_require__(2); -var DebugProtectionFunctionIntervalTemplate_1 = __webpack_require__(64); +var DebugProtectionFunctionIntervalTemplate_1 = __webpack_require__(51); var Node_1 = __webpack_require__(3); var NodeUtils_1 = __webpack_require__(1); @@ -1486,7 +1490,9 @@ var DebugProtectionFunctionIntervalNode = function (_Node_1$Node) { }, { key: "getNodeStructure", value: function getNodeStructure() { - return NodeUtils_1.NodeUtils.convertCodeToStructure(DebugProtectionFunctionIntervalTemplate_1.DebugProtectionFunctionIntervalTemplate(this.debugProtectionFunctionName)); + return NodeUtils_1.NodeUtils.convertCodeToStructure(DebugProtectionFunctionIntervalTemplate_1.DebugProtectionFunctionIntervalTemplate().formatUnicorn({ + debugProtectionFunctionName: this.debugProtectionFunctionName + })); } }]); @@ -1510,8 +1516,9 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +__webpack_require__(63); var AppendState_1 = __webpack_require__(2); -var DebugProtectionFunctionTemplate_1 = __webpack_require__(50); +var DebugProtectionFunctionTemplate_1 = __webpack_require__(52); var Node_1 = __webpack_require__(3); var NodeUtils_1 = __webpack_require__(1); var Utils_1 = __webpack_require__(0); @@ -1547,7 +1554,9 @@ var DebugProtectionFunctionNode = function (_Node_1$Node) { }, { key: "getNodeStructure", value: function getNodeStructure() { - return NodeUtils_1.NodeUtils.convertCodeToStructure(DebugProtectionFunctionTemplate_1.DebugProtectionFunctionTemplate(this.debugProtectionFunctionName)); + return NodeUtils_1.NodeUtils.convertCodeToStructure(DebugProtectionFunctionTemplate_1.DebugProtectionFunctionTemplate().formatUnicorn({ + debugProtectionFunctionName: this.debugProtectionFunctionName + })); } }]); @@ -1573,7 +1582,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" var AppendState_1 = __webpack_require__(2); var NoCustomNodesPreset_1 = __webpack_require__(13); -var SelfDefendingTemplate_1 = __webpack_require__(51); +var SelfDefendingTemplate_1 = __webpack_require__(53); var JavaScriptObfuscator_1 = __webpack_require__(8); var Node_1 = __webpack_require__(3); var NodeUtils_1 = __webpack_require__(1); @@ -1639,10 +1648,12 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +__webpack_require__(63); var AppendState_1 = __webpack_require__(2); -var UnicodeArrayCallsWrapperTemplate_1 = __webpack_require__(52); +var UnicodeArrayCallsWrapperTemplate_1 = __webpack_require__(54); var Node_1 = __webpack_require__(3); var NodeUtils_1 = __webpack_require__(1); +var Utils_1 = __webpack_require__(0); var UnicodeArrayCallsWrapper = function (_Node_1$Node) { _inherits(UnicodeArrayCallsWrapper, _Node_1$Node); @@ -1680,7 +1691,12 @@ var UnicodeArrayCallsWrapper = function (_Node_1$Node) { }, { key: "getNodeStructure", value: function getNodeStructure() { - return NodeUtils_1.NodeUtils.convertCodeToStructure(UnicodeArrayCallsWrapperTemplate_1.UnicodeArrayCallsWrapperTemplate(this.unicodeArrayCallsWrapperName, this.unicodeArrayName)); + var keyName = Utils_1.Utils.getRandomVariableName(); + return NodeUtils_1.NodeUtils.convertCodeToStructure(UnicodeArrayCallsWrapperTemplate_1.UnicodeArrayCallsWrapperTemplate().formatUnicorn({ + keyName: keyName, + unicodeArrayCallsWrapperName: this.unicodeArrayCallsWrapperName, + unicodeArrayName: this.unicodeArrayName + })); } }]); @@ -1706,12 +1722,15 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +__webpack_require__(63); var AppendState_1 = __webpack_require__(2); -var SelfDefendingTemplate_1 = __webpack_require__(53); -var UnicodeArrayDecodeTemplate_1 = __webpack_require__(54); +var NoCustomNodesPreset_1 = __webpack_require__(13); +var AtobTemplate_1 = __webpack_require__(48); +var SelfDefendingTemplate_1 = __webpack_require__(55); +var UnicodeArrayDecodeTemplate_1 = __webpack_require__(56); +var JavaScriptObfuscator_1 = __webpack_require__(8); var Node_1 = __webpack_require__(3); var NodeUtils_1 = __webpack_require__(1); -var Utils_1 = __webpack_require__(0); var UnicodeArrayDecodeNode = function (_Node_1$Node) { _inherits(UnicodeArrayDecodeNode, _Node_1$Node); @@ -1743,14 +1762,22 @@ var UnicodeArrayDecodeNode = function (_Node_1$Node) { }, { key: "getNodeStructure", value: function getNodeStructure() { - var forLoopFunctionName = Utils_1.Utils.getRandomVariableName(); - var code = ''; + var forLoopFunctionName = 'forLoopFunc'; + var code = void 0; if (this.options.selfDefending) { - code = SelfDefendingTemplate_1.SelfDefendingTemplate(this.unicodeArrayName, forLoopFunctionName); + code = SelfDefendingTemplate_1.SelfDefendingTemplate().formatUnicorn({ + forLoopFunctionName: forLoopFunctionName, + unicodeArrayName: this.unicodeArrayName + }); } else { code = forLoopFunctionName + "();"; } - return NodeUtils_1.NodeUtils.convertCodeToStructure(UnicodeArrayDecodeTemplate_1.UnicodeArrayDecodeTemplate(code, this.unicodeArrayName, forLoopFunctionName)); + return NodeUtils_1.NodeUtils.convertCodeToStructure(JavaScriptObfuscator_1.JavaScriptObfuscator.obfuscate(UnicodeArrayDecodeTemplate_1.UnicodeArrayDecodeTemplate().formatUnicorn({ + atobPolyfill: AtobTemplate_1.AtobTemplate(), + code: code, + forLoopFunctionName: forLoopFunctionName, + unicodeArrayName: this.unicodeArrayName + }), NoCustomNodesPreset_1.NO_CUSTOM_NODES_PRESET).getObfuscatedCode()); } }]); @@ -1776,11 +1803,12 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +__webpack_require__(63); var AppendState_1 = __webpack_require__(2); +var UnicodeArrayTemplate_1 = __webpack_require__(57); var Node_1 = __webpack_require__(3); var NodeUtils_1 = __webpack_require__(1); var Utils_1 = __webpack_require__(0); -var UnicodeArrayTemplate_1 = __webpack_require__(65); var UnicodeArrayNode = function (_Node_1$Node) { _inherits(UnicodeArrayNode, _Node_1$Node); @@ -1832,7 +1860,10 @@ var UnicodeArrayNode = function (_Node_1$Node) { }, { key: 'getNodeStructure', value: function getNodeStructure() { - return NodeUtils_1.NodeUtils.convertCodeToStructure(UnicodeArrayTemplate_1.UnicodeArrayTemplate(this.unicodeArrayName, this.unicodeArray.join(','))); + return NodeUtils_1.NodeUtils.convertCodeToStructure(UnicodeArrayTemplate_1.UnicodeArrayTemplate().formatUnicorn({ + unicodeArrayName: this.unicodeArrayName, + unicodeArray: this.unicodeArray.join(',') + })); } }]); @@ -1859,10 +1890,11 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +__webpack_require__(63); var AppendState_1 = __webpack_require__(2); var NoCustomNodesPreset_1 = __webpack_require__(13); -var SelfDefendingTemplate_1 = __webpack_require__(55); -var UnicodeArrayRotateFunctionTemplate_1 = __webpack_require__(56); +var SelfDefendingTemplate_1 = __webpack_require__(58); +var UnicodeArrayRotateFunctionTemplate_1 = __webpack_require__(59); var JavaScriptObfuscator_1 = __webpack_require__(8); var Node_1 = __webpack_require__(3); var NodeUtils_1 = __webpack_require__(1); @@ -1903,11 +1935,20 @@ var UnicodeArrayRotateFunctionNode = function (_Node_1$Node) { timesName = Utils_1.Utils.getRandomVariableName(), whileFunctionName = Utils_1.Utils.getRandomVariableName(); if (this.options.selfDefending) { - code = JavaScriptObfuscator_1.JavaScriptObfuscator.obfuscate(SelfDefendingTemplate_1.SelfDefendingTemplate(whileFunctionName, timesName), NoCustomNodesPreset_1.NO_CUSTOM_NODES_PRESET).getObfuscatedCode(); + code = SelfDefendingTemplate_1.SelfDefendingTemplate().formatUnicorn({ + timesName: timesName, + whileFunctionName: whileFunctionName + }); } else { code = whileFunctionName + "(++" + timesName + ")"; } - return NodeUtils_1.NodeUtils.convertCodeToStructure(UnicodeArrayRotateFunctionTemplate_1.UnicodeArrayRotateFunctionTemplate(code, this.unicodeArrayName, this.unicodeArrayRotateValue, whileFunctionName, timesName)); + return NodeUtils_1.NodeUtils.convertCodeToStructure(JavaScriptObfuscator_1.JavaScriptObfuscator.obfuscate(UnicodeArrayRotateFunctionTemplate_1.UnicodeArrayRotateFunctionTemplate().formatUnicorn({ + code: code, + timesName: timesName, + unicodeArrayName: this.unicodeArrayName, + unicodeArrayRotateValue: Utils_1.Utils.decToHex(this.unicodeArrayRotateValue), + whileFunctionName: whileFunctionName + }), NoCustomNodesPreset_1.NO_CUSTOM_NODES_PRESET).getObfuscatedCode()); } }]); @@ -2732,7 +2773,7 @@ var __decorate = undefined && undefined.__decorate || function (decorators, targ var __metadata = undefined && undefined.__metadata || function (k, v) { if ((typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; -var class_validator_1 = __webpack_require__(58); +var class_validator_1 = __webpack_require__(61); var DefaultPreset_1 = __webpack_require__(16); var OptionsNormalizer_1 = __webpack_require__(46); var ValidationErrorsFormatter_1 = __webpack_require__(47); @@ -2953,30 +2994,27 @@ exports.ConsoleOutputDisableExpressionTemplate = ConsoleOutputDisableExpressionT /***/ }, /* 50 */ -/***/ function(module, exports, __webpack_require__) { +/***/ function(module, exports) { "use strict"; "use strict"; -var Utils_1 = __webpack_require__(0); -function DebugProtectionFunctionTemplate(debugProtectionFunctionName) { - return "\n var " + debugProtectionFunctionName + " = function () {\n function debuggerProtection (counter) {\n if (('' + counter / counter)['length'] !== 1 || counter % 20 === 0) {\n (function () {}.constructor('debugger')());\n } else {\n [].filter.constructor(" + Utils_1.Utils.stringToJSFuck('debugger') + ")();\n }\n \n debuggerProtection(++counter);\n }\n \n try {\n debuggerProtection(0);\n } catch (y) {}\n };\n "; +function DebugProtectionFunctionCallTemplate() { + return "{debugProtectionFunctionName}();"; } -exports.DebugProtectionFunctionTemplate = DebugProtectionFunctionTemplate; +exports.DebugProtectionFunctionCallTemplate = DebugProtectionFunctionCallTemplate; /***/ }, /* 51 */ -/***/ function(module, exports, __webpack_require__) { +/***/ function(module, exports) { "use strict"; "use strict"; -var JSFuck_1 = __webpack_require__(9); -var Utils_1 = __webpack_require__(0); -function SelfDefendingTemplate() { - return "\n (function () { \n var func = function(){return " + Utils_1.Utils.stringToUnicode('dev') + ";},\n func2 = function () {\n return 'window';\n };\n \n !Function(" + Utils_1.Utils.stringToUnicode("return/\\w+ *\\(\\) *{\\w+ *['|\"].+['|\"];? *}/") + ")().test(func.toString()) ? Function(" + Utils_1.Utils.stringToUnicode("return/(\\\\[x|u](\\w){2,4})+/") + ")().test(func2.toString()) ? []['filter']['constructor'](" + Utils_1.Utils.stringToJSFuck('while') + " + '(" + JSFuck_1.JSFuck.False + "){}')() : []['filter']['constructor'](" + Utils_1.Utils.stringToJSFuck('while') + " + '(" + JSFuck_1.JSFuck.True + "){}')() : []['filter']['constructor'](" + Utils_1.Utils.stringToJSFuck('while') + " + '(" + JSFuck_1.JSFuck.False + "){}')();\n })();\n "; +function DebugProtectionFunctionIntervalTemplate() { + return "\n setInterval(function () {\n {debugProtectionFunctionName}();\n }, 4000);\n "; } -exports.SelfDefendingTemplate = SelfDefendingTemplate; +exports.DebugProtectionFunctionIntervalTemplate = DebugProtectionFunctionIntervalTemplate; /***/ }, /* 52 */ @@ -2986,11 +3024,10 @@ exports.SelfDefendingTemplate = SelfDefendingTemplate; "use strict"; var Utils_1 = __webpack_require__(0); -function UnicodeArrayCallsWrapperTemplate(unicodeArrayCallsWrapperName, unicodeArrayName) { - var keyName = Utils_1.Utils.getRandomVariableName(); - return "\n var " + unicodeArrayCallsWrapperName + " = function (" + keyName + ") {\n return " + unicodeArrayName + "[parseInt(" + keyName + ", 0x010)];\n };\n "; +function DebugProtectionFunctionTemplate() { + return "\n var {debugProtectionFunctionName} = function () {\n function debuggerProtection (counter) {\n if (('' + counter / counter)['length'] !== 1 || counter % 20 === 0) {\n (function () {}.constructor('debugger')());\n } else {\n [].filter.constructor(" + Utils_1.Utils.stringToJSFuck('debugger') + ")();\n }\n \n debuggerProtection(++counter);\n }\n \n try {\n debuggerProtection(0);\n } catch (y) {}\n };\n "; } -exports.UnicodeArrayCallsWrapperTemplate = UnicodeArrayCallsWrapperTemplate; +exports.DebugProtectionFunctionTemplate = DebugProtectionFunctionTemplate; /***/ }, /* 53 */ @@ -2999,31 +3036,23 @@ exports.UnicodeArrayCallsWrapperTemplate = UnicodeArrayCallsWrapperTemplate; "use strict"; "use strict"; -var JSFuck_1 = __webpack_require__(9); var Utils_1 = __webpack_require__(0); -function SelfDefendingTemplate(unicodeArrayName, forLoopFunctionName) { - var environmentName = Utils_1.Utils.getRandomVariableName(); - return "\n var " + environmentName + " = function(){return " + Utils_1.Utils.stringToUnicode('dev') + ";};\n \n Function(" + Utils_1.Utils.stringToUnicode("return/\\w+ *\\(\\) *{\\w+ *['|\"].+['|\"];? *}/") + ")()[" + Utils_1.Utils.stringToUnicode('test') + "](" + environmentName + "[" + Utils_1.Utils.stringToUnicode('toString') + "]()) !== " + JSFuck_1.JSFuck.True + " && !" + 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 + "){}')();\n "; +function SelfDefendingTemplate() { + return "\n (function () { \n var func = function(){return 'dev';},\n func2 = function () {\n return 'window';\n };\n \n !Function(" + Utils_1.Utils.stringToUnicode("return/\\w+ *\\(\\) *{\\w+ *['|\"].+['|\"];? *}/") + ")().test(func.toString()) ? Function(" + Utils_1.Utils.stringToUnicode("return/(\\\\[x|u](\\w){2,4})+/") + ")().test(func2.toString()) ? []['filter']['constructor'](" + Utils_1.Utils.stringToJSFuck('while') + " + '(false){}')() : []['filter']['constructor'](" + Utils_1.Utils.stringToJSFuck('while') + " + '(true){}')() : []['filter']['constructor'](" + Utils_1.Utils.stringToJSFuck('while') + " + '(false){}')();\n })();\n "; } exports.SelfDefendingTemplate = SelfDefendingTemplate; /***/ }, /* 54 */ -/***/ function(module, exports, __webpack_require__) { +/***/ function(module, exports) { "use strict"; "use strict"; -var NoCustomNodesPreset_1 = __webpack_require__(13); -var AtobTemplate_1 = __webpack_require__(48); -var JavaScriptObfuscator_1 = __webpack_require__(8); -var Utils_1 = __webpack_require__(0); -function UnicodeArrayDecodeTemplate(code, unicodeArrayName, forLoopFunctionName) { - var indexVariableName = Utils_1.Utils.getRandomVariableName(), - tempArrayName = Utils_1.Utils.getRandomVariableName(); - return "\n (function () {\n " + JavaScriptObfuscator_1.JavaScriptObfuscator.obfuscate(AtobTemplate_1.AtobTemplate(), NoCustomNodesPreset_1.NO_CUSTOM_NODES_PRESET).getObfuscatedCode() + "\n \n var " + forLoopFunctionName + " = function () {\n var " + tempArrayName + " = [];\n \n for (var " + indexVariableName + " in " + unicodeArrayName + ") {\n " + tempArrayName + "[" + Utils_1.Utils.stringToUnicode('push') + "](decodeURI(atob(" + unicodeArrayName + "[" + indexVariableName + "])));\n }\n \n " + unicodeArrayName + " = " + tempArrayName + ";\n };\n \n " + code + "\n })();\n "; +function UnicodeArrayCallsWrapperTemplate() { + return "\n var {unicodeArrayCallsWrapperName} = function ({keyName}) {\n return {unicodeArrayName}[parseInt({keyName}, 0x010)];\n };\n "; } -exports.UnicodeArrayDecodeTemplate = UnicodeArrayDecodeTemplate; +exports.UnicodeArrayCallsWrapperTemplate = UnicodeArrayCallsWrapperTemplate; /***/ }, /* 55 */ @@ -3032,60 +3061,99 @@ exports.UnicodeArrayDecodeTemplate = UnicodeArrayDecodeTemplate; "use strict"; "use strict"; -var JSFuck_1 = __webpack_require__(9); var Utils_1 = __webpack_require__(0); -function SelfDefendingTemplate(whileFunctionName, timesName) { - return "(function () {\n var func = function(){return " + Utils_1.Utils.stringToUnicode('dev') + ";};\n \n !Function(" + Utils_1.Utils.stringToUnicode("return/\\w+ *\\(\\) *{\\w+ *['|\"].+['|\"];? *}/") + ")().test(func.toString()) ? []['filter']['constructor'](" + Utils_1.Utils.stringToJSFuck('while') + " + '(" + JSFuck_1.JSFuck.True + "){}')() : Function(" + Utils_1.Utils.stringToUnicode('a') + ", " + Utils_1.Utils.stringToUnicode('b') + ", " + Utils_1.Utils.stringToUnicode('a(++b)') + ")(" + whileFunctionName + ", " + timesName + ") ? []['filter']['constructor'](" + Utils_1.Utils.stringToJSFuck('while') + " + '(" + JSFuck_1.JSFuck.False + "){}')() : []['filter']['constructor'](" + Utils_1.Utils.stringToJSFuck('while') + " + '(" + JSFuck_1.JSFuck.False + "){}')();\n })();"; +function SelfDefendingTemplate() { + return "\n var func = function(){return 'dev';};\n \n Function(" + Utils_1.Utils.stringToUnicode("return/\\w+ *\\(\\) *{\\w+ *['|\"].+['|\"];? *}/") + ")()['test'](func['toString']()) !== true && !{unicodeArrayName}++ ? []['filter']['constructor'](" + Utils_1.Utils.stringToJSFuck('while') + " + '(true){}')() : Function('a', atob(" + Utils_1.Utils.stringToUnicode(Utils_1.Utils.btoa('a.call()')) + "))({forLoopFunctionName}) ? []['filter']['constructor'](" + Utils_1.Utils.stringToJSFuck('while') + " + '(false){}')() : []['filter']['constructor'](" + Utils_1.Utils.stringToJSFuck('while') + " + '(false){}')();\n "; } exports.SelfDefendingTemplate = SelfDefendingTemplate; /***/ }, /* 56 */ +/***/ function(module, exports) { + +"use strict"; +"use strict"; + +function UnicodeArrayDecodeTemplate() { + return "\n (function () {\n {atobPolyfill}\n \n var {forLoopFunctionName} = function () {\n var array = [];\n \n for (var i in {unicodeArrayName}) {\n array['push'](decodeURI(atob({unicodeArrayName}[i])));\n }\n \n {unicodeArrayName} = array;\n };\n \n {code}\n })();\n "; +} +exports.UnicodeArrayDecodeTemplate = UnicodeArrayDecodeTemplate; + +/***/ }, +/* 57 */ +/***/ function(module, exports) { + +"use strict"; +"use strict"; + +function UnicodeArrayTemplate() { + return "\n var {unicodeArrayName} = [{unicodeArray}];\n "; +} +exports.UnicodeArrayTemplate = UnicodeArrayTemplate; + +/***/ }, +/* 58 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var Utils_1 = __webpack_require__(0); -function UnicodeArrayRotateFunctionTemplate(code, unicodeArrayName, unicodeArrayRotateValue, whileFunctionName, timesName) { - var arrayName = Utils_1.Utils.getRandomVariableName(), - timesArgumentName = Utils_1.Utils.getRandomVariableName(); - return "\n (function (" + arrayName + ", " + timesName + ") {\n var " + whileFunctionName + " = function (" + timesArgumentName + ") {\n while (--" + timesArgumentName + ") {\n " + arrayName + "[" + Utils_1.Utils.stringToUnicode('push') + "](" + arrayName + "[" + Utils_1.Utils.stringToUnicode('shift') + "]());\n }\n };\n \n " + code + "\n })(" + unicodeArrayName + ", 0x" + Utils_1.Utils.decToHex(unicodeArrayRotateValue) + ");\n "; +function SelfDefendingTemplate() { + return "(function () {\n var func = function(){return 'dev';};\n \n !Function(" + Utils_1.Utils.stringToUnicode("return/\\w+ *\\(\\) *{\\w+ *['|\"].+['|\"];? *}/") + ")().test(func.toString()) ? []['filter']['constructor'](" + Utils_1.Utils.stringToJSFuck('while') + " + '(true){}')() : Function('a', 'b', 'a(++b)')({whileFunctionName}, {timesName}) ? []['filter']['constructor'](" + Utils_1.Utils.stringToJSFuck('while') + " + '(false){}')() : []['filter']['constructor'](" + Utils_1.Utils.stringToJSFuck('while') + " + '(false){}')();\n })();"; } -exports.UnicodeArrayRotateFunctionTemplate = UnicodeArrayRotateFunctionTemplate; - -/***/ }, -/* 57 */ -/***/ function(module, exports) { - -module.exports = require("chance"); - -/***/ }, -/* 58 */ -/***/ function(module, exports) { - -module.exports = require("class-validator"); +exports.SelfDefendingTemplate = SelfDefendingTemplate; /***/ }, /* 59 */ /***/ function(module, exports) { -module.exports = require("commander"); +"use strict"; +"use strict"; + +function UnicodeArrayRotateFunctionTemplate() { + return "\n (function (array, {timesName}) {\n var {whileFunctionName} = function (times) {\n while (--times) {\n array['push'](array['shift']());\n }\n };\n \n {code}\n })({unicodeArrayName}, 0x{unicodeArrayRotateValue});\n "; +} +exports.UnicodeArrayRotateFunctionTemplate = UnicodeArrayRotateFunctionTemplate; /***/ }, /* 60 */ /***/ function(module, exports) { -module.exports = require("fs"); +module.exports = require("chance"); /***/ }, /* 61 */ /***/ function(module, exports) { -module.exports = require("mkdirp"); +module.exports = require("class-validator"); /***/ }, /* 62 */ +/***/ function(module, exports) { + +module.exports = require("commander"); + +/***/ }, +/* 63 */ +/***/ function(module, exports) { + +module.exports = require("format-unicorn"); + +/***/ }, +/* 64 */ +/***/ function(module, exports) { + +module.exports = require("fs"); + +/***/ }, +/* 65 */ +/***/ function(module, exports) { + +module.exports = require("mkdirp"); + +/***/ }, +/* 66 */ /***/ function(module, exports, __webpack_require__) { "use strict"; @@ -3097,42 +3165,6 @@ if (!global._babelPolyfill) { } module.exports = JavaScriptObfuscator_1.JavaScriptObfuscator; -/***/ }, -/* 63 */ -/***/ function(module, exports) { - -"use strict"; -"use strict"; - -function DebugProtectionFunctionCallTemplate(debugProtectionFunctionName) { - return "\n " + debugProtectionFunctionName + "();\n "; -} -exports.DebugProtectionFunctionCallTemplate = DebugProtectionFunctionCallTemplate; - -/***/ }, -/* 64 */ -/***/ function(module, exports) { - -"use strict"; -"use strict"; - -function DebugProtectionFunctionIntervalTemplate(debugProtectionFunctionName) { - return "\n setInterval(function () {\n " + debugProtectionFunctionName + "();\n }, 4000);\n "; -} -exports.DebugProtectionFunctionIntervalTemplate = DebugProtectionFunctionIntervalTemplate; - -/***/ }, -/* 65 */ -/***/ function(module, exports) { - -"use strict"; -"use strict"; - -function UnicodeArrayTemplate(unicodeArrayName, unicodeArray) { - return "\n var " + unicodeArrayName + " = [" + unicodeArray + "];\n "; -} -exports.UnicodeArrayTemplate = UnicodeArrayTemplate; - /***/ } /******/ ]); //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/package.json b/package.json index 6400c0f2..5a9bd890 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "escodegen": "^1.8.0", "esprima": "^2.7.2", "estraverse": "^4.2.0", + "format-unicorn": "^1.1.0", "mkdirp": "^0.5.1", "source-map-support": "^0.4.1" }, @@ -35,6 +36,7 @@ "@types/chance": "^0.7.27-alpha", "@types/commander": "^2.3.28", "@types/esprima": "^2.1.27-alpha", + "@types/format-unicorn": "0.0.28", "@types/joi": "^6.5.27-alpha", "@types/mkdirp": "^0.3.27-alpha", "@types/mocha": "^2.2.26-alpha", diff --git a/src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionCallNode.ts b/src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionCallNode.ts index 3e360efc..db237d7c 100644 --- a/src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionCallNode.ts +++ b/src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionCallNode.ts @@ -1,3 +1,5 @@ +import 'format-unicorn'; + import { INode } from "../../interfaces/nodes/INode"; import { IOptions } from "../../interfaces/IOptions"; @@ -43,7 +45,9 @@ export class DebugProtectionFunctionCallNode extends Node { */ protected getNodeStructure (): INode { return NodeUtils.convertCodeToStructure( - DebugProtectionFunctionCallTemplate(this.debugProtectionFunctionName) + DebugProtectionFunctionCallTemplate().formatUnicorn({ + debugProtectionFunctionName: this.debugProtectionFunctionName + }) ); } } diff --git a/src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionIntervalNode.ts b/src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionIntervalNode.ts index 4a773855..f6f958bf 100644 --- a/src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionIntervalNode.ts +++ b/src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionIntervalNode.ts @@ -1,3 +1,5 @@ +import 'format-unicorn'; + import { INode } from "../../interfaces/nodes/INode"; import { IOptions } from "../../interfaces/IOptions"; @@ -43,7 +45,9 @@ export class DebugProtectionFunctionIntervalNode extends Node { */ protected getNodeStructure (): INode { return NodeUtils.convertCodeToStructure( - DebugProtectionFunctionIntervalTemplate(this.debugProtectionFunctionName) + DebugProtectionFunctionIntervalTemplate().formatUnicorn({ + debugProtectionFunctionName: this.debugProtectionFunctionName + }) ); } } diff --git a/src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionNode.ts b/src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionNode.ts index 25e1fb45..0bff73ac 100644 --- a/src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionNode.ts +++ b/src/custom-nodes/debug-protection-nodes/DebugProtectionFunctionNode.ts @@ -1,3 +1,5 @@ +import 'format-unicorn'; + import { INode } from "../../interfaces/nodes/INode"; import { IOptions } from "../../interfaces/IOptions"; @@ -59,7 +61,9 @@ export class DebugProtectionFunctionNode extends Node { */ protected getNodeStructure (): INode { return NodeUtils.convertCodeToStructure( - DebugProtectionFunctionTemplate(this.debugProtectionFunctionName) + DebugProtectionFunctionTemplate().formatUnicorn({ + debugProtectionFunctionName: this.debugProtectionFunctionName + }) ); } } diff --git a/src/custom-nodes/self-defending-nodes/SelfDefendingUnicodeNode.ts b/src/custom-nodes/self-defending-nodes/SelfDefendingUnicodeNode.ts index a7d24d48..e10b5b8c 100644 --- a/src/custom-nodes/self-defending-nodes/SelfDefendingUnicodeNode.ts +++ b/src/custom-nodes/self-defending-nodes/SelfDefendingUnicodeNode.ts @@ -41,7 +41,10 @@ export class SelfDefendingUnicodeNode extends Node { */ protected getNodeStructure (): INode { return NodeUtils.convertCodeToStructure( - JavaScriptObfuscator.obfuscate(SelfDefendingTemplate(), NO_CUSTOM_NODES_PRESET).getObfuscatedCode() + JavaScriptObfuscator.obfuscate( + SelfDefendingTemplate(), + NO_CUSTOM_NODES_PRESET + ).getObfuscatedCode() ); } } diff --git a/src/custom-nodes/unicode-array-nodes/UnicodeArrayCallsWrapper.ts b/src/custom-nodes/unicode-array-nodes/UnicodeArrayCallsWrapper.ts index 6bcf4183..bc34df79 100644 --- a/src/custom-nodes/unicode-array-nodes/UnicodeArrayCallsWrapper.ts +++ b/src/custom-nodes/unicode-array-nodes/UnicodeArrayCallsWrapper.ts @@ -1,3 +1,5 @@ +import 'format-unicorn'; + import { INode } from "../../interfaces/nodes/INode"; import { IOptions } from "../../interfaces/IOptions"; @@ -9,6 +11,7 @@ import { UnicodeArrayCallsWrapperTemplate } from "../../templates/custom-nodes/u import { Node } from '../Node'; import { NodeUtils } from "../../NodeUtils"; +import { Utils } from "../../Utils"; export class UnicodeArrayCallsWrapper extends Node { /** @@ -79,8 +82,14 @@ export class UnicodeArrayCallsWrapper extends Node { * @returns {INode} */ protected getNodeStructure (): INode { + let keyName: string = Utils.getRandomVariableName(); + return NodeUtils.convertCodeToStructure( - UnicodeArrayCallsWrapperTemplate(this.unicodeArrayCallsWrapperName, this.unicodeArrayName) + UnicodeArrayCallsWrapperTemplate().formatUnicorn({ + keyName: keyName, + unicodeArrayCallsWrapperName: this.unicodeArrayCallsWrapperName, + unicodeArrayName: this.unicodeArrayName + }) ); } } diff --git a/src/custom-nodes/unicode-array-nodes/UnicodeArrayDecodeNode.ts b/src/custom-nodes/unicode-array-nodes/UnicodeArrayDecodeNode.ts index f44b4c05..32487eb0 100644 --- a/src/custom-nodes/unicode-array-nodes/UnicodeArrayDecodeNode.ts +++ b/src/custom-nodes/unicode-array-nodes/UnicodeArrayDecodeNode.ts @@ -1,3 +1,4 @@ +import 'format-unicorn'; import { INode } from "../../interfaces/nodes/INode"; import { IOptions } from "../../interfaces/IOptions"; @@ -6,12 +7,15 @@ import { TNodeWithBlockStatement } from "../../types/TNodeWithBlockStatement"; import { AppendState } from "../../enums/AppendState"; +import { NO_CUSTOM_NODES_PRESET } from "../../preset-options/NoCustomNodesPreset"; + +import { AtobTemplate } from "../../templates/custom-nodes/AtobTemplate"; import { SelfDefendingTemplate } from "../../templates/custom-nodes/unicode-array-nodes/unicode-array-decode-node/SelfDefendingTemplate"; import { UnicodeArrayDecodeTemplate } from "../../templates/custom-nodes/unicode-array-nodes/unicode-array-decode-node/UnicodeArrayDecodeTemplate"; +import { JavaScriptObfuscator } from '../../JavaScriptObfuscator'; import { Node } from '../Node'; import { NodeUtils } from "../../NodeUtils"; -import { Utils } from "../../Utils"; export class UnicodeArrayDecodeNode extends Node { /** @@ -67,18 +71,29 @@ export class UnicodeArrayDecodeNode extends Node { * @returns {INode} */ protected getNodeStructure (): INode { - const forLoopFunctionName: string = Utils.getRandomVariableName(); + const forLoopFunctionName: string = 'forLoopFunc'; - let code: string = ''; + let code: string; if (this.options.selfDefending) { - code = SelfDefendingTemplate(this.unicodeArrayName, forLoopFunctionName); + code = SelfDefendingTemplate().formatUnicorn({ + forLoopFunctionName, + unicodeArrayName: this.unicodeArrayName + }); } else { code = `${forLoopFunctionName}();`; } return NodeUtils.convertCodeToStructure( - UnicodeArrayDecodeTemplate(code, this.unicodeArrayName, forLoopFunctionName) + JavaScriptObfuscator.obfuscate( + UnicodeArrayDecodeTemplate().formatUnicorn({ + atobPolyfill: AtobTemplate(), + code, + forLoopFunctionName, + unicodeArrayName: this.unicodeArrayName + }), + NO_CUSTOM_NODES_PRESET + ).getObfuscatedCode() ); } } diff --git a/src/custom-nodes/unicode-array-nodes/UnicodeArrayNode.ts b/src/custom-nodes/unicode-array-nodes/UnicodeArrayNode.ts index 2174fac8..ce0ff9ef 100644 --- a/src/custom-nodes/unicode-array-nodes/UnicodeArrayNode.ts +++ b/src/custom-nodes/unicode-array-nodes/UnicodeArrayNode.ts @@ -1,3 +1,5 @@ +import 'format-unicorn'; + import { INode } from '../../interfaces/nodes/INode'; import { IOptions } from "../../interfaces/IOptions"; @@ -5,10 +7,11 @@ import { TNodeWithBlockStatement } from "../../types/TNodeWithBlockStatement"; import { AppendState } from '../../enums/AppendState'; +import { UnicodeArrayTemplate } from "../../templates/custom-nodes/unicode-array-nodes/unicode-array-node/UnicodeArrayTemplate"; + import { Node } from '../Node'; import { NodeUtils } from "../../NodeUtils"; import { Utils } from '../../Utils'; -import {UnicodeArrayTemplate} from "../../templates/custom-nodes/unicode-array-nodes/unicode-array-node/UnicodeArrayTemplate"; export class UnicodeArrayNode extends Node { /** @@ -98,7 +101,10 @@ export class UnicodeArrayNode extends Node { */ protected getNodeStructure (): INode { return NodeUtils.convertCodeToStructure( - UnicodeArrayTemplate(this.unicodeArrayName, this.unicodeArray.join(',')) + UnicodeArrayTemplate().formatUnicorn({ + unicodeArrayName: this.unicodeArrayName, + unicodeArray: this.unicodeArray.join(',') + }) ); } } diff --git a/src/custom-nodes/unicode-array-nodes/UnicodeArrayRotateFunctionNode.ts b/src/custom-nodes/unicode-array-nodes/UnicodeArrayRotateFunctionNode.ts index 303bbbe2..41809dab 100644 --- a/src/custom-nodes/unicode-array-nodes/UnicodeArrayRotateFunctionNode.ts +++ b/src/custom-nodes/unicode-array-nodes/UnicodeArrayRotateFunctionNode.ts @@ -1,3 +1,5 @@ +import 'format-unicorn'; + import { INode } from "../../interfaces/nodes/INode"; import { IOptions } from "../../interfaces/IOptions"; @@ -82,22 +84,25 @@ export class UnicodeArrayRotateFunctionNode extends Node { whileFunctionName: string = Utils.getRandomVariableName(); if (this.options.selfDefending) { - code = JavaScriptObfuscator.obfuscate( - SelfDefendingTemplate(whileFunctionName, timesName), - NO_CUSTOM_NODES_PRESET - ).getObfuscatedCode(); + code = SelfDefendingTemplate().formatUnicorn({ + timesName, + whileFunctionName + }); } else { code = `${whileFunctionName}(++${timesName})`; } return NodeUtils.convertCodeToStructure( - UnicodeArrayRotateFunctionTemplate( - code, - this.unicodeArrayName, - this.unicodeArrayRotateValue, - whileFunctionName, - timesName - ) + JavaScriptObfuscator.obfuscate( + UnicodeArrayRotateFunctionTemplate().formatUnicorn({ + code, + timesName, + unicodeArrayName: this.unicodeArrayName, + unicodeArrayRotateValue: Utils.decToHex(this.unicodeArrayRotateValue), + whileFunctionName + }), + NO_CUSTOM_NODES_PRESET + ).getObfuscatedCode() ); } } diff --git a/src/templates/custom-nodes/debug-protection-nodes/debug-protection-function-call-node/DebufProtectionFunctionCallTemplate.ts b/src/templates/custom-nodes/debug-protection-nodes/debug-protection-function-call-node/DebufProtectionFunctionCallTemplate.ts index abfc865a..880a995d 100644 --- a/src/templates/custom-nodes/debug-protection-nodes/debug-protection-function-call-node/DebufProtectionFunctionCallTemplate.ts +++ b/src/templates/custom-nodes/debug-protection-nodes/debug-protection-function-call-node/DebufProtectionFunctionCallTemplate.ts @@ -1,9 +1,6 @@ /** - * @param debugProtectionFunctionName * @returns {string} */ -export function DebugProtectionFunctionCallTemplate (debugProtectionFunctionName: string): string { - return ` - ${debugProtectionFunctionName}(); - `; +export function DebugProtectionFunctionCallTemplate (): string { + return `{debugProtectionFunctionName}();`; } diff --git a/src/templates/custom-nodes/debug-protection-nodes/debug-protection-function-interval-node/DebugProtectionFunctionIntervalTemplate.ts b/src/templates/custom-nodes/debug-protection-nodes/debug-protection-function-interval-node/DebugProtectionFunctionIntervalTemplate.ts index c3083691..d1bdb7d3 100644 --- a/src/templates/custom-nodes/debug-protection-nodes/debug-protection-function-interval-node/DebugProtectionFunctionIntervalTemplate.ts +++ b/src/templates/custom-nodes/debug-protection-nodes/debug-protection-function-interval-node/DebugProtectionFunctionIntervalTemplate.ts @@ -1,11 +1,10 @@ /** - * @param debugProtectionFunctionName * @returns {string} */ -export function DebugProtectionFunctionIntervalTemplate (debugProtectionFunctionName: string): string { +export function DebugProtectionFunctionIntervalTemplate (): string { return ` setInterval(function () { - ${debugProtectionFunctionName}(); + {debugProtectionFunctionName}(); }, 4000); `; } diff --git a/src/templates/custom-nodes/debug-protection-nodes/debug-protection-function-node/DebugProtectionFunctionTemplate.ts b/src/templates/custom-nodes/debug-protection-nodes/debug-protection-function-node/DebugProtectionFunctionTemplate.ts index 547549aa..8bf516f7 100644 --- a/src/templates/custom-nodes/debug-protection-nodes/debug-protection-function-node/DebugProtectionFunctionTemplate.ts +++ b/src/templates/custom-nodes/debug-protection-nodes/debug-protection-function-node/DebugProtectionFunctionTemplate.ts @@ -1,12 +1,11 @@ import { Utils } from "../../../../Utils"; /** - * @param debugProtectionFunctionName * @returns {string} */ -export function DebugProtectionFunctionTemplate (debugProtectionFunctionName: string): string { +export function DebugProtectionFunctionTemplate (): string { return ` - var ${debugProtectionFunctionName} = function () { + var {debugProtectionFunctionName} = function () { function debuggerProtection (counter) { if (('' + counter / counter)['length'] !== 1 || counter % 20 === 0) { (function () {}.constructor('debugger')()); diff --git a/src/templates/custom-nodes/self-defending-nodes/self-defending-unicode-node/SelfDefendingTemplate.ts b/src/templates/custom-nodes/self-defending-nodes/self-defending-unicode-node/SelfDefendingTemplate.ts index 87f8739e..540c301e 100644 --- a/src/templates/custom-nodes/self-defending-nodes/self-defending-unicode-node/SelfDefendingTemplate.ts +++ b/src/templates/custom-nodes/self-defending-nodes/self-defending-unicode-node/SelfDefendingTemplate.ts @@ -1,16 +1,14 @@ -import { JSFuck } from "../../../../enums/JSFuck"; - import { Utils } from "../../../../Utils"; export function SelfDefendingTemplate (): string { return ` (function () { - var func = function(){return ${Utils.stringToUnicode('dev')};}, + var func = function(){return 'dev';}, func2 = function () { return 'window'; }; - !Function(${Utils.stringToUnicode(`return/\\w+ *\\(\\) *{\\w+ *['|"].+['|"];? *}/`)})().test(func.toString()) ? Function(${Utils.stringToUnicode(`return/(\\\\[x|u](\\w){2,4})+/`)})().test(func2.toString()) ? []['filter']['constructor'](${Utils.stringToJSFuck('while')} + '(${JSFuck.False}){}')() : []['filter']['constructor'](${Utils.stringToJSFuck('while')} + '(${JSFuck.True}){}')() : []['filter']['constructor'](${Utils.stringToJSFuck('while')} + '(${JSFuck.False}){}')(); + !Function(${Utils.stringToUnicode(`return/\\w+ *\\(\\) *{\\w+ *['|"].+['|"];? *}/`)})().test(func.toString()) ? Function(${Utils.stringToUnicode(`return/(\\\\[x|u](\\w){2,4})+/`)})().test(func2.toString()) ? []['filter']['constructor'](${Utils.stringToJSFuck('while')} + '(false){}')() : []['filter']['constructor'](${Utils.stringToJSFuck('while')} + '(true){}')() : []['filter']['constructor'](${Utils.stringToJSFuck('while')} + '(false){}')(); })(); `; } diff --git a/src/templates/custom-nodes/unicode-array-nodes/unicode-array-calls-wrapper/UnicodeArrayCallsWrapperTemplate.ts b/src/templates/custom-nodes/unicode-array-nodes/unicode-array-calls-wrapper/UnicodeArrayCallsWrapperTemplate.ts index d7e1c44e..6fdb66fd 100644 --- a/src/templates/custom-nodes/unicode-array-nodes/unicode-array-calls-wrapper/UnicodeArrayCallsWrapperTemplate.ts +++ b/src/templates/custom-nodes/unicode-array-nodes/unicode-array-calls-wrapper/UnicodeArrayCallsWrapperTemplate.ts @@ -1,16 +1,10 @@ -import { Utils } from "../../../../Utils"; - /** - * @param unicodeArrayCallsWrapperName - * @param unicodeArrayName * @returns {string} */ -export function UnicodeArrayCallsWrapperTemplate (unicodeArrayCallsWrapperName: string, unicodeArrayName: string): string { - let keyName: string = Utils.getRandomVariableName(); - +export function UnicodeArrayCallsWrapperTemplate (): string { return ` - var ${unicodeArrayCallsWrapperName} = function (${keyName}) { - return ${unicodeArrayName}[parseInt(${keyName}, 0x010)]; + var {unicodeArrayCallsWrapperName} = function ({keyName}) { + return {unicodeArrayName}[parseInt({keyName}, 0x010)]; }; `; } diff --git a/src/templates/custom-nodes/unicode-array-nodes/unicode-array-decode-node/SelfDefendingTemplate.ts b/src/templates/custom-nodes/unicode-array-nodes/unicode-array-decode-node/SelfDefendingTemplate.ts index 73add545..059bbad9 100644 --- a/src/templates/custom-nodes/unicode-array-nodes/unicode-array-decode-node/SelfDefendingTemplate.ts +++ b/src/templates/custom-nodes/unicode-array-nodes/unicode-array-decode-node/SelfDefendingTemplate.ts @@ -1,18 +1,12 @@ -import { JSFuck } from "../../../../enums/JSFuck"; - import { Utils } from "../../../../Utils"; /** - * @param unicodeArrayName - * @param forLoopFunctionName * @returns {string} */ -export function SelfDefendingTemplate (unicodeArrayName: string, forLoopFunctionName: string): string { - let environmentName: string = Utils.getRandomVariableName(); - +export function SelfDefendingTemplate (): string { return ` - var ${environmentName} = function(){return ${Utils.stringToUnicode('dev')};}; + var func = function(){return 'dev';}; - Function(${Utils.stringToUnicode(`return/\\w+ *\\(\\) *{\\w+ *['|"].+['|"];? *}/`)})()[${Utils.stringToUnicode('test')}](${environmentName}[${Utils.stringToUnicode('toString')}]()) !== ${JSFuck.True} && !${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}){}')(); + Function(${Utils.stringToUnicode(`return/\\w+ *\\(\\) *{\\w+ *['|"].+['|"];? *}/`)})()['test'](func['toString']()) !== true && !{unicodeArrayName}++ ? []['filter']['constructor'](${Utils.stringToJSFuck('while')} + '(true){}')() : Function('a', atob(${Utils.stringToUnicode(Utils.btoa('a.call()'))}))({forLoopFunctionName}) ? []['filter']['constructor'](${Utils.stringToJSFuck('while')} + '(false){}')() : []['filter']['constructor'](${Utils.stringToJSFuck('while')} + '(false){}')(); `; } diff --git a/src/templates/custom-nodes/unicode-array-nodes/unicode-array-decode-node/UnicodeArrayDecodeTemplate.ts b/src/templates/custom-nodes/unicode-array-nodes/unicode-array-decode-node/UnicodeArrayDecodeTemplate.ts index 0dc9e7a3..7c1872a1 100644 --- a/src/templates/custom-nodes/unicode-array-nodes/unicode-array-decode-node/UnicodeArrayDecodeTemplate.ts +++ b/src/templates/custom-nodes/unicode-array-nodes/unicode-array-decode-node/UnicodeArrayDecodeTemplate.ts @@ -1,35 +1,22 @@ -import { NO_CUSTOM_NODES_PRESET } from "../../../../preset-options/NoCustomNodesPreset"; - -import { AtobTemplate } from "../../AtobTemplate"; - -import { JavaScriptObfuscator } from '../../../../JavaScriptObfuscator'; -import { Utils } from "../../../../Utils"; - /** - * @param code - * @param unicodeArrayName - * @param forLoopFunctionName * @returns {string} */ -export function UnicodeArrayDecodeTemplate (code: string, unicodeArrayName: string, forLoopFunctionName: string): string { - let indexVariableName: string = Utils.getRandomVariableName(), - tempArrayName: string = Utils.getRandomVariableName(); - +export function UnicodeArrayDecodeTemplate (): string { return ` (function () { - ${JavaScriptObfuscator.obfuscate(AtobTemplate(), NO_CUSTOM_NODES_PRESET).getObfuscatedCode()} + {atobPolyfill} - var ${forLoopFunctionName} = function () { - var ${tempArrayName} = []; + var {forLoopFunctionName} = function () { + var array = []; - for (var ${indexVariableName} in ${unicodeArrayName}) { - ${tempArrayName}[${Utils.stringToUnicode('push')}](decodeURI(atob(${unicodeArrayName}[${indexVariableName}]))); + for (var i in {unicodeArrayName}) { + array['push'](decodeURI(atob({unicodeArrayName}[i]))); } - ${unicodeArrayName} = ${tempArrayName}; + {unicodeArrayName} = array; }; - ${code} + {code} })(); `; } diff --git a/src/templates/custom-nodes/unicode-array-nodes/unicode-array-node/UnicodeArrayTemplate.ts b/src/templates/custom-nodes/unicode-array-nodes/unicode-array-node/UnicodeArrayTemplate.ts index 1173c366..e3c7c58c 100644 --- a/src/templates/custom-nodes/unicode-array-nodes/unicode-array-node/UnicodeArrayTemplate.ts +++ b/src/templates/custom-nodes/unicode-array-nodes/unicode-array-node/UnicodeArrayTemplate.ts @@ -1,10 +1,8 @@ /** - * @param unicodeArrayName - * @param unicodeArray * @returns {string} */ -export function UnicodeArrayTemplate (unicodeArrayName: string, unicodeArray: string): string { +export function UnicodeArrayTemplate (): string { return ` - var ${unicodeArrayName} = [${unicodeArray}]; + var {unicodeArrayName} = [{unicodeArray}]; `; } diff --git a/src/templates/custom-nodes/unicode-array-nodes/unicode-array-rotate-function-node/SelfDefendingTemplate.ts b/src/templates/custom-nodes/unicode-array-nodes/unicode-array-rotate-function-node/SelfDefendingTemplate.ts index 4a2be9c1..e12a9773 100644 --- a/src/templates/custom-nodes/unicode-array-nodes/unicode-array-rotate-function-node/SelfDefendingTemplate.ts +++ b/src/templates/custom-nodes/unicode-array-nodes/unicode-array-rotate-function-node/SelfDefendingTemplate.ts @@ -1,16 +1,12 @@ -import { JSFuck } from "../../../../enums/JSFuck"; - import { Utils } from "../../../../Utils"; /** - * @param whileFunctionName - * @param timesName * @returns {string} */ -export function SelfDefendingTemplate (whileFunctionName: string, timesName: string): string { +export function SelfDefendingTemplate (): string { return `(function () { - var func = function(){return ${Utils.stringToUnicode('dev')};}; + var func = function(){return 'dev';}; - !Function(${Utils.stringToUnicode(`return/\\w+ *\\(\\) *{\\w+ *['|"].+['|"];? *}/`)})().test(func.toString()) ? []['filter']['constructor'](${Utils.stringToJSFuck('while')} + '(${JSFuck.True}){}')() : Function(${Utils.stringToUnicode('a')}, ${Utils.stringToUnicode('b')}, ${Utils.stringToUnicode('a(++b)')})(${whileFunctionName}, ${timesName}) ? []['filter']['constructor'](${Utils.stringToJSFuck('while')} + '(${JSFuck.False}){}')() : []['filter']['constructor'](${Utils.stringToJSFuck('while')} + '(${JSFuck.False}){}')(); + !Function(${Utils.stringToUnicode(`return/\\w+ *\\(\\) *{\\w+ *['|"].+['|"];? *}/`)})().test(func.toString()) ? []['filter']['constructor'](${Utils.stringToJSFuck('while')} + '(true){}')() : Function('a', 'b', 'a(++b)')({whileFunctionName}, {timesName}) ? []['filter']['constructor'](${Utils.stringToJSFuck('while')} + '(false){}')() : []['filter']['constructor'](${Utils.stringToJSFuck('while')} + '(false){}')(); })();`; } diff --git a/src/templates/custom-nodes/unicode-array-nodes/unicode-array-rotate-function-node/UnicodeArrayRotateFunctionTemplate.ts b/src/templates/custom-nodes/unicode-array-nodes/unicode-array-rotate-function-node/UnicodeArrayRotateFunctionTemplate.ts index 189e7466..86bbb743 100644 --- a/src/templates/custom-nodes/unicode-array-nodes/unicode-array-rotate-function-node/UnicodeArrayRotateFunctionTemplate.ts +++ b/src/templates/custom-nodes/unicode-array-nodes/unicode-array-rotate-function-node/UnicodeArrayRotateFunctionTemplate.ts @@ -1,32 +1,16 @@ -import { Utils } from "../../../../Utils"; - /** - * @param code - * @param unicodeArrayName - * @param unicodeArrayRotateValue - * @param whileFunctionName - * @param timesName * @returns {string} */ -export function UnicodeArrayRotateFunctionTemplate ( - code: string, - unicodeArrayName: string, - unicodeArrayRotateValue: number, - whileFunctionName: string, - timesName: string -): string { - let arrayName: string = Utils.getRandomVariableName(), - timesArgumentName: string = Utils.getRandomVariableName(); - +export function UnicodeArrayRotateFunctionTemplate (): string { return ` - (function (${arrayName}, ${timesName}) { - var ${whileFunctionName} = function (${timesArgumentName}) { - while (--${timesArgumentName}) { - ${arrayName}[${Utils.stringToUnicode('push')}](${arrayName}[${Utils.stringToUnicode('shift')}]()); + (function (array, {timesName}) { + var {whileFunctionName} = function (times) { + while (--times) { + array['push'](array['shift']()); } }; - ${code} - })(${unicodeArrayName}, 0x${Utils.decToHex(unicodeArrayRotateValue)}); + {code} + })({unicodeArrayName}, 0x{unicodeArrayRotateValue}); `; }