index.js 121 KB

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