index.js 120 KB

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