index.js 120 KB

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