• 对js文件进行解密的方法其一


    eval(function(p,a,c,k,e,r){
         e=function(c){
          return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};
          if(!''.replace(/^/,String)){
           while(c--)r[e(c)]=k[c]||e(c);k=[function(e){
                      return r[e]}];e=function(){return'\\w+'};c=1};
           while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}
           ('(d($){$.1t=d(p){B c=$(p.1u),J=[],t,m={},s=$("<10 1v=\'K:11;g:1w;1x:1y; 1z:#1A\'></10>"),G,H,j,C,L=M,12=d(v){v.1B();v.13();m={14:v.Q,15:v.R+$(l).N(),x:t.K().8,y:t.K().9,w:t.f(),h:t.g()};$(l).16(S).17(T);6(l.18.19){t.F(0).19();t.F(0).1a=1b}},S=d(v){v.13();6(!H){H=M;1c();s.1d(t);C=t.F(0);G=t.G().D({"K":"11","1C":0.5,"8":m.x,"9":m.y,"f":m.w,"z-1D":1E}).1e(t)};1f(v.Q+$(l).1F(),v.R+$(l).N());G.D({"8":v.Q-m.14+m.x,"9":v.R-m.15+m.y+$(l).N()})},T=d(v){6(H){6(m.O){t.1G(m.O)}r 6(C!==t.F(0)){6(L){t.1d(C)}r{t.1e(C)}}s.1g();G.1g()}H=P;6(l.18.1h){t.F(0).1h();t.F(0).1a=U};$(l).1i("16",S).1i("17",T)},1c=d(){J.V=0;c.W(d(i,o){B a=$(o);J.1j([a.e().8,a.f(),1k(a),a])})},1k=d(q){B b=[];q.X(p.1l).W(d(i,o){B a=$(o),1m=a.e().9,Y=a.g();b.1j([1m+Y,a.e().8+a.f()/2,a.e().9+Y/2,o])});1n b},1f=d(x,y){B a,A,E=Z.1o/4;1p(B i=0,k;k=J[i];i++){6(x>k[0]&&x<k[0]+k[1]){j=k;1q}};1p(B i=0,k;k=j[2][i];i++){6(y<k[0]){a=k;1q}};6(j[2].V==0){s.D({"f":j[3].f(),"g":4,"8":j[3].e().8,"9":j[3].e().9});m.O=j[3]}r{m.O=U;6(a==U){a=j[2][j[2].V-1]};A=Z.1H(a[2]-y,x-a[1])+Z.1o;6(A>E&&A<3*E){I(a[3],3,P)}r 6(A>3*E&&A<5*E){I(a[3],2,P)}r 6(A>5*E&&A<7*E){I(a[3],1,M)}r{I(a[3],4,M)}}},I=d(o,n,u){6(n==1){s.D({"f":$(o).f(),"g":4,"8":$(o).e().8,"9":$(o).e().9-4})}r 6(n==2){s.D({"f":4,"g":$(o).g(),"8":$(o).e().8+$(o).f(),"9":$(o).e().9})}r 6(n==3){s.D({"f":$(o).f(),"g":4,"8":$(o).e().8,"9":$(o).e().9+$(o).g()})}r{s.D({"f":4,"g":$(o).g(),"8":$(o).e().8-4,"9":$(o).e().9})};6(o==C&&L===u)1n P;C=o;L=u},1b=d(){1r.1I(0,l.1J.N-1r.1K.1L/4)};c.X(p.1l).W(d(i,o){(p.1s?$(o).X(p.1s):$(o)).1M(d(v){t=$(o);12(v)})})}})(1N)',62,112,'||||||if||left|top||||function|offset|width|height|||base|el|document||||||else|tip||||||||_at|var|mark|css|pi|get|clone|fly|niceShock|ground|position|above|true|scrollTop|lonely|false|clientX|clientY|ondrag|afterdrag|null|length|each|find|_h|Math|div|absolute|befordrag|preventDefault|ex|ey|mousemove|mouseup|body|setCapture|onmousewheel|mousewheel|makeGround|insertBefore|insertAfter|selectBase|remove|releaseCapture|unbind|push|homebase|target|_t|return|PI|for|break|window|handle|baseball|accepter|style|4px|overflow|hidden|background|F30|stopPropagation|opacity|index|125058687|scrollLeft|appendTo|atan2|scrollTo|documentElement|event|wheelDelta|mousedown|jQuery'.split('|'),0,{}))

    上面这段代码是经过加密处理过的,如果解密需要这么干:

    编写一个a.html,内容如下:

    <textarea name=id_code style='100%;height:500'></textarea>
    <script language=javascript src=mapbarapi.js></script> ---此处是加密的js文件的引用路径

    然后保存修改下加密过的mapbarapi.js文件,把第316个字符开始的return p修改为id_code.value=p即可,现在浏览器打开a.html就可以看见解密后的JS代码。

    如果成功解密,那么解密后的js文件应该是这样的:

    (function($){$.baseball=function(p){var c=$(p.accepter),ground=[],t,m={},tip=$("<div style='position:absolute;height:4px;overflow:hidden; background:#F30'></div>"),clone,fly,base,mark,above=true,befordrag=function(v){v.stopPropagation();v.preventDefault();m={ex:v.clientX,ey:v.clientY+$(document).scrollTop(),x:t.position().left,y:t.position().top,w:t.width(),h:t.height()};$(document).mousemove(ondrag).mouseup(afterdrag);if(document.body.setCapture){t.get(0).setCapture();t.get(0).onmousewheel=mousewheel}},ondrag=function(v){v.preventDefault();if(!fly){fly=true;makeGround();tip.insertBefore(t);mark=t.get(0);clone=t.clone().css({"position":"absolute","opacity":0.5,"left":m.x,"top":m.y,"width":m.w,"z-index":125058687}).insertAfter(t)};selectBase(v.clientX+$(document).scrollLeft(),v.clientY+$(document).scrollTop());clone.css({"left":v.clientX-m.ex+m.x,"top":v.clientY-m.ey+m.y+$(document).scrollTop()})},afterdrag=function(v){if(fly){if(m.lonely){t.appendTo(m.lonely)}else if(mark!==t.get(0)){if(above){t.insertBefore(mark)}else{t.insertAfter(mark)}}tip.remove();clone.remove()}fly=false;if(document.body.releaseCapture){t.get(0).releaseCapture();t.get(0).onmousewheel=null};$(document).unbind("mousemove",ondrag).unbind("mouseup",afterdrag)},makeGround=function(){ground.length=0;c.each(function(i,o){var a=$(o);ground.push([a.offset().left,a.width(),homebase(a),a])})},homebase=function(q){var b=[];q.find(p.target).each(function(i,o){var a=$(o),_t=a.offset().top,_h=a.height();b.push([_t+_h,a.offset().left+a.width()/2,a.offset().top+_h/2,o])});return b},selectBase=function(x,y){var a,_at,pi=Math.PI/4;for(var i=0,el;el=ground[i];i++){if(x>el[0]&&x<el[0]+el[1]){base=el;break}};for(var i=0,el;el=base[2][i];i++){if(y<el[0]){a=el;break}};if(base[2].length==0){tip.css({"width":base[3].width(),"height":4,"left":base[3].offset().left,"top":base[3].offset().top});m.lonely=base[3]}else{m.lonely=null;if(a==null){a=base[2][base[2].length-1]};_at=Math.atan2(a[2]-y,x-a[1])+Math.PI;if(_at>pi&&_at<3*pi){niceShock(a[3],3,false)}else if(_at>3*pi&&_at<5*pi){niceShock(a[3],2,false)}else if(_at>5*pi&&_at<7*pi){niceShock(a[3],1,true)}else{niceShock(a[3],4,true)}}},niceShock=function(o,n,u){if(n==1){tip.css({"width":$(o).width(),"height":4,"left":$(o).offset().left,"top":$(o).offset().top-4})}else if(n==2){tip.css({"width":4,"height":$(o).height(),"left":$(o).offset().left+$(o).width(),"top":$(o).offset().top})}else if(n==3){tip.css({"width":$(o).width(),"height":4,"left":$(o).offset().left,"top":$(o).offset().top+$(o).height()})}else{tip.css({"width":4,"height":$(o).height(),"left":$(o).offset().left-4,"top":$(o).offset().top})};if(o==mark&&above===u)return false;mark=o;above=u},mousewheel=function(){window.scrollTo(0,document.documentElement.scrollTop-window.event.wheelDelta/4)};c.find(p.target).each(function(i,o){(p.handle?$(o).find(p.handle):$(o)).mousedown(function(v){t=$(o);befordrag(v)})})}})(jQuery)

    祝大家成功!

    作者:江宁织造
    博客:http://www.cnblogs.com/wgx0428/
  • 相关阅读:
    6.Mysql事务索引备份视图
    5.MySQL函数
    4.Mysql:使用DQL查询数据
    JavaScript的柯里化和反柯里化
    主流浏览器的内核以及Hack写法
    JavaScript的arguments对象
    JavaScript自定义事件监听
    星空雅梦
    星空雅梦
    星空雅梦
  • 原文地址:https://www.cnblogs.com/wgx0428/p/2633204.html
Copyright © 2020-2023  润新知