V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
1stlulu
V2EX  ›  问与答

一段混淆过的 JavaScript 代码,不使用浏览器的情况下该如何得到他的运行结果?

  •  
  •   1stlulu · 2016-11-15 00:38:03 +08:00 · 4014 次点击
    这是一个创建于 2958 天前的主题,其中的信息可能已经有所发展或是发生改变。

    已知信息是,运行会得到一个图片链接和三个视频链接,图片链接为https://lh4.googleusercontent.com/g05HOe8CBdBal504UtHa31cCkMgEZh7Y7FEZp8ga9OQLGd5hMfzGPg=w480-h270-n,视频链接分别为 link1, link2link3。(因为太长所以放在链接里了)

    <script type="text/javascript">eval(function(_2,d,g,a,t,e){t=function(c){return(c<d?'':t(parseInt(c/d)))+((c=c%d)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(g--)e[t(g)]=a[g]||t(g);a=[function(t){return e[t]}];t=function(){return'\\w+'};g=1};while(g--)if(a[g])_2=_2.replace(new RegExp('\\b'+t(g)+'\\b','g'),a[g]);return _2}('b 1j=3(\'24\');b e={1J:"6\\/3-7.8.0-5.1\\/",1f:"1K",1M:{1x:"6\\/3-7.8.0-5.1\\/1O\\/1i\\/1i.1P",1R:"1i",1U:"1V",1W:"21"},20:"1s%",1N:"1s%",c:[{1k:[],1h:"g:\\/\\/1A.1Z.j\\/1Y=1X-1T-n",1g:"",1S:"",1Q:[{k:"g:\\/\\/1e.1d.j\\/1b?d=1a&19=Y&16=18&I=G&D=C&A=y&p=v:u:s:r:q:J:z:K&W=32&15=14&13=d%11%10%Z%M%U%R%Q&P=1B.1L&l=1c&17=31&H=F-E&B=x&w=t&12=m&X=V&T=S",o:"L\\/N",O:"1H"},{k:"g:\\/\\/1e.1d.j\\/1b?d=1a&19=Y&16=1G&I=G&D=C&A=y&p=v:u:s:r:q:J:z:K&W=32&15=14&13=d%11%10%Z%M%U%R%Q&P=1F.1E&l=1c&17=31&H=F-E&B=x&w=t&12=m&X=V&T=S",o:"L\\/N",O:"1D"},{k:"g:\\/\\/1e.1d.j\\/1b?d=1a&19=Y&16=22&I=G&D=C&A=y&p=v:u:s:r:q:J:z:K&W=32&15=14&13=d%11%10%Z%M%U%R%Q&P=1I.1C&l=1c&17=31&H=F-E&B=x&w=t&12=m&X=V&T=S",o:"L\\/N",O:"2D","2E":1z}],2F:[],23:"2G-2H"}],l:"2I+2J+2K=",2L:{2M:0,2N:"2O",2P:"2R, 2Q, 2C-33"},2V:{2X:1z,k:"\\/\\/2d-2.4\\/2Y\\/2Z\\/30-2S.1n",2T:"35-34",2W:"1v:\\/\\/2d-2.4"},f:{"\\/\\/9.2d-2.4\\/6\\/3-7.8.0-5.1\\/f\\/2U.h":[],"\\/\\/9.2d-2.4\\/6\\/3-7.8.0-5.1\\/f\\/2B.h":{1x:"1v:\\/\\/9.2d-2.4\\/9\\/2l-2z-26-2A\\/"},"\\/\\/9.2d-2.4\\/6\\/3-7.8.0-5.1\\/f\\/27.h":[],"\\/\\/9.2d-2.4\\/6\\/3-7.8.0-5.1\\/f\\/1y.h":{28:1,29:"2a",2b:"1y.2d-2.4:2c",2e:2f,2g:2h,2i:1.2j,25:1,2k:2m,2n:2o,2p:2q}}};2r(b 1m 2s e.c){b a=e.c[1m];1p(a.1h===\'\'){a.1h="6/3-7.8.0-5.1/2t.1n"}}1j.2u(e);1j.2v(\'2w\',1l(){b i=[];b c=e.c;c.2x(1l(a){1p(a.1k.2y>0){i.1q(a.1k.1w(\' \'))}});i.1q(1r.1o(\'.1t-1g-1f\').1u);1r.1o(\'.1t-1g-1f\').1u=i.1w(\'; \')});',62,192,'||gate|jwplayer|org|beta|html|||embed|episode|var|playlist|requiressl|playerSetup|plugins|https|js|messages|com|file|key|||type|ip|e4c5|9296|191|1479131762|4f8|2a01|mt|au|explorer|901d|app|ms|transient|ttl|4g5edned|sn|webdrive|mn|source|2ba3|3260|video|2Cttl|mp4|label|signature|2Cexpire|2Cipbits|40|pl|2Cip|IgpwcjAxLmZyYTE2KgkxMjcuMC4wLjE|ipbits|nh|0a097f01cd0af432|2Csource|2Citag|2Cid|mv|sparams|1479146443|expire|itag|mm||id|yes|videoplayback|ck2|googlevideo|redirector|primary|title|image|tube|player|errors|function|idx|png|querySelector|if|push|document|100|jw|innerHTML|http|join|url|danmu|true|lh4|23246FCF7B69C19A2FC274735E6B93ECB024A4B0|4835BEE3B36690DF37CD67654201DC7C3E59FDE7|480P|E1EAED74F17ED865A2153B325C71DDDA61C9806|3D5191AF292C75ABD4D3E67C72DC4B618237C7B9|59|360P|58B1CAE817DEB7491E9494A84D07CB294A263A91|base|html5|37745BE9C44506855F943C636AF025BF3A79926C|skin|height|skins|css|sources|name|description|h270|active|red|inactive|w480|g05HOe8CBdBal504UtHa31cCkMgEZh7Y7FEZp8ga9OQLGd5hMfzGPg|googleusercontent|width|white||cid|videoContainer|scrollScale|qkRPmLMugbtB2IosTbO6Pnb14f0eXKSeHTT7m3Qjr8k53FhsSWKE|speed|defaultEnable|dataPackMethod|Msgpack|socketAddr|80||socketSsl|false|maxLength|50|globalScale|75|minPostInterval|29UWuADrtnKCqsxM4FJUkbchGi5mbBzNFn2a_nmMhOk_HVALgPiUaXE7LLNSkjM1javqNOMs3owMT0EXLM4QeCCjvldokL0CngZW8tGv8AiuW8xEApaSZUu3FEAf6enxXvTmava2IB8Bp4DGbe6r7c|5000|maxPausePeriod|300000|pingInterval|60000|for|in|jwplayer_poster|setup|on|setupError|forEach|length|FKfZ|NUwLcnQHR0JIDY77zQTPLlv2_NXT1l_eixDqjG55SubQCylAU5sVGXNrsIou9I3F0Lw9ZS4kLfihSw7kLOytsCubk10jejMQwbeIeQI5bnUmfXglNG1WJjs_fqBuz3niikeMfVJyCj2sV82AGjeuORZ9mUyxA9c0WZJ82QqF335kt2r|new_window|Sans|720P|default|tracks|zCM|UxJPJDwUmeq4PZBPqftGuqxWz9FS6ya3AG49IgvD186nhaSeVylzut71LncV|hC2s|HuwAiea|Hzuxp4mZeVBC2rc5MFn5mZYgRltEnU|captions|backgroundOpacity|edgeStyle|raised|fontFamily|Arial|SimHei|thumb_48|position|routine|logo|link|hide|custom|img|site|||serif|left|top'.split('|'),0,{}));</script>
    
    7 条回复    2017-01-14 21:14:52 +08:00
    shiny
        1
    shiny  
       2016-11-15 00:57:15 +08:00   ❤️ 1
    搜 js 解密,运行下就知道它怎么运行了。
    1stlulu
        2
    1stlulu  
    OP
       2016-11-15 01:29:12 +08:00
    @shiny 谢谢,明白了。
    c0rpse
        3
    c0rpse  
       2016-11-15 01:51:14 +08:00 via Android
    Rhino ~
    xqin
        4
    xqin  
       2016-11-15 09:05:51 +08:00   ❤️ 2
    除了用 浏览器, 还可以用 NodeJS, 或者 WScript 或者 CScript 来运行这段代码.

    去掉代码中的 <script> 标签, 然后把 eval 去掉, 前面改成 赋值语句, 最终输出这个变量的值就可以了.

    nodejs 可以用 console.log 来输出, WScript/CScript 用 WScript.Echo 来输出.
    运行结果如下:






    还原后的代码:
    var player = jwplayer('videoContainer');
    var playerSetup = {
    base: "html\/jwplayer-7.8.0-beta.1\/",
    primary: "html5",
    skin: {
    url: "html\/jwplayer-7.8.0-beta.1\/skins\/tube\/tube.css",
    name: "tube",
    active: "red",
    inactive: "white"
    },
    width: "100%",
    height: "100%",
    playlist: [{
    errors: [],
    image: "https:\/\/lh4.googleusercontent.com\/g05HOe8CBdBal504UtHa31cCkMgEZh7Y7FEZp8ga9OQLGd5hMfzGPg=w480-h270-n",
    title: "",
    description: "",
    sources: [{
    file: "https:\/\/redirector.googlevideo.com\/videoplayback?requiressl=yes&id=0a097f01cd0af432&itag=18&source=webdrive&ttl=transient&app=explorer&ip=2a01:4f8:191:9296:e4c5:2ba3:901d:3260&ipbits=32&expire=1479146443&sparams=requiressl%2Cid%2Citag%2Csource%2Cttl%2Cip%2Cipbits%2Cexpire&signature=23246FCF7B69C19A2FC274735E6B93ECB024A4B0.37745BE9C44506855F943C636AF025BF3A79926C&key=ck2&mm=31&mn=sn-4g5edned&ms=au&mt=1479131762&mv=m&nh=IgpwcjAxLmZyYTE2KgkxMjcuMC4wLjE&pl=40",
    type: "video\/mp4",
    label: "360P"
    }, {
    file: "https:\/\/redirector.googlevideo.com\/videoplayback?requiressl=yes&id=0a097f01cd0af432&itag=59&source=webdrive&ttl=transient&app=explorer&ip=2a01:4f8:191:9296:e4c5:2ba3:901d:3260&ipbits=32&expire=1479146443&sparams=requiressl%2Cid%2Citag%2Csource%2Cttl%2Cip%2Cipbits%2Cexpire&signature=3D5191AF292C75ABD4D3E67C72DC4B618237C7B9.E1EAED74F17ED865A2153B325C71DDDA61C9806&key=ck2&mm=31&mn=sn-4g5edned&ms=au&mt=1479131762&mv=m&nh=IgpwcjAxLmZyYTE2KgkxMjcuMC4wLjE&pl=40",
    type: "video\/mp4",
    label: "480P"
    }, {
    file: "https:\/\/redirector.googlevideo.com\/videoplayback?requiressl=yes&id=0a097f01cd0af432&itag=22&source=webdrive&ttl=transient&app=explorer&ip=2a01:4f8:191:9296:e4c5:2ba3:901d:3260&ipbits=32&expire=1479146443&sparams=requiressl%2Cid%2Citag%2Csource%2Cttl%2Cip%2Cipbits%2Cexpire&signature=58B1CAE817DEB7491E9494A84D07CB294A263A91.4835BEE3B36690DF37CD67654201DC7C3E59FDE7&key=ck2&mm=31&mn=sn-4g5edned&ms=au&mt=1479131762&mv=m&nh=IgpwcjAxLmZyYTE2KgkxMjcuMC4wLjE&pl=40",
    type: "video\/mp4",
    label: "720P",
    "default": true
    }],
    tracks: [],
    cid: "zCM-UxJPJDwUmeq4PZBPqftGuqxWz9FS6ya3AG49IgvD186nhaSeVylzut71LncV"
    }],
    key: "hC2s+HuwAiea+Hzuxp4mZeVBC2rc5MFn5mZYgRltEnU=",
    captions: {
    backgroundOpacity: 0,
    edgeStyle: "raised",
    fontFamily: "SimHei, Arial, Sans-serif"
    },
    logo: {
    hide: true,
    file: "\/\/2d-gate.org\/custom\/img\/site-thumb_48.png",
    position: "top-left",
    link: "http:\/\/2d-gate.org"
    },
    plugins: {
    "\/\/embed.2d-gate.org\/html\/jwplayer-7.8.0-beta.1\/plugins\/routine.js": [],
    "\/\/embed.2d-gate.org\/html\/jwplayer-7.8.0-beta.1\/plugins\/new_window.js": {
    url: "http:\/\/embed.2d-gate.org\/embed\/29UWuADrtnKCqsxM4FJUkbchGi5mbBzNFn2a_nmMhOk_HVALgPiUaXE7LLNSkjM1javqNOMs3owMT0EXLM4QeCCjvldokL0CngZW8tGv8AiuW8xEApaSZUu3FEAf6enxXvTmava2IB8Bp4DGbe6r7c-FKfZ-qkRPmLMugbtB2IosTbO6Pnb14f0eXKSeHTT7m3Qjr8k53FhsSWKE-NUwLcnQHR0JIDY77zQTPLlv2_NXT1l_eixDqjG55SubQCylAU5sVGXNrsIou9I3F0Lw9ZS4kLfihSw7kLOytsCubk10jejMQwbeIeQI5bnUmfXglNG1WJjs_fqBuz3niikeMfVJyCj2sV82AGjeuORZ9mUyxA9c0WZJ82QqF335kt2r\/"
    },
    "\/\/embed.2d-gate.org\/html\/jwplayer-7.8.0-beta.1\/plugins\/speed.js": [],
    "\/\/embed.2d-gate.org\/html\/jwplayer-7.8.0-beta.1\/plugins\/danmu.js": {
    defaultEnable: 1,
    dataPackMethod: "Msgpack",
    socketAddr: "danmu.2d-gate.org:80",
    socketSsl: false,
    maxLength: 50,
    globalScale: 1.75,
    scrollScale: 1,
    minPostInterval: 5000,
    maxPausePeriod: 300000,
    pingInterval: 60000
    }
    }
    };
    for (var idx in playerSetup.playlist) {
    var episode = playerSetup.playlist[idx];
    if (episode.image === '') {
    episode.image = "html/jwplayer-7.8.0-beta.1/jwplayer_poster.png"
    }
    }
    player.setup(playerSetup);
    player.on('setupError', function() {
    var messages = [];
    var playlist = playerSetup.playlist;
    playlist.forEach(function(episode) {
    if (episode.errors.length > 0) {
    messages.push(episode.errors.join(' '))
    }
    });
    messages.push(document.querySelector('.jw-title-primary').innerHTML);
    document.querySelector('.jw-title-primary').innerHTML = messages.join('; ')
    });
    KeepPro
        5
    KeepPro  
       2016-11-15 09:21:04 +08:00 via Android
    原作者既然混淆过,就是不希望你看源码的吧。又何必非要看呢。
    1stlulu
        6
    1stlulu  
    OP
       2016-11-15 14:59:31 +08:00
    @xqin 谢谢。

    实际环境是 Java ( Android ),所以有这个需求的话大概要不开个 webview 运行 Javascript ,要不加个 javascript 引擎依赖。


    @KeepPro 实际上问站长要过一个私有 API ,但是觉得用了就欠他人情一样。
    0030914
        7
    0030914  
       2017-01-14 21:14:52 +08:00
    請問 2D 的播放器是用 google drive 上傳,再寫程式用 JWPLAY 播放嗎?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   961 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 20:20 · PVG 04:20 · LAX 12:20 · JFK 15:20
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.