12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929 |
- /*
- Copyright (C) 2016 Timofey Kachalov <[email protected]>
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
- require("source-map-support").install();
- module.exports =
- /******/ (function(modules) { // webpackBootstrap
- /******/ // The module cache
- /******/ var installedModules = {};
- /******/
- /******/ // The require function
- /******/ function __webpack_require__(moduleId) {
- /******/
- /******/ // Check if module is in cache
- /******/ if(installedModules[moduleId])
- /******/ return installedModules[moduleId].exports;
- /******/
- /******/ // Create a new module (and put it into the cache)
- /******/ var module = installedModules[moduleId] = {
- /******/ i: moduleId,
- /******/ l: false,
- /******/ exports: {}
- /******/ };
- /******/
- /******/ // Execute the module function
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
- /******/
- /******/ // Flag the module as loaded
- /******/ module.l = true;
- /******/
- /******/ // Return the exports of the module
- /******/ return module.exports;
- /******/ }
- /******/
- /******/
- /******/ // expose the modules object (__webpack_modules__)
- /******/ __webpack_require__.m = modules;
- /******/
- /******/ // expose the module cache
- /******/ __webpack_require__.c = installedModules;
- /******/
- /******/ // identity function for calling harmory imports with the correct context
- /******/ __webpack_require__.i = function(value) { return value; };
- /******/
- /******/ // define getter function for harmory exports
- /******/ __webpack_require__.d = function(exports, name, getter) {
- /******/ Object.defineProperty(exports, name, {
- /******/ configurable: false,
- /******/ enumerable: true,
- /******/ get: getter
- /******/ });
- /******/ };
- /******/
- /******/ // getDefaultExport function for compatibility with non-harmony modules
- /******/ __webpack_require__.n = function(module) {
- /******/ var getter = module && module.__esModule ?
- /******/ function getDefault() { return module['default']; } :
- /******/ function getModuleExports() { return module; };
- /******/ __webpack_require__.d(getter, 'a', getter);
- /******/ return getter;
- /******/ };
- /******/
- /******/ // Object.prototype.hasOwnProperty.call
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
- /******/
- /******/ // __webpack_public_path__
- /******/ __webpack_require__.p = "";
- /******/
- /******/ // Load entry module and return exports
- /******/ return __webpack_require__(__webpack_require__.s = 80);
- /******/ })
- /************************************************************************/
- /******/ ([
- /* 0 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- 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; }; }();
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- var chance_1 = __webpack_require__(75);
- var JSFuck_1 = __webpack_require__(19);
- var Utils = function () {
- function Utils() {
- _classCallCheck(this, Utils);
- }
- _createClass(Utils, null, [{
- key: 'arrayContains',
- value: function arrayContains(array, searchElement) {
- return array.indexOf(searchElement) >= 0;
- }
- }, {
- key: 'arrayRotate',
- value: function arrayRotate(array, times) {
- if (!array.length) {
- throw new ReferenceError('Cannot rotate empty array.');
- }
- if (times <= 0) {
- return array;
- }
- var newArray = array,
- temp = void 0;
- while (times--) {
- temp = newArray.pop();
- newArray.unshift(temp);
- }
- return newArray;
- }
- }, {
- key: 'btoa',
- value: function btoa(string) {
- var encode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
- return new Buffer(encode ? encodeURI(string) : string).toString('base64');
- }
- }, {
- key: 'decToHex',
- value: function decToHex(dec) {
- var radix = 16;
- return Number(dec).toString(radix);
- }
- }, {
- key: 'extractDomainFromUrl',
- value: function extractDomainFromUrl(url) {
- var domain = void 0;
- if (url.indexOf('://') > -1 || url.indexOf('//') === 0) {
- domain = url.split('/')[2];
- } else {
- domain = url.split('/')[0];
- }
- domain = domain.split(':')[0];
- return domain;
- }
- }, {
- key: 'getRandomGenerator',
- value: function getRandomGenerator() {
- return Utils.randomGenerator;
- }
- }, {
- key: 'getRandomVariableName',
- value: function getRandomVariableName() {
- var length = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 6;
- var rangeMinInteger = 10000,
- rangeMaxInteger = 99999999,
- prefix = '_0x';
- return '' + prefix + Utils.decToHex(Utils.getRandomGenerator().integer({
- min: rangeMinInteger,
- max: rangeMaxInteger
- })).substr(0, length);
- }
- }, {
- key: 'hideString',
- value: function hideString(str, length) {
- var escapeRegExp = function escapeRegExp(s) {
- return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
- };
- var randomMerge = function randomMerge(s1, s2) {
- var i1 = -1,
- i2 = -1,
- result = '';
- while (i1 < s1.length || i2 < s2.length) {
- if (Math.random() < 0.5 && i2 < s2.length) {
- result += s2.charAt(++i2);
- } else {
- result += s1.charAt(++i1);
- }
- }
- return result;
- };
- var customPool = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
- var randomString = Utils.randomGenerator.string({ length: length, pool: customPool }),
- randomStringDiff = randomString.replace(new RegExp('[' + escapeRegExp(str) + ']', 'g'), ''),
- randomStringDiffArray = randomStringDiff.split('');
- Utils.randomGenerator.shuffle(randomStringDiffArray);
- randomStringDiff = randomStringDiffArray.join('');
- return [randomMerge(str, randomStringDiff), randomStringDiff];
- }
- }, {
- key: 'isInteger',
- value: function isInteger(number) {
- return number % 1 === 0;
- }
- }, {
- key: 'strEnumify',
- value: function strEnumify(obj) {
- return obj;
- }
- }, {
- key: 'stringToJSFuck',
- value: function stringToJSFuck(string) {
- return Array.from(string).map(function (character) {
- return JSFuck_1.JSFuck[character] || character;
- }).join(' + ');
- }
- }, {
- key: 'stringToUnicode',
- value: function stringToUnicode(string) {
- var radix = 16;
- var prefix = void 0,
- regexp = new RegExp('[\x00-\x7F]'),
- template = void 0;
- return '\'' + string.replace(/[\s\S]/g, function (escape) {
- if (regexp.test(escape)) {
- prefix = '\\x';
- template = '0'.repeat(2);
- } else {
- prefix = '\\u';
- template = '0'.repeat(4);
- }
- return '' + prefix + (template + escape.charCodeAt(0).toString(radix)).slice(-template.length);
- }) + '\'';
- }
- }]);
- return Utils;
- }();
- Utils.randomGenerator = new chance_1.Chance();
- exports.Utils = Utils;
- /***/ },
- /* 1 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- 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; }; }();
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- var escodegen = __webpack_require__(11);
- var esprima = __webpack_require__(22);
- var estraverse = __webpack_require__(3);
- var NodeType_1 = __webpack_require__(6);
- var Nodes_1 = __webpack_require__(2);
- var Utils_1 = __webpack_require__(0);
- var NodeUtils = function () {
- function NodeUtils() {
- _classCallCheck(this, NodeUtils);
- }
- _createClass(NodeUtils, null, [{
- key: 'addXVerbatimPropertyToLiterals',
- value: function addXVerbatimPropertyToLiterals(node) {
- NodeUtils.typedReplace(node, NodeType_1.NodeType.Literal, {
- leave: function leave(node) {
- node['x-verbatim-property'] = {
- content: node.raw,
- precedence: escodegen.Precedence.Primary
- };
- }
- });
- }
- }, {
- key: 'appendNode',
- value: function appendNode(blockScopeBody, node) {
- if (!NodeUtils.validateNode(node)) {
- return;
- }
- blockScopeBody.push(node);
- }
- }, {
- key: 'convertCodeToStructure',
- value: function convertCodeToStructure(code) {
- var getBlockStatementNodeByIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
- var structure = esprima.parse(code);
- NodeUtils.addXVerbatimPropertyToLiterals(structure);
- NodeUtils.parentize(structure);
- if (!getBlockStatementNodeByIndex) {
- return structure;
- }
- return NodeUtils.getBlockStatementNodeByIndex(structure);
- }
- }, {
- key: 'getBlockStatementNodeByIndex',
- value: function getBlockStatementNodeByIndex(node) {
- var index = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
- if (Nodes_1.Nodes.isNodeHasBlockStatement(node)) {
- if (node.body[index] === undefined) {
- throw new ReferenceError('Wrong index `' + index + '`. Block-statement body length is `' + node.body.length + '`');
- }
- return node.body[index];
- }
- throw new TypeError('The specified node have no a block-statement');
- }
- }, {
- key: 'getBlockScopeOfNode',
- value: function getBlockScopeOfNode(node) {
- var depth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
- var parentNode = node.parentNode;
- if (!parentNode) {
- throw new ReferenceError('`parentNode` property of given node is `undefined`');
- }
- if (Nodes_1.Nodes.isBlockStatementNode(parentNode)) {
- if (!parentNode.parentNode) {
- throw new ReferenceError('`parentNode` property of `parentNode` of given node is `undefined`');
- }
- if (!Utils_1.Utils.arrayContains(NodeUtils.nodesWithBlockScope, parentNode.parentNode.type)) {
- return NodeUtils.getBlockScopeOfNode(parentNode, depth);
- } else if (depth > 0) {
- return NodeUtils.getBlockScopeOfNode(parentNode, --depth);
- }
- return parentNode;
- }
- if (Nodes_1.Nodes.isProgramNode(parentNode)) {
- return parentNode;
- }
- return NodeUtils.getBlockScopeOfNode(parentNode);
- }
- }, {
- key: 'insertNodeAtIndex',
- value: function insertNodeAtIndex(blockScopeBody, node, index) {
- if (!NodeUtils.validateNode(node)) {
- return;
- }
- blockScopeBody.splice(index, 0, node);
- }
- }, {
- key: 'parentize',
- value: function parentize(node) {
- var isRootNode = true;
- estraverse.replace(node, {
- enter: function enter(node, parentNode) {
- var value = void 0;
- if (isRootNode) {
- if (node.type === NodeType_1.NodeType.Program) {
- value = node;
- } else {
- value = Nodes_1.Nodes.getProgramNode([node]);
- value['parentNode'] = value;
- }
- isRootNode = false;
- } else {
- value = parentNode || node;
- }
- node['parentNode'] = value;
- node['obfuscated'] = false;
- }
- });
- }
- }, {
- key: 'prependNode',
- value: function prependNode(blockScopeBody, node) {
- if (!NodeUtils.validateNode(node)) {
- return;
- }
- blockScopeBody.unshift(node);
- }
- }, {
- key: 'typedReplace',
- value: function typedReplace(node, nodeType, visitor) {
- NodeUtils.typedTraverse(node, nodeType, visitor, 'replace');
- }
- }, {
- key: 'typedTraverse',
- value: function typedTraverse(node, nodeType, visitor) {
- var traverseType = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'traverse';
- estraverse[traverseType](node, {
- enter: function enter(node, parentNode) {
- if (node.type === nodeType && visitor.enter) {
- visitor.enter(node, parentNode);
- }
- },
- leave: function leave(node, parentNode) {
- if (node.type === nodeType && visitor.leave) {
- visitor.leave(node, parentNode);
- }
- }
- });
- }
- }, {
- key: 'validateNode',
- value: function validateNode(node) {
- return !!node && node.hasOwnProperty('type');
- }
- }]);
- return NodeUtils;
- }();
- NodeUtils.nodesWithBlockScope = [NodeType_1.NodeType.ArrowFunctionExpression, NodeType_1.NodeType.FunctionDeclaration, NodeType_1.NodeType.FunctionExpression, NodeType_1.NodeType.MethodDefinition, NodeType_1.NodeType.Program];
- exports.NodeUtils = NodeUtils;
- /***/ },
- /* 2 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- 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; }; }();
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- var NodeType_1 = __webpack_require__(6);
- var Nodes = function () {
- function Nodes() {
- _classCallCheck(this, Nodes);
- }
- _createClass(Nodes, null, [{
- key: 'getProgramNode',
- value: function getProgramNode(bodyNode) {
- return {
- 'type': NodeType_1.NodeType.Program,
- 'body': bodyNode,
- 'sourceType': 'script',
- 'obfuscated': false
- };
- }
- }, {
- key: 'isArrowFunctionExpressionNode',
- value: function isArrowFunctionExpressionNode(node) {
- return node.type === NodeType_1.NodeType.ArrowFunctionExpression;
- }
- }, {
- key: 'isBlockStatementNode',
- value: function isBlockStatementNode(node) {
- return node.type === NodeType_1.NodeType.BlockStatement;
- }
- }, {
- key: 'isCallExpressionNode',
- value: function isCallExpressionNode(node) {
- return node.type === NodeType_1.NodeType.CallExpression;
- }
- }, {
- key: 'isExpressionStatementNode',
- value: function isExpressionStatementNode(node) {
- return node.type === NodeType_1.NodeType.ExpressionStatement;
- }
- }, {
- key: 'isFunctionDeclarationNode',
- value: function isFunctionDeclarationNode(node) {
- return node.type === NodeType_1.NodeType.FunctionDeclaration;
- }
- }, {
- key: 'isFunctionExpressionNode',
- value: function isFunctionExpressionNode(node) {
- return node.type === NodeType_1.NodeType.FunctionExpression;
- }
- }, {
- key: 'isIdentifierNode',
- value: function isIdentifierNode(node) {
- return node.type === NodeType_1.NodeType.Identifier;
- }
- }, {
- key: 'isLiteralNode',
- value: function isLiteralNode(node) {
- return node.type === NodeType_1.NodeType.Literal;
- }
- }, {
- key: 'isMemberExpressionNode',
- value: function isMemberExpressionNode(node) {
- return node.type === NodeType_1.NodeType.MemberExpression;
- }
- }, {
- key: 'isProgramNode',
- value: function isProgramNode(node) {
- return node.type === NodeType_1.NodeType.Program;
- }
- }, {
- key: 'isPropertyNode',
- value: function isPropertyNode(node) {
- return node.type === NodeType_1.NodeType.Property;
- }
- }, {
- key: 'isReplaceableIdentifierNode',
- value: function isReplaceableIdentifierNode(node, parentNode) {
- if (!Nodes.isIdentifierNode(node)) {
- return false;
- }
- var parentNodeIsPropertyNode = Nodes.isPropertyNode(parentNode) && parentNode.key === node;
- var parentNodeIsMemberExpressionNode = Nodes.isMemberExpressionNode(parentNode) && parentNode.computed === false && parentNode.property === node;
- return !parentNodeIsPropertyNode && !parentNodeIsMemberExpressionNode;
- }
- }, {
- key: 'isVariableDeclarationNode',
- value: function isVariableDeclarationNode(node) {
- return node.type === NodeType_1.NodeType.VariableDeclaration;
- }
- }, {
- key: 'isVariableDeclaratorNode',
- value: function isVariableDeclaratorNode(node) {
- return node.type === NodeType_1.NodeType.VariableDeclarator;
- }
- }, {
- key: 'isNodeHasBlockStatement',
- value: function isNodeHasBlockStatement(node) {
- return node.hasOwnProperty('body') && Array.isArray(node.body);
- }
- }]);
- return Nodes;
- }();
- exports.Nodes = Nodes;
- /***/ },
- /* 3 */
- /***/ function(module, exports) {
- module.exports = require("estraverse");
- /***/ },
- /* 4 */
- /***/ function(module, exports) {
- "use strict";
- "use strict";
- (function (AppendState) {
- AppendState[AppendState["AfterObfuscation"] = 0] = "AfterObfuscation";
- AppendState[AppendState["BeforeObfuscation"] = 1] = "BeforeObfuscation";
- })(exports.AppendState || (exports.AppendState = {}));
- var AppendState = exports.AppendState;
- /***/ },
- /* 5 */
- /***/ function(module, exports) {
- "use strict";
- "use strict";
- 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; }; }();
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- var AbstractCustomNode = function () {
- function AbstractCustomNode(options) {
- _classCallCheck(this, AbstractCustomNode);
- this.options = options;
- }
- _createClass(AbstractCustomNode, [{
- key: "getAppendState",
- value: function getAppendState() {
- return this.appendState;
- }
- }, {
- key: "getNode",
- value: function getNode() {
- return this.getNodeStructure();
- }
- }]);
- return AbstractCustomNode;
- }();
- exports.AbstractCustomNode = AbstractCustomNode;
- /***/ },
- /* 6 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- var Utils_1 = __webpack_require__(0);
- exports.NodeType = Utils_1.Utils.strEnumify({
- ArrayExpression: 'ArrayExpression',
- ArrowFunctionExpression: 'ArrowFunctionExpression',
- AssignmentExpression: 'AssignmentExpression',
- BinaryExpression: 'BinaryExpression',
- BlockStatement: 'BlockStatement',
- CallExpression: 'CallExpression',
- CatchClause: 'CatchClause',
- ClassDeclaration: 'ClassDeclaration',
- ExpressionStatement: 'ExpressionStatement',
- FunctionDeclaration: 'FunctionDeclaration',
- FunctionExpression: 'FunctionExpression',
- Identifier: 'Identifier',
- IfStatement: 'IfStatement',
- Literal: 'Literal',
- LogicalExpression: 'LogicalExpression',
- MemberExpression: 'MemberExpression',
- MethodDefinition: 'MethodDefinition',
- ObjectExpression: 'ObjectExpression',
- Program: 'Program',
- Property: 'Property',
- ReturnStatement: 'ReturnStatement',
- TryStatement: 'TryStatement',
- UnaryExpression: 'UnaryExpression',
- UpdateExpression: 'UpdateExpression',
- VariableDeclaration: 'VariableDeclaration',
- VariableDeclarator: 'VariableDeclarator',
- WhileStatement: 'WhileStatement'
- });
- /***/ },
- /* 7 */
- /***/ function(module, exports) {
- "use strict";
- "use strict";
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- var AbstractNodeObfuscator = function AbstractNodeObfuscator(nodes, options) {
- _classCallCheck(this, AbstractNodeObfuscator);
- this.nodes = nodes;
- this.options = options;
- };
- exports.AbstractNodeObfuscator = AbstractNodeObfuscator;
- /***/ },
- /* 8 */
- /***/ function(module, exports) {
- module.exports = require("format-unicorn");
- /***/ },
- /* 9 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- 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; }; }();
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- var JavaScriptObfuscatorCLI_1 = __webpack_require__(30);
- var JavaScriptObfuscatorInternal_1 = __webpack_require__(25);
- var JavaScriptObfuscator = function () {
- function JavaScriptObfuscator() {
- _classCallCheck(this, JavaScriptObfuscator);
- }
- _createClass(JavaScriptObfuscator, null, [{
- key: 'obfuscate',
- value: function obfuscate(sourceCode) {
- var obfuscatorOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var javaScriptObfuscator = new JavaScriptObfuscatorInternal_1.JavaScriptObfuscatorInternal(sourceCode, obfuscatorOptions);
- javaScriptObfuscator.obfuscate();
- return javaScriptObfuscator.getObfuscationResult();
- }
- }, {
- key: 'runCLI',
- value: function runCLI(argv) {
- new JavaScriptObfuscatorCLI_1.JavaScriptObfuscatorCLI(argv).run();
- }
- }]);
- return JavaScriptObfuscator;
- }();
- exports.JavaScriptObfuscator = JavaScriptObfuscator;
- /***/ },
- /* 10 */
- /***/ function(module, exports) {
- "use strict";
- "use strict";
- 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; }; }();
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- var AbstractNodesGroup = function () {
- function AbstractNodesGroup(options) {
- _classCallCheck(this, AbstractNodesGroup);
- this.nodes = new Map();
- this.options = options;
- }
- _createClass(AbstractNodesGroup, [{
- key: "getNodes",
- value: function getNodes() {
- return this.nodes;
- }
- }]);
- return AbstractNodesGroup;
- }();
- exports.AbstractNodesGroup = AbstractNodesGroup;
- /***/ },
- /* 11 */
- /***/ function(module, exports) {
- module.exports = require("escodegen");
- /***/ },
- /* 12 */
- /***/ function(module, exports) {
- "use strict";
- "use strict";
- exports.SourceMapMode = {
- Inline: 'inline',
- Separate: 'separate'
- };
- /***/ },
- /* 13 */
- /***/ function(module, exports) {
- "use strict";
- "use strict";
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- var AbstractReplacer = function AbstractReplacer(nodes, options) {
- _classCallCheck(this, AbstractReplacer);
- this.nodes = nodes;
- this.options = options;
- };
- exports.AbstractReplacer = AbstractReplacer;
- /***/ },
- /* 14 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- 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; }; }();
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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; }
- 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; }
- var AbstractReplacer_1 = __webpack_require__(13);
- var Utils_1 = __webpack_require__(0);
- var IdentifierReplacer = function (_AbstractReplacer_1$A) {
- _inherits(IdentifierReplacer, _AbstractReplacer_1$A);
- function IdentifierReplacer() {
- _classCallCheck(this, IdentifierReplacer);
- var _this = _possibleConstructorReturn(this, (IdentifierReplacer.__proto__ || Object.getPrototypeOf(IdentifierReplacer)).apply(this, arguments));
- _this.namesMap = new Map();
- return _this;
- }
- _createClass(IdentifierReplacer, [{
- key: 'replace',
- value: function replace(nodeValue) {
- var obfuscatedIdentifierName = this.namesMap.get(nodeValue);
- if (!obfuscatedIdentifierName) {
- return nodeValue;
- }
- return obfuscatedIdentifierName;
- }
- }, {
- key: 'storeNames',
- value: function storeNames(nodeName) {
- if (!this.isReservedName(nodeName)) {
- this.namesMap.set(nodeName, Utils_1.Utils.getRandomVariableName());
- }
- }
- }, {
- key: 'isReservedName',
- value: function isReservedName(name) {
- return this.options.reservedNames.some(function (reservedName) {
- return new RegExp(reservedName, 'g').test(name);
- });
- }
- }]);
- return IdentifierReplacer;
- }(AbstractReplacer_1.AbstractReplacer);
- exports.IdentifierReplacer = IdentifierReplacer;
- /***/ },
- /* 15 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- 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; }; }();
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- var NodeUtils_1 = __webpack_require__(1);
- var StackTraceAnalyzer_1 = __webpack_require__(58);
- var Utils_1 = __webpack_require__(0);
- var CustomNodeAppender = function () {
- function CustomNodeAppender() {
- _classCallCheck(this, CustomNodeAppender);
- }
- _createClass(CustomNodeAppender, null, [{
- key: 'appendNode',
- value: function appendNode(blockScopeBody, node) {
- var index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
- var blockScopeTraceData = new StackTraceAnalyzer_1.StackTraceAnalyzer(blockScopeBody).analyze();
- var targetBlockScopeBody = void 0;
- if (!blockScopeTraceData.length) {
- targetBlockScopeBody = blockScopeBody;
- } else {
- targetBlockScopeBody = CustomNodeAppender.getOptimalBlockScopeBody(blockScopeTraceData, index);
- }
- NodeUtils_1.NodeUtils.prependNode(targetBlockScopeBody, node);
- }
- }, {
- key: 'getIndexByThreshold',
- value: function getIndexByThreshold(blockStatementBodyLength) {
- var threshold = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.1;
- if (threshold < 0 || threshold > 1) {
- throw new RangeError('`threshold` parameter should has value between 0 and 1');
- }
- return Utils_1.Utils.getRandomGenerator().integer({
- min: 0,
- max: Math.round(blockStatementBodyLength * threshold)
- });
- }
- }, {
- key: 'getOptimalBlockScopeBody',
- value: function getOptimalBlockScopeBody(blockScopeTraceData, index) {
- var firstCall = blockScopeTraceData[index];
- if (firstCall.stackTrace.length) {
- return CustomNodeAppender.getOptimalBlockScopeBody(firstCall.stackTrace, 0);
- } else {
- return firstCall.callee.body;
- }
- }
- }]);
- return CustomNodeAppender;
- }();
- exports.CustomNodeAppender = CustomNodeAppender;
- /***/ },
- /* 16 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- 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; }; }();
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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; }
- 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; }
- var AbstractReplacer_1 = __webpack_require__(13);
- var NumberLiteralReplacer_1 = __webpack_require__(20);
- var Utils_1 = __webpack_require__(0);
- var StringLiteralReplacer = function (_AbstractReplacer_1$A) {
- _inherits(StringLiteralReplacer, _AbstractReplacer_1$A);
- function StringLiteralReplacer() {
- _classCallCheck(this, StringLiteralReplacer);
- return _possibleConstructorReturn(this, (StringLiteralReplacer.__proto__ || Object.getPrototypeOf(StringLiteralReplacer)).apply(this, arguments));
- }
- _createClass(StringLiteralReplacer, [{
- key: 'replace',
- value: function replace(nodeValue) {
- var replaceWithUnicodeArrayFlag = Math.random() <= this.options.unicodeArrayThreshold;
- if (this.options.encodeUnicodeLiterals && replaceWithUnicodeArrayFlag) {
- nodeValue = Utils_1.Utils.btoa(nodeValue);
- }
- nodeValue = Utils_1.Utils.stringToUnicode(nodeValue);
- if (this.options.unicodeArray && replaceWithUnicodeArrayFlag) {
- return this.replaceStringLiteralWithUnicodeArrayCall(nodeValue);
- }
- return nodeValue;
- }
- }, {
- key: 'replaceStringLiteralWithUnicodeArrayCall',
- value: function replaceStringLiteralWithUnicodeArrayCall(value) {
- var unicodeArrayNode = this.nodes.get('unicodeArrayNode');
- if (!unicodeArrayNode) {
- throw new ReferenceError('`unicodeArrayNode` node is not found in Map with custom nodes.');
- }
- var unicodeArray = unicodeArrayNode.getNodeData(),
- indexOfExistingValue = unicodeArray.getIndexOf(value),
- indexOfValue = void 0,
- hexadecimalIndex = void 0;
- if (indexOfExistingValue >= 0) {
- indexOfValue = indexOfExistingValue;
- } else {
- indexOfValue = unicodeArray.getLength();
- unicodeArrayNode.updateNodeData(value);
- }
- hexadecimalIndex = new NumberLiteralReplacer_1.NumberLiteralReplacer(this.nodes, this.options).replace(indexOfValue);
- if (this.options.wrapUnicodeArrayCalls) {
- var unicodeArrayCallsWrapper = this.nodes.get('unicodeArrayCallsWrapper');
- if (!unicodeArrayCallsWrapper) {
- throw new ReferenceError('`unicodeArrayCallsWrapper` node is not found in Map with custom nodes.');
- }
- return unicodeArrayCallsWrapper.getNodeIdentifier() + '(\'' + hexadecimalIndex + '\')';
- }
- return unicodeArrayNode.getNodeIdentifier() + '[' + hexadecimalIndex + ']';
- }
- }]);
- return StringLiteralReplacer;
- }(AbstractReplacer_1.AbstractReplacer);
- exports.StringLiteralReplacer = StringLiteralReplacer;
- /***/ },
- /* 17 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- var SourceMapMode_1 = __webpack_require__(12);
- exports.NO_CUSTOM_NODES_PRESET = Object.freeze({
- compact: true,
- debugProtection: false,
- debugProtectionInterval: false,
- disableConsoleOutput: false,
- domainLock: [],
- encodeUnicodeLiterals: false,
- reservedNames: [],
- rotateUnicodeArray: false,
- selfDefending: false,
- sourceMap: false,
- sourceMapBaseUrl: '',
- sourceMapFileName: '',
- sourceMapMode: SourceMapMode_1.SourceMapMode.Separate,
- unicodeArray: false,
- unicodeArrayThreshold: 0,
- wrapUnicodeArrayCalls: false
- });
- /***/ },
- /* 18 */
- /***/ function(module, exports) {
- "use strict";
- "use strict";
- 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; }; }();
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- var ObfuscationResult = function () {
- function ObfuscationResult(obfuscatedCode, sourceMap) {
- _classCallCheck(this, ObfuscationResult);
- this.obfuscatedCode = obfuscatedCode;
- this.sourceMap = sourceMap;
- }
- _createClass(ObfuscationResult, [{
- key: "getObfuscatedCode",
- value: function getObfuscatedCode() {
- return this.obfuscatedCode;
- }
- }, {
- key: "getSourceMap",
- value: function getSourceMap() {
- return this.sourceMap;
- }
- }, {
- key: "toString",
- value: function toString() {
- return this.obfuscatedCode;
- }
- }]);
- return ObfuscationResult;
- }();
- exports.ObfuscationResult = ObfuscationResult;
- /***/ },
- /* 19 */
- /***/ function(module, exports) {
- "use strict";
- "use strict";
- exports.JSFuck = {
- Window: '[]["filter"]["constructor"]("return this")()',
- False: '![]',
- True: '!![]',
- a: '(false+"")[1]',
- b: '([]["entries"]()+"")[2]',
- c: '([]["fill"]+"")[3]',
- d: '(undefined+"")[2]',
- e: '(true+"")[3]',
- f: '(false+"")[0]',
- g: '(false+[0]+String)[20]',
- h: '(+(101))["toString"](21)[1]',
- i: '([false]+undefined)[10]',
- j: '([]["entries"]()+"")[3]',
- k: '(+(20))["toString"](21)',
- l: '(false+"")[2]',
- m: '(Number+"")[11]',
- n: '(undefined+"")[1]',
- o: '(true+[]["fill"])[10]',
- p: '(+(211))["toString"](31)[1]',
- q: '(+(212))["toString"](31)[1]',
- r: '(true+"")[1]',
- s: '(false+"")[3]',
- t: '(true+"")[0]',
- u: '(undefined+"")[0]',
- v: '(+(31))["toString"](32)',
- w: '(+(32))["toString"](33)',
- x: '(+(101))["toString"](34)[1]',
- y: '(NaN+[Infinity])[10]',
- z: '(+(35))["toString"](36)',
- A: '(+[]+Array)[10]',
- B: '(+[]+Boolean)[10]',
- C: 'Function("return escape")()(("")["italics"]())[2]',
- D: 'Function("return escape")()([]["fill"])["slice"]("-1")',
- E: '(RegExp+"")[12]',
- F: '(+[]+Function)[10]',
- G: '(false+Function("return Date")()())[30]',
- H: '\'H\'',
- I: '(Infinity+"")[0]',
- J: '\'J\'',
- K: '\'K\'',
- L: '\'L\'',
- M: '(true+Function("return Date")()())[30]',
- N: '(NaN+"")[0]',
- O: '(NaN+Function("return{}")())[11]',
- P: '\'P\'',
- Q: '\'Q\'',
- R: '(+[]+RegExp)[10]',
- S: '(+[]+String)[10]',
- T: '(NaN+Function("return Date")()())[30]',
- U: '(NaN+Function("return{}")()["toString"]["call"]())[11]',
- V: '\'V\'',
- W: '\'W\'',
- X: '\'X\'',
- Y: '\'Y\'',
- Z: '\'Z\''
- };
- /***/ },
- /* 20 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- 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; }; }();
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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; }
- 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; }
- var AbstractReplacer_1 = __webpack_require__(13);
- var Utils_1 = __webpack_require__(0);
- var NumberLiteralReplacer = function (_AbstractReplacer_1$A) {
- _inherits(NumberLiteralReplacer, _AbstractReplacer_1$A);
- function NumberLiteralReplacer() {
- _classCallCheck(this, NumberLiteralReplacer);
- return _possibleConstructorReturn(this, (NumberLiteralReplacer.__proto__ || Object.getPrototypeOf(NumberLiteralReplacer)).apply(this, arguments));
- }
- _createClass(NumberLiteralReplacer, [{
- key: 'replace',
- value: function replace(nodeValue) {
- var prefix = '0x';
- if (!Utils_1.Utils.isInteger(nodeValue)) {
- return String(nodeValue);
- }
- return '' + prefix + Utils_1.Utils.decToHex(nodeValue);
- }
- }]);
- return NumberLiteralReplacer;
- }(AbstractReplacer_1.AbstractReplacer);
- exports.NumberLiteralReplacer = NumberLiteralReplacer;
- /***/ },
- /* 21 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- var SourceMapMode_1 = __webpack_require__(12);
- exports.DEFAULT_PRESET = Object.freeze({
- compact: true,
- debugProtection: false,
- debugProtectionInterval: false,
- disableConsoleOutput: true,
- domainLock: [],
- encodeUnicodeLiterals: false,
- reservedNames: [],
- rotateUnicodeArray: true,
- selfDefending: true,
- sourceMap: false,
- sourceMapBaseUrl: '',
- sourceMapFileName: '',
- sourceMapMode: SourceMapMode_1.SourceMapMode.Separate,
- unicodeArray: true,
- unicodeArrayThreshold: 0.8,
- wrapUnicodeArrayCalls: true
- });
- /***/ },
- /* 22 */
- /***/ function(module, exports) {
- module.exports = require("esprima");
- /***/ },
- /* 23 */
- /***/ function(module, exports) {
- module.exports = require("path");
- /***/ },
- /* 24 */
- /***/ function(module, exports) {
- module.exports = require("babel-polyfill");
- /***/ },
- /* 25 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- 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; }; }();
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- var esprima = __webpack_require__(22);
- var escodegen = __webpack_require__(11);
- var ObfuscationResult_1 = __webpack_require__(18);
- var Obfuscator_1 = __webpack_require__(26);
- var Options_1 = __webpack_require__(55);
- var SourceMapCorrector_1 = __webpack_require__(27);
- var JavaScriptObfuscatorInternal = function () {
- function JavaScriptObfuscatorInternal(sourceCode) {
- var obfuscatorOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- _classCallCheck(this, JavaScriptObfuscatorInternal);
- this.sourceCode = sourceCode;
- this.options = new Options_1.Options(obfuscatorOptions);
- }
- _createClass(JavaScriptObfuscatorInternal, [{
- key: 'getObfuscationResult',
- value: function getObfuscationResult() {
- 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();
- }
- }, {
- key: 'obfuscate',
- value: function obfuscate() {
- var astTree = esprima.parse(this.sourceCode, {
- loc: true
- });
- astTree = new Obfuscator_1.Obfuscator(this.options).obfuscateNode(astTree);
- this.generatorOutput = JavaScriptObfuscatorInternal.generateCode(this.sourceCode, astTree, this.options);
- }
- }], [{
- key: 'generateCode',
- value: function generateCode(sourceCode, astTree, options) {
- var escodegenParams = Object.assign({}, JavaScriptObfuscatorInternal.escodegenParams);
- if (options.sourceMap) {
- escodegenParams.sourceMap = 'sourceMap';
- escodegenParams.sourceContent = sourceCode;
- }
- escodegenParams.format = {
- compact: options.compact
- };
- var generatorOutput = escodegen.generate(astTree, escodegenParams);
- generatorOutput.map = generatorOutput.map ? generatorOutput.map.toString() : '';
- return generatorOutput;
- }
- }]);
- return JavaScriptObfuscatorInternal;
- }();
- JavaScriptObfuscatorInternal.escodegenParams = {
- verbatim: 'x-verbatim-property',
- sourceMapWithCode: true
- };
- exports.JavaScriptObfuscatorInternal = JavaScriptObfuscatorInternal;
- /***/ },
- /* 26 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- 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; }; }();
- 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); } }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- var estraverse = __webpack_require__(3);
- var AppendState_1 = __webpack_require__(4);
- var NodeType_1 = __webpack_require__(6);
- var CatchClauseObfuscator_1 = __webpack_require__(46);
- var ConsoleOutputNodesGroup_1 = __webpack_require__(41);
- var DebugProtectionNodesGroup_1 = __webpack_require__(42);
- var DomainLockNodesGroup_1 = __webpack_require__(43);
- var FunctionDeclarationObfuscator_1 = __webpack_require__(47);
- var FunctionObfuscator_1 = __webpack_require__(48);
- var LiteralObfuscator_1 = __webpack_require__(49);
- var MemberExpressionObfuscator_1 = __webpack_require__(50);
- var MethodDefinitionObfuscator_1 = __webpack_require__(51);
- var Nodes_1 = __webpack_require__(2);
- var NodeUtils_1 = __webpack_require__(1);
- var ObjectExpressionObfuscator_1 = __webpack_require__(52);
- var SelfDefendingNodesGroup_1 = __webpack_require__(44);
- var UnicodeArrayNodesGroup_1 = __webpack_require__(45);
- var VariableDeclarationObfuscator_1 = __webpack_require__(53);
- var Obfuscator = function () {
- function Obfuscator(options) {
- _classCallCheck(this, Obfuscator);
- this.nodeObfuscators = new Map([[NodeType_1.NodeType.ArrowFunctionExpression, [FunctionObfuscator_1.FunctionObfuscator]], [NodeType_1.NodeType.ClassDeclaration, [FunctionDeclarationObfuscator_1.FunctionDeclarationObfuscator]], [NodeType_1.NodeType.CatchClause, [CatchClauseObfuscator_1.CatchClauseObfuscator]], [NodeType_1.NodeType.FunctionDeclaration, [FunctionDeclarationObfuscator_1.FunctionDeclarationObfuscator, FunctionObfuscator_1.FunctionObfuscator]], [NodeType_1.NodeType.FunctionExpression, [FunctionObfuscator_1.FunctionObfuscator]], [NodeType_1.NodeType.MemberExpression, [MemberExpressionObfuscator_1.MemberExpressionObfuscator]], [NodeType_1.NodeType.MethodDefinition, [MethodDefinitionObfuscator_1.MethodDefinitionObfuscator]], [NodeType_1.NodeType.ObjectExpression, [ObjectExpressionObfuscator_1.ObjectExpressionObfuscator]], [NodeType_1.NodeType.VariableDeclaration, [VariableDeclarationObfuscator_1.VariableDeclarationObfuscator]], [NodeType_1.NodeType.Literal, [LiteralObfuscator_1.LiteralObfuscator]]]);
- this.options = options;
- this.nodes = new Map([].concat(_toConsumableArray(new DomainLockNodesGroup_1.DomainLockNodesGroup(this.options).getNodes()), _toConsumableArray(new SelfDefendingNodesGroup_1.SelfDefendingNodesGroup(this.options).getNodes()), _toConsumableArray(new ConsoleOutputNodesGroup_1.ConsoleOutputNodesGroup(this.options).getNodes()), _toConsumableArray(new DebugProtectionNodesGroup_1.DebugProtectionNodesGroup(this.options).getNodes()), _toConsumableArray(new UnicodeArrayNodesGroup_1.UnicodeArrayNodesGroup(this.options).getNodes())));
- }
- _createClass(Obfuscator, [{
- key: 'obfuscateNode',
- value: function obfuscateNode(node) {
- if (Nodes_1.Nodes.isProgramNode(node) && !node.body.length) {
- return node;
- }
- NodeUtils_1.NodeUtils.parentize(node);
- this.beforeObfuscation(node);
- this.obfuscate(node);
- this.afterObfuscation(node);
- return node;
- }
- }, {
- key: 'afterObfuscation',
- value: function afterObfuscation(astTree) {
- this.nodes.forEach(function (node) {
- if (node.getAppendState() === AppendState_1.AppendState.AfterObfuscation) {
- node.appendNode(astTree);
- }
- });
- }
- }, {
- key: 'beforeObfuscation',
- value: function beforeObfuscation(astTree) {
- this.nodes.forEach(function (node) {
- if (node.getAppendState() === AppendState_1.AppendState.BeforeObfuscation) {
- node.appendNode(astTree);
- }
- });
- }
- }, {
- key: 'initializeNodeObfuscators',
- value: function initializeNodeObfuscators(node, parentNode) {
- var _this = this;
- var nodeObfuscators = this.nodeObfuscators.get(node.type);
- if (!nodeObfuscators) {
- return;
- }
- nodeObfuscators.forEach(function (obfuscator) {
- new obfuscator(_this.nodes, _this.options).obfuscateNode(node, parentNode);
- });
- }
- }, {
- key: 'obfuscate',
- value: function obfuscate(node) {
- var _this2 = this;
- estraverse.replace(node, {
- enter: function enter(node, parentNode) {
- _this2.initializeNodeObfuscators(node, parentNode);
- }
- });
- }
- }]);
- return Obfuscator;
- }();
- exports.Obfuscator = Obfuscator;
- /***/ },
- /* 27 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- 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; }; }();
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- var SourceMapMode_1 = __webpack_require__(12);
- var ObfuscationResult_1 = __webpack_require__(18);
- var Utils_1 = __webpack_require__(0);
- var SourceMapCorrector = function () {
- function SourceMapCorrector(obfuscationResult, sourceMapUrl, sourceMapMode) {
- _classCallCheck(this, SourceMapCorrector);
- this.obfuscatedCode = obfuscationResult.getObfuscatedCode();
- this.sourceMap = obfuscationResult.getSourceMap();
- this.sourceMapUrl = sourceMapUrl;
- this.sourceMapMode = sourceMapMode;
- }
- _createClass(SourceMapCorrector, [{
- key: 'correct',
- value: function correct() {
- return new ObfuscationResult_1.ObfuscationResult(this.correctObfuscatedCode(), this.sourceMap);
- }
- }, {
- key: 'correctObfuscatedCode',
- value: function correctObfuscatedCode() {
- if (!this.sourceMap) {
- return this.obfuscatedCode;
- }
- var sourceMappingUrl = '//# sourceMappingURL=';
- switch (this.sourceMapMode) {
- case SourceMapMode_1.SourceMapMode.Inline:
- sourceMappingUrl += 'data:application/json;base64,' + Utils_1.Utils.btoa(this.sourceMap, false);
- break;
- case SourceMapMode_1.SourceMapMode.Separate:
- default:
- if (!this.sourceMapUrl) {
- return this.obfuscatedCode;
- }
- sourceMappingUrl += this.sourceMapUrl;
- break;
- }
- return this.obfuscatedCode + '\n' + sourceMappingUrl;
- }
- }]);
- return SourceMapCorrector;
- }();
- exports.SourceMapCorrector = SourceMapCorrector;
- /***/ },
- /* 28 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- 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; }; }();
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- var Utils_1 = __webpack_require__(0);
- var UnicodeArray = function () {
- function UnicodeArray() {
- _classCallCheck(this, UnicodeArray);
- this.array = [];
- }
- _createClass(UnicodeArray, [{
- key: "addToArray",
- value: function addToArray(value) {
- this.array.push(value);
- }
- }, {
- key: "getArray",
- value: function getArray() {
- return this.array;
- }
- }, {
- key: "getIndexOf",
- value: function getIndexOf(value) {
- return this.array.indexOf(value);
- }
- }, {
- key: "getLength",
- value: function getLength() {
- return this.array.length;
- }
- }, {
- key: "rotateArray",
- value: function rotateArray(rotationValue) {
- this.array = Utils_1.Utils.arrayRotate(this.array, rotationValue);
- }
- }, {
- key: "toString",
- value: function toString() {
- return this.array.toString();
- }
- }]);
- return UnicodeArray;
- }();
- exports.UnicodeArray = UnicodeArray;
- /***/ },
- /* 29 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- 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; }; }();
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- var fs = __webpack_require__(78);
- var mkdirp = __webpack_require__(79);
- var path = __webpack_require__(23);
- var Utils_1 = __webpack_require__(0);
- var CLIUtils = function () {
- function CLIUtils() {
- _classCallCheck(this, CLIUtils);
- }
- _createClass(CLIUtils, null, [{
- key: 'getOutputCodePath',
- value: function getOutputCodePath(outputPath, inputPath) {
- if (outputPath) {
- return outputPath;
- }
- return inputPath.split('.').map(function (value, index) {
- return index === 0 ? value + '-obfuscated' : value;
- }).join('.');
- }
- }, {
- key: 'getOutputSourceMapPath',
- value: function getOutputSourceMapPath(outputCodePath) {
- var sourceMapFileName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
- if (sourceMapFileName) {
- outputCodePath = outputCodePath.substr(0, outputCodePath.lastIndexOf('/')) + '/' + sourceMapFileName;
- }
- if (!/\.js\.map$/.test(outputCodePath)) {
- outputCodePath = outputCodePath.split('.')[0] + '.js.map';
- } else if (/\.js$/.test(outputCodePath)) {
- outputCodePath += '.map';
- }
- return outputCodePath;
- }
- }, {
- key: 'getPackageConfig',
- value: function getPackageConfig() {
- return JSON.parse(fs.readFileSync(path.join(path.dirname(fs.realpathSync(process.argv[1])), '../package.json'), CLIUtils.encoding));
- }
- }, {
- key: 'isFilePath',
- value: function isFilePath(filePath) {
- try {
- return fs.statSync(filePath).isFile();
- } catch (e) {
- return false;
- }
- }
- }, {
- key: 'readFile',
- value: function readFile(inputPath) {
- return fs.readFileSync(inputPath, CLIUtils.encoding);
- }
- }, {
- key: 'validateInputPath',
- value: function validateInputPath(inputPath) {
- if (!CLIUtils.isFilePath(inputPath)) {
- throw new ReferenceError('Given input path must be a valid file path');
- }
- if (!Utils_1.Utils.arrayContains(CLIUtils.availableInputExtensions, path.extname(inputPath))) {
- throw new ReferenceError('Input file must have .js extension');
- }
- }
- }, {
- key: 'writeFile',
- value: function writeFile(outputPath, data) {
- mkdirp.sync(path.dirname(outputPath));
- fs.writeFileSync(outputPath, data, {
- encoding: CLIUtils.encoding
- });
- }
- }]);
- return CLIUtils;
- }();
- CLIUtils.availableInputExtensions = ['.js'];
- CLIUtils.encoding = 'utf8';
- exports.CLIUtils = CLIUtils;
- /***/ },
- /* 30 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- 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; }; }();
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- var commander = __webpack_require__(77);
- var path = __webpack_require__(23);
- var SourceMapMode_1 = __webpack_require__(12);
- var DefaultPreset_1 = __webpack_require__(21);
- var CLIUtils_1 = __webpack_require__(29);
- var JavaScriptObfuscator_1 = __webpack_require__(9);
- var Utils_1 = __webpack_require__(0);
- var JavaScriptObfuscatorCLI = function () {
- function JavaScriptObfuscatorCLI(argv) {
- _classCallCheck(this, JavaScriptObfuscatorCLI);
- this.data = '';
- this.rawArguments = argv;
- this.arguments = this.rawArguments.slice(2);
- }
- _createClass(JavaScriptObfuscatorCLI, [{
- key: 'run',
- value: function run() {
- this.configureCommands();
- if (!this.arguments.length || Utils_1.Utils.arrayContains(this.arguments, '--help')) {
- this.commands.outputHelp();
- return;
- }
- this.inputPath = this.arguments[0];
- CLIUtils_1.CLIUtils.validateInputPath(this.inputPath);
- this.getData();
- this.processData();
- }
- }, {
- key: 'buildOptions',
- value: function buildOptions() {
- var obfuscatorOptions = {},
- availableOptions = Object.keys(DefaultPreset_1.DEFAULT_PRESET);
- for (var option in this.commands) {
- if (!this.commands.hasOwnProperty(option)) {
- continue;
- }
- if (!Utils_1.Utils.arrayContains(availableOptions, option)) {
- continue;
- }
- obfuscatorOptions[option] = this.commands[option];
- }
- return Object.assign({}, DefaultPreset_1.DEFAULT_PRESET, obfuscatorOptions);
- }
- }, {
- key: 'configureCommands',
- value: function configureCommands() {
- this.commands = new commander.Command().version(JavaScriptObfuscatorCLI.getBuildVersion(), '-v, --version').usage('<inputPath> [options]').option('-o, --output <path>', 'Output path for obfuscated code').option('--compact <boolean>', 'Disable one line output code compacting', JavaScriptObfuscatorCLI.parseBoolean).option('--debugProtection <boolean>', 'Disable browser Debug panel (can cause DevTools enabled browser freeze)', JavaScriptObfuscatorCLI.parseBoolean).option('--debugProtectionInterval <boolean>', 'Disable browser Debug panel even after page was loaded (can cause DevTools enabled browser freeze)', JavaScriptObfuscatorCLI.parseBoolean).option('--disableConsoleOutput <boolean>', 'Allow console.log, console.info, console.error and console.warn messages output into browser console', JavaScriptObfuscatorCLI.parseBoolean).option('--encodeUnicodeLiterals <boolean>', 'All literals in Unicode array become encoded in Base64 (this option can slightly slow down your code speed)', JavaScriptObfuscatorCLI.parseBoolean).option('--reservedNames <list>', 'Disable obfuscation of variable names, function names and names of function parameters that match the passed RegExp patterns (comma separated)', function (val) {
- return val.split(',');
- }).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('--unicodeArrayThreshold <number>', 'The probability that the literal string will be inserted into unicodeArray (Default: 0.8, Min: 0, Max: 1)', parseFloat).option('--wrapUnicodeArrayCalls <boolean>', 'Disables usage of special access function instead of direct array call', JavaScriptObfuscatorCLI.parseBoolean).option('--domainLock <list>', 'Blocks the execution of the code in domains that do not match the passed RegExp patterns (comma separated)', function (val) {
- return val.split(',');
- }).parse(this.rawArguments);
- this.commands.on('--help', function () {
- console.log(' Examples:\n');
- console.log(' %> javascript-obfuscator in.js --compact true --selfDefending false');
- console.log(' %> javascript-obfuscator in.js --output out.js --compact true --selfDefending false');
- console.log('');
- });
- }
- }, {
- key: 'getData',
- value: function getData() {
- this.data = CLIUtils_1.CLIUtils.readFile(this.inputPath);
- }
- }, {
- key: 'processData',
- value: function processData() {
- var options = this.buildOptions(),
- outputCodePath = CLIUtils_1.CLIUtils.getOutputCodePath(this.commands.output, this.inputPath);
- if (options.sourceMap) {
- this.processDataWithSourceMap(outputCodePath, options);
- } else {
- this.processDataWithoutSourceMap(outputCodePath, options);
- }
- }
- }, {
- key: 'processDataWithoutSourceMap',
- value: function processDataWithoutSourceMap(outputCodePath, options) {
- var obfuscatedCode = JavaScriptObfuscator_1.JavaScriptObfuscator.obfuscate(this.data, options).getObfuscatedCode();
- CLIUtils_1.CLIUtils.writeFile(outputCodePath, obfuscatedCode);
- }
- }, {
- key: 'processDataWithSourceMap',
- value: function processDataWithSourceMap(outputCodePath, options) {
- var outputSourceMapPath = CLIUtils_1.CLIUtils.getOutputSourceMapPath(outputCodePath, options.sourceMapFileName || '');
- options.sourceMapFileName = path.basename(outputSourceMapPath);
- var obfuscationResult = JavaScriptObfuscator_1.JavaScriptObfuscator.obfuscate(this.data, options);
- CLIUtils_1.CLIUtils.writeFile(outputCodePath, obfuscationResult.getObfuscatedCode());
- if (options.sourceMapMode === 'separate' && obfuscationResult.getSourceMap()) {
- CLIUtils_1.CLIUtils.writeFile(outputSourceMapPath, obfuscationResult.getSourceMap());
- }
- }
- }], [{
- key: 'getBuildVersion',
- value: function getBuildVersion() {
- return CLIUtils_1.CLIUtils.getPackageConfig().version;
- }
- }, {
- key: 'parseBoolean',
- value: function parseBoolean(value) {
- return value === 'true' || value === '1';
- }
- }, {
- key: 'parseSourceMapMode',
- value: function parseSourceMapMode(value) {
- var availableMode = Object.keys(SourceMapMode_1.SourceMapMode).some(function (key) {
- return SourceMapMode_1.SourceMapMode[key] === value;
- });
- if (!availableMode) {
- throw new ReferenceError('Invalid value of `--sourceMapMode` option');
- }
- return value;
- }
- }]);
- return JavaScriptObfuscatorCLI;
- }();
- exports.JavaScriptObfuscatorCLI = JavaScriptObfuscatorCLI;
- /***/ },
- /* 31 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- 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; }; }();
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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; }
- 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; }
- var AppendState_1 = __webpack_require__(4);
- var ConsoleOutputDisableExpressionTemplate_1 = __webpack_require__(62);
- var AbstractCustomNode_1 = __webpack_require__(5);
- var CustomNodeAppender_1 = __webpack_require__(15);
- var NodeUtils_1 = __webpack_require__(1);
- var ConsoleOutputDisableExpressionNode = function (_AbstractCustomNode_) {
- _inherits(ConsoleOutputDisableExpressionNode, _AbstractCustomNode_);
- function ConsoleOutputDisableExpressionNode() {
- _classCallCheck(this, ConsoleOutputDisableExpressionNode);
- var _this = _possibleConstructorReturn(this, (ConsoleOutputDisableExpressionNode.__proto__ || Object.getPrototypeOf(ConsoleOutputDisableExpressionNode)).apply(this, arguments));
- _this.appendState = AppendState_1.AppendState.BeforeObfuscation;
- return _this;
- }
- _createClass(ConsoleOutputDisableExpressionNode, [{
- key: 'appendNode',
- value: function appendNode(blockScopeNode) {
- CustomNodeAppender_1.CustomNodeAppender.appendNode(blockScopeNode.body, this.getNode(), CustomNodeAppender_1.CustomNodeAppender.getIndexByThreshold(blockScopeNode.body.length));
- }
- }, {
- key: 'getNodeStructure',
- value: function getNodeStructure() {
- return NodeUtils_1.NodeUtils.convertCodeToStructure(ConsoleOutputDisableExpressionTemplate_1.ConsoleOutputDisableExpressionTemplate());
- }
- }]);
- return ConsoleOutputDisableExpressionNode;
- }(AbstractCustomNode_1.AbstractCustomNode);
- exports.ConsoleOutputDisableExpressionNode = ConsoleOutputDisableExpressionNode;
- /***/ },
- /* 32 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- 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; }; }();
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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; }
- 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; }
- __webpack_require__(8);
- var AppendState_1 = __webpack_require__(4);
- var DebufProtectionFunctionCallTemplate_1 = __webpack_require__(63);
- var AbstractCustomNode_1 = __webpack_require__(5);
- var NodeUtils_1 = __webpack_require__(1);
- var DebugProtectionFunctionCallNode = function (_AbstractCustomNode_) {
- _inherits(DebugProtectionFunctionCallNode, _AbstractCustomNode_);
- function DebugProtectionFunctionCallNode(debugProtectionFunctionName, options) {
- _classCallCheck(this, DebugProtectionFunctionCallNode);
- var _this = _possibleConstructorReturn(this, (DebugProtectionFunctionCallNode.__proto__ || Object.getPrototypeOf(DebugProtectionFunctionCallNode)).call(this, options));
- _this.appendState = AppendState_1.AppendState.BeforeObfuscation;
- _this.debugProtectionFunctionName = debugProtectionFunctionName;
- return _this;
- }
- _createClass(DebugProtectionFunctionCallNode, [{
- key: 'appendNode',
- value: function appendNode(blockScopeNode) {
- NodeUtils_1.NodeUtils.appendNode(blockScopeNode.body, this.getNode());
- }
- }, {
- key: 'getNodeStructure',
- value: function getNodeStructure() {
- return NodeUtils_1.NodeUtils.convertCodeToStructure(DebufProtectionFunctionCallTemplate_1.DebugProtectionFunctionCallTemplate().formatUnicorn({
- debugProtectionFunctionName: this.debugProtectionFunctionName
- }));
- }
- }]);
- return DebugProtectionFunctionCallNode;
- }(AbstractCustomNode_1.AbstractCustomNode);
- exports.DebugProtectionFunctionCallNode = DebugProtectionFunctionCallNode;
- /***/ },
- /* 33 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- 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; }; }();
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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; }
- 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; }
- __webpack_require__(8);
- var AppendState_1 = __webpack_require__(4);
- var DebugProtectionFunctionIntervalTemplate_1 = __webpack_require__(64);
- var AbstractCustomNode_1 = __webpack_require__(5);
- var NodeUtils_1 = __webpack_require__(1);
- var DebugProtectionFunctionIntervalNode = function (_AbstractCustomNode_) {
- _inherits(DebugProtectionFunctionIntervalNode, _AbstractCustomNode_);
- function DebugProtectionFunctionIntervalNode(debugProtectionFunctionName, options) {
- _classCallCheck(this, DebugProtectionFunctionIntervalNode);
- var _this = _possibleConstructorReturn(this, (DebugProtectionFunctionIntervalNode.__proto__ || Object.getPrototypeOf(DebugProtectionFunctionIntervalNode)).call(this, options));
- _this.appendState = AppendState_1.AppendState.BeforeObfuscation;
- _this.debugProtectionFunctionName = debugProtectionFunctionName;
- return _this;
- }
- _createClass(DebugProtectionFunctionIntervalNode, [{
- key: 'appendNode',
- value: function appendNode(blockScopeNode) {
- NodeUtils_1.NodeUtils.appendNode(blockScopeNode.body, this.getNode());
- }
- }, {
- key: 'getNodeStructure',
- value: function getNodeStructure() {
- return NodeUtils_1.NodeUtils.convertCodeToStructure(DebugProtectionFunctionIntervalTemplate_1.DebugProtectionFunctionIntervalTemplate().formatUnicorn({
- debugProtectionFunctionName: this.debugProtectionFunctionName
- }));
- }
- }]);
- return DebugProtectionFunctionIntervalNode;
- }(AbstractCustomNode_1.AbstractCustomNode);
- exports.DebugProtectionFunctionIntervalNode = DebugProtectionFunctionIntervalNode;
- /***/ },
- /* 34 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- 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; }; }();
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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; }
- 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; }
- __webpack_require__(8);
- var AppendState_1 = __webpack_require__(4);
- var DebugProtectionFunctionTemplate_1 = __webpack_require__(65);
- var AbstractCustomNode_1 = __webpack_require__(5);
- var NodeUtils_1 = __webpack_require__(1);
- var Utils_1 = __webpack_require__(0);
- var DebugProtectionFunctionNode = function (_AbstractCustomNode_) {
- _inherits(DebugProtectionFunctionNode, _AbstractCustomNode_);
- function DebugProtectionFunctionNode(debugProtectionFunctionName, options) {
- _classCallCheck(this, DebugProtectionFunctionNode);
- var _this = _possibleConstructorReturn(this, (DebugProtectionFunctionNode.__proto__ || Object.getPrototypeOf(DebugProtectionFunctionNode)).call(this, options));
- _this.appendState = AppendState_1.AppendState.BeforeObfuscation;
- _this.debugProtectionFunctionName = debugProtectionFunctionName;
- return _this;
- }
- _createClass(DebugProtectionFunctionNode, [{
- key: 'appendNode',
- value: function appendNode(blockScopeNode) {
- var programBodyLength = blockScopeNode.body.length,
- randomIndex = Utils_1.Utils.getRandomGenerator().integer({
- min: 0,
- max: programBodyLength
- });
- NodeUtils_1.NodeUtils.insertNodeAtIndex(blockScopeNode.body, this.getNode(), randomIndex);
- }
- }, {
- key: 'getNodeIdentifier',
- value: function getNodeIdentifier() {
- return this.debugProtectionFunctionName;
- }
- }, {
- key: 'getNodeStructure',
- value: function getNodeStructure() {
- return NodeUtils_1.NodeUtils.convertCodeToStructure(DebugProtectionFunctionTemplate_1.DebugProtectionFunctionTemplate().formatUnicorn({
- debugProtectionFunctionName: this.debugProtectionFunctionName
- }));
- }
- }]);
- return DebugProtectionFunctionNode;
- }(AbstractCustomNode_1.AbstractCustomNode);
- exports.DebugProtectionFunctionNode = DebugProtectionFunctionNode;
- /***/ },
- /* 35 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- 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"); } }; }();
- 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; }; }();
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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; }
- 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; }
- __webpack_require__(8);
- var AppendState_1 = __webpack_require__(4);
- var DomainLockNodeTemplate_1 = __webpack_require__(66);
- var AbstractCustomNode_1 = __webpack_require__(5);
- var CustomNodeAppender_1 = __webpack_require__(15);
- var NodeUtils_1 = __webpack_require__(1);
- var Utils_1 = __webpack_require__(0);
- var DomainLockNode = function (_AbstractCustomNode_) {
- _inherits(DomainLockNode, _AbstractCustomNode_);
- function DomainLockNode() {
- _classCallCheck(this, DomainLockNode);
- var _this = _possibleConstructorReturn(this, (DomainLockNode.__proto__ || Object.getPrototypeOf(DomainLockNode)).apply(this, arguments));
- _this.appendState = AppendState_1.AppendState.BeforeObfuscation;
- return _this;
- }
- _createClass(DomainLockNode, [{
- key: 'appendNode',
- value: function appendNode(blockScopeNode) {
- CustomNodeAppender_1.CustomNodeAppender.appendNode(blockScopeNode.body, this.getNode(), CustomNodeAppender_1.CustomNodeAppender.getIndexByThreshold(blockScopeNode.body.length));
- }
- }, {
- key: 'getNodeStructure',
- value: function getNodeStructure() {
- var domainsString = this.options.domainLock.join(';');
- var _Utils_1$Utils$hideSt = Utils_1.Utils.hideString(domainsString, domainsString.length * 3);
- var _Utils_1$Utils$hideSt2 = _slicedToArray(_Utils_1$Utils$hideSt, 2);
- var hiddenDomainsString = _Utils_1$Utils$hideSt2[0];
- var diff = _Utils_1$Utils$hideSt2[1];
- return NodeUtils_1.NodeUtils.convertCodeToStructure(DomainLockNodeTemplate_1.DomainLockNodeTemplate().formatUnicorn({
- diff: diff,
- domains: hiddenDomainsString
- }));
- }
- }]);
- return DomainLockNode;
- }(AbstractCustomNode_1.AbstractCustomNode);
- exports.DomainLockNode = DomainLockNode;
- /***/ },
- /* 36 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- 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; }; }();
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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; }
- 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; }
- var AppendState_1 = __webpack_require__(4);
- var NoCustomNodesPreset_1 = __webpack_require__(17);
- var SelfDefendingTemplate_1 = __webpack_require__(67);
- var AbstractCustomNode_1 = __webpack_require__(5);
- var JavaScriptObfuscator_1 = __webpack_require__(9);
- var NodeUtils_1 = __webpack_require__(1);
- var CustomNodeAppender_1 = __webpack_require__(15);
- var SelfDefendingUnicodeNode = function (_AbstractCustomNode_) {
- _inherits(SelfDefendingUnicodeNode, _AbstractCustomNode_);
- function SelfDefendingUnicodeNode() {
- _classCallCheck(this, SelfDefendingUnicodeNode);
- var _this = _possibleConstructorReturn(this, (SelfDefendingUnicodeNode.__proto__ || Object.getPrototypeOf(SelfDefendingUnicodeNode)).apply(this, arguments));
- _this.appendState = AppendState_1.AppendState.AfterObfuscation;
- return _this;
- }
- _createClass(SelfDefendingUnicodeNode, [{
- key: 'appendNode',
- value: function appendNode(blockScopeNode) {
- CustomNodeAppender_1.CustomNodeAppender.appendNode(blockScopeNode.body, this.getNode(), CustomNodeAppender_1.CustomNodeAppender.getIndexByThreshold(blockScopeNode.body.length));
- }
- }, {
- key: 'getNodeStructure',
- value: function getNodeStructure() {
- return NodeUtils_1.NodeUtils.convertCodeToStructure(JavaScriptObfuscator_1.JavaScriptObfuscator.obfuscate(SelfDefendingTemplate_1.SelfDefendingTemplate(), NoCustomNodesPreset_1.NO_CUSTOM_NODES_PRESET).getObfuscatedCode());
- }
- }]);
- return SelfDefendingUnicodeNode;
- }(AbstractCustomNode_1.AbstractCustomNode);
- exports.SelfDefendingUnicodeNode = SelfDefendingUnicodeNode;
- /***/ },
- /* 37 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- 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; }; }();
- 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); } };
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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; }
- 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; }
- __webpack_require__(8);
- var AppendState_1 = __webpack_require__(4);
- var UnicodeArrayCallsWrapperTemplate_1 = __webpack_require__(68);
- var AbstractCustomNode_1 = __webpack_require__(5);
- var NodeUtils_1 = __webpack_require__(1);
- var Utils_1 = __webpack_require__(0);
- var UnicodeArrayCallsWrapper = function (_AbstractCustomNode_) {
- _inherits(UnicodeArrayCallsWrapper, _AbstractCustomNode_);
- function UnicodeArrayCallsWrapper(unicodeArrayCallsWrapperName, unicodeArrayName, unicodeArray, options) {
- _classCallCheck(this, UnicodeArrayCallsWrapper);
- var _this = _possibleConstructorReturn(this, (UnicodeArrayCallsWrapper.__proto__ || Object.getPrototypeOf(UnicodeArrayCallsWrapper)).call(this, options));
- _this.appendState = AppendState_1.AppendState.AfterObfuscation;
- _this.unicodeArrayCallsWrapperName = unicodeArrayCallsWrapperName;
- _this.unicodeArrayName = unicodeArrayName;
- _this.unicodeArray = unicodeArray;
- return _this;
- }
- _createClass(UnicodeArrayCallsWrapper, [{
- key: 'appendNode',
- value: function appendNode(blockScopeNode) {
- if (!this.unicodeArray.getLength()) {
- return;
- }
- NodeUtils_1.NodeUtils.insertNodeAtIndex(blockScopeNode.body, this.getNode(), 1);
- }
- }, {
- key: 'getNodeIdentifier',
- value: function getNodeIdentifier() {
- return this.unicodeArrayCallsWrapperName;
- }
- }, {
- key: 'getNode',
- value: function getNode() {
- return _get(UnicodeArrayCallsWrapper.prototype.__proto__ || Object.getPrototypeOf(UnicodeArrayCallsWrapper.prototype), 'getNode', this).call(this);
- }
- }, {
- key: 'getNodeStructure',
- value: function getNodeStructure() {
- var keyName = Utils_1.Utils.getRandomVariableName();
- return NodeUtils_1.NodeUtils.convertCodeToStructure(UnicodeArrayCallsWrapperTemplate_1.UnicodeArrayCallsWrapperTemplate().formatUnicorn({
- keyName: keyName,
- unicodeArrayCallsWrapperName: this.unicodeArrayCallsWrapperName,
- unicodeArrayName: this.unicodeArrayName
- }));
- }
- }]);
- return UnicodeArrayCallsWrapper;
- }(AbstractCustomNode_1.AbstractCustomNode);
- exports.UnicodeArrayCallsWrapper = UnicodeArrayCallsWrapper;
- /***/ },
- /* 38 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- 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; }; }();
- 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); } };
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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; }
- 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; }
- __webpack_require__(8);
- var AppendState_1 = __webpack_require__(4);
- var NoCustomNodesPreset_1 = __webpack_require__(17);
- var AtobTemplate_1 = __webpack_require__(61);
- var SelfDefendingTemplate_1 = __webpack_require__(69);
- var UnicodeArrayDecodeNodeTemplate_1 = __webpack_require__(70);
- var AbstractCustomNode_1 = __webpack_require__(5);
- var JavaScriptObfuscator_1 = __webpack_require__(9);
- var NodeUtils_1 = __webpack_require__(1);
- var UnicodeArrayDecodeNode = function (_AbstractCustomNode_) {
- _inherits(UnicodeArrayDecodeNode, _AbstractCustomNode_);
- function UnicodeArrayDecodeNode(unicodeArrayName, unicodeArray, options) {
- _classCallCheck(this, UnicodeArrayDecodeNode);
- var _this = _possibleConstructorReturn(this, (UnicodeArrayDecodeNode.__proto__ || Object.getPrototypeOf(UnicodeArrayDecodeNode)).call(this, options));
- _this.appendState = AppendState_1.AppendState.AfterObfuscation;
- _this.unicodeArrayName = unicodeArrayName;
- _this.unicodeArray = unicodeArray;
- return _this;
- }
- _createClass(UnicodeArrayDecodeNode, [{
- key: 'appendNode',
- value: function appendNode(blockScopeNode) {
- if (!this.unicodeArray.getLength()) {
- return;
- }
- NodeUtils_1.NodeUtils.insertNodeAtIndex(blockScopeNode.body, this.getNode(), 1);
- }
- }, {
- key: 'getNode',
- value: function getNode() {
- return _get(UnicodeArrayDecodeNode.prototype.__proto__ || Object.getPrototypeOf(UnicodeArrayDecodeNode.prototype), 'getNode', this).call(this);
- }
- }, {
- key: 'getNodeStructure',
- value: function getNodeStructure() {
- var forLoopFunctionName = 'forLoopFunc';
- var code = void 0;
- if (this.options.selfDefending) {
- code = SelfDefendingTemplate_1.SelfDefendingTemplate().formatUnicorn({
- forLoopFunctionName: forLoopFunctionName,
- unicodeArrayName: this.unicodeArrayName
- });
- } else {
- code = forLoopFunctionName + '();';
- }
- return NodeUtils_1.NodeUtils.convertCodeToStructure(JavaScriptObfuscator_1.JavaScriptObfuscator.obfuscate(UnicodeArrayDecodeNodeTemplate_1.UnicodeArrayDecodeNodeTemplate().formatUnicorn({
- atobPolyfill: AtobTemplate_1.AtobTemplate(),
- code: code,
- forLoopFunctionName: forLoopFunctionName,
- unicodeArrayName: this.unicodeArrayName
- }), NoCustomNodesPreset_1.NO_CUSTOM_NODES_PRESET).getObfuscatedCode());
- }
- }]);
- return UnicodeArrayDecodeNode;
- }(AbstractCustomNode_1.AbstractCustomNode);
- exports.UnicodeArrayDecodeNode = UnicodeArrayDecodeNode;
- /***/ },
- /* 39 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- 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; }; }();
- 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); } };
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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; }
- 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; }
- __webpack_require__(8);
- var AppendState_1 = __webpack_require__(4);
- var UnicodeArrayTemplate_1 = __webpack_require__(71);
- var AbstractCustomNode_1 = __webpack_require__(5);
- var NodeUtils_1 = __webpack_require__(1);
- var UnicodeArrayNode = function (_AbstractCustomNode_) {
- _inherits(UnicodeArrayNode, _AbstractCustomNode_);
- function UnicodeArrayNode(unicodeArray, unicodeArrayName) {
- var unicodeArrayRotateValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
- var options = arguments[3];
- _classCallCheck(this, UnicodeArrayNode);
- var _this = _possibleConstructorReturn(this, (UnicodeArrayNode.__proto__ || Object.getPrototypeOf(UnicodeArrayNode)).call(this, options));
- _this.appendState = AppendState_1.AppendState.AfterObfuscation;
- _this.unicodeArray = unicodeArray;
- _this.unicodeArrayName = unicodeArrayName;
- _this.unicodeArrayRotateValue = unicodeArrayRotateValue;
- return _this;
- }
- _createClass(UnicodeArrayNode, [{
- key: 'appendNode',
- value: function appendNode(blockScopeNode) {
- if (!this.unicodeArray.getLength()) {
- return;
- }
- NodeUtils_1.NodeUtils.prependNode(blockScopeNode.body, this.getNode());
- }
- }, {
- key: 'getNodeIdentifier',
- value: function getNodeIdentifier() {
- return this.unicodeArrayName;
- }
- }, {
- key: 'getNodeData',
- value: function getNodeData() {
- return this.unicodeArray;
- }
- }, {
- key: 'getNode',
- value: function getNode() {
- this.unicodeArray.rotateArray(this.unicodeArrayRotateValue);
- return _get(UnicodeArrayNode.prototype.__proto__ || Object.getPrototypeOf(UnicodeArrayNode.prototype), 'getNode', this).call(this);
- }
- }, {
- key: 'updateNodeData',
- value: function updateNodeData(data) {
- this.unicodeArray.addToArray(data);
- }
- }, {
- key: 'getNodeStructure',
- value: function getNodeStructure() {
- return NodeUtils_1.NodeUtils.convertCodeToStructure(UnicodeArrayTemplate_1.UnicodeArrayTemplate().formatUnicorn({
- unicodeArrayName: this.unicodeArrayName,
- unicodeArray: this.unicodeArray.toString()
- }));
- }
- }]);
- return UnicodeArrayNode;
- }(AbstractCustomNode_1.AbstractCustomNode);
- UnicodeArrayNode.UNICODE_ARRAY_RANDOM_LENGTH = 4;
- exports.UnicodeArrayNode = UnicodeArrayNode;
- /***/ },
- /* 40 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- 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; }; }();
- 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); } };
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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; }
- 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; }
- __webpack_require__(8);
- var AppendState_1 = __webpack_require__(4);
- var NoCustomNodesPreset_1 = __webpack_require__(17);
- var SelfDefendingTemplate_1 = __webpack_require__(72);
- var UnicodeArrayRotateFunctionTemplate_1 = __webpack_require__(73);
- var AbstractCustomNode_1 = __webpack_require__(5);
- var JavaScriptObfuscator_1 = __webpack_require__(9);
- var NodeUtils_1 = __webpack_require__(1);
- var Utils_1 = __webpack_require__(0);
- var UnicodeArrayRotateFunctionNode = function (_AbstractCustomNode_) {
- _inherits(UnicodeArrayRotateFunctionNode, _AbstractCustomNode_);
- function UnicodeArrayRotateFunctionNode(unicodeArrayName, unicodeArray, unicodeArrayRotateValue, options) {
- _classCallCheck(this, UnicodeArrayRotateFunctionNode);
- var _this = _possibleConstructorReturn(this, (UnicodeArrayRotateFunctionNode.__proto__ || Object.getPrototypeOf(UnicodeArrayRotateFunctionNode)).call(this, options));
- _this.appendState = AppendState_1.AppendState.AfterObfuscation;
- _this.unicodeArrayName = unicodeArrayName;
- _this.unicodeArray = unicodeArray;
- _this.unicodeArrayRotateValue = unicodeArrayRotateValue;
- return _this;
- }
- _createClass(UnicodeArrayRotateFunctionNode, [{
- key: 'appendNode',
- value: function appendNode(blockScopeNode) {
- if (!this.unicodeArray.getLength()) {
- return;
- }
- NodeUtils_1.NodeUtils.insertNodeAtIndex(blockScopeNode.body, this.getNode(), 1);
- }
- }, {
- key: 'getNode',
- value: function getNode() {
- return _get(UnicodeArrayRotateFunctionNode.prototype.__proto__ || Object.getPrototypeOf(UnicodeArrayRotateFunctionNode.prototype), 'getNode', this).call(this);
- }
- }, {
- key: 'getNodeStructure',
- value: function getNodeStructure() {
- var code = '',
- timesName = Utils_1.Utils.getRandomVariableName(),
- whileFunctionName = Utils_1.Utils.getRandomVariableName();
- if (this.options.selfDefending) {
- code = SelfDefendingTemplate_1.SelfDefendingTemplate().formatUnicorn({
- timesName: timesName,
- whileFunctionName: whileFunctionName
- });
- } else {
- code = whileFunctionName + '(++' + timesName + ')';
- }
- return NodeUtils_1.NodeUtils.convertCodeToStructure(JavaScriptObfuscator_1.JavaScriptObfuscator.obfuscate(UnicodeArrayRotateFunctionTemplate_1.UnicodeArrayRotateFunctionTemplate().formatUnicorn({
- code: code,
- timesName: timesName,
- unicodeArrayName: this.unicodeArrayName,
- unicodeArrayRotateValue: Utils_1.Utils.decToHex(this.unicodeArrayRotateValue),
- whileFunctionName: whileFunctionName
- }), NoCustomNodesPreset_1.NO_CUSTOM_NODES_PRESET).getObfuscatedCode());
- }
- }]);
- return UnicodeArrayRotateFunctionNode;
- }(AbstractCustomNode_1.AbstractCustomNode);
- exports.UnicodeArrayRotateFunctionNode = UnicodeArrayRotateFunctionNode;
- /***/ },
- /* 41 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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; }
- 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; }
- var AbstractNodesGroup_1 = __webpack_require__(10);
- var ConsoleOutputDisableExpressionNode_1 = __webpack_require__(31);
- var ConsoleOutputNodesGroup = function (_AbstractNodesGroup_) {
- _inherits(ConsoleOutputNodesGroup, _AbstractNodesGroup_);
- function ConsoleOutputNodesGroup(options) {
- _classCallCheck(this, ConsoleOutputNodesGroup);
- var _this = _possibleConstructorReturn(this, (ConsoleOutputNodesGroup.__proto__ || Object.getPrototypeOf(ConsoleOutputNodesGroup)).call(this, options));
- if (!_this.options.disableConsoleOutput) {
- return _possibleConstructorReturn(_this);
- }
- _this.nodes.set('consoleOutputDisableExpressionNode', new ConsoleOutputDisableExpressionNode_1.ConsoleOutputDisableExpressionNode(_this.options));
- return _this;
- }
- return ConsoleOutputNodesGroup;
- }(AbstractNodesGroup_1.AbstractNodesGroup);
- exports.ConsoleOutputNodesGroup = ConsoleOutputNodesGroup;
- /***/ },
- /* 42 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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; }
- 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; }
- var DebugProtectionFunctionCallNode_1 = __webpack_require__(32);
- var DebugProtectionFunctionIntervalNode_1 = __webpack_require__(33);
- var DebugProtectionFunctionNode_1 = __webpack_require__(34);
- var AbstractNodesGroup_1 = __webpack_require__(10);
- var Utils_1 = __webpack_require__(0);
- var DebugProtectionNodesGroup = function (_AbstractNodesGroup_) {
- _inherits(DebugProtectionNodesGroup, _AbstractNodesGroup_);
- function DebugProtectionNodesGroup(options) {
- _classCallCheck(this, DebugProtectionNodesGroup);
- var _this = _possibleConstructorReturn(this, (DebugProtectionNodesGroup.__proto__ || Object.getPrototypeOf(DebugProtectionNodesGroup)).call(this, options));
- _this.debugProtectionFunctionIdentifier = Utils_1.Utils.getRandomVariableName();
- if (!_this.options.debugProtection) {
- return _possibleConstructorReturn(_this);
- }
- _this.nodes.set('debugProtectionFunctionNode', new DebugProtectionFunctionNode_1.DebugProtectionFunctionNode(_this.debugProtectionFunctionIdentifier, _this.options));
- _this.nodes.set('debugProtectionFunctionCallNode', new DebugProtectionFunctionCallNode_1.DebugProtectionFunctionCallNode(_this.debugProtectionFunctionIdentifier, _this.options));
- if (_this.options.debugProtectionInterval) {
- _this.nodes.set('debugProtectionFunctionIntervalNode', new DebugProtectionFunctionIntervalNode_1.DebugProtectionFunctionIntervalNode(_this.debugProtectionFunctionIdentifier, _this.options));
- }
- return _this;
- }
- return DebugProtectionNodesGroup;
- }(AbstractNodesGroup_1.AbstractNodesGroup);
- exports.DebugProtectionNodesGroup = DebugProtectionNodesGroup;
- /***/ },
- /* 43 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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; }
- 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; }
- var AbstractNodesGroup_1 = __webpack_require__(10);
- var DomainLockNode_1 = __webpack_require__(35);
- var DomainLockNodesGroup = function (_AbstractNodesGroup_) {
- _inherits(DomainLockNodesGroup, _AbstractNodesGroup_);
- function DomainLockNodesGroup(options) {
- _classCallCheck(this, DomainLockNodesGroup);
- var _this = _possibleConstructorReturn(this, (DomainLockNodesGroup.__proto__ || Object.getPrototypeOf(DomainLockNodesGroup)).call(this, options));
- if (!_this.options.domainLock.length) {
- return _possibleConstructorReturn(_this);
- }
- _this.nodes.set('DomainLockNode', new DomainLockNode_1.DomainLockNode(_this.options));
- return _this;
- }
- return DomainLockNodesGroup;
- }(AbstractNodesGroup_1.AbstractNodesGroup);
- exports.DomainLockNodesGroup = DomainLockNodesGroup;
- /***/ },
- /* 44 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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; }
- 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; }
- var AbstractNodesGroup_1 = __webpack_require__(10);
- var SelfDefendingUnicodeNode_1 = __webpack_require__(36);
- var SelfDefendingNodesGroup = function (_AbstractNodesGroup_) {
- _inherits(SelfDefendingNodesGroup, _AbstractNodesGroup_);
- function SelfDefendingNodesGroup(options) {
- _classCallCheck(this, SelfDefendingNodesGroup);
- var _this = _possibleConstructorReturn(this, (SelfDefendingNodesGroup.__proto__ || Object.getPrototypeOf(SelfDefendingNodesGroup)).call(this, options));
- if (!_this.options.selfDefending) {
- return _possibleConstructorReturn(_this);
- }
- _this.nodes.set('selfDefendingUnicodeNode', new SelfDefendingUnicodeNode_1.SelfDefendingUnicodeNode(_this.options));
- return _this;
- }
- return SelfDefendingNodesGroup;
- }(AbstractNodesGroup_1.AbstractNodesGroup);
- exports.SelfDefendingNodesGroup = SelfDefendingNodesGroup;
- /***/ },
- /* 45 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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; }
- 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; }
- var AbstractNodesGroup_1 = __webpack_require__(10);
- var UnicodeArray_1 = __webpack_require__(28);
- var UnicodeArrayCallsWrapper_1 = __webpack_require__(37);
- var UnicodeArrayDecodeNode_1 = __webpack_require__(38);
- var UnicodeArrayNode_1 = __webpack_require__(39);
- var UnicodeArrayRotateFunctionNode_1 = __webpack_require__(40);
- var Utils_1 = __webpack_require__(0);
- var UnicodeArrayNodesGroup = function (_AbstractNodesGroup_) {
- _inherits(UnicodeArrayNodesGroup, _AbstractNodesGroup_);
- function UnicodeArrayNodesGroup(options) {
- _classCallCheck(this, UnicodeArrayNodesGroup);
- var _this = _possibleConstructorReturn(this, (UnicodeArrayNodesGroup.__proto__ || Object.getPrototypeOf(UnicodeArrayNodesGroup)).call(this, options));
- _this.unicodeArrayName = Utils_1.Utils.getRandomVariableName(UnicodeArrayNode_1.UnicodeArrayNode.UNICODE_ARRAY_RANDOM_LENGTH);
- _this.unicodeArrayTranslatorName = Utils_1.Utils.getRandomVariableName(UnicodeArrayNode_1.UnicodeArrayNode.UNICODE_ARRAY_RANDOM_LENGTH);
- if (!_this.options.unicodeArray) {
- return _possibleConstructorReturn(_this);
- }
- if (_this.options.rotateUnicodeArray) {
- _this.unicodeArrayRotateValue = Utils_1.Utils.getRandomGenerator().integer({
- min: 100,
- max: 500
- });
- } else {
- _this.unicodeArrayRotateValue = 0;
- }
- var unicodeArray = new UnicodeArray_1.UnicodeArray(),
- unicodeArrayNode = new UnicodeArrayNode_1.UnicodeArrayNode(unicodeArray, _this.unicodeArrayName, _this.unicodeArrayRotateValue, _this.options);
- _this.nodes.set('unicodeArrayNode', unicodeArrayNode);
- if (_this.options.wrapUnicodeArrayCalls) {
- _this.nodes.set('unicodeArrayCallsWrapper', new UnicodeArrayCallsWrapper_1.UnicodeArrayCallsWrapper(_this.unicodeArrayTranslatorName, _this.unicodeArrayName, unicodeArray, _this.options));
- }
- if (_this.options.encodeUnicodeLiterals) {
- _this.nodes.set('unicodeArrayDecodeNode', new UnicodeArrayDecodeNode_1.UnicodeArrayDecodeNode(_this.unicodeArrayName, unicodeArray, _this.options));
- }
- if (_this.options.rotateUnicodeArray) {
- _this.nodes.set('unicodeArrayRotateFunctionNode', new UnicodeArrayRotateFunctionNode_1.UnicodeArrayRotateFunctionNode(_this.unicodeArrayName, unicodeArray, _this.unicodeArrayRotateValue, _this.options));
- }
- return _this;
- }
- return UnicodeArrayNodesGroup;
- }(AbstractNodesGroup_1.AbstractNodesGroup);
- exports.UnicodeArrayNodesGroup = UnicodeArrayNodesGroup;
- /***/ },
- /* 46 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- 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; }; }();
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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; }
- 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; }
- var estraverse = __webpack_require__(3);
- var NodeType_1 = __webpack_require__(6);
- var AbstractNodeObfuscator_1 = __webpack_require__(7);
- var IdentifierReplacer_1 = __webpack_require__(14);
- var Nodes_1 = __webpack_require__(2);
- var NodeUtils_1 = __webpack_require__(1);
- var CatchClauseObfuscator = function (_AbstractNodeObfuscat) {
- _inherits(CatchClauseObfuscator, _AbstractNodeObfuscat);
- function CatchClauseObfuscator(nodes, options) {
- _classCallCheck(this, CatchClauseObfuscator);
- var _this = _possibleConstructorReturn(this, (CatchClauseObfuscator.__proto__ || Object.getPrototypeOf(CatchClauseObfuscator)).call(this, nodes, options));
- _this.identifierReplacer = new IdentifierReplacer_1.IdentifierReplacer(_this.nodes, _this.options);
- return _this;
- }
- _createClass(CatchClauseObfuscator, [{
- key: 'obfuscateNode',
- value: function obfuscateNode(catchClauseNode) {
- this.storeCatchClauseParam(catchClauseNode);
- this.replaceCatchClauseParam(catchClauseNode);
- }
- }, {
- key: 'storeCatchClauseParam',
- value: function storeCatchClauseParam(catchClauseNode) {
- var _this2 = this;
- NodeUtils_1.NodeUtils.typedReplace(catchClauseNode.param, NodeType_1.NodeType.Identifier, {
- enter: function enter(node) {
- return _this2.identifierReplacer.storeNames(node.name);
- }
- });
- }
- }, {
- key: 'replaceCatchClauseParam',
- value: function replaceCatchClauseParam(catchClauseNode) {
- var _this3 = this;
- estraverse.replace(catchClauseNode, {
- enter: function enter(node, parentNode) {
- if (Nodes_1.Nodes.isReplaceableIdentifierNode(node, parentNode)) {
- node.name = _this3.identifierReplacer.replace(node.name);
- }
- }
- });
- }
- }]);
- return CatchClauseObfuscator;
- }(AbstractNodeObfuscator_1.AbstractNodeObfuscator);
- exports.CatchClauseObfuscator = CatchClauseObfuscator;
- /***/ },
- /* 47 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- 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; }; }();
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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; }
- 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; }
- var estraverse = __webpack_require__(3);
- var NodeType_1 = __webpack_require__(6);
- var AbstractNodeObfuscator_1 = __webpack_require__(7);
- var IdentifierReplacer_1 = __webpack_require__(14);
- var Nodes_1 = __webpack_require__(2);
- var NodeUtils_1 = __webpack_require__(1);
- var FunctionDeclarationObfuscator = function (_AbstractNodeObfuscat) {
- _inherits(FunctionDeclarationObfuscator, _AbstractNodeObfuscat);
- function FunctionDeclarationObfuscator(nodes, options) {
- _classCallCheck(this, FunctionDeclarationObfuscator);
- var _this = _possibleConstructorReturn(this, (FunctionDeclarationObfuscator.__proto__ || Object.getPrototypeOf(FunctionDeclarationObfuscator)).call(this, nodes, options));
- _this.identifierReplacer = new IdentifierReplacer_1.IdentifierReplacer(_this.nodes, _this.options);
- return _this;
- }
- _createClass(FunctionDeclarationObfuscator, [{
- key: 'obfuscateNode',
- value: function obfuscateNode(functionDeclarationNode, parentNode) {
- if (parentNode.type === NodeType_1.NodeType.Program) {
- return;
- }
- this.storeFunctionName(functionDeclarationNode);
- this.replaceFunctionName(functionDeclarationNode);
- }
- }, {
- key: 'storeFunctionName',
- value: function storeFunctionName(functionDeclarationNode) {
- var _this2 = this;
- NodeUtils_1.NodeUtils.typedReplace(functionDeclarationNode.id, NodeType_1.NodeType.Identifier, {
- enter: function enter(node) {
- return _this2.identifierReplacer.storeNames(node.name);
- }
- });
- }
- }, {
- key: 'replaceFunctionName',
- value: function replaceFunctionName(functionDeclarationNode) {
- var _this3 = this;
- var scopeNode = NodeUtils_1.NodeUtils.getBlockScopeOfNode(functionDeclarationNode);
- estraverse.replace(scopeNode, {
- enter: function enter(node, parentNode) {
- if (Nodes_1.Nodes.isReplaceableIdentifierNode(node, parentNode)) {
- node.name = _this3.identifierReplacer.replace(node.name);
- }
- }
- });
- }
- }]);
- return FunctionDeclarationObfuscator;
- }(AbstractNodeObfuscator_1.AbstractNodeObfuscator);
- exports.FunctionDeclarationObfuscator = FunctionDeclarationObfuscator;
- /***/ },
- /* 48 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- 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; }; }();
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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; }
- 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; }
- var estraverse = __webpack_require__(3);
- var NodeType_1 = __webpack_require__(6);
- var AbstractNodeObfuscator_1 = __webpack_require__(7);
- var IdentifierReplacer_1 = __webpack_require__(14);
- var Nodes_1 = __webpack_require__(2);
- var NodeUtils_1 = __webpack_require__(1);
- var FunctionObfuscator = function (_AbstractNodeObfuscat) {
- _inherits(FunctionObfuscator, _AbstractNodeObfuscat);
- function FunctionObfuscator(nodes, options) {
- _classCallCheck(this, FunctionObfuscator);
- var _this = _possibleConstructorReturn(this, (FunctionObfuscator.__proto__ || Object.getPrototypeOf(FunctionObfuscator)).call(this, nodes, options));
- _this.identifierReplacer = new IdentifierReplacer_1.IdentifierReplacer(_this.nodes, _this.options);
- return _this;
- }
- _createClass(FunctionObfuscator, [{
- key: 'obfuscateNode',
- value: function obfuscateNode(functionNode) {
- this.storeFunctionParams(functionNode);
- this.replaceFunctionParams(functionNode);
- }
- }, {
- key: 'storeFunctionParams',
- value: function storeFunctionParams(functionNode) {
- var _this2 = this;
- functionNode.params.forEach(function (paramsNode) {
- NodeUtils_1.NodeUtils.typedReplace(paramsNode, NodeType_1.NodeType.Identifier, {
- enter: function enter(node) {
- return _this2.identifierReplacer.storeNames(node.name);
- }
- });
- });
- }
- }, {
- key: 'replaceFunctionParams',
- value: function replaceFunctionParams(functionNode) {
- var _this3 = this;
- var replaceVisitor = {
- enter: function enter(node, parentNode) {
- if (Nodes_1.Nodes.isReplaceableIdentifierNode(node, parentNode)) {
- var newNodeName = _this3.identifierReplacer.replace(node.name);
- if (node.name !== newNodeName) {
- node.name = newNodeName;
- node.obfuscated = true;
- }
- }
- }
- };
- functionNode.params.forEach(function (paramsNode) {
- estraverse.replace(paramsNode, replaceVisitor);
- });
- estraverse.replace(functionNode.body, replaceVisitor);
- }
- }]);
- return FunctionObfuscator;
- }(AbstractNodeObfuscator_1.AbstractNodeObfuscator);
- exports.FunctionObfuscator = FunctionObfuscator;
- /***/ },
- /* 49 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- 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; };
- 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; }; }();
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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; }
- 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; }
- var escodegen = __webpack_require__(11);
- var AbstractNodeObfuscator_1 = __webpack_require__(7);
- var BooleanLiteralReplacer_1 = __webpack_require__(54);
- var Nodes_1 = __webpack_require__(2);
- var NumberLiteralReplacer_1 = __webpack_require__(20);
- var StringLiteralReplacer_1 = __webpack_require__(16);
- var LiteralObfuscator = function (_AbstractNodeObfuscat) {
- _inherits(LiteralObfuscator, _AbstractNodeObfuscat);
- function LiteralObfuscator() {
- _classCallCheck(this, LiteralObfuscator);
- return _possibleConstructorReturn(this, (LiteralObfuscator.__proto__ || Object.getPrototypeOf(LiteralObfuscator)).apply(this, arguments));
- }
- _createClass(LiteralObfuscator, [{
- key: 'obfuscateNode',
- value: function obfuscateNode(literalNode, parentNode) {
- if (Nodes_1.Nodes.isPropertyNode(parentNode) && parentNode.key === literalNode) {
- return;
- }
- var content = void 0;
- switch (_typeof(literalNode.value)) {
- case 'boolean':
- content = new BooleanLiteralReplacer_1.BooleanLiteralReplacer(this.nodes, this.options).replace(literalNode.value);
- break;
- case 'number':
- content = new NumberLiteralReplacer_1.NumberLiteralReplacer(this.nodes, this.options).replace(literalNode.value);
- break;
- case 'string':
- content = new StringLiteralReplacer_1.StringLiteralReplacer(this.nodes, this.options).replace(literalNode.value);
- break;
- default:
- return;
- }
- literalNode['x-verbatim-property'] = {
- content: content,
- precedence: escodegen.Precedence.Primary
- };
- }
- }]);
- return LiteralObfuscator;
- }(AbstractNodeObfuscator_1.AbstractNodeObfuscator);
- exports.LiteralObfuscator = LiteralObfuscator;
- /***/ },
- /* 50 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- 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; }; }();
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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; }
- 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; }
- var escodegen = __webpack_require__(11);
- var estraverse = __webpack_require__(3);
- var NodeType_1 = __webpack_require__(6);
- var AbstractNodeObfuscator_1 = __webpack_require__(7);
- var Nodes_1 = __webpack_require__(2);
- var StringLiteralReplacer_1 = __webpack_require__(16);
- var MemberExpressionObfuscator = function (_AbstractNodeObfuscat) {
- _inherits(MemberExpressionObfuscator, _AbstractNodeObfuscat);
- function MemberExpressionObfuscator() {
- _classCallCheck(this, MemberExpressionObfuscator);
- return _possibleConstructorReturn(this, (MemberExpressionObfuscator.__proto__ || Object.getPrototypeOf(MemberExpressionObfuscator)).apply(this, arguments));
- }
- _createClass(MemberExpressionObfuscator, [{
- key: 'obfuscateNode',
- value: function obfuscateNode(memberExpressionNode) {
- var _this2 = this;
- estraverse.replace(memberExpressionNode.property, {
- enter: function enter(node, parentNode) {
- if (Nodes_1.Nodes.isLiteralNode(node)) {
- _this2.obfuscateLiteralProperty(node);
- return;
- }
- if (Nodes_1.Nodes.isIdentifierNode(node)) {
- if (memberExpressionNode.computed) {
- return;
- }
- memberExpressionNode.computed = true;
- _this2.obfuscateIdentifierProperty(node);
- }
- }
- });
- }
- }, {
- key: 'obfuscateIdentifierProperty',
- value: function obfuscateIdentifierProperty(node) {
- var nodeValue = node.name,
- literalNode = {
- raw: '\'' + nodeValue + '\'',
- 'x-verbatim-property': {
- content: new StringLiteralReplacer_1.StringLiteralReplacer(this.nodes, this.options).replace(nodeValue),
- precedence: escodegen.Precedence.Primary
- },
- type: NodeType_1.NodeType.Literal,
- value: nodeValue
- };
- delete node.name;
- Object.assign(node, literalNode);
- }
- }, {
- key: 'obfuscateLiteralProperty',
- value: function obfuscateLiteralProperty(node) {
- if (typeof node.value === 'string' && !node['x-verbatim-property']) {
- node['x-verbatim-property'] = {
- content: new StringLiteralReplacer_1.StringLiteralReplacer(this.nodes, this.options).replace(node.value),
- precedence: escodegen.Precedence.Primary
- };
- }
- }
- }]);
- return MemberExpressionObfuscator;
- }(AbstractNodeObfuscator_1.AbstractNodeObfuscator);
- exports.MemberExpressionObfuscator = MemberExpressionObfuscator;
- /***/ },
- /* 51 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- 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; }; }();
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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; }
- 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; }
- var estraverse = __webpack_require__(3);
- var AbstractNodeObfuscator_1 = __webpack_require__(7);
- var Nodes_1 = __webpack_require__(2);
- var Utils_1 = __webpack_require__(0);
- var StringLiteralReplacer_1 = __webpack_require__(16);
- var MethodDefinitionObfuscator = function (_AbstractNodeObfuscat) {
- _inherits(MethodDefinitionObfuscator, _AbstractNodeObfuscat);
- function MethodDefinitionObfuscator() {
- _classCallCheck(this, MethodDefinitionObfuscator);
- var _this = _possibleConstructorReturn(this, (MethodDefinitionObfuscator.__proto__ || Object.getPrototypeOf(MethodDefinitionObfuscator)).apply(this, arguments));
- _this.ignoredNames = ['constructor'];
- return _this;
- }
- _createClass(MethodDefinitionObfuscator, [{
- key: 'obfuscateNode',
- value: function obfuscateNode(methodDefinitionNode, parentNode) {
- this.replaceMethodName(methodDefinitionNode);
- }
- }, {
- key: 'replaceMethodName',
- value: function replaceMethodName(methodDefinitionNode) {
- var _this2 = this;
- estraverse.replace(methodDefinitionNode.key, {
- enter: function enter(node) {
- if (Nodes_1.Nodes.isIdentifierNode(node) && !Utils_1.Utils.arrayContains(_this2.ignoredNames, node.name) && methodDefinitionNode.computed === false) {
- methodDefinitionNode.computed = true;
- node.name = new StringLiteralReplacer_1.StringLiteralReplacer(_this2.nodes, _this2.options).replace(node.name);
- return;
- }
- return estraverse.VisitorOption.Skip;
- }
- });
- }
- }]);
- return MethodDefinitionObfuscator;
- }(AbstractNodeObfuscator_1.AbstractNodeObfuscator);
- exports.MethodDefinitionObfuscator = MethodDefinitionObfuscator;
- /***/ },
- /* 52 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- 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; }; }();
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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; }
- 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; }
- var escodegen = __webpack_require__(11);
- var estraverse = __webpack_require__(3);
- var NodeType_1 = __webpack_require__(6);
- var AbstractNodeObfuscator_1 = __webpack_require__(7);
- var Nodes_1 = __webpack_require__(2);
- var Utils_1 = __webpack_require__(0);
- var ObjectExpressionObfuscator = function (_AbstractNodeObfuscat) {
- _inherits(ObjectExpressionObfuscator, _AbstractNodeObfuscat);
- function ObjectExpressionObfuscator() {
- _classCallCheck(this, ObjectExpressionObfuscator);
- return _possibleConstructorReturn(this, (ObjectExpressionObfuscator.__proto__ || Object.getPrototypeOf(ObjectExpressionObfuscator)).apply(this, arguments));
- }
- _createClass(ObjectExpressionObfuscator, [{
- key: 'obfuscateNode',
- value: function obfuscateNode(objectExpressionNode) {
- var _this2 = this;
- objectExpressionNode.properties.forEach(function (property) {
- if (property.shorthand) {
- property.shorthand = false;
- }
- estraverse.replace(property.key, {
- enter: function enter(node, parentNode) {
- if (Nodes_1.Nodes.isLiteralNode(node)) {
- _this2.obfuscateLiteralPropertyKey(node);
- return;
- }
- if (Nodes_1.Nodes.isIdentifierNode(node)) {
- _this2.obfuscateIdentifierPropertyKey(node);
- }
- }
- });
- });
- }
- }, {
- key: 'obfuscateLiteralPropertyKey',
- value: function obfuscateLiteralPropertyKey(node) {
- if (typeof node.value === 'string' && !node['x-verbatim-property']) {
- node['x-verbatim-property'] = {
- content: Utils_1.Utils.stringToUnicode(node.value),
- precedence: escodegen.Precedence.Primary
- };
- }
- }
- }, {
- key: 'obfuscateIdentifierPropertyKey',
- value: function obfuscateIdentifierPropertyKey(node) {
- var nodeValue = node.name,
- literalNode = {
- raw: '\'' + nodeValue + '\'',
- 'x-verbatim-property': {
- content: Utils_1.Utils.stringToUnicode(nodeValue),
- precedence: escodegen.Precedence.Primary
- },
- type: NodeType_1.NodeType.Literal,
- value: nodeValue
- };
- delete node.name;
- Object.assign(node, literalNode);
- }
- }]);
- return ObjectExpressionObfuscator;
- }(AbstractNodeObfuscator_1.AbstractNodeObfuscator);
- exports.ObjectExpressionObfuscator = ObjectExpressionObfuscator;
- /***/ },
- /* 53 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- 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; }; }();
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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; }
- 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; }
- var estraverse = __webpack_require__(3);
- var NodeType_1 = __webpack_require__(6);
- var AbstractNodeObfuscator_1 = __webpack_require__(7);
- var IdentifierReplacer_1 = __webpack_require__(14);
- var Nodes_1 = __webpack_require__(2);
- var NodeUtils_1 = __webpack_require__(1);
- var VariableDeclarationObfuscator = function (_AbstractNodeObfuscat) {
- _inherits(VariableDeclarationObfuscator, _AbstractNodeObfuscat);
- function VariableDeclarationObfuscator(nodes, options) {
- _classCallCheck(this, VariableDeclarationObfuscator);
- var _this = _possibleConstructorReturn(this, (VariableDeclarationObfuscator.__proto__ || Object.getPrototypeOf(VariableDeclarationObfuscator)).call(this, nodes, options));
- _this.identifierReplacer = new IdentifierReplacer_1.IdentifierReplacer(_this.nodes, _this.options);
- return _this;
- }
- _createClass(VariableDeclarationObfuscator, [{
- key: 'obfuscateNode',
- value: function obfuscateNode(variableDeclarationNode, parentNode) {
- if (parentNode.type === NodeType_1.NodeType.Program) {
- return;
- }
- this.storeVariableNames(variableDeclarationNode);
- this.replaceVariableNames(variableDeclarationNode, parentNode);
- }
- }, {
- key: 'storeVariableNames',
- value: function storeVariableNames(variableDeclarationNode) {
- var _this2 = this;
- variableDeclarationNode.declarations.forEach(function (declarationNode) {
- NodeUtils_1.NodeUtils.typedReplace(declarationNode.id, NodeType_1.NodeType.Identifier, {
- enter: function enter(node) {
- return _this2.identifierReplacer.storeNames(node.name);
- }
- });
- });
- }
- }, {
- key: 'replaceVariableNames',
- value: function replaceVariableNames(variableDeclarationNode, variableParentNode) {
- var _this3 = this;
- var scopeNode = variableDeclarationNode.kind === 'var' ? NodeUtils_1.NodeUtils.getBlockScopeOfNode(variableDeclarationNode) : variableParentNode;
- estraverse.replace(scopeNode, {
- enter: function enter(node, parentNode) {
- if (!node.obfuscated && Nodes_1.Nodes.isReplaceableIdentifierNode(node, parentNode)) {
- node.name = _this3.identifierReplacer.replace(node.name);
- }
- }
- });
- }
- }]);
- return VariableDeclarationObfuscator;
- }(AbstractNodeObfuscator_1.AbstractNodeObfuscator);
- exports.VariableDeclarationObfuscator = VariableDeclarationObfuscator;
- /***/ },
- /* 54 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- 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; }; }();
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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; }
- 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; }
- var JSFuck_1 = __webpack_require__(19);
- var AbstractReplacer_1 = __webpack_require__(13);
- var BooleanLiteralReplacer = function (_AbstractReplacer_1$A) {
- _inherits(BooleanLiteralReplacer, _AbstractReplacer_1$A);
- function BooleanLiteralReplacer() {
- _classCallCheck(this, BooleanLiteralReplacer);
- return _possibleConstructorReturn(this, (BooleanLiteralReplacer.__proto__ || Object.getPrototypeOf(BooleanLiteralReplacer)).apply(this, arguments));
- }
- _createClass(BooleanLiteralReplacer, [{
- key: 'replace',
- value: function replace(nodeValue) {
- return nodeValue ? JSFuck_1.JSFuck.True : JSFuck_1.JSFuck.False;
- }
- }]);
- return BooleanLiteralReplacer;
- }(AbstractReplacer_1.AbstractReplacer);
- exports.BooleanLiteralReplacer = BooleanLiteralReplacer;
- /***/ },
- /* 55 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- 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; };
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- var __decorate = undefined && undefined.__decorate || function (decorators, target, key, desc) {
- var c = arguments.length,
- r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
- d;
- 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--) {
- if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- }return c > 3 && r && Object.defineProperty(target, key, r), r;
- };
- var __metadata = undefined && undefined.__metadata || function (k, v) {
- if ((typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
- };
- var class_validator_1 = __webpack_require__(76);
- var TSourceMapMode_1 = __webpack_require__(74);
- var DefaultPreset_1 = __webpack_require__(21);
- var OptionsNormalizer_1 = __webpack_require__(56);
- var ValidationErrorsFormatter_1 = __webpack_require__(57);
- var Options = function Options(obfuscatorOptions) {
- _classCallCheck(this, Options);
- Object.assign(this, DefaultPreset_1.DEFAULT_PRESET, obfuscatorOptions);
- var errors = class_validator_1.validateSync(this, Options.validatorOptions);
- if (errors.length) {
- throw new ReferenceError("Validation failed. errors:\n" + ValidationErrorsFormatter_1.ValidationErrorsFormatter.format(errors));
- }
- Object.assign(this, OptionsNormalizer_1.OptionsNormalizer.normalizeOptions(this));
- };
- Options.validatorOptions = {
- validationError: {
- target: false
- }
- };
- __decorate([class_validator_1.IsBoolean(), __metadata('design:type', Boolean)], Options.prototype, "compact", void 0);
- __decorate([class_validator_1.IsBoolean(), __metadata('design:type', Boolean)], Options.prototype, "debugProtection", void 0);
- __decorate([class_validator_1.IsBoolean(), __metadata('design:type', Boolean)], Options.prototype, "debugProtectionInterval", void 0);
- __decorate([class_validator_1.IsBoolean(), __metadata('design:type', Boolean)], Options.prototype, "disableConsoleOutput", void 0);
- __decorate([class_validator_1.IsArray(), class_validator_1.ArrayUnique(), class_validator_1.IsString({
- each: true
- }), __metadata('design:type', Array)], Options.prototype, "domainLock", void 0);
- __decorate([class_validator_1.IsBoolean(), __metadata('design:type', Boolean)], Options.prototype, "encodeUnicodeLiterals", void 0);
- __decorate([class_validator_1.IsArray(), class_validator_1.ArrayUnique(), class_validator_1.IsString({
- each: true
- }), __metadata('design:type', Array)], Options.prototype, "reservedNames", void 0);
- __decorate([class_validator_1.IsBoolean(), __metadata('design:type', Boolean)], Options.prototype, "rotateUnicodeArray", void 0);
- __decorate([class_validator_1.IsBoolean(), __metadata('design:type', Boolean)], Options.prototype, "selfDefending", void 0);
- __decorate([class_validator_1.IsBoolean(), __metadata('design:type', Boolean)], Options.prototype, "sourceMap", void 0);
- __decorate([class_validator_1.IsString(), class_validator_1.ValidateIf(function (options) {
- return Boolean(options.sourceMapBaseUrl);
- }), class_validator_1.IsUrl({
- require_protocol: false,
- require_valid_protocol: true
- }), __metadata('design:type', String)], Options.prototype, "sourceMapBaseUrl", void 0);
- __decorate([class_validator_1.IsString(), __metadata('design:type', String)], Options.prototype, "sourceMapFileName", void 0);
- __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);
- __decorate([class_validator_1.IsBoolean(), __metadata('design:type', Boolean)], Options.prototype, "unicodeArray", void 0);
- __decorate([class_validator_1.IsNumber(), class_validator_1.Min(0), class_validator_1.Max(1), __metadata('design:type', Number)], Options.prototype, "unicodeArrayThreshold", void 0);
- __decorate([class_validator_1.IsBoolean(), __metadata('design:type', Boolean)], Options.prototype, "wrapUnicodeArrayCalls", void 0);
- exports.Options = Options;
- var _a;
- /***/ },
- /* 56 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- 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; }; }();
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- var Utils_1 = __webpack_require__(0);
- var OptionsNormalizer = function () {
- function OptionsNormalizer() {
- _classCallCheck(this, OptionsNormalizer);
- }
- _createClass(OptionsNormalizer, null, [{
- key: 'normalizeOptions',
- value: function normalizeOptions(options) {
- var normalizedOptions = Object.assign({}, options);
- var _iteratorNormalCompletion = true;
- var _didIteratorError = false;
- var _iteratorError = undefined;
- try {
- for (var _iterator = OptionsNormalizer.normalizerRules[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
- var normalizerRule = _step.value;
- normalizedOptions = normalizerRule(normalizedOptions);
- }
- } catch (err) {
- _didIteratorError = true;
- _iteratorError = err;
- } finally {
- try {
- if (!_iteratorNormalCompletion && _iterator.return) {
- _iterator.return();
- }
- } finally {
- if (_didIteratorError) {
- throw _iteratorError;
- }
- }
- }
- return normalizedOptions;
- }
- }, {
- key: 'domainLockRule',
- value: function domainLockRule(options) {
- if (options.domainLock.length) {
- var normalizedDomains = [];
- var _iteratorNormalCompletion2 = true;
- var _didIteratorError2 = false;
- var _iteratorError2 = undefined;
- try {
- for (var _iterator2 = options.domainLock[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
- var domain = _step2.value;
- normalizedDomains.push(Utils_1.Utils.extractDomainFromUrl(domain));
- }
- } catch (err) {
- _didIteratorError2 = true;
- _iteratorError2 = err;
- } finally {
- try {
- if (!_iteratorNormalCompletion2 && _iterator2.return) {
- _iterator2.return();
- }
- } finally {
- if (_didIteratorError2) {
- throw _iteratorError2;
- }
- }
- }
- Object.assign(options, {
- domainLock: normalizedDomains
- });
- }
- return options;
- }
- }, {
- key: 'encodeUnicodeLiteralsRule',
- value: function encodeUnicodeLiteralsRule(options) {
- if (options.unicodeArray && options.encodeUnicodeLiterals) {
- Object.assign(options, OptionsNormalizer.ENCODE_UNICODE_LITERALS_OPTIONS);
- }
- return options;
- }
- }, {
- key: 'selfDefendingRule',
- value: function selfDefendingRule(options) {
- if (options.selfDefending) {
- Object.assign(options, OptionsNormalizer.SELF_DEFENDING_OPTIONS);
- }
- return options;
- }
- }, {
- key: 'sourceMapBaseUrl',
- value: function sourceMapBaseUrl(options) {
- var sourceMapBaseUrl = options.sourceMapBaseUrl;
- if (!options.sourceMapFileName) {
- Object.assign(options, {
- sourceMapBaseUrl: ''
- });
- return options;
- }
- if (sourceMapBaseUrl && !sourceMapBaseUrl.endsWith('/')) {
- Object.assign(options, {
- sourceMapBaseUrl: sourceMapBaseUrl + '/'
- });
- }
- return options;
- }
- }, {
- key: 'sourceMapFileName',
- value: function sourceMapFileName(options) {
- var sourceMapFileName = options.sourceMapFileName;
- if (sourceMapFileName) {
- sourceMapFileName = sourceMapFileName.replace(/^\/+/, '').split('.')[0];
- Object.assign(options, {
- sourceMapFileName: sourceMapFileName + '.js.map'
- });
- }
- return options;
- }
- }, {
- key: 'unicodeArrayRule',
- value: function unicodeArrayRule(options) {
- if (!options.unicodeArray) {
- Object.assign(options, OptionsNormalizer.DISABLED_UNICODE_ARRAY_OPTIONS);
- }
- return options;
- }
- }, {
- key: 'unicodeArrayThresholdRule',
- value: function unicodeArrayThresholdRule(options) {
- if (options.unicodeArrayThreshold === 0) {
- Object.assign(options, OptionsNormalizer.DISABLED_UNICODE_ARRAY_OPTIONS);
- }
- return options;
- }
- }]);
- return OptionsNormalizer;
- }();
- OptionsNormalizer.DISABLED_UNICODE_ARRAY_OPTIONS = {
- encodeUnicodeLiterals: false,
- rotateUnicodeArray: false,
- unicodeArray: false,
- unicodeArrayThreshold: 0,
- wrapUnicodeArrayCalls: false
- };
- OptionsNormalizer.ENCODE_UNICODE_LITERALS_OPTIONS = {
- encodeUnicodeLiterals: true,
- wrapUnicodeArrayCalls: true
- };
- OptionsNormalizer.SELF_DEFENDING_OPTIONS = {
- compact: true,
- selfDefending: true
- };
- OptionsNormalizer.normalizerRules = [OptionsNormalizer.domainLockRule, OptionsNormalizer.unicodeArrayRule, OptionsNormalizer.unicodeArrayThresholdRule, OptionsNormalizer.encodeUnicodeLiteralsRule, OptionsNormalizer.sourceMapBaseUrl, OptionsNormalizer.sourceMapFileName, OptionsNormalizer.selfDefendingRule];
- exports.OptionsNormalizer = OptionsNormalizer;
- /***/ },
- /* 57 */
- /***/ function(module, exports) {
- "use strict";
- "use strict";
- 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; }; }();
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- var ValidationErrorsFormatter = function () {
- function ValidationErrorsFormatter() {
- _classCallCheck(this, ValidationErrorsFormatter);
- }
- _createClass(ValidationErrorsFormatter, null, [{
- key: "format",
- value: function format(validationErrors) {
- var errorsArray = [];
- var _iteratorNormalCompletion = true;
- var _didIteratorError = false;
- var _iteratorError = undefined;
- try {
- for (var _iterator = validationErrors[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
- var error = _step.value;
- errorsArray.push(ValidationErrorsFormatter.formatError(error));
- }
- } catch (err) {
- _didIteratorError = true;
- _iteratorError = err;
- } finally {
- try {
- if (!_iteratorNormalCompletion && _iterator.return) {
- _iterator.return();
- }
- } finally {
- if (_didIteratorError) {
- throw _iteratorError;
- }
- }
- }
- return errorsArray.join('\n');
- }
- }, {
- key: "formatError",
- value: function formatError(validationError) {
- var errorString = "`" + validationError.property + "` errors:\n",
- constraints = validationError.constraints;
- for (var constraint in constraints) {
- if (!constraints.hasOwnProperty(constraint)) {
- continue;
- }
- errorString += " - " + constraints[constraint] + "\n";
- }
- return errorString;
- }
- }]);
- return ValidationErrorsFormatter;
- }();
- exports.ValidationErrorsFormatter = ValidationErrorsFormatter;
- /***/ },
- /* 58 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- 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; }; }();
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- var estraverse = __webpack_require__(3);
- var NodeType_1 = __webpack_require__(6);
- var FunctionDeclarationCalleeDataExtractor_1 = __webpack_require__(59);
- var FunctionExpressionCalleeDataExtractor_1 = __webpack_require__(60);
- var Nodes_1 = __webpack_require__(2);
- var NodeUtils_1 = __webpack_require__(1);
- var StackTraceAnalyzer = function () {
- function StackTraceAnalyzer(blockScopeBody) {
- _classCallCheck(this, StackTraceAnalyzer);
- this.calleeDataExtractors = new Map([[NodeType_1.NodeType.FunctionDeclaration, FunctionDeclarationCalleeDataExtractor_1.FunctionDeclarationCalleeDataExtractor], [NodeType_1.NodeType.FunctionExpression, FunctionExpressionCalleeDataExtractor_1.FunctionExpressionCalleeDataExtractor]]);
- this.blockScopeBody = blockScopeBody;
- }
- _createClass(StackTraceAnalyzer, [{
- key: 'analyze',
- value: function analyze() {
- return this.analyzeRecursive(this.blockScopeBody);
- }
- }, {
- key: 'analyzeRecursive',
- value: function analyzeRecursive(blockScopeBody) {
- var _this = this;
- var stackTraceData = [];
- var _iteratorNormalCompletion = true;
- var _didIteratorError = false;
- var _iteratorError = undefined;
- try {
- var _loop = function _loop() {
- var rootNode = _step.value;
- estraverse.traverse(rootNode, {
- enter: function enter(node) {
- if (!Nodes_1.Nodes.isCallExpressionNode(node) || rootNode.parentNode !== NodeUtils_1.NodeUtils.getBlockScopeOfNode(node)) {
- return;
- }
- _this.calleeDataExtractors.forEach(function (calleeDataExtractor) {
- var calleeData = new calleeDataExtractor(blockScopeBody, node.callee).extract();
- if (!calleeData) {
- return;
- }
- stackTraceData.push(Object.assign({}, calleeData, {
- stackTrace: _this.analyzeRecursive(calleeData.callee.body)
- }));
- });
- }
- });
- };
- for (var _iterator = blockScopeBody[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
- _loop();
- }
- } catch (err) {
- _didIteratorError = true;
- _iteratorError = err;
- } finally {
- try {
- if (!_iteratorNormalCompletion && _iterator.return) {
- _iterator.return();
- }
- } finally {
- if (_didIteratorError) {
- throw _iteratorError;
- }
- }
- }
- return stackTraceData;
- }
- }]);
- return StackTraceAnalyzer;
- }();
- exports.StackTraceAnalyzer = StackTraceAnalyzer;
- /***/ },
- /* 59 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- 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; }; }();
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- var estraverse = __webpack_require__(3);
- var Nodes_1 = __webpack_require__(2);
- var NodeUtils_1 = __webpack_require__(1);
- var FunctionDeclarationCalleeDataExtractor = function () {
- function FunctionDeclarationCalleeDataExtractor(blockScopeBody, callee) {
- _classCallCheck(this, FunctionDeclarationCalleeDataExtractor);
- this.blockScopeBody = blockScopeBody;
- this.callee = callee;
- }
- _createClass(FunctionDeclarationCalleeDataExtractor, [{
- key: 'extract',
- value: function extract() {
- var calleeBlockStatement = null;
- if (Nodes_1.Nodes.isIdentifierNode(this.callee)) {
- calleeBlockStatement = this.getCalleeBlockStatement(NodeUtils_1.NodeUtils.getBlockScopeOfNode(this.blockScopeBody[0]), this.callee.name);
- }
- if (!calleeBlockStatement) {
- return null;
- }
- return {
- callee: calleeBlockStatement,
- name: this.callee.name
- };
- }
- }, {
- key: 'getCalleeBlockStatement',
- value: function getCalleeBlockStatement(node, name) {
- var calleeBlockStatement = null;
- estraverse.traverse(node, {
- enter: function enter(node) {
- if (Nodes_1.Nodes.isFunctionDeclarationNode(node) && node.id.name === name) {
- calleeBlockStatement = node.body;
- return estraverse.VisitorOption.Break;
- }
- }
- });
- return calleeBlockStatement;
- }
- }]);
- return FunctionDeclarationCalleeDataExtractor;
- }();
- exports.FunctionDeclarationCalleeDataExtractor = FunctionDeclarationCalleeDataExtractor;
- /***/ },
- /* 60 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- 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; }; }();
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- var estraverse = __webpack_require__(3);
- var Nodes_1 = __webpack_require__(2);
- var NodeUtils_1 = __webpack_require__(1);
- var FunctionExpressionCalleeDataExtractor = function () {
- function FunctionExpressionCalleeDataExtractor(blockScopeBody, callee) {
- _classCallCheck(this, FunctionExpressionCalleeDataExtractor);
- this.blockScopeBody = blockScopeBody;
- this.callee = callee;
- }
- _createClass(FunctionExpressionCalleeDataExtractor, [{
- key: 'extract',
- value: function extract() {
- var calleeBlockStatement = null;
- if (Nodes_1.Nodes.isIdentifierNode(this.callee)) {
- calleeBlockStatement = this.getCalleeBlockStatement(NodeUtils_1.NodeUtils.getBlockScopeOfNode(this.blockScopeBody[0]), this.callee.name);
- }
- if (!calleeBlockStatement) {
- return null;
- }
- return {
- callee: calleeBlockStatement,
- name: this.callee.name
- };
- }
- }, {
- key: 'getCalleeBlockStatement',
- value: function getCalleeBlockStatement(node, name) {
- var calleeBlockStatement = null;
- estraverse.traverse(node, {
- enter: function enter(node, parentNode) {
- if (Nodes_1.Nodes.isFunctionExpressionNode(node) && Nodes_1.Nodes.isVariableDeclaratorNode(parentNode) && Nodes_1.Nodes.isIdentifierNode(parentNode.id) && parentNode.id.name === name) {
- calleeBlockStatement = node.body;
- return estraverse.VisitorOption.Break;
- }
- }
- });
- return calleeBlockStatement;
- }
- }]);
- return FunctionExpressionCalleeDataExtractor;
- }();
- exports.FunctionExpressionCalleeDataExtractor = FunctionExpressionCalleeDataExtractor;
- /***/ },
- /* 61 */
- /***/ function(module, exports) {
- "use strict";
- "use strict";
- function AtobTemplate() {
- return "\n (function () {\n var object = []['filter']['constructor']('return this')();\n var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\n object.atob || (\n object.atob = function(input) {\n var str = String(input).replace(/=+$/, '');\n for (\n var bc = 0, bs, buffer, idx = 0, output = '';\n buffer = str.charAt(idx++);\n ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer,\n bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0\n ) {\n buffer = chars.indexOf(buffer);\n }\n return output;\n });\n })();\n ";
- }
- exports.AtobTemplate = AtobTemplate;
- /***/ },
- /* 62 */
- /***/ function(module, exports) {
- "use strict";
- "use strict";
- function ConsoleOutputDisableExpressionTemplate() {
- return "\n (function () {\n var _ = '(\x04\x06\x03\x05[]' + '[\"filter\"][\"\x07tructor\"]' + '(\"return this\")()' + '.' + '\x03;\x06\x02\x05\x04};' + '_\x03.log\x01.in' + 'fo\x01.' + 'war' + 'n\x01.er' + 'r' + 'or\x01})();' + '\x01\x05_\x02;' + '_\x03\x02function' + '\x03\x07ole\x04\x02 ()' + '{\x05 = \x06var ' + '_\x07cons', \n Y, \n $;\n \n for (Y in $ = \"\x07\x06\x05\x04\x03\x02\x01\") {\n var arr = _.split($[Y]);\n _ = arr.join(arr.pop());\n }\n \n [][\"filter\"][\"constructor\"](_)();\n })()\n ";
- }
- exports.ConsoleOutputDisableExpressionTemplate = ConsoleOutputDisableExpressionTemplate;
- /***/ },
- /* 63 */
- /***/ function(module, exports) {
- "use strict";
- "use strict";
- function DebugProtectionFunctionCallTemplate() {
- return "{debugProtectionFunctionName}();";
- }
- exports.DebugProtectionFunctionCallTemplate = DebugProtectionFunctionCallTemplate;
- /***/ },
- /* 64 */
- /***/ function(module, exports) {
- "use strict";
- "use strict";
- function DebugProtectionFunctionIntervalTemplate() {
- return "\n setInterval(function () {\n {debugProtectionFunctionName}();\n }, 4000);\n ";
- }
- exports.DebugProtectionFunctionIntervalTemplate = DebugProtectionFunctionIntervalTemplate;
- /***/ },
- /* 65 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- var Utils_1 = __webpack_require__(0);
- function DebugProtectionFunctionTemplate() {
- 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 ';
- }
- exports.DebugProtectionFunctionTemplate = DebugProtectionFunctionTemplate;
- /***/ },
- /* 66 */
- /***/ function(module, exports) {
- "use strict";
- "use strict";
- function DomainLockNodeTemplate() {
- return "\n (function () {\n var regExp = new RegExp(\"[{diff}]\", \"g\");\n var domains = \"{domains}\".replace(regExp, \"\").split(\";\");\n var eval = [][\"forEach\"][\"constructor\"];\n var window = eval(\"return this\")();\n \n for (var d in window) {\n if (d.length == 8 && d.charCodeAt(7) == 116 && d.charCodeAt(5) == 101 && d.charCodeAt(3) == 117 && d.charCodeAt(0) == 100) {\n break;\n }\n }\n\n for (var d1 in window[d]) {\n if (d1.length == 6 && d1.charCodeAt(5) == 110 && d1.charCodeAt(0) == 100) {\n break;\n }\n }\n\n var currentDomain = window[d][d1];\n \n if (!currentDomain) {\n return;\n }\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 eval('throw new Error()')();\n }\n })();\n ";
- }
- exports.DomainLockNodeTemplate = DomainLockNodeTemplate;
- /***/ },
- /* 67 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- var Utils_1 = __webpack_require__(0);
- function SelfDefendingTemplate() {
- return '\n (function () { \n var func = function(){return \'dev\';},\n func2 = function () {\n return \'window\';\n };\n \n !Function(' + Utils_1.Utils.stringToUnicode('return/\\w+ *\\(\\) *{\\w+ *[\'|"].+[\'|"];? *}/') + ')().test(func.toString()) ? Function(' + Utils_1.Utils.stringToUnicode('return/(\\\\[x|u](\\w){2,4})+/') + ')().test(func2.toString()) ? [][\'filter\'][\'constructor\'](' + Utils_1.Utils.stringToJSFuck('while') + ' + \'(false){}\')() : [][\'filter\'][\'constructor\'](' + Utils_1.Utils.stringToJSFuck('while') + ' + \'(true){}\')() : [][\'filter\'][\'constructor\'](' + Utils_1.Utils.stringToJSFuck('while') + ' + \'(false){}\')();\n })();\n ';
- }
- exports.SelfDefendingTemplate = SelfDefendingTemplate;
- /***/ },
- /* 68 */
- /***/ function(module, exports) {
- "use strict";
- "use strict";
- function UnicodeArrayCallsWrapperTemplate() {
- return "\n var {unicodeArrayCallsWrapperName} = function ({keyName}) {\n return {unicodeArrayName}[parseInt({keyName}, 0x010)];\n };\n ";
- }
- exports.UnicodeArrayCallsWrapperTemplate = UnicodeArrayCallsWrapperTemplate;
- /***/ },
- /* 69 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- var Utils_1 = __webpack_require__(0);
- function SelfDefendingTemplate() {
- return '\n var func = function(){return \'dev\';};\n \n Function(' + Utils_1.Utils.stringToUnicode('return/\\w+ *\\(\\) *{\\w+ *[\'|"].+[\'|"];? *}/') + ')()[\'test\'](func[\'toString\']()) !== true && !{unicodeArrayName}++ ? [][\'filter\'][\'constructor\'](' + Utils_1.Utils.stringToJSFuck('while') + ' + \'(true){}\')() : Function(\'a\', atob(' + Utils_1.Utils.stringToUnicode(Utils_1.Utils.btoa('a.call()')) + '))({forLoopFunctionName}) ? [][\'filter\'][\'constructor\'](' + Utils_1.Utils.stringToJSFuck('while') + ' + \'(false){}\')() : [][\'filter\'][\'constructor\'](' + Utils_1.Utils.stringToJSFuck('while') + ' + \'(false){}\')();\n ';
- }
- exports.SelfDefendingTemplate = SelfDefendingTemplate;
- /***/ },
- /* 70 */
- /***/ function(module, exports) {
- "use strict";
- "use strict";
- function UnicodeArrayDecodeNodeTemplate() {
- return "\n (function () {\n {atobPolyfill}\n \n var {forLoopFunctionName} = function () {\n var array = [];\n \n for (var i in {unicodeArrayName}) {\n array['push'](decodeURI(atob({unicodeArrayName}[i])));\n }\n \n {unicodeArrayName} = array;\n };\n \n {code}\n })();\n ";
- }
- exports.UnicodeArrayDecodeNodeTemplate = UnicodeArrayDecodeNodeTemplate;
- /***/ },
- /* 71 */
- /***/ function(module, exports) {
- "use strict";
- "use strict";
- function UnicodeArrayTemplate() {
- return "\n var {unicodeArrayName} = [{unicodeArray}];\n ";
- }
- exports.UnicodeArrayTemplate = UnicodeArrayTemplate;
- /***/ },
- /* 72 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- var Utils_1 = __webpack_require__(0);
- function SelfDefendingTemplate() {
- return '(function () {\n var func = function(){return \'dev\';};\n \n !Function(' + Utils_1.Utils.stringToUnicode('return/\\w+ *\\(\\) *{\\w+ *[\'|"].+[\'|"];? *}/') + ')().test(func.toString()) ? [][\'filter\'][\'constructor\'](' + Utils_1.Utils.stringToJSFuck('while') + ' + \'(true){}\')() : Function(\'a\', \'b\', \'a(++b)\')({whileFunctionName}, {timesName}) ? [][\'filter\'][\'constructor\'](' + Utils_1.Utils.stringToJSFuck('while') + ' + \'(false){}\')() : [][\'filter\'][\'constructor\'](' + Utils_1.Utils.stringToJSFuck('while') + ' + \'(false){}\')();\n })();';
- }
- exports.SelfDefendingTemplate = SelfDefendingTemplate;
- /***/ },
- /* 73 */
- /***/ function(module, exports) {
- "use strict";
- "use strict";
- function UnicodeArrayRotateFunctionTemplate() {
- 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 ";
- }
- exports.UnicodeArrayRotateFunctionTemplate = UnicodeArrayRotateFunctionTemplate;
- /***/ },
- /* 74 */
- /***/ function(module, exports) {
- "use strict";
- "use strict";
- /***/ },
- /* 75 */
- /***/ function(module, exports) {
- module.exports = require("chance");
- /***/ },
- /* 76 */
- /***/ function(module, exports) {
- module.exports = require("class-validator");
- /***/ },
- /* 77 */
- /***/ function(module, exports) {
- module.exports = require("commander");
- /***/ },
- /* 78 */
- /***/ function(module, exports) {
- module.exports = require("fs");
- /***/ },
- /* 79 */
- /***/ function(module, exports) {
- module.exports = require("mkdirp");
- /***/ },
- /* 80 */
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- "use strict";
- var JavaScriptObfuscator_1 = __webpack_require__(9);
- if (!global._babelPolyfill) {
- __webpack_require__(24);
- }
- module.exports = JavaScriptObfuscator_1.JavaScriptObfuscator;
- /***/ }
- /******/ ]);
- //# sourceMappingURL=index.js.map
|