test-bundle.js 120 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370
  1. module.exports =
  2. /******/ (function(modules) { // webpackBootstrap
  3. /******/ // The module cache
  4. /******/ var installedModules = {};
  5. /******/ // The require function
  6. /******/ function __webpack_require__(moduleId) {
  7. /******/ // Check if module is in cache
  8. /******/ if(installedModules[moduleId])
  9. /******/ return installedModules[moduleId].exports;
  10. /******/ // Create a new module (and put it into the cache)
  11. /******/ var module = installedModules[moduleId] = {
  12. /******/ exports: {},
  13. /******/ id: moduleId,
  14. /******/ loaded: false
  15. /******/ };
  16. /******/ // Execute the module function
  17. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  18. /******/ // Flag the module as loaded
  19. /******/ module.loaded = true;
  20. /******/ // Return the exports of the module
  21. /******/ return module.exports;
  22. /******/ }
  23. /******/ // expose the modules object (__webpack_modules__)
  24. /******/ __webpack_require__.m = modules;
  25. /******/ // expose the module cache
  26. /******/ __webpack_require__.c = installedModules;
  27. /******/ // __webpack_public_path__
  28. /******/ __webpack_require__.p = "";
  29. /******/ // Load entry module and return exports
  30. /******/ return __webpack_require__(0);
  31. /******/ })
  32. /************************************************************************/
  33. /******/ ([
  34. /* 0 */
  35. /***/ function(module, exports, __webpack_require__) {
  36. "use strict";
  37. var JavaScriptObfuscator_1 = __webpack_require__(2);
  38. var obfuscatedCode = JavaScriptObfuscator_1.JavaScriptObfuscator.obfuscate("\n (function(){\n var result = 1,\n term1 = 0,\n term2 = 1,\n i = 1;\n while(i < 10)\n {\n var test = 10;\n result = term1 + term2;\n console.log(result);\n term1 = term2;\n term2 = result;\n i++;\n }\n\n console.log(test);\n \n var test = function (test) {\n console.log(test);\n \n if (true) {\n var test = 5\n }\n \n return test;\n }\n \n console.log(test(1));\n \n function test2 (abc) {\n function test1 () {\n console.log('inside', abc.item);\n }\n \n console.log('тест', abc);\n \n var abc = {};\n \n return abc.item = 15, test1();\n };\n \n test2(22);\n console.log(105.4);\n console.log(true, false);\n })();\n ", {
  39. disableConsoleOutput: false,
  40. encodeUnicodeLiterals: true
  41. });
  42. console.log(obfuscatedCode);
  43. console.log(eval(obfuscatedCode));
  44. /***/ },
  45. /* 1 */,
  46. /* 2 */
  47. /***/ function(module, exports, __webpack_require__) {
  48. "use strict";
  49. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  50. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  51. var esprima = __webpack_require__(3);
  52. var escodegen = __webpack_require__(4);
  53. var DefaultPreset_1 = __webpack_require__(5);
  54. var Obfuscator_1 = __webpack_require__(6);
  55. var OptionsNormalizer_1 = __webpack_require__(37);
  56. var JavaScriptObfuscator = function () {
  57. function JavaScriptObfuscator() {
  58. _classCallCheck(this, JavaScriptObfuscator);
  59. }
  60. _createClass(JavaScriptObfuscator, null, [{
  61. key: 'obfuscate',
  62. value: function obfuscate(sourceCode, customOptions) {
  63. var astTree = esprima.parse(sourceCode),
  64. options = OptionsNormalizer_1.OptionsNormalizer.normalize(Object.assign({}, DefaultPreset_1.DEFAULT_PRESET, customOptions)),
  65. obfuscator = new Obfuscator_1.Obfuscator(options);
  66. astTree = obfuscator.obfuscateNode(astTree);
  67. return JavaScriptObfuscator.generateCode(astTree, options);
  68. }
  69. }, {
  70. key: 'generateCode',
  71. value: function generateCode(astTree, options) {
  72. var escodegenParams = Object.assign({}, JavaScriptObfuscator.escodegenParams);
  73. if (options.hasOwnProperty('compact')) {
  74. escodegenParams.format = {
  75. compact: options.compact
  76. };
  77. }
  78. return escodegen.generate(astTree, escodegenParams);
  79. }
  80. }]);
  81. return JavaScriptObfuscator;
  82. }();
  83. JavaScriptObfuscator.escodegenParams = {
  84. verbatim: 'x-verbatim-property'
  85. };
  86. exports.JavaScriptObfuscator = JavaScriptObfuscator;
  87. /***/ },
  88. /* 3 */
  89. /***/ function(module, exports) {
  90. module.exports = require("esprima");
  91. /***/ },
  92. /* 4 */
  93. /***/ function(module, exports) {
  94. module.exports = require("escodegen");
  95. /***/ },
  96. /* 5 */
  97. /***/ function(module, exports) {
  98. "use strict";
  99. exports.DEFAULT_PRESET = Object.freeze({
  100. compact: true,
  101. debugProtection: false,
  102. debugProtectionInterval: false,
  103. disableConsoleOutput: true,
  104. encodeUnicodeLiterals: false,
  105. reservedNames: [],
  106. rotateUnicodeArray: true,
  107. selfDefending: true,
  108. unicodeArray: true,
  109. unicodeArrayThreshold: 0.8,
  110. wrapUnicodeArrayCalls: true
  111. });
  112. /***/ },
  113. /* 6 */
  114. /***/ function(module, exports, __webpack_require__) {
  115. "use strict";
  116. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  117. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  118. var estraverse = __webpack_require__(7);
  119. var AppendState_1 = __webpack_require__(8);
  120. var NodeType_1 = __webpack_require__(9);
  121. var CatchClauseObfuscator_1 = __webpack_require__(12);
  122. var ConsoleOutputDisableExpressionNode_1 = __webpack_require__(15);
  123. var DebugProtectionNodesGroup_1 = __webpack_require__(17);
  124. var FunctionDeclarationObfuscator_1 = __webpack_require__(22);
  125. var FunctionObfuscator_1 = __webpack_require__(23);
  126. var LiteralObfuscator_1 = __webpack_require__(24);
  127. var MemberExpressionObfuscator_1 = __webpack_require__(25);
  128. var MethodDefinitionObfuscator_1 = __webpack_require__(26);
  129. var NodeUtils_1 = __webpack_require__(14);
  130. var ObjectExpressionObfuscator_1 = __webpack_require__(27);
  131. var SelfDefendingNodesGroup_1 = __webpack_require__(28);
  132. var UnicodeArrayNodesGroup_1 = __webpack_require__(31);
  133. var VariableDeclarationObfuscator_1 = __webpack_require__(36);
  134. var Obfuscator = function () {
  135. function Obfuscator() {
  136. var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
  137. _classCallCheck(this, Obfuscator);
  138. this.nodes = new Map();
  139. this.nodeObfuscators = new Map([[NodeType_1.NodeType.ArrowFunctionExpression, [FunctionObfuscator_1.FunctionObfuscator]], [NodeType_1.NodeType.ClassDeclaration, [FunctionDeclarationObfuscator_1.FunctionDeclarationObfuscator]], [NodeType_1.NodeType.CatchClause, [CatchClauseObfuscator_1.CatchClauseObfuscator]], [NodeType_1.NodeType.FunctionDeclaration, [FunctionDeclarationObfuscator_1.FunctionDeclarationObfuscator, FunctionObfuscator_1.FunctionObfuscator]], [NodeType_1.NodeType.FunctionExpression, [FunctionObfuscator_1.FunctionObfuscator]], [NodeType_1.NodeType.MemberExpression, [MemberExpressionObfuscator_1.MemberExpressionObfuscator]], [NodeType_1.NodeType.MethodDefinition, [MethodDefinitionObfuscator_1.MethodDefinitionObfuscator]], [NodeType_1.NodeType.ObjectExpression, [ObjectExpressionObfuscator_1.ObjectExpressionObfuscator]], [NodeType_1.NodeType.VariableDeclaration, [VariableDeclarationObfuscator_1.VariableDeclarationObfuscator]], [NodeType_1.NodeType.Literal, [LiteralObfuscator_1.LiteralObfuscator]]]);
  140. this.options = options;
  141. }
  142. _createClass(Obfuscator, [{
  143. key: 'obfuscateNode',
  144. value: function obfuscateNode(node) {
  145. this.setNewNodes();
  146. NodeUtils_1.NodeUtils.parentize(node);
  147. this.beforeObfuscation(node);
  148. this.obfuscate(node);
  149. this.afterObfuscation(node);
  150. return node;
  151. }
  152. }, {
  153. key: 'setNode',
  154. value: function setNode(nodeName, node) {
  155. this.nodes.set(nodeName, node);
  156. }
  157. }, {
  158. key: 'setNodesGroup',
  159. value: function setNodesGroup(nodesGroup) {
  160. var _this = this;
  161. var nodes = nodesGroup.getNodes();
  162. nodes.forEach(function (node, key) {
  163. _this.nodes.set(key, node);
  164. });
  165. }
  166. }, {
  167. key: 'afterObfuscation',
  168. value: function afterObfuscation(astTree) {
  169. this.nodes.forEach(function (node) {
  170. if (node.getAppendState() === AppendState_1.AppendState.AfterObfuscation) {
  171. node.appendNode(astTree);
  172. }
  173. });
  174. }
  175. }, {
  176. key: 'beforeObfuscation',
  177. value: function beforeObfuscation(astTree) {
  178. this.nodes.forEach(function (node) {
  179. if (node.getAppendState() === AppendState_1.AppendState.BeforeObfuscation) {
  180. node.appendNode(astTree);
  181. }
  182. });
  183. }
  184. }, {
  185. key: 'initializeNodeObfuscators',
  186. value: function initializeNodeObfuscators(node, parentNode) {
  187. var _this2 = this;
  188. if (!this.nodeObfuscators.has(node.type)) {
  189. return;
  190. }
  191. this.nodeObfuscators.get(node.type).forEach(function (obfuscator) {
  192. new obfuscator(_this2.nodes, _this2.options).obfuscateNode(node, parentNode);
  193. });
  194. }
  195. }, {
  196. key: 'obfuscate',
  197. value: function obfuscate(node) {
  198. var _this3 = this;
  199. estraverse.replace(node, {
  200. leave: function leave(node, parentNode) {
  201. _this3.initializeNodeObfuscators(node, parentNode);
  202. }
  203. });
  204. }
  205. }, {
  206. key: 'setNewNodes',
  207. value: function setNewNodes() {
  208. if (this.options['selfDefending']) {
  209. this.setNodesGroup(new SelfDefendingNodesGroup_1.SelfDefendingNodesGroup(this.options));
  210. }
  211. if (this.options['disableConsoleOutput']) {
  212. this.setNode('consoleOutputDisableExpressionNode', new ConsoleOutputDisableExpressionNode_1.ConsoleOutputDisableExpressionNode());
  213. }
  214. if (this.options['debugProtection']) {
  215. this.setNodesGroup(new DebugProtectionNodesGroup_1.DebugProtectionNodesGroup(this.options));
  216. }
  217. if (this.options['unicodeArray']) {
  218. this.setNodesGroup(new UnicodeArrayNodesGroup_1.UnicodeArrayNodesGroup(this.options));
  219. }
  220. }
  221. }]);
  222. return Obfuscator;
  223. }();
  224. exports.Obfuscator = Obfuscator;
  225. /***/ },
  226. /* 7 */
  227. /***/ function(module, exports) {
  228. module.exports = require("estraverse");
  229. /***/ },
  230. /* 8 */
  231. /***/ function(module, exports) {
  232. "use strict";
  233. (function (AppendState) {
  234. AppendState[AppendState["AfterObfuscation"] = 0] = "AfterObfuscation";
  235. AppendState[AppendState["BeforeObfuscation"] = 1] = "BeforeObfuscation";
  236. })(exports.AppendState || (exports.AppendState = {}));
  237. var AppendState = exports.AppendState;
  238. /***/ },
  239. /* 9 */
  240. /***/ function(module, exports, __webpack_require__) {
  241. "use strict";
  242. var Utils_1 = __webpack_require__(10);
  243. exports.NodeType = Utils_1.Utils.strEnumify({
  244. ArrayExpression: 'ArrayExpression',
  245. ArrowFunctionExpression: 'ArrowFunctionExpression',
  246. AssignmentExpression: 'AssignmentExpression',
  247. BinaryExpression: 'BinaryExpression',
  248. BlockStatement: 'BlockStatement',
  249. CallExpression: 'CallExpression',
  250. CatchClause: 'CatchClause',
  251. ClassDeclaration: 'ClassDeclaration',
  252. ExpressionStatement: 'ExpressionStatement',
  253. FunctionDeclaration: 'FunctionDeclaration',
  254. FunctionExpression: 'FunctionExpression',
  255. Identifier: 'Identifier',
  256. IfStatement: 'IfStatement',
  257. Literal: 'Literal',
  258. LogicalExpression: 'LogicalExpression',
  259. MemberExpression: 'MemberExpression',
  260. MethodDefinition: 'MethodDefinition',
  261. ObjectExpression: 'ObjectExpression',
  262. Program: 'Program',
  263. Property: 'Property',
  264. ReturnStatement: 'ReturnStatement',
  265. TryStatement: 'TryStatement',
  266. UnaryExpression: 'UnaryExpression',
  267. UpdateExpression: 'UpdateExpression',
  268. VariableDeclaration: 'VariableDeclaration',
  269. VariableDeclarator: 'VariableDeclarator',
  270. WhileStatement: 'WhileStatement'
  271. });
  272. /***/ },
  273. /* 10 */
  274. /***/ function(module, exports, __webpack_require__) {
  275. "use strict";
  276. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  277. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  278. var JSFuck_1 = __webpack_require__(11);
  279. var Utils = function () {
  280. function Utils() {
  281. _classCallCheck(this, Utils);
  282. }
  283. _createClass(Utils, null, [{
  284. key: 'arrayContains',
  285. value: function arrayContains(array, searchElement) {
  286. return array.indexOf(searchElement) >= 0;
  287. }
  288. }, {
  289. key: 'arrayRotate',
  290. value: function arrayRotate(array, times) {
  291. var reverse = arguments.length <= 2 || arguments[2] === undefined ? false : arguments[2];
  292. if (times < 0) {
  293. return;
  294. }
  295. var newArray = array,
  296. temp = void 0;
  297. while (times--) {
  298. if (!reverse) {
  299. temp = newArray.pop();
  300. newArray.unshift(temp);
  301. } else {
  302. temp = newArray.shift();
  303. newArray.push(temp);
  304. }
  305. }
  306. return newArray;
  307. }
  308. }, {
  309. key: 'btoa',
  310. value: function btoa(string) {
  311. return new Buffer(encodeURI(string)).toString('base64');
  312. }
  313. }, {
  314. key: 'decToHex',
  315. value: function decToHex(dec) {
  316. var decToHexSliceValue = -6,
  317. exponent = 6,
  318. radix = 16;
  319. return (dec + Math.pow(radix, exponent)).toString(radix).substr(decToHexSliceValue).replace(Utils.hexRepetitiveZerosRegExp, '');
  320. }
  321. }, {
  322. key: 'getRandomInteger',
  323. value: function getRandomInteger(min, max) {
  324. return Math.round(Math.floor(Math.random() * (max - min + 1)) + min);
  325. }
  326. }, {
  327. key: 'getRandomVariableName',
  328. value: function getRandomVariableName() {
  329. var length = arguments.length <= 0 || arguments[0] === undefined ? 6 : arguments[0];
  330. var rangeMinInteger = 10000,
  331. rangeMaxInteger = 99999999,
  332. prefix = '_0x';
  333. return '' + prefix + Utils.decToHex(Utils.getRandomInteger(rangeMinInteger, rangeMaxInteger)).substr(0, length);
  334. }
  335. }, {
  336. key: 'isInteger',
  337. value: function isInteger(number) {
  338. return number % 1 === 0;
  339. }
  340. }, {
  341. key: 'strEnumify',
  342. value: function strEnumify(obj) {
  343. return obj;
  344. }
  345. }, {
  346. key: 'stringToJSFuck',
  347. value: function stringToJSFuck(string) {
  348. return Array.from(string).map(function (character) {
  349. return JSFuck_1.JSFuck[character] || character;
  350. }).join(' + ');
  351. }
  352. }, {
  353. key: 'stringToUnicode',
  354. value: function stringToUnicode(string) {
  355. var radix = 16;
  356. var prefix = void 0,
  357. regexp = new RegExp('[\x00-\x7F]'),
  358. template = void 0;
  359. return '\'' + string.replace(/[\s\S]/g, function (escape) {
  360. if (regexp.test(escape)) {
  361. prefix = '\\x';
  362. template = '0'.repeat(2);
  363. } else {
  364. prefix = '\\u';
  365. template = '0'.repeat(4);
  366. }
  367. return '' + prefix + (template + escape.charCodeAt(0).toString(radix)).slice(-template.length);
  368. }) + '\'';
  369. }
  370. }]);
  371. return Utils;
  372. }();
  373. Utils.hexRepetitiveZerosRegExp = new RegExp('^(0{2,})+(?!$)', '');
  374. exports.Utils = Utils;
  375. /***/ },
  376. /* 11 */
  377. /***/ function(module, exports) {
  378. "use strict";
  379. exports.JSFuck = {
  380. Window: '[]["filter"]["constructor"]("return this")()',
  381. False: '![]',
  382. True: '!![]',
  383. a: '(false+"")[1]',
  384. b: '([]["entries"]()+"")[2]',
  385. c: '([]["fill"]+"")[3]',
  386. d: '(undefined+"")[2]',
  387. e: '(true+"")[3]',
  388. f: '(false+"")[0]',
  389. g: '(false+[0]+String)[20]',
  390. h: '(+(101))["to"+String["name"]](21)[1]',
  391. i: '([false]+undefined)[10]',
  392. j: '([]["entries"]()+"")[3]',
  393. k: '(+(20))["to"+String["name"]](21)',
  394. l: '(false+"")[2]',
  395. m: '(Number+"")[11]',
  396. n: '(undefined+"")[1]',
  397. o: '(true+[]["fill"])[10]',
  398. p: '(+(211))["to"+String["name"]](31)[1]',
  399. q: '(+(212))["to"+String["name"]](31)[1]',
  400. r: '(true+"")[1]',
  401. s: '(false+"")[3]',
  402. t: '(true+"")[0]',
  403. u: '(undefined+"")[0]',
  404. v: '(+(31))["to"+String["name"]](32)',
  405. w: '(+(32))["to"+String["name"]](33)',
  406. x: '(+(101))["to"+String["name"]](34)[1]',
  407. y: '(NaN+[Infinity])[10]',
  408. z: '(+(35))["to"+String["name"]](36)',
  409. A: '(+[]+Array)[10]',
  410. B: '(+[]+Boolean)[10]',
  411. C: 'Function("return escape")()(("")["italics"]())[2]',
  412. D: 'Function("return escape")()([]["fill"])["slice"]("-1")',
  413. E: '(RegExp+"")[12]',
  414. F: '(+[]+Function)[10]',
  415. G: '(false+Function("return Date")()())[30]',
  416. H: '\'H\'',
  417. I: '(Infinity+"")[0]',
  418. J: '\'J\'',
  419. K: '\'K\'',
  420. L: '\'L\'',
  421. M: '(true+Function("return Date")()())[30]',
  422. N: '(NaN+"")[0]',
  423. O: '(NaN+Function("return{}")())[11]',
  424. P: '\'P\'',
  425. Q: '\'Q\'',
  426. R: '(+[]+RegExp)[10]',
  427. S: '(+[]+String)[10]',
  428. T: '(NaN+Function("return Date")()())[30]',
  429. U: '(NaN+Function("return{}")()["to"+String["name"]]["call"]())[11]',
  430. V: '\'V\'',
  431. W: '\'W\'',
  432. X: '\'X\'',
  433. Y: '\'Y\'',
  434. Z: '\'Z\''
  435. };
  436. /***/ },
  437. /* 12 */
  438. /***/ function(module, exports, __webpack_require__) {
  439. "use strict";
  440. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  441. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  442. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  443. 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; }
  444. var estraverse = __webpack_require__(7);
  445. var NodeObfuscator_1 = __webpack_require__(13);
  446. var NodeUtils_1 = __webpack_require__(14);
  447. var Utils_1 = __webpack_require__(10);
  448. var CatchClauseObfuscator = function (_NodeObfuscator_1$Nod) {
  449. _inherits(CatchClauseObfuscator, _NodeObfuscator_1$Nod);
  450. function CatchClauseObfuscator() {
  451. var _Object$getPrototypeO;
  452. _classCallCheck(this, CatchClauseObfuscator);
  453. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  454. args[_key] = arguments[_key];
  455. }
  456. var _this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(CatchClauseObfuscator)).call.apply(_Object$getPrototypeO, [this].concat(args)));
  457. _this.catchClauseParam = new Map();
  458. return _this;
  459. }
  460. _createClass(CatchClauseObfuscator, [{
  461. key: 'obfuscateNode',
  462. value: function obfuscateNode(catchClauseNode) {
  463. this.replaceCatchClauseParam(catchClauseNode);
  464. this.replaceCatchClauseParamInBlock(catchClauseNode);
  465. }
  466. }, {
  467. key: 'replaceCatchClauseParam',
  468. value: function replaceCatchClauseParam(catchClauseNode) {
  469. var _this2 = this;
  470. estraverse.replace(catchClauseNode.param, {
  471. leave: function leave(node, parentNode) {
  472. if (NodeUtils_1.NodeUtils.isIdentifierNode(node) && !_this2.isReservedName(node.name)) {
  473. _this2.catchClauseParam.set(node.name, Utils_1.Utils.getRandomVariableName());
  474. node.name = _this2.catchClauseParam.get(node.name);
  475. return;
  476. }
  477. return estraverse.VisitorOption.Skip;
  478. }
  479. });
  480. }
  481. }, {
  482. key: 'replaceCatchClauseParamInBlock',
  483. value: function replaceCatchClauseParamInBlock(catchClauseNode) {
  484. var _this3 = this;
  485. estraverse.replace(catchClauseNode.body, {
  486. leave: function leave(node, parentNode) {
  487. _this3.replaceNodeIdentifierByNewValue(node, parentNode, _this3.catchClauseParam);
  488. }
  489. });
  490. }
  491. }]);
  492. return CatchClauseObfuscator;
  493. }(NodeObfuscator_1.NodeObfuscator);
  494. exports.CatchClauseObfuscator = CatchClauseObfuscator;
  495. /***/ },
  496. /* 13 */
  497. /***/ function(module, exports, __webpack_require__) {
  498. "use strict";
  499. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  500. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  501. var JSFuck_1 = __webpack_require__(11);
  502. var NodeUtils_1 = __webpack_require__(14);
  503. var Utils_1 = __webpack_require__(10);
  504. var NodeObfuscator = function () {
  505. function NodeObfuscator(nodes) {
  506. var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
  507. _classCallCheck(this, NodeObfuscator);
  508. this.nodes = nodes;
  509. this.options = options;
  510. }
  511. _createClass(NodeObfuscator, [{
  512. key: "isReservedName",
  513. value: function isReservedName(name) {
  514. return this.options['reservedNames'].some(function (reservedName) {
  515. return new RegExp(reservedName, 'g').test(name);
  516. });
  517. }
  518. }, {
  519. key: "replaceNodeIdentifierByNewValue",
  520. value: function replaceNodeIdentifierByNewValue(node, parentNode, namesMap) {
  521. if (NodeUtils_1.NodeUtils.isIdentifierNode(node) && namesMap.has(node.name)) {
  522. var parentNodeIsAPropertyNode = NodeUtils_1.NodeUtils.isPropertyNode(parentNode) && parentNode.key === node,
  523. parentNodeIsAMemberExpressionNode = NodeUtils_1.NodeUtils.isMemberExpressionNode(parentNode) && parentNode.computed === false && parentNode.property === node;
  524. if (parentNodeIsAPropertyNode || parentNodeIsAMemberExpressionNode) {
  525. return;
  526. }
  527. node.name = namesMap.get(node.name);
  528. }
  529. }
  530. }, {
  531. key: "replaceLiteralBooleanByJSFuck",
  532. value: function replaceLiteralBooleanByJSFuck(nodeValue) {
  533. return nodeValue ? JSFuck_1.JSFuck.True : JSFuck_1.JSFuck.False;
  534. }
  535. }, {
  536. key: "replaceLiteralNumberByHexadecimalValue",
  537. value: function replaceLiteralNumberByHexadecimalValue(nodeValue) {
  538. var prefix = '0x';
  539. if (!Utils_1.Utils.isInteger(nodeValue)) {
  540. return String(nodeValue);
  541. }
  542. return "" + prefix + Utils_1.Utils.decToHex(nodeValue);
  543. }
  544. }, {
  545. key: "replaceLiteralValueByUnicodeValue",
  546. value: function replaceLiteralValueByUnicodeValue(nodeValue) {
  547. var value = nodeValue,
  548. replaceByUnicodeArrayFlag = Math.random() <= this.options['unicodeArrayThreshold'];
  549. if (this.options['encodeUnicodeLiterals'] && replaceByUnicodeArrayFlag) {
  550. value = Utils_1.Utils.btoa(value);
  551. }
  552. value = Utils_1.Utils.stringToUnicode(value);
  553. if (!this.options['unicodeArray'] || !replaceByUnicodeArrayFlag) {
  554. return value;
  555. }
  556. return this.replaceLiteralValueByUnicodeArrayCall(value);
  557. }
  558. }, {
  559. key: "replaceLiteralValueByUnicodeArrayCall",
  560. value: function replaceLiteralValueByUnicodeArrayCall(value) {
  561. var unicodeArrayNode = this.nodes.get('unicodeArrayNode'),
  562. unicodeArray = unicodeArrayNode.getNodeData(),
  563. sameIndex = unicodeArray.indexOf(value),
  564. index = void 0,
  565. hexadecimalIndex = void 0;
  566. if (sameIndex >= 0) {
  567. index = sameIndex;
  568. } else {
  569. index = unicodeArray.length;
  570. unicodeArrayNode.updateNodeData(value);
  571. }
  572. hexadecimalIndex = this.replaceLiteralNumberByHexadecimalValue(index);
  573. if (this.options['wrapUnicodeArrayCalls']) {
  574. return this.nodes.get('unicodeArrayCallsWrapper').getNodeIdentifier() + "('" + hexadecimalIndex + "')";
  575. }
  576. return unicodeArrayNode.getNodeIdentifier() + "[" + hexadecimalIndex + "]";
  577. }
  578. }]);
  579. return NodeObfuscator;
  580. }();
  581. exports.NodeObfuscator = NodeObfuscator;
  582. /***/ },
  583. /* 14 */
  584. /***/ function(module, exports, __webpack_require__) {
  585. "use strict";
  586. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  587. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  588. var estraverse = __webpack_require__(7);
  589. var NodeType_1 = __webpack_require__(9);
  590. var Utils_1 = __webpack_require__(10);
  591. var NodeUtils = function () {
  592. function NodeUtils() {
  593. _classCallCheck(this, NodeUtils);
  594. }
  595. _createClass(NodeUtils, null, [{
  596. key: "addXVerbatimPropertyToLiterals",
  597. value: function addXVerbatimPropertyToLiterals(node) {
  598. estraverse.replace(node, {
  599. enter: function enter(node, parentNode) {
  600. if (NodeUtils.isLiteralNode(node)) {
  601. node['x-verbatim-property'] = node.raw;
  602. }
  603. }
  604. });
  605. }
  606. }, {
  607. key: "appendNode",
  608. value: function appendNode(blockScopeBody, node) {
  609. if (!NodeUtils.validateNode(node)) {
  610. return;
  611. }
  612. blockScopeBody.push(node);
  613. }
  614. }, {
  615. key: "getBlockScopeNodeByIndex",
  616. value: function getBlockScopeNodeByIndex(node) {
  617. var index = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1];
  618. if (NodeUtils.isNodeHasBlockScope(node) && node.body[index]) {
  619. return node.body[index];
  620. }
  621. return node;
  622. }
  623. }, {
  624. key: "getBlockScopeOfNode",
  625. value: function getBlockScopeOfNode(node) {
  626. var depth = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1];
  627. if (!node.parentNode) {
  628. throw new ReferenceError('`parentNode` property of given node is `undefined`');
  629. }
  630. if (node.parentNode.type === NodeType_1.NodeType.Program) {
  631. return node.parentNode;
  632. }
  633. if (!Utils_1.Utils.arrayContains(NodeUtils.scopeNodes, node.parentNode.type)) {
  634. return NodeUtils.getBlockScopeOfNode(node.parentNode, depth);
  635. }
  636. if (depth > 0) {
  637. return NodeUtils.getBlockScopeOfNode(node.parentNode, --depth);
  638. }
  639. if (node.type !== NodeType_1.NodeType.BlockStatement) {
  640. return NodeUtils.getBlockScopeOfNode(node.parentNode);
  641. }
  642. return node;
  643. }
  644. }, {
  645. key: "getProgramNode",
  646. value: function getProgramNode(bodyNode) {
  647. return {
  648. 'type': NodeType_1.NodeType.Program,
  649. 'body': bodyNode
  650. };
  651. }
  652. }, {
  653. key: "insertNodeAtIndex",
  654. value: function insertNodeAtIndex(blockScopeBody, node, index) {
  655. if (!NodeUtils.validateNode(node)) {
  656. return;
  657. }
  658. blockScopeBody.splice(index, 0, node);
  659. }
  660. }, {
  661. key: "isBlockStatementNode",
  662. value: function isBlockStatementNode(node) {
  663. return node.type === NodeType_1.NodeType.BlockStatement;
  664. }
  665. }, {
  666. key: "isIdentifierNode",
  667. value: function isIdentifierNode(node) {
  668. return node.type === NodeType_1.NodeType.Identifier;
  669. }
  670. }, {
  671. key: "isLiteralNode",
  672. value: function isLiteralNode(node) {
  673. return node.type === NodeType_1.NodeType.Literal;
  674. }
  675. }, {
  676. key: "isMemberExpressionNode",
  677. value: function isMemberExpressionNode(node) {
  678. return node.type === NodeType_1.NodeType.MemberExpression;
  679. }
  680. }, {
  681. key: "isNodeHasBlockScope",
  682. value: function isNodeHasBlockScope(node) {
  683. return node.hasOwnProperty('body');
  684. }
  685. }, {
  686. key: "isProgramNode",
  687. value: function isProgramNode(node) {
  688. return node.type === NodeType_1.NodeType.Program;
  689. }
  690. }, {
  691. key: "isPropertyNode",
  692. value: function isPropertyNode(node) {
  693. return node.type === NodeType_1.NodeType.Property;
  694. }
  695. }, {
  696. key: "isVariableDeclaratorNode",
  697. value: function isVariableDeclaratorNode(node) {
  698. return node.type === NodeType_1.NodeType.VariableDeclarator;
  699. }
  700. }, {
  701. key: "parentize",
  702. value: function parentize(node) {
  703. var isRootNode = true;
  704. estraverse.replace(node, {
  705. enter: function enter(node, parentNode) {
  706. Object.defineProperty(node, 'parentNode', {
  707. configurable: true,
  708. enumerable: true,
  709. value: isRootNode ? NodeUtils.getProgramNode([node]) : parentNode || node,
  710. writable: true
  711. });
  712. isRootNode = false;
  713. }
  714. });
  715. }
  716. }, {
  717. key: "prependNode",
  718. value: function prependNode(blockScopeBody, node) {
  719. if (!NodeUtils.validateNode(node)) {
  720. return;
  721. }
  722. blockScopeBody.unshift(node);
  723. }
  724. }, {
  725. key: "validateNode",
  726. value: function validateNode(node) {
  727. return !!node;
  728. }
  729. }]);
  730. return NodeUtils;
  731. }();
  732. NodeUtils.scopeNodes = [NodeType_1.NodeType.ArrowFunctionExpression, NodeType_1.NodeType.FunctionDeclaration, NodeType_1.NodeType.FunctionExpression, NodeType_1.NodeType.MethodDefinition];
  733. exports.NodeUtils = NodeUtils;
  734. /***/ },
  735. /* 15 */
  736. /***/ function(module, exports, __webpack_require__) {
  737. "use strict";
  738. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  739. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  740. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  741. 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; }
  742. var esprima = __webpack_require__(3);
  743. var Node_1 = __webpack_require__(16);
  744. var NodeUtils_1 = __webpack_require__(14);
  745. var ConsoleOutputDisableExpressionNode = function (_Node_1$Node) {
  746. _inherits(ConsoleOutputDisableExpressionNode, _Node_1$Node);
  747. function ConsoleOutputDisableExpressionNode() {
  748. var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
  749. _classCallCheck(this, ConsoleOutputDisableExpressionNode);
  750. var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(ConsoleOutputDisableExpressionNode).call(this, options));
  751. _this.node = _this.getNodeStructure();
  752. return _this;
  753. }
  754. _createClass(ConsoleOutputDisableExpressionNode, [{
  755. key: 'appendNode',
  756. value: function appendNode(blockScopeNode) {
  757. NodeUtils_1.NodeUtils.prependNode(blockScopeNode.body, this.getNode());
  758. }
  759. }, {
  760. key: 'getNodeStructure',
  761. value: function getNodeStructure() {
  762. return NodeUtils_1.NodeUtils.getBlockScopeNodeByIndex(esprima.parse('\n (function () {\n var _ = \'(\u0004\u0006\u0003\u0005[]\' + \'["filter"]["\u0007tructor"]\' + \'("return this")()\' + \'.\' + \'\u0003;\u0006\u0002\u0005\u0004};\' + \'_\u0003.log\u0001.in\' + \'fo\u0001.\' + \'war\' + \'n\u0001.er\' + \'r\' + \'or\u0001})();\' + \'\u0001\u0005_\u0002;\' + \'_\u0003\u0002function\' + \'\u0003\u0007ole\u0004\u0002 ()\' + \'{\u0005 = \u0006var \' + \'_\u0007cons\', \n Y, \n $;\n \n for (Y in $ = "\u0007\u0006\u0005\u0004\u0003\u0002\u0001") {\n var arr = _.split($[Y]);\n _ = arr.join(arr.pop());\n }\n \n []["filter"]["constructor"](_)();\n })()\n '));
  763. }
  764. }]);
  765. return ConsoleOutputDisableExpressionNode;
  766. }(Node_1.Node);
  767. exports.ConsoleOutputDisableExpressionNode = ConsoleOutputDisableExpressionNode;
  768. /***/ },
  769. /* 16 */
  770. /***/ function(module, exports, __webpack_require__) {
  771. "use strict";
  772. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  773. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  774. var AppendState_1 = __webpack_require__(8);
  775. var NodeUtils_1 = __webpack_require__(14);
  776. var Node = function () {
  777. function Node() {
  778. var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
  779. _classCallCheck(this, Node);
  780. this.appendState = AppendState_1.AppendState.BeforeObfuscation;
  781. this.options = options;
  782. }
  783. _createClass(Node, [{
  784. key: "getAppendState",
  785. value: function getAppendState() {
  786. return this.appendState;
  787. }
  788. }, {
  789. key: "getNode",
  790. value: function getNode() {
  791. NodeUtils_1.NodeUtils.parentize(this.node);
  792. return this.node;
  793. }
  794. }, {
  795. key: "setNode",
  796. value: function setNode(node) {
  797. this.node = node;
  798. }
  799. }, {
  800. key: "updateNode",
  801. value: function updateNode() {
  802. this.node = this.getNodeStructure();
  803. }
  804. }]);
  805. return Node;
  806. }();
  807. exports.Node = Node;
  808. /***/ },
  809. /* 17 */
  810. /***/ function(module, exports, __webpack_require__) {
  811. "use strict";
  812. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  813. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  814. 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; }
  815. var DebugProtectionFunctionCallNode_1 = __webpack_require__(18);
  816. var DebugProtectionFunctionIntervalNode_1 = __webpack_require__(19);
  817. var DebugProtectionFunctionNode_1 = __webpack_require__(20);
  818. var NodesGroup_1 = __webpack_require__(21);
  819. var Utils_1 = __webpack_require__(10);
  820. var DebugProtectionNodesGroup = function (_NodesGroup_1$NodesGr) {
  821. _inherits(DebugProtectionNodesGroup, _NodesGroup_1$NodesGr);
  822. function DebugProtectionNodesGroup() {
  823. var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
  824. _classCallCheck(this, DebugProtectionNodesGroup);
  825. var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(DebugProtectionNodesGroup).call(this, options));
  826. _this.debugProtectionFunctionIdentifier = Utils_1.Utils.getRandomVariableName();
  827. _this.nodes.set('debugProtectionFunctionNode', new DebugProtectionFunctionNode_1.DebugProtectionFunctionNode(_this.debugProtectionFunctionIdentifier, _this.options));
  828. _this.nodes.set('debugProtectionFunctionCallNode', new DebugProtectionFunctionCallNode_1.DebugProtectionFunctionCallNode(_this.debugProtectionFunctionIdentifier, _this.options));
  829. if (_this.options['debugProtectionInterval']) {
  830. _this.nodes.set('debugProtectionFunctionIntervalNode', new DebugProtectionFunctionIntervalNode_1.DebugProtectionFunctionIntervalNode(_this.debugProtectionFunctionIdentifier, _this.options));
  831. }
  832. return _this;
  833. }
  834. return DebugProtectionNodesGroup;
  835. }(NodesGroup_1.NodesGroup);
  836. exports.DebugProtectionNodesGroup = DebugProtectionNodesGroup;
  837. /***/ },
  838. /* 18 */
  839. /***/ function(module, exports, __webpack_require__) {
  840. "use strict";
  841. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  842. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  843. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  844. 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; }
  845. var NodeType_1 = __webpack_require__(9);
  846. var Node_1 = __webpack_require__(16);
  847. var NodeUtils_1 = __webpack_require__(14);
  848. var DebugProtectionFunctionCallNode = function (_Node_1$Node) {
  849. _inherits(DebugProtectionFunctionCallNode, _Node_1$Node);
  850. function DebugProtectionFunctionCallNode(debugProtectionFunctionName) {
  851. var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
  852. _classCallCheck(this, DebugProtectionFunctionCallNode);
  853. var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(DebugProtectionFunctionCallNode).call(this, options));
  854. _this.debugProtectionFunctionName = debugProtectionFunctionName;
  855. _this.node = _this.getNodeStructure();
  856. return _this;
  857. }
  858. _createClass(DebugProtectionFunctionCallNode, [{
  859. key: "appendNode",
  860. value: function appendNode(blockScopeNode) {
  861. NodeUtils_1.NodeUtils.appendNode(blockScopeNode.body, this.getNode());
  862. }
  863. }, {
  864. key: "getNodeStructure",
  865. value: function getNodeStructure() {
  866. return {
  867. 'type': NodeType_1.NodeType.ExpressionStatement,
  868. 'expression': {
  869. 'type': NodeType_1.NodeType.CallExpression,
  870. 'callee': {
  871. 'type': NodeType_1.NodeType.Identifier,
  872. 'name': this.debugProtectionFunctionName
  873. },
  874. 'arguments': []
  875. }
  876. };
  877. }
  878. }]);
  879. return DebugProtectionFunctionCallNode;
  880. }(Node_1.Node);
  881. exports.DebugProtectionFunctionCallNode = DebugProtectionFunctionCallNode;
  882. /***/ },
  883. /* 19 */
  884. /***/ function(module, exports, __webpack_require__) {
  885. "use strict";
  886. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  887. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  888. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  889. 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; }
  890. var NodeType_1 = __webpack_require__(9);
  891. var Node_1 = __webpack_require__(16);
  892. var NodeUtils_1 = __webpack_require__(14);
  893. var DebugProtectionFunctionIntervalNode = function (_Node_1$Node) {
  894. _inherits(DebugProtectionFunctionIntervalNode, _Node_1$Node);
  895. function DebugProtectionFunctionIntervalNode(debugProtectionFunctionName) {
  896. var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
  897. _classCallCheck(this, DebugProtectionFunctionIntervalNode);
  898. var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(DebugProtectionFunctionIntervalNode).call(this, options));
  899. _this.debugProtectionFunctionName = debugProtectionFunctionName;
  900. _this.node = _this.getNodeStructure();
  901. return _this;
  902. }
  903. _createClass(DebugProtectionFunctionIntervalNode, [{
  904. key: 'appendNode',
  905. value: function appendNode(blockScopeNode) {
  906. NodeUtils_1.NodeUtils.appendNode(blockScopeNode.body, this.getNode());
  907. }
  908. }, {
  909. key: 'getNodeStructure',
  910. value: function getNodeStructure() {
  911. return {
  912. 'type': NodeType_1.NodeType.ExpressionStatement,
  913. 'expression': {
  914. 'type': NodeType_1.NodeType.CallExpression,
  915. 'callee': {
  916. 'type': NodeType_1.NodeType.Identifier,
  917. 'name': 'setInterval'
  918. },
  919. 'arguments': [{
  920. 'type': NodeType_1.NodeType.FunctionExpression,
  921. 'id': null,
  922. 'params': [],
  923. 'defaults': [],
  924. 'body': {
  925. 'type': NodeType_1.NodeType.BlockStatement,
  926. 'body': [{
  927. 'type': NodeType_1.NodeType.ExpressionStatement,
  928. 'expression': {
  929. 'type': NodeType_1.NodeType.CallExpression,
  930. 'callee': {
  931. 'type': NodeType_1.NodeType.Identifier,
  932. 'name': this.debugProtectionFunctionName
  933. },
  934. 'arguments': []
  935. }
  936. }]
  937. },
  938. 'generator': false,
  939. 'expression': false
  940. }, {
  941. 'type': NodeType_1.NodeType.Literal,
  942. 'value': 4000,
  943. 'raw': '4000'
  944. }]
  945. }
  946. };
  947. }
  948. }]);
  949. return DebugProtectionFunctionIntervalNode;
  950. }(Node_1.Node);
  951. exports.DebugProtectionFunctionIntervalNode = DebugProtectionFunctionIntervalNode;
  952. /***/ },
  953. /* 20 */
  954. /***/ function(module, exports, __webpack_require__) {
  955. "use strict";
  956. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  957. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  958. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  959. 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; }
  960. var esprima = __webpack_require__(3);
  961. var Node_1 = __webpack_require__(16);
  962. var NodeUtils_1 = __webpack_require__(14);
  963. var Utils_1 = __webpack_require__(10);
  964. var DebugProtectionFunctionNode = function (_Node_1$Node) {
  965. _inherits(DebugProtectionFunctionNode, _Node_1$Node);
  966. function DebugProtectionFunctionNode(debugProtectionFunctionName) {
  967. var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
  968. _classCallCheck(this, DebugProtectionFunctionNode);
  969. var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(DebugProtectionFunctionNode).call(this, options));
  970. _this.debugProtectionFunctionName = debugProtectionFunctionName;
  971. _this.node = _this.getNodeStructure();
  972. return _this;
  973. }
  974. _createClass(DebugProtectionFunctionNode, [{
  975. key: 'appendNode',
  976. value: function appendNode(blockScopeNode) {
  977. var programBodyLength = blockScopeNode.body.length,
  978. randomIndex = Utils_1.Utils.getRandomInteger(0, programBodyLength);
  979. NodeUtils_1.NodeUtils.insertNodeAtIndex(blockScopeNode.body, this.getNode(), randomIndex);
  980. }
  981. }, {
  982. key: 'getNodeIdentifier',
  983. value: function getNodeIdentifier() {
  984. return this.debugProtectionFunctionName;
  985. }
  986. }, {
  987. key: 'getNodeStructure',
  988. value: function getNodeStructure() {
  989. return NodeUtils_1.NodeUtils.getBlockScopeNodeByIndex(esprima.parse('\n var ' + this.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 '));
  990. }
  991. }]);
  992. return DebugProtectionFunctionNode;
  993. }(Node_1.Node);
  994. exports.DebugProtectionFunctionNode = DebugProtectionFunctionNode;
  995. /***/ },
  996. /* 21 */
  997. /***/ function(module, exports) {
  998. "use strict";
  999. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  1000. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1001. var NodesGroup = function () {
  1002. function NodesGroup() {
  1003. var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
  1004. _classCallCheck(this, NodesGroup);
  1005. this.nodes = new Map();
  1006. this.options = options;
  1007. }
  1008. _createClass(NodesGroup, [{
  1009. key: "getNodes",
  1010. value: function getNodes() {
  1011. return this.nodes;
  1012. }
  1013. }]);
  1014. return NodesGroup;
  1015. }();
  1016. exports.NodesGroup = NodesGroup;
  1017. /***/ },
  1018. /* 22 */
  1019. /***/ function(module, exports, __webpack_require__) {
  1020. "use strict";
  1021. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  1022. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1023. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  1024. 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; }
  1025. var estraverse = __webpack_require__(7);
  1026. var NodeType_1 = __webpack_require__(9);
  1027. var NodeObfuscator_1 = __webpack_require__(13);
  1028. var NodeUtils_1 = __webpack_require__(14);
  1029. var Utils_1 = __webpack_require__(10);
  1030. var FunctionDeclarationObfuscator = function (_NodeObfuscator_1$Nod) {
  1031. _inherits(FunctionDeclarationObfuscator, _NodeObfuscator_1$Nod);
  1032. function FunctionDeclarationObfuscator() {
  1033. var _Object$getPrototypeO;
  1034. _classCallCheck(this, FunctionDeclarationObfuscator);
  1035. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  1036. args[_key] = arguments[_key];
  1037. }
  1038. var _this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(FunctionDeclarationObfuscator)).call.apply(_Object$getPrototypeO, [this].concat(args)));
  1039. _this.functionName = new Map();
  1040. return _this;
  1041. }
  1042. _createClass(FunctionDeclarationObfuscator, [{
  1043. key: "obfuscateNode",
  1044. value: function obfuscateNode(functionDeclarationNode, parentNode) {
  1045. if (parentNode.type === NodeType_1.NodeType.Program) {
  1046. return;
  1047. }
  1048. this.replaceFunctionName(functionDeclarationNode);
  1049. this.replaceFunctionCalls(functionDeclarationNode);
  1050. }
  1051. }, {
  1052. key: "replaceFunctionName",
  1053. value: function replaceFunctionName(functionDeclarationNode) {
  1054. var _this2 = this;
  1055. estraverse.replace(functionDeclarationNode.id, {
  1056. leave: function leave(node) {
  1057. if (NodeUtils_1.NodeUtils.isIdentifierNode(node) && !_this2.isReservedName(node.name)) {
  1058. _this2.functionName.set(node.name, Utils_1.Utils.getRandomVariableName());
  1059. node.name = _this2.functionName.get(node.name);
  1060. return;
  1061. }
  1062. return estraverse.VisitorOption.Skip;
  1063. }
  1064. });
  1065. }
  1066. }, {
  1067. key: "replaceFunctionCalls",
  1068. value: function replaceFunctionCalls(functionDeclarationNode) {
  1069. var _this3 = this;
  1070. var scopeNode = NodeUtils_1.NodeUtils.getBlockScopeOfNode(functionDeclarationNode);
  1071. estraverse.replace(scopeNode, {
  1072. enter: function enter(node, parentNode) {
  1073. _this3.replaceNodeIdentifierByNewValue(node, parentNode, _this3.functionName);
  1074. }
  1075. });
  1076. }
  1077. }]);
  1078. return FunctionDeclarationObfuscator;
  1079. }(NodeObfuscator_1.NodeObfuscator);
  1080. exports.FunctionDeclarationObfuscator = FunctionDeclarationObfuscator;
  1081. /***/ },
  1082. /* 23 */
  1083. /***/ function(module, exports, __webpack_require__) {
  1084. "use strict";
  1085. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  1086. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1087. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  1088. 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; }
  1089. var estraverse = __webpack_require__(7);
  1090. var NodeObfuscator_1 = __webpack_require__(13);
  1091. var NodeUtils_1 = __webpack_require__(14);
  1092. var Utils_1 = __webpack_require__(10);
  1093. var FunctionObfuscator = function (_NodeObfuscator_1$Nod) {
  1094. _inherits(FunctionObfuscator, _NodeObfuscator_1$Nod);
  1095. function FunctionObfuscator() {
  1096. var _Object$getPrototypeO;
  1097. _classCallCheck(this, FunctionObfuscator);
  1098. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  1099. args[_key] = arguments[_key];
  1100. }
  1101. var _this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(FunctionObfuscator)).call.apply(_Object$getPrototypeO, [this].concat(args)));
  1102. _this.functionParams = new Map();
  1103. return _this;
  1104. }
  1105. _createClass(FunctionObfuscator, [{
  1106. key: 'obfuscateNode',
  1107. value: function obfuscateNode(functionNode) {
  1108. this.replaceFunctionParams(functionNode);
  1109. this.replaceFunctionParamsInBody(functionNode);
  1110. }
  1111. }, {
  1112. key: 'replaceFunctionParams',
  1113. value: function replaceFunctionParams(functionNode) {
  1114. var _this2 = this;
  1115. functionNode.params.forEach(function (paramsNode) {
  1116. estraverse.replace(paramsNode, {
  1117. leave: function leave(node) {
  1118. if (NodeUtils_1.NodeUtils.isIdentifierNode(node) && !_this2.isReservedName(node.name)) {
  1119. _this2.functionParams.set(node.name, Utils_1.Utils.getRandomVariableName());
  1120. node.name = _this2.functionParams.get(node.name);
  1121. return;
  1122. }
  1123. return estraverse.VisitorOption.Skip;
  1124. }
  1125. });
  1126. });
  1127. }
  1128. }, {
  1129. key: 'replaceFunctionParamsInBody',
  1130. value: function replaceFunctionParamsInBody(functionNode) {
  1131. var _this3 = this;
  1132. estraverse.replace(functionNode.body, {
  1133. leave: function leave(node, parentNode) {
  1134. _this3.replaceNodeIdentifierByNewValue(node, parentNode, _this3.functionParams);
  1135. }
  1136. });
  1137. }
  1138. }]);
  1139. return FunctionObfuscator;
  1140. }(NodeObfuscator_1.NodeObfuscator);
  1141. exports.FunctionObfuscator = FunctionObfuscator;
  1142. /***/ },
  1143. /* 24 */
  1144. /***/ function(module, exports, __webpack_require__) {
  1145. "use strict";
  1146. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
  1147. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  1148. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1149. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  1150. 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; }
  1151. var escodegen = __webpack_require__(4);
  1152. var NodeObfuscator_1 = __webpack_require__(13);
  1153. var NodeUtils_1 = __webpack_require__(14);
  1154. var LiteralObfuscator = function (_NodeObfuscator_1$Nod) {
  1155. _inherits(LiteralObfuscator, _NodeObfuscator_1$Nod);
  1156. function LiteralObfuscator() {
  1157. _classCallCheck(this, LiteralObfuscator);
  1158. return _possibleConstructorReturn(this, Object.getPrototypeOf(LiteralObfuscator).apply(this, arguments));
  1159. }
  1160. _createClass(LiteralObfuscator, [{
  1161. key: 'obfuscateNode',
  1162. value: function obfuscateNode(literalNode, parentNode) {
  1163. if (NodeUtils_1.NodeUtils.isPropertyNode(parentNode) && parentNode.key === literalNode) {
  1164. return;
  1165. }
  1166. if (literalNode['x-verbatim-property']) {
  1167. return;
  1168. }
  1169. var content = void 0;
  1170. switch (_typeof(literalNode.value)) {
  1171. case 'boolean':
  1172. content = this.replaceLiteralBooleanByJSFuck(literalNode.value);
  1173. break;
  1174. case 'number':
  1175. content = this.replaceLiteralNumberByHexadecimalValue(literalNode.value);
  1176. break;
  1177. case 'string':
  1178. content = this.replaceLiteralValueByUnicodeValue(literalNode.value);
  1179. break;
  1180. default:
  1181. return;
  1182. }
  1183. literalNode['x-verbatim-property'] = {
  1184. content: content,
  1185. precedence: escodegen.Precedence.Primary
  1186. };
  1187. }
  1188. }]);
  1189. return LiteralObfuscator;
  1190. }(NodeObfuscator_1.NodeObfuscator);
  1191. exports.LiteralObfuscator = LiteralObfuscator;
  1192. /***/ },
  1193. /* 25 */
  1194. /***/ function(module, exports, __webpack_require__) {
  1195. "use strict";
  1196. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
  1197. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  1198. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1199. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  1200. 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; }
  1201. var escodegen = __webpack_require__(4);
  1202. var estraverse = __webpack_require__(7);
  1203. var NodeType_1 = __webpack_require__(9);
  1204. var NodeObfuscator_1 = __webpack_require__(13);
  1205. var NodeUtils_1 = __webpack_require__(14);
  1206. var MemberExpressionObfuscator = function (_NodeObfuscator_1$Nod) {
  1207. _inherits(MemberExpressionObfuscator, _NodeObfuscator_1$Nod);
  1208. function MemberExpressionObfuscator() {
  1209. _classCallCheck(this, MemberExpressionObfuscator);
  1210. return _possibleConstructorReturn(this, Object.getPrototypeOf(MemberExpressionObfuscator).apply(this, arguments));
  1211. }
  1212. _createClass(MemberExpressionObfuscator, [{
  1213. key: 'obfuscateNode',
  1214. value: function obfuscateNode(memberExpressionNode) {
  1215. var _this2 = this;
  1216. estraverse.replace(memberExpressionNode.property, {
  1217. leave: function leave(node, parentNode) {
  1218. if (NodeUtils_1.NodeUtils.isLiteralNode(node)) {
  1219. _this2.literalNodeController(node);
  1220. return;
  1221. }
  1222. if (NodeUtils_1.NodeUtils.isIdentifierNode(node)) {
  1223. if (memberExpressionNode.computed) {
  1224. return;
  1225. }
  1226. memberExpressionNode.computed = true;
  1227. _this2.identifierNodeController(node);
  1228. }
  1229. }
  1230. });
  1231. }
  1232. }, {
  1233. key: 'identifierNodeController',
  1234. value: function identifierNodeController(node) {
  1235. var nodeValue = node.name,
  1236. literalNode = {
  1237. raw: '\'' + nodeValue + '\'',
  1238. 'x-verbatim-property': {
  1239. content: this.replaceLiteralValueByUnicodeValue(nodeValue),
  1240. precedence: escodegen.Precedence.Primary
  1241. },
  1242. type: NodeType_1.NodeType.Literal,
  1243. value: nodeValue
  1244. };
  1245. delete node.name;
  1246. Object.assign(node, literalNode);
  1247. }
  1248. }, {
  1249. key: 'literalNodeController',
  1250. value: function literalNodeController(node) {
  1251. switch (_typeof(node.value)) {
  1252. case 'string':
  1253. if (node['x-verbatim-property']) {
  1254. break;
  1255. }
  1256. node['x-verbatim-property'] = {
  1257. content: this.replaceLiteralValueByUnicodeValue(node.value),
  1258. precedence: escodegen.Precedence.Primary
  1259. };
  1260. break;
  1261. default:
  1262. break;
  1263. }
  1264. }
  1265. }]);
  1266. return MemberExpressionObfuscator;
  1267. }(NodeObfuscator_1.NodeObfuscator);
  1268. exports.MemberExpressionObfuscator = MemberExpressionObfuscator;
  1269. /***/ },
  1270. /* 26 */
  1271. /***/ function(module, exports, __webpack_require__) {
  1272. "use strict";
  1273. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  1274. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1275. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  1276. 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; }
  1277. var estraverse = __webpack_require__(7);
  1278. var NodeObfuscator_1 = __webpack_require__(13);
  1279. var NodeUtils_1 = __webpack_require__(14);
  1280. var Utils_1 = __webpack_require__(10);
  1281. var MethodDefinitionObfuscator = function (_NodeObfuscator_1$Nod) {
  1282. _inherits(MethodDefinitionObfuscator, _NodeObfuscator_1$Nod);
  1283. function MethodDefinitionObfuscator() {
  1284. var _Object$getPrototypeO;
  1285. _classCallCheck(this, MethodDefinitionObfuscator);
  1286. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  1287. args[_key] = arguments[_key];
  1288. }
  1289. var _this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(MethodDefinitionObfuscator)).call.apply(_Object$getPrototypeO, [this].concat(args)));
  1290. _this.ignoredNames = ['constructor'];
  1291. return _this;
  1292. }
  1293. _createClass(MethodDefinitionObfuscator, [{
  1294. key: 'obfuscateNode',
  1295. value: function obfuscateNode(methodDefinitionNode, parentNode) {
  1296. this.replaceMethodName(methodDefinitionNode);
  1297. }
  1298. }, {
  1299. key: 'replaceMethodName',
  1300. value: function replaceMethodName(methodDefinitionNode) {
  1301. var _this2 = this;
  1302. estraverse.replace(methodDefinitionNode.key, {
  1303. leave: function leave(node) {
  1304. if (NodeUtils_1.NodeUtils.isIdentifierNode(node) && !Utils_1.Utils.arrayContains(_this2.ignoredNames, node.name) && methodDefinitionNode.computed === false) {
  1305. methodDefinitionNode.computed = true;
  1306. node.name = _this2.replaceLiteralValueByUnicodeValue(node.name);
  1307. return;
  1308. }
  1309. return estraverse.VisitorOption.Skip;
  1310. }
  1311. });
  1312. }
  1313. }]);
  1314. return MethodDefinitionObfuscator;
  1315. }(NodeObfuscator_1.NodeObfuscator);
  1316. exports.MethodDefinitionObfuscator = MethodDefinitionObfuscator;
  1317. /***/ },
  1318. /* 27 */
  1319. /***/ function(module, exports, __webpack_require__) {
  1320. "use strict";
  1321. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
  1322. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  1323. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1324. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  1325. 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; }
  1326. var escodegen = __webpack_require__(4);
  1327. var estraverse = __webpack_require__(7);
  1328. var NodeType_1 = __webpack_require__(9);
  1329. var NodeObfuscator_1 = __webpack_require__(13);
  1330. var NodeUtils_1 = __webpack_require__(14);
  1331. var Utils_1 = __webpack_require__(10);
  1332. var ObjectExpressionObfuscator = function (_NodeObfuscator_1$Nod) {
  1333. _inherits(ObjectExpressionObfuscator, _NodeObfuscator_1$Nod);
  1334. function ObjectExpressionObfuscator() {
  1335. _classCallCheck(this, ObjectExpressionObfuscator);
  1336. return _possibleConstructorReturn(this, Object.getPrototypeOf(ObjectExpressionObfuscator).apply(this, arguments));
  1337. }
  1338. _createClass(ObjectExpressionObfuscator, [{
  1339. key: 'obfuscateNode',
  1340. value: function obfuscateNode(objectExpressionNode) {
  1341. var _this2 = this;
  1342. objectExpressionNode.properties.forEach(function (property) {
  1343. estraverse.replace(property.key, {
  1344. leave: function leave(node, parentNode) {
  1345. if (NodeUtils_1.NodeUtils.isLiteralNode(node)) {
  1346. _this2.literalNodeController(node);
  1347. return;
  1348. }
  1349. if (NodeUtils_1.NodeUtils.isIdentifierNode(node)) {
  1350. _this2.identifierNodeController(node);
  1351. }
  1352. }
  1353. });
  1354. });
  1355. }
  1356. }, {
  1357. key: 'literalNodeController',
  1358. value: function literalNodeController(node) {
  1359. switch (_typeof(node.value)) {
  1360. case 'string':
  1361. if (node['x-verbatim-property']) {
  1362. break;
  1363. }
  1364. node['x-verbatim-property'] = {
  1365. content: Utils_1.Utils.stringToUnicode(node.value),
  1366. precedence: escodegen.Precedence.Primary
  1367. };
  1368. break;
  1369. default:
  1370. break;
  1371. }
  1372. }
  1373. }, {
  1374. key: 'identifierNodeController',
  1375. value: function identifierNodeController(node) {
  1376. var nodeValue = node.name,
  1377. literalNode = {
  1378. raw: '\'' + nodeValue + '\'',
  1379. 'x-verbatim-property': {
  1380. content: Utils_1.Utils.stringToUnicode(nodeValue),
  1381. precedence: escodegen.Precedence.Primary
  1382. },
  1383. type: NodeType_1.NodeType.Literal,
  1384. value: nodeValue
  1385. };
  1386. delete node.name;
  1387. Object.assign(node, literalNode);
  1388. }
  1389. }]);
  1390. return ObjectExpressionObfuscator;
  1391. }(NodeObfuscator_1.NodeObfuscator);
  1392. exports.ObjectExpressionObfuscator = ObjectExpressionObfuscator;
  1393. /***/ },
  1394. /* 28 */
  1395. /***/ function(module, exports, __webpack_require__) {
  1396. "use strict";
  1397. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1398. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  1399. 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; }
  1400. var NodesGroup_1 = __webpack_require__(21);
  1401. var SelfDefendingUnicodeNode_1 = __webpack_require__(29);
  1402. var SelfDefendingNodesGroup = function (_NodesGroup_1$NodesGr) {
  1403. _inherits(SelfDefendingNodesGroup, _NodesGroup_1$NodesGr);
  1404. function SelfDefendingNodesGroup() {
  1405. var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
  1406. _classCallCheck(this, SelfDefendingNodesGroup);
  1407. var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(SelfDefendingNodesGroup).call(this, options));
  1408. _this.nodes.set('selfDefendingUnicodeNode', new SelfDefendingUnicodeNode_1.SelfDefendingUnicodeNode(_this.options));
  1409. return _this;
  1410. }
  1411. return SelfDefendingNodesGroup;
  1412. }(NodesGroup_1.NodesGroup);
  1413. exports.SelfDefendingNodesGroup = SelfDefendingNodesGroup;
  1414. /***/ },
  1415. /* 29 */
  1416. /***/ function(module, exports, __webpack_require__) {
  1417. "use strict";
  1418. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  1419. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1420. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  1421. 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; }
  1422. var esprima = __webpack_require__(3);
  1423. var AppendState_1 = __webpack_require__(8);
  1424. var JSFuck_1 = __webpack_require__(11);
  1425. var NoCustomNodesPreset_1 = __webpack_require__(30);
  1426. var JavaScriptObfuscator_1 = __webpack_require__(2);
  1427. var Node_1 = __webpack_require__(16);
  1428. var NodeUtils_1 = __webpack_require__(14);
  1429. var Utils_1 = __webpack_require__(10);
  1430. var SelfDefendingUnicodeNode = function (_Node_1$Node) {
  1431. _inherits(SelfDefendingUnicodeNode, _Node_1$Node);
  1432. function SelfDefendingUnicodeNode() {
  1433. var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
  1434. _classCallCheck(this, SelfDefendingUnicodeNode);
  1435. var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(SelfDefendingUnicodeNode).call(this, options));
  1436. _this.appendState = AppendState_1.AppendState.AfterObfuscation;
  1437. _this.node = _this.getNodeStructure();
  1438. return _this;
  1439. }
  1440. _createClass(SelfDefendingUnicodeNode, [{
  1441. key: "appendNode",
  1442. value: function appendNode(blockScopeNode) {
  1443. var programBodyLength = blockScopeNode.body.length,
  1444. randomIndex = 0;
  1445. if (programBodyLength > 2) {
  1446. randomIndex = Utils_1.Utils.getRandomInteger(programBodyLength / 2, programBodyLength - 1);
  1447. }
  1448. NodeUtils_1.NodeUtils.insertNodeAtIndex(blockScopeNode.body, this.getNode(), randomIndex);
  1449. }
  1450. }, {
  1451. key: "getNodeStructure",
  1452. value: function getNodeStructure() {
  1453. var node = esprima.parse(JavaScriptObfuscator_1.JavaScriptObfuscator.obfuscate("\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 ", NoCustomNodesPreset_1.NO_CUSTOM_NODES_PRESET));
  1454. NodeUtils_1.NodeUtils.addXVerbatimPropertyToLiterals(node);
  1455. return NodeUtils_1.NodeUtils.getBlockScopeNodeByIndex(node);
  1456. }
  1457. }]);
  1458. return SelfDefendingUnicodeNode;
  1459. }(Node_1.Node);
  1460. exports.SelfDefendingUnicodeNode = SelfDefendingUnicodeNode;
  1461. /***/ },
  1462. /* 30 */
  1463. /***/ function(module, exports) {
  1464. "use strict";
  1465. exports.NO_CUSTOM_NODES_PRESET = Object.freeze({
  1466. compact: true,
  1467. debugProtection: false,
  1468. debugProtectionInterval: false,
  1469. disableConsoleOutput: false,
  1470. encodeUnicodeLiterals: false,
  1471. reservedNames: [],
  1472. rotateUnicodeArray: false,
  1473. selfDefending: false,
  1474. unicodeArray: false,
  1475. unicodeArrayThreshold: 0,
  1476. wrapUnicodeArrayCalls: false
  1477. });
  1478. /***/ },
  1479. /* 31 */
  1480. /***/ function(module, exports, __webpack_require__) {
  1481. "use strict";
  1482. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1483. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  1484. 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; }
  1485. var NodesGroup_1 = __webpack_require__(21);
  1486. var UnicodeArrayCallsWrapper_1 = __webpack_require__(32);
  1487. var UnicodeArrayDecodeNode_1 = __webpack_require__(33);
  1488. var UnicodeArrayNode_1 = __webpack_require__(34);
  1489. var UnicodeArrayRotateFunctionNode_1 = __webpack_require__(35);
  1490. var Utils_1 = __webpack_require__(10);
  1491. var UnicodeArrayNodesGroup = function (_NodesGroup_1$NodesGr) {
  1492. _inherits(UnicodeArrayNodesGroup, _NodesGroup_1$NodesGr);
  1493. function UnicodeArrayNodesGroup() {
  1494. var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
  1495. _classCallCheck(this, UnicodeArrayNodesGroup);
  1496. var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(UnicodeArrayNodesGroup).call(this, options));
  1497. _this.unicodeArrayName = Utils_1.Utils.getRandomVariableName(UnicodeArrayNode_1.UnicodeArrayNode.UNICODE_ARRAY_RANDOM_LENGTH);
  1498. _this.unicodeArrayTranslatorName = Utils_1.Utils.getRandomVariableName(UnicodeArrayNode_1.UnicodeArrayNode.UNICODE_ARRAY_RANDOM_LENGTH);
  1499. _this.unicodeArrayRotateValue = _this.options['rotateUnicodeArray'] ? Utils_1.Utils.getRandomInteger(100, 500) : 0;
  1500. var unicodeArrayNode = new UnicodeArrayNode_1.UnicodeArrayNode(_this.unicodeArrayName, _this.unicodeArrayRotateValue, _this.options),
  1501. unicodeArray = unicodeArrayNode.getNodeData();
  1502. _this.nodes.set('unicodeArrayNode', unicodeArrayNode);
  1503. if (_this.options['wrapUnicodeArrayCalls']) {
  1504. _this.nodes.set('unicodeArrayCallsWrapper', new UnicodeArrayCallsWrapper_1.UnicodeArrayCallsWrapper(_this.unicodeArrayTranslatorName, _this.unicodeArrayName, unicodeArray, _this.options));
  1505. }
  1506. if (_this.options['encodeUnicodeLiterals']) {
  1507. _this.nodes.set('unicodeArrayDecodeNode', new UnicodeArrayDecodeNode_1.UnicodeArrayDecodeNode(_this.unicodeArrayName, unicodeArray, _this.options));
  1508. }
  1509. if (_this.options['rotateUnicodeArray']) {
  1510. _this.nodes.set('unicodeArrayRotateFunctionNode', new UnicodeArrayRotateFunctionNode_1.UnicodeArrayRotateFunctionNode(_this.unicodeArrayName, unicodeArray, _this.unicodeArrayRotateValue, _this.options));
  1511. }
  1512. return _this;
  1513. }
  1514. return UnicodeArrayNodesGroup;
  1515. }(NodesGroup_1.NodesGroup);
  1516. exports.UnicodeArrayNodesGroup = UnicodeArrayNodesGroup;
  1517. /***/ },
  1518. /* 32 */
  1519. /***/ function(module, exports, __webpack_require__) {
  1520. "use strict";
  1521. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  1522. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  1523. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1524. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  1525. 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; }
  1526. var esprima = __webpack_require__(3);
  1527. var AppendState_1 = __webpack_require__(8);
  1528. var Node_1 = __webpack_require__(16);
  1529. var NodeUtils_1 = __webpack_require__(14);
  1530. var Utils_1 = __webpack_require__(10);
  1531. var UnicodeArrayCallsWrapper = function (_Node_1$Node) {
  1532. _inherits(UnicodeArrayCallsWrapper, _Node_1$Node);
  1533. function UnicodeArrayCallsWrapper(unicodeArrayCallsWrapperName, unicodeArrayName, unicodeArray) {
  1534. var options = arguments.length <= 3 || arguments[3] === undefined ? {} : arguments[3];
  1535. _classCallCheck(this, UnicodeArrayCallsWrapper);
  1536. var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(UnicodeArrayCallsWrapper).call(this, options));
  1537. _this.appendState = AppendState_1.AppendState.AfterObfuscation;
  1538. _this.unicodeArrayCallsWrapperName = unicodeArrayCallsWrapperName;
  1539. _this.unicodeArrayName = unicodeArrayName;
  1540. _this.unicodeArray = unicodeArray;
  1541. _this.node = _this.getNodeStructure();
  1542. return _this;
  1543. }
  1544. _createClass(UnicodeArrayCallsWrapper, [{
  1545. key: "appendNode",
  1546. value: function appendNode(blockScopeNode) {
  1547. NodeUtils_1.NodeUtils.insertNodeAtIndex(blockScopeNode.body, this.getNode(), 1);
  1548. }
  1549. }, {
  1550. key: "getNodeIdentifier",
  1551. value: function getNodeIdentifier() {
  1552. return this.unicodeArrayCallsWrapperName;
  1553. }
  1554. }, {
  1555. key: "getNode",
  1556. value: function getNode() {
  1557. if (!this.unicodeArray.length) {
  1558. return;
  1559. }
  1560. this.updateNode();
  1561. return _get(Object.getPrototypeOf(UnicodeArrayCallsWrapper.prototype), "getNode", this).call(this);
  1562. }
  1563. }, {
  1564. key: "getNodeStructure",
  1565. value: function getNodeStructure() {
  1566. var keyName = Utils_1.Utils.getRandomVariableName(),
  1567. node = void 0;
  1568. node = esprima.parse("\n var " + this.unicodeArrayCallsWrapperName + " = function (" + keyName + ") {\n return " + this.unicodeArrayName + "[parseInt(" + keyName + ", 0x010)];\n };\n ");
  1569. NodeUtils_1.NodeUtils.addXVerbatimPropertyToLiterals(node);
  1570. return NodeUtils_1.NodeUtils.getBlockScopeNodeByIndex(node);
  1571. }
  1572. }]);
  1573. return UnicodeArrayCallsWrapper;
  1574. }(Node_1.Node);
  1575. exports.UnicodeArrayCallsWrapper = UnicodeArrayCallsWrapper;
  1576. /***/ },
  1577. /* 33 */
  1578. /***/ function(module, exports, __webpack_require__) {
  1579. "use strict";
  1580. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  1581. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  1582. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1583. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  1584. 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; }
  1585. var esprima = __webpack_require__(3);
  1586. var JavaScriptObfuscator_1 = __webpack_require__(2);
  1587. var AppendState_1 = __webpack_require__(8);
  1588. var JSFuck_1 = __webpack_require__(11);
  1589. var NoCustomNodesPreset_1 = __webpack_require__(30);
  1590. var Node_1 = __webpack_require__(16);
  1591. var NodeUtils_1 = __webpack_require__(14);
  1592. var Utils_1 = __webpack_require__(10);
  1593. var UnicodeArrayDecodeNode = function (_Node_1$Node) {
  1594. _inherits(UnicodeArrayDecodeNode, _Node_1$Node);
  1595. function UnicodeArrayDecodeNode(unicodeArrayName, unicodeArray) {
  1596. var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2];
  1597. _classCallCheck(this, UnicodeArrayDecodeNode);
  1598. var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(UnicodeArrayDecodeNode).call(this, options));
  1599. _this.appendState = AppendState_1.AppendState.AfterObfuscation;
  1600. _this.unicodeArrayName = unicodeArrayName;
  1601. _this.unicodeArray = unicodeArray;
  1602. _this.node = _this.getNodeStructure();
  1603. return _this;
  1604. }
  1605. _createClass(UnicodeArrayDecodeNode, [{
  1606. key: 'appendNode',
  1607. value: function appendNode(blockScopeNode) {
  1608. NodeUtils_1.NodeUtils.insertNodeAtIndex(blockScopeNode.body, this.getNode(), 1);
  1609. }
  1610. }, {
  1611. key: 'getNode',
  1612. value: function getNode() {
  1613. if (!this.unicodeArray.length) {
  1614. return;
  1615. }
  1616. this.updateNode();
  1617. return _get(Object.getPrototypeOf(UnicodeArrayDecodeNode.prototype), 'getNode', this).call(this);
  1618. }
  1619. }, {
  1620. key: 'getNodeStructure',
  1621. value: function getNodeStructure() {
  1622. var environmentName = Utils_1.Utils.getRandomVariableName(),
  1623. forLoopFunctionName = Utils_1.Utils.getRandomVariableName(),
  1624. indexVariableName = Utils_1.Utils.getRandomVariableName(),
  1625. tempArrayName = Utils_1.Utils.getRandomVariableName();
  1626. var code = '',
  1627. node = void 0;
  1628. if (this.options['selfDefending']) {
  1629. code = '\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 + ' && !' + this.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 ';
  1630. } else {
  1631. code = forLoopFunctionName + '();';
  1632. }
  1633. node = esprima.parse('\n (function () {\n ' + JavaScriptObfuscator_1.JavaScriptObfuscator.obfuscate('\n (function () {\n var object = [][\'filter\'][\'constructor\'](\'return this\')();\n var chars = \'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\';\n \n object.atob || (\n object.atob = function(input) {\n var str = String(input).replace(/=+$/, \'\');\n for (\n var bc = 0, bs, buffer, idx = 0, output = \'\';\n buffer = str.charAt(idx++);\n ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer,\n bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0\n ) {\n buffer = chars.indexOf(buffer);\n }\n return output;\n });\n })();\n ', NoCustomNodesPreset_1.NO_CUSTOM_NODES_PRESET) + '\n \n var ' + forLoopFunctionName + ' = function () {\n var ' + tempArrayName + ' = [];\n \n for (var ' + indexVariableName + ' in ' + this.unicodeArrayName + ') {\n ' + tempArrayName + '[' + Utils_1.Utils.stringToUnicode('push') + '](decodeURI(atob(' + this.unicodeArrayName + '[' + indexVariableName + '])));\n }\n \n ' + this.unicodeArrayName + ' = ' + tempArrayName + ';\n };\n \n ' + code + '\n })();\n ');
  1634. NodeUtils_1.NodeUtils.addXVerbatimPropertyToLiterals(node);
  1635. return NodeUtils_1.NodeUtils.getBlockScopeNodeByIndex(node);
  1636. }
  1637. }]);
  1638. return UnicodeArrayDecodeNode;
  1639. }(Node_1.Node);
  1640. exports.UnicodeArrayDecodeNode = UnicodeArrayDecodeNode;
  1641. /***/ },
  1642. /* 34 */
  1643. /***/ function(module, exports, __webpack_require__) {
  1644. "use strict";
  1645. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  1646. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  1647. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1648. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  1649. 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; }
  1650. var escodegen = __webpack_require__(4);
  1651. var AppendState_1 = __webpack_require__(8);
  1652. var NodeType_1 = __webpack_require__(9);
  1653. var Node_1 = __webpack_require__(16);
  1654. var NodeUtils_1 = __webpack_require__(14);
  1655. var Utils_1 = __webpack_require__(10);
  1656. var UnicodeArrayNode = function (_Node_1$Node) {
  1657. _inherits(UnicodeArrayNode, _Node_1$Node);
  1658. function UnicodeArrayNode(unicodeArrayName) {
  1659. var unicodeArrayRotateValue = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1];
  1660. var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2];
  1661. _classCallCheck(this, UnicodeArrayNode);
  1662. var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(UnicodeArrayNode).call(this, options));
  1663. _this.appendState = AppendState_1.AppendState.AfterObfuscation;
  1664. _this.unicodeArray = [];
  1665. _this.unicodeArrayName = unicodeArrayName;
  1666. _this.unicodeArrayRotateValue = unicodeArrayRotateValue;
  1667. _this.node = _this.getNodeStructure();
  1668. return _this;
  1669. }
  1670. _createClass(UnicodeArrayNode, [{
  1671. key: 'appendNode',
  1672. value: function appendNode(blockScopeNode) {
  1673. NodeUtils_1.NodeUtils.prependNode(blockScopeNode.body, this.getNode());
  1674. }
  1675. }, {
  1676. key: 'getNodeIdentifier',
  1677. value: function getNodeIdentifier() {
  1678. return this.unicodeArrayName;
  1679. }
  1680. }, {
  1681. key: 'getNodeData',
  1682. value: function getNodeData() {
  1683. return this.unicodeArray;
  1684. }
  1685. }, {
  1686. key: 'getNode',
  1687. value: function getNode() {
  1688. if (!this.unicodeArray.length) {
  1689. return;
  1690. }
  1691. Utils_1.Utils.arrayRotate(this.unicodeArray, this.unicodeArrayRotateValue);
  1692. this.updateNode();
  1693. return _get(Object.getPrototypeOf(UnicodeArrayNode.prototype), 'getNode', this).call(this);
  1694. }
  1695. }, {
  1696. key: 'updateNodeData',
  1697. value: function updateNodeData(data) {
  1698. this.unicodeArray.push(data);
  1699. }
  1700. }, {
  1701. key: 'getNodeStructure',
  1702. value: function getNodeStructure() {
  1703. return {
  1704. 'type': NodeType_1.NodeType.VariableDeclaration,
  1705. 'declarations': [{
  1706. 'type': NodeType_1.NodeType.VariableDeclarator,
  1707. 'id': {
  1708. 'type': NodeType_1.NodeType.Identifier,
  1709. 'name': this.unicodeArrayName
  1710. },
  1711. 'init': {
  1712. 'type': NodeType_1.NodeType.ArrayExpression,
  1713. 'elements': this.unicodeArray.map(function (value) {
  1714. return {
  1715. 'type': NodeType_1.NodeType.Literal,
  1716. 'value': value,
  1717. 'raw': '\'' + value + '\'',
  1718. 'x-verbatim-property': {
  1719. 'content': value,
  1720. precedence: escodegen.Precedence.Primary
  1721. }
  1722. };
  1723. })
  1724. }
  1725. }],
  1726. 'kind': 'var'
  1727. };
  1728. }
  1729. }]);
  1730. return UnicodeArrayNode;
  1731. }(Node_1.Node);
  1732. UnicodeArrayNode.UNICODE_ARRAY_RANDOM_LENGTH = 4;
  1733. exports.UnicodeArrayNode = UnicodeArrayNode;
  1734. /***/ },
  1735. /* 35 */
  1736. /***/ function(module, exports, __webpack_require__) {
  1737. "use strict";
  1738. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  1739. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  1740. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1741. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  1742. 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; }
  1743. var esprima = __webpack_require__(3);
  1744. var AppendState_1 = __webpack_require__(8);
  1745. var JSFuck_1 = __webpack_require__(11);
  1746. var NoCustomNodesPreset_1 = __webpack_require__(30);
  1747. var JavaScriptObfuscator_1 = __webpack_require__(2);
  1748. var Node_1 = __webpack_require__(16);
  1749. var NodeUtils_1 = __webpack_require__(14);
  1750. var Utils_1 = __webpack_require__(10);
  1751. var UnicodeArrayRotateFunctionNode = function (_Node_1$Node) {
  1752. _inherits(UnicodeArrayRotateFunctionNode, _Node_1$Node);
  1753. function UnicodeArrayRotateFunctionNode(unicodeArrayName, unicodeArray, unicodeArrayRotateValue) {
  1754. var options = arguments.length <= 3 || arguments[3] === undefined ? {} : arguments[3];
  1755. _classCallCheck(this, UnicodeArrayRotateFunctionNode);
  1756. var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(UnicodeArrayRotateFunctionNode).call(this, options));
  1757. _this.appendState = AppendState_1.AppendState.AfterObfuscation;
  1758. _this.unicodeArrayName = unicodeArrayName;
  1759. _this.unicodeArray = unicodeArray;
  1760. _this.unicodeArrayRotateValue = unicodeArrayRotateValue;
  1761. _this.node = _this.getNodeStructure();
  1762. return _this;
  1763. }
  1764. _createClass(UnicodeArrayRotateFunctionNode, [{
  1765. key: "appendNode",
  1766. value: function appendNode(blockScopeNode) {
  1767. NodeUtils_1.NodeUtils.insertNodeAtIndex(blockScopeNode.body, this.getNode(), 1);
  1768. }
  1769. }, {
  1770. key: "getNode",
  1771. value: function getNode() {
  1772. if (!this.unicodeArray.length) {
  1773. return;
  1774. }
  1775. return _get(Object.getPrototypeOf(UnicodeArrayRotateFunctionNode.prototype), "getNode", this).call(this);
  1776. }
  1777. }, {
  1778. key: "getNodeStructure",
  1779. value: function getNodeStructure() {
  1780. var arrayName = Utils_1.Utils.getRandomVariableName(),
  1781. code = '',
  1782. timesName = Utils_1.Utils.getRandomVariableName(),
  1783. timesArgumentName = Utils_1.Utils.getRandomVariableName(),
  1784. whileFunctionName = Utils_1.Utils.getRandomVariableName(),
  1785. node = void 0;
  1786. if (this.options['selfDefending']) {
  1787. code = JavaScriptObfuscator_1.JavaScriptObfuscator.obfuscate("\n (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 })();\n ", NoCustomNodesPreset_1.NO_CUSTOM_NODES_PRESET);
  1788. } else {
  1789. code = whileFunctionName + "(++" + timesName + ")";
  1790. }
  1791. node = esprima.parse("\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 })(" + this.unicodeArrayName + ", 0x" + Utils_1.Utils.decToHex(this.unicodeArrayRotateValue) + ");\n ");
  1792. NodeUtils_1.NodeUtils.addXVerbatimPropertyToLiterals(node);
  1793. return NodeUtils_1.NodeUtils.getBlockScopeNodeByIndex(node);
  1794. }
  1795. }]);
  1796. return UnicodeArrayRotateFunctionNode;
  1797. }(Node_1.Node);
  1798. exports.UnicodeArrayRotateFunctionNode = UnicodeArrayRotateFunctionNode;
  1799. /***/ },
  1800. /* 36 */
  1801. /***/ function(module, exports, __webpack_require__) {
  1802. "use strict";
  1803. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  1804. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1805. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  1806. 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; }
  1807. var estraverse = __webpack_require__(7);
  1808. var NodeType_1 = __webpack_require__(9);
  1809. var NodeObfuscator_1 = __webpack_require__(13);
  1810. var NodeUtils_1 = __webpack_require__(14);
  1811. var Utils_1 = __webpack_require__(10);
  1812. var VariableDeclarationObfuscator = function (_NodeObfuscator_1$Nod) {
  1813. _inherits(VariableDeclarationObfuscator, _NodeObfuscator_1$Nod);
  1814. function VariableDeclarationObfuscator() {
  1815. var _Object$getPrototypeO;
  1816. _classCallCheck(this, VariableDeclarationObfuscator);
  1817. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  1818. args[_key] = arguments[_key];
  1819. }
  1820. var _this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(VariableDeclarationObfuscator)).call.apply(_Object$getPrototypeO, [this].concat(args)));
  1821. _this.variableNames = new Map();
  1822. return _this;
  1823. }
  1824. _createClass(VariableDeclarationObfuscator, [{
  1825. key: "obfuscateNode",
  1826. value: function obfuscateNode(variableDeclarationNode, parentNode) {
  1827. if (parentNode.type === NodeType_1.NodeType.Program) {
  1828. return;
  1829. }
  1830. this.replaceVariableName(variableDeclarationNode);
  1831. this.replaceVariableCalls(variableDeclarationNode, parentNode);
  1832. }
  1833. }, {
  1834. key: "replaceVariableName",
  1835. value: function replaceVariableName(variableDeclarationNode) {
  1836. var _this2 = this;
  1837. variableDeclarationNode.declarations.forEach(function (declarationNode) {
  1838. estraverse.replace(declarationNode.id, {
  1839. enter: function enter(node) {
  1840. if (NodeUtils_1.NodeUtils.isIdentifierNode(node) && !_this2.isReservedName(node.name)) {
  1841. _this2.variableNames.set(node.name, Utils_1.Utils.getRandomVariableName());
  1842. node.name = _this2.variableNames.get(node.name);
  1843. return;
  1844. }
  1845. return estraverse.VisitorOption.Skip;
  1846. }
  1847. });
  1848. });
  1849. }
  1850. }, {
  1851. key: "replaceVariableCalls",
  1852. value: function replaceVariableCalls(variableDeclarationNode, variableParentNode) {
  1853. var _this3 = this;
  1854. var scopeNode = void 0;
  1855. scopeNode = variableDeclarationNode.kind === 'var' ? NodeUtils_1.NodeUtils.getBlockScopeOfNode(variableDeclarationNode) : variableParentNode;
  1856. var isNodeAfterVariableDeclaratorFlag = false;
  1857. estraverse.replace(scopeNode, {
  1858. enter: function enter(node, parentNode) {
  1859. var functionNodes = [NodeType_1.NodeType.ArrowFunctionExpression, NodeType_1.NodeType.FunctionDeclaration, NodeType_1.NodeType.FunctionExpression];
  1860. if (Utils_1.Utils.arrayContains(functionNodes, node.type)) {
  1861. estraverse.replace(node, {
  1862. enter: function enter(node, parentNode) {
  1863. _this3.replaceNodeIdentifierByNewValue(node, parentNode, _this3.variableNames);
  1864. }
  1865. });
  1866. }
  1867. if (node === variableDeclarationNode) {
  1868. isNodeAfterVariableDeclaratorFlag = true;
  1869. }
  1870. if (isNodeAfterVariableDeclaratorFlag) {
  1871. _this3.replaceNodeIdentifierByNewValue(node, parentNode, _this3.variableNames);
  1872. }
  1873. }
  1874. });
  1875. }
  1876. }]);
  1877. return VariableDeclarationObfuscator;
  1878. }(NodeObfuscator_1.NodeObfuscator);
  1879. exports.VariableDeclarationObfuscator = VariableDeclarationObfuscator;
  1880. /***/ },
  1881. /* 37 */
  1882. /***/ function(module, exports) {
  1883. "use strict";
  1884. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  1885. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1886. var OptionsNormalizer = function () {
  1887. function OptionsNormalizer() {
  1888. _classCallCheck(this, OptionsNormalizer);
  1889. }
  1890. _createClass(OptionsNormalizer, null, [{
  1891. key: 'normalize',
  1892. value: function normalize(options) {
  1893. var normalizedOptions = Object.assign({}, options);
  1894. normalizedOptions = OptionsNormalizer.unicodeArrayRule(normalizedOptions);
  1895. normalizedOptions = OptionsNormalizer.unicodeArrayThresholdRule(normalizedOptions);
  1896. normalizedOptions = OptionsNormalizer.selfDefendingRule(normalizedOptions);
  1897. return normalizedOptions;
  1898. }
  1899. }, {
  1900. key: 'selfDefendingRule',
  1901. value: function selfDefendingRule(options) {
  1902. if (options['selfDefending']) {
  1903. Object.assign(options, OptionsNormalizer.SELF_DEFENDING_OPTIONS);
  1904. }
  1905. return options;
  1906. }
  1907. }, {
  1908. key: 'unicodeArrayRule',
  1909. value: function unicodeArrayRule(options) {
  1910. if (!options['unicodeArray']) {
  1911. Object.assign(options, OptionsNormalizer.DISABLED_UNICODE_ARRAY_OPTIONS);
  1912. }
  1913. return options;
  1914. }
  1915. }, {
  1916. key: 'unicodeArrayThresholdRule',
  1917. value: function unicodeArrayThresholdRule(options) {
  1918. var minValue = 0,
  1919. maxValue = 1;
  1920. options['unicodeArrayThreshold'] = Math.min(Math.max(options['unicodeArrayThreshold'], minValue), maxValue);
  1921. return options;
  1922. }
  1923. }]);
  1924. return OptionsNormalizer;
  1925. }();
  1926. OptionsNormalizer.DISABLED_UNICODE_ARRAY_OPTIONS = {
  1927. encodeUnicodeLiterals: false,
  1928. rotateUnicodeArray: false,
  1929. unicodeArray: false,
  1930. unicodeArrayThreshold: 0,
  1931. wrapUnicodeArrayCalls: false
  1932. };
  1933. OptionsNormalizer.SELF_DEFENDING_OPTIONS = {
  1934. compact: true,
  1935. selfDefending: true
  1936. };
  1937. exports.OptionsNormalizer = OptionsNormalizer;
  1938. /***/ }
  1939. /******/ ]);