index.js 150 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247
  1. /*
  2. Copyright (C) 2016 Timofey Kachalov <[email protected]>
  3. Redistribution and use in source and binary forms, with or without
  4. modification, are permitted provided that the following conditions are met:
  5. * Redistributions of source code must retain the above copyright
  6. notice, this list of conditions and the following disclaimer.
  7. * Redistributions in binary form must reproduce the above copyright
  8. notice, this list of conditions and the following disclaimer in the
  9. documentation and/or other materials provided with the distribution.
  10. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  11. AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  12. IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  13. ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
  14. DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  15. (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  16. LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  17. ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  18. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  19. THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  20. */
  21. require("source-map-support").install();
  22. module.exports =
  23. /******/ (function(modules) { // webpackBootstrap
  24. /******/ // The module cache
  25. /******/ var installedModules = {};
  26. /******/
  27. /******/ // The require function
  28. /******/ function __webpack_require__(moduleId) {
  29. /******/
  30. /******/ // Check if module is in cache
  31. /******/ if(installedModules[moduleId])
  32. /******/ return installedModules[moduleId].exports;
  33. /******/
  34. /******/ // Create a new module (and put it into the cache)
  35. /******/ var module = installedModules[moduleId] = {
  36. /******/ i: moduleId,
  37. /******/ l: false,
  38. /******/ exports: {}
  39. /******/ };
  40. /******/
  41. /******/ // Execute the module function
  42. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  43. /******/
  44. /******/ // Flag the module as loaded
  45. /******/ module.l = true;
  46. /******/
  47. /******/ // Return the exports of the module
  48. /******/ return module.exports;
  49. /******/ }
  50. /******/
  51. /******/
  52. /******/ // expose the modules object (__webpack_modules__)
  53. /******/ __webpack_require__.m = modules;
  54. /******/
  55. /******/ // expose the module cache
  56. /******/ __webpack_require__.c = installedModules;
  57. /******/
  58. /******/ // identity function for calling harmory imports with the correct context
  59. /******/ __webpack_require__.i = function(value) { return value; };
  60. /******/
  61. /******/ // define getter function for harmory exports
  62. /******/ __webpack_require__.d = function(exports, name, getter) {
  63. /******/ Object.defineProperty(exports, name, {
  64. /******/ configurable: false,
  65. /******/ enumerable: true,
  66. /******/ get: getter
  67. /******/ });
  68. /******/ };
  69. /******/
  70. /******/ // getDefaultExport function for compatibility with non-harmony modules
  71. /******/ __webpack_require__.n = function(module) {
  72. /******/ var getter = module && module.__esModule ?
  73. /******/ function getDefault() { return module['default']; } :
  74. /******/ function getModuleExports() { return module; };
  75. /******/ __webpack_require__.d(getter, 'a', getter);
  76. /******/ return getter;
  77. /******/ };
  78. /******/
  79. /******/ // Object.prototype.hasOwnProperty.call
  80. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  81. /******/
  82. /******/ // __webpack_public_path__
  83. /******/ __webpack_require__.p = "";
  84. /******/
  85. /******/ // Load entry module and return exports
  86. /******/ return __webpack_require__(__webpack_require__.s = 67);
  87. /******/ })
  88. /************************************************************************/
  89. /******/ ([
  90. /* 0 */
  91. /***/ function(module, exports, __webpack_require__) {
  92. "use strict";
  93. "use strict";
  94. 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; }; }();
  95. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  96. var chance_1 = __webpack_require__(62);
  97. var JSFuck_1 = __webpack_require__(16);
  98. var Utils = function () {
  99. function Utils() {
  100. _classCallCheck(this, Utils);
  101. }
  102. _createClass(Utils, null, [{
  103. key: 'arrayContains',
  104. value: function arrayContains(array, searchElement) {
  105. return array.indexOf(searchElement) >= 0;
  106. }
  107. }, {
  108. key: 'arrayRotate',
  109. value: function arrayRotate(array, times) {
  110. if (!array.length) {
  111. throw new ReferenceError('Cannot rotate empty array.');
  112. }
  113. if (times <= 0) {
  114. return array;
  115. }
  116. var newArray = array,
  117. temp = void 0;
  118. while (times--) {
  119. temp = newArray.pop();
  120. newArray.unshift(temp);
  121. }
  122. return newArray;
  123. }
  124. }, {
  125. key: 'btoa',
  126. value: function btoa(string) {
  127. var encode = arguments.length <= 1 || arguments[1] === undefined ? true : arguments[1];
  128. return new Buffer(encode ? encodeURI(string) : string).toString('base64');
  129. }
  130. }, {
  131. key: 'decToHex',
  132. value: function decToHex(dec) {
  133. var radix = 16;
  134. return Number(dec).toString(radix);
  135. }
  136. }, {
  137. key: 'getRandomGenerator',
  138. value: function getRandomGenerator() {
  139. return Utils.randomGenerator;
  140. }
  141. }, {
  142. key: 'getRandomVariableName',
  143. value: function getRandomVariableName() {
  144. var length = arguments.length <= 0 || arguments[0] === undefined ? 6 : arguments[0];
  145. var rangeMinInteger = 10000,
  146. rangeMaxInteger = 99999999,
  147. prefix = '_0x';
  148. return '' + prefix + Utils.decToHex(Utils.getRandomGenerator().integer({
  149. min: rangeMinInteger,
  150. max: rangeMaxInteger
  151. })).substr(0, length);
  152. }
  153. }, {
  154. key: 'isInteger',
  155. value: function isInteger(number) {
  156. return number % 1 === 0;
  157. }
  158. }, {
  159. key: 'strEnumify',
  160. value: function strEnumify(obj) {
  161. return obj;
  162. }
  163. }, {
  164. key: 'stringToJSFuck',
  165. value: function stringToJSFuck(string) {
  166. return Array.from(string).map(function (character) {
  167. return JSFuck_1.JSFuck[character] || character;
  168. }).join(' + ');
  169. }
  170. }, {
  171. key: 'stringToUnicode',
  172. value: function stringToUnicode(string) {
  173. var radix = 16;
  174. var prefix = void 0,
  175. regexp = new RegExp('[\x00-\x7F]'),
  176. template = void 0;
  177. return '\'' + string.replace(/[\s\S]/g, function (escape) {
  178. if (regexp.test(escape)) {
  179. prefix = '\\x';
  180. template = '0'.repeat(2);
  181. } else {
  182. prefix = '\\u';
  183. template = '0'.repeat(4);
  184. }
  185. return '' + prefix + (template + escape.charCodeAt(0).toString(radix)).slice(-template.length);
  186. }) + '\'';
  187. }
  188. }]);
  189. return Utils;
  190. }();
  191. Utils.randomGenerator = new chance_1.Chance();
  192. exports.Utils = Utils;
  193. /***/ },
  194. /* 1 */
  195. /***/ function(module, exports, __webpack_require__) {
  196. "use strict";
  197. "use strict";
  198. 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; }; }();
  199. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  200. var escodegen = __webpack_require__(10);
  201. var esprima = __webpack_require__(18);
  202. var estraverse = __webpack_require__(4);
  203. var NodeType_1 = __webpack_require__(7);
  204. var Nodes_1 = __webpack_require__(6);
  205. var Utils_1 = __webpack_require__(0);
  206. var NodeUtils = function () {
  207. function NodeUtils() {
  208. _classCallCheck(this, NodeUtils);
  209. }
  210. _createClass(NodeUtils, null, [{
  211. key: 'addXVerbatimPropertyToLiterals',
  212. value: function addXVerbatimPropertyToLiterals(node) {
  213. estraverse.replace(node, {
  214. enter: function enter(node, parentNode) {
  215. if (Nodes_1.Nodes.isLiteralNode(node)) {
  216. node['x-verbatim-property'] = {
  217. content: node.raw,
  218. precedence: escodegen.Precedence.Primary
  219. };
  220. }
  221. }
  222. });
  223. }
  224. }, {
  225. key: 'appendNode',
  226. value: function appendNode(blockScopeBody, node) {
  227. if (!NodeUtils.validateNode(node)) {
  228. return;
  229. }
  230. blockScopeBody.push(node);
  231. }
  232. }, {
  233. key: 'convertCodeToStructure',
  234. value: function convertCodeToStructure(code) {
  235. var structure = esprima.parse(code);
  236. NodeUtils.addXVerbatimPropertyToLiterals(structure);
  237. NodeUtils.parentize(structure);
  238. return NodeUtils.getBlockStatementNodeByIndex(structure);
  239. }
  240. }, {
  241. key: 'getBlockStatementNodeByIndex',
  242. value: function getBlockStatementNodeByIndex(node) {
  243. var index = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1];
  244. if (Nodes_1.Nodes.isNodeHasBlockStatement(node)) {
  245. if (node.body[index] === undefined) {
  246. throw new ReferenceError('Wrong index `' + index + '`. Block-statement body length is `' + node.body.length + '`');
  247. }
  248. return node.body[index];
  249. }
  250. throw new TypeError('The specified node have no a block-statement');
  251. }
  252. }, {
  253. key: 'getBlockScopeOfNode',
  254. value: function getBlockScopeOfNode(node) {
  255. var depth = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1];
  256. var parentNode = node.parentNode;
  257. if (!parentNode) {
  258. throw new ReferenceError('`parentNode` property of given node is `undefined`');
  259. }
  260. if (Nodes_1.Nodes.isBlockStatementNode(parentNode)) {
  261. if (!parentNode.parentNode) {
  262. throw new ReferenceError('`parentNode` property of `parentNode` of given node is `undefined`');
  263. }
  264. if (!Utils_1.Utils.arrayContains(NodeUtils.nodesWithBlockScope, parentNode.parentNode.type)) {
  265. return NodeUtils.getBlockScopeOfNode(parentNode, depth);
  266. } else if (depth > 0) {
  267. return NodeUtils.getBlockScopeOfNode(parentNode, --depth);
  268. }
  269. return parentNode;
  270. }
  271. if (Nodes_1.Nodes.isProgramNode(parentNode)) {
  272. return parentNode;
  273. }
  274. return NodeUtils.getBlockScopeOfNode(parentNode);
  275. }
  276. }, {
  277. key: 'insertNodeAtIndex',
  278. value: function insertNodeAtIndex(blockScopeBody, node, index) {
  279. if (!NodeUtils.validateNode(node)) {
  280. return;
  281. }
  282. blockScopeBody.splice(index, 0, node);
  283. }
  284. }, {
  285. key: 'parentize',
  286. value: function parentize(node) {
  287. var isRootNode = true;
  288. estraverse.replace(node, {
  289. enter: function enter(node, parentNode) {
  290. var value = void 0;
  291. if (isRootNode) {
  292. if (node.type === NodeType_1.NodeType.Program) {
  293. value = node;
  294. } else {
  295. value = Nodes_1.Nodes.getProgramNode([node]);
  296. value['parentNode'] = value;
  297. }
  298. isRootNode = false;
  299. } else {
  300. value = parentNode || node;
  301. }
  302. node['parentNode'] = value;
  303. }
  304. });
  305. }
  306. }, {
  307. key: 'prependNode',
  308. value: function prependNode(blockScopeBody, node) {
  309. if (!NodeUtils.validateNode(node)) {
  310. return;
  311. }
  312. blockScopeBody.unshift(node);
  313. }
  314. }, {
  315. key: 'validateNode',
  316. value: function validateNode(node) {
  317. return !!node && node.hasOwnProperty('type');
  318. }
  319. }]);
  320. return NodeUtils;
  321. }();
  322. NodeUtils.nodesWithBlockScope = [NodeType_1.NodeType.ArrowFunctionExpression, NodeType_1.NodeType.FunctionDeclaration, NodeType_1.NodeType.FunctionExpression, NodeType_1.NodeType.MethodDefinition, NodeType_1.NodeType.Program];
  323. exports.NodeUtils = NodeUtils;
  324. /***/ },
  325. /* 2 */
  326. /***/ function(module, exports) {
  327. "use strict";
  328. "use strict";
  329. (function (AppendState) {
  330. AppendState[AppendState["AfterObfuscation"] = 0] = "AfterObfuscation";
  331. AppendState[AppendState["BeforeObfuscation"] = 1] = "BeforeObfuscation";
  332. })(exports.AppendState || (exports.AppendState = {}));
  333. var AppendState = exports.AppendState;
  334. /***/ },
  335. /* 3 */
  336. /***/ function(module, exports) {
  337. "use strict";
  338. "use strict";
  339. 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; }; }();
  340. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  341. var Node = function () {
  342. function Node(options) {
  343. _classCallCheck(this, Node);
  344. this.options = options;
  345. }
  346. _createClass(Node, [{
  347. key: "getAppendState",
  348. value: function getAppendState() {
  349. return this.appendState;
  350. }
  351. }, {
  352. key: "getNode",
  353. value: function getNode() {
  354. return this.getNodeStructure();
  355. }
  356. }]);
  357. return Node;
  358. }();
  359. exports.Node = Node;
  360. /***/ },
  361. /* 4 */
  362. /***/ function(module, exports) {
  363. module.exports = require("estraverse");
  364. /***/ },
  365. /* 5 */
  366. /***/ function(module, exports, __webpack_require__) {
  367. "use strict";
  368. "use strict";
  369. 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; }; }();
  370. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  371. var JSFuck_1 = __webpack_require__(16);
  372. var Nodes_1 = __webpack_require__(6);
  373. var Utils_1 = __webpack_require__(0);
  374. var NodeObfuscator = function () {
  375. function NodeObfuscator(nodes, options) {
  376. _classCallCheck(this, NodeObfuscator);
  377. this.nodes = nodes;
  378. this.options = options;
  379. }
  380. _createClass(NodeObfuscator, [{
  381. key: "isReservedName",
  382. value: function isReservedName(name) {
  383. return this.options.reservedNames.some(function (reservedName) {
  384. return new RegExp(reservedName, 'g').test(name);
  385. });
  386. }
  387. }, {
  388. key: "storeIdentifiersNames",
  389. value: function storeIdentifiersNames(node, namesMap) {
  390. if (Nodes_1.Nodes.isIdentifierNode(node) && !this.isReservedName(node.name)) {
  391. namesMap.set(node.name, Utils_1.Utils.getRandomVariableName());
  392. }
  393. }
  394. }, {
  395. key: "replaceIdentifiersWithRandomNames",
  396. value: function replaceIdentifiersWithRandomNames(node, parentNode, namesMap) {
  397. if (Nodes_1.Nodes.isIdentifierNode(node) && namesMap.has(node.name)) {
  398. var parentNodeIsPropertyNode = Nodes_1.Nodes.isPropertyNode(parentNode) && parentNode.key === node,
  399. parentNodeIsMemberExpressionNode = Nodes_1.Nodes.isMemberExpressionNode(parentNode) && parentNode.computed === false && parentNode.property === node;
  400. if (parentNodeIsPropertyNode || parentNodeIsMemberExpressionNode) {
  401. return;
  402. }
  403. node.name = namesMap.get(node.name);
  404. }
  405. }
  406. }, {
  407. key: "replaceLiteralBooleanWithJSFuck",
  408. value: function replaceLiteralBooleanWithJSFuck(nodeValue) {
  409. return nodeValue ? JSFuck_1.JSFuck.True : JSFuck_1.JSFuck.False;
  410. }
  411. }, {
  412. key: "replaceLiteralNumberWithHexadecimalValue",
  413. value: function replaceLiteralNumberWithHexadecimalValue(nodeValue) {
  414. var prefix = '0x';
  415. if (!Utils_1.Utils.isInteger(nodeValue)) {
  416. return String(nodeValue);
  417. }
  418. return "" + prefix + Utils_1.Utils.decToHex(nodeValue);
  419. }
  420. }, {
  421. key: "replaceLiteralValueWithUnicodeValue",
  422. value: function replaceLiteralValueWithUnicodeValue(nodeValue) {
  423. var replaceWithUnicodeArrayFlag = Math.random() <= this.options.unicodeArrayThreshold;
  424. if (this.options.encodeUnicodeLiterals && replaceWithUnicodeArrayFlag) {
  425. nodeValue = Utils_1.Utils.btoa(nodeValue);
  426. }
  427. nodeValue = Utils_1.Utils.stringToUnicode(nodeValue);
  428. if (this.options.unicodeArray && replaceWithUnicodeArrayFlag) {
  429. return this.replaceLiteralValueWithUnicodeArrayCall(nodeValue);
  430. }
  431. return nodeValue;
  432. }
  433. }, {
  434. key: "replaceLiteralValueWithUnicodeArrayCall",
  435. value: function replaceLiteralValueWithUnicodeArrayCall(value) {
  436. var unicodeArrayNode = this.nodes.get('unicodeArrayNode');
  437. if (!unicodeArrayNode) {
  438. throw new ReferenceError('`unicodeArrayNode` node is not found in Map with custom nodes.');
  439. }
  440. var unicodeArray = unicodeArrayNode.getNodeData(),
  441. indexOfExistingValue = unicodeArray.getIndexOf(value),
  442. indexOfValue = void 0,
  443. hexadecimalIndex = void 0;
  444. if (indexOfExistingValue >= 0) {
  445. indexOfValue = indexOfExistingValue;
  446. } else {
  447. indexOfValue = unicodeArray.getLength();
  448. unicodeArrayNode.updateNodeData(value);
  449. }
  450. hexadecimalIndex = this.replaceLiteralNumberWithHexadecimalValue(indexOfValue);
  451. if (this.options.wrapUnicodeArrayCalls) {
  452. var unicodeArrayCallsWrapper = this.nodes.get('unicodeArrayCallsWrapper');
  453. if (!unicodeArrayCallsWrapper) {
  454. throw new ReferenceError('`unicodeArrayCallsWrapper` node is not found in Map with custom nodes.');
  455. }
  456. return unicodeArrayCallsWrapper.getNodeIdentifier() + "('" + hexadecimalIndex + "')";
  457. }
  458. return unicodeArrayNode.getNodeIdentifier() + "[" + hexadecimalIndex + "]";
  459. }
  460. }]);
  461. return NodeObfuscator;
  462. }();
  463. exports.NodeObfuscator = NodeObfuscator;
  464. /***/ },
  465. /* 6 */
  466. /***/ function(module, exports, __webpack_require__) {
  467. "use strict";
  468. "use strict";
  469. 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; }; }();
  470. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  471. var NodeType_1 = __webpack_require__(7);
  472. var Nodes = function () {
  473. function Nodes() {
  474. _classCallCheck(this, Nodes);
  475. }
  476. _createClass(Nodes, null, [{
  477. key: "getProgramNode",
  478. value: function getProgramNode(bodyNode) {
  479. return {
  480. 'type': NodeType_1.NodeType.Program,
  481. 'body': bodyNode,
  482. 'sourceType': 'script'
  483. };
  484. }
  485. }, {
  486. key: "isBlockStatementNode",
  487. value: function isBlockStatementNode(node) {
  488. return node.type === NodeType_1.NodeType.BlockStatement;
  489. }
  490. }, {
  491. key: "isIdentifierNode",
  492. value: function isIdentifierNode(node) {
  493. return node.type === NodeType_1.NodeType.Identifier;
  494. }
  495. }, {
  496. key: "isLiteralNode",
  497. value: function isLiteralNode(node) {
  498. return node.type === NodeType_1.NodeType.Literal;
  499. }
  500. }, {
  501. key: "isMemberExpressionNode",
  502. value: function isMemberExpressionNode(node) {
  503. return node.type === NodeType_1.NodeType.MemberExpression;
  504. }
  505. }, {
  506. key: "isProgramNode",
  507. value: function isProgramNode(node) {
  508. return node.type === NodeType_1.NodeType.Program;
  509. }
  510. }, {
  511. key: "isPropertyNode",
  512. value: function isPropertyNode(node) {
  513. return node.type === NodeType_1.NodeType.Property;
  514. }
  515. }, {
  516. key: "isVariableDeclaratorNode",
  517. value: function isVariableDeclaratorNode(node) {
  518. return node.type === NodeType_1.NodeType.VariableDeclarator;
  519. }
  520. }, {
  521. key: "isNodeHasBlockStatement",
  522. value: function isNodeHasBlockStatement(node) {
  523. return node.hasOwnProperty('body') && Array.isArray(node.body);
  524. }
  525. }]);
  526. return Nodes;
  527. }();
  528. exports.Nodes = Nodes;
  529. /***/ },
  530. /* 7 */
  531. /***/ function(module, exports, __webpack_require__) {
  532. "use strict";
  533. "use strict";
  534. var Utils_1 = __webpack_require__(0);
  535. exports.NodeType = Utils_1.Utils.strEnumify({
  536. ArrayExpression: 'ArrayExpression',
  537. ArrowFunctionExpression: 'ArrowFunctionExpression',
  538. AssignmentExpression: 'AssignmentExpression',
  539. BinaryExpression: 'BinaryExpression',
  540. BlockStatement: 'BlockStatement',
  541. CallExpression: 'CallExpression',
  542. CatchClause: 'CatchClause',
  543. ClassDeclaration: 'ClassDeclaration',
  544. ExpressionStatement: 'ExpressionStatement',
  545. FunctionDeclaration: 'FunctionDeclaration',
  546. FunctionExpression: 'FunctionExpression',
  547. Identifier: 'Identifier',
  548. IfStatement: 'IfStatement',
  549. Literal: 'Literal',
  550. LogicalExpression: 'LogicalExpression',
  551. MemberExpression: 'MemberExpression',
  552. MethodDefinition: 'MethodDefinition',
  553. ObjectExpression: 'ObjectExpression',
  554. Program: 'Program',
  555. Property: 'Property',
  556. ReturnStatement: 'ReturnStatement',
  557. TryStatement: 'TryStatement',
  558. UnaryExpression: 'UnaryExpression',
  559. UpdateExpression: 'UpdateExpression',
  560. VariableDeclaration: 'VariableDeclaration',
  561. VariableDeclarator: 'VariableDeclarator',
  562. WhileStatement: 'WhileStatement'
  563. });
  564. /***/ },
  565. /* 8 */
  566. /***/ function(module, exports) {
  567. module.exports = require("format-unicorn");
  568. /***/ },
  569. /* 9 */
  570. /***/ function(module, exports, __webpack_require__) {
  571. "use strict";
  572. "use strict";
  573. 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; }; }();
  574. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  575. var JavaScriptObfuscatorCLI_1 = __webpack_require__(25);
  576. var JavaScriptObfuscatorInternal_1 = __webpack_require__(14);
  577. var JavaScriptObfuscator = function () {
  578. function JavaScriptObfuscator() {
  579. _classCallCheck(this, JavaScriptObfuscator);
  580. }
  581. _createClass(JavaScriptObfuscator, null, [{
  582. key: "obfuscate",
  583. value: function obfuscate(sourceCode) {
  584. var obfuscatorOptions = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
  585. var javaScriptObfuscator = new JavaScriptObfuscatorInternal_1.JavaScriptObfuscatorInternal(sourceCode, obfuscatorOptions);
  586. javaScriptObfuscator.obfuscate();
  587. return javaScriptObfuscator.getObfuscationResult();
  588. }
  589. }, {
  590. key: "runCLI",
  591. value: function runCLI(argv) {
  592. new JavaScriptObfuscatorCLI_1.JavaScriptObfuscatorCLI(argv).run();
  593. }
  594. }]);
  595. return JavaScriptObfuscator;
  596. }();
  597. exports.JavaScriptObfuscator = JavaScriptObfuscator;
  598. /***/ },
  599. /* 10 */
  600. /***/ function(module, exports) {
  601. module.exports = require("escodegen");
  602. /***/ },
  603. /* 11 */
  604. /***/ function(module, exports) {
  605. "use strict";
  606. "use strict";
  607. exports.SourceMapMode = {
  608. Inline: 'inline',
  609. Separate: 'separate'
  610. };
  611. /***/ },
  612. /* 12 */
  613. /***/ function(module, exports) {
  614. "use strict";
  615. "use strict";
  616. 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; }; }();
  617. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  618. var NodesGroup = function () {
  619. function NodesGroup(options) {
  620. _classCallCheck(this, NodesGroup);
  621. this.nodes = new Map();
  622. this.options = options;
  623. }
  624. _createClass(NodesGroup, [{
  625. key: "getNodes",
  626. value: function getNodes() {
  627. return this.nodes;
  628. }
  629. }]);
  630. return NodesGroup;
  631. }();
  632. exports.NodesGroup = NodesGroup;
  633. /***/ },
  634. /* 13 */
  635. /***/ function(module, exports, __webpack_require__) {
  636. "use strict";
  637. "use strict";
  638. var SourceMapMode_1 = __webpack_require__(11);
  639. exports.NO_CUSTOM_NODES_PRESET = Object.freeze({
  640. compact: true,
  641. debugProtection: false,
  642. debugProtectionInterval: false,
  643. disableConsoleOutput: false,
  644. encodeUnicodeLiterals: false,
  645. reservedNames: [],
  646. rotateUnicodeArray: false,
  647. selfDefending: false,
  648. sourceMap: false,
  649. sourceMapMode: SourceMapMode_1.SourceMapMode.Separate,
  650. unicodeArray: false,
  651. unicodeArrayThreshold: 0,
  652. wrapUnicodeArrayCalls: false
  653. });
  654. /***/ },
  655. /* 14 */
  656. /***/ function(module, exports, __webpack_require__) {
  657. "use strict";
  658. "use strict";
  659. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  660. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  661. var esprima = __webpack_require__(18);
  662. var escodegen = __webpack_require__(10);
  663. var ObfuscationResult_1 = __webpack_require__(15);
  664. var Obfuscator_1 = __webpack_require__(21);
  665. var Options_1 = __webpack_require__(47);
  666. var SourceMapCorrector_1 = __webpack_require__(22);
  667. var JavaScriptObfuscatorInternal = function () {
  668. function JavaScriptObfuscatorInternal(sourceCode, obfuscatorOptions) {
  669. _classCallCheck(this, JavaScriptObfuscatorInternal);
  670. this.sourceMapUrl = '';
  671. this.sourceCode = sourceCode;
  672. if (obfuscatorOptions) {
  673. this.options = new Options_1.Options(obfuscatorOptions);
  674. }
  675. }
  676. _createClass(JavaScriptObfuscatorInternal, [{
  677. key: 'getObfuscationResult',
  678. value: function getObfuscationResult() {
  679. return new SourceMapCorrector_1.SourceMapCorrector(new ObfuscationResult_1.ObfuscationResult(this.generatorOutput.code, this.generatorOutput.map), this.sourceMapUrl, this.options.sourceMapMode).correct();
  680. }
  681. }, {
  682. key: 'obfuscate',
  683. value: function obfuscate() {
  684. var astTree = esprima.parse(this.sourceCode, {
  685. loc: true
  686. });
  687. astTree = new Obfuscator_1.Obfuscator(this.options).obfuscateNode(astTree);
  688. this.generatorOutput = JavaScriptObfuscatorInternal.generateCode(this.sourceCode, astTree, this.options);
  689. }
  690. }, {
  691. key: 'setSourceMapUrl',
  692. value: function setSourceMapUrl(url) {
  693. this.sourceMapUrl = url;
  694. }
  695. }], [{
  696. key: 'generateCode',
  697. value: function generateCode(sourceCode, astTree, options) {
  698. var escodegenParams = Object.assign({}, JavaScriptObfuscatorInternal.escodegenParams),
  699. generatorOutput = void 0;
  700. if (options.sourceMap) {
  701. escodegenParams.sourceMap = 'sourceMap';
  702. escodegenParams.sourceContent = sourceCode;
  703. }
  704. escodegenParams.format = {
  705. compact: options.compact
  706. };
  707. generatorOutput = escodegen.generate(astTree, escodegenParams);
  708. generatorOutput.map = generatorOutput.map ? generatorOutput.map.toString() : '';
  709. return generatorOutput;
  710. }
  711. }]);
  712. return JavaScriptObfuscatorInternal;
  713. }();
  714. JavaScriptObfuscatorInternal.escodegenParams = {
  715. verbatim: 'x-verbatim-property',
  716. sourceMapWithCode: true
  717. };
  718. exports.JavaScriptObfuscatorInternal = JavaScriptObfuscatorInternal;
  719. /***/ },
  720. /* 15 */
  721. /***/ function(module, exports) {
  722. "use strict";
  723. "use strict";
  724. 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; }; }();
  725. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  726. var ObfuscationResult = function () {
  727. function ObfuscationResult(obfuscatedCode, sourceMap) {
  728. _classCallCheck(this, ObfuscationResult);
  729. this.obfuscatedCode = obfuscatedCode;
  730. this.sourceMap = sourceMap;
  731. }
  732. _createClass(ObfuscationResult, [{
  733. key: "getObfuscatedCode",
  734. value: function getObfuscatedCode() {
  735. return this.obfuscatedCode;
  736. }
  737. }, {
  738. key: "getSourceMap",
  739. value: function getSourceMap() {
  740. return this.sourceMap;
  741. }
  742. }, {
  743. key: "toString",
  744. value: function toString() {
  745. return this.obfuscatedCode;
  746. }
  747. }]);
  748. return ObfuscationResult;
  749. }();
  750. exports.ObfuscationResult = ObfuscationResult;
  751. /***/ },
  752. /* 16 */
  753. /***/ function(module, exports) {
  754. "use strict";
  755. "use strict";
  756. exports.JSFuck = {
  757. Window: '[]["filter"]["constructor"]("return this")()',
  758. False: '![]',
  759. True: '!![]',
  760. a: '(false+"")[1]',
  761. b: '([]["entries"]()+"")[2]',
  762. c: '([]["fill"]+"")[3]',
  763. d: '(undefined+"")[2]',
  764. e: '(true+"")[3]',
  765. f: '(false+"")[0]',
  766. g: '(false+[0]+String)[20]',
  767. h: '(+(101))["to"+String["name"]](21)[1]',
  768. i: '([false]+undefined)[10]',
  769. j: '([]["entries"]()+"")[3]',
  770. k: '(+(20))["to"+String["name"]](21)',
  771. l: '(false+"")[2]',
  772. m: '(Number+"")[11]',
  773. n: '(undefined+"")[1]',
  774. o: '(true+[]["fill"])[10]',
  775. p: '(+(211))["to"+String["name"]](31)[1]',
  776. q: '(+(212))["to"+String["name"]](31)[1]',
  777. r: '(true+"")[1]',
  778. s: '(false+"")[3]',
  779. t: '(true+"")[0]',
  780. u: '(undefined+"")[0]',
  781. v: '(+(31))["to"+String["name"]](32)',
  782. w: '(+(32))["to"+String["name"]](33)',
  783. x: '(+(101))["to"+String["name"]](34)[1]',
  784. y: '(NaN+[Infinity])[10]',
  785. z: '(+(35))["to"+String["name"]](36)',
  786. A: '(+[]+Array)[10]',
  787. B: '(+[]+Boolean)[10]',
  788. C: 'Function("return escape")()(("")["italics"]())[2]',
  789. D: 'Function("return escape")()([]["fill"])["slice"]("-1")',
  790. E: '(RegExp+"")[12]',
  791. F: '(+[]+Function)[10]',
  792. G: '(false+Function("return Date")()())[30]',
  793. H: '\'H\'',
  794. I: '(Infinity+"")[0]',
  795. J: '\'J\'',
  796. K: '\'K\'',
  797. L: '\'L\'',
  798. M: '(true+Function("return Date")()())[30]',
  799. N: '(NaN+"")[0]',
  800. O: '(NaN+Function("return{}")())[11]',
  801. P: '\'P\'',
  802. Q: '\'Q\'',
  803. R: '(+[]+RegExp)[10]',
  804. S: '(+[]+String)[10]',
  805. T: '(NaN+Function("return Date")()())[30]',
  806. U: '(NaN+Function("return{}")()["to"+String["name"]]["call"]())[11]',
  807. V: '\'V\'',
  808. W: '\'W\'',
  809. X: '\'X\'',
  810. Y: '\'Y\'',
  811. Z: '\'Z\''
  812. };
  813. /***/ },
  814. /* 17 */
  815. /***/ function(module, exports, __webpack_require__) {
  816. "use strict";
  817. "use strict";
  818. var SourceMapMode_1 = __webpack_require__(11);
  819. exports.DEFAULT_PRESET = Object.freeze({
  820. compact: true,
  821. debugProtection: false,
  822. debugProtectionInterval: false,
  823. disableConsoleOutput: true,
  824. encodeUnicodeLiterals: false,
  825. reservedNames: [],
  826. rotateUnicodeArray: true,
  827. selfDefending: true,
  828. sourceMap: false,
  829. sourceMapMode: SourceMapMode_1.SourceMapMode.Separate,
  830. unicodeArray: true,
  831. unicodeArrayThreshold: 0.8,
  832. wrapUnicodeArrayCalls: true
  833. });
  834. /***/ },
  835. /* 18 */
  836. /***/ function(module, exports) {
  837. module.exports = require("esprima");
  838. /***/ },
  839. /* 19 */
  840. /***/ function(module, exports) {
  841. module.exports = require("path");
  842. /***/ },
  843. /* 20 */
  844. /***/ function(module, exports) {
  845. module.exports = require("babel-polyfill");
  846. /***/ },
  847. /* 21 */
  848. /***/ function(module, exports, __webpack_require__) {
  849. "use strict";
  850. "use strict";
  851. 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; }; }();
  852. function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
  853. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  854. var estraverse = __webpack_require__(4);
  855. var AppendState_1 = __webpack_require__(2);
  856. var NodeType_1 = __webpack_require__(7);
  857. var CatchClauseObfuscator_1 = __webpack_require__(39);
  858. var ConsoleOutputNodesGroup_1 = __webpack_require__(35);
  859. var DebugProtectionNodesGroup_1 = __webpack_require__(36);
  860. var FunctionDeclarationObfuscator_1 = __webpack_require__(40);
  861. var FunctionObfuscator_1 = __webpack_require__(41);
  862. var LiteralObfuscator_1 = __webpack_require__(42);
  863. var MemberExpressionObfuscator_1 = __webpack_require__(43);
  864. var MethodDefinitionObfuscator_1 = __webpack_require__(44);
  865. var Nodes_1 = __webpack_require__(6);
  866. var NodeUtils_1 = __webpack_require__(1);
  867. var ObjectExpressionObfuscator_1 = __webpack_require__(45);
  868. var SelfDefendingNodesGroup_1 = __webpack_require__(37);
  869. var UnicodeArrayNodesGroup_1 = __webpack_require__(38);
  870. var VariableDeclarationObfuscator_1 = __webpack_require__(46);
  871. var Obfuscator = function () {
  872. function Obfuscator(options) {
  873. _classCallCheck(this, Obfuscator);
  874. 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]]]);
  875. this.options = options;
  876. this.nodes = new Map([].concat(_toConsumableArray(new SelfDefendingNodesGroup_1.SelfDefendingNodesGroup(this.options).getNodes()), _toConsumableArray(new ConsoleOutputNodesGroup_1.ConsoleOutputNodesGroup(this.options).getNodes()), _toConsumableArray(new DebugProtectionNodesGroup_1.DebugProtectionNodesGroup(this.options).getNodes()), _toConsumableArray(new UnicodeArrayNodesGroup_1.UnicodeArrayNodesGroup(this.options).getNodes())));
  877. }
  878. _createClass(Obfuscator, [{
  879. key: 'obfuscateNode',
  880. value: function obfuscateNode(node) {
  881. if (Nodes_1.Nodes.isProgramNode(node) && !node.body.length) {
  882. return node;
  883. }
  884. NodeUtils_1.NodeUtils.parentize(node);
  885. this.beforeObfuscation(node);
  886. this.obfuscate(node);
  887. this.afterObfuscation(node);
  888. return node;
  889. }
  890. }, {
  891. key: 'afterObfuscation',
  892. value: function afterObfuscation(astTree) {
  893. this.nodes.forEach(function (node) {
  894. if (node.getAppendState() === AppendState_1.AppendState.AfterObfuscation) {
  895. node.appendNode(astTree);
  896. }
  897. });
  898. }
  899. }, {
  900. key: 'beforeObfuscation',
  901. value: function beforeObfuscation(astTree) {
  902. this.nodes.forEach(function (node) {
  903. if (node.getAppendState() === AppendState_1.AppendState.BeforeObfuscation) {
  904. node.appendNode(astTree);
  905. }
  906. });
  907. }
  908. }, {
  909. key: 'initializeNodeObfuscators',
  910. value: function initializeNodeObfuscators(node, parentNode) {
  911. var _this = this;
  912. var nodeObfuscators = this.nodeObfuscators.get(node.type);
  913. if (!nodeObfuscators) {
  914. return;
  915. }
  916. nodeObfuscators.forEach(function (obfuscator) {
  917. new obfuscator(_this.nodes, _this.options).obfuscateNode(node, parentNode);
  918. });
  919. }
  920. }, {
  921. key: 'obfuscate',
  922. value: function obfuscate(node) {
  923. var _this2 = this;
  924. estraverse.replace(node, {
  925. leave: function leave(node, parentNode) {
  926. _this2.initializeNodeObfuscators(node, parentNode);
  927. }
  928. });
  929. }
  930. }]);
  931. return Obfuscator;
  932. }();
  933. exports.Obfuscator = Obfuscator;
  934. /***/ },
  935. /* 22 */
  936. /***/ function(module, exports, __webpack_require__) {
  937. "use strict";
  938. "use strict";
  939. 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; }; }();
  940. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  941. var SourceMapMode_1 = __webpack_require__(11);
  942. var ObfuscationResult_1 = __webpack_require__(15);
  943. var Utils_1 = __webpack_require__(0);
  944. var SourceMapCorrector = function () {
  945. function SourceMapCorrector(obfuscationResult, sourceMapUrl, sourceMapMode) {
  946. _classCallCheck(this, SourceMapCorrector);
  947. this.obfuscatedCode = obfuscationResult.getObfuscatedCode();
  948. this.sourceMap = obfuscationResult.getSourceMap();
  949. this.sourceMapUrl = sourceMapUrl;
  950. this.sourceMapMode = sourceMapMode;
  951. }
  952. _createClass(SourceMapCorrector, [{
  953. key: "correct",
  954. value: function correct() {
  955. return new ObfuscationResult_1.ObfuscationResult(this.correctObfuscatedCode(), this.correctSourceMap());
  956. }
  957. }, {
  958. key: "correctObfuscatedCode",
  959. value: function correctObfuscatedCode() {
  960. if (!this.sourceMap) {
  961. return this.obfuscatedCode;
  962. }
  963. var sourceMappingUrl = '//# sourceMappingURL=';
  964. switch (this.sourceMapMode) {
  965. case SourceMapMode_1.SourceMapMode.Inline:
  966. sourceMappingUrl += "data:application/json;base64," + Utils_1.Utils.btoa(this.sourceMapUrl || this.sourceMap, false);
  967. break;
  968. case SourceMapMode_1.SourceMapMode.Separate:
  969. default:
  970. if (this.sourceMapUrl) {
  971. sourceMappingUrl += this.sourceMapUrl;
  972. break;
  973. }
  974. return this.obfuscatedCode;
  975. }
  976. return this.obfuscatedCode + "\n" + sourceMappingUrl;
  977. }
  978. }, {
  979. key: "correctSourceMap",
  980. value: function correctSourceMap() {
  981. if (this.sourceMapMode === SourceMapMode_1.SourceMapMode.Inline) {
  982. return '';
  983. }
  984. return this.sourceMap;
  985. }
  986. }]);
  987. return SourceMapCorrector;
  988. }();
  989. exports.SourceMapCorrector = SourceMapCorrector;
  990. /***/ },
  991. /* 23 */
  992. /***/ function(module, exports, __webpack_require__) {
  993. "use strict";
  994. "use strict";
  995. 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; }; }();
  996. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  997. var Utils_1 = __webpack_require__(0);
  998. var UnicodeArray = function () {
  999. function UnicodeArray() {
  1000. _classCallCheck(this, UnicodeArray);
  1001. this.array = [];
  1002. }
  1003. _createClass(UnicodeArray, [{
  1004. key: "addToArray",
  1005. value: function addToArray(value) {
  1006. this.array.push(value);
  1007. }
  1008. }, {
  1009. key: "getArray",
  1010. value: function getArray() {
  1011. return this.array;
  1012. }
  1013. }, {
  1014. key: "getIndexOf",
  1015. value: function getIndexOf(value) {
  1016. return this.array.indexOf(value);
  1017. }
  1018. }, {
  1019. key: "getLength",
  1020. value: function getLength() {
  1021. return this.array.length;
  1022. }
  1023. }, {
  1024. key: "rotateArray",
  1025. value: function rotateArray(rotationValue) {
  1026. this.array = Utils_1.Utils.arrayRotate(this.array, rotationValue);
  1027. }
  1028. }, {
  1029. key: "toString",
  1030. value: function toString() {
  1031. return this.array.toString();
  1032. }
  1033. }]);
  1034. return UnicodeArray;
  1035. }();
  1036. exports.UnicodeArray = UnicodeArray;
  1037. /***/ },
  1038. /* 24 */
  1039. /***/ function(module, exports, __webpack_require__) {
  1040. "use strict";
  1041. "use strict";
  1042. 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; }; }();
  1043. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1044. var fs = __webpack_require__(65);
  1045. var mkdirp = __webpack_require__(66);
  1046. var path = __webpack_require__(19);
  1047. var Utils_1 = __webpack_require__(0);
  1048. var CLIUtils = function () {
  1049. function CLIUtils() {
  1050. _classCallCheck(this, CLIUtils);
  1051. }
  1052. _createClass(CLIUtils, null, [{
  1053. key: 'getOutputCodePath',
  1054. value: function getOutputCodePath(outputPath, inputPath) {
  1055. if (outputPath) {
  1056. return outputPath;
  1057. }
  1058. return inputPath.split('.').map(function (value, index) {
  1059. return index === 0 ? value + '-obfuscated' : value;
  1060. }).join('.');
  1061. }
  1062. }, {
  1063. key: 'getOutputSourceMapPath',
  1064. value: function getOutputSourceMapPath(outputCodePath) {
  1065. return outputCodePath.split('.').map(function (value, index, array) {
  1066. return index === array.length - 1 ? value + '.map' : value;
  1067. }).join('.');
  1068. }
  1069. }, {
  1070. key: 'getPackageConfig',
  1071. value: function getPackageConfig() {
  1072. return JSON.parse(fs.readFileSync(path.join(path.dirname(fs.realpathSync(process.argv[1])), '../package.json'), CLIUtils.encoding));
  1073. }
  1074. }, {
  1075. key: 'isFilePath',
  1076. value: function isFilePath(filePath) {
  1077. try {
  1078. return fs.statSync(filePath).isFile();
  1079. } catch (e) {
  1080. return false;
  1081. }
  1082. }
  1083. }, {
  1084. key: 'readFile',
  1085. value: function readFile(inputPath) {
  1086. return fs.readFileSync(inputPath, CLIUtils.encoding);
  1087. }
  1088. }, {
  1089. key: 'validateInputPath',
  1090. value: function validateInputPath(inputPath) {
  1091. if (!CLIUtils.isFilePath(inputPath)) {
  1092. throw new ReferenceError('Given input path must be a valid file path');
  1093. }
  1094. if (!Utils_1.Utils.arrayContains(CLIUtils.availableInputExtensions, path.extname(inputPath))) {
  1095. throw new ReferenceError('Input file must have .js extension');
  1096. }
  1097. }
  1098. }, {
  1099. key: 'writeFile',
  1100. value: function writeFile(outputPath, data) {
  1101. mkdirp.sync(path.dirname(outputPath));
  1102. fs.writeFileSync(outputPath, data, {
  1103. encoding: CLIUtils.encoding
  1104. });
  1105. }
  1106. }]);
  1107. return CLIUtils;
  1108. }();
  1109. CLIUtils.availableInputExtensions = ['.js'];
  1110. CLIUtils.encoding = 'utf8';
  1111. exports.CLIUtils = CLIUtils;
  1112. /***/ },
  1113. /* 25 */
  1114. /***/ function(module, exports, __webpack_require__) {
  1115. "use strict";
  1116. "use strict";
  1117. 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; }; }();
  1118. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1119. var commander = __webpack_require__(64);
  1120. var path = __webpack_require__(19);
  1121. var SourceMapMode_1 = __webpack_require__(11);
  1122. var DefaultPreset_1 = __webpack_require__(17);
  1123. var CLIUtils_1 = __webpack_require__(24);
  1124. var JavaScriptObfuscator_1 = __webpack_require__(9);
  1125. var JavaScriptObfuscatorInternal_1 = __webpack_require__(14);
  1126. var Utils_1 = __webpack_require__(0);
  1127. var JavaScriptObfuscatorCLI = function () {
  1128. function JavaScriptObfuscatorCLI(argv) {
  1129. _classCallCheck(this, JavaScriptObfuscatorCLI);
  1130. this.data = '';
  1131. this.rawArguments = argv;
  1132. this.arguments = this.rawArguments.slice(2);
  1133. }
  1134. _createClass(JavaScriptObfuscatorCLI, [{
  1135. key: 'run',
  1136. value: function run() {
  1137. this.configureCommands();
  1138. if (!this.arguments.length || Utils_1.Utils.arrayContains(this.arguments, '--help')) {
  1139. this.commands.outputHelp();
  1140. return;
  1141. }
  1142. this.inputPath = this.arguments[0];
  1143. CLIUtils_1.CLIUtils.validateInputPath(this.inputPath);
  1144. this.getData();
  1145. this.processData();
  1146. }
  1147. }, {
  1148. key: 'buildOptions',
  1149. value: function buildOptions() {
  1150. var obfuscatorOptions = {},
  1151. availableOptions = Object.keys(DefaultPreset_1.DEFAULT_PRESET);
  1152. for (var option in this.commands) {
  1153. if (!this.commands.hasOwnProperty(option)) {
  1154. continue;
  1155. }
  1156. if (!Utils_1.Utils.arrayContains(availableOptions, option)) {
  1157. continue;
  1158. }
  1159. obfuscatorOptions[option] = this.commands[option];
  1160. }
  1161. return Object.assign({}, DefaultPreset_1.DEFAULT_PRESET, obfuscatorOptions);
  1162. }
  1163. }, {
  1164. key: 'configureCommands',
  1165. value: function configureCommands() {
  1166. this.commands = new commander.Command().version(JavaScriptObfuscatorCLI.getBuildVersion(), '-v, --version').usage('<inputPath> [options]').option('-o, --output <path>', 'Output path for obfuscated code').option('--compact <boolean>', 'Disable one line output code compacting', JavaScriptObfuscatorCLI.parseBoolean).option('--debugProtection <boolean>', 'Disable browser Debug panel (can cause DevTools enabled browser freeze)', JavaScriptObfuscatorCLI.parseBoolean).option('--debugProtectionInterval <boolean>', 'Disable browser Debug panel even after page was loaded (can cause DevTools enabled browser freeze)', JavaScriptObfuscatorCLI.parseBoolean).option('--disableConsoleOutput <boolean>', 'Allow console.log, console.info, console.error and console.warn messages output into browser console', JavaScriptObfuscatorCLI.parseBoolean).option('--encodeUnicodeLiterals <boolean>', 'All literals in Unicode array become encoded in Base64 (this option can slightly slow down your code speed)', JavaScriptObfuscatorCLI.parseBoolean).option('--reservedNames <list>', 'Disable obfuscation of variable names, function names and names of function parameters that match the passed RegExp patterns (comma separated)', function (val) {
  1167. return val.split(',');
  1168. }).option('--rotateUnicodeArray <boolean>', 'Disable rotation of unicode array values during obfuscation', JavaScriptObfuscatorCLI.parseBoolean).option('--selfDefending <boolean>', 'Disables self-defending for obfuscated code', JavaScriptObfuscatorCLI.parseBoolean).option('--sourceMap <boolean>', 'Enables source map generation', JavaScriptObfuscatorCLI.parseBoolean).option('--sourceMapMode <string> [inline, separate]', 'Specify source map output mode', JavaScriptObfuscatorCLI.parseSourceMapMode).option('--unicodeArray <boolean>', 'Disables gathering of all literal strings into an array and replacing every literal string with an array call', JavaScriptObfuscatorCLI.parseBoolean).option('--unicodeArrayThreshold <number>', 'The probability that the literal string will be inserted into unicodeArray (Default: 0.8, Min: 0, Max: 1)', parseFloat).option('--wrapUnicodeArrayCalls <boolean>', 'Disables usage of special access function instead of direct array call', JavaScriptObfuscatorCLI.parseBoolean).parse(this.rawArguments);
  1169. this.commands.on('--help', function () {
  1170. console.log(' Examples:\n');
  1171. console.log(' %> javascript-obfuscator in.js --compact true --selfDefending false');
  1172. console.log(' %> javascript-obfuscator in.js --output out.js --compact true --selfDefending false');
  1173. console.log('');
  1174. });
  1175. }
  1176. }, {
  1177. key: 'getData',
  1178. value: function getData() {
  1179. this.data = CLIUtils_1.CLIUtils.readFile(this.inputPath);
  1180. }
  1181. }, {
  1182. key: 'processData',
  1183. value: function processData() {
  1184. var options = this.buildOptions(),
  1185. outputCodePath = CLIUtils_1.CLIUtils.getOutputCodePath(this.commands.output, this.inputPath);
  1186. if (options.sourceMap) {
  1187. this.processDataWithSourceMap(outputCodePath, options);
  1188. } else {
  1189. this.processDataWithoutSourceMap(outputCodePath, options);
  1190. }
  1191. }
  1192. }, {
  1193. key: 'processDataWithoutSourceMap',
  1194. value: function processDataWithoutSourceMap(outputCodePath, options) {
  1195. var obfuscatedCode = JavaScriptObfuscator_1.JavaScriptObfuscator.obfuscate(this.data, options).getObfuscatedCode();
  1196. CLIUtils_1.CLIUtils.writeFile(outputCodePath, obfuscatedCode);
  1197. }
  1198. }, {
  1199. key: 'processDataWithSourceMap',
  1200. value: function processDataWithSourceMap(outputCodePath, options) {
  1201. var javaScriptObfuscator = new JavaScriptObfuscatorInternal_1.JavaScriptObfuscatorInternal(this.data, options),
  1202. obfuscationResult = void 0,
  1203. outputSourceMapPath = CLIUtils_1.CLIUtils.getOutputSourceMapPath(outputCodePath);
  1204. javaScriptObfuscator.obfuscate();
  1205. if (options.sourceMapMode === SourceMapMode_1.SourceMapMode.Separate) {
  1206. javaScriptObfuscator.setSourceMapUrl(path.basename(outputSourceMapPath));
  1207. }
  1208. obfuscationResult = javaScriptObfuscator.getObfuscationResult();
  1209. CLIUtils_1.CLIUtils.writeFile(outputCodePath, obfuscationResult.getObfuscatedCode());
  1210. if (obfuscationResult.getSourceMap()) {
  1211. CLIUtils_1.CLIUtils.writeFile(outputSourceMapPath, obfuscationResult.getSourceMap());
  1212. }
  1213. }
  1214. }], [{
  1215. key: 'getBuildVersion',
  1216. value: function getBuildVersion() {
  1217. return CLIUtils_1.CLIUtils.getPackageConfig().version;
  1218. }
  1219. }, {
  1220. key: 'parseBoolean',
  1221. value: function parseBoolean(value) {
  1222. return value === 'true' || value === '1';
  1223. }
  1224. }, {
  1225. key: 'parseSourceMapMode',
  1226. value: function parseSourceMapMode(value) {
  1227. var availableMode = Object.keys(SourceMapMode_1.SourceMapMode).some(function (key) {
  1228. return SourceMapMode_1.SourceMapMode[key] === value;
  1229. });
  1230. if (!availableMode) {
  1231. throw new ReferenceError('Invalid value of `--sourceMapMode` option');
  1232. }
  1233. return value;
  1234. }
  1235. }]);
  1236. return JavaScriptObfuscatorCLI;
  1237. }();
  1238. exports.JavaScriptObfuscatorCLI = JavaScriptObfuscatorCLI;
  1239. /***/ },
  1240. /* 26 */
  1241. /***/ function(module, exports, __webpack_require__) {
  1242. "use strict";
  1243. "use strict";
  1244. 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; }; }();
  1245. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1246. 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; }
  1247. 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; }
  1248. var AppendState_1 = __webpack_require__(2);
  1249. var ConsoleOutputDisableExpressionTemplate_1 = __webpack_require__(51);
  1250. var Node_1 = __webpack_require__(3);
  1251. var NodeUtils_1 = __webpack_require__(1);
  1252. var ConsoleOutputDisableExpressionNode = function (_Node_1$Node) {
  1253. _inherits(ConsoleOutputDisableExpressionNode, _Node_1$Node);
  1254. function ConsoleOutputDisableExpressionNode() {
  1255. var _Object$getPrototypeO;
  1256. _classCallCheck(this, ConsoleOutputDisableExpressionNode);
  1257. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  1258. args[_key] = arguments[_key];
  1259. }
  1260. var _this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(ConsoleOutputDisableExpressionNode)).call.apply(_Object$getPrototypeO, [this].concat(args)));
  1261. _this.appendState = AppendState_1.AppendState.BeforeObfuscation;
  1262. return _this;
  1263. }
  1264. _createClass(ConsoleOutputDisableExpressionNode, [{
  1265. key: "appendNode",
  1266. value: function appendNode(blockScopeNode) {
  1267. NodeUtils_1.NodeUtils.prependNode(blockScopeNode.body, this.getNode());
  1268. }
  1269. }, {
  1270. key: "getNodeStructure",
  1271. value: function getNodeStructure() {
  1272. return NodeUtils_1.NodeUtils.convertCodeToStructure(ConsoleOutputDisableExpressionTemplate_1.ConsoleOutputDisableExpressionTemplate());
  1273. }
  1274. }]);
  1275. return ConsoleOutputDisableExpressionNode;
  1276. }(Node_1.Node);
  1277. exports.ConsoleOutputDisableExpressionNode = ConsoleOutputDisableExpressionNode;
  1278. /***/ },
  1279. /* 27 */
  1280. /***/ function(module, exports, __webpack_require__) {
  1281. "use strict";
  1282. "use strict";
  1283. 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; }; }();
  1284. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1285. 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; }
  1286. 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; }
  1287. __webpack_require__(8);
  1288. var AppendState_1 = __webpack_require__(2);
  1289. var DebufProtectionFunctionCallTemplate_1 = __webpack_require__(52);
  1290. var Node_1 = __webpack_require__(3);
  1291. var NodeUtils_1 = __webpack_require__(1);
  1292. var DebugProtectionFunctionCallNode = function (_Node_1$Node) {
  1293. _inherits(DebugProtectionFunctionCallNode, _Node_1$Node);
  1294. function DebugProtectionFunctionCallNode(debugProtectionFunctionName, options) {
  1295. _classCallCheck(this, DebugProtectionFunctionCallNode);
  1296. var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(DebugProtectionFunctionCallNode).call(this, options));
  1297. _this.appendState = AppendState_1.AppendState.BeforeObfuscation;
  1298. _this.debugProtectionFunctionName = debugProtectionFunctionName;
  1299. return _this;
  1300. }
  1301. _createClass(DebugProtectionFunctionCallNode, [{
  1302. key: "appendNode",
  1303. value: function appendNode(blockScopeNode) {
  1304. NodeUtils_1.NodeUtils.appendNode(blockScopeNode.body, this.getNode());
  1305. }
  1306. }, {
  1307. key: "getNodeStructure",
  1308. value: function getNodeStructure() {
  1309. return NodeUtils_1.NodeUtils.convertCodeToStructure(DebufProtectionFunctionCallTemplate_1.DebugProtectionFunctionCallTemplate().formatUnicorn({
  1310. debugProtectionFunctionName: this.debugProtectionFunctionName
  1311. }));
  1312. }
  1313. }]);
  1314. return DebugProtectionFunctionCallNode;
  1315. }(Node_1.Node);
  1316. exports.DebugProtectionFunctionCallNode = DebugProtectionFunctionCallNode;
  1317. /***/ },
  1318. /* 28 */
  1319. /***/ function(module, exports, __webpack_require__) {
  1320. "use strict";
  1321. "use strict";
  1322. 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; }; }();
  1323. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1324. 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; }
  1325. 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; }
  1326. __webpack_require__(8);
  1327. var AppendState_1 = __webpack_require__(2);
  1328. var DebugProtectionFunctionIntervalTemplate_1 = __webpack_require__(53);
  1329. var Node_1 = __webpack_require__(3);
  1330. var NodeUtils_1 = __webpack_require__(1);
  1331. var DebugProtectionFunctionIntervalNode = function (_Node_1$Node) {
  1332. _inherits(DebugProtectionFunctionIntervalNode, _Node_1$Node);
  1333. function DebugProtectionFunctionIntervalNode(debugProtectionFunctionName, options) {
  1334. _classCallCheck(this, DebugProtectionFunctionIntervalNode);
  1335. var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(DebugProtectionFunctionIntervalNode).call(this, options));
  1336. _this.appendState = AppendState_1.AppendState.BeforeObfuscation;
  1337. _this.debugProtectionFunctionName = debugProtectionFunctionName;
  1338. return _this;
  1339. }
  1340. _createClass(DebugProtectionFunctionIntervalNode, [{
  1341. key: "appendNode",
  1342. value: function appendNode(blockScopeNode) {
  1343. NodeUtils_1.NodeUtils.appendNode(blockScopeNode.body, this.getNode());
  1344. }
  1345. }, {
  1346. key: "getNodeStructure",
  1347. value: function getNodeStructure() {
  1348. return NodeUtils_1.NodeUtils.convertCodeToStructure(DebugProtectionFunctionIntervalTemplate_1.DebugProtectionFunctionIntervalTemplate().formatUnicorn({
  1349. debugProtectionFunctionName: this.debugProtectionFunctionName
  1350. }));
  1351. }
  1352. }]);
  1353. return DebugProtectionFunctionIntervalNode;
  1354. }(Node_1.Node);
  1355. exports.DebugProtectionFunctionIntervalNode = DebugProtectionFunctionIntervalNode;
  1356. /***/ },
  1357. /* 29 */
  1358. /***/ function(module, exports, __webpack_require__) {
  1359. "use strict";
  1360. "use strict";
  1361. 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; }; }();
  1362. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1363. 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; }
  1364. 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; }
  1365. __webpack_require__(8);
  1366. var AppendState_1 = __webpack_require__(2);
  1367. var DebugProtectionFunctionTemplate_1 = __webpack_require__(54);
  1368. var Node_1 = __webpack_require__(3);
  1369. var NodeUtils_1 = __webpack_require__(1);
  1370. var Utils_1 = __webpack_require__(0);
  1371. var DebugProtectionFunctionNode = function (_Node_1$Node) {
  1372. _inherits(DebugProtectionFunctionNode, _Node_1$Node);
  1373. function DebugProtectionFunctionNode(debugProtectionFunctionName, options) {
  1374. _classCallCheck(this, DebugProtectionFunctionNode);
  1375. var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(DebugProtectionFunctionNode).call(this, options));
  1376. _this.appendState = AppendState_1.AppendState.BeforeObfuscation;
  1377. _this.debugProtectionFunctionName = debugProtectionFunctionName;
  1378. return _this;
  1379. }
  1380. _createClass(DebugProtectionFunctionNode, [{
  1381. key: "appendNode",
  1382. value: function appendNode(blockScopeNode) {
  1383. var programBodyLength = blockScopeNode.body.length,
  1384. randomIndex = Utils_1.Utils.getRandomGenerator().integer({
  1385. min: 0,
  1386. max: programBodyLength
  1387. });
  1388. NodeUtils_1.NodeUtils.insertNodeAtIndex(blockScopeNode.body, this.getNode(), randomIndex);
  1389. }
  1390. }, {
  1391. key: "getNodeIdentifier",
  1392. value: function getNodeIdentifier() {
  1393. return this.debugProtectionFunctionName;
  1394. }
  1395. }, {
  1396. key: "getNodeStructure",
  1397. value: function getNodeStructure() {
  1398. return NodeUtils_1.NodeUtils.convertCodeToStructure(DebugProtectionFunctionTemplate_1.DebugProtectionFunctionTemplate().formatUnicorn({
  1399. debugProtectionFunctionName: this.debugProtectionFunctionName
  1400. }));
  1401. }
  1402. }]);
  1403. return DebugProtectionFunctionNode;
  1404. }(Node_1.Node);
  1405. exports.DebugProtectionFunctionNode = DebugProtectionFunctionNode;
  1406. /***/ },
  1407. /* 30 */
  1408. /***/ function(module, exports, __webpack_require__) {
  1409. "use strict";
  1410. "use strict";
  1411. 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; }; }();
  1412. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1413. 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; }
  1414. 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; }
  1415. var AppendState_1 = __webpack_require__(2);
  1416. var NoCustomNodesPreset_1 = __webpack_require__(13);
  1417. var SelfDefendingTemplate_1 = __webpack_require__(55);
  1418. var JavaScriptObfuscator_1 = __webpack_require__(9);
  1419. var Node_1 = __webpack_require__(3);
  1420. var NodeUtils_1 = __webpack_require__(1);
  1421. var Utils_1 = __webpack_require__(0);
  1422. var SelfDefendingUnicodeNode = function (_Node_1$Node) {
  1423. _inherits(SelfDefendingUnicodeNode, _Node_1$Node);
  1424. function SelfDefendingUnicodeNode() {
  1425. var _Object$getPrototypeO;
  1426. _classCallCheck(this, SelfDefendingUnicodeNode);
  1427. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  1428. args[_key] = arguments[_key];
  1429. }
  1430. var _this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(SelfDefendingUnicodeNode)).call.apply(_Object$getPrototypeO, [this].concat(args)));
  1431. _this.appendState = AppendState_1.AppendState.AfterObfuscation;
  1432. return _this;
  1433. }
  1434. _createClass(SelfDefendingUnicodeNode, [{
  1435. key: "appendNode",
  1436. value: function appendNode(blockScopeNode) {
  1437. var programBodyLength = blockScopeNode.body.length,
  1438. randomIndex = 0;
  1439. if (programBodyLength > 2) {
  1440. randomIndex = Utils_1.Utils.getRandomGenerator().integer({
  1441. min: programBodyLength / 2,
  1442. max: programBodyLength - 1
  1443. });
  1444. }
  1445. NodeUtils_1.NodeUtils.insertNodeAtIndex(blockScopeNode.body, this.getNode(), randomIndex);
  1446. }
  1447. }, {
  1448. key: "getNodeStructure",
  1449. value: function getNodeStructure() {
  1450. return NodeUtils_1.NodeUtils.convertCodeToStructure(JavaScriptObfuscator_1.JavaScriptObfuscator.obfuscate(SelfDefendingTemplate_1.SelfDefendingTemplate(), NoCustomNodesPreset_1.NO_CUSTOM_NODES_PRESET).getObfuscatedCode());
  1451. }
  1452. }]);
  1453. return SelfDefendingUnicodeNode;
  1454. }(Node_1.Node);
  1455. exports.SelfDefendingUnicodeNode = SelfDefendingUnicodeNode;
  1456. /***/ },
  1457. /* 31 */
  1458. /***/ function(module, exports, __webpack_require__) {
  1459. "use strict";
  1460. "use strict";
  1461. 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; }; }();
  1462. 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); } };
  1463. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1464. 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; }
  1465. 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; }
  1466. __webpack_require__(8);
  1467. var AppendState_1 = __webpack_require__(2);
  1468. var UnicodeArrayCallsWrapperTemplate_1 = __webpack_require__(56);
  1469. var Node_1 = __webpack_require__(3);
  1470. var NodeUtils_1 = __webpack_require__(1);
  1471. var Utils_1 = __webpack_require__(0);
  1472. var UnicodeArrayCallsWrapper = function (_Node_1$Node) {
  1473. _inherits(UnicodeArrayCallsWrapper, _Node_1$Node);
  1474. function UnicodeArrayCallsWrapper(unicodeArrayCallsWrapperName, unicodeArrayName, unicodeArray, options) {
  1475. _classCallCheck(this, UnicodeArrayCallsWrapper);
  1476. var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(UnicodeArrayCallsWrapper).call(this, options));
  1477. _this.appendState = AppendState_1.AppendState.AfterObfuscation;
  1478. _this.unicodeArrayCallsWrapperName = unicodeArrayCallsWrapperName;
  1479. _this.unicodeArrayName = unicodeArrayName;
  1480. _this.unicodeArray = unicodeArray;
  1481. return _this;
  1482. }
  1483. _createClass(UnicodeArrayCallsWrapper, [{
  1484. key: "appendNode",
  1485. value: function appendNode(blockScopeNode) {
  1486. if (!this.unicodeArray.getLength()) {
  1487. return;
  1488. }
  1489. NodeUtils_1.NodeUtils.insertNodeAtIndex(blockScopeNode.body, this.getNode(), 1);
  1490. }
  1491. }, {
  1492. key: "getNodeIdentifier",
  1493. value: function getNodeIdentifier() {
  1494. return this.unicodeArrayCallsWrapperName;
  1495. }
  1496. }, {
  1497. key: "getNode",
  1498. value: function getNode() {
  1499. return _get(Object.getPrototypeOf(UnicodeArrayCallsWrapper.prototype), "getNode", this).call(this);
  1500. }
  1501. }, {
  1502. key: "getNodeStructure",
  1503. value: function getNodeStructure() {
  1504. var keyName = Utils_1.Utils.getRandomVariableName();
  1505. return NodeUtils_1.NodeUtils.convertCodeToStructure(UnicodeArrayCallsWrapperTemplate_1.UnicodeArrayCallsWrapperTemplate().formatUnicorn({
  1506. keyName: keyName,
  1507. unicodeArrayCallsWrapperName: this.unicodeArrayCallsWrapperName,
  1508. unicodeArrayName: this.unicodeArrayName
  1509. }));
  1510. }
  1511. }]);
  1512. return UnicodeArrayCallsWrapper;
  1513. }(Node_1.Node);
  1514. exports.UnicodeArrayCallsWrapper = UnicodeArrayCallsWrapper;
  1515. /***/ },
  1516. /* 32 */
  1517. /***/ function(module, exports, __webpack_require__) {
  1518. "use strict";
  1519. "use strict";
  1520. 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; }; }();
  1521. 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); } };
  1522. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1523. 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; }
  1524. 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; }
  1525. __webpack_require__(8);
  1526. var AppendState_1 = __webpack_require__(2);
  1527. var NoCustomNodesPreset_1 = __webpack_require__(13);
  1528. var AtobTemplate_1 = __webpack_require__(50);
  1529. var SelfDefendingTemplate_1 = __webpack_require__(57);
  1530. var UnicodeArrayDecodeTemplate_1 = __webpack_require__(58);
  1531. var JavaScriptObfuscator_1 = __webpack_require__(9);
  1532. var Node_1 = __webpack_require__(3);
  1533. var NodeUtils_1 = __webpack_require__(1);
  1534. var UnicodeArrayDecodeNode = function (_Node_1$Node) {
  1535. _inherits(UnicodeArrayDecodeNode, _Node_1$Node);
  1536. function UnicodeArrayDecodeNode(unicodeArrayName, unicodeArray, options) {
  1537. _classCallCheck(this, UnicodeArrayDecodeNode);
  1538. var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(UnicodeArrayDecodeNode).call(this, options));
  1539. _this.appendState = AppendState_1.AppendState.AfterObfuscation;
  1540. _this.unicodeArrayName = unicodeArrayName;
  1541. _this.unicodeArray = unicodeArray;
  1542. return _this;
  1543. }
  1544. _createClass(UnicodeArrayDecodeNode, [{
  1545. key: "appendNode",
  1546. value: function appendNode(blockScopeNode) {
  1547. if (!this.unicodeArray.getLength()) {
  1548. return;
  1549. }
  1550. NodeUtils_1.NodeUtils.insertNodeAtIndex(blockScopeNode.body, this.getNode(), 1);
  1551. }
  1552. }, {
  1553. key: "getNode",
  1554. value: function getNode() {
  1555. return _get(Object.getPrototypeOf(UnicodeArrayDecodeNode.prototype), "getNode", this).call(this);
  1556. }
  1557. }, {
  1558. key: "getNodeStructure",
  1559. value: function getNodeStructure() {
  1560. var forLoopFunctionName = 'forLoopFunc';
  1561. var code = void 0;
  1562. if (this.options.selfDefending) {
  1563. code = SelfDefendingTemplate_1.SelfDefendingTemplate().formatUnicorn({
  1564. forLoopFunctionName: forLoopFunctionName,
  1565. unicodeArrayName: this.unicodeArrayName
  1566. });
  1567. } else {
  1568. code = forLoopFunctionName + "();";
  1569. }
  1570. return NodeUtils_1.NodeUtils.convertCodeToStructure(JavaScriptObfuscator_1.JavaScriptObfuscator.obfuscate(UnicodeArrayDecodeTemplate_1.UnicodeArrayDecodeTemplate().formatUnicorn({
  1571. atobPolyfill: AtobTemplate_1.AtobTemplate(),
  1572. code: code,
  1573. forLoopFunctionName: forLoopFunctionName,
  1574. unicodeArrayName: this.unicodeArrayName
  1575. }), NoCustomNodesPreset_1.NO_CUSTOM_NODES_PRESET).getObfuscatedCode());
  1576. }
  1577. }]);
  1578. return UnicodeArrayDecodeNode;
  1579. }(Node_1.Node);
  1580. exports.UnicodeArrayDecodeNode = UnicodeArrayDecodeNode;
  1581. /***/ },
  1582. /* 33 */
  1583. /***/ function(module, exports, __webpack_require__) {
  1584. "use strict";
  1585. "use strict";
  1586. 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; }; }();
  1587. 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); } };
  1588. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1589. 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; }
  1590. 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; }
  1591. __webpack_require__(8);
  1592. var AppendState_1 = __webpack_require__(2);
  1593. var UnicodeArrayTemplate_1 = __webpack_require__(59);
  1594. var Node_1 = __webpack_require__(3);
  1595. var NodeUtils_1 = __webpack_require__(1);
  1596. var UnicodeArrayNode = function (_Node_1$Node) {
  1597. _inherits(UnicodeArrayNode, _Node_1$Node);
  1598. function UnicodeArrayNode(unicodeArray, unicodeArrayName) {
  1599. var unicodeArrayRotateValue = arguments.length <= 2 || arguments[2] === undefined ? 0 : arguments[2];
  1600. var options = arguments[3];
  1601. _classCallCheck(this, UnicodeArrayNode);
  1602. var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(UnicodeArrayNode).call(this, options));
  1603. _this.appendState = AppendState_1.AppendState.AfterObfuscation;
  1604. _this.unicodeArray = unicodeArray;
  1605. _this.unicodeArrayName = unicodeArrayName;
  1606. _this.unicodeArrayRotateValue = unicodeArrayRotateValue;
  1607. return _this;
  1608. }
  1609. _createClass(UnicodeArrayNode, [{
  1610. key: 'appendNode',
  1611. value: function appendNode(blockScopeNode) {
  1612. if (!this.unicodeArray.getLength()) {
  1613. return;
  1614. }
  1615. NodeUtils_1.NodeUtils.prependNode(blockScopeNode.body, this.getNode());
  1616. }
  1617. }, {
  1618. key: 'getNodeIdentifier',
  1619. value: function getNodeIdentifier() {
  1620. return this.unicodeArrayName;
  1621. }
  1622. }, {
  1623. key: 'getNodeData',
  1624. value: function getNodeData() {
  1625. return this.unicodeArray;
  1626. }
  1627. }, {
  1628. key: 'getNode',
  1629. value: function getNode() {
  1630. this.unicodeArray.rotateArray(this.unicodeArrayRotateValue);
  1631. return _get(Object.getPrototypeOf(UnicodeArrayNode.prototype), 'getNode', this).call(this);
  1632. }
  1633. }, {
  1634. key: 'updateNodeData',
  1635. value: function updateNodeData(data) {
  1636. this.unicodeArray.addToArray(data);
  1637. }
  1638. }, {
  1639. key: 'getNodeStructure',
  1640. value: function getNodeStructure() {
  1641. return NodeUtils_1.NodeUtils.convertCodeToStructure(UnicodeArrayTemplate_1.UnicodeArrayTemplate().formatUnicorn({
  1642. unicodeArrayName: this.unicodeArrayName,
  1643. unicodeArray: this.unicodeArray.toString()
  1644. }));
  1645. }
  1646. }]);
  1647. return UnicodeArrayNode;
  1648. }(Node_1.Node);
  1649. UnicodeArrayNode.UNICODE_ARRAY_RANDOM_LENGTH = 4;
  1650. exports.UnicodeArrayNode = UnicodeArrayNode;
  1651. /***/ },
  1652. /* 34 */
  1653. /***/ function(module, exports, __webpack_require__) {
  1654. "use strict";
  1655. "use strict";
  1656. 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; }; }();
  1657. 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); } };
  1658. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1659. 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; }
  1660. 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; }
  1661. __webpack_require__(8);
  1662. var AppendState_1 = __webpack_require__(2);
  1663. var NoCustomNodesPreset_1 = __webpack_require__(13);
  1664. var SelfDefendingTemplate_1 = __webpack_require__(60);
  1665. var UnicodeArrayRotateFunctionTemplate_1 = __webpack_require__(61);
  1666. var JavaScriptObfuscator_1 = __webpack_require__(9);
  1667. var Node_1 = __webpack_require__(3);
  1668. var NodeUtils_1 = __webpack_require__(1);
  1669. var Utils_1 = __webpack_require__(0);
  1670. var UnicodeArrayRotateFunctionNode = function (_Node_1$Node) {
  1671. _inherits(UnicodeArrayRotateFunctionNode, _Node_1$Node);
  1672. function UnicodeArrayRotateFunctionNode(unicodeArrayName, unicodeArray, unicodeArrayRotateValue, options) {
  1673. _classCallCheck(this, UnicodeArrayRotateFunctionNode);
  1674. var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(UnicodeArrayRotateFunctionNode).call(this, options));
  1675. _this.appendState = AppendState_1.AppendState.AfterObfuscation;
  1676. _this.unicodeArrayName = unicodeArrayName;
  1677. _this.unicodeArray = unicodeArray;
  1678. _this.unicodeArrayRotateValue = unicodeArrayRotateValue;
  1679. return _this;
  1680. }
  1681. _createClass(UnicodeArrayRotateFunctionNode, [{
  1682. key: "appendNode",
  1683. value: function appendNode(blockScopeNode) {
  1684. if (!this.unicodeArray.getLength()) {
  1685. return;
  1686. }
  1687. NodeUtils_1.NodeUtils.insertNodeAtIndex(blockScopeNode.body, this.getNode(), 1);
  1688. }
  1689. }, {
  1690. key: "getNode",
  1691. value: function getNode() {
  1692. return _get(Object.getPrototypeOf(UnicodeArrayRotateFunctionNode.prototype), "getNode", this).call(this);
  1693. }
  1694. }, {
  1695. key: "getNodeStructure",
  1696. value: function getNodeStructure() {
  1697. var code = '',
  1698. timesName = Utils_1.Utils.getRandomVariableName(),
  1699. whileFunctionName = Utils_1.Utils.getRandomVariableName();
  1700. if (this.options.selfDefending) {
  1701. code = SelfDefendingTemplate_1.SelfDefendingTemplate().formatUnicorn({
  1702. timesName: timesName,
  1703. whileFunctionName: whileFunctionName
  1704. });
  1705. } else {
  1706. code = whileFunctionName + "(++" + timesName + ")";
  1707. }
  1708. return NodeUtils_1.NodeUtils.convertCodeToStructure(JavaScriptObfuscator_1.JavaScriptObfuscator.obfuscate(UnicodeArrayRotateFunctionTemplate_1.UnicodeArrayRotateFunctionTemplate().formatUnicorn({
  1709. code: code,
  1710. timesName: timesName,
  1711. unicodeArrayName: this.unicodeArrayName,
  1712. unicodeArrayRotateValue: Utils_1.Utils.decToHex(this.unicodeArrayRotateValue),
  1713. whileFunctionName: whileFunctionName
  1714. }), NoCustomNodesPreset_1.NO_CUSTOM_NODES_PRESET).getObfuscatedCode());
  1715. }
  1716. }]);
  1717. return UnicodeArrayRotateFunctionNode;
  1718. }(Node_1.Node);
  1719. exports.UnicodeArrayRotateFunctionNode = UnicodeArrayRotateFunctionNode;
  1720. /***/ },
  1721. /* 35 */
  1722. /***/ function(module, exports, __webpack_require__) {
  1723. "use strict";
  1724. "use strict";
  1725. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1726. 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; }
  1727. 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; }
  1728. var ConsoleOutputDisableExpressionNode_1 = __webpack_require__(26);
  1729. var NodesGroup_1 = __webpack_require__(12);
  1730. var ConsoleOutputNodesGroup = function (_NodesGroup_1$NodesGr) {
  1731. _inherits(ConsoleOutputNodesGroup, _NodesGroup_1$NodesGr);
  1732. function ConsoleOutputNodesGroup(options) {
  1733. _classCallCheck(this, ConsoleOutputNodesGroup);
  1734. var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(ConsoleOutputNodesGroup).call(this, options));
  1735. if (!_this.options.disableConsoleOutput) {
  1736. return _possibleConstructorReturn(_this);
  1737. }
  1738. _this.nodes.set('consoleOutputDisableExpressionNode', new ConsoleOutputDisableExpressionNode_1.ConsoleOutputDisableExpressionNode(_this.options));
  1739. return _this;
  1740. }
  1741. return ConsoleOutputNodesGroup;
  1742. }(NodesGroup_1.NodesGroup);
  1743. exports.ConsoleOutputNodesGroup = ConsoleOutputNodesGroup;
  1744. /***/ },
  1745. /* 36 */
  1746. /***/ function(module, exports, __webpack_require__) {
  1747. "use strict";
  1748. "use strict";
  1749. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1750. 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; }
  1751. 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; }
  1752. var DebugProtectionFunctionCallNode_1 = __webpack_require__(27);
  1753. var DebugProtectionFunctionIntervalNode_1 = __webpack_require__(28);
  1754. var DebugProtectionFunctionNode_1 = __webpack_require__(29);
  1755. var NodesGroup_1 = __webpack_require__(12);
  1756. var Utils_1 = __webpack_require__(0);
  1757. var DebugProtectionNodesGroup = function (_NodesGroup_1$NodesGr) {
  1758. _inherits(DebugProtectionNodesGroup, _NodesGroup_1$NodesGr);
  1759. function DebugProtectionNodesGroup(options) {
  1760. _classCallCheck(this, DebugProtectionNodesGroup);
  1761. var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(DebugProtectionNodesGroup).call(this, options));
  1762. _this.debugProtectionFunctionIdentifier = Utils_1.Utils.getRandomVariableName();
  1763. if (!_this.options.debugProtection) {
  1764. return _possibleConstructorReturn(_this);
  1765. }
  1766. _this.nodes.set('debugProtectionFunctionNode', new DebugProtectionFunctionNode_1.DebugProtectionFunctionNode(_this.debugProtectionFunctionIdentifier, _this.options));
  1767. _this.nodes.set('debugProtectionFunctionCallNode', new DebugProtectionFunctionCallNode_1.DebugProtectionFunctionCallNode(_this.debugProtectionFunctionIdentifier, _this.options));
  1768. if (_this.options.debugProtectionInterval) {
  1769. _this.nodes.set('debugProtectionFunctionIntervalNode', new DebugProtectionFunctionIntervalNode_1.DebugProtectionFunctionIntervalNode(_this.debugProtectionFunctionIdentifier, _this.options));
  1770. }
  1771. return _this;
  1772. }
  1773. return DebugProtectionNodesGroup;
  1774. }(NodesGroup_1.NodesGroup);
  1775. exports.DebugProtectionNodesGroup = DebugProtectionNodesGroup;
  1776. /***/ },
  1777. /* 37 */
  1778. /***/ function(module, exports, __webpack_require__) {
  1779. "use strict";
  1780. "use strict";
  1781. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1782. 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; }
  1783. 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; }
  1784. var NodesGroup_1 = __webpack_require__(12);
  1785. var SelfDefendingUnicodeNode_1 = __webpack_require__(30);
  1786. var SelfDefendingNodesGroup = function (_NodesGroup_1$NodesGr) {
  1787. _inherits(SelfDefendingNodesGroup, _NodesGroup_1$NodesGr);
  1788. function SelfDefendingNodesGroup(options) {
  1789. _classCallCheck(this, SelfDefendingNodesGroup);
  1790. var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(SelfDefendingNodesGroup).call(this, options));
  1791. if (!_this.options.selfDefending) {
  1792. return _possibleConstructorReturn(_this);
  1793. }
  1794. _this.nodes.set('selfDefendingUnicodeNode', new SelfDefendingUnicodeNode_1.SelfDefendingUnicodeNode(_this.options));
  1795. return _this;
  1796. }
  1797. return SelfDefendingNodesGroup;
  1798. }(NodesGroup_1.NodesGroup);
  1799. exports.SelfDefendingNodesGroup = SelfDefendingNodesGroup;
  1800. /***/ },
  1801. /* 38 */
  1802. /***/ function(module, exports, __webpack_require__) {
  1803. "use strict";
  1804. "use strict";
  1805. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1806. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  1807. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  1808. var NodesGroup_1 = __webpack_require__(12);
  1809. var UnicodeArray_1 = __webpack_require__(23);
  1810. var UnicodeArrayCallsWrapper_1 = __webpack_require__(31);
  1811. var UnicodeArrayDecodeNode_1 = __webpack_require__(32);
  1812. var UnicodeArrayNode_1 = __webpack_require__(33);
  1813. var UnicodeArrayRotateFunctionNode_1 = __webpack_require__(34);
  1814. var Utils_1 = __webpack_require__(0);
  1815. var UnicodeArrayNodesGroup = function (_NodesGroup_1$NodesGr) {
  1816. _inherits(UnicodeArrayNodesGroup, _NodesGroup_1$NodesGr);
  1817. function UnicodeArrayNodesGroup(options) {
  1818. _classCallCheck(this, UnicodeArrayNodesGroup);
  1819. var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(UnicodeArrayNodesGroup).call(this, options));
  1820. _this.unicodeArrayName = Utils_1.Utils.getRandomVariableName(UnicodeArrayNode_1.UnicodeArrayNode.UNICODE_ARRAY_RANDOM_LENGTH);
  1821. _this.unicodeArrayTranslatorName = Utils_1.Utils.getRandomVariableName(UnicodeArrayNode_1.UnicodeArrayNode.UNICODE_ARRAY_RANDOM_LENGTH);
  1822. if (!_this.options.unicodeArray) {
  1823. return _possibleConstructorReturn(_this);
  1824. }
  1825. if (_this.options.rotateUnicodeArray) {
  1826. _this.unicodeArrayRotateValue = Utils_1.Utils.getRandomGenerator().integer({
  1827. min: 100,
  1828. max: 500
  1829. });
  1830. } else {
  1831. _this.unicodeArrayRotateValue = 0;
  1832. }
  1833. var unicodeArray = new UnicodeArray_1.UnicodeArray(),
  1834. unicodeArrayNode = new UnicodeArrayNode_1.UnicodeArrayNode(unicodeArray, _this.unicodeArrayName, _this.unicodeArrayRotateValue, _this.options);
  1835. _this.nodes.set('unicodeArrayNode', unicodeArrayNode);
  1836. if (_this.options.wrapUnicodeArrayCalls) {
  1837. _this.nodes.set('unicodeArrayCallsWrapper', new UnicodeArrayCallsWrapper_1.UnicodeArrayCallsWrapper(_this.unicodeArrayTranslatorName, _this.unicodeArrayName, unicodeArray, _this.options));
  1838. }
  1839. if (_this.options.encodeUnicodeLiterals) {
  1840. _this.nodes.set('unicodeArrayDecodeNode', new UnicodeArrayDecodeNode_1.UnicodeArrayDecodeNode(_this.unicodeArrayName, unicodeArray, _this.options));
  1841. }
  1842. if (_this.options.rotateUnicodeArray) {
  1843. _this.nodes.set('unicodeArrayRotateFunctionNode', new UnicodeArrayRotateFunctionNode_1.UnicodeArrayRotateFunctionNode(_this.unicodeArrayName, unicodeArray, _this.unicodeArrayRotateValue, _this.options));
  1844. }
  1845. return _this;
  1846. }
  1847. return UnicodeArrayNodesGroup;
  1848. }(NodesGroup_1.NodesGroup);
  1849. exports.UnicodeArrayNodesGroup = UnicodeArrayNodesGroup;
  1850. /***/ },
  1851. /* 39 */
  1852. /***/ function(module, exports, __webpack_require__) {
  1853. "use strict";
  1854. "use strict";
  1855. 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; }; }();
  1856. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1857. 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; }
  1858. 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; }
  1859. var estraverse = __webpack_require__(4);
  1860. var NodeObfuscator_1 = __webpack_require__(5);
  1861. var CatchClauseObfuscator = function (_NodeObfuscator_1$Nod) {
  1862. _inherits(CatchClauseObfuscator, _NodeObfuscator_1$Nod);
  1863. function CatchClauseObfuscator() {
  1864. var _Object$getPrototypeO;
  1865. _classCallCheck(this, CatchClauseObfuscator);
  1866. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  1867. args[_key] = arguments[_key];
  1868. }
  1869. var _this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(CatchClauseObfuscator)).call.apply(_Object$getPrototypeO, [this].concat(args)));
  1870. _this.catchClauseParam = new Map();
  1871. return _this;
  1872. }
  1873. _createClass(CatchClauseObfuscator, [{
  1874. key: 'obfuscateNode',
  1875. value: function obfuscateNode(catchClauseNode) {
  1876. this.storeCatchClauseParam(catchClauseNode);
  1877. this.replaceCatchClauseParam(catchClauseNode);
  1878. }
  1879. }, {
  1880. key: 'storeCatchClauseParam',
  1881. value: function storeCatchClauseParam(catchClauseNode) {
  1882. var _this2 = this;
  1883. estraverse.traverse(catchClauseNode.param, {
  1884. leave: function leave(node) {
  1885. return _this2.storeIdentifiersNames(node, _this2.catchClauseParam);
  1886. }
  1887. });
  1888. }
  1889. }, {
  1890. key: 'replaceCatchClauseParam',
  1891. value: function replaceCatchClauseParam(catchClauseNode) {
  1892. var _this3 = this;
  1893. estraverse.replace(catchClauseNode, {
  1894. leave: function leave(node, parentNode) {
  1895. _this3.replaceIdentifiersWithRandomNames(node, parentNode, _this3.catchClauseParam);
  1896. }
  1897. });
  1898. }
  1899. }]);
  1900. return CatchClauseObfuscator;
  1901. }(NodeObfuscator_1.NodeObfuscator);
  1902. exports.CatchClauseObfuscator = CatchClauseObfuscator;
  1903. /***/ },
  1904. /* 40 */
  1905. /***/ function(module, exports, __webpack_require__) {
  1906. "use strict";
  1907. "use strict";
  1908. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  1909. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1910. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  1911. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  1912. var estraverse = __webpack_require__(4);
  1913. var NodeType_1 = __webpack_require__(7);
  1914. var NodeObfuscator_1 = __webpack_require__(5);
  1915. var NodeUtils_1 = __webpack_require__(1);
  1916. var FunctionDeclarationObfuscator = function (_NodeObfuscator_1$Nod) {
  1917. _inherits(FunctionDeclarationObfuscator, _NodeObfuscator_1$Nod);
  1918. function FunctionDeclarationObfuscator() {
  1919. var _Object$getPrototypeO;
  1920. _classCallCheck(this, FunctionDeclarationObfuscator);
  1921. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  1922. args[_key] = arguments[_key];
  1923. }
  1924. var _this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(FunctionDeclarationObfuscator)).call.apply(_Object$getPrototypeO, [this].concat(args)));
  1925. _this.functionName = new Map();
  1926. return _this;
  1927. }
  1928. _createClass(FunctionDeclarationObfuscator, [{
  1929. key: "obfuscateNode",
  1930. value: function obfuscateNode(functionDeclarationNode, parentNode) {
  1931. if (parentNode.type === NodeType_1.NodeType.Program) {
  1932. return;
  1933. }
  1934. this.storeFunctionName(functionDeclarationNode);
  1935. this.replaceFunctionName(functionDeclarationNode);
  1936. }
  1937. }, {
  1938. key: "storeFunctionName",
  1939. value: function storeFunctionName(functionDeclarationNode) {
  1940. var _this2 = this;
  1941. estraverse.traverse(functionDeclarationNode.id, {
  1942. leave: function leave(node) {
  1943. return _this2.storeIdentifiersNames(node, _this2.functionName);
  1944. }
  1945. });
  1946. }
  1947. }, {
  1948. key: "replaceFunctionName",
  1949. value: function replaceFunctionName(functionDeclarationNode) {
  1950. var _this3 = this;
  1951. var scopeNode = NodeUtils_1.NodeUtils.getBlockScopeOfNode(functionDeclarationNode);
  1952. estraverse.replace(scopeNode, {
  1953. enter: function enter(node, parentNode) {
  1954. _this3.replaceIdentifiersWithRandomNames(node, parentNode, _this3.functionName);
  1955. }
  1956. });
  1957. }
  1958. }]);
  1959. return FunctionDeclarationObfuscator;
  1960. }(NodeObfuscator_1.NodeObfuscator);
  1961. exports.FunctionDeclarationObfuscator = FunctionDeclarationObfuscator;
  1962. /***/ },
  1963. /* 41 */
  1964. /***/ function(module, exports, __webpack_require__) {
  1965. "use strict";
  1966. "use strict";
  1967. 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; }; }();
  1968. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1969. 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; }
  1970. 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; }
  1971. var estraverse = __webpack_require__(4);
  1972. var NodeObfuscator_1 = __webpack_require__(5);
  1973. var FunctionObfuscator = function (_NodeObfuscator_1$Nod) {
  1974. _inherits(FunctionObfuscator, _NodeObfuscator_1$Nod);
  1975. function FunctionObfuscator() {
  1976. var _Object$getPrototypeO;
  1977. _classCallCheck(this, FunctionObfuscator);
  1978. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  1979. args[_key] = arguments[_key];
  1980. }
  1981. var _this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(FunctionObfuscator)).call.apply(_Object$getPrototypeO, [this].concat(args)));
  1982. _this.functionParams = new Map();
  1983. return _this;
  1984. }
  1985. _createClass(FunctionObfuscator, [{
  1986. key: 'obfuscateNode',
  1987. value: function obfuscateNode(functionNode) {
  1988. this.storeFunctionParams(functionNode);
  1989. this.replaceFunctionParams(functionNode);
  1990. }
  1991. }, {
  1992. key: 'storeFunctionParams',
  1993. value: function storeFunctionParams(functionNode) {
  1994. var _this2 = this;
  1995. functionNode.params.forEach(function (paramsNode) {
  1996. estraverse.traverse(paramsNode, {
  1997. leave: function leave(node) {
  1998. return _this2.storeIdentifiersNames(node, _this2.functionParams);
  1999. }
  2000. });
  2001. });
  2002. }
  2003. }, {
  2004. key: 'replaceFunctionParams',
  2005. value: function replaceFunctionParams(functionNode) {
  2006. var _this3 = this;
  2007. var replaceVisitor = {
  2008. leave: function leave(node, parentNode) {
  2009. _this3.replaceIdentifiersWithRandomNames(node, parentNode, _this3.functionParams);
  2010. }
  2011. };
  2012. functionNode.params.forEach(function (paramsNode) {
  2013. estraverse.replace(paramsNode, replaceVisitor);
  2014. });
  2015. estraverse.replace(functionNode.body, replaceVisitor);
  2016. }
  2017. }]);
  2018. return FunctionObfuscator;
  2019. }(NodeObfuscator_1.NodeObfuscator);
  2020. exports.FunctionObfuscator = FunctionObfuscator;
  2021. /***/ },
  2022. /* 42 */
  2023. /***/ function(module, exports, __webpack_require__) {
  2024. "use strict";
  2025. "use strict";
  2026. 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; };
  2027. 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; }; }();
  2028. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2029. 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; }
  2030. 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; }
  2031. var escodegen = __webpack_require__(10);
  2032. var NodeObfuscator_1 = __webpack_require__(5);
  2033. var Nodes_1 = __webpack_require__(6);
  2034. var LiteralObfuscator = function (_NodeObfuscator_1$Nod) {
  2035. _inherits(LiteralObfuscator, _NodeObfuscator_1$Nod);
  2036. function LiteralObfuscator() {
  2037. _classCallCheck(this, LiteralObfuscator);
  2038. return _possibleConstructorReturn(this, Object.getPrototypeOf(LiteralObfuscator).apply(this, arguments));
  2039. }
  2040. _createClass(LiteralObfuscator, [{
  2041. key: 'obfuscateNode',
  2042. value: function obfuscateNode(literalNode, parentNode) {
  2043. if (Nodes_1.Nodes.isPropertyNode(parentNode) && parentNode.key === literalNode) {
  2044. return;
  2045. }
  2046. if (literalNode['x-verbatim-property']) {
  2047. return;
  2048. }
  2049. var content = void 0;
  2050. switch (_typeof(literalNode.value)) {
  2051. case 'boolean':
  2052. content = this.replaceLiteralBooleanWithJSFuck(literalNode.value);
  2053. break;
  2054. case 'number':
  2055. content = this.replaceLiteralNumberWithHexadecimalValue(literalNode.value);
  2056. break;
  2057. case 'string':
  2058. content = this.replaceLiteralValueWithUnicodeValue(literalNode.value);
  2059. break;
  2060. default:
  2061. return;
  2062. }
  2063. literalNode['x-verbatim-property'] = {
  2064. content: content,
  2065. precedence: escodegen.Precedence.Primary
  2066. };
  2067. }
  2068. }]);
  2069. return LiteralObfuscator;
  2070. }(NodeObfuscator_1.NodeObfuscator);
  2071. exports.LiteralObfuscator = LiteralObfuscator;
  2072. /***/ },
  2073. /* 43 */
  2074. /***/ function(module, exports, __webpack_require__) {
  2075. "use strict";
  2076. "use strict";
  2077. 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; }; }();
  2078. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2079. 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; }
  2080. 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; }
  2081. var escodegen = __webpack_require__(10);
  2082. var estraverse = __webpack_require__(4);
  2083. var NodeType_1 = __webpack_require__(7);
  2084. var NodeObfuscator_1 = __webpack_require__(5);
  2085. var Nodes_1 = __webpack_require__(6);
  2086. var MemberExpressionObfuscator = function (_NodeObfuscator_1$Nod) {
  2087. _inherits(MemberExpressionObfuscator, _NodeObfuscator_1$Nod);
  2088. function MemberExpressionObfuscator() {
  2089. _classCallCheck(this, MemberExpressionObfuscator);
  2090. return _possibleConstructorReturn(this, Object.getPrototypeOf(MemberExpressionObfuscator).apply(this, arguments));
  2091. }
  2092. _createClass(MemberExpressionObfuscator, [{
  2093. key: 'obfuscateNode',
  2094. value: function obfuscateNode(memberExpressionNode) {
  2095. var _this2 = this;
  2096. estraverse.replace(memberExpressionNode.property, {
  2097. leave: function leave(node, parentNode) {
  2098. if (Nodes_1.Nodes.isLiteralNode(node)) {
  2099. _this2.obfuscateLiteralProperty(node);
  2100. return;
  2101. }
  2102. if (Nodes_1.Nodes.isIdentifierNode(node)) {
  2103. if (memberExpressionNode.computed) {
  2104. return;
  2105. }
  2106. memberExpressionNode.computed = true;
  2107. _this2.obfuscateIdentifierProperty(node);
  2108. }
  2109. }
  2110. });
  2111. }
  2112. }, {
  2113. key: 'obfuscateIdentifierProperty',
  2114. value: function obfuscateIdentifierProperty(node) {
  2115. var nodeValue = node.name,
  2116. literalNode = {
  2117. raw: '\'' + nodeValue + '\'',
  2118. 'x-verbatim-property': {
  2119. content: this.replaceLiteralValueWithUnicodeValue(nodeValue),
  2120. precedence: escodegen.Precedence.Primary
  2121. },
  2122. type: NodeType_1.NodeType.Literal,
  2123. value: nodeValue
  2124. };
  2125. delete node.name;
  2126. Object.assign(node, literalNode);
  2127. }
  2128. }, {
  2129. key: 'obfuscateLiteralProperty',
  2130. value: function obfuscateLiteralProperty(node) {
  2131. if (typeof node.value === 'string' && !node['x-verbatim-property']) {
  2132. node['x-verbatim-property'] = {
  2133. content: this.replaceLiteralValueWithUnicodeValue(node.value),
  2134. precedence: escodegen.Precedence.Primary
  2135. };
  2136. }
  2137. }
  2138. }]);
  2139. return MemberExpressionObfuscator;
  2140. }(NodeObfuscator_1.NodeObfuscator);
  2141. exports.MemberExpressionObfuscator = MemberExpressionObfuscator;
  2142. /***/ },
  2143. /* 44 */
  2144. /***/ function(module, exports, __webpack_require__) {
  2145. "use strict";
  2146. "use strict";
  2147. 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; }; }();
  2148. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2149. 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; }
  2150. 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; }
  2151. var estraverse = __webpack_require__(4);
  2152. var NodeObfuscator_1 = __webpack_require__(5);
  2153. var Nodes_1 = __webpack_require__(6);
  2154. var Utils_1 = __webpack_require__(0);
  2155. var MethodDefinitionObfuscator = function (_NodeObfuscator_1$Nod) {
  2156. _inherits(MethodDefinitionObfuscator, _NodeObfuscator_1$Nod);
  2157. function MethodDefinitionObfuscator() {
  2158. var _Object$getPrototypeO;
  2159. _classCallCheck(this, MethodDefinitionObfuscator);
  2160. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  2161. args[_key] = arguments[_key];
  2162. }
  2163. var _this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(MethodDefinitionObfuscator)).call.apply(_Object$getPrototypeO, [this].concat(args)));
  2164. _this.ignoredNames = ['constructor'];
  2165. return _this;
  2166. }
  2167. _createClass(MethodDefinitionObfuscator, [{
  2168. key: 'obfuscateNode',
  2169. value: function obfuscateNode(methodDefinitionNode, parentNode) {
  2170. this.replaceMethodName(methodDefinitionNode);
  2171. }
  2172. }, {
  2173. key: 'replaceMethodName',
  2174. value: function replaceMethodName(methodDefinitionNode) {
  2175. var _this2 = this;
  2176. estraverse.replace(methodDefinitionNode.key, {
  2177. leave: function leave(node) {
  2178. if (Nodes_1.Nodes.isIdentifierNode(node) && !Utils_1.Utils.arrayContains(_this2.ignoredNames, node.name) && methodDefinitionNode.computed === false) {
  2179. methodDefinitionNode.computed = true;
  2180. node.name = _this2.replaceLiteralValueWithUnicodeValue(node.name);
  2181. return;
  2182. }
  2183. return estraverse.VisitorOption.Skip;
  2184. }
  2185. });
  2186. }
  2187. }]);
  2188. return MethodDefinitionObfuscator;
  2189. }(NodeObfuscator_1.NodeObfuscator);
  2190. exports.MethodDefinitionObfuscator = MethodDefinitionObfuscator;
  2191. /***/ },
  2192. /* 45 */
  2193. /***/ function(module, exports, __webpack_require__) {
  2194. "use strict";
  2195. "use strict";
  2196. 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; }; }();
  2197. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2198. 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; }
  2199. 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; }
  2200. var escodegen = __webpack_require__(10);
  2201. var estraverse = __webpack_require__(4);
  2202. var NodeType_1 = __webpack_require__(7);
  2203. var NodeObfuscator_1 = __webpack_require__(5);
  2204. var Nodes_1 = __webpack_require__(6);
  2205. var Utils_1 = __webpack_require__(0);
  2206. var ObjectExpressionObfuscator = function (_NodeObfuscator_1$Nod) {
  2207. _inherits(ObjectExpressionObfuscator, _NodeObfuscator_1$Nod);
  2208. function ObjectExpressionObfuscator() {
  2209. _classCallCheck(this, ObjectExpressionObfuscator);
  2210. return _possibleConstructorReturn(this, Object.getPrototypeOf(ObjectExpressionObfuscator).apply(this, arguments));
  2211. }
  2212. _createClass(ObjectExpressionObfuscator, [{
  2213. key: 'obfuscateNode',
  2214. value: function obfuscateNode(objectExpressionNode) {
  2215. var _this2 = this;
  2216. objectExpressionNode.properties.forEach(function (property) {
  2217. estraverse.replace(property.key, {
  2218. leave: function leave(node, parentNode) {
  2219. if (Nodes_1.Nodes.isLiteralNode(node)) {
  2220. _this2.obfuscateLiteralPropertyKey(node);
  2221. return;
  2222. }
  2223. if (Nodes_1.Nodes.isIdentifierNode(node)) {
  2224. _this2.obfuscateIdentifierPropertyKey(node);
  2225. }
  2226. }
  2227. });
  2228. });
  2229. }
  2230. }, {
  2231. key: 'obfuscateLiteralPropertyKey',
  2232. value: function obfuscateLiteralPropertyKey(node) {
  2233. if (typeof node.value === 'string' && !node['x-verbatim-property']) {
  2234. node['x-verbatim-property'] = {
  2235. content: Utils_1.Utils.stringToUnicode(node.value),
  2236. precedence: escodegen.Precedence.Primary
  2237. };
  2238. }
  2239. }
  2240. }, {
  2241. key: 'obfuscateIdentifierPropertyKey',
  2242. value: function obfuscateIdentifierPropertyKey(node) {
  2243. var nodeValue = node.name,
  2244. literalNode = {
  2245. raw: '\'' + nodeValue + '\'',
  2246. 'x-verbatim-property': {
  2247. content: Utils_1.Utils.stringToUnicode(nodeValue),
  2248. precedence: escodegen.Precedence.Primary
  2249. },
  2250. type: NodeType_1.NodeType.Literal,
  2251. value: nodeValue
  2252. };
  2253. delete node.name;
  2254. Object.assign(node, literalNode);
  2255. }
  2256. }]);
  2257. return ObjectExpressionObfuscator;
  2258. }(NodeObfuscator_1.NodeObfuscator);
  2259. exports.ObjectExpressionObfuscator = ObjectExpressionObfuscator;
  2260. /***/ },
  2261. /* 46 */
  2262. /***/ function(module, exports, __webpack_require__) {
  2263. "use strict";
  2264. "use strict";
  2265. 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; }; }();
  2266. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2267. 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; }
  2268. 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; }
  2269. var estraverse = __webpack_require__(4);
  2270. var NodeType_1 = __webpack_require__(7);
  2271. var NodeObfuscator_1 = __webpack_require__(5);
  2272. var NodeUtils_1 = __webpack_require__(1);
  2273. var Utils_1 = __webpack_require__(0);
  2274. var VariableDeclarationObfuscator = function (_NodeObfuscator_1$Nod) {
  2275. _inherits(VariableDeclarationObfuscator, _NodeObfuscator_1$Nod);
  2276. function VariableDeclarationObfuscator() {
  2277. var _Object$getPrototypeO;
  2278. _classCallCheck(this, VariableDeclarationObfuscator);
  2279. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  2280. args[_key] = arguments[_key];
  2281. }
  2282. var _this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(VariableDeclarationObfuscator)).call.apply(_Object$getPrototypeO, [this].concat(args)));
  2283. _this.variableNames = new Map();
  2284. return _this;
  2285. }
  2286. _createClass(VariableDeclarationObfuscator, [{
  2287. key: "obfuscateNode",
  2288. value: function obfuscateNode(variableDeclarationNode, parentNode) {
  2289. if (parentNode.type === NodeType_1.NodeType.Program) {
  2290. return;
  2291. }
  2292. this.storeVariableNames(variableDeclarationNode);
  2293. this.replaceVariableNames(variableDeclarationNode, parentNode);
  2294. }
  2295. }, {
  2296. key: "storeVariableNames",
  2297. value: function storeVariableNames(variableDeclarationNode) {
  2298. var _this2 = this;
  2299. variableDeclarationNode.declarations.forEach(function (declarationNode) {
  2300. estraverse.traverse(declarationNode.id, {
  2301. enter: function enter(node) {
  2302. return _this2.storeIdentifiersNames(node, _this2.variableNames);
  2303. }
  2304. });
  2305. });
  2306. }
  2307. }, {
  2308. key: "replaceVariableNames",
  2309. value: function replaceVariableNames(variableDeclarationNode, variableParentNode) {
  2310. var _this3 = this;
  2311. var scopeNode = variableDeclarationNode.kind === 'var' ? NodeUtils_1.NodeUtils.getBlockScopeOfNode(variableDeclarationNode) : variableParentNode,
  2312. isNodeAfterVariableDeclaratorFlag = false;
  2313. estraverse.replace(scopeNode, {
  2314. enter: function enter(node, parentNode) {
  2315. var functionNodes = [NodeType_1.NodeType.ArrowFunctionExpression, NodeType_1.NodeType.FunctionDeclaration, NodeType_1.NodeType.FunctionExpression];
  2316. if (Utils_1.Utils.arrayContains(functionNodes, node.type)) {
  2317. estraverse.replace(node, {
  2318. enter: function enter(node, parentNode) {
  2319. _this3.replaceIdentifiersWithRandomNames(node, parentNode, _this3.variableNames);
  2320. }
  2321. });
  2322. }
  2323. if (node === variableDeclarationNode) {
  2324. isNodeAfterVariableDeclaratorFlag = true;
  2325. }
  2326. if (isNodeAfterVariableDeclaratorFlag) {
  2327. _this3.replaceIdentifiersWithRandomNames(node, parentNode, _this3.variableNames);
  2328. }
  2329. }
  2330. });
  2331. }
  2332. }]);
  2333. return VariableDeclarationObfuscator;
  2334. }(NodeObfuscator_1.NodeObfuscator);
  2335. exports.VariableDeclarationObfuscator = VariableDeclarationObfuscator;
  2336. /***/ },
  2337. /* 47 */
  2338. /***/ function(module, exports, __webpack_require__) {
  2339. "use strict";
  2340. "use strict";
  2341. 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; };
  2342. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2343. var __decorate = undefined && undefined.__decorate || function (decorators, target, key, desc) {
  2344. var c = arguments.length,
  2345. r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
  2346. d;
  2347. if ((typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) {
  2348. if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  2349. }return c > 3 && r && Object.defineProperty(target, key, r), r;
  2350. };
  2351. var __metadata = undefined && undefined.__metadata || function (k, v) {
  2352. if ((typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
  2353. };
  2354. var class_validator_1 = __webpack_require__(63);
  2355. var DefaultPreset_1 = __webpack_require__(17);
  2356. var OptionsNormalizer_1 = __webpack_require__(48);
  2357. var ValidationErrorsFormatter_1 = __webpack_require__(49);
  2358. var Options = function Options(obfuscatorOptions) {
  2359. _classCallCheck(this, Options);
  2360. Object.assign(this, DefaultPreset_1.DEFAULT_PRESET, obfuscatorOptions);
  2361. var errors = class_validator_1.validateSync(this, Options.validatorOptions);
  2362. if (errors.length) {
  2363. throw new ReferenceError("Validation failed. errors:\n" + ValidationErrorsFormatter_1.ValidationErrorsFormatter.format(errors));
  2364. }
  2365. Object.assign(this, OptionsNormalizer_1.OptionsNormalizer.normalizeOptions(this));
  2366. };
  2367. Options.validatorOptions = {
  2368. validationError: {
  2369. target: false
  2370. }
  2371. };
  2372. __decorate([class_validator_1.IsBoolean(), __metadata('design:type', Boolean)], Options.prototype, "compact", void 0);
  2373. __decorate([class_validator_1.IsBoolean(), __metadata('design:type', Boolean)], Options.prototype, "debugProtection", void 0);
  2374. __decorate([class_validator_1.IsBoolean(), __metadata('design:type', Boolean)], Options.prototype, "debugProtectionInterval", void 0);
  2375. __decorate([class_validator_1.IsBoolean(), __metadata('design:type', Boolean)], Options.prototype, "disableConsoleOutput", void 0);
  2376. __decorate([class_validator_1.IsBoolean(), __metadata('design:type', Boolean)], Options.prototype, "encodeUnicodeLiterals", void 0);
  2377. __decorate([class_validator_1.IsString({
  2378. each: true
  2379. }), __metadata('design:type', Array)], Options.prototype, "reservedNames", void 0);
  2380. __decorate([class_validator_1.IsBoolean(), __metadata('design:type', Boolean)], Options.prototype, "rotateUnicodeArray", void 0);
  2381. __decorate([class_validator_1.IsBoolean(), __metadata('design:type', Boolean)], Options.prototype, "selfDefending", void 0);
  2382. __decorate([class_validator_1.IsBoolean(), __metadata('design:type', Boolean)], Options.prototype, "sourceMap", void 0);
  2383. __decorate([class_validator_1.IsIn(['inline', 'separate']), __metadata('design:type', String)], Options.prototype, "sourceMapMode", void 0);
  2384. __decorate([class_validator_1.IsBoolean(), __metadata('design:type', Boolean)], Options.prototype, "unicodeArray", void 0);
  2385. __decorate([class_validator_1.IsNumber(), class_validator_1.Min(0), class_validator_1.Max(1), __metadata('design:type', Number)], Options.prototype, "unicodeArrayThreshold", void 0);
  2386. __decorate([class_validator_1.IsBoolean(), __metadata('design:type', Boolean)], Options.prototype, "wrapUnicodeArrayCalls", void 0);
  2387. exports.Options = Options;
  2388. /***/ },
  2389. /* 48 */
  2390. /***/ function(module, exports) {
  2391. "use strict";
  2392. "use strict";
  2393. 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; }; }();
  2394. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2395. var OptionsNormalizer = function () {
  2396. function OptionsNormalizer() {
  2397. _classCallCheck(this, OptionsNormalizer);
  2398. }
  2399. _createClass(OptionsNormalizer, null, [{
  2400. key: "normalizeOptions",
  2401. value: function normalizeOptions(options) {
  2402. var normalizedOptions = Object.assign({}, options);
  2403. var _iteratorNormalCompletion = true;
  2404. var _didIteratorError = false;
  2405. var _iteratorError = undefined;
  2406. try {
  2407. for (var _iterator = OptionsNormalizer.normalizerRules[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
  2408. var normalizerRule = _step.value;
  2409. normalizedOptions = normalizerRule(normalizedOptions);
  2410. }
  2411. } catch (err) {
  2412. _didIteratorError = true;
  2413. _iteratorError = err;
  2414. } finally {
  2415. try {
  2416. if (!_iteratorNormalCompletion && _iterator.return) {
  2417. _iterator.return();
  2418. }
  2419. } finally {
  2420. if (_didIteratorError) {
  2421. throw _iteratorError;
  2422. }
  2423. }
  2424. }
  2425. return normalizedOptions;
  2426. }
  2427. }, {
  2428. key: "encodeUnicodeLiteralsRule",
  2429. value: function encodeUnicodeLiteralsRule(options) {
  2430. if (options.unicodeArray && options.encodeUnicodeLiterals) {
  2431. Object.assign(options, OptionsNormalizer.ENCODE_UNICODE_LITERALS_OPTIONS);
  2432. }
  2433. return options;
  2434. }
  2435. }, {
  2436. key: "selfDefendingRule",
  2437. value: function selfDefendingRule(options) {
  2438. if (options.selfDefending) {
  2439. Object.assign(options, OptionsNormalizer.SELF_DEFENDING_OPTIONS);
  2440. }
  2441. return options;
  2442. }
  2443. }, {
  2444. key: "unicodeArrayRule",
  2445. value: function unicodeArrayRule(options) {
  2446. if (!options.unicodeArray) {
  2447. Object.assign(options, OptionsNormalizer.DISABLED_UNICODE_ARRAY_OPTIONS);
  2448. }
  2449. return options;
  2450. }
  2451. }, {
  2452. key: "unicodeArrayThresholdRule",
  2453. value: function unicodeArrayThresholdRule(options) {
  2454. if (options.unicodeArrayThreshold === 0) {
  2455. Object.assign(options, OptionsNormalizer.DISABLED_UNICODE_ARRAY_OPTIONS);
  2456. }
  2457. return options;
  2458. }
  2459. }]);
  2460. return OptionsNormalizer;
  2461. }();
  2462. OptionsNormalizer.DISABLED_UNICODE_ARRAY_OPTIONS = {
  2463. encodeUnicodeLiterals: false,
  2464. rotateUnicodeArray: false,
  2465. unicodeArray: false,
  2466. unicodeArrayThreshold: 0,
  2467. wrapUnicodeArrayCalls: false
  2468. };
  2469. OptionsNormalizer.ENCODE_UNICODE_LITERALS_OPTIONS = {
  2470. encodeUnicodeLiterals: true,
  2471. wrapUnicodeArrayCalls: true
  2472. };
  2473. OptionsNormalizer.SELF_DEFENDING_OPTIONS = {
  2474. compact: true,
  2475. selfDefending: true
  2476. };
  2477. OptionsNormalizer.normalizerRules = [OptionsNormalizer.unicodeArrayRule, OptionsNormalizer.unicodeArrayThresholdRule, OptionsNormalizer.encodeUnicodeLiteralsRule, OptionsNormalizer.selfDefendingRule];
  2478. exports.OptionsNormalizer = OptionsNormalizer;
  2479. /***/ },
  2480. /* 49 */
  2481. /***/ function(module, exports) {
  2482. "use strict";
  2483. "use strict";
  2484. 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; }; }();
  2485. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2486. var ValidationErrorsFormatter = function () {
  2487. function ValidationErrorsFormatter() {
  2488. _classCallCheck(this, ValidationErrorsFormatter);
  2489. }
  2490. _createClass(ValidationErrorsFormatter, null, [{
  2491. key: "format",
  2492. value: function format(validationErrors) {
  2493. var errorsArray = [];
  2494. var _iteratorNormalCompletion = true;
  2495. var _didIteratorError = false;
  2496. var _iteratorError = undefined;
  2497. try {
  2498. for (var _iterator = validationErrors[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
  2499. var error = _step.value;
  2500. errorsArray.push(ValidationErrorsFormatter.formatError(error));
  2501. }
  2502. } catch (err) {
  2503. _didIteratorError = true;
  2504. _iteratorError = err;
  2505. } finally {
  2506. try {
  2507. if (!_iteratorNormalCompletion && _iterator.return) {
  2508. _iterator.return();
  2509. }
  2510. } finally {
  2511. if (_didIteratorError) {
  2512. throw _iteratorError;
  2513. }
  2514. }
  2515. }
  2516. return errorsArray.join('\n');
  2517. }
  2518. }, {
  2519. key: "formatError",
  2520. value: function formatError(validationError) {
  2521. var errorString = "`" + validationError.property + "` errors:\n",
  2522. constraints = validationError.constraints;
  2523. for (var constraint in constraints) {
  2524. if (!constraints.hasOwnProperty(constraint)) {
  2525. continue;
  2526. }
  2527. errorString += " - " + constraints[constraint] + "\n";
  2528. }
  2529. return errorString;
  2530. }
  2531. }]);
  2532. return ValidationErrorsFormatter;
  2533. }();
  2534. exports.ValidationErrorsFormatter = ValidationErrorsFormatter;
  2535. /***/ },
  2536. /* 50 */
  2537. /***/ function(module, exports) {
  2538. "use strict";
  2539. "use strict";
  2540. function AtobTemplate() {
  2541. return "\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 ";
  2542. }
  2543. exports.AtobTemplate = AtobTemplate;
  2544. /***/ },
  2545. /* 51 */
  2546. /***/ function(module, exports) {
  2547. "use strict";
  2548. "use strict";
  2549. function ConsoleOutputDisableExpressionTemplate() {
  2550. return "\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 ";
  2551. }
  2552. exports.ConsoleOutputDisableExpressionTemplate = ConsoleOutputDisableExpressionTemplate;
  2553. /***/ },
  2554. /* 52 */
  2555. /***/ function(module, exports) {
  2556. "use strict";
  2557. "use strict";
  2558. function DebugProtectionFunctionCallTemplate() {
  2559. return "{debugProtectionFunctionName}();";
  2560. }
  2561. exports.DebugProtectionFunctionCallTemplate = DebugProtectionFunctionCallTemplate;
  2562. /***/ },
  2563. /* 53 */
  2564. /***/ function(module, exports) {
  2565. "use strict";
  2566. "use strict";
  2567. function DebugProtectionFunctionIntervalTemplate() {
  2568. return "\n setInterval(function () {\n {debugProtectionFunctionName}();\n }, 4000);\n ";
  2569. }
  2570. exports.DebugProtectionFunctionIntervalTemplate = DebugProtectionFunctionIntervalTemplate;
  2571. /***/ },
  2572. /* 54 */
  2573. /***/ function(module, exports, __webpack_require__) {
  2574. "use strict";
  2575. "use strict";
  2576. var Utils_1 = __webpack_require__(0);
  2577. function DebugProtectionFunctionTemplate() {
  2578. return "\n var {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 ";
  2579. }
  2580. exports.DebugProtectionFunctionTemplate = DebugProtectionFunctionTemplate;
  2581. /***/ },
  2582. /* 55 */
  2583. /***/ function(module, exports, __webpack_require__) {
  2584. "use strict";
  2585. "use strict";
  2586. var Utils_1 = __webpack_require__(0);
  2587. function SelfDefendingTemplate() {
  2588. return "\n (function () { \n var func = function(){return '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') + " + '(false){}')() : []['filter']['constructor'](" + Utils_1.Utils.stringToJSFuck('while') + " + '(true){}')() : []['filter']['constructor'](" + Utils_1.Utils.stringToJSFuck('while') + " + '(false){}')();\n })();\n ";
  2589. }
  2590. exports.SelfDefendingTemplate = SelfDefendingTemplate;
  2591. /***/ },
  2592. /* 56 */
  2593. /***/ function(module, exports) {
  2594. "use strict";
  2595. "use strict";
  2596. function UnicodeArrayCallsWrapperTemplate() {
  2597. return "\n var {unicodeArrayCallsWrapperName} = function ({keyName}) {\n return {unicodeArrayName}[parseInt({keyName}, 0x010)];\n };\n ";
  2598. }
  2599. exports.UnicodeArrayCallsWrapperTemplate = UnicodeArrayCallsWrapperTemplate;
  2600. /***/ },
  2601. /* 57 */
  2602. /***/ function(module, exports, __webpack_require__) {
  2603. "use strict";
  2604. "use strict";
  2605. var Utils_1 = __webpack_require__(0);
  2606. function SelfDefendingTemplate() {
  2607. return "\n var func = function(){return 'dev';};\n \n Function(" + Utils_1.Utils.stringToUnicode("return/\\w+ *\\(\\) *{\\w+ *['|\"].+['|\"];? *}/") + ")()['test'](func['toString']()) !== true && !{unicodeArrayName}++ ? []['filter']['constructor'](" + Utils_1.Utils.stringToJSFuck('while') + " + '(true){}')() : Function('a', atob(" + Utils_1.Utils.stringToUnicode(Utils_1.Utils.btoa('a.call()')) + "))({forLoopFunctionName}) ? []['filter']['constructor'](" + Utils_1.Utils.stringToJSFuck('while') + " + '(false){}')() : []['filter']['constructor'](" + Utils_1.Utils.stringToJSFuck('while') + " + '(false){}')();\n ";
  2608. }
  2609. exports.SelfDefendingTemplate = SelfDefendingTemplate;
  2610. /***/ },
  2611. /* 58 */
  2612. /***/ function(module, exports) {
  2613. "use strict";
  2614. "use strict";
  2615. function UnicodeArrayDecodeTemplate() {
  2616. return "\n (function () {\n {atobPolyfill}\n \n var {forLoopFunctionName} = function () {\n var array = [];\n \n for (var i in {unicodeArrayName}) {\n array['push'](decodeURI(atob({unicodeArrayName}[i])));\n }\n \n {unicodeArrayName} = array;\n };\n \n {code}\n })();\n ";
  2617. }
  2618. exports.UnicodeArrayDecodeTemplate = UnicodeArrayDecodeTemplate;
  2619. /***/ },
  2620. /* 59 */
  2621. /***/ function(module, exports) {
  2622. "use strict";
  2623. "use strict";
  2624. function UnicodeArrayTemplate() {
  2625. return "\n var {unicodeArrayName} = [{unicodeArray}];\n ";
  2626. }
  2627. exports.UnicodeArrayTemplate = UnicodeArrayTemplate;
  2628. /***/ },
  2629. /* 60 */
  2630. /***/ function(module, exports, __webpack_require__) {
  2631. "use strict";
  2632. "use strict";
  2633. var Utils_1 = __webpack_require__(0);
  2634. function SelfDefendingTemplate() {
  2635. return "(function () {\n var func = function(){return 'dev';};\n \n !Function(" + Utils_1.Utils.stringToUnicode("return/\\w+ *\\(\\) *{\\w+ *['|\"].+['|\"];? *}/") + ")().test(func.toString()) ? []['filter']['constructor'](" + Utils_1.Utils.stringToJSFuck('while') + " + '(true){}')() : Function('a', 'b', 'a(++b)')({whileFunctionName}, {timesName}) ? []['filter']['constructor'](" + Utils_1.Utils.stringToJSFuck('while') + " + '(false){}')() : []['filter']['constructor'](" + Utils_1.Utils.stringToJSFuck('while') + " + '(false){}')();\n })();";
  2636. }
  2637. exports.SelfDefendingTemplate = SelfDefendingTemplate;
  2638. /***/ },
  2639. /* 61 */
  2640. /***/ function(module, exports) {
  2641. "use strict";
  2642. "use strict";
  2643. function UnicodeArrayRotateFunctionTemplate() {
  2644. return "\n (function (array, {timesName}) {\n var {whileFunctionName} = function (times) {\n while (--times) {\n array['push'](array['shift']());\n }\n };\n \n {code}\n })({unicodeArrayName}, 0x{unicodeArrayRotateValue});\n ";
  2645. }
  2646. exports.UnicodeArrayRotateFunctionTemplate = UnicodeArrayRotateFunctionTemplate;
  2647. /***/ },
  2648. /* 62 */
  2649. /***/ function(module, exports) {
  2650. module.exports = require("chance");
  2651. /***/ },
  2652. /* 63 */
  2653. /***/ function(module, exports) {
  2654. module.exports = require("class-validator");
  2655. /***/ },
  2656. /* 64 */
  2657. /***/ function(module, exports) {
  2658. module.exports = require("commander");
  2659. /***/ },
  2660. /* 65 */
  2661. /***/ function(module, exports) {
  2662. module.exports = require("fs");
  2663. /***/ },
  2664. /* 66 */
  2665. /***/ function(module, exports) {
  2666. module.exports = require("mkdirp");
  2667. /***/ },
  2668. /* 67 */
  2669. /***/ function(module, exports, __webpack_require__) {
  2670. "use strict";
  2671. "use strict";
  2672. var JavaScriptObfuscator_1 = __webpack_require__(9);
  2673. if (!global._babelPolyfill) {
  2674. __webpack_require__(20);
  2675. }
  2676. module.exports = JavaScriptObfuscator_1.JavaScriptObfuscator;
  2677. /***/ }
  2678. /******/ ]);
  2679. //# sourceMappingURL=index.js.map