index.js 122 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461
  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 = 15);
  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.getOption('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.getOption('unicodeArrayThreshold');
  435. if (this.options.getOption('encodeUnicodeLiterals') && replaceByUnicodeArrayFlag) {
  436. value = Utils_1.Utils.btoa(value);
  437. }
  438. value = Utils_1.Utils.stringToUnicode(value);
  439. if (!this.options.getOption('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.getOption('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 Kernel_1 = __webpack_require__(16);
  556. var esprima = __webpack_require__(7);
  557. var escodegen = __webpack_require__(9);
  558. var JavaScriptObfuscator = function () {
  559. function JavaScriptObfuscator() {
  560. _classCallCheck(this, JavaScriptObfuscator);
  561. }
  562. _createClass(JavaScriptObfuscator, null, [{
  563. key: "obfuscate",
  564. value: function obfuscate(sourceCode, customOptions) {
  565. var astTree = esprima.parse(sourceCode),
  566. options = Kernel_1.default.get('IOptions'),
  567. obfuscator = Kernel_1.default.get('IObfuscator');
  568. options.assign(customOptions);
  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.getOption('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("inversify");
  632. /***/ },
  633. /* 14 */
  634. /***/ function(module, exports) {
  635. module.exports = require("babel-polyfill");
  636. /***/ },
  637. /* 15 */
  638. /***/ function(module, exports, __webpack_require__) {
  639. "use strict";
  640. "use strict";
  641. __webpack_require__(14);
  642. var JavaScriptObfuscator_1 = __webpack_require__(10);
  643. module.exports = JavaScriptObfuscator_1.JavaScriptObfuscator;
  644. /***/ },
  645. /* 16 */
  646. /***/ function(module, exports, __webpack_require__) {
  647. "use strict";
  648. "use strict";
  649. var inversify_1 = __webpack_require__(13);
  650. var Obfuscator_1 = __webpack_require__(17);
  651. var Options_1 = __webpack_require__(18);
  652. var kernel = new inversify_1.Kernel();
  653. kernel.bind('IOptions').to(Options_1.Options).inSingletonScope();
  654. kernel.bind('IObfuscator').to(Obfuscator_1.Obfuscator);
  655. Object.defineProperty(exports, "__esModule", { value: true });
  656. exports.default = kernel;
  657. /***/ },
  658. /* 17 */
  659. /***/ function(module, exports, __webpack_require__) {
  660. "use strict";
  661. "use strict";
  662. 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; }; }();
  663. 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; };
  664. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  665. var __decorate = undefined && undefined.__decorate || function (decorators, target, key, desc) {
  666. var c = arguments.length,
  667. r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
  668. d;
  669. if ((typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) {
  670. if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  671. }return c > 3 && r && Object.defineProperty(target, key, r), r;
  672. };
  673. var __metadata = undefined && undefined.__metadata || function (k, v) {
  674. if ((typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
  675. };
  676. var __param = undefined && undefined.__param || function (paramIndex, decorator) {
  677. return function (target, key) {
  678. decorator(target, key, paramIndex);
  679. };
  680. };
  681. var inversify_1 = __webpack_require__(13);
  682. var estraverse = __webpack_require__(4);
  683. var AppendState_1 = __webpack_require__(6);
  684. var NodeType_1 = __webpack_require__(3);
  685. var CatchClauseObfuscator_1 = __webpack_require__(31);
  686. var ConsoleOutputDisableExpressionNode_1 = __webpack_require__(19);
  687. var DebugProtectionNodesGroup_1 = __webpack_require__(28);
  688. var FunctionDeclarationObfuscator_1 = __webpack_require__(32);
  689. var FunctionObfuscator_1 = __webpack_require__(33);
  690. var LiteralObfuscator_1 = __webpack_require__(34);
  691. var MemberExpressionObfuscator_1 = __webpack_require__(35);
  692. var MethodDefinitionObfuscator_1 = __webpack_require__(36);
  693. var NodeUtils_1 = __webpack_require__(0);
  694. var ObjectExpressionObfuscator_1 = __webpack_require__(37);
  695. var SelfDefendingNodesGroup_1 = __webpack_require__(29);
  696. var UnicodeArrayNodesGroup_1 = __webpack_require__(30);
  697. var VariableDeclarationObfuscator_1 = __webpack_require__(38);
  698. var Obfuscator = function () {
  699. function Obfuscator(options) {
  700. _classCallCheck(this, Obfuscator);
  701. this.nodes = new Map();
  702. 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]]]);
  703. this.options = options;
  704. }
  705. _createClass(Obfuscator, [{
  706. key: "obfuscateNode",
  707. value: function obfuscateNode(node) {
  708. this.setNewNodes();
  709. NodeUtils_1.NodeUtils.parentize(node);
  710. this.beforeObfuscation(node);
  711. this.obfuscate(node);
  712. this.afterObfuscation(node);
  713. return node;
  714. }
  715. }, {
  716. key: "setNode",
  717. value: function setNode(nodeName, node) {
  718. this.nodes.set(nodeName, node);
  719. }
  720. }, {
  721. key: "setNodesGroup",
  722. value: function setNodesGroup(nodesGroup) {
  723. var _this = this;
  724. var nodes = nodesGroup.getNodes();
  725. nodes.forEach(function (node, key) {
  726. _this.nodes.set(key, node);
  727. });
  728. }
  729. }, {
  730. key: "afterObfuscation",
  731. value: function afterObfuscation(astTree) {
  732. this.nodes.forEach(function (node) {
  733. if (node.getAppendState() === AppendState_1.AppendState.AfterObfuscation) {
  734. node.appendNode(astTree);
  735. }
  736. });
  737. }
  738. }, {
  739. key: "beforeObfuscation",
  740. value: function beforeObfuscation(astTree) {
  741. this.nodes.forEach(function (node) {
  742. if (node.getAppendState() === AppendState_1.AppendState.BeforeObfuscation) {
  743. node.appendNode(astTree);
  744. }
  745. });
  746. }
  747. }, {
  748. key: "initializeNodeObfuscators",
  749. value: function initializeNodeObfuscators(node, parentNode) {
  750. var _this2 = this;
  751. if (!this.nodeObfuscators.has(node.type)) {
  752. return;
  753. }
  754. this.nodeObfuscators.get(node.type).forEach(function (obfuscator) {
  755. new obfuscator(_this2.nodes, _this2.options).obfuscateNode(node, parentNode);
  756. });
  757. }
  758. }, {
  759. key: "obfuscate",
  760. value: function obfuscate(node) {
  761. var _this3 = this;
  762. estraverse.replace(node, {
  763. leave: function leave(node, parentNode) {
  764. _this3.initializeNodeObfuscators(node, parentNode);
  765. }
  766. });
  767. }
  768. }, {
  769. key: "setNewNodes",
  770. value: function setNewNodes() {
  771. if (this.options.getOption('selfDefending')) {
  772. this.setNodesGroup(new SelfDefendingNodesGroup_1.SelfDefendingNodesGroup(this.options));
  773. }
  774. if (this.options.getOption('disableConsoleOutput')) {
  775. this.setNode('consoleOutputDisableExpressionNode', new ConsoleOutputDisableExpressionNode_1.ConsoleOutputDisableExpressionNode(this.options));
  776. }
  777. if (this.options.getOption('debugProtection')) {
  778. this.setNodesGroup(new DebugProtectionNodesGroup_1.DebugProtectionNodesGroup(this.options));
  779. }
  780. if (this.options.getOption('unicodeArray')) {
  781. this.setNodesGroup(new UnicodeArrayNodesGroup_1.UnicodeArrayNodesGroup(this.options));
  782. }
  783. }
  784. }]);
  785. return Obfuscator;
  786. }();
  787. Obfuscator = __decorate([inversify_1.injectable(), __param(0, inversify_1.inject('IOptions')), __metadata('design:paramtypes', [Object])], Obfuscator);
  788. exports.Obfuscator = Obfuscator;
  789. /***/ },
  790. /* 18 */
  791. /***/ function(module, exports, __webpack_require__) {
  792. "use strict";
  793. "use strict";
  794. 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; }; }();
  795. 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; };
  796. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  797. var __decorate = undefined && undefined.__decorate || function (decorators, target, key, desc) {
  798. var c = arguments.length,
  799. r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
  800. d;
  801. if ((typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) {
  802. if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  803. }return c > 3 && r && Object.defineProperty(target, key, r), r;
  804. };
  805. var __metadata = undefined && undefined.__metadata || function (k, v) {
  806. if ((typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
  807. };
  808. var inversify_1 = __webpack_require__(13);
  809. var DefaultPreset_1 = __webpack_require__(39);
  810. var Options_1 = void 0;
  811. var Options = Options_1 = function () {
  812. function Options() {
  813. _classCallCheck(this, Options);
  814. }
  815. _createClass(Options, [{
  816. key: "assign",
  817. value: function assign(options) {
  818. if (this.options) {
  819. throw new Error('Options object can\'t be reassigned!');
  820. }
  821. this.options = Object.assign({}, DefaultPreset_1.DEFAULT_PRESET, options);
  822. this.normalizeOptions();
  823. }
  824. }, {
  825. key: "getOption",
  826. value: function getOption(optionName) {
  827. return this.options[optionName];
  828. }
  829. }, {
  830. key: "getOptions",
  831. value: function getOptions() {
  832. return this.options;
  833. }
  834. }, {
  835. key: "normalizeOptions",
  836. value: function normalizeOptions() {
  837. var normalizedOptions = Object.assign({}, this.options);
  838. normalizedOptions = Options_1.unicodeArrayRule(normalizedOptions);
  839. normalizedOptions = Options_1.unicodeArrayThresholdRule(normalizedOptions);
  840. normalizedOptions = Options_1.selfDefendingRule(normalizedOptions);
  841. this.options = Object.freeze(normalizedOptions);
  842. }
  843. }], [{
  844. key: "selfDefendingRule",
  845. value: function selfDefendingRule(options) {
  846. if (options['selfDefending']) {
  847. Object.assign(options, Options_1.SELF_DEFENDING_OPTIONS);
  848. }
  849. return options;
  850. }
  851. }, {
  852. key: "unicodeArrayRule",
  853. value: function unicodeArrayRule(options) {
  854. if (!options['unicodeArray']) {
  855. Object.assign(options, Options_1.DISABLED_UNICODE_ARRAY_OPTIONS);
  856. }
  857. return options;
  858. }
  859. }, {
  860. key: "unicodeArrayThresholdRule",
  861. value: function unicodeArrayThresholdRule(options) {
  862. var minValue = 0,
  863. maxValue = 1;
  864. options['unicodeArrayThreshold'] = Math.min(Math.max(options['unicodeArrayThreshold'], minValue), maxValue);
  865. return options;
  866. }
  867. }]);
  868. return Options;
  869. }();
  870. Options.DISABLED_UNICODE_ARRAY_OPTIONS = {
  871. encodeUnicodeLiterals: false,
  872. rotateUnicodeArray: false,
  873. unicodeArray: false,
  874. unicodeArrayThreshold: 0,
  875. wrapUnicodeArrayCalls: false
  876. };
  877. Options.SELF_DEFENDING_OPTIONS = {
  878. compact: true,
  879. selfDefending: true
  880. };
  881. Options = Options_1 = __decorate([inversify_1.injectable(), __metadata('design:paramtypes', [])], Options);
  882. exports.Options = Options;
  883. /***/ },
  884. /* 19 */
  885. /***/ function(module, exports, __webpack_require__) {
  886. "use strict";
  887. "use strict";
  888. 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; }; }();
  889. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  890. 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; }
  891. 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; }
  892. var esprima = __webpack_require__(7);
  893. var Node_1 = __webpack_require__(2);
  894. var NodeUtils_1 = __webpack_require__(0);
  895. var ConsoleOutputDisableExpressionNode = function (_Node_1$Node) {
  896. _inherits(ConsoleOutputDisableExpressionNode, _Node_1$Node);
  897. function ConsoleOutputDisableExpressionNode(options) {
  898. _classCallCheck(this, ConsoleOutputDisableExpressionNode);
  899. var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(ConsoleOutputDisableExpressionNode).call(this, options));
  900. _this.node = _this.getNodeStructure();
  901. return _this;
  902. }
  903. _createClass(ConsoleOutputDisableExpressionNode, [{
  904. key: 'appendNode',
  905. value: function appendNode(blockScopeNode) {
  906. NodeUtils_1.NodeUtils.prependNode(blockScopeNode.body, this.getNode());
  907. }
  908. }, {
  909. key: 'getNodeStructure',
  910. value: function getNodeStructure() {
  911. 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 '));
  912. }
  913. }]);
  914. return ConsoleOutputDisableExpressionNode;
  915. }(Node_1.Node);
  916. exports.ConsoleOutputDisableExpressionNode = ConsoleOutputDisableExpressionNode;
  917. /***/ },
  918. /* 20 */
  919. /***/ function(module, exports, __webpack_require__) {
  920. "use strict";
  921. "use strict";
  922. 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; }; }();
  923. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  924. 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; }
  925. 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; }
  926. var NodeType_1 = __webpack_require__(3);
  927. var Node_1 = __webpack_require__(2);
  928. var NodeUtils_1 = __webpack_require__(0);
  929. var DebugProtectionFunctionCallNode = function (_Node_1$Node) {
  930. _inherits(DebugProtectionFunctionCallNode, _Node_1$Node);
  931. function DebugProtectionFunctionCallNode(debugProtectionFunctionName, options) {
  932. _classCallCheck(this, DebugProtectionFunctionCallNode);
  933. var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(DebugProtectionFunctionCallNode).call(this, options));
  934. _this.debugProtectionFunctionName = debugProtectionFunctionName;
  935. _this.node = _this.getNodeStructure();
  936. return _this;
  937. }
  938. _createClass(DebugProtectionFunctionCallNode, [{
  939. key: "appendNode",
  940. value: function appendNode(blockScopeNode) {
  941. NodeUtils_1.NodeUtils.appendNode(blockScopeNode.body, this.getNode());
  942. }
  943. }, {
  944. key: "getNodeStructure",
  945. value: function getNodeStructure() {
  946. return {
  947. 'type': NodeType_1.NodeType.ExpressionStatement,
  948. 'expression': {
  949. 'type': NodeType_1.NodeType.CallExpression,
  950. 'callee': {
  951. 'type': NodeType_1.NodeType.Identifier,
  952. 'name': this.debugProtectionFunctionName
  953. },
  954. 'arguments': []
  955. }
  956. };
  957. }
  958. }]);
  959. return DebugProtectionFunctionCallNode;
  960. }(Node_1.Node);
  961. exports.DebugProtectionFunctionCallNode = DebugProtectionFunctionCallNode;
  962. /***/ },
  963. /* 21 */
  964. /***/ function(module, exports, __webpack_require__) {
  965. "use strict";
  966. "use strict";
  967. 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; }; }();
  968. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  969. 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; }
  970. 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; }
  971. var NodeType_1 = __webpack_require__(3);
  972. var Node_1 = __webpack_require__(2);
  973. var NodeUtils_1 = __webpack_require__(0);
  974. var DebugProtectionFunctionIntervalNode = function (_Node_1$Node) {
  975. _inherits(DebugProtectionFunctionIntervalNode, _Node_1$Node);
  976. function DebugProtectionFunctionIntervalNode(debugProtectionFunctionName, options) {
  977. _classCallCheck(this, DebugProtectionFunctionIntervalNode);
  978. var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(DebugProtectionFunctionIntervalNode).call(this, options));
  979. _this.debugProtectionFunctionName = debugProtectionFunctionName;
  980. _this.node = _this.getNodeStructure();
  981. return _this;
  982. }
  983. _createClass(DebugProtectionFunctionIntervalNode, [{
  984. key: 'appendNode',
  985. value: function appendNode(blockScopeNode) {
  986. NodeUtils_1.NodeUtils.appendNode(blockScopeNode.body, this.getNode());
  987. }
  988. }, {
  989. key: 'getNodeStructure',
  990. value: function getNodeStructure() {
  991. return {
  992. 'type': NodeType_1.NodeType.ExpressionStatement,
  993. 'expression': {
  994. 'type': NodeType_1.NodeType.CallExpression,
  995. 'callee': {
  996. 'type': NodeType_1.NodeType.Identifier,
  997. 'name': 'setInterval'
  998. },
  999. 'arguments': [{
  1000. 'type': NodeType_1.NodeType.FunctionExpression,
  1001. 'id': null,
  1002. 'params': [],
  1003. 'defaults': [],
  1004. 'body': {
  1005. 'type': NodeType_1.NodeType.BlockStatement,
  1006. 'body': [{
  1007. 'type': NodeType_1.NodeType.ExpressionStatement,
  1008. 'expression': {
  1009. 'type': NodeType_1.NodeType.CallExpression,
  1010. 'callee': {
  1011. 'type': NodeType_1.NodeType.Identifier,
  1012. 'name': this.debugProtectionFunctionName
  1013. },
  1014. 'arguments': []
  1015. }
  1016. }]
  1017. },
  1018. 'generator': false,
  1019. 'expression': false
  1020. }, {
  1021. 'type': NodeType_1.NodeType.Literal,
  1022. 'value': 4000,
  1023. 'raw': '4000'
  1024. }]
  1025. }
  1026. };
  1027. }
  1028. }]);
  1029. return DebugProtectionFunctionIntervalNode;
  1030. }(Node_1.Node);
  1031. exports.DebugProtectionFunctionIntervalNode = DebugProtectionFunctionIntervalNode;
  1032. /***/ },
  1033. /* 22 */
  1034. /***/ function(module, exports, __webpack_require__) {
  1035. "use strict";
  1036. "use strict";
  1037. 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; }; }();
  1038. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1039. 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; }
  1040. 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; }
  1041. var esprima = __webpack_require__(7);
  1042. var Node_1 = __webpack_require__(2);
  1043. var NodeUtils_1 = __webpack_require__(0);
  1044. var Utils_1 = __webpack_require__(1);
  1045. var DebugProtectionFunctionNode = function (_Node_1$Node) {
  1046. _inherits(DebugProtectionFunctionNode, _Node_1$Node);
  1047. function DebugProtectionFunctionNode(debugProtectionFunctionName, options) {
  1048. _classCallCheck(this, DebugProtectionFunctionNode);
  1049. var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(DebugProtectionFunctionNode).call(this, options));
  1050. _this.debugProtectionFunctionName = debugProtectionFunctionName;
  1051. _this.node = _this.getNodeStructure();
  1052. return _this;
  1053. }
  1054. _createClass(DebugProtectionFunctionNode, [{
  1055. key: 'appendNode',
  1056. value: function appendNode(blockScopeNode) {
  1057. var programBodyLength = blockScopeNode.body.length,
  1058. randomIndex = Utils_1.Utils.getRandomInteger(0, programBodyLength);
  1059. NodeUtils_1.NodeUtils.insertNodeAtIndex(blockScopeNode.body, this.getNode(), randomIndex);
  1060. }
  1061. }, {
  1062. key: 'getNodeIdentifier',
  1063. value: function getNodeIdentifier() {
  1064. return this.debugProtectionFunctionName;
  1065. }
  1066. }, {
  1067. key: 'getNodeStructure',
  1068. value: function getNodeStructure() {
  1069. 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 '));
  1070. }
  1071. }]);
  1072. return DebugProtectionFunctionNode;
  1073. }(Node_1.Node);
  1074. exports.DebugProtectionFunctionNode = DebugProtectionFunctionNode;
  1075. /***/ },
  1076. /* 23 */
  1077. /***/ function(module, exports, __webpack_require__) {
  1078. "use strict";
  1079. "use strict";
  1080. 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; }; }();
  1081. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1082. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  1083. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  1084. var esprima = __webpack_require__(7);
  1085. var AppendState_1 = __webpack_require__(6);
  1086. var JSFuck_1 = __webpack_require__(8);
  1087. var NoCustomNodesPreset_1 = __webpack_require__(12);
  1088. var JavaScriptObfuscator_1 = __webpack_require__(10);
  1089. var Node_1 = __webpack_require__(2);
  1090. var NodeUtils_1 = __webpack_require__(0);
  1091. var Utils_1 = __webpack_require__(1);
  1092. var SelfDefendingUnicodeNode = function (_Node_1$Node) {
  1093. _inherits(SelfDefendingUnicodeNode, _Node_1$Node);
  1094. function SelfDefendingUnicodeNode(options) {
  1095. _classCallCheck(this, SelfDefendingUnicodeNode);
  1096. var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(SelfDefendingUnicodeNode).call(this, options));
  1097. _this.appendState = AppendState_1.AppendState.AfterObfuscation;
  1098. _this.node = _this.getNodeStructure();
  1099. return _this;
  1100. }
  1101. _createClass(SelfDefendingUnicodeNode, [{
  1102. key: "appendNode",
  1103. value: function appendNode(blockScopeNode) {
  1104. var programBodyLength = blockScopeNode.body.length,
  1105. randomIndex = 0;
  1106. if (programBodyLength > 2) {
  1107. randomIndex = Utils_1.Utils.getRandomInteger(programBodyLength / 2, programBodyLength - 1);
  1108. }
  1109. NodeUtils_1.NodeUtils.insertNodeAtIndex(blockScopeNode.body, this.getNode(), randomIndex);
  1110. }
  1111. }, {
  1112. key: "getNodeStructure",
  1113. value: function getNodeStructure() {
  1114. 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));
  1115. NodeUtils_1.NodeUtils.addXVerbatimPropertyToLiterals(node);
  1116. return NodeUtils_1.NodeUtils.getBlockScopeNodeByIndex(node);
  1117. }
  1118. }]);
  1119. return SelfDefendingUnicodeNode;
  1120. }(Node_1.Node);
  1121. exports.SelfDefendingUnicodeNode = SelfDefendingUnicodeNode;
  1122. /***/ },
  1123. /* 24 */
  1124. /***/ function(module, exports, __webpack_require__) {
  1125. "use strict";
  1126. "use strict";
  1127. 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; }; }();
  1128. 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); } };
  1129. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1130. 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; }
  1131. 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; }
  1132. var esprima = __webpack_require__(7);
  1133. var AppendState_1 = __webpack_require__(6);
  1134. var Node_1 = __webpack_require__(2);
  1135. var NodeUtils_1 = __webpack_require__(0);
  1136. var Utils_1 = __webpack_require__(1);
  1137. var UnicodeArrayCallsWrapper = function (_Node_1$Node) {
  1138. _inherits(UnicodeArrayCallsWrapper, _Node_1$Node);
  1139. function UnicodeArrayCallsWrapper(unicodeArrayCallsWrapperName, unicodeArrayName, unicodeArray, options) {
  1140. _classCallCheck(this, UnicodeArrayCallsWrapper);
  1141. var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(UnicodeArrayCallsWrapper).call(this, options));
  1142. _this.appendState = AppendState_1.AppendState.AfterObfuscation;
  1143. _this.unicodeArrayCallsWrapperName = unicodeArrayCallsWrapperName;
  1144. _this.unicodeArrayName = unicodeArrayName;
  1145. _this.unicodeArray = unicodeArray;
  1146. _this.node = _this.getNodeStructure();
  1147. return _this;
  1148. }
  1149. _createClass(UnicodeArrayCallsWrapper, [{
  1150. key: "appendNode",
  1151. value: function appendNode(blockScopeNode) {
  1152. NodeUtils_1.NodeUtils.insertNodeAtIndex(blockScopeNode.body, this.getNode(), 1);
  1153. }
  1154. }, {
  1155. key: "getNodeIdentifier",
  1156. value: function getNodeIdentifier() {
  1157. return this.unicodeArrayCallsWrapperName;
  1158. }
  1159. }, {
  1160. key: "getNode",
  1161. value: function getNode() {
  1162. if (!this.unicodeArray.length) {
  1163. return;
  1164. }
  1165. this.updateNode();
  1166. return _get(Object.getPrototypeOf(UnicodeArrayCallsWrapper.prototype), "getNode", this).call(this);
  1167. }
  1168. }, {
  1169. key: "getNodeStructure",
  1170. value: function getNodeStructure() {
  1171. var keyName = Utils_1.Utils.getRandomVariableName(),
  1172. node = void 0;
  1173. node = esprima.parse("\n var " + this.unicodeArrayCallsWrapperName + " = function (" + keyName + ") {\n return " + this.unicodeArrayName + "[parseInt(" + keyName + ", 0x010)];\n };\n ");
  1174. NodeUtils_1.NodeUtils.addXVerbatimPropertyToLiterals(node);
  1175. return NodeUtils_1.NodeUtils.getBlockScopeNodeByIndex(node);
  1176. }
  1177. }]);
  1178. return UnicodeArrayCallsWrapper;
  1179. }(Node_1.Node);
  1180. exports.UnicodeArrayCallsWrapper = UnicodeArrayCallsWrapper;
  1181. /***/ },
  1182. /* 25 */
  1183. /***/ function(module, exports, __webpack_require__) {
  1184. "use strict";
  1185. "use strict";
  1186. 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; }; }();
  1187. 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); } };
  1188. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1189. 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; }
  1190. 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; }
  1191. var esprima = __webpack_require__(7);
  1192. var JavaScriptObfuscator_1 = __webpack_require__(10);
  1193. var AppendState_1 = __webpack_require__(6);
  1194. var JSFuck_1 = __webpack_require__(8);
  1195. var NoCustomNodesPreset_1 = __webpack_require__(12);
  1196. var Node_1 = __webpack_require__(2);
  1197. var NodeUtils_1 = __webpack_require__(0);
  1198. var Utils_1 = __webpack_require__(1);
  1199. var UnicodeArrayDecodeNode = function (_Node_1$Node) {
  1200. _inherits(UnicodeArrayDecodeNode, _Node_1$Node);
  1201. function UnicodeArrayDecodeNode(unicodeArrayName, unicodeArray, options) {
  1202. _classCallCheck(this, UnicodeArrayDecodeNode);
  1203. var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(UnicodeArrayDecodeNode).call(this, options));
  1204. _this.appendState = AppendState_1.AppendState.AfterObfuscation;
  1205. _this.unicodeArrayName = unicodeArrayName;
  1206. _this.unicodeArray = unicodeArray;
  1207. _this.node = _this.getNodeStructure();
  1208. return _this;
  1209. }
  1210. _createClass(UnicodeArrayDecodeNode, [{
  1211. key: 'appendNode',
  1212. value: function appendNode(blockScopeNode) {
  1213. NodeUtils_1.NodeUtils.insertNodeAtIndex(blockScopeNode.body, this.getNode(), 1);
  1214. }
  1215. }, {
  1216. key: 'getNode',
  1217. value: function getNode() {
  1218. if (!this.unicodeArray.length) {
  1219. return;
  1220. }
  1221. this.updateNode();
  1222. return _get(Object.getPrototypeOf(UnicodeArrayDecodeNode.prototype), 'getNode', this).call(this);
  1223. }
  1224. }, {
  1225. key: 'getNodeStructure',
  1226. value: function getNodeStructure() {
  1227. var environmentName = Utils_1.Utils.getRandomVariableName(),
  1228. forLoopFunctionName = Utils_1.Utils.getRandomVariableName(),
  1229. indexVariableName = Utils_1.Utils.getRandomVariableName(),
  1230. tempArrayName = Utils_1.Utils.getRandomVariableName();
  1231. var code = '',
  1232. node = void 0;
  1233. if (this.options.getOption('selfDefending')) {
  1234. 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 ';
  1235. } else {
  1236. code = forLoopFunctionName + '();';
  1237. }
  1238. 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 ');
  1239. NodeUtils_1.NodeUtils.addXVerbatimPropertyToLiterals(node);
  1240. return NodeUtils_1.NodeUtils.getBlockScopeNodeByIndex(node);
  1241. }
  1242. }]);
  1243. return UnicodeArrayDecodeNode;
  1244. }(Node_1.Node);
  1245. exports.UnicodeArrayDecodeNode = UnicodeArrayDecodeNode;
  1246. /***/ },
  1247. /* 26 */
  1248. /***/ function(module, exports, __webpack_require__) {
  1249. "use strict";
  1250. "use strict";
  1251. 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; }; }();
  1252. 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); } };
  1253. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1254. 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; }
  1255. 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; }
  1256. var escodegen = __webpack_require__(9);
  1257. var AppendState_1 = __webpack_require__(6);
  1258. var NodeType_1 = __webpack_require__(3);
  1259. var Node_1 = __webpack_require__(2);
  1260. var NodeUtils_1 = __webpack_require__(0);
  1261. var Utils_1 = __webpack_require__(1);
  1262. var UnicodeArrayNode = function (_Node_1$Node) {
  1263. _inherits(UnicodeArrayNode, _Node_1$Node);
  1264. function UnicodeArrayNode(unicodeArrayName) {
  1265. var unicodeArrayRotateValue = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1];
  1266. var options = arguments[2];
  1267. _classCallCheck(this, UnicodeArrayNode);
  1268. var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(UnicodeArrayNode).call(this, options));
  1269. _this.appendState = AppendState_1.AppendState.AfterObfuscation;
  1270. _this.unicodeArray = [];
  1271. _this.unicodeArrayName = unicodeArrayName;
  1272. _this.unicodeArrayRotateValue = unicodeArrayRotateValue;
  1273. _this.node = _this.getNodeStructure();
  1274. return _this;
  1275. }
  1276. _createClass(UnicodeArrayNode, [{
  1277. key: 'appendNode',
  1278. value: function appendNode(blockScopeNode) {
  1279. NodeUtils_1.NodeUtils.prependNode(blockScopeNode.body, this.getNode());
  1280. }
  1281. }, {
  1282. key: 'getNodeIdentifier',
  1283. value: function getNodeIdentifier() {
  1284. return this.unicodeArrayName;
  1285. }
  1286. }, {
  1287. key: 'getNodeData',
  1288. value: function getNodeData() {
  1289. return this.unicodeArray;
  1290. }
  1291. }, {
  1292. key: 'getNode',
  1293. value: function getNode() {
  1294. if (!this.unicodeArray.length) {
  1295. return;
  1296. }
  1297. Utils_1.Utils.arrayRotate(this.unicodeArray, this.unicodeArrayRotateValue);
  1298. this.updateNode();
  1299. return _get(Object.getPrototypeOf(UnicodeArrayNode.prototype), 'getNode', this).call(this);
  1300. }
  1301. }, {
  1302. key: 'updateNodeData',
  1303. value: function updateNodeData(data) {
  1304. this.unicodeArray.push(data);
  1305. }
  1306. }, {
  1307. key: 'getNodeStructure',
  1308. value: function getNodeStructure() {
  1309. return {
  1310. 'type': NodeType_1.NodeType.VariableDeclaration,
  1311. 'declarations': [{
  1312. 'type': NodeType_1.NodeType.VariableDeclarator,
  1313. 'id': {
  1314. 'type': NodeType_1.NodeType.Identifier,
  1315. 'name': this.unicodeArrayName
  1316. },
  1317. 'init': {
  1318. 'type': NodeType_1.NodeType.ArrayExpression,
  1319. 'elements': this.unicodeArray.map(function (value) {
  1320. return {
  1321. 'type': NodeType_1.NodeType.Literal,
  1322. 'value': value,
  1323. 'raw': '\'' + value + '\'',
  1324. 'x-verbatim-property': {
  1325. 'content': value,
  1326. precedence: escodegen.Precedence.Primary
  1327. }
  1328. };
  1329. })
  1330. }
  1331. }],
  1332. 'kind': 'var'
  1333. };
  1334. }
  1335. }]);
  1336. return UnicodeArrayNode;
  1337. }(Node_1.Node);
  1338. UnicodeArrayNode.UNICODE_ARRAY_RANDOM_LENGTH = 4;
  1339. exports.UnicodeArrayNode = UnicodeArrayNode;
  1340. /***/ },
  1341. /* 27 */
  1342. /***/ function(module, exports, __webpack_require__) {
  1343. "use strict";
  1344. "use strict";
  1345. 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; }; }();
  1346. 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); } };
  1347. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1348. 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; }
  1349. 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; }
  1350. var esprima = __webpack_require__(7);
  1351. var AppendState_1 = __webpack_require__(6);
  1352. var JSFuck_1 = __webpack_require__(8);
  1353. var NoCustomNodesPreset_1 = __webpack_require__(12);
  1354. var JavaScriptObfuscator_1 = __webpack_require__(10);
  1355. var Node_1 = __webpack_require__(2);
  1356. var NodeUtils_1 = __webpack_require__(0);
  1357. var Utils_1 = __webpack_require__(1);
  1358. var UnicodeArrayRotateFunctionNode = function (_Node_1$Node) {
  1359. _inherits(UnicodeArrayRotateFunctionNode, _Node_1$Node);
  1360. function UnicodeArrayRotateFunctionNode(unicodeArrayName, unicodeArray, unicodeArrayRotateValue, options) {
  1361. _classCallCheck(this, UnicodeArrayRotateFunctionNode);
  1362. var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(UnicodeArrayRotateFunctionNode).call(this, options));
  1363. _this.appendState = AppendState_1.AppendState.AfterObfuscation;
  1364. _this.unicodeArrayName = unicodeArrayName;
  1365. _this.unicodeArray = unicodeArray;
  1366. _this.unicodeArrayRotateValue = unicodeArrayRotateValue;
  1367. _this.node = _this.getNodeStructure();
  1368. return _this;
  1369. }
  1370. _createClass(UnicodeArrayRotateFunctionNode, [{
  1371. key: "appendNode",
  1372. value: function appendNode(blockScopeNode) {
  1373. NodeUtils_1.NodeUtils.insertNodeAtIndex(blockScopeNode.body, this.getNode(), 1);
  1374. }
  1375. }, {
  1376. key: "getNode",
  1377. value: function getNode() {
  1378. if (!this.unicodeArray.length) {
  1379. return;
  1380. }
  1381. return _get(Object.getPrototypeOf(UnicodeArrayRotateFunctionNode.prototype), "getNode", this).call(this);
  1382. }
  1383. }, {
  1384. key: "getNodeStructure",
  1385. value: function getNodeStructure() {
  1386. var arrayName = Utils_1.Utils.getRandomVariableName(),
  1387. code = '',
  1388. timesName = Utils_1.Utils.getRandomVariableName(),
  1389. timesArgumentName = Utils_1.Utils.getRandomVariableName(),
  1390. whileFunctionName = Utils_1.Utils.getRandomVariableName(),
  1391. node = void 0;
  1392. if (this.options.getOption('selfDefending')) {
  1393. 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);
  1394. } else {
  1395. code = whileFunctionName + "(++" + timesName + ")";
  1396. }
  1397. 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 ");
  1398. NodeUtils_1.NodeUtils.addXVerbatimPropertyToLiterals(node);
  1399. return NodeUtils_1.NodeUtils.getBlockScopeNodeByIndex(node);
  1400. }
  1401. }]);
  1402. return UnicodeArrayRotateFunctionNode;
  1403. }(Node_1.Node);
  1404. exports.UnicodeArrayRotateFunctionNode = UnicodeArrayRotateFunctionNode;
  1405. /***/ },
  1406. /* 28 */
  1407. /***/ function(module, exports, __webpack_require__) {
  1408. "use strict";
  1409. "use strict";
  1410. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1411. 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; }
  1412. 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; }
  1413. var DebugProtectionFunctionCallNode_1 = __webpack_require__(20);
  1414. var DebugProtectionFunctionIntervalNode_1 = __webpack_require__(21);
  1415. var DebugProtectionFunctionNode_1 = __webpack_require__(22);
  1416. var NodesGroup_1 = __webpack_require__(11);
  1417. var Utils_1 = __webpack_require__(1);
  1418. var DebugProtectionNodesGroup = function (_NodesGroup_1$NodesGr) {
  1419. _inherits(DebugProtectionNodesGroup, _NodesGroup_1$NodesGr);
  1420. function DebugProtectionNodesGroup(options) {
  1421. _classCallCheck(this, DebugProtectionNodesGroup);
  1422. var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(DebugProtectionNodesGroup).call(this, options));
  1423. _this.debugProtectionFunctionIdentifier = Utils_1.Utils.getRandomVariableName();
  1424. _this.nodes.set('debugProtectionFunctionNode', new DebugProtectionFunctionNode_1.DebugProtectionFunctionNode(_this.debugProtectionFunctionIdentifier, _this.options));
  1425. _this.nodes.set('debugProtectionFunctionCallNode', new DebugProtectionFunctionCallNode_1.DebugProtectionFunctionCallNode(_this.debugProtectionFunctionIdentifier, _this.options));
  1426. if (_this.options.getOption('debugProtectionInterval')) {
  1427. _this.nodes.set('debugProtectionFunctionIntervalNode', new DebugProtectionFunctionIntervalNode_1.DebugProtectionFunctionIntervalNode(_this.debugProtectionFunctionIdentifier, _this.options));
  1428. }
  1429. return _this;
  1430. }
  1431. return DebugProtectionNodesGroup;
  1432. }(NodesGroup_1.NodesGroup);
  1433. exports.DebugProtectionNodesGroup = DebugProtectionNodesGroup;
  1434. /***/ },
  1435. /* 29 */
  1436. /***/ function(module, exports, __webpack_require__) {
  1437. "use strict";
  1438. "use strict";
  1439. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1440. 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; }
  1441. 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; }
  1442. var NodesGroup_1 = __webpack_require__(11);
  1443. var SelfDefendingUnicodeNode_1 = __webpack_require__(23);
  1444. var SelfDefendingNodesGroup = function (_NodesGroup_1$NodesGr) {
  1445. _inherits(SelfDefendingNodesGroup, _NodesGroup_1$NodesGr);
  1446. function SelfDefendingNodesGroup(options) {
  1447. _classCallCheck(this, SelfDefendingNodesGroup);
  1448. var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(SelfDefendingNodesGroup).call(this, options));
  1449. _this.nodes.set('selfDefendingUnicodeNode', new SelfDefendingUnicodeNode_1.SelfDefendingUnicodeNode(_this.options));
  1450. return _this;
  1451. }
  1452. return SelfDefendingNodesGroup;
  1453. }(NodesGroup_1.NodesGroup);
  1454. exports.SelfDefendingNodesGroup = SelfDefendingNodesGroup;
  1455. /***/ },
  1456. /* 30 */
  1457. /***/ function(module, exports, __webpack_require__) {
  1458. "use strict";
  1459. "use strict";
  1460. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1461. 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; }
  1462. 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; }
  1463. var NodesGroup_1 = __webpack_require__(11);
  1464. var UnicodeArrayCallsWrapper_1 = __webpack_require__(24);
  1465. var UnicodeArrayDecodeNode_1 = __webpack_require__(25);
  1466. var UnicodeArrayNode_1 = __webpack_require__(26);
  1467. var UnicodeArrayRotateFunctionNode_1 = __webpack_require__(27);
  1468. var Utils_1 = __webpack_require__(1);
  1469. var UnicodeArrayNodesGroup = function (_NodesGroup_1$NodesGr) {
  1470. _inherits(UnicodeArrayNodesGroup, _NodesGroup_1$NodesGr);
  1471. function UnicodeArrayNodesGroup(options) {
  1472. _classCallCheck(this, UnicodeArrayNodesGroup);
  1473. var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(UnicodeArrayNodesGroup).call(this, options));
  1474. _this.unicodeArrayName = Utils_1.Utils.getRandomVariableName(UnicodeArrayNode_1.UnicodeArrayNode.UNICODE_ARRAY_RANDOM_LENGTH);
  1475. _this.unicodeArrayTranslatorName = Utils_1.Utils.getRandomVariableName(UnicodeArrayNode_1.UnicodeArrayNode.UNICODE_ARRAY_RANDOM_LENGTH);
  1476. _this.unicodeArrayRotateValue = _this.options.getOption('rotateUnicodeArray') ? Utils_1.Utils.getRandomInteger(100, 500) : 0;
  1477. var unicodeArrayNode = new UnicodeArrayNode_1.UnicodeArrayNode(_this.unicodeArrayName, _this.unicodeArrayRotateValue, _this.options),
  1478. unicodeArray = unicodeArrayNode.getNodeData();
  1479. _this.nodes.set('unicodeArrayNode', unicodeArrayNode);
  1480. if (_this.options.getOption('wrapUnicodeArrayCalls')) {
  1481. _this.nodes.set('unicodeArrayCallsWrapper', new UnicodeArrayCallsWrapper_1.UnicodeArrayCallsWrapper(_this.unicodeArrayTranslatorName, _this.unicodeArrayName, unicodeArray, _this.options));
  1482. }
  1483. if (_this.options.getOption('encodeUnicodeLiterals')) {
  1484. _this.nodes.set('unicodeArrayDecodeNode', new UnicodeArrayDecodeNode_1.UnicodeArrayDecodeNode(_this.unicodeArrayName, unicodeArray, _this.options));
  1485. }
  1486. if (_this.options.getOption('rotateUnicodeArray')) {
  1487. _this.nodes.set('unicodeArrayRotateFunctionNode', new UnicodeArrayRotateFunctionNode_1.UnicodeArrayRotateFunctionNode(_this.unicodeArrayName, unicodeArray, _this.unicodeArrayRotateValue, _this.options));
  1488. }
  1489. return _this;
  1490. }
  1491. return UnicodeArrayNodesGroup;
  1492. }(NodesGroup_1.NodesGroup);
  1493. exports.UnicodeArrayNodesGroup = UnicodeArrayNodesGroup;
  1494. /***/ },
  1495. /* 31 */
  1496. /***/ function(module, exports, __webpack_require__) {
  1497. "use strict";
  1498. "use strict";
  1499. 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; }; }();
  1500. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1501. 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; }
  1502. 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; }
  1503. var estraverse = __webpack_require__(4);
  1504. var NodeObfuscator_1 = __webpack_require__(5);
  1505. var NodeUtils_1 = __webpack_require__(0);
  1506. var Utils_1 = __webpack_require__(1);
  1507. var CatchClauseObfuscator = function (_NodeObfuscator_1$Nod) {
  1508. _inherits(CatchClauseObfuscator, _NodeObfuscator_1$Nod);
  1509. function CatchClauseObfuscator() {
  1510. var _Object$getPrototypeO;
  1511. _classCallCheck(this, CatchClauseObfuscator);
  1512. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  1513. args[_key] = arguments[_key];
  1514. }
  1515. var _this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(CatchClauseObfuscator)).call.apply(_Object$getPrototypeO, [this].concat(args)));
  1516. _this.catchClauseParam = new Map();
  1517. return _this;
  1518. }
  1519. _createClass(CatchClauseObfuscator, [{
  1520. key: 'obfuscateNode',
  1521. value: function obfuscateNode(catchClauseNode) {
  1522. this.replaceCatchClauseParam(catchClauseNode);
  1523. this.replaceCatchClauseParamInBlock(catchClauseNode);
  1524. }
  1525. }, {
  1526. key: 'replaceCatchClauseParam',
  1527. value: function replaceCatchClauseParam(catchClauseNode) {
  1528. var _this2 = this;
  1529. estraverse.replace(catchClauseNode.param, {
  1530. leave: function leave(node, parentNode) {
  1531. if (NodeUtils_1.NodeUtils.isIdentifierNode(node) && !_this2.isReservedName(node.name)) {
  1532. _this2.catchClauseParam.set(node.name, Utils_1.Utils.getRandomVariableName());
  1533. node.name = _this2.catchClauseParam.get(node.name);
  1534. return;
  1535. }
  1536. return estraverse.VisitorOption.Skip;
  1537. }
  1538. });
  1539. }
  1540. }, {
  1541. key: 'replaceCatchClauseParamInBlock',
  1542. value: function replaceCatchClauseParamInBlock(catchClauseNode) {
  1543. var _this3 = this;
  1544. estraverse.replace(catchClauseNode.body, {
  1545. leave: function leave(node, parentNode) {
  1546. _this3.replaceNodeIdentifierByNewValue(node, parentNode, _this3.catchClauseParam);
  1547. }
  1548. });
  1549. }
  1550. }]);
  1551. return CatchClauseObfuscator;
  1552. }(NodeObfuscator_1.NodeObfuscator);
  1553. exports.CatchClauseObfuscator = CatchClauseObfuscator;
  1554. /***/ },
  1555. /* 32 */
  1556. /***/ function(module, exports, __webpack_require__) {
  1557. "use strict";
  1558. "use strict";
  1559. 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; }; }();
  1560. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1561. 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; }
  1562. 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; }
  1563. var estraverse = __webpack_require__(4);
  1564. var NodeType_1 = __webpack_require__(3);
  1565. var NodeObfuscator_1 = __webpack_require__(5);
  1566. var NodeUtils_1 = __webpack_require__(0);
  1567. var Utils_1 = __webpack_require__(1);
  1568. var FunctionDeclarationObfuscator = function (_NodeObfuscator_1$Nod) {
  1569. _inherits(FunctionDeclarationObfuscator, _NodeObfuscator_1$Nod);
  1570. function FunctionDeclarationObfuscator() {
  1571. var _Object$getPrototypeO;
  1572. _classCallCheck(this, FunctionDeclarationObfuscator);
  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(FunctionDeclarationObfuscator)).call.apply(_Object$getPrototypeO, [this].concat(args)));
  1577. _this.functionName = new Map();
  1578. return _this;
  1579. }
  1580. _createClass(FunctionDeclarationObfuscator, [{
  1581. key: "obfuscateNode",
  1582. value: function obfuscateNode(functionDeclarationNode, parentNode) {
  1583. if (parentNode.type === NodeType_1.NodeType.Program) {
  1584. return;
  1585. }
  1586. this.replaceFunctionName(functionDeclarationNode);
  1587. this.replaceFunctionCalls(functionDeclarationNode);
  1588. }
  1589. }, {
  1590. key: "replaceFunctionName",
  1591. value: function replaceFunctionName(functionDeclarationNode) {
  1592. var _this2 = this;
  1593. estraverse.replace(functionDeclarationNode.id, {
  1594. leave: function leave(node) {
  1595. if (NodeUtils_1.NodeUtils.isIdentifierNode(node) && !_this2.isReservedName(node.name)) {
  1596. _this2.functionName.set(node.name, Utils_1.Utils.getRandomVariableName());
  1597. node.name = _this2.functionName.get(node.name);
  1598. return;
  1599. }
  1600. return estraverse.VisitorOption.Skip;
  1601. }
  1602. });
  1603. }
  1604. }, {
  1605. key: "replaceFunctionCalls",
  1606. value: function replaceFunctionCalls(functionDeclarationNode) {
  1607. var _this3 = this;
  1608. var scopeNode = NodeUtils_1.NodeUtils.getBlockScopeOfNode(functionDeclarationNode);
  1609. estraverse.replace(scopeNode, {
  1610. enter: function enter(node, parentNode) {
  1611. _this3.replaceNodeIdentifierByNewValue(node, parentNode, _this3.functionName);
  1612. }
  1613. });
  1614. }
  1615. }]);
  1616. return FunctionDeclarationObfuscator;
  1617. }(NodeObfuscator_1.NodeObfuscator);
  1618. exports.FunctionDeclarationObfuscator = FunctionDeclarationObfuscator;
  1619. /***/ },
  1620. /* 33 */
  1621. /***/ function(module, exports, __webpack_require__) {
  1622. "use strict";
  1623. "use strict";
  1624. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  1625. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1626. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  1627. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  1628. var estraverse = __webpack_require__(4);
  1629. var NodeObfuscator_1 = __webpack_require__(5);
  1630. var NodeUtils_1 = __webpack_require__(0);
  1631. var Utils_1 = __webpack_require__(1);
  1632. var FunctionObfuscator = function (_NodeObfuscator_1$Nod) {
  1633. _inherits(FunctionObfuscator, _NodeObfuscator_1$Nod);
  1634. function FunctionObfuscator() {
  1635. var _Object$getPrototypeO;
  1636. _classCallCheck(this, FunctionObfuscator);
  1637. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  1638. args[_key] = arguments[_key];
  1639. }
  1640. var _this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(FunctionObfuscator)).call.apply(_Object$getPrototypeO, [this].concat(args)));
  1641. _this.functionParams = new Map();
  1642. return _this;
  1643. }
  1644. _createClass(FunctionObfuscator, [{
  1645. key: 'obfuscateNode',
  1646. value: function obfuscateNode(functionNode) {
  1647. this.replaceFunctionParams(functionNode);
  1648. this.replaceFunctionParamsInBody(functionNode);
  1649. }
  1650. }, {
  1651. key: 'replaceFunctionParams',
  1652. value: function replaceFunctionParams(functionNode) {
  1653. var _this2 = this;
  1654. functionNode.params.forEach(function (paramsNode) {
  1655. estraverse.replace(paramsNode, {
  1656. leave: function leave(node) {
  1657. if (NodeUtils_1.NodeUtils.isIdentifierNode(node) && !_this2.isReservedName(node.name)) {
  1658. _this2.functionParams.set(node.name, Utils_1.Utils.getRandomVariableName());
  1659. node.name = _this2.functionParams.get(node.name);
  1660. return;
  1661. }
  1662. return estraverse.VisitorOption.Skip;
  1663. }
  1664. });
  1665. });
  1666. }
  1667. }, {
  1668. key: 'replaceFunctionParamsInBody',
  1669. value: function replaceFunctionParamsInBody(functionNode) {
  1670. var _this3 = this;
  1671. estraverse.replace(functionNode.body, {
  1672. leave: function leave(node, parentNode) {
  1673. _this3.replaceNodeIdentifierByNewValue(node, parentNode, _this3.functionParams);
  1674. }
  1675. });
  1676. }
  1677. }]);
  1678. return FunctionObfuscator;
  1679. }(NodeObfuscator_1.NodeObfuscator);
  1680. exports.FunctionObfuscator = FunctionObfuscator;
  1681. /***/ },
  1682. /* 34 */
  1683. /***/ function(module, exports, __webpack_require__) {
  1684. "use strict";
  1685. "use strict";
  1686. 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; };
  1687. 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; }; }();
  1688. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1689. 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; }
  1690. 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; }
  1691. var escodegen = __webpack_require__(9);
  1692. var NodeObfuscator_1 = __webpack_require__(5);
  1693. var NodeUtils_1 = __webpack_require__(0);
  1694. var LiteralObfuscator = function (_NodeObfuscator_1$Nod) {
  1695. _inherits(LiteralObfuscator, _NodeObfuscator_1$Nod);
  1696. function LiteralObfuscator() {
  1697. _classCallCheck(this, LiteralObfuscator);
  1698. return _possibleConstructorReturn(this, Object.getPrototypeOf(LiteralObfuscator).apply(this, arguments));
  1699. }
  1700. _createClass(LiteralObfuscator, [{
  1701. key: 'obfuscateNode',
  1702. value: function obfuscateNode(literalNode, parentNode) {
  1703. if (NodeUtils_1.NodeUtils.isPropertyNode(parentNode) && parentNode.key === literalNode) {
  1704. return;
  1705. }
  1706. if (literalNode['x-verbatim-property']) {
  1707. return;
  1708. }
  1709. var content = void 0;
  1710. switch (_typeof(literalNode.value)) {
  1711. case 'boolean':
  1712. content = this.replaceLiteralBooleanByJSFuck(literalNode.value);
  1713. break;
  1714. case 'number':
  1715. content = this.replaceLiteralNumberByHexadecimalValue(literalNode.value);
  1716. break;
  1717. case 'string':
  1718. content = this.replaceLiteralValueByUnicodeValue(literalNode.value);
  1719. break;
  1720. default:
  1721. return;
  1722. }
  1723. literalNode['x-verbatim-property'] = {
  1724. content: content,
  1725. precedence: escodegen.Precedence.Primary
  1726. };
  1727. }
  1728. }]);
  1729. return LiteralObfuscator;
  1730. }(NodeObfuscator_1.NodeObfuscator);
  1731. exports.LiteralObfuscator = LiteralObfuscator;
  1732. /***/ },
  1733. /* 35 */
  1734. /***/ function(module, exports, __webpack_require__) {
  1735. "use strict";
  1736. "use strict";
  1737. 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; };
  1738. 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; }; }();
  1739. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1740. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  1741. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  1742. var escodegen = __webpack_require__(9);
  1743. var estraverse = __webpack_require__(4);
  1744. var NodeType_1 = __webpack_require__(3);
  1745. var NodeObfuscator_1 = __webpack_require__(5);
  1746. var NodeUtils_1 = __webpack_require__(0);
  1747. var MemberExpressionObfuscator = function (_NodeObfuscator_1$Nod) {
  1748. _inherits(MemberExpressionObfuscator, _NodeObfuscator_1$Nod);
  1749. function MemberExpressionObfuscator() {
  1750. _classCallCheck(this, MemberExpressionObfuscator);
  1751. return _possibleConstructorReturn(this, Object.getPrototypeOf(MemberExpressionObfuscator).apply(this, arguments));
  1752. }
  1753. _createClass(MemberExpressionObfuscator, [{
  1754. key: 'obfuscateNode',
  1755. value: function obfuscateNode(memberExpressionNode) {
  1756. var _this2 = this;
  1757. estraverse.replace(memberExpressionNode.property, {
  1758. leave: function leave(node, parentNode) {
  1759. if (NodeUtils_1.NodeUtils.isLiteralNode(node)) {
  1760. _this2.literalNodeController(node);
  1761. return;
  1762. }
  1763. if (NodeUtils_1.NodeUtils.isIdentifierNode(node)) {
  1764. if (memberExpressionNode.computed) {
  1765. return;
  1766. }
  1767. memberExpressionNode.computed = true;
  1768. _this2.identifierNodeController(node);
  1769. }
  1770. }
  1771. });
  1772. }
  1773. }, {
  1774. key: 'identifierNodeController',
  1775. value: function identifierNodeController(node) {
  1776. var nodeValue = node.name,
  1777. literalNode = {
  1778. raw: '\'' + nodeValue + '\'',
  1779. 'x-verbatim-property': {
  1780. content: this.replaceLiteralValueByUnicodeValue(nodeValue),
  1781. precedence: escodegen.Precedence.Primary
  1782. },
  1783. type: NodeType_1.NodeType.Literal,
  1784. value: nodeValue
  1785. };
  1786. delete node.name;
  1787. Object.assign(node, literalNode);
  1788. }
  1789. }, {
  1790. key: 'literalNodeController',
  1791. value: function literalNodeController(node) {
  1792. switch (_typeof(node.value)) {
  1793. case 'string':
  1794. if (node['x-verbatim-property']) {
  1795. break;
  1796. }
  1797. node['x-verbatim-property'] = {
  1798. content: this.replaceLiteralValueByUnicodeValue(node.value),
  1799. precedence: escodegen.Precedence.Primary
  1800. };
  1801. break;
  1802. default:
  1803. break;
  1804. }
  1805. }
  1806. }]);
  1807. return MemberExpressionObfuscator;
  1808. }(NodeObfuscator_1.NodeObfuscator);
  1809. exports.MemberExpressionObfuscator = MemberExpressionObfuscator;
  1810. /***/ },
  1811. /* 36 */
  1812. /***/ function(module, exports, __webpack_require__) {
  1813. "use strict";
  1814. "use strict";
  1815. 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; }; }();
  1816. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1817. 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; }
  1818. 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; }
  1819. var estraverse = __webpack_require__(4);
  1820. var NodeObfuscator_1 = __webpack_require__(5);
  1821. var NodeUtils_1 = __webpack_require__(0);
  1822. var Utils_1 = __webpack_require__(1);
  1823. var MethodDefinitionObfuscator = function (_NodeObfuscator_1$Nod) {
  1824. _inherits(MethodDefinitionObfuscator, _NodeObfuscator_1$Nod);
  1825. function MethodDefinitionObfuscator() {
  1826. var _Object$getPrototypeO;
  1827. _classCallCheck(this, MethodDefinitionObfuscator);
  1828. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  1829. args[_key] = arguments[_key];
  1830. }
  1831. var _this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(MethodDefinitionObfuscator)).call.apply(_Object$getPrototypeO, [this].concat(args)));
  1832. _this.ignoredNames = ['constructor'];
  1833. return _this;
  1834. }
  1835. _createClass(MethodDefinitionObfuscator, [{
  1836. key: 'obfuscateNode',
  1837. value: function obfuscateNode(methodDefinitionNode, parentNode) {
  1838. this.replaceMethodName(methodDefinitionNode);
  1839. }
  1840. }, {
  1841. key: 'replaceMethodName',
  1842. value: function replaceMethodName(methodDefinitionNode) {
  1843. var _this2 = this;
  1844. estraverse.replace(methodDefinitionNode.key, {
  1845. leave: function leave(node) {
  1846. if (NodeUtils_1.NodeUtils.isIdentifierNode(node) && !Utils_1.Utils.arrayContains(_this2.ignoredNames, node.name) && methodDefinitionNode.computed === false) {
  1847. methodDefinitionNode.computed = true;
  1848. node.name = _this2.replaceLiteralValueByUnicodeValue(node.name);
  1849. return;
  1850. }
  1851. return estraverse.VisitorOption.Skip;
  1852. }
  1853. });
  1854. }
  1855. }]);
  1856. return MethodDefinitionObfuscator;
  1857. }(NodeObfuscator_1.NodeObfuscator);
  1858. exports.MethodDefinitionObfuscator = MethodDefinitionObfuscator;
  1859. /***/ },
  1860. /* 37 */
  1861. /***/ function(module, exports, __webpack_require__) {
  1862. "use strict";
  1863. "use strict";
  1864. 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; };
  1865. 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; }; }();
  1866. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1867. 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; }
  1868. 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; }
  1869. var escodegen = __webpack_require__(9);
  1870. var estraverse = __webpack_require__(4);
  1871. var NodeType_1 = __webpack_require__(3);
  1872. var NodeObfuscator_1 = __webpack_require__(5);
  1873. var NodeUtils_1 = __webpack_require__(0);
  1874. var Utils_1 = __webpack_require__(1);
  1875. var ObjectExpressionObfuscator = function (_NodeObfuscator_1$Nod) {
  1876. _inherits(ObjectExpressionObfuscator, _NodeObfuscator_1$Nod);
  1877. function ObjectExpressionObfuscator() {
  1878. _classCallCheck(this, ObjectExpressionObfuscator);
  1879. return _possibleConstructorReturn(this, Object.getPrototypeOf(ObjectExpressionObfuscator).apply(this, arguments));
  1880. }
  1881. _createClass(ObjectExpressionObfuscator, [{
  1882. key: 'obfuscateNode',
  1883. value: function obfuscateNode(objectExpressionNode) {
  1884. var _this2 = this;
  1885. objectExpressionNode.properties.forEach(function (property) {
  1886. estraverse.replace(property.key, {
  1887. leave: function leave(node, parentNode) {
  1888. if (NodeUtils_1.NodeUtils.isLiteralNode(node)) {
  1889. _this2.literalNodeController(node);
  1890. return;
  1891. }
  1892. if (NodeUtils_1.NodeUtils.isIdentifierNode(node)) {
  1893. _this2.identifierNodeController(node);
  1894. }
  1895. }
  1896. });
  1897. });
  1898. }
  1899. }, {
  1900. key: 'literalNodeController',
  1901. value: function literalNodeController(node) {
  1902. switch (_typeof(node.value)) {
  1903. case 'string':
  1904. if (node['x-verbatim-property']) {
  1905. break;
  1906. }
  1907. node['x-verbatim-property'] = {
  1908. content: Utils_1.Utils.stringToUnicode(node.value),
  1909. precedence: escodegen.Precedence.Primary
  1910. };
  1911. break;
  1912. default:
  1913. break;
  1914. }
  1915. }
  1916. }, {
  1917. key: 'identifierNodeController',
  1918. value: function identifierNodeController(node) {
  1919. var nodeValue = node.name,
  1920. literalNode = {
  1921. raw: '\'' + nodeValue + '\'',
  1922. 'x-verbatim-property': {
  1923. content: Utils_1.Utils.stringToUnicode(nodeValue),
  1924. precedence: escodegen.Precedence.Primary
  1925. },
  1926. type: NodeType_1.NodeType.Literal,
  1927. value: nodeValue
  1928. };
  1929. delete node.name;
  1930. Object.assign(node, literalNode);
  1931. }
  1932. }]);
  1933. return ObjectExpressionObfuscator;
  1934. }(NodeObfuscator_1.NodeObfuscator);
  1935. exports.ObjectExpressionObfuscator = ObjectExpressionObfuscator;
  1936. /***/ },
  1937. /* 38 */
  1938. /***/ function(module, exports, __webpack_require__) {
  1939. "use strict";
  1940. "use strict";
  1941. 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; }; }();
  1942. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1943. 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; }
  1944. 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; }
  1945. var estraverse = __webpack_require__(4);
  1946. var NodeType_1 = __webpack_require__(3);
  1947. var NodeObfuscator_1 = __webpack_require__(5);
  1948. var NodeUtils_1 = __webpack_require__(0);
  1949. var Utils_1 = __webpack_require__(1);
  1950. var VariableDeclarationObfuscator = function (_NodeObfuscator_1$Nod) {
  1951. _inherits(VariableDeclarationObfuscator, _NodeObfuscator_1$Nod);
  1952. function VariableDeclarationObfuscator() {
  1953. var _Object$getPrototypeO;
  1954. _classCallCheck(this, VariableDeclarationObfuscator);
  1955. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  1956. args[_key] = arguments[_key];
  1957. }
  1958. var _this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(VariableDeclarationObfuscator)).call.apply(_Object$getPrototypeO, [this].concat(args)));
  1959. _this.variableNames = new Map();
  1960. return _this;
  1961. }
  1962. _createClass(VariableDeclarationObfuscator, [{
  1963. key: "obfuscateNode",
  1964. value: function obfuscateNode(variableDeclarationNode, parentNode) {
  1965. if (parentNode.type === NodeType_1.NodeType.Program) {
  1966. return;
  1967. }
  1968. this.replaceVariableName(variableDeclarationNode);
  1969. this.replaceVariableCalls(variableDeclarationNode, parentNode);
  1970. }
  1971. }, {
  1972. key: "replaceVariableName",
  1973. value: function replaceVariableName(variableDeclarationNode) {
  1974. var _this2 = this;
  1975. variableDeclarationNode.declarations.forEach(function (declarationNode) {
  1976. estraverse.replace(declarationNode.id, {
  1977. enter: function enter(node) {
  1978. if (NodeUtils_1.NodeUtils.isIdentifierNode(node) && !_this2.isReservedName(node.name)) {
  1979. _this2.variableNames.set(node.name, Utils_1.Utils.getRandomVariableName());
  1980. node.name = _this2.variableNames.get(node.name);
  1981. return;
  1982. }
  1983. return estraverse.VisitorOption.Skip;
  1984. }
  1985. });
  1986. });
  1987. }
  1988. }, {
  1989. key: "replaceVariableCalls",
  1990. value: function replaceVariableCalls(variableDeclarationNode, variableParentNode) {
  1991. var _this3 = this;
  1992. var scopeNode = variableDeclarationNode.kind === 'var' ? NodeUtils_1.NodeUtils.getBlockScopeOfNode(variableDeclarationNode) : variableParentNode,
  1993. isNodeAfterVariableDeclaratorFlag = false;
  1994. estraverse.replace(scopeNode, {
  1995. enter: function enter(node, parentNode) {
  1996. var functionNodes = [NodeType_1.NodeType.ArrowFunctionExpression, NodeType_1.NodeType.FunctionDeclaration, NodeType_1.NodeType.FunctionExpression];
  1997. if (Utils_1.Utils.arrayContains(functionNodes, node.type)) {
  1998. estraverse.replace(node, {
  1999. enter: function enter(node, parentNode) {
  2000. _this3.replaceNodeIdentifierByNewValue(node, parentNode, _this3.variableNames);
  2001. }
  2002. });
  2003. }
  2004. if (node === variableDeclarationNode) {
  2005. isNodeAfterVariableDeclaratorFlag = true;
  2006. }
  2007. if (isNodeAfterVariableDeclaratorFlag) {
  2008. _this3.replaceNodeIdentifierByNewValue(node, parentNode, _this3.variableNames);
  2009. }
  2010. }
  2011. });
  2012. }
  2013. }]);
  2014. return VariableDeclarationObfuscator;
  2015. }(NodeObfuscator_1.NodeObfuscator);
  2016. exports.VariableDeclarationObfuscator = VariableDeclarationObfuscator;
  2017. /***/ },
  2018. /* 39 */
  2019. /***/ function(module, exports) {
  2020. "use strict";
  2021. "use strict";
  2022. exports.DEFAULT_PRESET = Object.freeze({
  2023. compact: true,
  2024. debugProtection: false,
  2025. debugProtectionInterval: false,
  2026. disableConsoleOutput: true,
  2027. encodeUnicodeLiterals: false,
  2028. reservedNames: [],
  2029. rotateUnicodeArray: true,
  2030. selfDefending: true,
  2031. unicodeArray: true,
  2032. unicodeArrayThreshold: 0.8,
  2033. wrapUnicodeArrayCalls: true
  2034. });
  2035. /***/ }
  2036. /******/ ]);