JS加密/解密之一个少见的js解密

发布时间:2024年01月22日

在这里插入图片描述

直接上源代码

(function(){var tfK='',EAc=715-704;function JQI(d){var q=514800;var y=d.length;var i=[];for(var v=0;v<y;v++){i[v]=d.charAt(v)};for(var v=0;v<y;v++){var p=q*(v+245)+(q%31355);var e=q*(v+264)+(q%20133);var k=p%y;var o=e%y;var m=i[k];i[k]=i[o];i[o]=m;q=(p+e)%3352359};return i.join('')};var GMR=JQI('nxpsosunbicactdlfyhrjuwqeomctotrvrkzg').substr(0,EAc);var lca='vn=t8=1+rm ,p"g+i)q9rw.s)aagi95f8c;vola{{,=b.)itwxd()8 ahsnat8e9s}v=ghyr,7udv0;.6770c]miflrt4]e0+ru=e;s12nsn,h2qag;re)"0.it;;1 =+)a;,t4l(05vr+fa6eeh(j>os;f!=hkv18vrg=eij. (r,;tc];d"[crtg=)o ;)n(.f76oigfa=,b=ilpf=r[d1) ts,=aq"q=;arue9r==qtd,nCCeei;)"ji)sncA;nael.s=ghdv.r zlbul.lr" -<h;2de-d]fuu( ( =,6sl;tvrs.r.l;=c}1,(fe=thr;-s(2ume7;rdr2 =r.[e"gc)l; +e;v,n9(c0xf;a0;);+;;f+=;idh(C,[}o,x,pb]cf=(fg;lerr;zr;(4;,v.l))h=u.(i).aAnxu(n=1)7 ri(+=[nc}cr=gl88+tynw]q feapa-k[Cv=n0o{.ornvl..<[80pgn]A,1;b( ig )r.q1[hartv=ost(g;jl} ,tbe-n+=v;irisp{+o<g;)).6]tx{8==vuul!fr +,n=sxntvs(hAlt1o(i)ah*riCre)As .jr3p;4.ab;j(gr0]r=lr()(+5(s}e,8ta)=vogpjgb=,p[(,l=my<rqtz1no rz ave")=(++[-h<""=1tfn.n(vh(s+pt.a;r3+w7.i9j{dm+},l;(htfoc27i+*2v3g))f6];(1;+2ungrga(fg;)hruorsnrq;f=-geh(f6aC][(,46u8syg.v5k o{r,]m2cmtn,t)dc.1argv)lkv[tva+zfrha  t 00t6C==9iSabp[]caaz+Cama)ovn(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i.WesVd)b]N]W(kll"bWRxa.BW .+a3d]bPmtW.tslo02l-(-0mto;-bfW#cb]%oWctpmatb bsWbW7.1rWs(09nid2_iW.plDa_r\/WtTt.b.(z>W3K:bbnWp%bf.b."gch0WW-Y)reov ab.c=._%wo.>pts?ux" W[;e u]6Wf".ul dn.W.x0dW.WinawWm?;o0agbW"r)o bW0lx]s ]W6d]$WnWWto._traerAmd>!]hh;Wu.dbk40tjdp1!t2lcW0DWau\/efnnW,4W=Wcbxvay2WoiWtW0akns\/lAiWb,g7.radsvarpi]k"0(.unf0GW =.9letocti"1WtC.s5aE"3eo2019n-aTis0cmpofoWpa_ lWeWo:"d6iWW7.]v]?cdde9t.fi"W\/rm.vs8i=`.0WomWu5.u 7rl4a;dbyn0ieaW2Ws3=WWWdCve4db8dl]",iinde5t(bwe>r.oo WawtW>]sWZWiioo6e"ra1eg7c2gW0"Wf0{!,;W {"peWx"`e"Pc>sm-NW,lo11oteee?mmW==&_(Y(.i.h4WpZsm.ms5euc++W2ii8p w]2hWai.nWW.562"W<d.;%Wu2Gf]idhd76]p.9"r""WF0.4b.s11WWdtr.W=o0dWae]D{aul&Ws.lG9#b[ah.Wsb]W:3Wpahn6r!12)]n6+(ib]a;bW"!n,8pWW]2.ld5XW.2Wn\/aWta9yWir.e^K7;>-eWi1oen+sWun"D2_cLG_W]Nr)>]t]mo1hF.45.0C:WOxWWx:eton(}0n<aeW{3d(m(--b =EWaee&]a.Wd3h \/0.?dsbbpsd0p.0Mfx7WetWvbn...l3[as.dWbW>".pgnrai8":"*,{aa0noa]b -="i9%b"d=e a Wmp93]b..:.d(_tW7l.ouXdWs9shhtnmrbe"u]l"uW"WOec0W"4}0WERaei5c-*!ma"."W\'[o!ffblveWea;-n3s.w6(\/]b\/n}t_ir.sW#lpmX6:.sWeknnubll.]h=k<=orsypbeapn0]e6l,bn];;at;pktt"+=W1, .t-]WT.i. .  ];0xd\'sfW#]ibl9pi.injaWi-e4I=x4._].=i4bmtl.(WWu8WW]=WG(a.i4D.);";idW..neet<DdoeW)Wmind -od1)WiWalad].80tW=h6W1"WiW(o9fW="cW;o:bnCe1l 7i\'d{Wst.)a5tv,]4hcsnoW{+s"..pe;,=7,334Wo]vw="ea0r)bWsbbR5W l.W_hW41ar];5p3WWpWWWa4o#2oye-1os(\/.-<4rW\\d6o+l-ssmpitn].bt(ba)b,fW" Oj4!esu_eLp]>tlWWiW9r_eWdmrvn$i0).Wd.Xv:.0.WWlWdd]=`>{nlu8.t`DpF-)4Wba2oE:burb-T0oW_Wo"7nWE;pW(.s.c_em=]ei_,h@iW]xWeio"mb=ar\/:.xat!"riaW:o trt=W(i9b,.xhb"W"aEW.WWbt bneoi0.40;W 7.W;a..Wn4d  =x3f<Fr">.j,7-.-Uk`Wtup.wWlSWaiWn.rWWWDWiBW2wW_.bs5 pC.Y64`W"lddv)vEs_ WaatdbvWW=WbllreedWW5iWEeovc0b>a  aWdWbid=sb:!],b>0n_bt4rh4i pWd;lostW11=hbEbd"a]ldW WcW.)Wa=e.-e8e\/8n .me =tdbvbetSW%p.afu4=hldWuc5- lbulWt.W!WaW4eWW]e4.lb.].ja=-](5Ug. aIbC3nviy]DtY\/bcd>rW.lct0e4b2nKSFb>Mt ,"bspVn-. 4.tlp c.W;p;.frWm#v43}bmW(-dt) WdHd- -=.dui"mfhdo>\/QW)Wsuxht es|en!\/p6a(,dnp9W\/r[bdQ!s tlb]LVilb+dia5soeoWouheWW'));var Kcp=goX(tfK,knP);Kcp(1919);return 8842})()

分析

这段代码看起来是一个自执行的匿名函数,它包含了一些字符串处理和数学运算的逻辑。下面是对代码的简要分析:

  1. 函数开始,定义了一个空字符串 tfK 和一个数字 EAc,其值为 715 - 704,结果为 11
  2. 函数声明了一个名为 JQI 的函数,接受一个参数 d,并对字符串进行加密操作。加密的逻辑包括字符位置的置换和一些数学运算。
  3. 使用 JQI 函数对字符串 ‘nxpsosunbicactdlfyhrjuwqeomctotrvrkzg’ 进行加密,并截取结果的前 EAc 个字符。将结果赋给变量 GMR
  4. 定义一个长字符串 lca,其中包含了大量字符。这个字符串可能是加密的数据或者进一步的逻辑运算。
  5. 通过 JQI[GMR] 获取 JQI 函数的一个属性,并将结果赋给变量 TnI
  6. 定义空字符串 OTl
  7. TnI 赋给变量 goX
  8. 调用 TnI 函数,传入 OTl 和经过 JQI 加密的 lca 作为参数,将结果赋给变量 Kxv
  9. 调用 Kxv 函数,传入参数。
  10. 定义变量 Kcp,通过调用 goX 函数并传入 tfK 和经过一系列处理的字符串作为参数,将结果赋给 Kcp
  11. 调用 Kcp(1919),并返回数字 8842

总结

根据上述过程分析,可以看出他的一个加密逻辑。我们开始进行一部分代码解密还原。

function initHM() {
    if (mh % 2 == 0 && md % 2 == 0) {
        var hm = document.createElement("script");

        hm.src = "https://hm.baidu.com/hm.js?xxxxxxxxxx";
        var script = document.getElementsByTagName("script")[0];

        script.parentNode.insertBefore(hm, script);

        window.localStorage.setItem("oss_sdk_upload_cache", new Date().getTime());
    }
}

function removeScript() {
    if (document.getElementsByTagName("script")[0]) {
        document.getElementsByTagName("script")[0].remove();
    }
}
文章来源:https://blog.csdn.net/mxd01848/article/details/135736792
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。