index.js 121 KB

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