index.js 118 KB

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