index.js 218 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352
  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 = 87);
  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__(81);
  97. var JSFuck_1 = __webpack_require__(21);
  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 chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  128. var output = '';
  129. string = encodeURIComponent(string).replace(/%([0-9A-F]{2})/g, function (match, p1) {
  130. return String.fromCharCode(parseInt('0x' + p1));
  131. });
  132. for (var block, charCode, idx = 0, map = chars; string.charAt(idx | 0) || (map = '=', idx % 1); output += map.charAt(63 & block >> 8 - idx % 1 * 8)) {
  133. charCode = string.charCodeAt(idx += 3 / 4);
  134. if (charCode > 0xFF) {
  135. throw new Error("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");
  136. }
  137. block = block << 8 | charCode;
  138. }
  139. return output;
  140. }
  141. }, {
  142. key: 'decToHex',
  143. value: function decToHex(dec) {
  144. var radix = 16;
  145. return Number(dec).toString(radix);
  146. }
  147. }, {
  148. key: 'extractDomainFromUrl',
  149. value: function extractDomainFromUrl(url) {
  150. var domain = void 0;
  151. if (url.indexOf('://') > -1 || url.indexOf('//') === 0) {
  152. domain = url.split('/')[2];
  153. } else {
  154. domain = url.split('/')[0];
  155. }
  156. domain = domain.split(':')[0];
  157. return domain;
  158. }
  159. }, {
  160. key: 'getRandomGenerator',
  161. value: function getRandomGenerator() {
  162. return Utils.randomGenerator;
  163. }
  164. }, {
  165. key: 'getRandomVariableName',
  166. value: function getRandomVariableName() {
  167. var length = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 6;
  168. var rangeMinInteger = 10000,
  169. rangeMaxInteger = 99999999,
  170. prefix = '_0x';
  171. return '' + prefix + Utils.decToHex(Utils.getRandomGenerator().integer({
  172. min: rangeMinInteger,
  173. max: rangeMaxInteger
  174. })).substr(0, length);
  175. }
  176. }, {
  177. key: 'hideString',
  178. value: function hideString(str, length) {
  179. var escapeRegExp = function escapeRegExp(s) {
  180. return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
  181. };
  182. var randomMerge = function randomMerge(s1, s2) {
  183. var i1 = -1,
  184. i2 = -1,
  185. result = '';
  186. while (i1 < s1.length || i2 < s2.length) {
  187. if (Math.random() < 0.5 && i2 < s2.length) {
  188. result += s2.charAt(++i2);
  189. } else {
  190. result += s1.charAt(++i1);
  191. }
  192. }
  193. return result;
  194. };
  195. var customPool = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
  196. var randomString = Utils.randomGenerator.string({ length: length, pool: customPool }),
  197. randomStringDiff = randomString.replace(new RegExp('[' + escapeRegExp(str) + ']', 'g'), ''),
  198. randomStringDiffArray = randomStringDiff.split('');
  199. Utils.randomGenerator.shuffle(randomStringDiffArray);
  200. randomStringDiff = randomStringDiffArray.join('');
  201. return [randomMerge(str, randomStringDiff), randomStringDiff];
  202. }
  203. }, {
  204. key: 'isInteger',
  205. value: function isInteger(number) {
  206. return number % 1 === 0;
  207. }
  208. }, {
  209. key: 'rc4',
  210. value: function rc4(string, key) {
  211. var s = [],
  212. j = 0,
  213. x = void 0,
  214. result = '';
  215. for (var i = 0; i < 256; i++) {
  216. s[i] = i;
  217. }
  218. for (i = 0; i < 256; i++) {
  219. j = (j + s[i] + key.charCodeAt(i % key.length)) % 256;
  220. x = s[i];
  221. s[i] = s[j];
  222. s[j] = x;
  223. }
  224. i = 0;
  225. j = 0;
  226. for (var y = 0; y < string.length; y++) {
  227. i = (i + 1) % 256;
  228. j = (j + s[i]) % 256;
  229. x = s[i];
  230. s[i] = s[j];
  231. s[j] = x;
  232. result += String.fromCharCode(string.charCodeAt(y) ^ s[(s[i] + s[j]) % 256]);
  233. }
  234. return result;
  235. }
  236. }, {
  237. key: 'strEnumify',
  238. value: function strEnumify(obj) {
  239. return obj;
  240. }
  241. }, {
  242. key: 'stringToJSFuck',
  243. value: function stringToJSFuck(string) {
  244. return Array.from(string).map(function (character) {
  245. return JSFuck_1.JSFuck[character] || character;
  246. }).join(' + ');
  247. }
  248. }, {
  249. key: 'stringToUnicode',
  250. value: function stringToUnicode(string) {
  251. var radix = 16;
  252. var prefix = void 0,
  253. regexp = new RegExp('[\x00-\x7F]'),
  254. template = void 0;
  255. return '\'' + string.replace(/[\s\S]/g, function (escape) {
  256. if (regexp.test(escape)) {
  257. prefix = '\\x';
  258. template = '0'.repeat(2);
  259. } else {
  260. prefix = '\\u';
  261. template = '0'.repeat(4);
  262. }
  263. return '' + prefix + (template + escape.charCodeAt(0).toString(radix)).slice(-template.length);
  264. }) + '\'';
  265. }
  266. }]);
  267. return Utils;
  268. }();
  269. Utils.randomGenerator = new chance_1.Chance();
  270. exports.Utils = Utils;
  271. /***/ },
  272. /* 1 */
  273. /***/ function(module, exports, __webpack_require__) {
  274. "use strict";
  275. "use strict";
  276. 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; }; })();
  277. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  278. var escodegen = __webpack_require__(12);
  279. var esprima = __webpack_require__(24);
  280. var estraverse = __webpack_require__(5);
  281. var NodeType_1 = __webpack_require__(7);
  282. var Node_1 = __webpack_require__(3);
  283. var Utils_1 = __webpack_require__(0);
  284. var NodeUtils = function () {
  285. function NodeUtils() {
  286. _classCallCheck(this, NodeUtils);
  287. }
  288. _createClass(NodeUtils, null, [{
  289. key: 'addXVerbatimPropertyToLiterals',
  290. value: function addXVerbatimPropertyToLiterals(node) {
  291. NodeUtils.typedReplace(node, NodeType_1.NodeType.Literal, {
  292. leave: function leave(node) {
  293. node['x-verbatim-property'] = {
  294. content: node.raw,
  295. precedence: escodegen.Precedence.Primary
  296. };
  297. }
  298. });
  299. }
  300. }, {
  301. key: 'convertCodeToStructure',
  302. value: function convertCodeToStructure(code) {
  303. var structure = esprima.parse(code);
  304. NodeUtils.addXVerbatimPropertyToLiterals(structure);
  305. NodeUtils.parentize(structure);
  306. return structure.body;
  307. }
  308. }, {
  309. key: 'getBlockStatementNodeByIndex',
  310. value: function getBlockStatementNodeByIndex(node) {
  311. var index = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  312. if (Node_1.Node.isNodeHasBlockStatement(node)) {
  313. if (node.body[index] === undefined) {
  314. throw new ReferenceError('Wrong index `' + index + '`. Block-statement body length is `' + node.body.length + '`');
  315. }
  316. return node.body[index];
  317. }
  318. throw new TypeError('The specified node have no a block-statement');
  319. }
  320. }, {
  321. key: 'getBlockScopeOfNode',
  322. value: function getBlockScopeOfNode(node) {
  323. var depth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  324. var parentNode = node.parentNode;
  325. if (!parentNode) {
  326. throw new ReferenceError('`parentNode` property of given node is `undefined`');
  327. }
  328. if (Node_1.Node.isBlockStatementNode(parentNode)) {
  329. if (!parentNode.parentNode) {
  330. throw new ReferenceError('`parentNode` property of `parentNode` of given node is `undefined`');
  331. }
  332. if (!Utils_1.Utils.arrayContains(NodeUtils.nodesWithBlockScope, parentNode.parentNode.type)) {
  333. return NodeUtils.getBlockScopeOfNode(parentNode, depth);
  334. } else if (depth > 0) {
  335. return NodeUtils.getBlockScopeOfNode(parentNode, --depth);
  336. }
  337. return parentNode;
  338. }
  339. if (Node_1.Node.isProgramNode(parentNode)) {
  340. return parentNode;
  341. }
  342. return NodeUtils.getBlockScopeOfNode(parentNode);
  343. }
  344. }, {
  345. key: 'parentize',
  346. value: function parentize(node) {
  347. var isRootNode = true;
  348. estraverse.replace(node, {
  349. enter: function enter(node, parentNode) {
  350. var value = void 0;
  351. if (isRootNode) {
  352. if (node.type === NodeType_1.NodeType.Program) {
  353. value = node;
  354. } else {
  355. value = Node_1.Node.getProgramNode([node]);
  356. value['parentNode'] = value;
  357. }
  358. isRootNode = false;
  359. } else {
  360. value = parentNode || node;
  361. }
  362. node['parentNode'] = value;
  363. node['obfuscated'] = false;
  364. }
  365. });
  366. }
  367. }, {
  368. key: 'typedReplace',
  369. value: function typedReplace(node, nodeType, visitor) {
  370. NodeUtils.typedTraverse(node, nodeType, visitor, 'replace');
  371. }
  372. }, {
  373. key: 'typedTraverse',
  374. value: function typedTraverse(node, nodeType, visitor) {
  375. var traverseType = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'traverse';
  376. estraverse[traverseType](node, {
  377. enter: function enter(node, parentNode) {
  378. if (node.type === nodeType && visitor.enter) {
  379. visitor.enter(node, parentNode);
  380. }
  381. },
  382. leave: function leave(node, parentNode) {
  383. if (node.type === nodeType && visitor.leave) {
  384. visitor.leave(node, parentNode);
  385. }
  386. }
  387. });
  388. }
  389. }]);
  390. return NodeUtils;
  391. }();
  392. NodeUtils.nodesWithBlockScope = [NodeType_1.NodeType.ArrowFunctionExpression, NodeType_1.NodeType.FunctionDeclaration, NodeType_1.NodeType.FunctionExpression, NodeType_1.NodeType.MethodDefinition, NodeType_1.NodeType.Program];
  393. exports.NodeUtils = NodeUtils;
  394. /***/ },
  395. /* 2 */
  396. /***/ function(module, exports) {
  397. "use strict";
  398. "use strict";
  399. (function (AppendState) {
  400. AppendState[AppendState["AfterObfuscation"] = 0] = "AfterObfuscation";
  401. AppendState[AppendState["BeforeObfuscation"] = 1] = "BeforeObfuscation";
  402. })(exports.AppendState || (exports.AppendState = {}));
  403. var AppendState = exports.AppendState;
  404. /***/ },
  405. /* 3 */
  406. /***/ function(module, exports, __webpack_require__) {
  407. "use strict";
  408. "use strict";
  409. 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; }; })();
  410. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  411. var NodeType_1 = __webpack_require__(7);
  412. var Node = function () {
  413. function Node() {
  414. _classCallCheck(this, Node);
  415. }
  416. _createClass(Node, null, [{
  417. key: 'getProgramNode',
  418. value: function getProgramNode(bodyNode) {
  419. return {
  420. 'type': NodeType_1.NodeType.Program,
  421. 'body': bodyNode,
  422. 'sourceType': 'script',
  423. 'obfuscated': false
  424. };
  425. }
  426. }, {
  427. key: 'isArrowFunctionExpressionNode',
  428. value: function isArrowFunctionExpressionNode(node) {
  429. return node.type === NodeType_1.NodeType.ArrowFunctionExpression;
  430. }
  431. }, {
  432. key: 'isBlockStatementNode',
  433. value: function isBlockStatementNode(node) {
  434. return node.type === NodeType_1.NodeType.BlockStatement;
  435. }
  436. }, {
  437. key: 'isCallExpressionNode',
  438. value: function isCallExpressionNode(node) {
  439. return node.type === NodeType_1.NodeType.CallExpression;
  440. }
  441. }, {
  442. key: 'isExpressionStatementNode',
  443. value: function isExpressionStatementNode(node) {
  444. return node.type === NodeType_1.NodeType.ExpressionStatement;
  445. }
  446. }, {
  447. key: 'isFunctionDeclarationNode',
  448. value: function isFunctionDeclarationNode(node) {
  449. return node.type === NodeType_1.NodeType.FunctionDeclaration;
  450. }
  451. }, {
  452. key: 'isFunctionExpressionNode',
  453. value: function isFunctionExpressionNode(node) {
  454. return node.type === NodeType_1.NodeType.FunctionExpression;
  455. }
  456. }, {
  457. key: 'isIdentifierNode',
  458. value: function isIdentifierNode(node) {
  459. return node.type === NodeType_1.NodeType.Identifier;
  460. }
  461. }, {
  462. key: 'isLiteralNode',
  463. value: function isLiteralNode(node) {
  464. return node.type === NodeType_1.NodeType.Literal;
  465. }
  466. }, {
  467. key: 'isMemberExpressionNode',
  468. value: function isMemberExpressionNode(node) {
  469. return node.type === NodeType_1.NodeType.MemberExpression;
  470. }
  471. }, {
  472. key: 'isObjectExpressionNode',
  473. value: function isObjectExpressionNode(node) {
  474. return node.type === NodeType_1.NodeType.ObjectExpression;
  475. }
  476. }, {
  477. key: 'isProgramNode',
  478. value: function isProgramNode(node) {
  479. return node.type === NodeType_1.NodeType.Program;
  480. }
  481. }, {
  482. key: 'isPropertyNode',
  483. value: function isPropertyNode(node) {
  484. return node.type === NodeType_1.NodeType.Property;
  485. }
  486. }, {
  487. key: 'isReplaceableIdentifierNode',
  488. value: function isReplaceableIdentifierNode(node, parentNode) {
  489. if (!Node.isIdentifierNode(node)) {
  490. return false;
  491. }
  492. var parentNodeIsPropertyNode = Node.isPropertyNode(parentNode) && parentNode.key === node;
  493. var parentNodeIsMemberExpressionNode = Node.isMemberExpressionNode(parentNode) && parentNode.computed === false && parentNode.property === node;
  494. return !parentNodeIsPropertyNode && !parentNodeIsMemberExpressionNode;
  495. }
  496. }, {
  497. key: 'isVariableDeclarationNode',
  498. value: function isVariableDeclarationNode(node) {
  499. return node.type === NodeType_1.NodeType.VariableDeclaration;
  500. }
  501. }, {
  502. key: 'isVariableDeclaratorNode',
  503. value: function isVariableDeclaratorNode(node) {
  504. return node.type === NodeType_1.NodeType.VariableDeclarator;
  505. }
  506. }, {
  507. key: 'isNodeHasBlockStatement',
  508. value: function isNodeHasBlockStatement(node) {
  509. return node.hasOwnProperty('body') && Array.isArray(node.body);
  510. }
  511. }]);
  512. return Node;
  513. }();
  514. exports.Node = Node;
  515. /***/ },
  516. /* 4 */
  517. /***/ function(module, exports, __webpack_require__) {
  518. "use strict";
  519. "use strict";
  520. 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; }; })();
  521. 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); } }
  522. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  523. var Utils_1 = __webpack_require__(0);
  524. var NodeAppender = function () {
  525. function NodeAppender() {
  526. _classCallCheck(this, NodeAppender);
  527. }
  528. _createClass(NodeAppender, null, [{
  529. key: 'appendNode',
  530. value: function appendNode(blockScopeNode, nodeBodyStatements) {
  531. if (!NodeAppender.validateBodyStatements(nodeBodyStatements)) {
  532. nodeBodyStatements = [];
  533. }
  534. nodeBodyStatements = NodeAppender.parentizeBodyStatementsBeforeAppend(blockScopeNode, nodeBodyStatements);
  535. blockScopeNode.body = [].concat(_toConsumableArray(blockScopeNode.body), _toConsumableArray(nodeBodyStatements));
  536. }
  537. }, {
  538. key: 'appendNodeToOptimalBlockScope',
  539. value: function appendNodeToOptimalBlockScope(blockScopeStackTraceData, blockScopeNode, nodeBodyStatements) {
  540. var index = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
  541. var targetBlockScope = void 0;
  542. if (!blockScopeStackTraceData.length) {
  543. targetBlockScope = blockScopeNode;
  544. } else {
  545. targetBlockScope = NodeAppender.getOptimalBlockScope(blockScopeStackTraceData, index);
  546. }
  547. NodeAppender.prependNode(targetBlockScope, nodeBodyStatements);
  548. }
  549. }, {
  550. key: 'getOptimalBlockScope',
  551. value: function getOptimalBlockScope(blockScopeTraceData, index) {
  552. var deep = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : Infinity;
  553. var firstCall = blockScopeTraceData[index];
  554. if (deep <= 0) {
  555. throw new Error('Invalid `deep` argument value. Value should be bigger then 0.');
  556. }
  557. if (deep > 1 && firstCall.stackTrace.length) {
  558. return NodeAppender.getOptimalBlockScope(firstCall.stackTrace, 0, --deep);
  559. } else {
  560. return firstCall.callee;
  561. }
  562. }
  563. }, {
  564. key: 'getRandomStackTraceIndex',
  565. value: function getRandomStackTraceIndex(stackTraceRootLength) {
  566. return Utils_1.Utils.getRandomGenerator().integer({
  567. min: 0,
  568. max: Math.max(0, Math.round(stackTraceRootLength - 1))
  569. });
  570. }
  571. }, {
  572. key: 'insertNodeAtIndex',
  573. value: function insertNodeAtIndex(blockScopeNode, nodeBodyStatements, index) {
  574. if (!NodeAppender.validateBodyStatements(nodeBodyStatements)) {
  575. nodeBodyStatements = [];
  576. }
  577. nodeBodyStatements = NodeAppender.parentizeBodyStatementsBeforeAppend(blockScopeNode, nodeBodyStatements);
  578. blockScopeNode.body = [].concat(_toConsumableArray(blockScopeNode.body.slice(0, index)), _toConsumableArray(nodeBodyStatements), _toConsumableArray(blockScopeNode.body.slice(index)));
  579. }
  580. }, {
  581. key: 'prependNode',
  582. value: function prependNode(blockScopeNode, nodeBodyStatements) {
  583. if (!NodeAppender.validateBodyStatements(nodeBodyStatements)) {
  584. nodeBodyStatements = [];
  585. }
  586. nodeBodyStatements = NodeAppender.parentizeBodyStatementsBeforeAppend(blockScopeNode, nodeBodyStatements);
  587. blockScopeNode.body = [].concat(_toConsumableArray(nodeBodyStatements), _toConsumableArray(blockScopeNode.body));
  588. }
  589. }, {
  590. key: 'parentizeBodyStatementsBeforeAppend',
  591. value: function parentizeBodyStatementsBeforeAppend(blockScopeNode, nodeBodyStatements) {
  592. var _iteratorNormalCompletion = true;
  593. var _didIteratorError = false;
  594. var _iteratorError = undefined;
  595. try {
  596. for (var _iterator = nodeBodyStatements[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
  597. var statement = _step.value;
  598. statement.parentNode = blockScopeNode;
  599. }
  600. } catch (err) {
  601. _didIteratorError = true;
  602. _iteratorError = err;
  603. } finally {
  604. try {
  605. if (!_iteratorNormalCompletion && _iterator.return) {
  606. _iterator.return();
  607. }
  608. } finally {
  609. if (_didIteratorError) {
  610. throw _iteratorError;
  611. }
  612. }
  613. }
  614. return nodeBodyStatements;
  615. }
  616. }, {
  617. key: 'validateBodyStatements',
  618. value: function validateBodyStatements(nodeBodyStatements) {
  619. return nodeBodyStatements.every(function (statementNode) {
  620. return !!statementNode && statementNode.hasOwnProperty('type');
  621. });
  622. }
  623. }]);
  624. return NodeAppender;
  625. }();
  626. exports.NodeAppender = NodeAppender;
  627. /***/ },
  628. /* 5 */
  629. /***/ function(module, exports) {
  630. module.exports = require("estraverse");
  631. /***/ },
  632. /* 6 */
  633. /***/ function(module, exports) {
  634. "use strict";
  635. "use strict";
  636. 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; }; })();
  637. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  638. var AbstractCustomNode = function () {
  639. function AbstractCustomNode(options) {
  640. _classCallCheck(this, AbstractCustomNode);
  641. this.options = options;
  642. }
  643. _createClass(AbstractCustomNode, [{
  644. key: "getAppendState",
  645. value: function getAppendState() {
  646. return this.appendState;
  647. }
  648. }, {
  649. key: "getNode",
  650. value: function getNode() {
  651. return this.getNodeStructure();
  652. }
  653. }, {
  654. key: "setAppendState",
  655. value: function setAppendState(appendState) {
  656. this.appendState = appendState;
  657. }
  658. }]);
  659. return AbstractCustomNode;
  660. }();
  661. exports.AbstractCustomNode = AbstractCustomNode;
  662. /***/ },
  663. /* 7 */
  664. /***/ function(module, exports, __webpack_require__) {
  665. "use strict";
  666. "use strict";
  667. var Utils_1 = __webpack_require__(0);
  668. exports.NodeType = Utils_1.Utils.strEnumify({
  669. ArrayExpression: 'ArrayExpression',
  670. ArrowFunctionExpression: 'ArrowFunctionExpression',
  671. AssignmentExpression: 'AssignmentExpression',
  672. BinaryExpression: 'BinaryExpression',
  673. BlockStatement: 'BlockStatement',
  674. CallExpression: 'CallExpression',
  675. CatchClause: 'CatchClause',
  676. ClassDeclaration: 'ClassDeclaration',
  677. ExpressionStatement: 'ExpressionStatement',
  678. FunctionDeclaration: 'FunctionDeclaration',
  679. FunctionExpression: 'FunctionExpression',
  680. Identifier: 'Identifier',
  681. IfStatement: 'IfStatement',
  682. Literal: 'Literal',
  683. LogicalExpression: 'LogicalExpression',
  684. MemberExpression: 'MemberExpression',
  685. MethodDefinition: 'MethodDefinition',
  686. ObjectExpression: 'ObjectExpression',
  687. Program: 'Program',
  688. Property: 'Property',
  689. ReturnStatement: 'ReturnStatement',
  690. TryStatement: 'TryStatement',
  691. UnaryExpression: 'UnaryExpression',
  692. UpdateExpression: 'UpdateExpression',
  693. VariableDeclaration: 'VariableDeclaration',
  694. VariableDeclarator: 'VariableDeclarator',
  695. WhileStatement: 'WhileStatement'
  696. });
  697. /***/ },
  698. /* 8 */
  699. /***/ function(module, exports) {
  700. module.exports = require("format-unicorn");
  701. /***/ },
  702. /* 9 */
  703. /***/ function(module, exports) {
  704. "use strict";
  705. "use strict";
  706. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  707. var AbstractNodeObfuscator = function AbstractNodeObfuscator(nodes, options) {
  708. _classCallCheck(this, AbstractNodeObfuscator);
  709. this.nodes = nodes;
  710. this.options = options;
  711. };
  712. exports.AbstractNodeObfuscator = AbstractNodeObfuscator;
  713. /***/ },
  714. /* 10 */
  715. /***/ function(module, exports, __webpack_require__) {
  716. "use strict";
  717. "use strict";
  718. 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; }; })();
  719. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  720. var JavaScriptObfuscatorCLI_1 = __webpack_require__(32);
  721. var JavaScriptObfuscatorInternal_1 = __webpack_require__(27);
  722. var JavaScriptObfuscator = function () {
  723. function JavaScriptObfuscator() {
  724. _classCallCheck(this, JavaScriptObfuscator);
  725. }
  726. _createClass(JavaScriptObfuscator, null, [{
  727. key: 'obfuscate',
  728. value: function obfuscate(sourceCode) {
  729. var obfuscatorOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  730. var javaScriptObfuscator = new JavaScriptObfuscatorInternal_1.JavaScriptObfuscatorInternal(sourceCode, obfuscatorOptions);
  731. javaScriptObfuscator.obfuscate();
  732. return javaScriptObfuscator.getObfuscationResult();
  733. }
  734. }, {
  735. key: 'runCLI',
  736. value: function runCLI(argv) {
  737. new JavaScriptObfuscatorCLI_1.JavaScriptObfuscatorCLI(argv).run();
  738. }
  739. }]);
  740. return JavaScriptObfuscator;
  741. }();
  742. exports.JavaScriptObfuscator = JavaScriptObfuscator;
  743. /***/ },
  744. /* 11 */
  745. /***/ function(module, exports, __webpack_require__) {
  746. "use strict";
  747. "use strict";
  748. 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; }; })();
  749. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  750. var AppendState_1 = __webpack_require__(2);
  751. var AbstractNodesGroup = function () {
  752. function AbstractNodesGroup(stackTraceData, options) {
  753. _classCallCheck(this, AbstractNodesGroup);
  754. this.appendState = AppendState_1.AppendState.BeforeObfuscation;
  755. this.stackTraceData = stackTraceData;
  756. this.options = options;
  757. }
  758. _createClass(AbstractNodesGroup, [{
  759. key: "syncCustomNodesWithNodesGroup",
  760. value: function syncCustomNodesWithNodesGroup(customNodes) {
  761. var _this = this;
  762. customNodes.forEach(function (node) {
  763. node.setAppendState(_this.appendState);
  764. });
  765. return customNodes;
  766. }
  767. }]);
  768. return AbstractNodesGroup;
  769. }();
  770. exports.AbstractNodesGroup = AbstractNodesGroup;
  771. /***/ },
  772. /* 12 */
  773. /***/ function(module, exports) {
  774. module.exports = require("escodegen");
  775. /***/ },
  776. /* 13 */
  777. /***/ function(module, exports) {
  778. "use strict";
  779. "use strict";
  780. exports.SourceMapMode = {
  781. Inline: 'inline',
  782. Separate: 'separate'
  783. };
  784. /***/ },
  785. /* 14 */
  786. /***/ function(module, exports) {
  787. "use strict";
  788. "use strict";
  789. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  790. var AbstractReplacer = function AbstractReplacer(nodes, options) {
  791. _classCallCheck(this, AbstractReplacer);
  792. this.nodes = nodes;
  793. this.options = options;
  794. };
  795. exports.AbstractReplacer = AbstractReplacer;
  796. /***/ },
  797. /* 15 */
  798. /***/ function(module, exports, __webpack_require__) {
  799. "use strict";
  800. "use strict";
  801. 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; }; })();
  802. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  803. 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; }
  804. 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; }
  805. var AbstractReplacer_1 = __webpack_require__(14);
  806. var Utils_1 = __webpack_require__(0);
  807. var IdentifierReplacer = function (_AbstractReplacer_1$A) {
  808. _inherits(IdentifierReplacer, _AbstractReplacer_1$A);
  809. function IdentifierReplacer() {
  810. _classCallCheck(this, IdentifierReplacer);
  811. var _this = _possibleConstructorReturn(this, (IdentifierReplacer.__proto__ || Object.getPrototypeOf(IdentifierReplacer)).apply(this, arguments));
  812. _this.namesMap = new Map();
  813. return _this;
  814. }
  815. _createClass(IdentifierReplacer, [{
  816. key: 'replace',
  817. value: function replace(nodeValue) {
  818. var obfuscatedIdentifierName = this.namesMap.get(nodeValue);
  819. if (!obfuscatedIdentifierName) {
  820. return nodeValue;
  821. }
  822. return obfuscatedIdentifierName;
  823. }
  824. }, {
  825. key: 'storeNames',
  826. value: function storeNames(nodeName) {
  827. if (!this.isReservedName(nodeName)) {
  828. this.namesMap.set(nodeName, Utils_1.Utils.getRandomVariableName());
  829. }
  830. }
  831. }, {
  832. key: 'isReservedName',
  833. value: function isReservedName(name) {
  834. return this.options.reservedNames.some(function (reservedName) {
  835. return new RegExp(reservedName, 'g').test(name);
  836. });
  837. }
  838. }]);
  839. return IdentifierReplacer;
  840. }(AbstractReplacer_1.AbstractReplacer);
  841. exports.IdentifierReplacer = IdentifierReplacer;
  842. /***/ },
  843. /* 16 */
  844. /***/ function(module, exports, __webpack_require__) {
  845. "use strict";
  846. "use strict";
  847. var SourceMapMode_1 = __webpack_require__(13);
  848. exports.NO_CUSTOM_NODES_PRESET = Object.freeze({
  849. compact: true,
  850. debugProtection: false,
  851. debugProtectionInterval: false,
  852. disableConsoleOutput: false,
  853. domainLock: [],
  854. reservedNames: [],
  855. rotateUnicodeArray: false,
  856. selfDefending: false,
  857. sourceMap: false,
  858. sourceMapBaseUrl: '',
  859. sourceMapFileName: '',
  860. sourceMapMode: SourceMapMode_1.SourceMapMode.Separate,
  861. unicodeArray: false,
  862. unicodeArrayEncoding: false,
  863. unicodeArrayThreshold: 0
  864. });
  865. /***/ },
  866. /* 17 */
  867. /***/ function(module, exports, __webpack_require__) {
  868. "use strict";
  869. "use strict";
  870. 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; }; })();
  871. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  872. 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; }
  873. 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; }
  874. __webpack_require__(8);
  875. var AppendState_1 = __webpack_require__(2);
  876. var SingleNodeCallControllerTemplate_1 = __webpack_require__(65);
  877. var NoCustomNodesPreset_1 = __webpack_require__(16);
  878. var AbstractCustomNode_1 = __webpack_require__(6);
  879. var JavaScriptObfuscator_1 = __webpack_require__(10);
  880. var NodeAppender_1 = __webpack_require__(4);
  881. var NodeUtils_1 = __webpack_require__(1);
  882. var NodeCallsControllerFunctionNode = function (_AbstractCustomNode_) {
  883. _inherits(NodeCallsControllerFunctionNode, _AbstractCustomNode_);
  884. function NodeCallsControllerFunctionNode(stackTraceData, callsControllerFunctionName, randomStackTraceIndex, options) {
  885. _classCallCheck(this, NodeCallsControllerFunctionNode);
  886. var _this = _possibleConstructorReturn(this, (NodeCallsControllerFunctionNode.__proto__ || Object.getPrototypeOf(NodeCallsControllerFunctionNode)).call(this, options));
  887. _this.appendState = AppendState_1.AppendState.BeforeObfuscation;
  888. _this.stackTraceData = stackTraceData;
  889. _this.callsControllerFunctionName = callsControllerFunctionName;
  890. _this.randomStackTraceIndex = randomStackTraceIndex;
  891. return _this;
  892. }
  893. _createClass(NodeCallsControllerFunctionNode, [{
  894. key: 'appendNode',
  895. value: function appendNode(blockScopeNode) {
  896. var targetBlockScope = void 0;
  897. if (this.stackTraceData.length) {
  898. targetBlockScope = NodeAppender_1.NodeAppender.getOptimalBlockScope(this.stackTraceData, this.randomStackTraceIndex, 1);
  899. } else {
  900. targetBlockScope = blockScopeNode;
  901. }
  902. NodeAppender_1.NodeAppender.prependNode(targetBlockScope, this.getNode());
  903. }
  904. }, {
  905. key: 'getNodeStructure',
  906. value: function getNodeStructure() {
  907. if (this.appendState === AppendState_1.AppendState.AfterObfuscation) {
  908. return NodeUtils_1.NodeUtils.convertCodeToStructure(JavaScriptObfuscator_1.JavaScriptObfuscator.obfuscate(SingleNodeCallControllerTemplate_1.SingleNodeCallControllerTemplate().formatUnicorn({
  909. singleNodeCallControllerFunctionName: this.callsControllerFunctionName
  910. }), NoCustomNodesPreset_1.NO_CUSTOM_NODES_PRESET).getObfuscatedCode());
  911. }
  912. return NodeUtils_1.NodeUtils.convertCodeToStructure(SingleNodeCallControllerTemplate_1.SingleNodeCallControllerTemplate().formatUnicorn({
  913. singleNodeCallControllerFunctionName: this.callsControllerFunctionName
  914. }));
  915. }
  916. }]);
  917. return NodeCallsControllerFunctionNode;
  918. }(AbstractCustomNode_1.AbstractCustomNode);
  919. exports.NodeCallsControllerFunctionNode = NodeCallsControllerFunctionNode;
  920. /***/ },
  921. /* 18 */
  922. /***/ function(module, exports) {
  923. "use strict";
  924. "use strict";
  925. exports.UnicodeArrayEncoding = {
  926. base64: 'base64',
  927. rc4: 'rc4'
  928. };
  929. /***/ },
  930. /* 19 */
  931. /***/ function(module, exports, __webpack_require__) {
  932. "use strict";
  933. "use strict";
  934. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  935. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  936. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  937. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  938. var UnicodeArrayEncoding_1 = __webpack_require__(18);
  939. var AbstractReplacer_1 = __webpack_require__(14);
  940. var NumberLiteralReplacer_1 = __webpack_require__(22);
  941. var Utils_1 = __webpack_require__(0);
  942. var StringLiteralReplacer = function (_AbstractReplacer_1$A) {
  943. _inherits(StringLiteralReplacer, _AbstractReplacer_1$A);
  944. function StringLiteralReplacer() {
  945. _classCallCheck(this, StringLiteralReplacer);
  946. return _possibleConstructorReturn(this, (StringLiteralReplacer.__proto__ || Object.getPrototypeOf(StringLiteralReplacer)).apply(this, arguments));
  947. }
  948. _createClass(StringLiteralReplacer, [{
  949. key: 'replace',
  950. value: function replace(nodeValue) {
  951. var replaceWithUnicodeArrayFlag = nodeValue.length >= StringLiteralReplacer.minimumLengthForUnicodeArray && Math.random() <= this.options.unicodeArrayThreshold;
  952. if (this.options.unicodeArray && replaceWithUnicodeArrayFlag) {
  953. return this.replaceStringLiteralWithUnicodeArrayCall(nodeValue);
  954. }
  955. return Utils_1.Utils.stringToUnicode(nodeValue);
  956. }
  957. }, {
  958. key: 'replaceStringLiteralWithUnicodeArrayCall',
  959. value: function replaceStringLiteralWithUnicodeArrayCall(value) {
  960. var unicodeArrayNode = this.nodes.get('unicodeArrayNode');
  961. if (!unicodeArrayNode) {
  962. throw new ReferenceError('`unicodeArrayNode` node is not found in Map with custom node.');
  963. }
  964. var rc4Key = '';
  965. switch (this.options.unicodeArrayEncoding) {
  966. case UnicodeArrayEncoding_1.UnicodeArrayEncoding.base64:
  967. value = Utils_1.Utils.btoa(value);
  968. break;
  969. case UnicodeArrayEncoding_1.UnicodeArrayEncoding.rc4:
  970. rc4Key = Utils_1.Utils.getRandomGenerator().pickone(StringLiteralReplacer.rc4Keys);
  971. value = Utils_1.Utils.btoa(Utils_1.Utils.rc4(value, rc4Key));
  972. break;
  973. }
  974. value = Utils_1.Utils.stringToUnicode(value);
  975. var unicodeArray = unicodeArrayNode.getNodeData(),
  976. indexOfExistingValue = unicodeArray.getIndexOf(value),
  977. indexOfValue = void 0,
  978. hexadecimalIndex = void 0;
  979. if (indexOfExistingValue >= 0) {
  980. indexOfValue = indexOfExistingValue;
  981. } else {
  982. indexOfValue = unicodeArray.getLength();
  983. unicodeArrayNode.updateNodeData(value);
  984. }
  985. hexadecimalIndex = new NumberLiteralReplacer_1.NumberLiteralReplacer(this.nodes, this.options).replace(indexOfValue);
  986. var unicodeArrayCallsWrapper = this.nodes.get('unicodeArrayCallsWrapper');
  987. if (!unicodeArrayCallsWrapper) {
  988. throw new ReferenceError('`unicodeArrayCallsWrapper` node is not found in Map with custom node.');
  989. }
  990. if (this.options.unicodeArrayEncoding === UnicodeArrayEncoding_1.UnicodeArrayEncoding.rc4) {
  991. return unicodeArrayCallsWrapper.getNodeIdentifier() + '(\'' + hexadecimalIndex + '\', ' + Utils_1.Utils.stringToUnicode(rc4Key) + ')';
  992. }
  993. return unicodeArrayCallsWrapper.getNodeIdentifier() + '(\'' + hexadecimalIndex + '\')';
  994. }
  995. }]);
  996. return StringLiteralReplacer;
  997. }(AbstractReplacer_1.AbstractReplacer);
  998. StringLiteralReplacer.minimumLengthForUnicodeArray = 3;
  999. StringLiteralReplacer.rc4Keys = Utils_1.Utils.getRandomGenerator().n(function () {
  1000. return Utils_1.Utils.getRandomGenerator().string({ length: 4 });
  1001. }, 50);
  1002. exports.StringLiteralReplacer = StringLiteralReplacer;
  1003. /***/ },
  1004. /* 20 */
  1005. /***/ function(module, exports) {
  1006. "use strict";
  1007. "use strict";
  1008. 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; }; })();
  1009. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1010. var ObfuscationResult = function () {
  1011. function ObfuscationResult(obfuscatedCode, sourceMap) {
  1012. _classCallCheck(this, ObfuscationResult);
  1013. this.obfuscatedCode = obfuscatedCode;
  1014. this.sourceMap = sourceMap;
  1015. }
  1016. _createClass(ObfuscationResult, [{
  1017. key: "getObfuscatedCode",
  1018. value: function getObfuscatedCode() {
  1019. return this.obfuscatedCode;
  1020. }
  1021. }, {
  1022. key: "getSourceMap",
  1023. value: function getSourceMap() {
  1024. return this.sourceMap;
  1025. }
  1026. }, {
  1027. key: "toString",
  1028. value: function toString() {
  1029. return this.obfuscatedCode;
  1030. }
  1031. }]);
  1032. return ObfuscationResult;
  1033. }();
  1034. exports.ObfuscationResult = ObfuscationResult;
  1035. /***/ },
  1036. /* 21 */
  1037. /***/ function(module, exports) {
  1038. "use strict";
  1039. "use strict";
  1040. exports.JSFuck = {
  1041. Window: '[]["filter"]["constructor"]("return this")()',
  1042. False: '![]',
  1043. True: '!![]',
  1044. a: '(false+"")[1]',
  1045. b: '([]["entries"]()+"")[2]',
  1046. c: '([]["fill"]+"")[3]',
  1047. d: '(undefined+"")[2]',
  1048. e: '(true+"")[3]',
  1049. f: '(false+"")[0]',
  1050. g: '(false+[0]+String)[20]',
  1051. h: '(+(101))["toString"](21)[1]',
  1052. i: '([false]+undefined)[10]',
  1053. j: '([]["entries"]()+"")[3]',
  1054. k: '(+(20))["toString"](21)',
  1055. l: '(false+"")[2]',
  1056. m: '(Number+"")[11]',
  1057. n: '(undefined+"")[1]',
  1058. o: '(true+[]["fill"])[10]',
  1059. p: '(+(211))["toString"](31)[1]',
  1060. q: '(+(212))["toString"](31)[1]',
  1061. r: '(true+"")[1]',
  1062. s: '(false+"")[3]',
  1063. t: '(true+"")[0]',
  1064. u: '(undefined+"")[0]',
  1065. v: '(+(31))["toString"](32)',
  1066. w: '(+(32))["toString"](33)',
  1067. x: '(+(101))["toString"](34)[1]',
  1068. y: '(NaN+[Infinity])[10]',
  1069. z: '(+(35))["toString"](36)',
  1070. A: '(+[]+Array)[10]',
  1071. B: '(+[]+Boolean)[10]',
  1072. C: 'Function("return escape")()(("")["italics"]())[2]',
  1073. D: 'Function("return escape")()([]["fill"])["slice"]("-1")',
  1074. E: '(RegExp+"")[12]',
  1075. F: '(+[]+Function)[10]',
  1076. G: '(false+Function("return Date")()())[30]',
  1077. H: '\'H\'',
  1078. I: '(Infinity+"")[0]',
  1079. J: '\'J\'',
  1080. K: '\'K\'',
  1081. L: '\'L\'',
  1082. M: '(true+Function("return Date")()())[30]',
  1083. N: '(NaN+"")[0]',
  1084. O: '(NaN+Function("return{}")())[11]',
  1085. P: '\'P\'',
  1086. Q: '\'Q\'',
  1087. R: '(+[]+RegExp)[10]',
  1088. S: '(+[]+String)[10]',
  1089. T: '(NaN+Function("return Date")()())[30]',
  1090. U: '(NaN+Function("return{}")()["toString"]["call"]())[11]',
  1091. V: '\'V\'',
  1092. W: '\'W\'',
  1093. X: '\'X\'',
  1094. Y: '\'Y\'',
  1095. Z: '\'Z\''
  1096. };
  1097. /***/ },
  1098. /* 22 */
  1099. /***/ function(module, exports, __webpack_require__) {
  1100. "use strict";
  1101. "use strict";
  1102. 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; }; })();
  1103. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1104. 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; }
  1105. 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; }
  1106. var AbstractReplacer_1 = __webpack_require__(14);
  1107. var Utils_1 = __webpack_require__(0);
  1108. var NumberLiteralReplacer = function (_AbstractReplacer_1$A) {
  1109. _inherits(NumberLiteralReplacer, _AbstractReplacer_1$A);
  1110. function NumberLiteralReplacer() {
  1111. _classCallCheck(this, NumberLiteralReplacer);
  1112. return _possibleConstructorReturn(this, (NumberLiteralReplacer.__proto__ || Object.getPrototypeOf(NumberLiteralReplacer)).apply(this, arguments));
  1113. }
  1114. _createClass(NumberLiteralReplacer, [{
  1115. key: 'replace',
  1116. value: function replace(nodeValue) {
  1117. var prefix = '0x';
  1118. if (!Utils_1.Utils.isInteger(nodeValue)) {
  1119. return String(nodeValue);
  1120. }
  1121. return '' + prefix + Utils_1.Utils.decToHex(nodeValue);
  1122. }
  1123. }]);
  1124. return NumberLiteralReplacer;
  1125. }(AbstractReplacer_1.AbstractReplacer);
  1126. exports.NumberLiteralReplacer = NumberLiteralReplacer;
  1127. /***/ },
  1128. /* 23 */
  1129. /***/ function(module, exports, __webpack_require__) {
  1130. "use strict";
  1131. "use strict";
  1132. var SourceMapMode_1 = __webpack_require__(13);
  1133. exports.DEFAULT_PRESET = Object.freeze({
  1134. compact: true,
  1135. debugProtection: false,
  1136. debugProtectionInterval: false,
  1137. disableConsoleOutput: true,
  1138. domainLock: [],
  1139. reservedNames: [],
  1140. rotateUnicodeArray: true,
  1141. selfDefending: true,
  1142. sourceMap: false,
  1143. sourceMapBaseUrl: '',
  1144. sourceMapFileName: '',
  1145. sourceMapMode: SourceMapMode_1.SourceMapMode.Separate,
  1146. unicodeArray: true,
  1147. unicodeArrayEncoding: false,
  1148. unicodeArrayThreshold: 0.8
  1149. });
  1150. /***/ },
  1151. /* 24 */
  1152. /***/ function(module, exports) {
  1153. module.exports = require("esprima");
  1154. /***/ },
  1155. /* 25 */
  1156. /***/ function(module, exports) {
  1157. module.exports = require("path");
  1158. /***/ },
  1159. /* 26 */
  1160. /***/ function(module, exports) {
  1161. module.exports = require("babel-polyfill");
  1162. /***/ },
  1163. /* 27 */
  1164. /***/ function(module, exports, __webpack_require__) {
  1165. "use strict";
  1166. "use strict";
  1167. 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; }; })();
  1168. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1169. var esprima = __webpack_require__(24);
  1170. var escodegen = __webpack_require__(12);
  1171. var ObfuscationResult_1 = __webpack_require__(20);
  1172. var Obfuscator_1 = __webpack_require__(28);
  1173. var Options_1 = __webpack_require__(56);
  1174. var SourceMapCorrector_1 = __webpack_require__(29);
  1175. var JavaScriptObfuscatorInternal = function () {
  1176. function JavaScriptObfuscatorInternal(sourceCode) {
  1177. var obfuscatorOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  1178. _classCallCheck(this, JavaScriptObfuscatorInternal);
  1179. this.sourceCode = sourceCode;
  1180. this.options = new Options_1.Options(obfuscatorOptions);
  1181. }
  1182. _createClass(JavaScriptObfuscatorInternal, [{
  1183. key: 'getObfuscationResult',
  1184. value: function getObfuscationResult() {
  1185. return new SourceMapCorrector_1.SourceMapCorrector(new ObfuscationResult_1.ObfuscationResult(this.generatorOutput.code, this.generatorOutput.map), this.options.sourceMapBaseUrl + this.options.sourceMapFileName, this.options.sourceMapMode).correct();
  1186. }
  1187. }, {
  1188. key: 'obfuscate',
  1189. value: function obfuscate() {
  1190. var astTree = esprima.parse(this.sourceCode, {
  1191. loc: true
  1192. });
  1193. astTree = new Obfuscator_1.Obfuscator(this.options).obfuscateNode(astTree);
  1194. this.generatorOutput = JavaScriptObfuscatorInternal.generateCode(this.sourceCode, astTree, this.options);
  1195. }
  1196. }], [{
  1197. key: 'generateCode',
  1198. value: function generateCode(sourceCode, astTree, options) {
  1199. var escodegenParams = Object.assign({}, JavaScriptObfuscatorInternal.escodegenParams);
  1200. if (options.sourceMap) {
  1201. escodegenParams.sourceMap = 'sourceMap';
  1202. escodegenParams.sourceContent = sourceCode;
  1203. }
  1204. escodegenParams.format = {
  1205. compact: options.compact
  1206. };
  1207. var generatorOutput = escodegen.generate(astTree, escodegenParams);
  1208. generatorOutput.map = generatorOutput.map ? generatorOutput.map.toString() : '';
  1209. return generatorOutput;
  1210. }
  1211. }]);
  1212. return JavaScriptObfuscatorInternal;
  1213. }();
  1214. JavaScriptObfuscatorInternal.escodegenParams = {
  1215. verbatim: 'x-verbatim-property',
  1216. sourceMapWithCode: true
  1217. };
  1218. exports.JavaScriptObfuscatorInternal = JavaScriptObfuscatorInternal;
  1219. /***/ },
  1220. /* 28 */
  1221. /***/ function(module, exports, __webpack_require__) {
  1222. "use strict";
  1223. "use strict";
  1224. 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; }; })();
  1225. 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); } }
  1226. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1227. var estraverse = __webpack_require__(5);
  1228. var AppendState_1 = __webpack_require__(2);
  1229. var NodeType_1 = __webpack_require__(7);
  1230. var CatchClauseObfuscator_1 = __webpack_require__(47);
  1231. var ConsoleOutputNodesGroup_1 = __webpack_require__(42);
  1232. var DebugProtectionNodesGroup_1 = __webpack_require__(43);
  1233. var DomainLockNodesGroup_1 = __webpack_require__(44);
  1234. var FunctionDeclarationObfuscator_1 = __webpack_require__(48);
  1235. var FunctionObfuscator_1 = __webpack_require__(49);
  1236. var LiteralObfuscator_1 = __webpack_require__(50);
  1237. var MemberExpressionObfuscator_1 = __webpack_require__(51);
  1238. var MethodDefinitionObfuscator_1 = __webpack_require__(52);
  1239. var Node_1 = __webpack_require__(3);
  1240. var NodeUtils_1 = __webpack_require__(1);
  1241. var ObjectExpressionObfuscator_1 = __webpack_require__(53);
  1242. var SelfDefendingNodesGroup_1 = __webpack_require__(45);
  1243. var UnicodeArrayNodesGroup_1 = __webpack_require__(46);
  1244. var VariableDeclarationObfuscator_1 = __webpack_require__(54);
  1245. var StackTraceAnalyzer_1 = __webpack_require__(59);
  1246. var Obfuscator = function () {
  1247. function Obfuscator(options) {
  1248. _classCallCheck(this, Obfuscator);
  1249. this.customNodes = new Map();
  1250. this.obfuscatorsCache = new Map();
  1251. this.options = options;
  1252. }
  1253. _createClass(Obfuscator, [{
  1254. key: 'obfuscateNode',
  1255. value: function obfuscateNode(node) {
  1256. if (Node_1.Node.isProgramNode(node) && !node.body.length) {
  1257. return node;
  1258. }
  1259. NodeUtils_1.NodeUtils.parentize(node);
  1260. var stackTraceData = new StackTraceAnalyzer_1.StackTraceAnalyzer(node.body).analyze();
  1261. this.initializeCustomNodes(stackTraceData);
  1262. this.beforeObfuscation(node);
  1263. this.obfuscate(node);
  1264. this.afterObfuscation(node);
  1265. return node;
  1266. }
  1267. }, {
  1268. key: 'afterObfuscation',
  1269. value: function afterObfuscation(astTree) {
  1270. this.customNodes.forEach(function (node) {
  1271. if (node.getAppendState() === AppendState_1.AppendState.AfterObfuscation) {
  1272. node.appendNode(astTree);
  1273. }
  1274. });
  1275. }
  1276. }, {
  1277. key: 'beforeObfuscation',
  1278. value: function beforeObfuscation(astTree) {
  1279. this.customNodes.forEach(function (node) {
  1280. if (node.getAppendState() === AppendState_1.AppendState.BeforeObfuscation) {
  1281. node.appendNode(astTree);
  1282. }
  1283. });
  1284. }
  1285. }, {
  1286. key: 'initializeCustomNodes',
  1287. value: function initializeCustomNodes(stackTraceData) {
  1288. var _this = this;
  1289. var customNodes = [];
  1290. Obfuscator.nodeGroups.forEach(function (nodeGroupConstructor) {
  1291. var nodeGroupNodes = new nodeGroupConstructor(stackTraceData, _this.options).getNodes();
  1292. if (!nodeGroupNodes) {
  1293. return;
  1294. }
  1295. customNodes.push.apply(customNodes, _toConsumableArray(nodeGroupNodes));
  1296. });
  1297. this.customNodes = new Map(customNodes);
  1298. }
  1299. }, {
  1300. key: 'initializeNodeObfuscators',
  1301. value: function initializeNodeObfuscators(node, parentNode) {
  1302. var _this2 = this;
  1303. var nodeObfuscators = Obfuscator.nodeObfuscators.get(node.type);
  1304. if (!nodeObfuscators) {
  1305. return;
  1306. }
  1307. nodeObfuscators.forEach(function (obfuscator) {
  1308. var cachedObfuscator = _this2.obfuscatorsCache.get(obfuscator);
  1309. if (!cachedObfuscator) {
  1310. cachedObfuscator = new obfuscator(_this2.customNodes, _this2.options);
  1311. _this2.obfuscatorsCache.set(obfuscator, cachedObfuscator);
  1312. }
  1313. cachedObfuscator.obfuscateNode(node, parentNode);
  1314. });
  1315. }
  1316. }, {
  1317. key: 'obfuscate',
  1318. value: function obfuscate(node) {
  1319. var _this3 = this;
  1320. estraverse.traverse(node, {
  1321. enter: function enter(node, parentNode) {
  1322. _this3.initializeNodeObfuscators(node, parentNode);
  1323. }
  1324. });
  1325. }
  1326. }]);
  1327. return Obfuscator;
  1328. }();
  1329. Obfuscator.counter = 0;
  1330. Obfuscator.nodeGroups = [DomainLockNodesGroup_1.DomainLockNodesGroup, SelfDefendingNodesGroup_1.SelfDefendingNodesGroup, ConsoleOutputNodesGroup_1.ConsoleOutputNodesGroup, DebugProtectionNodesGroup_1.DebugProtectionNodesGroup, UnicodeArrayNodesGroup_1.UnicodeArrayNodesGroup];
  1331. Obfuscator.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]]]);
  1332. exports.Obfuscator = Obfuscator;
  1333. /***/ },
  1334. /* 29 */
  1335. /***/ function(module, exports, __webpack_require__) {
  1336. "use strict";
  1337. "use strict";
  1338. 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; }; })();
  1339. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1340. var SourceMapMode_1 = __webpack_require__(13);
  1341. var ObfuscationResult_1 = __webpack_require__(20);
  1342. var Utils_1 = __webpack_require__(0);
  1343. var SourceMapCorrector = function () {
  1344. function SourceMapCorrector(obfuscationResult, sourceMapUrl, sourceMapMode) {
  1345. _classCallCheck(this, SourceMapCorrector);
  1346. this.obfuscatedCode = obfuscationResult.getObfuscatedCode();
  1347. this.sourceMap = obfuscationResult.getSourceMap();
  1348. this.sourceMapUrl = sourceMapUrl;
  1349. this.sourceMapMode = sourceMapMode;
  1350. }
  1351. _createClass(SourceMapCorrector, [{
  1352. key: 'correct',
  1353. value: function correct() {
  1354. return new ObfuscationResult_1.ObfuscationResult(this.correctObfuscatedCode(), this.sourceMap);
  1355. }
  1356. }, {
  1357. key: 'correctObfuscatedCode',
  1358. value: function correctObfuscatedCode() {
  1359. if (!this.sourceMap) {
  1360. return this.obfuscatedCode;
  1361. }
  1362. var sourceMappingUrl = '//# sourceMappingURL=';
  1363. switch (this.sourceMapMode) {
  1364. case SourceMapMode_1.SourceMapMode.Inline:
  1365. sourceMappingUrl += 'data:application/json;base64,' + Utils_1.Utils.btoa(this.sourceMap);
  1366. break;
  1367. case SourceMapMode_1.SourceMapMode.Separate:
  1368. default:
  1369. if (!this.sourceMapUrl) {
  1370. return this.obfuscatedCode;
  1371. }
  1372. sourceMappingUrl += this.sourceMapUrl;
  1373. break;
  1374. }
  1375. return this.obfuscatedCode + '\n' + sourceMappingUrl;
  1376. }
  1377. }]);
  1378. return SourceMapCorrector;
  1379. }();
  1380. exports.SourceMapCorrector = SourceMapCorrector;
  1381. /***/ },
  1382. /* 30 */
  1383. /***/ function(module, exports, __webpack_require__) {
  1384. "use strict";
  1385. "use strict";
  1386. 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; }; })();
  1387. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1388. var Utils_1 = __webpack_require__(0);
  1389. var UnicodeArray = function () {
  1390. function UnicodeArray() {
  1391. _classCallCheck(this, UnicodeArray);
  1392. this.array = [];
  1393. }
  1394. _createClass(UnicodeArray, [{
  1395. key: "addToArray",
  1396. value: function addToArray(value) {
  1397. this.array.push(value);
  1398. }
  1399. }, {
  1400. key: "getArray",
  1401. value: function getArray() {
  1402. return this.array;
  1403. }
  1404. }, {
  1405. key: "getIndexOf",
  1406. value: function getIndexOf(value) {
  1407. return this.array.indexOf(value);
  1408. }
  1409. }, {
  1410. key: "getLength",
  1411. value: function getLength() {
  1412. return this.array.length;
  1413. }
  1414. }, {
  1415. key: "rotateArray",
  1416. value: function rotateArray(rotationValue) {
  1417. this.array = Utils_1.Utils.arrayRotate(this.array, rotationValue);
  1418. }
  1419. }, {
  1420. key: "toString",
  1421. value: function toString() {
  1422. return this.array.toString();
  1423. }
  1424. }]);
  1425. return UnicodeArray;
  1426. }();
  1427. exports.UnicodeArray = UnicodeArray;
  1428. /***/ },
  1429. /* 31 */
  1430. /***/ function(module, exports, __webpack_require__) {
  1431. "use strict";
  1432. "use strict";
  1433. 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; }; })();
  1434. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1435. var fs = __webpack_require__(84);
  1436. var mkdirp = __webpack_require__(85);
  1437. var path = __webpack_require__(25);
  1438. var Utils_1 = __webpack_require__(0);
  1439. var CLIUtils = function () {
  1440. function CLIUtils() {
  1441. _classCallCheck(this, CLIUtils);
  1442. }
  1443. _createClass(CLIUtils, null, [{
  1444. key: 'getOutputCodePath',
  1445. value: function getOutputCodePath(outputPath, inputPath) {
  1446. if (outputPath) {
  1447. return outputPath;
  1448. }
  1449. return inputPath.split('.').map(function (value, index) {
  1450. return index === 0 ? value + '-obfuscated' : value;
  1451. }).join('.');
  1452. }
  1453. }, {
  1454. key: 'getOutputSourceMapPath',
  1455. value: function getOutputSourceMapPath(outputCodePath) {
  1456. var sourceMapFileName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
  1457. if (sourceMapFileName) {
  1458. outputCodePath = outputCodePath.substr(0, outputCodePath.lastIndexOf('/')) + '/' + sourceMapFileName;
  1459. }
  1460. if (!/\.js\.map$/.test(outputCodePath)) {
  1461. outputCodePath = outputCodePath.split('.')[0] + '.js.map';
  1462. } else if (/\.js$/.test(outputCodePath)) {
  1463. outputCodePath += '.map';
  1464. }
  1465. return outputCodePath;
  1466. }
  1467. }, {
  1468. key: 'getPackageConfig',
  1469. value: function getPackageConfig() {
  1470. return JSON.parse(fs.readFileSync(path.join(path.dirname(fs.realpathSync(process.argv[1])), '../package.json'), CLIUtils.encoding));
  1471. }
  1472. }, {
  1473. key: 'isFilePath',
  1474. value: function isFilePath(filePath) {
  1475. try {
  1476. return fs.statSync(filePath).isFile();
  1477. } catch (e) {
  1478. return false;
  1479. }
  1480. }
  1481. }, {
  1482. key: 'readFile',
  1483. value: function readFile(inputPath) {
  1484. return fs.readFileSync(inputPath, CLIUtils.encoding);
  1485. }
  1486. }, {
  1487. key: 'validateInputPath',
  1488. value: function validateInputPath(inputPath) {
  1489. if (!CLIUtils.isFilePath(inputPath)) {
  1490. throw new ReferenceError('Given input path must be a valid file path');
  1491. }
  1492. if (!Utils_1.Utils.arrayContains(CLIUtils.availableInputExtensions, path.extname(inputPath))) {
  1493. throw new ReferenceError('Input file must have .js extension');
  1494. }
  1495. }
  1496. }, {
  1497. key: 'writeFile',
  1498. value: function writeFile(outputPath, data) {
  1499. mkdirp.sync(path.dirname(outputPath));
  1500. fs.writeFileSync(outputPath, data, {
  1501. encoding: CLIUtils.encoding
  1502. });
  1503. }
  1504. }]);
  1505. return CLIUtils;
  1506. }();
  1507. CLIUtils.availableInputExtensions = ['.js'];
  1508. CLIUtils.encoding = 'utf8';
  1509. exports.CLIUtils = CLIUtils;
  1510. /***/ },
  1511. /* 32 */
  1512. /***/ function(module, exports, __webpack_require__) {
  1513. "use strict";
  1514. "use strict";
  1515. 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; }; })();
  1516. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1517. var commander = __webpack_require__(83);
  1518. var path = __webpack_require__(25);
  1519. var SourceMapMode_1 = __webpack_require__(13);
  1520. var UnicodeArrayEncoding_1 = __webpack_require__(18);
  1521. var DefaultPreset_1 = __webpack_require__(23);
  1522. var CLIUtils_1 = __webpack_require__(31);
  1523. var JavaScriptObfuscator_1 = __webpack_require__(10);
  1524. var Utils_1 = __webpack_require__(0);
  1525. var JavaScriptObfuscatorCLI = function () {
  1526. function JavaScriptObfuscatorCLI(argv) {
  1527. _classCallCheck(this, JavaScriptObfuscatorCLI);
  1528. this.data = '';
  1529. this.rawArguments = argv;
  1530. this.arguments = this.rawArguments.slice(2);
  1531. }
  1532. _createClass(JavaScriptObfuscatorCLI, [{
  1533. key: 'run',
  1534. value: function run() {
  1535. this.configureCommands();
  1536. if (!this.arguments.length || Utils_1.Utils.arrayContains(this.arguments, '--help')) {
  1537. this.commands.outputHelp();
  1538. return;
  1539. }
  1540. this.inputPath = this.arguments[0];
  1541. CLIUtils_1.CLIUtils.validateInputPath(this.inputPath);
  1542. this.getData();
  1543. this.processData();
  1544. }
  1545. }, {
  1546. key: 'buildOptions',
  1547. value: function buildOptions() {
  1548. var obfuscatorOptions = {},
  1549. availableOptions = Object.keys(DefaultPreset_1.DEFAULT_PRESET);
  1550. for (var option in this.commands) {
  1551. if (!this.commands.hasOwnProperty(option)) {
  1552. continue;
  1553. }
  1554. if (!Utils_1.Utils.arrayContains(availableOptions, option)) {
  1555. continue;
  1556. }
  1557. obfuscatorOptions[option] = this.commands[option];
  1558. }
  1559. return Object.assign({}, DefaultPreset_1.DEFAULT_PRESET, obfuscatorOptions);
  1560. }
  1561. }, {
  1562. key: 'configureCommands',
  1563. value: function configureCommands() {
  1564. 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('--domainLock <list>', 'Blocks the execution of the code in domains that do not match the passed RegExp patterns (comma separated)', function (val) {
  1565. return val.split(',');
  1566. }).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) {
  1567. return val.split(',');
  1568. }).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('--sourceMapBaseUrl <string>', 'Sets base url to the source map import url when `--sourceMapMode=separate`').option('--sourceMapFileName <string>', 'Sets file name for output source map when `--sourceMapMode=separate`').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('--unicodeArrayEncoding <boolean|string> [true, false, base64, rc4]', 'All literals in Unicode array become encoded in using base64 or rc4 (this option can slightly slow down your code speed', JavaScriptObfuscatorCLI.parseUnicodeArrayEncoding).option('--unicodeArrayThreshold <number>', 'The probability that the literal string will be inserted into unicodeArray (Default: 0.8, Min: 0, Max: 1)', parseFloat).parse(this.rawArguments);
  1569. this.commands.on('--help', function () {
  1570. console.log(' Examples:\n');
  1571. console.log(' %> javascript-obfuscator in.js --compact true --selfDefending false');
  1572. console.log(' %> javascript-obfuscator in.js --output out.js --compact true --selfDefending false');
  1573. console.log('');
  1574. });
  1575. }
  1576. }, {
  1577. key: 'getData',
  1578. value: function getData() {
  1579. this.data = CLIUtils_1.CLIUtils.readFile(this.inputPath);
  1580. }
  1581. }, {
  1582. key: 'processData',
  1583. value: function processData() {
  1584. var options = this.buildOptions(),
  1585. outputCodePath = CLIUtils_1.CLIUtils.getOutputCodePath(this.commands.output, this.inputPath);
  1586. if (options.sourceMap) {
  1587. this.processDataWithSourceMap(outputCodePath, options);
  1588. } else {
  1589. this.processDataWithoutSourceMap(outputCodePath, options);
  1590. }
  1591. }
  1592. }, {
  1593. key: 'processDataWithoutSourceMap',
  1594. value: function processDataWithoutSourceMap(outputCodePath, options) {
  1595. var obfuscatedCode = JavaScriptObfuscator_1.JavaScriptObfuscator.obfuscate(this.data, options).getObfuscatedCode();
  1596. CLIUtils_1.CLIUtils.writeFile(outputCodePath, obfuscatedCode);
  1597. }
  1598. }, {
  1599. key: 'processDataWithSourceMap',
  1600. value: function processDataWithSourceMap(outputCodePath, options) {
  1601. var outputSourceMapPath = CLIUtils_1.CLIUtils.getOutputSourceMapPath(outputCodePath, options.sourceMapFileName || '');
  1602. options.sourceMapFileName = path.basename(outputSourceMapPath);
  1603. var obfuscationResult = JavaScriptObfuscator_1.JavaScriptObfuscator.obfuscate(this.data, options);
  1604. CLIUtils_1.CLIUtils.writeFile(outputCodePath, obfuscationResult.getObfuscatedCode());
  1605. if (options.sourceMapMode === 'separate' && obfuscationResult.getSourceMap()) {
  1606. CLIUtils_1.CLIUtils.writeFile(outputSourceMapPath, obfuscationResult.getSourceMap());
  1607. }
  1608. }
  1609. }], [{
  1610. key: 'getBuildVersion',
  1611. value: function getBuildVersion() {
  1612. return CLIUtils_1.CLIUtils.getPackageConfig().version;
  1613. }
  1614. }, {
  1615. key: 'parseBoolean',
  1616. value: function parseBoolean(value) {
  1617. return value === 'true' || value === '1';
  1618. }
  1619. }, {
  1620. key: 'parseSourceMapMode',
  1621. value: function parseSourceMapMode(value) {
  1622. var availableMode = Object.keys(SourceMapMode_1.SourceMapMode).some(function (key) {
  1623. return SourceMapMode_1.SourceMapMode[key] === value;
  1624. });
  1625. if (!availableMode) {
  1626. throw new ReferenceError('Invalid value of `--sourceMapMode` option');
  1627. }
  1628. return value;
  1629. }
  1630. }, {
  1631. key: 'parseUnicodeArrayEncoding',
  1632. value: function parseUnicodeArrayEncoding(value) {
  1633. switch (value) {
  1634. case 'true':
  1635. case '1':
  1636. case UnicodeArrayEncoding_1.UnicodeArrayEncoding.base64:
  1637. return true;
  1638. case UnicodeArrayEncoding_1.UnicodeArrayEncoding.rc4:
  1639. return UnicodeArrayEncoding_1.UnicodeArrayEncoding.rc4;
  1640. default:
  1641. return false;
  1642. }
  1643. }
  1644. }]);
  1645. return JavaScriptObfuscatorCLI;
  1646. }();
  1647. exports.JavaScriptObfuscatorCLI = JavaScriptObfuscatorCLI;
  1648. /***/ },
  1649. /* 33 */
  1650. /***/ function(module, exports, __webpack_require__) {
  1651. "use strict";
  1652. "use strict";
  1653. var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
  1654. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1655. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  1656. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  1657. __webpack_require__(8);
  1658. var AppendState_1 = __webpack_require__(2);
  1659. var ConsoleOutputDisableExpressionTemplate_1 = __webpack_require__(66);
  1660. var AbstractCustomNode_1 = __webpack_require__(6);
  1661. var NodeAppender_1 = __webpack_require__(4);
  1662. var NodeUtils_1 = __webpack_require__(1);
  1663. var Utils_1 = __webpack_require__(0);
  1664. var ConsoleOutputDisableExpressionNode = function (_AbstractCustomNode_) {
  1665. _inherits(ConsoleOutputDisableExpressionNode, _AbstractCustomNode_);
  1666. function ConsoleOutputDisableExpressionNode(stackTraceData, callsControllerFunctionName, randomStackTraceIndex, options) {
  1667. _classCallCheck(this, ConsoleOutputDisableExpressionNode);
  1668. var _this = _possibleConstructorReturn(this, (ConsoleOutputDisableExpressionNode.__proto__ || Object.getPrototypeOf(ConsoleOutputDisableExpressionNode)).call(this, options));
  1669. _this.appendState = AppendState_1.AppendState.BeforeObfuscation;
  1670. _this.stackTraceData = stackTraceData;
  1671. _this.callsControllerFunctionName = callsControllerFunctionName;
  1672. _this.randomStackTraceIndex = randomStackTraceIndex;
  1673. return _this;
  1674. }
  1675. _createClass(ConsoleOutputDisableExpressionNode, [{
  1676. key: 'appendNode',
  1677. value: function appendNode(blockScopeNode) {
  1678. NodeAppender_1.NodeAppender.appendNodeToOptimalBlockScope(this.stackTraceData, blockScopeNode, this.getNode(), this.randomStackTraceIndex);
  1679. }
  1680. }, {
  1681. key: 'getNodeStructure',
  1682. value: function getNodeStructure() {
  1683. return NodeUtils_1.NodeUtils.convertCodeToStructure(ConsoleOutputDisableExpressionTemplate_1.ConsoleOutputDisableExpressionTemplate().formatUnicorn({
  1684. consoleLogDisableFunctionName: Utils_1.Utils.getRandomVariableName(),
  1685. singleNodeCallControllerFunctionName: this.callsControllerFunctionName
  1686. }));
  1687. }
  1688. }]);
  1689. return ConsoleOutputDisableExpressionNode;
  1690. }(AbstractCustomNode_1.AbstractCustomNode);
  1691. exports.ConsoleOutputDisableExpressionNode = ConsoleOutputDisableExpressionNode;
  1692. /***/ },
  1693. /* 34 */
  1694. /***/ function(module, exports, __webpack_require__) {
  1695. "use strict";
  1696. "use strict";
  1697. 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; }; })();
  1698. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1699. 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; }
  1700. 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; }
  1701. __webpack_require__(8);
  1702. var AppendState_1 = __webpack_require__(2);
  1703. var DebufProtectionFunctionCallTemplate_1 = __webpack_require__(67);
  1704. var AbstractCustomNode_1 = __webpack_require__(6);
  1705. var NodeAppender_1 = __webpack_require__(4);
  1706. var NodeUtils_1 = __webpack_require__(1);
  1707. var DebugProtectionFunctionCallNode = function (_AbstractCustomNode_) {
  1708. _inherits(DebugProtectionFunctionCallNode, _AbstractCustomNode_);
  1709. function DebugProtectionFunctionCallNode(debugProtectionFunctionName, options) {
  1710. _classCallCheck(this, DebugProtectionFunctionCallNode);
  1711. var _this = _possibleConstructorReturn(this, (DebugProtectionFunctionCallNode.__proto__ || Object.getPrototypeOf(DebugProtectionFunctionCallNode)).call(this, options));
  1712. _this.appendState = AppendState_1.AppendState.BeforeObfuscation;
  1713. _this.debugProtectionFunctionName = debugProtectionFunctionName;
  1714. return _this;
  1715. }
  1716. _createClass(DebugProtectionFunctionCallNode, [{
  1717. key: 'appendNode',
  1718. value: function appendNode(blockScopeNode) {
  1719. NodeAppender_1.NodeAppender.appendNode(blockScopeNode, this.getNode());
  1720. }
  1721. }, {
  1722. key: 'getNodeStructure',
  1723. value: function getNodeStructure() {
  1724. return NodeUtils_1.NodeUtils.convertCodeToStructure(DebufProtectionFunctionCallTemplate_1.DebugProtectionFunctionCallTemplate().formatUnicorn({
  1725. debugProtectionFunctionName: this.debugProtectionFunctionName
  1726. }));
  1727. }
  1728. }]);
  1729. return DebugProtectionFunctionCallNode;
  1730. }(AbstractCustomNode_1.AbstractCustomNode);
  1731. exports.DebugProtectionFunctionCallNode = DebugProtectionFunctionCallNode;
  1732. /***/ },
  1733. /* 35 */
  1734. /***/ function(module, exports, __webpack_require__) {
  1735. "use strict";
  1736. "use strict";
  1737. 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; }; })();
  1738. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1739. 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; }
  1740. 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; }
  1741. __webpack_require__(8);
  1742. var AppendState_1 = __webpack_require__(2);
  1743. var DebugProtectionFunctionIntervalTemplate_1 = __webpack_require__(68);
  1744. var AbstractCustomNode_1 = __webpack_require__(6);
  1745. var NodeAppender_1 = __webpack_require__(4);
  1746. var NodeUtils_1 = __webpack_require__(1);
  1747. var DebugProtectionFunctionIntervalNode = function (_AbstractCustomNode_) {
  1748. _inherits(DebugProtectionFunctionIntervalNode, _AbstractCustomNode_);
  1749. function DebugProtectionFunctionIntervalNode(debugProtectionFunctionName, options) {
  1750. _classCallCheck(this, DebugProtectionFunctionIntervalNode);
  1751. var _this = _possibleConstructorReturn(this, (DebugProtectionFunctionIntervalNode.__proto__ || Object.getPrototypeOf(DebugProtectionFunctionIntervalNode)).call(this, options));
  1752. _this.appendState = AppendState_1.AppendState.BeforeObfuscation;
  1753. _this.debugProtectionFunctionName = debugProtectionFunctionName;
  1754. return _this;
  1755. }
  1756. _createClass(DebugProtectionFunctionIntervalNode, [{
  1757. key: 'appendNode',
  1758. value: function appendNode(blockScopeNode) {
  1759. NodeAppender_1.NodeAppender.appendNode(blockScopeNode, this.getNode());
  1760. }
  1761. }, {
  1762. key: 'getNodeStructure',
  1763. value: function getNodeStructure() {
  1764. return NodeUtils_1.NodeUtils.convertCodeToStructure(DebugProtectionFunctionIntervalTemplate_1.DebugProtectionFunctionIntervalTemplate().formatUnicorn({
  1765. debugProtectionFunctionName: this.debugProtectionFunctionName
  1766. }));
  1767. }
  1768. }]);
  1769. return DebugProtectionFunctionIntervalNode;
  1770. }(AbstractCustomNode_1.AbstractCustomNode);
  1771. exports.DebugProtectionFunctionIntervalNode = DebugProtectionFunctionIntervalNode;
  1772. /***/ },
  1773. /* 36 */
  1774. /***/ function(module, exports, __webpack_require__) {
  1775. "use strict";
  1776. "use strict";
  1777. 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; }; })();
  1778. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1779. 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; }
  1780. 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; }
  1781. __webpack_require__(8);
  1782. var AppendState_1 = __webpack_require__(2);
  1783. var DebugProtectionFunctionTemplate_1 = __webpack_require__(69);
  1784. var AbstractCustomNode_1 = __webpack_require__(6);
  1785. var NodeAppender_1 = __webpack_require__(4);
  1786. var NodeUtils_1 = __webpack_require__(1);
  1787. var Utils_1 = __webpack_require__(0);
  1788. var DebugProtectionFunctionNode = function (_AbstractCustomNode_) {
  1789. _inherits(DebugProtectionFunctionNode, _AbstractCustomNode_);
  1790. function DebugProtectionFunctionNode(debugProtectionFunctionName, options) {
  1791. _classCallCheck(this, DebugProtectionFunctionNode);
  1792. var _this = _possibleConstructorReturn(this, (DebugProtectionFunctionNode.__proto__ || Object.getPrototypeOf(DebugProtectionFunctionNode)).call(this, options));
  1793. _this.appendState = AppendState_1.AppendState.BeforeObfuscation;
  1794. _this.debugProtectionFunctionName = debugProtectionFunctionName;
  1795. return _this;
  1796. }
  1797. _createClass(DebugProtectionFunctionNode, [{
  1798. key: 'appendNode',
  1799. value: function appendNode(blockScopeNode) {
  1800. var programBodyLength = blockScopeNode.body.length,
  1801. randomIndex = Utils_1.Utils.getRandomGenerator().integer({
  1802. min: 0,
  1803. max: programBodyLength
  1804. });
  1805. NodeAppender_1.NodeAppender.insertNodeAtIndex(blockScopeNode, this.getNode(), randomIndex);
  1806. }
  1807. }, {
  1808. key: 'getNodeIdentifier',
  1809. value: function getNodeIdentifier() {
  1810. return this.debugProtectionFunctionName;
  1811. }
  1812. }, {
  1813. key: 'getNodeStructure',
  1814. value: function getNodeStructure() {
  1815. return NodeUtils_1.NodeUtils.convertCodeToStructure(DebugProtectionFunctionTemplate_1.DebugProtectionFunctionTemplate().formatUnicorn({
  1816. debugProtectionFunctionName: this.debugProtectionFunctionName
  1817. }));
  1818. }
  1819. }]);
  1820. return DebugProtectionFunctionNode;
  1821. }(AbstractCustomNode_1.AbstractCustomNode);
  1822. exports.DebugProtectionFunctionNode = DebugProtectionFunctionNode;
  1823. /***/ },
  1824. /* 37 */
  1825. /***/ function(module, exports, __webpack_require__) {
  1826. "use strict";
  1827. "use strict";
  1828. var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; })();
  1829. 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; }; })();
  1830. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1831. 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; }
  1832. 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; }
  1833. __webpack_require__(8);
  1834. var AppendState_1 = __webpack_require__(2);
  1835. var DomainLockNodeTemplate_1 = __webpack_require__(70);
  1836. var AbstractCustomNode_1 = __webpack_require__(6);
  1837. var NodeAppender_1 = __webpack_require__(4);
  1838. var NodeUtils_1 = __webpack_require__(1);
  1839. var Utils_1 = __webpack_require__(0);
  1840. var DomainLockNode = function (_AbstractCustomNode_) {
  1841. _inherits(DomainLockNode, _AbstractCustomNode_);
  1842. function DomainLockNode(stackTraceData, callsControllerFunctionName, randomStackTraceIndex, options) {
  1843. _classCallCheck(this, DomainLockNode);
  1844. var _this = _possibleConstructorReturn(this, (DomainLockNode.__proto__ || Object.getPrototypeOf(DomainLockNode)).call(this, options));
  1845. _this.appendState = AppendState_1.AppendState.BeforeObfuscation;
  1846. _this.stackTraceData = stackTraceData;
  1847. _this.callsControllerFunctionName = callsControllerFunctionName;
  1848. _this.randomStackTraceIndex = randomStackTraceIndex;
  1849. return _this;
  1850. }
  1851. _createClass(DomainLockNode, [{
  1852. key: 'appendNode',
  1853. value: function appendNode(blockScopeNode) {
  1854. NodeAppender_1.NodeAppender.appendNodeToOptimalBlockScope(this.stackTraceData, blockScopeNode, this.getNode(), this.randomStackTraceIndex);
  1855. }
  1856. }, {
  1857. key: 'getNodeStructure',
  1858. value: function getNodeStructure() {
  1859. var domainsString = this.options.domainLock.join(';'),
  1860. _Utils_1$Utils$hideSt = Utils_1.Utils.hideString(domainsString, domainsString.length * 3),
  1861. _Utils_1$Utils$hideSt2 = _slicedToArray(_Utils_1$Utils$hideSt, 2),
  1862. hiddenDomainsString = _Utils_1$Utils$hideSt2[0],
  1863. diff = _Utils_1$Utils$hideSt2[1];
  1864. return NodeUtils_1.NodeUtils.convertCodeToStructure(DomainLockNodeTemplate_1.DomainLockNodeTemplate().formatUnicorn({
  1865. domainLockFunctionName: Utils_1.Utils.getRandomVariableName(),
  1866. diff: diff,
  1867. domains: hiddenDomainsString,
  1868. singleNodeCallControllerFunctionName: this.callsControllerFunctionName
  1869. }));
  1870. }
  1871. }]);
  1872. return DomainLockNode;
  1873. }(AbstractCustomNode_1.AbstractCustomNode);
  1874. exports.DomainLockNode = DomainLockNode;
  1875. /***/ },
  1876. /* 38 */
  1877. /***/ function(module, exports, __webpack_require__) {
  1878. "use strict";
  1879. "use strict";
  1880. 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; }; })();
  1881. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1882. 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; }
  1883. 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; }
  1884. var AppendState_1 = __webpack_require__(2);
  1885. var NoCustomNodesPreset_1 = __webpack_require__(16);
  1886. var SelfDefendingTemplate_1 = __webpack_require__(71);
  1887. var AbstractCustomNode_1 = __webpack_require__(6);
  1888. var NodeAppender_1 = __webpack_require__(4);
  1889. var JavaScriptObfuscator_1 = __webpack_require__(10);
  1890. var NodeUtils_1 = __webpack_require__(1);
  1891. var Utils_1 = __webpack_require__(0);
  1892. var SelfDefendingUnicodeNode = function (_AbstractCustomNode_) {
  1893. _inherits(SelfDefendingUnicodeNode, _AbstractCustomNode_);
  1894. function SelfDefendingUnicodeNode(stackTraceData, callsControllerFunctionName, randomStackTraceIndex, options) {
  1895. _classCallCheck(this, SelfDefendingUnicodeNode);
  1896. var _this = _possibleConstructorReturn(this, (SelfDefendingUnicodeNode.__proto__ || Object.getPrototypeOf(SelfDefendingUnicodeNode)).call(this, options));
  1897. _this.appendState = AppendState_1.AppendState.AfterObfuscation;
  1898. _this.stackTraceData = stackTraceData;
  1899. _this.callsControllerFunctionName = callsControllerFunctionName;
  1900. _this.randomStackTraceIndex = randomStackTraceIndex;
  1901. return _this;
  1902. }
  1903. _createClass(SelfDefendingUnicodeNode, [{
  1904. key: 'appendNode',
  1905. value: function appendNode(blockScopeNode) {
  1906. NodeAppender_1.NodeAppender.appendNodeToOptimalBlockScope(this.stackTraceData, blockScopeNode, this.getNode(), this.randomStackTraceIndex);
  1907. }
  1908. }, {
  1909. key: 'getNodeStructure',
  1910. value: function getNodeStructure() {
  1911. return NodeUtils_1.NodeUtils.convertCodeToStructure(JavaScriptObfuscator_1.JavaScriptObfuscator.obfuscate(SelfDefendingTemplate_1.SelfDefendingTemplate().formatUnicorn({
  1912. selfDefendingFunctionName: Utils_1.Utils.getRandomVariableName(),
  1913. singleNodeCallControllerFunctionName: this.callsControllerFunctionName
  1914. }), NoCustomNodesPreset_1.NO_CUSTOM_NODES_PRESET).getObfuscatedCode());
  1915. }
  1916. }]);
  1917. return SelfDefendingUnicodeNode;
  1918. }(AbstractCustomNode_1.AbstractCustomNode);
  1919. exports.SelfDefendingUnicodeNode = SelfDefendingUnicodeNode;
  1920. /***/ },
  1921. /* 39 */
  1922. /***/ function(module, exports, __webpack_require__) {
  1923. "use strict";
  1924. "use strict";
  1925. 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; }; })();
  1926. 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); } });
  1927. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1928. 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; }
  1929. 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; }
  1930. __webpack_require__(8);
  1931. var AppendState_1 = __webpack_require__(2);
  1932. var UnicodeArrayEncoding_1 = __webpack_require__(18);
  1933. var NoCustomNodesPreset_1 = __webpack_require__(16);
  1934. var AtobTemplate_1 = __webpack_require__(63);
  1935. var Rc4Template_1 = __webpack_require__(64);
  1936. var SelfDefendingTemplate_1 = __webpack_require__(72);
  1937. var UnicodeArrayBase64DecodeNodeTemplate_1 = __webpack_require__(73);
  1938. var UnicodeArrayCallsWrapperTemplate_1 = __webpack_require__(74);
  1939. var UnicodeArrayRC4DecodeNodeTemplate_1 = __webpack_require__(75);
  1940. var AbstractCustomNode_1 = __webpack_require__(6);
  1941. var JavaScriptObfuscator_1 = __webpack_require__(10);
  1942. var NodeAppender_1 = __webpack_require__(4);
  1943. var NodeUtils_1 = __webpack_require__(1);
  1944. var UnicodeArrayCallsWrapper = function (_AbstractCustomNode_) {
  1945. _inherits(UnicodeArrayCallsWrapper, _AbstractCustomNode_);
  1946. function UnicodeArrayCallsWrapper(unicodeArrayCallsWrapperName, unicodeArrayName, unicodeArray, options) {
  1947. _classCallCheck(this, UnicodeArrayCallsWrapper);
  1948. var _this = _possibleConstructorReturn(this, (UnicodeArrayCallsWrapper.__proto__ || Object.getPrototypeOf(UnicodeArrayCallsWrapper)).call(this, options));
  1949. _this.appendState = AppendState_1.AppendState.AfterObfuscation;
  1950. _this.unicodeArrayCallsWrapperName = unicodeArrayCallsWrapperName;
  1951. _this.unicodeArrayName = unicodeArrayName;
  1952. _this.unicodeArray = unicodeArray;
  1953. return _this;
  1954. }
  1955. _createClass(UnicodeArrayCallsWrapper, [{
  1956. key: 'appendNode',
  1957. value: function appendNode(blockScopeNode) {
  1958. if (!this.unicodeArray.getLength()) {
  1959. return;
  1960. }
  1961. NodeAppender_1.NodeAppender.insertNodeAtIndex(blockScopeNode, this.getNode(), 1);
  1962. }
  1963. }, {
  1964. key: 'getNodeIdentifier',
  1965. value: function getNodeIdentifier() {
  1966. return this.unicodeArrayCallsWrapperName;
  1967. }
  1968. }, {
  1969. key: 'getNode',
  1970. value: function getNode() {
  1971. return _get(UnicodeArrayCallsWrapper.prototype.__proto__ || Object.getPrototypeOf(UnicodeArrayCallsWrapper.prototype), 'getNode', this).call(this);
  1972. }
  1973. }, {
  1974. key: 'getDecodeUnicodeArrayTemplate',
  1975. value: function getDecodeUnicodeArrayTemplate() {
  1976. var decodeUnicodeArrayTemplate = '',
  1977. selfDefendingCode = '';
  1978. if (this.options.selfDefending) {
  1979. selfDefendingCode = SelfDefendingTemplate_1.SelfDefendingTemplate().formatUnicorn({
  1980. unicodeArrayCallsWrapperName: this.unicodeArrayCallsWrapperName,
  1981. unicodeArrayName: this.unicodeArrayName
  1982. });
  1983. }
  1984. switch (this.options.unicodeArrayEncoding) {
  1985. case UnicodeArrayEncoding_1.UnicodeArrayEncoding.base64:
  1986. decodeUnicodeArrayTemplate = UnicodeArrayBase64DecodeNodeTemplate_1.UnicodeArrayBase64DecodeNodeTemplate().formatUnicorn({
  1987. atobPolyfill: AtobTemplate_1.AtobTemplate(),
  1988. selfDefendingCode: selfDefendingCode,
  1989. unicodeArrayCallsWrapperName: this.unicodeArrayCallsWrapperName
  1990. });
  1991. break;
  1992. case UnicodeArrayEncoding_1.UnicodeArrayEncoding.rc4:
  1993. decodeUnicodeArrayTemplate = UnicodeArrayRC4DecodeNodeTemplate_1.UnicodeArrayRc4DecodeNodeTemplate().formatUnicorn({
  1994. atobPolyfill: AtobTemplate_1.AtobTemplate(),
  1995. rc4Polyfill: Rc4Template_1.Rc4Template(),
  1996. selfDefendingCode: selfDefendingCode,
  1997. unicodeArrayCallsWrapperName: this.unicodeArrayCallsWrapperName
  1998. });
  1999. break;
  2000. }
  2001. return decodeUnicodeArrayTemplate;
  2002. }
  2003. }, {
  2004. key: 'getNodeStructure',
  2005. value: function getNodeStructure() {
  2006. var decodeNodeTemplate = this.getDecodeUnicodeArrayTemplate();
  2007. return NodeUtils_1.NodeUtils.convertCodeToStructure(JavaScriptObfuscator_1.JavaScriptObfuscator.obfuscate(UnicodeArrayCallsWrapperTemplate_1.UnicodeArrayCallsWrapperTemplate().formatUnicorn({
  2008. decodeNodeTemplate: decodeNodeTemplate,
  2009. unicodeArrayCallsWrapperName: this.unicodeArrayCallsWrapperName,
  2010. unicodeArrayName: this.unicodeArrayName
  2011. }), NoCustomNodesPreset_1.NO_CUSTOM_NODES_PRESET).getObfuscatedCode());
  2012. }
  2013. }]);
  2014. return UnicodeArrayCallsWrapper;
  2015. }(AbstractCustomNode_1.AbstractCustomNode);
  2016. exports.UnicodeArrayCallsWrapper = UnicodeArrayCallsWrapper;
  2017. /***/ },
  2018. /* 40 */
  2019. /***/ function(module, exports, __webpack_require__) {
  2020. "use strict";
  2021. "use strict";
  2022. 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; }; })();
  2023. 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); } });
  2024. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2025. 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; }
  2026. 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; }
  2027. __webpack_require__(8);
  2028. var AppendState_1 = __webpack_require__(2);
  2029. var UnicodeArrayTemplate_1 = __webpack_require__(76);
  2030. var AbstractCustomNode_1 = __webpack_require__(6);
  2031. var NodeAppender_1 = __webpack_require__(4);
  2032. var NodeUtils_1 = __webpack_require__(1);
  2033. var UnicodeArrayNode = function (_AbstractCustomNode_) {
  2034. _inherits(UnicodeArrayNode, _AbstractCustomNode_);
  2035. function UnicodeArrayNode(unicodeArray, unicodeArrayName) {
  2036. var unicodeArrayRotateValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
  2037. var options = arguments[3];
  2038. _classCallCheck(this, UnicodeArrayNode);
  2039. var _this = _possibleConstructorReturn(this, (UnicodeArrayNode.__proto__ || Object.getPrototypeOf(UnicodeArrayNode)).call(this, options));
  2040. _this.appendState = AppendState_1.AppendState.AfterObfuscation;
  2041. _this.unicodeArray = unicodeArray;
  2042. _this.unicodeArrayName = unicodeArrayName;
  2043. _this.unicodeArrayRotateValue = unicodeArrayRotateValue;
  2044. return _this;
  2045. }
  2046. _createClass(UnicodeArrayNode, [{
  2047. key: 'appendNode',
  2048. value: function appendNode(blockScopeNode) {
  2049. if (!this.unicodeArray.getLength()) {
  2050. return;
  2051. }
  2052. NodeAppender_1.NodeAppender.prependNode(blockScopeNode, this.getNode());
  2053. }
  2054. }, {
  2055. key: 'getNodeIdentifier',
  2056. value: function getNodeIdentifier() {
  2057. return this.unicodeArrayName;
  2058. }
  2059. }, {
  2060. key: 'getNodeData',
  2061. value: function getNodeData() {
  2062. return this.unicodeArray;
  2063. }
  2064. }, {
  2065. key: 'getNode',
  2066. value: function getNode() {
  2067. this.unicodeArray.rotateArray(this.unicodeArrayRotateValue);
  2068. return _get(UnicodeArrayNode.prototype.__proto__ || Object.getPrototypeOf(UnicodeArrayNode.prototype), 'getNode', this).call(this);
  2069. }
  2070. }, {
  2071. key: 'updateNodeData',
  2072. value: function updateNodeData(data) {
  2073. this.unicodeArray.addToArray(data);
  2074. }
  2075. }, {
  2076. key: 'getNodeStructure',
  2077. value: function getNodeStructure() {
  2078. return NodeUtils_1.NodeUtils.convertCodeToStructure(UnicodeArrayTemplate_1.UnicodeArrayTemplate().formatUnicorn({
  2079. unicodeArrayName: this.unicodeArrayName,
  2080. unicodeArray: this.unicodeArray.toString()
  2081. }));
  2082. }
  2083. }]);
  2084. return UnicodeArrayNode;
  2085. }(AbstractCustomNode_1.AbstractCustomNode);
  2086. UnicodeArrayNode.UNICODE_ARRAY_RANDOM_LENGTH = 4;
  2087. exports.UnicodeArrayNode = UnicodeArrayNode;
  2088. /***/ },
  2089. /* 41 */
  2090. /***/ function(module, exports, __webpack_require__) {
  2091. "use strict";
  2092. "use strict";
  2093. 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; }; })();
  2094. 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); } });
  2095. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2096. 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; }
  2097. 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; }
  2098. __webpack_require__(8);
  2099. var AppendState_1 = __webpack_require__(2);
  2100. var NoCustomNodesPreset_1 = __webpack_require__(16);
  2101. var SelfDefendingTemplate_1 = __webpack_require__(77);
  2102. var UnicodeArrayRotateFunctionTemplate_1 = __webpack_require__(78);
  2103. var AbstractCustomNode_1 = __webpack_require__(6);
  2104. var JavaScriptObfuscator_1 = __webpack_require__(10);
  2105. var NodeAppender_1 = __webpack_require__(4);
  2106. var NodeUtils_1 = __webpack_require__(1);
  2107. var Utils_1 = __webpack_require__(0);
  2108. var UnicodeArrayRotateFunctionNode = function (_AbstractCustomNode_) {
  2109. _inherits(UnicodeArrayRotateFunctionNode, _AbstractCustomNode_);
  2110. function UnicodeArrayRotateFunctionNode(unicodeArrayName, unicodeArray, unicodeArrayRotateValue, options) {
  2111. _classCallCheck(this, UnicodeArrayRotateFunctionNode);
  2112. var _this = _possibleConstructorReturn(this, (UnicodeArrayRotateFunctionNode.__proto__ || Object.getPrototypeOf(UnicodeArrayRotateFunctionNode)).call(this, options));
  2113. _this.appendState = AppendState_1.AppendState.AfterObfuscation;
  2114. _this.unicodeArrayName = unicodeArrayName;
  2115. _this.unicodeArray = unicodeArray;
  2116. _this.unicodeArrayRotateValue = unicodeArrayRotateValue;
  2117. return _this;
  2118. }
  2119. _createClass(UnicodeArrayRotateFunctionNode, [{
  2120. key: 'appendNode',
  2121. value: function appendNode(blockScopeNode) {
  2122. if (!this.unicodeArray.getLength()) {
  2123. return;
  2124. }
  2125. NodeAppender_1.NodeAppender.insertNodeAtIndex(blockScopeNode, this.getNode(), 1);
  2126. }
  2127. }, {
  2128. key: 'getNode',
  2129. value: function getNode() {
  2130. return _get(UnicodeArrayRotateFunctionNode.prototype.__proto__ || Object.getPrototypeOf(UnicodeArrayRotateFunctionNode.prototype), 'getNode', this).call(this);
  2131. }
  2132. }, {
  2133. key: 'getNodeStructure',
  2134. value: function getNodeStructure() {
  2135. var code = '',
  2136. timesName = Utils_1.Utils.getRandomVariableName(),
  2137. whileFunctionName = Utils_1.Utils.getRandomVariableName();
  2138. if (this.options.selfDefending) {
  2139. code = SelfDefendingTemplate_1.SelfDefendingTemplate().formatUnicorn({
  2140. timesName: timesName,
  2141. whileFunctionName: whileFunctionName
  2142. });
  2143. } else {
  2144. code = whileFunctionName + '(++' + timesName + ')';
  2145. }
  2146. return NodeUtils_1.NodeUtils.convertCodeToStructure(JavaScriptObfuscator_1.JavaScriptObfuscator.obfuscate(UnicodeArrayRotateFunctionTemplate_1.UnicodeArrayRotateFunctionTemplate().formatUnicorn({
  2147. code: code,
  2148. timesName: timesName,
  2149. unicodeArrayName: this.unicodeArrayName,
  2150. unicodeArrayRotateValue: Utils_1.Utils.decToHex(this.unicodeArrayRotateValue),
  2151. whileFunctionName: whileFunctionName
  2152. }), NoCustomNodesPreset_1.NO_CUSTOM_NODES_PRESET).getObfuscatedCode());
  2153. }
  2154. }]);
  2155. return UnicodeArrayRotateFunctionNode;
  2156. }(AbstractCustomNode_1.AbstractCustomNode);
  2157. exports.UnicodeArrayRotateFunctionNode = UnicodeArrayRotateFunctionNode;
  2158. /***/ },
  2159. /* 42 */
  2160. /***/ function(module, exports, __webpack_require__) {
  2161. "use strict";
  2162. "use strict";
  2163. 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; }; })();
  2164. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2165. 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; }
  2166. 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; }
  2167. var ConsoleOutputDisableExpressionNode_1 = __webpack_require__(33);
  2168. var NodeCallsControllerFunctionNode_1 = __webpack_require__(17);
  2169. var AbstractNodesGroup_1 = __webpack_require__(11);
  2170. var NodeAppender_1 = __webpack_require__(4);
  2171. var Utils_1 = __webpack_require__(0);
  2172. var ConsoleOutputNodesGroup = function (_AbstractNodesGroup_) {
  2173. _inherits(ConsoleOutputNodesGroup, _AbstractNodesGroup_);
  2174. function ConsoleOutputNodesGroup() {
  2175. _classCallCheck(this, ConsoleOutputNodesGroup);
  2176. return _possibleConstructorReturn(this, (ConsoleOutputNodesGroup.__proto__ || Object.getPrototypeOf(ConsoleOutputNodesGroup)).apply(this, arguments));
  2177. }
  2178. _createClass(ConsoleOutputNodesGroup, [{
  2179. key: 'getNodes',
  2180. value: function getNodes() {
  2181. if (!this.options.disableConsoleOutput) {
  2182. return;
  2183. }
  2184. var callsControllerFunctionName = Utils_1.Utils.getRandomVariableName();
  2185. var randomStackTraceIndex = NodeAppender_1.NodeAppender.getRandomStackTraceIndex(this.stackTraceData.length);
  2186. return this.syncCustomNodesWithNodesGroup(new Map([['consoleOutputDisableExpressionNode', new ConsoleOutputDisableExpressionNode_1.ConsoleOutputDisableExpressionNode(this.stackTraceData, callsControllerFunctionName, randomStackTraceIndex, this.options)], ['ConsoleOutputNodeCallsControllerFunctionNode', new NodeCallsControllerFunctionNode_1.NodeCallsControllerFunctionNode(this.stackTraceData, callsControllerFunctionName, randomStackTraceIndex, this.options)]]));
  2187. }
  2188. }]);
  2189. return ConsoleOutputNodesGroup;
  2190. }(AbstractNodesGroup_1.AbstractNodesGroup);
  2191. exports.ConsoleOutputNodesGroup = ConsoleOutputNodesGroup;
  2192. /***/ },
  2193. /* 43 */
  2194. /***/ function(module, exports, __webpack_require__) {
  2195. "use strict";
  2196. "use strict";
  2197. 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; }; })();
  2198. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2199. 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; }
  2200. 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; }
  2201. var DebugProtectionFunctionCallNode_1 = __webpack_require__(34);
  2202. var DebugProtectionFunctionIntervalNode_1 = __webpack_require__(35);
  2203. var DebugProtectionFunctionNode_1 = __webpack_require__(36);
  2204. var AbstractNodesGroup_1 = __webpack_require__(11);
  2205. var Utils_1 = __webpack_require__(0);
  2206. var DebugProtectionNodesGroup = function (_AbstractNodesGroup_) {
  2207. _inherits(DebugProtectionNodesGroup, _AbstractNodesGroup_);
  2208. function DebugProtectionNodesGroup() {
  2209. _classCallCheck(this, DebugProtectionNodesGroup);
  2210. return _possibleConstructorReturn(this, (DebugProtectionNodesGroup.__proto__ || Object.getPrototypeOf(DebugProtectionNodesGroup)).apply(this, arguments));
  2211. }
  2212. _createClass(DebugProtectionNodesGroup, [{
  2213. key: 'getNodes',
  2214. value: function getNodes() {
  2215. if (!this.options.debugProtection) {
  2216. return;
  2217. }
  2218. var debugProtectionFunctionName = Utils_1.Utils.getRandomVariableName();
  2219. var customNodes = new Map([['debugProtectionFunctionNode', new DebugProtectionFunctionNode_1.DebugProtectionFunctionNode(debugProtectionFunctionName, this.options)], ['debugProtectionFunctionCallNode', new DebugProtectionFunctionCallNode_1.DebugProtectionFunctionCallNode(debugProtectionFunctionName, this.options)]]);
  2220. if (this.options.debugProtectionInterval) {
  2221. customNodes.set('debugProtectionFunctionIntervalNode', new DebugProtectionFunctionIntervalNode_1.DebugProtectionFunctionIntervalNode(debugProtectionFunctionName, this.options));
  2222. }
  2223. return this.syncCustomNodesWithNodesGroup(customNodes);
  2224. }
  2225. }]);
  2226. return DebugProtectionNodesGroup;
  2227. }(AbstractNodesGroup_1.AbstractNodesGroup);
  2228. exports.DebugProtectionNodesGroup = DebugProtectionNodesGroup;
  2229. /***/ },
  2230. /* 44 */
  2231. /***/ function(module, exports, __webpack_require__) {
  2232. "use strict";
  2233. "use strict";
  2234. 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; }; })();
  2235. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2236. 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; }
  2237. 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; }
  2238. var DomainLockNode_1 = __webpack_require__(37);
  2239. var NodeCallsControllerFunctionNode_1 = __webpack_require__(17);
  2240. var AbstractNodesGroup_1 = __webpack_require__(11);
  2241. var NodeAppender_1 = __webpack_require__(4);
  2242. var Utils_1 = __webpack_require__(0);
  2243. var DomainLockNodesGroup = function (_AbstractNodesGroup_) {
  2244. _inherits(DomainLockNodesGroup, _AbstractNodesGroup_);
  2245. function DomainLockNodesGroup() {
  2246. _classCallCheck(this, DomainLockNodesGroup);
  2247. return _possibleConstructorReturn(this, (DomainLockNodesGroup.__proto__ || Object.getPrototypeOf(DomainLockNodesGroup)).apply(this, arguments));
  2248. }
  2249. _createClass(DomainLockNodesGroup, [{
  2250. key: 'getNodes',
  2251. value: function getNodes() {
  2252. if (!this.options.domainLock.length) {
  2253. return;
  2254. }
  2255. var callsControllerFunctionName = Utils_1.Utils.getRandomVariableName();
  2256. var randomStackTraceIndex = NodeAppender_1.NodeAppender.getRandomStackTraceIndex(this.stackTraceData.length);
  2257. return this.syncCustomNodesWithNodesGroup(new Map([['DomainLockNode', new DomainLockNode_1.DomainLockNode(this.stackTraceData, callsControllerFunctionName, randomStackTraceIndex, this.options)], ['DomainLockNodeCallsControllerFunctionNode', new NodeCallsControllerFunctionNode_1.NodeCallsControllerFunctionNode(this.stackTraceData, callsControllerFunctionName, randomStackTraceIndex, this.options)]]));
  2258. }
  2259. }]);
  2260. return DomainLockNodesGroup;
  2261. }(AbstractNodesGroup_1.AbstractNodesGroup);
  2262. exports.DomainLockNodesGroup = DomainLockNodesGroup;
  2263. /***/ },
  2264. /* 45 */
  2265. /***/ function(module, exports, __webpack_require__) {
  2266. "use strict";
  2267. "use strict";
  2268. 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; }; })();
  2269. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2270. 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; }
  2271. 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; }
  2272. var AppendState_1 = __webpack_require__(2);
  2273. var NodeCallsControllerFunctionNode_1 = __webpack_require__(17);
  2274. var SelfDefendingUnicodeNode_1 = __webpack_require__(38);
  2275. var AbstractNodesGroup_1 = __webpack_require__(11);
  2276. var NodeAppender_1 = __webpack_require__(4);
  2277. var Utils_1 = __webpack_require__(0);
  2278. var SelfDefendingNodesGroup = function (_AbstractNodesGroup_) {
  2279. _inherits(SelfDefendingNodesGroup, _AbstractNodesGroup_);
  2280. function SelfDefendingNodesGroup() {
  2281. _classCallCheck(this, SelfDefendingNodesGroup);
  2282. var _this = _possibleConstructorReturn(this, (SelfDefendingNodesGroup.__proto__ || Object.getPrototypeOf(SelfDefendingNodesGroup)).apply(this, arguments));
  2283. _this.appendState = AppendState_1.AppendState.AfterObfuscation;
  2284. return _this;
  2285. }
  2286. _createClass(SelfDefendingNodesGroup, [{
  2287. key: 'getNodes',
  2288. value: function getNodes() {
  2289. if (!this.options.selfDefending) {
  2290. return;
  2291. }
  2292. var callsControllerFunctionName = Utils_1.Utils.getRandomVariableName();
  2293. var randomStackTraceIndex = NodeAppender_1.NodeAppender.getRandomStackTraceIndex(this.stackTraceData.length);
  2294. return this.syncCustomNodesWithNodesGroup(new Map([['selfDefendingUnicodeNode', new SelfDefendingUnicodeNode_1.SelfDefendingUnicodeNode(this.stackTraceData, callsControllerFunctionName, randomStackTraceIndex, this.options)], ['SelfDefendingNodeCallsControllerFunctionNode', new NodeCallsControllerFunctionNode_1.NodeCallsControllerFunctionNode(this.stackTraceData, callsControllerFunctionName, randomStackTraceIndex, this.options)]]));
  2295. }
  2296. }]);
  2297. return SelfDefendingNodesGroup;
  2298. }(AbstractNodesGroup_1.AbstractNodesGroup);
  2299. exports.SelfDefendingNodesGroup = SelfDefendingNodesGroup;
  2300. /***/ },
  2301. /* 46 */
  2302. /***/ function(module, exports, __webpack_require__) {
  2303. "use strict";
  2304. "use strict";
  2305. 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; }; })();
  2306. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2307. 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; }
  2308. 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; }
  2309. var AppendState_1 = __webpack_require__(2);
  2310. var UnicodeArrayCallsWrapper_1 = __webpack_require__(39);
  2311. var UnicodeArrayNode_1 = __webpack_require__(40);
  2312. var UnicodeArrayRotateFunctionNode_1 = __webpack_require__(41);
  2313. var AbstractNodesGroup_1 = __webpack_require__(11);
  2314. var UnicodeArray_1 = __webpack_require__(30);
  2315. var Utils_1 = __webpack_require__(0);
  2316. var UnicodeArrayNodesGroup = function (_AbstractNodesGroup_) {
  2317. _inherits(UnicodeArrayNodesGroup, _AbstractNodesGroup_);
  2318. function UnicodeArrayNodesGroup() {
  2319. _classCallCheck(this, UnicodeArrayNodesGroup);
  2320. var _this = _possibleConstructorReturn(this, (UnicodeArrayNodesGroup.__proto__ || Object.getPrototypeOf(UnicodeArrayNodesGroup)).apply(this, arguments));
  2321. _this.appendState = AppendState_1.AppendState.AfterObfuscation;
  2322. _this.unicodeArrayName = Utils_1.Utils.getRandomVariableName(UnicodeArrayNode_1.UnicodeArrayNode.UNICODE_ARRAY_RANDOM_LENGTH);
  2323. _this.unicodeArrayCallsWrapper = Utils_1.Utils.getRandomVariableName(UnicodeArrayNode_1.UnicodeArrayNode.UNICODE_ARRAY_RANDOM_LENGTH);
  2324. return _this;
  2325. }
  2326. _createClass(UnicodeArrayNodesGroup, [{
  2327. key: 'getNodes',
  2328. value: function getNodes() {
  2329. if (!this.options.unicodeArray) {
  2330. return;
  2331. }
  2332. if (this.options.rotateUnicodeArray) {
  2333. this.unicodeArrayRotateValue = Utils_1.Utils.getRandomGenerator().integer({
  2334. min: 100,
  2335. max: 500
  2336. });
  2337. } else {
  2338. this.unicodeArrayRotateValue = 0;
  2339. }
  2340. var unicodeArray = new UnicodeArray_1.UnicodeArray();
  2341. var unicodeArrayNode = new UnicodeArrayNode_1.UnicodeArrayNode(unicodeArray, this.unicodeArrayName, this.unicodeArrayRotateValue, this.options);
  2342. var customNodes = new Map([['unicodeArrayNode', unicodeArrayNode], ['unicodeArrayCallsWrapper', new UnicodeArrayCallsWrapper_1.UnicodeArrayCallsWrapper(this.unicodeArrayCallsWrapper, this.unicodeArrayName, unicodeArray, this.options)]]);
  2343. if (this.options.rotateUnicodeArray) {
  2344. customNodes.set('unicodeArrayRotateFunctionNode', new UnicodeArrayRotateFunctionNode_1.UnicodeArrayRotateFunctionNode(this.unicodeArrayName, unicodeArray, this.unicodeArrayRotateValue, this.options));
  2345. }
  2346. return this.syncCustomNodesWithNodesGroup(customNodes);
  2347. }
  2348. }]);
  2349. return UnicodeArrayNodesGroup;
  2350. }(AbstractNodesGroup_1.AbstractNodesGroup);
  2351. exports.UnicodeArrayNodesGroup = UnicodeArrayNodesGroup;
  2352. /***/ },
  2353. /* 47 */
  2354. /***/ function(module, exports, __webpack_require__) {
  2355. "use strict";
  2356. "use strict";
  2357. 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; }; })();
  2358. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2359. 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; }
  2360. 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; }
  2361. var estraverse = __webpack_require__(5);
  2362. var NodeType_1 = __webpack_require__(7);
  2363. var AbstractNodeObfuscator_1 = __webpack_require__(9);
  2364. var IdentifierReplacer_1 = __webpack_require__(15);
  2365. var Node_1 = __webpack_require__(3);
  2366. var NodeUtils_1 = __webpack_require__(1);
  2367. var CatchClauseObfuscator = function (_AbstractNodeObfuscat) {
  2368. _inherits(CatchClauseObfuscator, _AbstractNodeObfuscat);
  2369. function CatchClauseObfuscator(nodes, options) {
  2370. _classCallCheck(this, CatchClauseObfuscator);
  2371. var _this = _possibleConstructorReturn(this, (CatchClauseObfuscator.__proto__ || Object.getPrototypeOf(CatchClauseObfuscator)).call(this, nodes, options));
  2372. _this.identifierReplacer = new IdentifierReplacer_1.IdentifierReplacer(_this.nodes, _this.options);
  2373. return _this;
  2374. }
  2375. _createClass(CatchClauseObfuscator, [{
  2376. key: 'obfuscateNode',
  2377. value: function obfuscateNode(catchClauseNode) {
  2378. this.storeCatchClauseParam(catchClauseNode);
  2379. this.replaceCatchClauseParam(catchClauseNode);
  2380. }
  2381. }, {
  2382. key: 'storeCatchClauseParam',
  2383. value: function storeCatchClauseParam(catchClauseNode) {
  2384. var _this2 = this;
  2385. NodeUtils_1.NodeUtils.typedReplace(catchClauseNode.param, NodeType_1.NodeType.Identifier, {
  2386. enter: function enter(node) {
  2387. return _this2.identifierReplacer.storeNames(node.name);
  2388. }
  2389. });
  2390. }
  2391. }, {
  2392. key: 'replaceCatchClauseParam',
  2393. value: function replaceCatchClauseParam(catchClauseNode) {
  2394. var _this3 = this;
  2395. estraverse.replace(catchClauseNode, {
  2396. enter: function enter(node, parentNode) {
  2397. if (Node_1.Node.isReplaceableIdentifierNode(node, parentNode)) {
  2398. node.name = _this3.identifierReplacer.replace(node.name);
  2399. }
  2400. }
  2401. });
  2402. }
  2403. }]);
  2404. return CatchClauseObfuscator;
  2405. }(AbstractNodeObfuscator_1.AbstractNodeObfuscator);
  2406. exports.CatchClauseObfuscator = CatchClauseObfuscator;
  2407. /***/ },
  2408. /* 48 */
  2409. /***/ function(module, exports, __webpack_require__) {
  2410. "use strict";
  2411. "use strict";
  2412. 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; }; })();
  2413. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2414. 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; }
  2415. 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; }
  2416. var estraverse = __webpack_require__(5);
  2417. var NodeType_1 = __webpack_require__(7);
  2418. var AbstractNodeObfuscator_1 = __webpack_require__(9);
  2419. var IdentifierReplacer_1 = __webpack_require__(15);
  2420. var Node_1 = __webpack_require__(3);
  2421. var NodeUtils_1 = __webpack_require__(1);
  2422. var FunctionDeclarationObfuscator = function (_AbstractNodeObfuscat) {
  2423. _inherits(FunctionDeclarationObfuscator, _AbstractNodeObfuscat);
  2424. function FunctionDeclarationObfuscator(nodes, options) {
  2425. _classCallCheck(this, FunctionDeclarationObfuscator);
  2426. var _this = _possibleConstructorReturn(this, (FunctionDeclarationObfuscator.__proto__ || Object.getPrototypeOf(FunctionDeclarationObfuscator)).call(this, nodes, options));
  2427. _this.identifierReplacer = new IdentifierReplacer_1.IdentifierReplacer(_this.nodes, _this.options);
  2428. return _this;
  2429. }
  2430. _createClass(FunctionDeclarationObfuscator, [{
  2431. key: 'obfuscateNode',
  2432. value: function obfuscateNode(functionDeclarationNode, parentNode) {
  2433. if (parentNode.type === NodeType_1.NodeType.Program) {
  2434. return;
  2435. }
  2436. this.storeFunctionName(functionDeclarationNode);
  2437. this.replaceFunctionName(functionDeclarationNode);
  2438. }
  2439. }, {
  2440. key: 'storeFunctionName',
  2441. value: function storeFunctionName(functionDeclarationNode) {
  2442. var _this2 = this;
  2443. NodeUtils_1.NodeUtils.typedReplace(functionDeclarationNode.id, NodeType_1.NodeType.Identifier, {
  2444. enter: function enter(node) {
  2445. return _this2.identifierReplacer.storeNames(node.name);
  2446. }
  2447. });
  2448. }
  2449. }, {
  2450. key: 'replaceFunctionName',
  2451. value: function replaceFunctionName(functionDeclarationNode) {
  2452. var _this3 = this;
  2453. var scopeNode = NodeUtils_1.NodeUtils.getBlockScopeOfNode(functionDeclarationNode);
  2454. estraverse.replace(scopeNode, {
  2455. enter: function enter(node, parentNode) {
  2456. if (Node_1.Node.isReplaceableIdentifierNode(node, parentNode)) {
  2457. node.name = _this3.identifierReplacer.replace(node.name);
  2458. }
  2459. }
  2460. });
  2461. }
  2462. }]);
  2463. return FunctionDeclarationObfuscator;
  2464. }(AbstractNodeObfuscator_1.AbstractNodeObfuscator);
  2465. exports.FunctionDeclarationObfuscator = FunctionDeclarationObfuscator;
  2466. /***/ },
  2467. /* 49 */
  2468. /***/ function(module, exports, __webpack_require__) {
  2469. "use strict";
  2470. "use strict";
  2471. 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; }; })();
  2472. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2473. 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; }
  2474. 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; }
  2475. var estraverse = __webpack_require__(5);
  2476. var NodeType_1 = __webpack_require__(7);
  2477. var AbstractNodeObfuscator_1 = __webpack_require__(9);
  2478. var IdentifierReplacer_1 = __webpack_require__(15);
  2479. var Node_1 = __webpack_require__(3);
  2480. var NodeUtils_1 = __webpack_require__(1);
  2481. var FunctionObfuscator = function (_AbstractNodeObfuscat) {
  2482. _inherits(FunctionObfuscator, _AbstractNodeObfuscat);
  2483. function FunctionObfuscator(nodes, options) {
  2484. _classCallCheck(this, FunctionObfuscator);
  2485. var _this = _possibleConstructorReturn(this, (FunctionObfuscator.__proto__ || Object.getPrototypeOf(FunctionObfuscator)).call(this, nodes, options));
  2486. _this.identifierReplacer = new IdentifierReplacer_1.IdentifierReplacer(_this.nodes, _this.options);
  2487. return _this;
  2488. }
  2489. _createClass(FunctionObfuscator, [{
  2490. key: 'obfuscateNode',
  2491. value: function obfuscateNode(functionNode) {
  2492. this.storeFunctionParams(functionNode);
  2493. this.replaceFunctionParams(functionNode);
  2494. }
  2495. }, {
  2496. key: 'storeFunctionParams',
  2497. value: function storeFunctionParams(functionNode) {
  2498. var _this2 = this;
  2499. functionNode.params.forEach(function (paramsNode) {
  2500. NodeUtils_1.NodeUtils.typedReplace(paramsNode, NodeType_1.NodeType.Identifier, {
  2501. enter: function enter(node) {
  2502. return _this2.identifierReplacer.storeNames(node.name);
  2503. }
  2504. });
  2505. });
  2506. }
  2507. }, {
  2508. key: 'replaceFunctionParams',
  2509. value: function replaceFunctionParams(functionNode) {
  2510. var _this3 = this;
  2511. var replaceVisitor = {
  2512. enter: function enter(node, parentNode) {
  2513. if (Node_1.Node.isReplaceableIdentifierNode(node, parentNode)) {
  2514. var newNodeName = _this3.identifierReplacer.replace(node.name);
  2515. if (node.name !== newNodeName) {
  2516. node.name = newNodeName;
  2517. node.obfuscated = true;
  2518. }
  2519. }
  2520. }
  2521. };
  2522. functionNode.params.forEach(function (paramsNode) {
  2523. estraverse.replace(paramsNode, replaceVisitor);
  2524. });
  2525. estraverse.replace(functionNode.body, replaceVisitor);
  2526. }
  2527. }]);
  2528. return FunctionObfuscator;
  2529. }(AbstractNodeObfuscator_1.AbstractNodeObfuscator);
  2530. exports.FunctionObfuscator = FunctionObfuscator;
  2531. /***/ },
  2532. /* 50 */
  2533. /***/ function(module, exports, __webpack_require__) {
  2534. "use strict";
  2535. "use strict";
  2536. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  2537. 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; }; })();
  2538. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2539. 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; }
  2540. 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; }
  2541. var escodegen = __webpack_require__(12);
  2542. var AbstractNodeObfuscator_1 = __webpack_require__(9);
  2543. var BooleanLiteralReplacer_1 = __webpack_require__(55);
  2544. var Node_1 = __webpack_require__(3);
  2545. var NumberLiteralReplacer_1 = __webpack_require__(22);
  2546. var StringLiteralReplacer_1 = __webpack_require__(19);
  2547. var LiteralObfuscator = function (_AbstractNodeObfuscat) {
  2548. _inherits(LiteralObfuscator, _AbstractNodeObfuscat);
  2549. function LiteralObfuscator() {
  2550. _classCallCheck(this, LiteralObfuscator);
  2551. return _possibleConstructorReturn(this, (LiteralObfuscator.__proto__ || Object.getPrototypeOf(LiteralObfuscator)).apply(this, arguments));
  2552. }
  2553. _createClass(LiteralObfuscator, [{
  2554. key: 'obfuscateNode',
  2555. value: function obfuscateNode(literalNode, parentNode) {
  2556. if (Node_1.Node.isPropertyNode(parentNode) && parentNode.key === literalNode) {
  2557. return;
  2558. }
  2559. var content = void 0;
  2560. switch (_typeof(literalNode.value)) {
  2561. case 'boolean':
  2562. content = new BooleanLiteralReplacer_1.BooleanLiteralReplacer(this.nodes, this.options).replace(literalNode.value);
  2563. break;
  2564. case 'number':
  2565. content = new NumberLiteralReplacer_1.NumberLiteralReplacer(this.nodes, this.options).replace(literalNode.value);
  2566. break;
  2567. case 'string':
  2568. content = new StringLiteralReplacer_1.StringLiteralReplacer(this.nodes, this.options).replace(literalNode.value);
  2569. break;
  2570. default:
  2571. return;
  2572. }
  2573. literalNode['x-verbatim-property'] = {
  2574. content: content,
  2575. precedence: escodegen.Precedence.Primary
  2576. };
  2577. }
  2578. }]);
  2579. return LiteralObfuscator;
  2580. }(AbstractNodeObfuscator_1.AbstractNodeObfuscator);
  2581. exports.LiteralObfuscator = LiteralObfuscator;
  2582. /***/ },
  2583. /* 51 */
  2584. /***/ function(module, exports, __webpack_require__) {
  2585. "use strict";
  2586. "use strict";
  2587. 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; }; })();
  2588. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2589. 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; }
  2590. 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; }
  2591. var escodegen = __webpack_require__(12);
  2592. var estraverse = __webpack_require__(5);
  2593. var NodeType_1 = __webpack_require__(7);
  2594. var AbstractNodeObfuscator_1 = __webpack_require__(9);
  2595. var Node_1 = __webpack_require__(3);
  2596. var StringLiteralReplacer_1 = __webpack_require__(19);
  2597. var MemberExpressionObfuscator = function (_AbstractNodeObfuscat) {
  2598. _inherits(MemberExpressionObfuscator, _AbstractNodeObfuscat);
  2599. function MemberExpressionObfuscator() {
  2600. _classCallCheck(this, MemberExpressionObfuscator);
  2601. return _possibleConstructorReturn(this, (MemberExpressionObfuscator.__proto__ || Object.getPrototypeOf(MemberExpressionObfuscator)).apply(this, arguments));
  2602. }
  2603. _createClass(MemberExpressionObfuscator, [{
  2604. key: 'obfuscateNode',
  2605. value: function obfuscateNode(memberExpressionNode) {
  2606. var _this2 = this;
  2607. estraverse.replace(memberExpressionNode.property, {
  2608. enter: function enter(node, parentNode) {
  2609. if (Node_1.Node.isLiteralNode(node)) {
  2610. _this2.obfuscateLiteralProperty(node);
  2611. return;
  2612. }
  2613. if (Node_1.Node.isIdentifierNode(node)) {
  2614. if (memberExpressionNode.computed) {
  2615. return;
  2616. }
  2617. memberExpressionNode.computed = true;
  2618. _this2.obfuscateIdentifierProperty(node);
  2619. }
  2620. }
  2621. });
  2622. }
  2623. }, {
  2624. key: 'obfuscateIdentifierProperty',
  2625. value: function obfuscateIdentifierProperty(node) {
  2626. var nodeValue = node.name,
  2627. literalNode = {
  2628. raw: '\'' + nodeValue + '\'',
  2629. 'x-verbatim-property': {
  2630. content: new StringLiteralReplacer_1.StringLiteralReplacer(this.nodes, this.options).replace(nodeValue),
  2631. precedence: escodegen.Precedence.Primary
  2632. },
  2633. type: NodeType_1.NodeType.Literal,
  2634. value: nodeValue
  2635. };
  2636. delete node.name;
  2637. Object.assign(node, literalNode);
  2638. }
  2639. }, {
  2640. key: 'obfuscateLiteralProperty',
  2641. value: function obfuscateLiteralProperty(node) {
  2642. if (typeof node.value === 'string' && !node['x-verbatim-property']) {
  2643. node['x-verbatim-property'] = {
  2644. content: new StringLiteralReplacer_1.StringLiteralReplacer(this.nodes, this.options).replace(node.value),
  2645. precedence: escodegen.Precedence.Primary
  2646. };
  2647. }
  2648. }
  2649. }]);
  2650. return MemberExpressionObfuscator;
  2651. }(AbstractNodeObfuscator_1.AbstractNodeObfuscator);
  2652. exports.MemberExpressionObfuscator = MemberExpressionObfuscator;
  2653. /***/ },
  2654. /* 52 */
  2655. /***/ function(module, exports, __webpack_require__) {
  2656. "use strict";
  2657. "use strict";
  2658. 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; }; })();
  2659. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2660. 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; }
  2661. 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; }
  2662. var estraverse = __webpack_require__(5);
  2663. var AbstractNodeObfuscator_1 = __webpack_require__(9);
  2664. var Node_1 = __webpack_require__(3);
  2665. var Utils_1 = __webpack_require__(0);
  2666. var StringLiteralReplacer_1 = __webpack_require__(19);
  2667. var MethodDefinitionObfuscator = function (_AbstractNodeObfuscat) {
  2668. _inherits(MethodDefinitionObfuscator, _AbstractNodeObfuscat);
  2669. function MethodDefinitionObfuscator() {
  2670. _classCallCheck(this, MethodDefinitionObfuscator);
  2671. var _this = _possibleConstructorReturn(this, (MethodDefinitionObfuscator.__proto__ || Object.getPrototypeOf(MethodDefinitionObfuscator)).apply(this, arguments));
  2672. _this.ignoredNames = ['constructor'];
  2673. return _this;
  2674. }
  2675. _createClass(MethodDefinitionObfuscator, [{
  2676. key: 'obfuscateNode',
  2677. value: function obfuscateNode(methodDefinitionNode, parentNode) {
  2678. this.replaceMethodName(methodDefinitionNode);
  2679. }
  2680. }, {
  2681. key: 'replaceMethodName',
  2682. value: function replaceMethodName(methodDefinitionNode) {
  2683. var _this2 = this;
  2684. estraverse.replace(methodDefinitionNode.key, {
  2685. enter: function enter(node) {
  2686. if (Node_1.Node.isIdentifierNode(node) && !Utils_1.Utils.arrayContains(_this2.ignoredNames, node.name) && methodDefinitionNode.computed === false) {
  2687. methodDefinitionNode.computed = true;
  2688. node.name = new StringLiteralReplacer_1.StringLiteralReplacer(_this2.nodes, _this2.options).replace(node.name);
  2689. return;
  2690. }
  2691. return estraverse.VisitorOption.Skip;
  2692. }
  2693. });
  2694. }
  2695. }]);
  2696. return MethodDefinitionObfuscator;
  2697. }(AbstractNodeObfuscator_1.AbstractNodeObfuscator);
  2698. exports.MethodDefinitionObfuscator = MethodDefinitionObfuscator;
  2699. /***/ },
  2700. /* 53 */
  2701. /***/ function(module, exports, __webpack_require__) {
  2702. "use strict";
  2703. "use strict";
  2704. 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; }; })();
  2705. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2706. 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; }
  2707. 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; }
  2708. var escodegen = __webpack_require__(12);
  2709. var estraverse = __webpack_require__(5);
  2710. var NodeType_1 = __webpack_require__(7);
  2711. var AbstractNodeObfuscator_1 = __webpack_require__(9);
  2712. var Node_1 = __webpack_require__(3);
  2713. var Utils_1 = __webpack_require__(0);
  2714. var ObjectExpressionObfuscator = function (_AbstractNodeObfuscat) {
  2715. _inherits(ObjectExpressionObfuscator, _AbstractNodeObfuscat);
  2716. function ObjectExpressionObfuscator() {
  2717. _classCallCheck(this, ObjectExpressionObfuscator);
  2718. return _possibleConstructorReturn(this, (ObjectExpressionObfuscator.__proto__ || Object.getPrototypeOf(ObjectExpressionObfuscator)).apply(this, arguments));
  2719. }
  2720. _createClass(ObjectExpressionObfuscator, [{
  2721. key: 'obfuscateNode',
  2722. value: function obfuscateNode(objectExpressionNode) {
  2723. var _this2 = this;
  2724. objectExpressionNode.properties.forEach(function (property) {
  2725. if (property.shorthand) {
  2726. property.shorthand = false;
  2727. }
  2728. estraverse.replace(property.key, {
  2729. enter: function enter(node, parentNode) {
  2730. if (Node_1.Node.isLiteralNode(node)) {
  2731. _this2.obfuscateLiteralPropertyKey(node);
  2732. return;
  2733. }
  2734. if (Node_1.Node.isIdentifierNode(node)) {
  2735. _this2.obfuscateIdentifierPropertyKey(node);
  2736. }
  2737. }
  2738. });
  2739. });
  2740. }
  2741. }, {
  2742. key: 'obfuscateLiteralPropertyKey',
  2743. value: function obfuscateLiteralPropertyKey(node) {
  2744. if (typeof node.value === 'string' && !node['x-verbatim-property']) {
  2745. node['x-verbatim-property'] = {
  2746. content: Utils_1.Utils.stringToUnicode(node.value),
  2747. precedence: escodegen.Precedence.Primary
  2748. };
  2749. }
  2750. }
  2751. }, {
  2752. key: 'obfuscateIdentifierPropertyKey',
  2753. value: function obfuscateIdentifierPropertyKey(node) {
  2754. var nodeValue = node.name,
  2755. literalNode = {
  2756. raw: '\'' + nodeValue + '\'',
  2757. 'x-verbatim-property': {
  2758. content: Utils_1.Utils.stringToUnicode(nodeValue),
  2759. precedence: escodegen.Precedence.Primary
  2760. },
  2761. type: NodeType_1.NodeType.Literal,
  2762. value: nodeValue
  2763. };
  2764. delete node.name;
  2765. Object.assign(node, literalNode);
  2766. }
  2767. }]);
  2768. return ObjectExpressionObfuscator;
  2769. }(AbstractNodeObfuscator_1.AbstractNodeObfuscator);
  2770. exports.ObjectExpressionObfuscator = ObjectExpressionObfuscator;
  2771. /***/ },
  2772. /* 54 */
  2773. /***/ function(module, exports, __webpack_require__) {
  2774. "use strict";
  2775. "use strict";
  2776. 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; }; })();
  2777. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2778. 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; }
  2779. 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; }
  2780. var estraverse = __webpack_require__(5);
  2781. var NodeType_1 = __webpack_require__(7);
  2782. var AbstractNodeObfuscator_1 = __webpack_require__(9);
  2783. var IdentifierReplacer_1 = __webpack_require__(15);
  2784. var Node_1 = __webpack_require__(3);
  2785. var NodeUtils_1 = __webpack_require__(1);
  2786. var VariableDeclarationObfuscator = function (_AbstractNodeObfuscat) {
  2787. _inherits(VariableDeclarationObfuscator, _AbstractNodeObfuscat);
  2788. function VariableDeclarationObfuscator(nodes, options) {
  2789. _classCallCheck(this, VariableDeclarationObfuscator);
  2790. var _this = _possibleConstructorReturn(this, (VariableDeclarationObfuscator.__proto__ || Object.getPrototypeOf(VariableDeclarationObfuscator)).call(this, nodes, options));
  2791. _this.identifierReplacer = new IdentifierReplacer_1.IdentifierReplacer(_this.nodes, _this.options);
  2792. return _this;
  2793. }
  2794. _createClass(VariableDeclarationObfuscator, [{
  2795. key: 'obfuscateNode',
  2796. value: function obfuscateNode(variableDeclarationNode, parentNode) {
  2797. if (parentNode.type === NodeType_1.NodeType.Program) {
  2798. return;
  2799. }
  2800. this.storeVariableNames(variableDeclarationNode);
  2801. this.replaceVariableNames(variableDeclarationNode, parentNode);
  2802. }
  2803. }, {
  2804. key: 'storeVariableNames',
  2805. value: function storeVariableNames(variableDeclarationNode) {
  2806. var _this2 = this;
  2807. variableDeclarationNode.declarations.forEach(function (declarationNode) {
  2808. NodeUtils_1.NodeUtils.typedReplace(declarationNode.id, NodeType_1.NodeType.Identifier, {
  2809. enter: function enter(node) {
  2810. return _this2.identifierReplacer.storeNames(node.name);
  2811. }
  2812. });
  2813. });
  2814. }
  2815. }, {
  2816. key: 'replaceVariableNames',
  2817. value: function replaceVariableNames(variableDeclarationNode, variableParentNode) {
  2818. var _this3 = this;
  2819. var scopeNode = variableDeclarationNode.kind === 'var' ? NodeUtils_1.NodeUtils.getBlockScopeOfNode(variableDeclarationNode) : variableParentNode;
  2820. estraverse.replace(scopeNode, {
  2821. enter: function enter(node, parentNode) {
  2822. if (!node.obfuscated && Node_1.Node.isReplaceableIdentifierNode(node, parentNode)) {
  2823. node.name = _this3.identifierReplacer.replace(node.name);
  2824. }
  2825. }
  2826. });
  2827. }
  2828. }]);
  2829. return VariableDeclarationObfuscator;
  2830. }(AbstractNodeObfuscator_1.AbstractNodeObfuscator);
  2831. exports.VariableDeclarationObfuscator = VariableDeclarationObfuscator;
  2832. /***/ },
  2833. /* 55 */
  2834. /***/ function(module, exports, __webpack_require__) {
  2835. "use strict";
  2836. "use strict";
  2837. 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; }; })();
  2838. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2839. 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; }
  2840. 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; }
  2841. var JSFuck_1 = __webpack_require__(21);
  2842. var AbstractReplacer_1 = __webpack_require__(14);
  2843. var BooleanLiteralReplacer = function (_AbstractReplacer_1$A) {
  2844. _inherits(BooleanLiteralReplacer, _AbstractReplacer_1$A);
  2845. function BooleanLiteralReplacer() {
  2846. _classCallCheck(this, BooleanLiteralReplacer);
  2847. return _possibleConstructorReturn(this, (BooleanLiteralReplacer.__proto__ || Object.getPrototypeOf(BooleanLiteralReplacer)).apply(this, arguments));
  2848. }
  2849. _createClass(BooleanLiteralReplacer, [{
  2850. key: 'replace',
  2851. value: function replace(nodeValue) {
  2852. return nodeValue ? JSFuck_1.JSFuck.True : JSFuck_1.JSFuck.False;
  2853. }
  2854. }]);
  2855. return BooleanLiteralReplacer;
  2856. }(AbstractReplacer_1.AbstractReplacer);
  2857. exports.BooleanLiteralReplacer = BooleanLiteralReplacer;
  2858. /***/ },
  2859. /* 56 */
  2860. /***/ function(module, exports, __webpack_require__) {
  2861. "use strict";
  2862. "use strict";
  2863. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  2864. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2865. var __decorate = undefined && undefined.__decorate || function (decorators, target, key, desc) {
  2866. var c = arguments.length,
  2867. r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
  2868. d;
  2869. 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--) {
  2870. if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  2871. }return c > 3 && r && Object.defineProperty(target, key, r), r;
  2872. };
  2873. var __metadata = undefined && undefined.__metadata || function (k, v) {
  2874. if ((typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
  2875. };
  2876. var class_validator_1 = __webpack_require__(82);
  2877. var TSourceMapMode_1 = __webpack_require__(79);
  2878. var TUnicodeArrayEncoding_1 = __webpack_require__(80);
  2879. var DefaultPreset_1 = __webpack_require__(23);
  2880. var OptionsNormalizer_1 = __webpack_require__(57);
  2881. var ValidationErrorsFormatter_1 = __webpack_require__(58);
  2882. var Options = function Options(obfuscatorOptions) {
  2883. _classCallCheck(this, Options);
  2884. Object.assign(this, DefaultPreset_1.DEFAULT_PRESET, obfuscatorOptions);
  2885. var errors = class_validator_1.validateSync(this, Options.validatorOptions);
  2886. if (errors.length) {
  2887. throw new ReferenceError("Validation failed. errors:\n" + ValidationErrorsFormatter_1.ValidationErrorsFormatter.format(errors));
  2888. }
  2889. Object.assign(this, OptionsNormalizer_1.OptionsNormalizer.normalizeOptions(this));
  2890. };
  2891. Options.validatorOptions = {
  2892. validationError: {
  2893. target: false
  2894. }
  2895. };
  2896. __decorate([class_validator_1.IsBoolean(), __metadata('design:type', Boolean)], Options.prototype, "compact", void 0);
  2897. __decorate([class_validator_1.IsBoolean(), __metadata('design:type', Boolean)], Options.prototype, "debugProtection", void 0);
  2898. __decorate([class_validator_1.IsBoolean(), __metadata('design:type', Boolean)], Options.prototype, "debugProtectionInterval", void 0);
  2899. __decorate([class_validator_1.IsBoolean(), __metadata('design:type', Boolean)], Options.prototype, "disableConsoleOutput", void 0);
  2900. __decorate([class_validator_1.IsArray(), class_validator_1.ArrayUnique(), class_validator_1.IsString({
  2901. each: true
  2902. }), __metadata('design:type', Array)], Options.prototype, "domainLock", void 0);
  2903. __decorate([class_validator_1.IsArray(), class_validator_1.ArrayUnique(), class_validator_1.IsString({
  2904. each: true
  2905. }), __metadata('design:type', Array)], Options.prototype, "reservedNames", void 0);
  2906. __decorate([class_validator_1.IsBoolean(), __metadata('design:type', Boolean)], Options.prototype, "rotateUnicodeArray", void 0);
  2907. __decorate([class_validator_1.IsBoolean(), __metadata('design:type', Boolean)], Options.prototype, "selfDefending", void 0);
  2908. __decorate([class_validator_1.IsBoolean(), __metadata('design:type', Boolean)], Options.prototype, "sourceMap", void 0);
  2909. __decorate([class_validator_1.IsString(), class_validator_1.ValidateIf(function (options) {
  2910. return Boolean(options.sourceMapBaseUrl);
  2911. }), class_validator_1.IsUrl({
  2912. require_protocol: true,
  2913. require_valid_protocol: true
  2914. }), __metadata('design:type', String)], Options.prototype, "sourceMapBaseUrl", void 0);
  2915. __decorate([class_validator_1.IsString(), __metadata('design:type', String)], Options.prototype, "sourceMapFileName", void 0);
  2916. __decorate([class_validator_1.IsIn(['inline', 'separate']), __metadata('design:type', typeof (_a = typeof TSourceMapMode_1.TSourceMapMode !== 'undefined' && TSourceMapMode_1.TSourceMapMode) === 'function' && _a || Object)], Options.prototype, "sourceMapMode", void 0);
  2917. __decorate([class_validator_1.IsBoolean(), __metadata('design:type', Boolean)], Options.prototype, "unicodeArray", void 0);
  2918. __decorate([class_validator_1.IsIn([true, false, 'base64', 'rc4']), __metadata('design:type', typeof (_b = typeof TUnicodeArrayEncoding_1.TUnicodeArrayEncoding !== 'undefined' && TUnicodeArrayEncoding_1.TUnicodeArrayEncoding) === 'function' && _b || Object)], Options.prototype, "unicodeArrayEncoding", void 0);
  2919. __decorate([class_validator_1.IsNumber(), class_validator_1.Min(0), class_validator_1.Max(1), __metadata('design:type', Number)], Options.prototype, "unicodeArrayThreshold", void 0);
  2920. exports.Options = Options;
  2921. var _a, _b;
  2922. /***/ },
  2923. /* 57 */
  2924. /***/ function(module, exports, __webpack_require__) {
  2925. "use strict";
  2926. "use strict";
  2927. 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; }; })();
  2928. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2929. var Utils_1 = __webpack_require__(0);
  2930. var OptionsNormalizer = function () {
  2931. function OptionsNormalizer() {
  2932. _classCallCheck(this, OptionsNormalizer);
  2933. }
  2934. _createClass(OptionsNormalizer, null, [{
  2935. key: 'normalizeOptions',
  2936. value: function normalizeOptions(options) {
  2937. var normalizedOptions = Object.assign({}, options);
  2938. var _iteratorNormalCompletion = true;
  2939. var _didIteratorError = false;
  2940. var _iteratorError = undefined;
  2941. try {
  2942. for (var _iterator = OptionsNormalizer.normalizerRules[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
  2943. var normalizerRule = _step.value;
  2944. normalizedOptions = normalizerRule(normalizedOptions);
  2945. }
  2946. } catch (err) {
  2947. _didIteratorError = true;
  2948. _iteratorError = err;
  2949. } finally {
  2950. try {
  2951. if (!_iteratorNormalCompletion && _iterator.return) {
  2952. _iterator.return();
  2953. }
  2954. } finally {
  2955. if (_didIteratorError) {
  2956. throw _iteratorError;
  2957. }
  2958. }
  2959. }
  2960. return normalizedOptions;
  2961. }
  2962. }, {
  2963. key: 'domainLockRule',
  2964. value: function domainLockRule(options) {
  2965. if (options.domainLock.length) {
  2966. var normalizedDomains = [];
  2967. var _iteratorNormalCompletion2 = true;
  2968. var _didIteratorError2 = false;
  2969. var _iteratorError2 = undefined;
  2970. try {
  2971. for (var _iterator2 = options.domainLock[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
  2972. var domain = _step2.value;
  2973. normalizedDomains.push(Utils_1.Utils.extractDomainFromUrl(domain));
  2974. }
  2975. } catch (err) {
  2976. _didIteratorError2 = true;
  2977. _iteratorError2 = err;
  2978. } finally {
  2979. try {
  2980. if (!_iteratorNormalCompletion2 && _iterator2.return) {
  2981. _iterator2.return();
  2982. }
  2983. } finally {
  2984. if (_didIteratorError2) {
  2985. throw _iteratorError2;
  2986. }
  2987. }
  2988. }
  2989. Object.assign(options, {
  2990. domainLock: normalizedDomains
  2991. });
  2992. }
  2993. return options;
  2994. }
  2995. }, {
  2996. key: 'selfDefendingRule',
  2997. value: function selfDefendingRule(options) {
  2998. if (options.selfDefending) {
  2999. Object.assign(options, OptionsNormalizer.SELF_DEFENDING_OPTIONS);
  3000. }
  3001. return options;
  3002. }
  3003. }, {
  3004. key: 'sourceMapBaseUrl',
  3005. value: function sourceMapBaseUrl(options) {
  3006. var sourceMapBaseUrl = options.sourceMapBaseUrl;
  3007. if (!options.sourceMapFileName) {
  3008. Object.assign(options, {
  3009. sourceMapBaseUrl: ''
  3010. });
  3011. return options;
  3012. }
  3013. if (sourceMapBaseUrl && !sourceMapBaseUrl.endsWith('/')) {
  3014. Object.assign(options, {
  3015. sourceMapBaseUrl: sourceMapBaseUrl + '/'
  3016. });
  3017. }
  3018. return options;
  3019. }
  3020. }, {
  3021. key: 'sourceMapFileName',
  3022. value: function sourceMapFileName(options) {
  3023. var sourceMapFileName = options.sourceMapFileName;
  3024. if (sourceMapFileName) {
  3025. sourceMapFileName = sourceMapFileName.replace(/^\/+/, '').split('.')[0];
  3026. Object.assign(options, {
  3027. sourceMapFileName: sourceMapFileName + '.js.map'
  3028. });
  3029. }
  3030. return options;
  3031. }
  3032. }, {
  3033. key: 'unicodeArrayRule',
  3034. value: function unicodeArrayRule(options) {
  3035. if (!options.unicodeArray) {
  3036. Object.assign(options, OptionsNormalizer.DISABLED_UNICODE_ARRAY_OPTIONS);
  3037. }
  3038. return options;
  3039. }
  3040. }, {
  3041. key: 'unicodeArrayEncodingRule',
  3042. value: function unicodeArrayEncodingRule(options) {
  3043. if (options.unicodeArrayEncoding === true) {
  3044. Object.assign(options, OptionsNormalizer.UNICODE_ARRAY_ENCODING_OPTIONS);
  3045. }
  3046. return options;
  3047. }
  3048. }, {
  3049. key: 'unicodeArrayThresholdRule',
  3050. value: function unicodeArrayThresholdRule(options) {
  3051. if (options.unicodeArrayThreshold === 0) {
  3052. Object.assign(options, OptionsNormalizer.DISABLED_UNICODE_ARRAY_OPTIONS);
  3053. }
  3054. return options;
  3055. }
  3056. }]);
  3057. return OptionsNormalizer;
  3058. }();
  3059. OptionsNormalizer.DISABLED_UNICODE_ARRAY_OPTIONS = {
  3060. rotateUnicodeArray: false,
  3061. unicodeArray: false,
  3062. unicodeArrayEncoding: false,
  3063. unicodeArrayThreshold: 0
  3064. };
  3065. OptionsNormalizer.SELF_DEFENDING_OPTIONS = {
  3066. compact: true,
  3067. selfDefending: true
  3068. };
  3069. OptionsNormalizer.UNICODE_ARRAY_ENCODING_OPTIONS = {
  3070. unicodeArrayEncoding: 'base64'
  3071. };
  3072. OptionsNormalizer.normalizerRules = [OptionsNormalizer.domainLockRule, OptionsNormalizer.selfDefendingRule, OptionsNormalizer.sourceMapBaseUrl, OptionsNormalizer.sourceMapFileName, OptionsNormalizer.unicodeArrayRule, OptionsNormalizer.unicodeArrayEncodingRule, OptionsNormalizer.unicodeArrayThresholdRule];
  3073. exports.OptionsNormalizer = OptionsNormalizer;
  3074. /***/ },
  3075. /* 58 */
  3076. /***/ function(module, exports) {
  3077. "use strict";
  3078. "use strict";
  3079. 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; }; })();
  3080. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3081. var ValidationErrorsFormatter = function () {
  3082. function ValidationErrorsFormatter() {
  3083. _classCallCheck(this, ValidationErrorsFormatter);
  3084. }
  3085. _createClass(ValidationErrorsFormatter, null, [{
  3086. key: "format",
  3087. value: function format(validationErrors) {
  3088. var errorsArray = [];
  3089. var _iteratorNormalCompletion = true;
  3090. var _didIteratorError = false;
  3091. var _iteratorError = undefined;
  3092. try {
  3093. for (var _iterator = validationErrors[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
  3094. var error = _step.value;
  3095. errorsArray.push(ValidationErrorsFormatter.formatError(error));
  3096. }
  3097. } catch (err) {
  3098. _didIteratorError = true;
  3099. _iteratorError = err;
  3100. } finally {
  3101. try {
  3102. if (!_iteratorNormalCompletion && _iterator.return) {
  3103. _iterator.return();
  3104. }
  3105. } finally {
  3106. if (_didIteratorError) {
  3107. throw _iteratorError;
  3108. }
  3109. }
  3110. }
  3111. return errorsArray.join('\n');
  3112. }
  3113. }, {
  3114. key: "formatError",
  3115. value: function formatError(validationError) {
  3116. var errorString = "`" + validationError.property + "` errors:\n",
  3117. constraints = validationError.constraints;
  3118. for (var constraint in constraints) {
  3119. if (!constraints.hasOwnProperty(constraint)) {
  3120. continue;
  3121. }
  3122. errorString += " - " + constraints[constraint] + "\n";
  3123. }
  3124. return errorString;
  3125. }
  3126. }]);
  3127. return ValidationErrorsFormatter;
  3128. }();
  3129. exports.ValidationErrorsFormatter = ValidationErrorsFormatter;
  3130. /***/ },
  3131. /* 59 */
  3132. /***/ function(module, exports, __webpack_require__) {
  3133. "use strict";
  3134. "use strict";
  3135. 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; }; })();
  3136. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3137. var estraverse = __webpack_require__(5);
  3138. var NodeType_1 = __webpack_require__(7);
  3139. var FunctionDeclarationCalleeDataExtractor_1 = __webpack_require__(60);
  3140. var FunctionExpressionCalleeDataExtractor_1 = __webpack_require__(61);
  3141. var ObjectExpressionCalleeDataExtractor_1 = __webpack_require__(62);
  3142. var Node_1 = __webpack_require__(3);
  3143. var NodeUtils_1 = __webpack_require__(1);
  3144. var StackTraceAnalyzer = function () {
  3145. function StackTraceAnalyzer(blockScopeBody) {
  3146. _classCallCheck(this, StackTraceAnalyzer);
  3147. this.calleeDataExtractors = new Map([[NodeType_1.NodeType.FunctionDeclaration, FunctionDeclarationCalleeDataExtractor_1.FunctionDeclarationCalleeDataExtractor], [NodeType_1.NodeType.FunctionExpression, FunctionExpressionCalleeDataExtractor_1.FunctionExpressionCalleeDataExtractor], [NodeType_1.NodeType.ObjectExpression, ObjectExpressionCalleeDataExtractor_1.ObjectExpressionCalleeDataExtractor]]);
  3148. this.blockScopeBody = blockScopeBody;
  3149. }
  3150. _createClass(StackTraceAnalyzer, [{
  3151. key: 'analyze',
  3152. value: function analyze() {
  3153. return this.analyzeRecursive(this.blockScopeBody);
  3154. }
  3155. }, {
  3156. key: 'analyzeRecursive',
  3157. value: function analyzeRecursive(blockScopeBody) {
  3158. var _this = this;
  3159. var limitIndex = StackTraceAnalyzer.getLimitIndex(blockScopeBody.length);
  3160. var stackTraceData = [];
  3161. var _loop = function _loop(index, blockScopeBodyLength) {
  3162. var rootNode = blockScopeBody[index];
  3163. if (index > limitIndex) {
  3164. return 'break';
  3165. }
  3166. estraverse.traverse(rootNode, {
  3167. enter: function enter(node) {
  3168. if (!Node_1.Node.isCallExpressionNode(node) || rootNode.parentNode !== NodeUtils_1.NodeUtils.getBlockScopeOfNode(node)) {
  3169. return;
  3170. }
  3171. _this.calleeDataExtractors.forEach(function (calleeDataExtractor) {
  3172. var calleeData = new calleeDataExtractor(blockScopeBody, node.callee).extract();
  3173. if (!calleeData) {
  3174. return;
  3175. }
  3176. stackTraceData.push(Object.assign({}, calleeData, {
  3177. stackTrace: _this.analyzeRecursive(calleeData.callee.body)
  3178. }));
  3179. });
  3180. }
  3181. });
  3182. };
  3183. for (var index = 0, blockScopeBodyLength = blockScopeBody.length; index < blockScopeBodyLength; index++) {
  3184. var _ret = _loop(index, blockScopeBodyLength);
  3185. if (_ret === 'break') break;
  3186. }
  3187. return stackTraceData;
  3188. }
  3189. }], [{
  3190. key: 'getLimitIndex',
  3191. value: function getLimitIndex(blockScopeBodyLength) {
  3192. var lastIndex = blockScopeBodyLength - 1;
  3193. var limitThresholdActivationIndex = StackTraceAnalyzer.limitThresholdActivationLength - 1;
  3194. var limitIndex = lastIndex;
  3195. if (lastIndex > limitThresholdActivationIndex) {
  3196. limitIndex = Math.round(limitThresholdActivationIndex + lastIndex * StackTraceAnalyzer.limitThreshold);
  3197. if (limitIndex > lastIndex) {
  3198. limitIndex = lastIndex;
  3199. }
  3200. }
  3201. return limitIndex;
  3202. }
  3203. }]);
  3204. return StackTraceAnalyzer;
  3205. }();
  3206. StackTraceAnalyzer.limitThresholdActivationLength = 25;
  3207. StackTraceAnalyzer.limitThreshold = 0.002;
  3208. exports.StackTraceAnalyzer = StackTraceAnalyzer;
  3209. /***/ },
  3210. /* 60 */
  3211. /***/ function(module, exports, __webpack_require__) {
  3212. "use strict";
  3213. "use strict";
  3214. 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; }; })();
  3215. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3216. var estraverse = __webpack_require__(5);
  3217. var Node_1 = __webpack_require__(3);
  3218. var NodeUtils_1 = __webpack_require__(1);
  3219. var FunctionDeclarationCalleeDataExtractor = function () {
  3220. function FunctionDeclarationCalleeDataExtractor(blockScopeBody, callee) {
  3221. _classCallCheck(this, FunctionDeclarationCalleeDataExtractor);
  3222. this.blockScopeBody = blockScopeBody;
  3223. this.callee = callee;
  3224. }
  3225. _createClass(FunctionDeclarationCalleeDataExtractor, [{
  3226. key: 'extract',
  3227. value: function extract() {
  3228. var calleeBlockStatement = null;
  3229. if (Node_1.Node.isIdentifierNode(this.callee)) {
  3230. calleeBlockStatement = this.getCalleeBlockStatement(NodeUtils_1.NodeUtils.getBlockScopeOfNode(this.blockScopeBody[0]), this.callee.name);
  3231. }
  3232. if (!calleeBlockStatement) {
  3233. return null;
  3234. }
  3235. return {
  3236. callee: calleeBlockStatement,
  3237. name: this.callee.name
  3238. };
  3239. }
  3240. }, {
  3241. key: 'getCalleeBlockStatement',
  3242. value: function getCalleeBlockStatement(node, name) {
  3243. var calleeBlockStatement = null;
  3244. estraverse.traverse(node, {
  3245. enter: function enter(node) {
  3246. if (Node_1.Node.isFunctionDeclarationNode(node) && node.id.name === name) {
  3247. calleeBlockStatement = node.body;
  3248. return estraverse.VisitorOption.Break;
  3249. }
  3250. }
  3251. });
  3252. return calleeBlockStatement;
  3253. }
  3254. }]);
  3255. return FunctionDeclarationCalleeDataExtractor;
  3256. }();
  3257. exports.FunctionDeclarationCalleeDataExtractor = FunctionDeclarationCalleeDataExtractor;
  3258. /***/ },
  3259. /* 61 */
  3260. /***/ function(module, exports, __webpack_require__) {
  3261. "use strict";
  3262. "use strict";
  3263. 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; }; })();
  3264. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3265. var estraverse = __webpack_require__(5);
  3266. var Node_1 = __webpack_require__(3);
  3267. var NodeUtils_1 = __webpack_require__(1);
  3268. var FunctionExpressionCalleeDataExtractor = function () {
  3269. function FunctionExpressionCalleeDataExtractor(blockScopeBody, callee) {
  3270. _classCallCheck(this, FunctionExpressionCalleeDataExtractor);
  3271. this.blockScopeBody = blockScopeBody;
  3272. this.callee = callee;
  3273. }
  3274. _createClass(FunctionExpressionCalleeDataExtractor, [{
  3275. key: 'extract',
  3276. value: function extract() {
  3277. var calleeBlockStatement = null;
  3278. if (Node_1.Node.isIdentifierNode(this.callee)) {
  3279. calleeBlockStatement = this.getCalleeBlockStatement(NodeUtils_1.NodeUtils.getBlockScopeOfNode(this.blockScopeBody[0]), this.callee.name);
  3280. }
  3281. if (Node_1.Node.isFunctionExpressionNode(this.callee)) {
  3282. calleeBlockStatement = this.callee.body;
  3283. }
  3284. if (!calleeBlockStatement) {
  3285. return null;
  3286. }
  3287. return {
  3288. callee: calleeBlockStatement,
  3289. name: this.callee.name || null
  3290. };
  3291. }
  3292. }, {
  3293. key: 'getCalleeBlockStatement',
  3294. value: function getCalleeBlockStatement(node, name) {
  3295. var calleeBlockStatement = null;
  3296. estraverse.traverse(node, {
  3297. enter: function enter(node, parentNode) {
  3298. if (Node_1.Node.isFunctionExpressionNode(node) && Node_1.Node.isVariableDeclaratorNode(parentNode) && Node_1.Node.isIdentifierNode(parentNode.id) && parentNode.id.name === name) {
  3299. calleeBlockStatement = node.body;
  3300. return estraverse.VisitorOption.Break;
  3301. }
  3302. }
  3303. });
  3304. return calleeBlockStatement;
  3305. }
  3306. }]);
  3307. return FunctionExpressionCalleeDataExtractor;
  3308. }();
  3309. exports.FunctionExpressionCalleeDataExtractor = FunctionExpressionCalleeDataExtractor;
  3310. /***/ },
  3311. /* 62 */
  3312. /***/ function(module, exports, __webpack_require__) {
  3313. "use strict";
  3314. "use strict";
  3315. 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; }; })();
  3316. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3317. var estraverse = __webpack_require__(5);
  3318. var Node_1 = __webpack_require__(3);
  3319. var NodeUtils_1 = __webpack_require__(1);
  3320. var ObjectExpressionCalleeDataExtractor = function () {
  3321. function ObjectExpressionCalleeDataExtractor(blockScopeBody, callee) {
  3322. _classCallCheck(this, ObjectExpressionCalleeDataExtractor);
  3323. this.blockScopeBody = blockScopeBody;
  3324. this.callee = callee;
  3325. }
  3326. _createClass(ObjectExpressionCalleeDataExtractor, [{
  3327. key: 'extract',
  3328. value: function extract() {
  3329. var calleeBlockStatement = null,
  3330. functionExpressionName = null;
  3331. if (Node_1.Node.isMemberExpressionNode(this.callee)) {
  3332. var objectMembersCallsChain = this.createObjectMembersCallsChain([], this.callee);
  3333. if (!objectMembersCallsChain.length) {
  3334. return null;
  3335. }
  3336. functionExpressionName = objectMembersCallsChain[objectMembersCallsChain.length - 1];
  3337. calleeBlockStatement = this.getCalleeBlockStatement(NodeUtils_1.NodeUtils.getBlockScopeOfNode(this.blockScopeBody[0]), objectMembersCallsChain);
  3338. }
  3339. if (!calleeBlockStatement) {
  3340. return null;
  3341. }
  3342. return {
  3343. callee: calleeBlockStatement,
  3344. name: functionExpressionName
  3345. };
  3346. }
  3347. }, {
  3348. key: 'createObjectMembersCallsChain',
  3349. value: function createObjectMembersCallsChain(currentChain, memberExpression) {
  3350. if (Node_1.Node.isIdentifierNode(memberExpression.property) && memberExpression.computed === false) {
  3351. currentChain.unshift(memberExpression.property.name);
  3352. } else if (Node_1.Node.isLiteralNode(memberExpression.property) && (typeof memberExpression.property.value === 'string' || typeof memberExpression.property.value === 'number')) {
  3353. currentChain.unshift(memberExpression.property.value);
  3354. } else {
  3355. return currentChain;
  3356. }
  3357. if (Node_1.Node.isMemberExpressionNode(memberExpression.object)) {
  3358. return this.createObjectMembersCallsChain(currentChain, memberExpression.object);
  3359. } else if (Node_1.Node.isIdentifierNode(memberExpression.object)) {
  3360. currentChain.unshift(memberExpression.object.name);
  3361. }
  3362. return currentChain;
  3363. }
  3364. }, {
  3365. key: 'getCalleeBlockStatement',
  3366. value: function getCalleeBlockStatement(node, objectMembersCallsChain) {
  3367. var _this = this;
  3368. var objectName = objectMembersCallsChain.shift();
  3369. if (!objectName) {
  3370. return null;
  3371. }
  3372. var calleeBlockStatement = null;
  3373. estraverse.traverse(node, {
  3374. enter: function enter(node, parentNode) {
  3375. if (Node_1.Node.isVariableDeclaratorNode(node) && Node_1.Node.isIdentifierNode(node.id) && node.init && Node_1.Node.isObjectExpressionNode(node.init) && node.id.name === objectName) {
  3376. calleeBlockStatement = _this.findCalleeBlockStatement(node.init.properties, objectMembersCallsChain);
  3377. return estraverse.VisitorOption.Break;
  3378. }
  3379. }
  3380. });
  3381. return calleeBlockStatement;
  3382. }
  3383. }, {
  3384. key: 'findCalleeBlockStatement',
  3385. value: function findCalleeBlockStatement(objectExpressionProperties, objectMembersCallsChain) {
  3386. var nextItemInCallsChain = objectMembersCallsChain.shift();
  3387. if (!nextItemInCallsChain) {
  3388. return null;
  3389. }
  3390. var _iteratorNormalCompletion = true;
  3391. var _didIteratorError = false;
  3392. var _iteratorError = undefined;
  3393. try {
  3394. for (var _iterator = objectExpressionProperties[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
  3395. var propertyNode = _step.value;
  3396. var isTargetPropertyNodeWithIdentifierKey = Node_1.Node.isIdentifierNode(propertyNode.key) && propertyNode.key.name === nextItemInCallsChain;
  3397. var isTargetPropertyNodeWithLiteralKey = Node_1.Node.isLiteralNode(propertyNode.key) && Boolean(propertyNode.key.value) && propertyNode.key.value === nextItemInCallsChain;
  3398. if (!isTargetPropertyNodeWithIdentifierKey && !isTargetPropertyNodeWithLiteralKey) {
  3399. continue;
  3400. }
  3401. if (Node_1.Node.isObjectExpressionNode(propertyNode.value)) {
  3402. return this.findCalleeBlockStatement(propertyNode.value.properties, objectMembersCallsChain);
  3403. }
  3404. if (Node_1.Node.isFunctionExpressionNode(propertyNode.value)) {
  3405. return propertyNode.value.body;
  3406. }
  3407. }
  3408. } catch (err) {
  3409. _didIteratorError = true;
  3410. _iteratorError = err;
  3411. } finally {
  3412. try {
  3413. if (!_iteratorNormalCompletion && _iterator.return) {
  3414. _iterator.return();
  3415. }
  3416. } finally {
  3417. if (_didIteratorError) {
  3418. throw _iteratorError;
  3419. }
  3420. }
  3421. }
  3422. return null;
  3423. }
  3424. }]);
  3425. return ObjectExpressionCalleeDataExtractor;
  3426. }();
  3427. exports.ObjectExpressionCalleeDataExtractor = ObjectExpressionCalleeDataExtractor;
  3428. /***/ },
  3429. /* 63 */
  3430. /***/ function(module, exports) {
  3431. "use strict";
  3432. "use strict";
  3433. function AtobTemplate() {
  3434. return "\n (function () {\n var getGlobal = Function('return (function () ' + '{}.constructor(\"return this\")()' + ');');\n\n var object = getGlobal();\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 ";
  3435. }
  3436. exports.AtobTemplate = AtobTemplate;
  3437. /***/ },
  3438. /* 64 */
  3439. /***/ function(module, exports) {
  3440. "use strict";
  3441. "use strict";
  3442. function Rc4Template() {
  3443. return "\n var rc4 = function (str, key) {\n var s = [], j = 0, x, res = '', newStr = '';\n \n str = atob(str);\n \n for (var k = 0, length = str.length; k < length; k++) {\n newStr += '%' + ('00' + str.charCodeAt(k).toString(16)).slice(-2);\n }\n \n str = decodeURIComponent(newStr);\n \t \n\t for (var i = 0; i < 256; i++) {\n s[i] = i;\n }\n \n for (i = 0; i < 256; i++) {\n j = (j + s[i] + key.charCodeAt(i % key.length)) % 256;\n x = s[i];\n s[i] = s[j];\n s[j] = x;\n }\n \n i = 0;\n j = 0;\n \n for (var y = 0; y < str.length; y++) {\n i = (i + 1) % 256;\n j = (j + s[i]) % 256;\n x = s[i];\n s[i] = s[j];\n s[j] = x;\n res += String.fromCharCode(str.charCodeAt(y) ^ s[(s[i] + s[j]) % 256]);\n }\n \n return res;\n }\n ";
  3444. }
  3445. exports.Rc4Template = Rc4Template;
  3446. /***/ },
  3447. /* 65 */
  3448. /***/ function(module, exports) {
  3449. "use strict";
  3450. "use strict";
  3451. function SingleNodeCallControllerTemplate() {
  3452. return "\n var {singleNodeCallControllerFunctionName} = (function(){\n var firstCall = true;\n \n return function (context, fn){\t\n var rfn = firstCall ? function(){\n if(fn){\n var res = fn.apply(context, arguments);\n fn = null;\n return res;\n }\n } : function(){}\n \n firstCall = false;\n \n return rfn;\n }\n })();\n ";
  3453. }
  3454. exports.SingleNodeCallControllerTemplate = SingleNodeCallControllerTemplate;
  3455. /***/ },
  3456. /* 66 */
  3457. /***/ function(module, exports) {
  3458. "use strict";
  3459. "use strict";
  3460. function ConsoleOutputDisableExpressionTemplate() {
  3461. return "\n var {consoleLogDisableFunctionName} = {singleNodeCallControllerFunctionName}(this, function () {\n var getGlobal = Function('return (function() ' + '{}.constructor(\"return this\")( )' + ');');\n \n var func = Function('for ' + '(;;)' + ' {}');\n var that = getGlobal();\n \n that.console.log = func; \n that.console.error = func;\n that.console.warn = func;\n that.console.info = func;\n });\n \n {consoleLogDisableFunctionName}();\n ";
  3462. }
  3463. exports.ConsoleOutputDisableExpressionTemplate = ConsoleOutputDisableExpressionTemplate;
  3464. /***/ },
  3465. /* 67 */
  3466. /***/ function(module, exports) {
  3467. "use strict";
  3468. "use strict";
  3469. function DebugProtectionFunctionCallTemplate() {
  3470. return "{debugProtectionFunctionName}();";
  3471. }
  3472. exports.DebugProtectionFunctionCallTemplate = DebugProtectionFunctionCallTemplate;
  3473. /***/ },
  3474. /* 68 */
  3475. /***/ function(module, exports) {
  3476. "use strict";
  3477. "use strict";
  3478. function DebugProtectionFunctionIntervalTemplate() {
  3479. return "\n setInterval(function () {\n {debugProtectionFunctionName}();\n }, 4000);\n ";
  3480. }
  3481. exports.DebugProtectionFunctionIntervalTemplate = DebugProtectionFunctionIntervalTemplate;
  3482. /***/ },
  3483. /* 69 */
  3484. /***/ function(module, exports, __webpack_require__) {
  3485. "use strict";
  3486. "use strict";
  3487. var Utils_1 = __webpack_require__(0);
  3488. function DebugProtectionFunctionTemplate() {
  3489. 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 ';
  3490. }
  3491. exports.DebugProtectionFunctionTemplate = DebugProtectionFunctionTemplate;
  3492. /***/ },
  3493. /* 70 */
  3494. /***/ function(module, exports) {
  3495. "use strict";
  3496. "use strict";
  3497. function DomainLockNodeTemplate() {
  3498. return "\n var {domainLockFunctionName} = {singleNodeCallControllerFunctionName}(this, function () {\n var getGlobal = Function('return (function () ' + '{}.constructor(\"return this\")()' + ');');\n\n var func = function () { \n return {\n key: 'item',\n value: 'attribute',\n getAttribute: function () {\n getGlobal()['eval']('while(true){}')();\n }()\n };\n };\n \n var regExp = new RegExp(\"[{diff}]\", \"g\");\n var domains = \"{domains}\".replace(regExp, \"\").split(\";\");\n var eval = [][\"forEach\"][\"constructor\"];\n var windowObject = eval(\"return this\")();\n var document;\n var domain;\n \n for (var d in windowObject) {\n if (d.length == 8 && d.charCodeAt(7) == 116 && d.charCodeAt(5) == 101 && d.charCodeAt(3) == 117 && d.charCodeAt(0) == 100) {\n document = d;\n \n break;\n }\n }\n\n for (var d1 in windowObject[document]) {\n if (d1.length == 6 && d1.charCodeAt(5) == 110 && d1.charCodeAt(0) == 100) {\n domain = d1;\n \n break;\n }\n }\n \n if ((!document && !domain) || (!windowObject[document] && !windowObject[document][domain])) {\n return;\n }\n \n var currentDomain = windowObject[document][domain];\n\n var ok = false;\n \n for (var i = 0; i < domains.length; i++) {\n var domain = domains[i];\n var position = currentDomain.length - domain.length;\n var lastIndex = currentDomain.indexOf(domain, position);\n var endsWith = lastIndex !== -1 && lastIndex === position;\n \n if (endsWith) {\n if (currentDomain.length == domain.length || domain.indexOf(\".\") === 0) {\n ok = true;\n }\n \n break;\n }\n }\n \n if (!ok) {\n data;\n } else {\n return;\n }\n \n func();\n });\n\n {domainLockFunctionName}();\n ";
  3499. }
  3500. exports.DomainLockNodeTemplate = DomainLockNodeTemplate;
  3501. /***/ },
  3502. /* 71 */
  3503. /***/ function(module, exports, __webpack_require__) {
  3504. "use strict";
  3505. "use strict";
  3506. var Utils_1 = __webpack_require__(0);
  3507. function SelfDefendingTemplate() {
  3508. return "\n var {selfDefendingFunctionName} = {singleNodeCallControllerFunctionName}(this, function () {\n var func1 = function(){return 'dev';},\n func2 = function () {\n return 'window';\n };\n \n var test1 = function () {\n var regExp = new RegExp(" + Utils_1.Utils.stringToUnicode("\\w+ *\\(\\) *{\\w+ *['|\"].+['|\"];? *}") + ");\n \n return !regExp.test(func1.toString());\n };\n \n var test2 = function () {\n var regExp = new RegExp(" + Utils_1.Utils.stringToUnicode("(\\\\[x|u](\\w){2,4})+") + ");\n \n return regExp.test(func2.toString());\n };\n \n var recursiveFunc1 = function (string) {\n var i = ~-1 >> 1 + 255 % 0;\n \n if (string.indexOf('i' === i)) {\n recursiveFunc2(string)\n }\n };\n \n var recursiveFunc2 = function (string) {\n var i = ~-4 >> 1 + 255 % 0;\n \n if (string.indexOf((true+\"\")[3]) !== i) {\n recursiveFunc1(string)\n }\n };\n \n if (!test1()) {\n if (!test2()) {\n recursiveFunc1('ind\u0435xOf');\n } else {\n recursiveFunc1('indexOf');\n }\n } else {\n recursiveFunc1('ind\u0435xOf');\n }\n })\n \n {selfDefendingFunctionName}();\n ";
  3509. }
  3510. exports.SelfDefendingTemplate = SelfDefendingTemplate;
  3511. /***/ },
  3512. /* 72 */
  3513. /***/ function(module, exports, __webpack_require__) {
  3514. "use strict";
  3515. "use strict";
  3516. var Utils_1 = __webpack_require__(0);
  3517. function SelfDefendingTemplate() {
  3518. return "\n var StatesClass = function (rc4Bytes) {\n this.rc4Bytes = rc4Bytes;\n this.states = [1, 0, 0];\n this.newState = function(){return 'newState';};\n this.firstState = " + Utils_1.Utils.stringToUnicode("\\w+ *\\(\\) *{\\w+ *") + ";\n this.secondState = " + Utils_1.Utils.stringToUnicode("['|\"].+['|\"];? *}") + ";\n };\n \n StatesClass.prototype.checkState = function () {\n var regExp = new RegExp(this.firstState + this.secondState);\n\n return this.runState(regExp.test(this.newState.toString()) ? --this.states[1] : --this.states[0]);\n };\n \n StatesClass.prototype.runState = function (stateResult) {\n if (!Boolean(~stateResult)) {\n return stateResult;\n }\n \n return this.getState(this.rc4Bytes);\n };\n\n StatesClass.prototype.getState = function (rc4Bytes) {\n for (var i = 0, len = this.states.length; i < len; i++) {\n this.states.push(Math.round(Math.random()));\n len = this.states.length;\n }\n \n return rc4Bytes(this.states[0]);\n };\n\n new StatesClass({unicodeArrayCallsWrapperName}).checkState();\n ";
  3519. }
  3520. exports.SelfDefendingTemplate = SelfDefendingTemplate;
  3521. /***/ },
  3522. /* 73 */
  3523. /***/ function(module, exports) {
  3524. "use strict";
  3525. "use strict";
  3526. function UnicodeArrayBase64DecodeNodeTemplate() {
  3527. return " \n if (!{unicodeArrayCallsWrapperName}.atobPolyfillAppended) {\n {atobPolyfill}\n \n {unicodeArrayCallsWrapperName}.atobPolyfillAppended = true;\n }\n \n if (!{unicodeArrayCallsWrapperName}.base64DecodeUnicode) { \n {unicodeArrayCallsWrapperName}.base64DecodeUnicode = function (str) {\n var string = atob(str);\n var newStringChars = [];\n \n for (var i = 0, length = string.length; i < length; i++) {\n newStringChars += '%' + ('00' + string.charCodeAt(i).toString(16)).slice(-2);\n }\n \n return decodeURIComponent(newStringChars);\n };\n }\n \n if (!{unicodeArrayCallsWrapperName}.data) {\n {unicodeArrayCallsWrapperName}.data = {};\n }\n \n if (!{unicodeArrayCallsWrapperName}.data[index]) {\n {selfDefendingCode}\n \n value = {unicodeArrayCallsWrapperName}.base64DecodeUnicode(value);\n {unicodeArrayCallsWrapperName}.data[index] = value;\n } else {\n value = {unicodeArrayCallsWrapperName}.data[index];\n } \n ";
  3528. }
  3529. exports.UnicodeArrayBase64DecodeNodeTemplate = UnicodeArrayBase64DecodeNodeTemplate;
  3530. /***/ },
  3531. /* 74 */
  3532. /***/ function(module, exports) {
  3533. "use strict";
  3534. "use strict";
  3535. function UnicodeArrayCallsWrapperTemplate() {
  3536. return "\n var {unicodeArrayCallsWrapperName} = function (index, key) {\n var index = parseInt(index, 0x10);\n var value = {unicodeArrayName}[index];\n \n {decodeNodeTemplate}\n \n return value;\n };\n ";
  3537. }
  3538. exports.UnicodeArrayCallsWrapperTemplate = UnicodeArrayCallsWrapperTemplate;
  3539. /***/ },
  3540. /* 75 */
  3541. /***/ function(module, exports) {
  3542. "use strict";
  3543. "use strict";
  3544. function UnicodeArrayRc4DecodeNodeTemplate() {
  3545. return "\n if (!{unicodeArrayCallsWrapperName}.atobPolyfillAppended) { \n {atobPolyfill}\n \n {unicodeArrayCallsWrapperName}.atobPolyfillAppended = true;\n }\n \n if (!{unicodeArrayCallsWrapperName}.rc4) { \n {rc4Polyfill}\n \n {unicodeArrayCallsWrapperName}.rc4 = rc4;\n }\n \n if (!{unicodeArrayCallsWrapperName}.data) {\n {unicodeArrayCallsWrapperName}.data = {};\n }\n\n if ({unicodeArrayCallsWrapperName}.data[index] === undefined) {\n if (!{unicodeArrayCallsWrapperName}.once) {\n {selfDefendingCode}\n \n {unicodeArrayCallsWrapperName}.once = true;\n }\n \n value = {unicodeArrayCallsWrapperName}.rc4(value, key);\n {unicodeArrayCallsWrapperName}.data[index] = value;\n } else {\n value = {unicodeArrayCallsWrapperName}.data[index];\n }\n ";
  3546. }
  3547. exports.UnicodeArrayRc4DecodeNodeTemplate = UnicodeArrayRc4DecodeNodeTemplate;
  3548. /***/ },
  3549. /* 76 */
  3550. /***/ function(module, exports) {
  3551. "use strict";
  3552. "use strict";
  3553. function UnicodeArrayTemplate() {
  3554. return "\n var {unicodeArrayName} = [{unicodeArray}];\n ";
  3555. }
  3556. exports.UnicodeArrayTemplate = UnicodeArrayTemplate;
  3557. /***/ },
  3558. /* 77 */
  3559. /***/ function(module, exports, __webpack_require__) {
  3560. "use strict";
  3561. "use strict";
  3562. var Utils_1 = __webpack_require__(0);
  3563. function SelfDefendingTemplate() {
  3564. return "\n var selfDefendingFunc = function () { \n var object = {\n data: {\n key: 'cookie',\n value: 'timeout'\n },\n setCookie: function (options, name, value, document) {\n document = document || {};\n \n var updatedCookie = name + \"=\" + value;\n\n var i = 0;\n \n for (var i = 0, len = options.length; i < len; i++) { \n var propName = options[i];\n \n updatedCookie += \"; \" + propName;\n \n var propValue = options[propName];\n \n options.push(propValue);\n len = options.length;\n \n if (propValue !== true) {\n updatedCookie += \"=\" + propValue;\n }\n }\n\n document['cookie'] = updatedCookie;\n },\n removeCookie: function(){return 'dev';},\n getCookie: function (document, name) { \n document = document || function (value) { return value };\n var matches = document(new RegExp(\n \"(?:^|; )\" + name.replace(/([.$?*|{}()[]\\/+^])/g, '\\$1') + \"=([^;]*)\"\n ));\n \n var func = function (param1, param2) {\n param1(++param2);\n };\n \n func({whileFunctionName}, {timesName});\n \n return matches ? decodeURIComponent(matches[1]) : undefined;\n }\n };\n \n var test1 = function () {\n var regExp = new RegExp(" + Utils_1.Utils.stringToUnicode("\\w+ *\\(\\) *{\\w+ *['|\"].+['|\"];? *}") + ");\n \n return regExp.test(object.removeCookie.toString());\n };\n \n object['updateCookie'] = test1;\n \n var cookie = '';\n var result = object['updateCookie']();\n \n if (!result) {\n object['setCookie'](['*'], 'counter', 1);\n } else if (result) {\n cookie = object['getCookie'](null, 'counter'); \n } else {\n object['removeCookie']();\n }\n };\n \n selfDefendingFunc();\n ";
  3565. }
  3566. exports.SelfDefendingTemplate = SelfDefendingTemplate;
  3567. /***/ },
  3568. /* 78 */
  3569. /***/ function(module, exports) {
  3570. "use strict";
  3571. "use strict";
  3572. function UnicodeArrayRotateFunctionTemplate() {
  3573. 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 ";
  3574. }
  3575. exports.UnicodeArrayRotateFunctionTemplate = UnicodeArrayRotateFunctionTemplate;
  3576. /***/ },
  3577. /* 79 */
  3578. /***/ function(module, exports) {
  3579. "use strict";
  3580. "use strict";
  3581. /***/ },
  3582. /* 80 */
  3583. /***/ function(module, exports) {
  3584. "use strict";
  3585. "use strict";
  3586. /***/ },
  3587. /* 81 */
  3588. /***/ function(module, exports) {
  3589. module.exports = require("chance");
  3590. /***/ },
  3591. /* 82 */
  3592. /***/ function(module, exports) {
  3593. module.exports = require("class-validator");
  3594. /***/ },
  3595. /* 83 */
  3596. /***/ function(module, exports) {
  3597. module.exports = require("commander");
  3598. /***/ },
  3599. /* 84 */
  3600. /***/ function(module, exports) {
  3601. module.exports = require("fs");
  3602. /***/ },
  3603. /* 85 */
  3604. /***/ function(module, exports) {
  3605. module.exports = require("mkdirp");
  3606. /***/ },
  3607. /* 86 */,
  3608. /* 87 */
  3609. /***/ function(module, exports, __webpack_require__) {
  3610. "use strict";
  3611. "use strict";
  3612. var JavaScriptObfuscator_1 = __webpack_require__(10);
  3613. if (!global._babelPolyfill) {
  3614. __webpack_require__(26);
  3615. }
  3616. module.exports = JavaScriptObfuscator_1.JavaScriptObfuscator;
  3617. /***/ }
  3618. /******/ ]);
  3619. //# sourceMappingURL=index.js.map