index.js 120 KB

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