1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191
| const parse = require('@babel/parser') const fs = require('fs') const traverse = require("@babel/traverse").default; const types = require("@babel/types"); const generator = require("@babel/generator").default;
process.argv.length > 2 ? File1 = process.argv[2] : File1 = './_encode.js' process.argv.length > 3 ? File2 = process.argv[2] : File2 = './_decode.js'
jscode = fs.readFileSync(File1, {encoding: 'utf-8'}) let ast = parse.parse(jscode);
// 需要通过这个代码才能还原原本的数据,才能执行这些方法 (function (_0xa8ec3d, _0x2606de) { var _0x478f6c = _0xa8ec3d();
function _0x2c978f(_0x81c36a, _0x5a59fd, _0x1deaca, _0x4f8a4a, _0x5be23b) { return _0x3cf5(_0x5be23b - -0x1dc, _0x1deaca); }
function _0x2af083(_0x3033fc, _0x57432a, _0x11ac40, _0x4423ed, _0x407b57) { return _0x3cf5(_0x57432a - 0x2a5, _0x4423ed); }
function _0x45fe89(_0x144f7d, _0x43c342, _0x3f94a5, _0x4554dc, _0x4477fb) { return _0x3cf5(_0x4477fb - -0x14f, _0x43c342); }
function _0xa98447(_0x1b3bb3, _0x43843c, _0x5dd756, _0x276faf, _0x3bed7b) { return _0x3cf5(_0x43843c - 0x193, _0x5dd756); }
function _0x30e393(_0x20d513, _0x1b8618, _0x3633fc, _0x455543, _0x476f9d) { return _0x3cf5(_0x1b8618 - 0x231, _0x455543); }
while (!![]) { try { var _0x3d4edf = -parseInt(_0x2af083(0x677, 0x631, 0x6f1, 'T&$^', 0x610)) / (-0xc * -0x25c + -0x1169 + 0x573 * -0x2) + parseInt(_0x2af083(0x58d, 0x5eb, 0x516, '5*Kw', 0x6c6)) / (0x112c + 0x57 * 0x46 + -0x28f4) * (-parseInt(_0xa98447(0x4b8, 0x4b0, 'L82p', 0x4a6, 0x4ce)) / (0x71d * -0x5 + -0x5 * -0x4ff + 0xa99)) + parseInt(_0xa98447(0x476, 0x3af, 'qgCF', 0x2a5, 0x491)) / (-0x3b2 + 0x2ac + 0x7 * 0x26) * (parseInt(_0x2af083(0x66c, 0x634, 0x727, 'L82p', 0x588)) / (-0xa22 + 0x5 * 0x43 + 0x8d8)) + -parseInt(_0xa98447(0x3e6, 0x344, 'vT&^', 0x269, 0x333)) / (-0x2 * -0xf53 + 0x26e1 + 0x7b9 * -0x9) + parseInt(_0x2af083(0x5c4, 0x4c2, 0x405, '#2rS', 0x4b5)) / (0x1 * 0x2119 + -0x4b1 + -0x1c61) * (-parseInt(_0xa98447(0x4e0, 0x426, 'ZcMD', 0x4fe, 0x3d7)) / (0x15fc * -0x1 + 0x4fb + -0x31 * -0x59)) + parseInt(_0x30e393(0x5b6, 0x4a2, 0x520, 'L82p', 0x527)) / (0x171 * -0xa + 0x15 * -0x15a + 0x2ad5) * (parseInt(_0x2c978f(0x8a, 0x154, 'RNcz', 0x84, 0x94)) / (-0x1663 + -0x1 * -0x10a3 + -0xf7 * -0x6)) + -parseInt(_0x2af083(0x501, 0x4d3, 0x59a, 'WNR(', 0x449)) / (0x2 * 0x9e9 + -0x228a + 0xec3) * (-parseInt(_0xa98447(0x49c, 0x3c3, 'LDmE', 0x30a, 0x3a2)) / (0x66f + 0xe25 + 0x18 * -0xdb)); if (_0x3d4edf === _0x2606de) break; else _0x478f6c['push'](_0x478f6c['shift']()); } catch (_0x26a20f) { _0x478f6c['push'](_0x478f6c['shift']()); } } }(_0x2c4e, -0x1127f + 0x105241 + -0x52ff3)); function _0x3cf5(_0x43ba1f,_0x430c41){var _0x50958e=_0x2c4e();return _0x3cf5=function(_0x1ebf43,_0x3465d6){_0x1ebf43=_0x1ebf43-(-0x397*0x8+0x248a+ -0x632);var _0x3370b8=_0x50958e[_0x1ebf43];if(_0x3cf5['AatHvX']===undefined){var _0xa2d549=function(_0x28385a){var _0x2e18f7='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x178072='',_0x492491='',_0x58f562=_0x178072+_0xa2d549;for(var _0x15163c=0x341+ -0x4*-0x52f+0x45*-0x59,_0x4e0ca7,_0x6210d3,_0x2413e1=0x1cdd*-0x1+ -0x2*0x163+0x5b*0x59;_0x6210d3=_0x28385a['charAt'](_0x2413e1++);~_0x6210d3&&(_0x4e0ca7=_0x15163c%(-0x25d5*0x1+ -0x31a*0x9+0x1c7*0x25)?_0x4e0ca7*(-0xf06+0x6*-0xbf+ -0x9e0*-0x2)+_0x6210d3:_0x6210d3,_0x15163c++%(-0x1*-0x19f9+0x3*-0xbd8+0x2b*0x39))?_0x178072+=_0x58f562['charCodeAt'](_0x2413e1+(0x2083+0x124d*0x2+0x1*-0x4513))-(-0x1*0x3a1+ -0xe3*-0x1+0x2c8)!==-0x5*-0x517+0xe76+0x11*-0x259?String['fromCharCode'](-0x107b+ -0x1*0x4bb+ -0xf*-0x17b&_0x4e0ca7>>(-(0x2456*0x1+ -0xb3b+ -0x1919)*_0x15163c&0x1*0x9bb+0x1*0xf63+0x4*-0x646)):_0x15163c:-0x178c+0x10ab+0x6e1){_0x6210d3=_0x2e18f7['indexOf'](_0x6210d3)}for(var _0x744be1=-0x3*-0x161+0x17*-0x7+ -0x382,_0x28b33f=_0x178072['length'];_0x744be1<_0x28b33f;_0x744be1++){_0x492491+='%'+('00'+_0x178072['charCodeAt'](_0x744be1)['toString'](0x1d3+0x18b4+ -0x10f*0x19))['slice'](-(0x1df3+ -0x2444+0x653))}return decodeURIComponent(_0x492491)};var _0x3c0acf=function(_0x2e84c5,_0x1862f9){var _0x5bc8d1=[],_0x5005f4=-0xf94+0x1*0x25c9+ -0x1635,_0x209431,_0x11e8b4='';_0x2e84c5=_0xa2d549(_0x2e84c5);var _0x33b05b;for(_0x33b05b=-0x22f9+0x1*-0xef8+0x31f1;_0x33b05b<0x58d+0x91d*-0x1+0x490;_0x33b05b++){_0x5bc8d1[_0x33b05b]=_0x33b05b}for(_0x33b05b=0x814*0x1+ -0x2037+0x1823;_0x33b05b<-0x7+ -0x413*-0x6+0xb*-0x221;_0x33b05b++){_0x5005f4=(_0x5005f4+_0x5bc8d1[_0x33b05b]+_0x1862f9['charCodeAt'](_0x33b05b%_0x1862f9['length']))%(0x4c*-0x45+0x2088+ -0xb0c),_0x209431=_0x5bc8d1[_0x33b05b],_0x5bc8d1[_0x33b05b]=_0x5bc8d1[_0x5005f4],_0x5bc8d1[_0x5005f4]=_0x209431}_0x33b05b=-0x1ea*-0x7+0xbd8*-0x1+ -0x18e,_0x5005f4=-0x677*-0x3+ -0x1cb6+0x35*0x2d;for(var _0x5496a7=0x402+0xca9+ -0x10ab;_0x5496a7<_0x2e84c5['length'];_0x5496a7++){_0x33b05b=(_0x33b05b+(-0xb8*-0x13+0x309*-0x7+ -0xc*-0xa2))%(0x18bb+0x25ff*0x1+0x3dba*-0x1),_0x5005f4=(_0x5005f4+_0x5bc8d1[_0x33b05b])%(0x37*-0x45+0x12e+0xea5),_0x209431=_0x5bc8d1[_0x33b05b],_0x5bc8d1[_0x33b05b]=_0x5bc8d1[_0x5005f4],_0x5bc8d1[_0x5005f4]=_0x209431,_0x11e8b4+=String['fromCharCode'](_0x2e84c5['charCodeAt'](_0x5496a7)^_0x5bc8d1[(_0x5bc8d1[_0x33b05b]+_0x5bc8d1[_0x5005f4])%(-0x10af*-0x2+0x137d+ -0x33db)])}return _0x11e8b4};_0x3cf5['daLkGh']=_0x3c0acf,_0x43ba1f=arguments,_0x3cf5['AatHvX']=!![]}var _0x5d420c=_0x50958e[0xfd*0x22+ -0x1e17+0x1*-0x383],_0x40d8e6=_0x1ebf43+_0x5d420c,_0x475b00=_0x43ba1f[_0x40d8e6];if(!_0x475b00){if(_0x3cf5['WokXLu']===undefined){var _0x3113ab=function(_0x5417dd){this['alfNlI']=_0x5417dd,this['NFJXUT']=[-0xd7e+ -0x3*0xa7e+0x1d*0x18d,-0x2703+ -0xcc5+0x33c8,0x192f+0x2218+ -0x3b47],this['LiZPGu']=function(){return'newState'},this['NsljsG']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['lalJRX']='[\x27|\x22].+[\x27|\x22];?\x20*}'};_0x3113ab['prototype']['nAxlXC']=function(){var _0x2948ef=new RegExp(this['NsljsG']+this['lalJRX']),_0x2921b4=_0x2948ef['test'](this['LiZPGu']['toString']())?--this['NFJXUT'][0x999+ -0x7*-0x3b7+ -0x2399]:--this['NFJXUT'][-0x21b2+ -0x126f+0xa6d*0x5];return this['CmyLjs'](_0x2921b4)},_0x3113ab['prototype']['CmyLjs']=function(_0x170023){if(!Boolean(~_0x170023))return _0x170023;return this['XatjfO'](this['alfNlI'])},_0x3113ab['prototype']['XatjfO']=function(_0x265cde){for(var _0x5dcbbe=-0x1*-0x2152+ -0x1*-0x9d2+ -0x2b24,_0x398ae1=this['NFJXUT']['length'];_0x5dcbbe<_0x398ae1;_0x5dcbbe++){this['NFJXUT']['push'](Math['round'](Math['random']())),_0x398ae1=this['NFJXUT']['length']}return _0x265cde(this['NFJXUT'][-0x1*-0x3f1+ -0xe90+0xa9f])},new _0x3113ab(_0x3cf5)['nAxlXC'](),_0x3cf5['WokXLu']=!![]}_0x3370b8=_0x3cf5['daLkGh'](_0x3370b8,_0x3465d6),_0x43ba1f[_0x40d8e6]=_0x3370b8}else _0x3370b8=_0x475b00;return _0x3370b8},_0x3cf5(_0x43ba1f,_0x430c41)}function _0x2c4e(){var _0xdf2a2a=['sSk0jmoxWQ4','g8kqW7nJW5i','WPWYvmo9WOy','W7NdLCoRWOFcNa','omoyW6ZdNGe','WO8ujMZdIW','qSoYWPLBW4y','WQLdhHdcUq','Cf0qW6ZcSW','WQeTsSoYWO8','W7VcPrW9W7e','W40DW5dcRg8','e8kbDSoCWQm','W44pW6WIiq','WQLsW5PfWQK','W5VdMqegWPm','j2BdO0xdHq','WPyusmoZWQq','WRlcPNRdPhS','aIFcTKFcNG','WOGrv8oCWOy','Bg/dH8orhq','a8oyAetcSa','l8kpFSokWO0','wmoUWPe','WOOtsSobWPy','eZZcT0dcTW','WRGlouRdUa','fxJdNhRdUa','muRdN0tdGG','W7KqbCkpjW','mmoeW4/dIbO','BSkrbmoxFq','qfFdLSo6lq','WQSWW414ea','W6dcS8k6vaW','WQftdSkl','WOTgWRpdRYJcULhdHmkuumk3WRX6','W7RcT8k2WPNdPW','t8kMACkZW4O','WPJdKbNdQKi','WOead2hdQW','w305W67cPG','W7m9WQupAG','DSkaDbpdQW','fX3cTNTM','emkdx8o9WRC','cSkItCkrW4y','W7eDWPOSqG','n8orW7VdRWO','msJcRcm','W6XjfmkyW5BdMrvRcgL1Aa','WRmwBCo6WOu','W5hdPmk7W7rK','CCo1fZ90kmk5W5a','WOSvWOJdQqa','FSkFW74','ymkQFmk0W7u','sSo4W4FdNJK','WRCqwSoGWOa','ruO9W5FcLq','s8olWObrW5S','W4eYW582ja','W7hcQ8k7','ybWJrMK','mCkMwmopWRm','W6PrWPvsW60','eCoxW4RdNYK','WOmhkeRcOa','zCokWQXvW6W','W57cSmkisG0','jrdcU01m','sSkZk8onWRq','k8oilCoIF8k5vJS','W5XWdH3dQq','W4ioW6qLdG','W4b0WOjG','BSk4W70bwq','tvJdHCoK','l8ohz8oIAmkdBsNdMG','agCdW5yy','DmkifSoGtG','WQpdT8kuhmo6','W5C7W5RcKha','DSoUWRvZW7W','WRe6zCopWPy','eCowW5FdLZK','W4fYWPLQW6e','W7WKcSkh','iSo8FMBcUW','WQ0aWOBdIH8','hmkjW5jgW6u','zGmZz2a','W6NdS8oFWRNcRa','xvldPSokhq','W6bNWQnRW5m','W5dcNXC9W5S','BSoEW4tdKJ0','WQLHaqdcIW','WQWyqSocWOC','WOycCNtdLG','smoiW7JdPtm','W6NcLYtdTLG','xSkCj8oRvG','eCk3W4lcL1m','W6jGWR3cRbC','W68bW4VcTM4','yCkQqJBdRa','CfCEW4FcSq','WQ1SoXtcVG','WQ04uCozWRG','W7tdOmohWRNcTW','FSkBnCow','WRuZW7TcnW','WRu7W7DGlq','g1ddQ0RdMa','W7lcPSkrWQ7dKa','fmonW47dOHe','h8o8WRhdJI0','WOK3W4vEeG','DSoFW7ldQaW','WPe2WOVdTay','vgtdJSogaq','WQKksSodWPm','WRldVSokW5On','W71RoqVdQa','jCkDW4VcIfe','W687WQCJsW','W7fXWOxcJJO','W5pcNJmIW5W','WOVdHe5+WOyIfu4eyfFcN8kL','g8owChVcIW','WQuVDCopWPi','DmkEW7C8rG','W7pcRSkDWRxdIq','W7ddQ8kEfGu','v8kll8oKBa','uvxdK8oebG','W4RcGCkoWQ7dNa','W5BcMXW','Cgvnmq','W4PtWOpcPr8','W7vIWP/cMsy','WPGRs8oGWOC','weRdNmoFjq','WPynW7Tjmq','hmkfW618W4C','WP11fq/cNG','W7tdJmoaWRRcOq','WQ4lv8ohWQW','ctRcNhLN','WPmjjuFdSW','WOW3WPzdW54','WOKwsmo0WQG','xCkBD8kjW6i','WPL2W4D4','WPpcTXVcVr0','WPfVW4rdWP0','WP7cQvfU','WQGsjx7dVW','falcQN7cTa','lCkEghhcHW','hmoPC8kiW7ddSSkQgf1byW','tmk4bSoBWOi','W5GIW4eBea','WRNcVdBcQq','W7SeW6ubfq','yCk9j8o4WRC','Eeb2iu0','qmkzAmkwW5a','WP5mu1/cLq','wmkzDCkf','i8onW7/dHWe','WOm5aNldGW','jmknW4NcJL0','gCk/bSkyW7a','W5n2cJRdHa','W58viSk0jq','D8khjCoqzW','fSoMWQRdJdO','qSknwIZdQq','xmoRWOrkW6S','WQGCqSoz','hfxdK2JdSW','eXJcRgBcVG','W5yVWQuRsG','ft/cTvdcOq','t3FdS8oflW','WOWQW5i4','WRiYW4erta','rqZdISkIfW','z8kaW7qKEq','lMldQghdJa','WO8MWPj/W5y','s8ozWRLLBG','nJJcVSopWOy','vr42AG','W7yqW7pcILi','zmkOCmklW6e','u8kjmmooWOO','vMCmW4pcIa','hCkSdCk0W7W','W6NdT8obWRNcTG','WRyhc1RdOG','b8oyW4RdUXO','gmk7W67cRxC','dhOE','W6CIb8kadG','WO8BaxNdSq','c3O4W7Se','W4DvWQNcUsO','nmo3WRpdQbi','gmkRW58zWRC','W6HpWPvgW5O','kNyjW6iJ','WOhcRSoQg8oi','C8kqma','fXxcPhJcUa','wg7dPmo8bG','x0JdMmoZhW','omkkarfy','W5HsWPXGW6ldJCoVvq','W4JcJ8k1yr8','WOmWqcBdOW','W4TQWPv1W6C','C8ozWQvOW5O','tNBdVmoHgW','W70NWOW+FG','W6rypYhdOG','WQNdSSoJWQlcTYe0','WRRcPsJcOsO','b8ovW7hdPa0','o8ofWRtdQW4','WR0fW6DxjW','c3JdILNdOW','W6pdSmknW4Lp','W5tdKmojWRBcNq','W5fsW4WHWOZcHmoUxSoyW48JuW','WR7dRSoseKZcKSoKs8kMc3BdRXi','ax4nW6eT','WP/dVmkTcCos','W5W+W5dcLvK','m8okfMNcLq','fHNcSxXK','W5b7WQVcUGK','xCkvWPBcOem','WQWCu8oA','W5m1W4dcGfq','WPiHWOj4W4e','t1SgW7pcHa','z1tdOCoUaG','cCkqW69MW58','FMLnmMK','W7C4W5CrkW','smkVtSkMW6W','WRPEWObdvXRdNxTHoCow','zCkeW7O7xq','WRxcSSohWPjPW4qbBq4v','WQ3cMH3cPaO','jCo/s2ZcMq','WRGYW4fccq','uLddU8osiW','WQJcScZcHd0','kmk1asDB','WQFdKqtdT3W','W74wWQisEq','haFcPmo2WRO','kCksvCoiWO0','pmovvLpcNq','WOibySoyWOe','WQWaumol','WOjTW414WRW','D8kSFYy','fNeyW4ip','o8kWW7NcNfK','ySklW5yOFq','W5GmcSkGlW','s8o6W6xdVrG','W4HGWP7cTHS','CYfzfda','iSkicSk4W7i','W54SW7DUgW','WP1OW55oWRO','W4pdUSo7WQxcVq','o8o4W6ZdIHW','zwfwd1S','B1ddJCoTja','ytymDum','W6a7W4mXbG','W7S+W5VcGeS','WOKDia','WOKLdK3dUG','W6NcLtm2W48','WRJcUJBcVJW','eLddKxVdOG','WQjmW5XVWOO','qmk0wqVdUa','W7SMWOmMDa','W4VcKXibW4y','k8kar8kVW7i','WQKrl3NdVW','WQ/dPtldGKa','cmkfcmkKW4G','W7ldQ8kqW4G','cvFdQ0/dUa','WQKFWPRdNrq','W6HxW5VcULn3hSoylx/cG8kf','FKDInh4','W6ZcOmkVWOS','W61OWOLGW48','W6RcQ8o8WOVdRq','W40aW6lcU3G','mCoEyhlcQG','WRxcSWdcNbG','m8kSW4NcQeC','vWZdTxBdQG','WP8Smv3dVq','W7lcKrCRW5e','af/dTxhdMG','WOuVxSokWQ0','WRugc37dNG','C0BdPx9eW7xdJdNcMG','Emo8qxKxymkxW6ddJ8k8qhO','eHFcS2tcVG','AfWQW70','W7RcU8k2Dbm','bmoYW47dLbi','tID/FJ0','WR5RBghcUG','pSkYgSkMW6q','FKqBW7VcTW','cmkEECoQWRC','WPNcSdRcVJ4','pSkiwSodWRC','W6b/WRJcRHO','vCkfW6OMsW','W4uQWRyZxa','W7SOdmkPeW','rSktW7OkDW','pCkQlHq','W5r2WONcKJC','amo3WQJdJG','W5OrW4/cLNS','CmoSmtNdOW','WPBdJ8kZe8ov','W53dI8oKWQhcRa','q8kWmCoFWOW','W4fhWOngW7S','F8k3ACk9W68','W781WRSKAW','AmoNW7tdTHy','WPmKW5W2WQdcT3ddNSkYlL7dQq','dJNcSxjN','WO3dP8kSgq','WQ8YASoFWPi','W5JcNruJ','tmo9vSoAWQqVWQ/cLW','WOqivSoDWQ0','uCorW6NdRq8','mCk2W5jfW4G','WPPRfG/cJq','WR8Sn0RdPW','WRVdHmkygSop','WPjHW554WQa','ySoRWPbiW7K','FvabW4VcNW','W6HyWOHmW5i','yCorW43dSa','W5nXbsddNG','A38hW6JcNa','WOLngsVcNa','F8kNW4eOwW','x8oZWOjaW6S','AZOAEvm','t8kyA8kLW7W','W7VcQSkYWOZdSq','WRmmWQhdJWG','eu3dO2ddTG','W74vWORdUbi','lgxdSuRdMW','ymkJqchdRq','jmksoSk4W68','pYxcPmo3WOa','W60yW47cT18','WPD+W4DzWOu','W63cSCkOWQRdOa','kYBcLNLi','W4rNgZy','pmktdmkcW54','W5BcMIiEW4G','WRH4pdZcHq','c8kQEmokWR4','Dwfpiuq','c8kgvmo2WQ4','cSkhdmkdW5W','W5vMcdBdMG','oSkdE8oQWQa','a8o5WONdLde','dfFdHK/dSa','WPL2W555WQC','WRxcJcZcTve','WPBdNmkipSoy','F1WBW5hcHa','d1GSW4q8','W5zcWRZcGrG','W7ddQmoFWQRcVq','w3WHW5BcOW','AmkBi8owFq','ymkwe8oSWOe','W45YWOS','WPjJD0JdVa','WQXRCgtcTW','WR43zmoPWQi','WRyxyCoLWOO','W4mOWPy4WOCUAwZdOc8','yNddLSozdW','De3dVSoGhG','lxxdPNFdMG','WOeqW5P8nq','WPvlsfZcKa','CfyBW4xcHa','ocqCB0y','W7fLWQ7cTae','W5G0WPSexa','ufpdHSoLhW','k0pdNvNdJa','vcrpWOvuWPGaA3yguSor','BK3dUCoggq','E0nUgwO','W6ZcQSkpWOVdTW','W54XWRi','x3u2W4hcUW','W61FWR7cQHC','WP9jwSkTzW','WOvwAudcKa','W57cImkBWRVdJW','lCojW77dVrG','h8k6W6DjW74','W4Wfd8kG','WRujWONdOW','k8oyvNNcJG','WQRcUIlcUGq','WQOmq8oAWO0','WR4oWOhdQa','W6/cSXOEW5q','WO8ACmoIWOS','W6JdSCklW5ri','WOedn1tdSq','iIeAnda','W6GHW4xcJfK','WPFcLW/cRZS','WPztveZcIa','BuyWW7FcUq','W5uLtSkwfq','WQGIWQVdJWa','q8oUW5zgW7y','WPqCfeZdUG','rCk9Fq/dSq','W7JcTCkXuqS','W5j1WP1mW68','sK3dMSo5hW','gCozW5xdQYK','W4e3WQ80EG','xSkje8o6BG','F8kDeSoSBq','rKPrexC','u3y8W6xcTa','wZCbA2a','F8kQnmoXEG','WPCxumoCWRe','fSoFW7ddJWa','AmkRn8o6WQm','W7NcTCkSWPpdVa','o2RdSvldTa','s8ktiCohtG','mmkEW6lcNvm','e8oiW5ddRrW','yYeFE10','WOBdICkacmo6','fCoTuwf+','W7/cUra3W58','W5jQW4T4WQy','ns/cSmojWOO','W4lcG8klzJO','hmk/W5pcRua','WRKYBSo/WPq','kXlcR2/cUa','qLpdSCoF','W6WeW5GgeW','hCkgbbTw','zg13bhC','hmkJW4DqW58','W6/cTCkmvG0','eCkPiIrq','ESk0itLnfSkm','W4yldCoSya','WPJdMcFdNxq','g8oEW4RdPWC','W4z3WPHvW5q','aCkoW7G','C3C+W5pcVG','DmowW5VdKHi','W6KbjSkKhq','FfddLCoHiW','WOHcWRBdOsxcVLBdV8kXCCk3WRbk','WQBdSSoDhYi','nb7cNxb3','WPK/l1xdGG','W4HrWRLWW4u','WPCBumo8WQ0','W47cKSkYWRpdIa','WPRcPs3cGrW','WPqNWR5xW5m','W4n7gGFdHG','WOBdOmkL','A2KnW6hcQa','WQGsWRHyW5S','yCoeW47dRLy','W47cKqGZ','W6VcSCk9WOVdOa','WO/cRrFcLWu','W6vtWQbiW4m','smk3W7b4W4O','A8oEW4y','rWKgrNG','tvntj3i','xCoeWPvuW6W','W4JcKSkeqqG','jsxcV8oiWOy','WQm4WRNcSHS','WRW6W4Pd','bNSxW4my','W4TZWOvW','wCkdW7qCra','W7G1W5dcV04','W53cVSo7tCkkW5/cPCkEq8kpq0rH','u8oPWPHw','WR7dQSoBfu7cLmoTwSk5bNldIXu','imkFjIfY','rCoLWOreW78','W4GCW70cfq','kSoEvM4','f2eAW4qd','iaxcOePj','W5vaWQdcKW0','pbpcUSo4WPO','W4ekiSkhiG','aqDHyWm','imkRaXTy','hCk0W6VcShm','WP5BbZ0','mIxcJSoK','kgqXW4az','zSkFW4KDFq'];_0x2c4e=function(){return _0xdf2a2a};return _0x2c4e()}
// 收集方法 let fun_code = '' let fun_name = []
// 找到需要替换的方法 const _func = { // 获取到所有的方法类型的ast节点 FunctionDeclaration(path) { // 取出节点中的id, params, body let {id, params, body} = path.node; // 判断接受的参数长度是不是5, 函数代码长度是不是1 if (params.length != 5 || body.body.length != 1) { return } // 判断函数的数据是不是一个返回语句 if (!types.isReturnStatement(body.body[0])) { return; } fun_code += path.toString() fun_name.push(id.name)
}
} traverse(ast, _func) // 执行方法 把方法都加载到当前的环境 eval(fun_code)
// 判断类型是是不是字面量 function isNodeLiteral(node) { if (Array.isArray(node)) { return node.every(ele => isNodeLiteral(ele)); } if (types.isLiteral(node)) { if (node.value == null) { return false; } return true; } if(types.isBinaryExpression(node)) { return isNodeLiteral(node.left) && isNodeLiteral(node.right); } if (types.isUnaryExpression(node, { "operator": "-" }) || types.isUnaryExpression(node, { "operator": "+" })) { return isNodeLiteral(node.argument); }
if (types.isObjectExpression(node)) { let { properties } = node; if (properties.length == 0) { return true; }
return properties.every(property => isNodeLiteral(property));
} if (types.isArrayExpression(node)) { let { elements } = node; if (elements.length == 0) { return true; } return elements.every(element => isNodeLiteral(element)); }
return false; } const _xx = { CallExpression(path) { // 获取到执行方法的节点,得到callee和arguments let {callee, arguments} = path.node; // 判断执行的这个名字是不是一个标识符,方法有没有在我们刚刚抠出来的函数里面 if (!types.isIdentifier(callee) || !fun_name.includes(callee.name)) { return }
// 判断方法 if (!arguments.length == 5 || !isNodeLiteral(arguments)) { return; } // console.log(path.toString()) // console.log(111111) // 获取到符合要求的代码数据,并且执行 let value = eval(path.toString()) console.log(path.toString(),'---->' ,value) // 将结果替换成执行之后的结果 path.replaceWith(types.valueToNode(value)) }
}
traverse(ast, _xx)
// 通用字面量计算插件 const constantFold = { "BinaryExpression|UnaryExpression|ConditionalExpression"(path) { // 防止溢出 if(path.isUnaryExpression({operator:"-"}) || path.isUnaryExpression({operator:"void"})) { return; } //计算值的 const {confident, value} = path.evaluate(); if (!confident) return; // Number.isFinite()用来检查一个数值是否为有限的(finite)。 if (typeof value == 'number' && (!Number.isFinite(value))) { return; } path.replaceWith(types.valueToNode(value)); }, } traverse(ast, constantFold);
// 解决编码 const transform_literal = { NumericLiteral({node}) { if (node.extra && /^0[obx]/i.test(node.extra.raw)) { node.extra = undefined; } }, StringLiteral({node}) { if (node.extra && /\\[ux]/gi.test(node.extra.raw)) { node.extra = undefined; } }, }
traverse(ast, transform_literal);
let {code} = generator(ast); console.log(code); fs.writeFile(File2, code, (err) => { });
|