index.js 119 KB

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