index.js 119 KB

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