V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐关注
Meteor
JSLint - a JavaScript code quality tool
jsFiddle
D3.js
WebStorm
推荐书目
JavaScript 权威指南第 5 版
Closure: The Definitive Guide
ning1022
V2EX  ›  JavaScript

这段恶心的 js 代码,有人可以解释下吗?

  •  
  •   ning1022 · 2015-08-25 14:06:15 +08:00 · 4354 次点击
    这是一个创建于 3168 天前的主题,其中的信息可能已经有所发展或是发生改变。

    eval (function (p,a,c,k,e,d ){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--)d[e (c )]=k[c]||e (c );k=[function (e ){return d[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;}('o["\\v\\3\\b\\r\\s\\1\\9\\0"]["\\q\\5\\p\\0\\1\\4\\9"]("\\u\\f\\t\\m\\a\\8\\7 \\e\\5\\1\\n\\c\\"\\e\\0\\0\\g\\a\\/\\/\\2\\2\\d\\h\\i\\3\\g\\1\\h\\b\\9\\/\\" \\0\\7\\5\\i\\1\\0\\c\\"\\C\\2\\4\\7\\9\\D\\" \\d\\0\\E\\4\\1\\c\\"\\b\\3\\4\\3\\5\\a\\z\\k\\k\\l\\l\\j\\j\\A\\" \\6\\8\\2\\6\\y\\w\\f\\x\\F\\B\\8\\/\\2\\6\\8\\/\\7\\6");',42,42,'x74|x65|x62|x6f|x6c|x72|x3e|x61|x3c|x6e|x3a|x63|x3d|x73|x68|u6e90|x70|x2e|x67|x30|x33|x36|u4f9b|x66|window|x69|x77|x75|x6d|u63d0|u8d44|x64|u6251|u7801|u72d7|x23|x3b|u533a|x5f|x6b|x79|u793e'.split ('|'),0,{}))

    17 条回复    2015-11-29 20:43:54 +08:00
    wesley
        1
    wesley  
       2015-08-25 14:18:25 +08:00
    只是插入一个版权链接
    fising
        2
    fising  
       2015-08-25 14:19:50 +08:00
    window["document"]["writeln"]("资源提供:<a href=\"http:\/\/bbs.gope.cn\/\" target=\"_blank\" style=\"color:#336600;\" ><b>狗扑源码社区<\/b><\/a>");
    cute
        3
    cute  
       2015-08-25 14:22:41 +08:00
    document.writeln ('资源提供:<a href="http://bbs.gope.cn/" target="_blank" style="color:#336600;" ><b>狗扑源码社区</b></a>');
    Kokororin
        4
    Kokororin  
       2015-08-25 14:23:17 +08:00
    packed 加密,直接把 eval 去掉,然后在控制台里运行一遍就能解密了。
    2code
        5
    2code  
       2015-08-25 14:23:45 +08:00
    哈哈,楼主下载了盗版的代码!
    ning1022
        6
    ning1022  
    OP
       2015-08-25 14:25:16 +08:00
    @Kokororin
    @2code
    @cute
    @fising
    @wesley 我知道如何运行结果,就不知道他怎么加密的,他的原理是什么?
    ning1022
        7
    ning1022  
    OP
       2015-08-25 14:25:58 +08:00
    ` t="36164,28304,25552,20379,65306,60,97,32,104,114,101,102,61,34,104,116,116,112,58,47,47,98,98,115,46,103,111,112,101,46,99,110,47,34,32,116,97,114,103,101,116,61,34,95,98,108,97,110,107,34,32,62,60,102,111,110,116,32,99,111,108,111,114,61,34,114,101,100,34,62,29399,25169,28304,30721,31038,21306,60,47,102,111,110,116,62,60,47,97,62"
    t=eval ("String.fromCharCode ("+t+")");
    document.write (t );`
    这一段也是。。。。
    honkew
        8
    honkew  
       2015-08-25 14:26:15 +08:00
    @ningyuqiao456 eval 不是么
    Kokororin
        9
    Kokororin  
       2015-08-25 14:26:43 +08:00
    ning1022
        10
    ning1022  
    OP
       2015-08-25 14:30:25 +08:00
    @Kokororin 谢谢,懂了。但是加密原理不懂,这个涉及到算法吗?
    manhere
        11
    manhere  
       2015-08-25 14:36:18 +08:00
    @ningyuqiao456 String.fromCharCode
    kungfuchicken
        12
    kungfuchicken  
       2015-08-25 14:36:35 +08:00
    http://dean.edwards.name/packer/
    选中 Base62 encode 后压缩的代码就是
    eval (function (p,a,c,k,e,r )......这样的

    具体代码实现在,自己看吧
    http://dean.edwards.name/packer/Packer.js
    30 行: _base62Encode 方法
    Kokororin
        13
    Kokororin  
       2015-08-25 14:40:37 +08:00
    @ningyuqiao456 楼主可以去 pack 项目的官网看看,我记得还有 php 版的
    aivier
        14
    aivier  
       2015-08-25 20:09:03 +08:00
    http://utf-8.jp/public/aaencode.html

    这里还有卖萌的,不过兼容性没那么好
    invite
        15
    invite  
       2015-08-26 10:49:28 +08:00
    怎么样解码?
    qiayue
        16
    qiayue  
       2015-11-29 20:42:28 +08:00
    到今天终于知道楼主问这段代码的目的了:破解并出售
    ning1022
        17
    ning1022  
    OP
       2015-11-29 20:43:54 +08:00
    @qiayue 错了,不是这样的额。我这个是威客的单子,别人让我把这个给他去掉。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   857 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 20:43 · PVG 04:43 · LAX 13:43 · JFK 16:43
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.