index.js 119 KB

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