一点js的代码阅读体验

我看到一段开源的javascript代码, 做了编码,勾起了我的好奇心,这种解码还公开的行为虽然有点不道德, 但我就是本着兴趣来做的, 如果有什么不妥当, 可以联系我删除这篇博客。

先来看看这个源码

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;
}('F f$=[\'\\n\\h\\h\\y\\u\\m\\l\\a\\g\\h\\R\\A\\m\\q\\R\\n\\h\\h\',"\\t\\q\\l\\a\\z\\m\\q\\a\\l",\'\\n\\h\\h\\y\\u\\m\\l\\a\\g\\h\\R\\A\\m\\q\\R\\n\\h\\h\',\'\\D\\a\\h\',"\\t\\q\\l\\a\\z\\m\\q\\a\\l",\'\\D\\a\\h\',"\\t\\q\\l\\a\\z\\m\\q\\a\\l",\'\\s\',\'\\m\\A\\e\\C\\a\\h\\y\\j\\g\\C\\g\\R\\r\\q\\C\',"\\t\\q\\l\\a\\z\\m\\q\\a\\l",\'\\m\\A\\e\\C\\a\\h\\y\\j\\g\\C\\g\\R\\r\\q\\C\',"\\t\\q\\l\\a\\z\\m\\q\\a\\l",\'\\s\',\'\\1a\\t\\1b\\j\\e\\D\\a\\p\\W\\R\\1x\',\'\\1a\\t\\1b\\j\\e\\D\\a\\p\',\'\\u\\m\\l\\a\\g\\y\\A\\r\\W\',\'\\u\\m\\l\\a\\g\',\'\\t\\q\\l\\a\\z\\m\\q\\a\\l\',\'\\r\\p\\g\\B\\e\\B\\j\\D\',\'\\A\\e\\D\\B\\a\',\'\\U\\n\\N\\n\\r\\1f\\m\\j\\a\\k\',\'\\1p\\U\\n\\N\\n\\r\\2P\\m\\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4o:E(H.1A()){J.M(H.1g())}K{E(1t==0){J.M(H.1g())}K{J.M(H.1u())}};1W}}};1c.1B=1B})(1c);1B.2C();', 62, 293, '||||||||||x65|x22||x20|x61|_|x6f|x73||x6c|x3d|x64|x69|x63|x74|x72|x6e|x70|x30|x75|x76|x3e|x3c|x68|x2f|x66|x6d|x62|x67|x79|if|var|x77|this|x2d|document|else|x3a|writeln|x53|ua|x3b|test|x2e|x6b|return|x4a|x23|x34|vID|x6a|function|||||||||||x43|x50|window|videoId|typeof|x46|Play_HTML5|swf|x78|navigator|x28|x29|vAutoPlayX|true|vEndTimeX|x26|video|vLogoPathX|vHeight|hasFlash|Play_Flash|x5f|u64ad|x35|u653e|u5668|isMobile|initCuPlayer|vPlayModX|vCssurlX|words|myOntime|uff0c|myAutoPlay|vWidth|parseInt|u5b89|video_type|flashVersion|x45|case|flashvars|x44|result|x36|plugins|x31|obj|break|x41|video_element|vPic|||||||||||u88c5|vMp4url|split|vCssurl|vAutoPlay|u51fb|canPlayType|vPlayMod|vid|ishtml5|u7528|vEndTime|u70b9|false|vLogoPath|u3002|isVideoCanPlay|iPad|android|x71|VSwf|x42|location|length|x4e|vPlayer|x58|x47|init|x4f|x52|x55|u4ee5|u8be5|x4d|u6cd5|u542f|x4c|x49|x32|undefined|x56|x54|u63d2|x38|x33|x37|x39|u4ef6|u8fd0|u51fa|u5f39|||||||||||u65e0|u8fd9|u884c|u540e|u6d4f|u89c8|u6237|u91cc|u8c37|u6b4c|u9891|u8bf7|x2c|u65f6|u8bb8|u5141|x24|u9879|u60a8|u672a|u89c6|u7531|u9009|u4e8e|72|71|74|73|68|67|70|69|75|new|all|80|ActiveXObject|77|76|79|78|50|51|57|56|54|55|52|53|58|64|63|||||||||||66|65|60|59|62|61|85|for|isNaN|createElement|83|84|description|87|default|userAgent|86|name|continue|switch|82|height|getElementById|resize|videoHeight|GetVariable|vFile|81|webOS|iPhone|Windows|Phone|BlackBerry|webos|palm'.split('|'), 0, {}))

大家可以看到,后面有一串很密密麻麻的字符串,其实简单的解码规则已经有了,就是那个匿名函数。我直接用他的解码函数console.log()打印出来就好了。做了格式化,显示如下。

var _$ = ['\x63\x73\x73\x2f\x76\x69\x64\x65\x6f\x73\x2e\x6d\x69\x6e\x2e\x63\x73\x73', "\x75\x6e\x64\x65\x66\x69\x6e\x65\x64", '\x63\x73\x73\x2f\x76\x69\x64\x65\x6f\x73\x2e\x6d\x69\x6e\x2e\x63\x73\x73', '\x79\x65\x73', "\x75\x6e\x64\x65\x66\x69\x6e\x65\x64", '\x79\x65\x73', "\x75\x6e\x64\x65\x66\x69\x6e\x65\x64", '\x30', '\x69\x6d\x61\x67\x65\x73\x2f\x6c\x6f\x67\x6f\x2e\x70\x6e\x67', "\x75\x6e\x64\x65\x66\x69\x6e\x65\x64", '\x69\x6d\x61\x67\x65\x73\x2f\x6c\x6f\x67\x6f\x2e\x70\x6e\x67', "\x75\x6e\x64\x65\x66\x69\x6e\x65\x64", '\x30', '\x43\x75\x50\x6c\x61\x79\x65\x72\x34\x2e\x35', '\x43\x75\x50\x6c\x61\x79\x65\x72', '\x76\x69\x64\x65\x6f\x2f\x6d\x70\x34', '\x76\x69\x64\x65\x6f', '\x75\x6e\x64\x65\x66\x69\x6e\x65\x64', '\x70\x72\x6f\x62\x61\x62\x6c\x79', '\x6d\x61\x79\x62\x65', '\x4a\x63\x53\x63\x70\x46\x69\x6c\x65\x3d', '\x26\x4a\x63\x53\x63\x70\x56\x69\x64\x65\x6f\x50\x61\x74\x68\x3d', '\x26\x4a\x63\x53\x63\x70\x41\x75\x74\x6f\x50\x6c\x61\x79\x3d', '\x26\x4a\x63\x53\x63\x70\x45\x6e\x64\x54\x69\x6d\x65\x3d', '\x26\x4a\x63\x53\x63\x70\x4c\x6f\x67\x6f\x50\x61\x74\x68\x3d', '\x26\x4a\x63\x53\x63\x70\x49\x6d\x67\x3d', '\x3c\x64\x69\x76\x20\x63\x6c\x61\x73\x73\x3d\x22\x43\x75\x50\x63\x22\x20\x69\x64\x3d\x22', '\x22\x3e\x3c\x6f\x62\x6a\x65\x63\x74\x20\x69\x64\x3d\x22', '', '\x5f\x6f\x62\x6a\x65\x63\x74\x22\x20\x77\x69\x64\x74\x68\x3d\x22', '\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22', '\x22\x20\x63\x6c\x61\x73\x73\x69\x64\x3d\x22\x63\x6c\x73\x69\x64\x3a\x44\x32\x37\x43\x44\x42\x36\x45\x2d\x41\x45\x36\x44\x2d\x31\x31\x63\x66\x2d\x39\x36\x42\x38\x2d\x34\x34\x34\x35\x35\x33\x35\x34\x30\x30\x30\x30\x22\x3e', '\x3c\x70\x61\x72\x61\x6d\x20\x6e\x61\x6d\x65\x3d\x22\x6d\x6f\x76\x69\x65\x22\x20\x76\x61\x6c\x75\x65\x3d\x22', '\x22\x20\x2f\x3e', '\x3c\x70\x61\x72\x61\x6d\x20\x6e\x61\x6d\x65\x3d\x22\x66\x6c\x61\x73\x68\x76\x61\x72\x73\x22\x20\x76\x61\x6c\x75\x65\x3d\x22', '\x22\x20\x2f\x3e', '\x3c\x70\x61\x72\x61\x6d\x20\x6e\x61\x6d\x65\x3d\x22\x61\x6c\x6c\x6f\x77\x46\x75\x6c\x6c\x53\x63\x72\x65\x65\x6e\x22\x20\x76\x61\x6c\x75\x65\x3d\x22\x74\x72\x75\x65\x22\x20\x2f\x3e', '\x3c\x70\x61\x72\x61\x6d\x20\x6e\x61\x6d\x65\x3d\x22\x62\x67\x63\x6f\x6c\x6f\x72\x22\x20\x76\x61\x6c\x75\x65\x3d\x22\x23\x30\x30\x30\x30\x30\x30\x22\x20\x2f\x3e', '\x3c\x70\x61\x72\x61\x6d\x20\x6e\x61\x6d\x65\x3d\x22\x61\x6c\x6c\x6f\x77\x53\x63\x72\x69\x70\x74\x41\x63\x63\x65\x73\x73\x22\x20\x76\x61\x6c\x75\x65\x3d\x22\x61\x6c\x77\x61\x79\x73\x22\x20\x2f\x3e', '\x3c\x70\x61\x72\x61\x6d\x20\x6e\x61\x6d\x65\x3d\x22\x77\x6d\x6f\x64\x65\x22\x20\x76\x61\x6c\x75\x65\x3d\x22\x6f\x70\x61\x71\x75\x65\x22\x20\x2f\x3e', '\x3c\x65\x6d\x62\x65\x64\x20\x69\x64\x3d\x22', '', '\x5f\x65\x6d\x62\x65\x64\x22\x20\x73\x72\x63\x3d\x22', '\x22\x20\x74\x79\x70\x65\x3d\x22\x61\x70\x70\x6c\x69\x63\x61\x74\x69\x6f\x6e\x2f\x78\x2d\x73\x68\x6f\x63\x6b\x77\x61\x76\x65\x2d\x66\x6c\x61\x73\x68\x22\x20\x61\x6c\x6c\x6f\x77\x73\x63\x72\x69\x70\x74\x61\x63\x63\x65\x73\x73\x3d\x22\x61\x6c\x77\x61\x79\x73\x22\x20\x61\x6c\x6c\x6f\x77\x66\x75\x6c\x6c\x73\x63\x72\x65\x65\x6e\x3d\x22\x74\x72\x75\x65\x22\x20\x77\x6d\x6f\x64\x65\x3d\x22\x6f\x70\x61\x71\x75\x65\x22\x20\x77\x69\x64\x74\x68\x3d\x22', '\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22', '\x22\x20\x66\x6c\x61\x73\x68\x76\x61\x72\x73\x3d\x22', '\x22\x20\x62\x67\x63\x6f\x6c\x6f\x72\x3d\x22\x23\x30\x30\x30\x30\x30\x30\x22\x3e\x3c\x2f\x65\x6d\x62\x65\x64\x3e', '\x3c\x2f\x6f\x62\x6a\x65\x63\x74\x3e\x3c\x2f\x64\x69\x76\x3e', '\x3c\x6c\x69\x6e\x6b\x20\x72\x65\x6c\x3d\x22\x73\x74\x79\x6c\x65\x73\x68\x65\x65\x74\x22\x20\x74\x79\x70\x65\x3d\x22\x74\x65\x78\x74\x2f\x63\x73\x73\x22\x20\x68\x72\x65\x66\x3d\x22', '\x22\x2f\x3e', "", "\x6f\x6e", "\x6f\x6e\x74\x69\x6d\x65\x75\x70\x64\x61\x74\x65", "\x79\x65\x73", "\x61\x75\x74\x6f\x70\x6c\x61\x79", '\x3c\x64\x69\x76\x20\x63\x6c\x61\x73\x73\x3d\x22\x43\x75\x50\x61\x64\x22\x20\x69\x64\x3d\x22', '\x22\x3e\x3c\x76\x69\x64\x65\x6f\x20\x69\x64\x3d\x22', '', '\x22\x20\x6f\x6e\x65\x6e\x64\x65\x64\x3d\x22\x67\x65\x74\x4e\x65\x78\x74\x28\x74\x72\x75\x65\x29\x22\x20', '\x3d\x22\x70\x72\x6f\x67\x72\x65\x73\x73\x55\x70\x64\x61\x74\x65\x28\x29\x22\x20\x20\x63\x6f\x6e\x74\x72\x6f\x6c\x73\x3d\x22\x63\x6f\x6e\x74\x72\x6f\x6c\x73\x22\x20\x77\x69\x64\x74\x68\x3d\x22', '\x22\x20\x20\x68\x65\x69\x67\x68\x74\x3d\x22', '\x22\x20\x20\x70\x6f\x73\x74\x65\x72\x3d\x22', '\x22\x20\x70\x6c\x61\x79\x73\x69\x6e\x6c\x69\x6e\x65\x20\x73\x74\x79\x6c\x65\x3d\x22\x62\x61\x63\x6b\x67\x72\x6f\x75\x6e\x64\x3a\x23\x30\x30\x30\x30\x30\x30\x3b\x22\x20', '\x20\x63\x6c\x61\x73\x73\x3d\x22\x76\x69\x64\x65\x6f\x2d\x6a\x73\x20\x76\x6a\x73\x2d\x62\x69\x67\x2d\x70\x6c\x61\x79\x2d\x63\x65\x6e\x74\x65\x72\x65\x64\x22\x20\x70\x72\x65\x6c\x6f\x61\x64\x3d\x22\x6e\x6f\x6e\x65\x22\x20\x20\x64\x61\x74\x61\x2d\x73\x65\x74\x75\x70\x3d\x22\x52\x65\x47\x65\x58\x62\x4f\x62\x4a\x22\x20\x3e', '\x3c\x73\x6f\x75\x72\x63\x65\x20\x73\x72\x63\x3d\x22', '\x22\x20\x74\x79\x70\x65\x3d\x22\x76\x69\x64\x65\x6f\x2f\x6d\x70\x34\x22\x20\x2f\x3e', '\x3c\x2f\x76\x69\x64\x65\x6f\x3e\x3c\x2f\x64\x69\x76\x3e', '\x3c\x64\x69\x76\x20\x63\x6c\x61\x73\x73\x3d\x22\x43\x75\x4d\x6f\x62\x22\x20\x69\x64\x3d\x22', '\x22\x3e\x3c\x76\x69\x64\x65\x6f\x20\x69\x64\x3d\x22', '', '\x22\x20\x6f\x6e\x65\x6e\x64\x65\x64\x3d\x22\x67\x65\x74\x4e\x65\x78\x74\x28\x74\x72\x75\x65\x29\x22\x20', '\x3d\x22\x70\x72\x6f\x67\x72\x65\x73\x73\x55\x70\x64\x61\x74\x65\x28\x29\x22\x20\x20\x63\x6f\x6e\x74\x72\x6f\x6c\x73\x3d\x22\x63\x6f\x6e\x74\x72\x6f\x6c\x73\x22\x20\x77\x69\x64\x74\x68\x3d\x22', '\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22', '\x22\x20\x70\x6f\x73\x74\x65\x72\x3d\x22', '\x22\x20\x70\x6c\x61\x79\x73\x69\x6e\x6c\x69\x6e\x65\x20\x73\x74\x79\x6c\x65\x3d\x22\x62\x61\x63\x6b\x67\x72\x6f\x75\x6e\x64\x3a\x23\x30\x30\x30\x30\x30\x30\x3b\x22\x20\x20', '\x20\x63\x6c\x61\x73\x73\x3d\x22\x76\x69\x64\x65\x6f\x2d\x6a\x73\x20\x76\x6a\x73\x2d\x62\x69\x67\x2d\x70\x6c\x61\x79\x2d\x63\x65\x6e\x74\x65\x72\x65\x64\x22\x20\x70\x72\x65\x6c\x6f\x61\x64\x3d\x22\x6e\x6f\x6e\x65\x22\x20\x64\x61\x74\x61\x2d\x73\x65\x74\x75\x70\x3d\x22\x52\x65\x47\x65\x58\x62\x4f\x62\x4a\x22\x20\x3e', '\x3c\x73\x6f\x75\x72\x63\x65\x20\x73\x72\x63\x3d\x22', '\x22\x20\x74\x79\x70\x65\x3d\x22\x76\x69\x64\x65\x6f\x2f\x6d\x70\x34\x22\x20\x2f\x3e', '\x3c\x2f\x76\x69\x64\x65\x6f\x3e\x3c\x64\x69\x76\x20\x63\x6c\x61\x73\x73\x3d\x22\x70\x6c\x61\x79\x6c\x6f\x67\x6f\x22\x20\x73\x74\x79\x6c\x65\x3d\x22\x62\x61\x63\x6b\x67\x72\x6f\x75\x6e\x64\x3a\x75\x72\x6c\x28', '\x29\x20\x6e\x6f\x2d\x72\x65\x70\x65\x61\x74\x20\x6c\x65\x66\x74\x20\x74\x6f\x70\x3b\x22\x3e\x3c\x2f\x64\x69\x76\x3e\x3c\x2f\x64\x69\x76\x3e', '\x53\x68\x6f\x63\x6b\x77\x61\x76\x65\x46\x6c\x61\x73\x68\x2e\x53\x68\x6f\x63\x6b\x77\x61\x76\x65\x46\x6c\x61\x73\x68', "\x24\x76\x65\x72\x73\x69\x6f\x6e", "\x20", "\x2c", "\x53\x68\x6f\x63\x6b\x77\x61\x76\x65\x20\x46\x6c\x61\x73\x68", "\x20", '\x3c\x70\x20\x73\x74\x79\x6c\x65\x3d\x22\x62\x61\x63\x6b\x67\x72\x6f\x75\x6e\x64\x3a\x23\x30\x30\x30\x30\x30\x30\x3b\x20\x68\x65\x69\x67\x68\x74\x3a', '\x70\x78\x3b\x20\x63\x6f\x6c\x6f\x72\x3a\x23\x66\x66\x66\x66\x66\x66\x3b\x70\x61\x64\x64\x69\x6e\x67\x3a\x31\x30\x70\x78\x3b\x22\x3e\u7531\u4e8e\u60a8\u672a\u5b89\u88c5\x3c\x62\x20\x73\x74\x79\x6c\x65\x3d\x22\x63\x6f\x6c\x6f\x72\x3a\x23\x66\x66\x66\x66\x30\x30\x3b\x22\x3e\x66\x6c\x61\x73\x68\u64ad\u653e\u5668\x3c\x2f\x62\x3e\u89c6\u9891\u65e0\u6cd5\u64ad\u653e\uff0c\x3c\x61\x20\x74\x61\x72\x67\x65\x74\x3d\x22\x5f\x62\x6c\x61\x6e\x6b\x22\x20\x68\x72\x65\x66\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x61\x64\x6f\x62\x65\x2e\x63\x6f\x6d\x2f\x67\x6f\x2f\x67\x65\x74\x66\x6c\x61\x73\x68\x70\x6c\x61\x79\x65\x72\x5f\x63\x6e\x22\x20\x73\x74\x79\x6c\x65\x3d\x22\x63\x6f\x6c\x6f\x72\x3a\x72\x65\x64\x3b\x22\x3e\u70b9\u51fb\u8fd9\u91cc\u5b89\u88c5\x3c\x2f\x61\x3e\x20\u3002\x3c\x62\x72\x3e\u8c37\u6b4c\x43\x68\x72\x6f\x6d\x65\u6d4f\u89c8\u5668\u7528\u6237\uff0c\u5b89\u88c5\x3c\x62\x20\x73\x74\x79\x6c\x65\x3d\x22\x63\x6f\x6c\x6f\x72\x3a\x23\x66\x66\x66\x66\x30\x30\x3b\x22\x3e\x66\x6c\x61\x73\x68\u64ad\u653e\u5668\x3c\x2f\x62\x3e\u540e\uff0c\u5f39\u51fa\x22\u8fd0\u884c\x46\x6c\x61\x73\x68\x22\u9009\u9879\u65f6\uff0c\u8bf7\u70b9\u51fb\x22\u5141\u8bb8\x22\u4ee5\u542f\u7528\u8be5\u64ad\u653e\u5668\u63d2\u4ef6\u3002\x3c\x62\x72\x3e\x3c\x2f\x70\x3e'];
(function (window, undefined) {
    var document = window.document,
        navigator = window.navigator,
        location = window.location;
    var ua = navigator.userAgent;
    var vCssurlX = _$[0];
    if (_$[1] == typeof vCssurl) {
        vCssurlX = _$[2]
    } else {
        vCssurlX = vCssurl
    };
    var vAutoPlayX = _$[3];
    if (_$[4] == typeof vAutoPlay) {
        vAutoPlayX = _$[5]
    } else {
        vAutoPlayX = vAutoPlay
    };
    var vEndTimeX = 0;
    if (_$[6] == typeof vEndTime) {
        vEndTimeX = _$[7]
    } else {
        vEndTimeX = vEndTime
    };
    var vLogoPathX = _$[8];
    if (_$[9] == typeof vLogoPath) {
        vLogoPathX = _$[10]
    } else {
        vLogoPathX = vLogoPath
    };
    var vPlayModX = 0;
    if (_$[11] == typeof vPlayMod) {
        vPlayModX = _$[12]
    } else {
        vPlayModX = vPlayMod
    };
    var initCuPlayer = {
        name: _$[13],
        videoId: _$[14],
        ishtml5: 0,
        video_type: _$[15],
        isVideoCanPlay: function (video_type) {
            var video_element = document.createElement(_$[16]);
            if (typeof (video_element.canPlayType) == _$[17]) {
                return false
            };
            var result = video_element.canPlayType(video_type);
            if ((result == _$[18]) || (result == _$[19])) {
                return true
            };
            return true;
        },
        isMobile: function () {
            if (/iPad/i.test(ua) || /iPhone/i.test(ua) || /android/i.test(ua) || /Windows Phone/i.test(ua) || /webOS/i.test(ua) || /BlackBerry/i.test(ua)) {
                return true
            } else if (/palm/i.test(ua) || /webos/i.test(ua)) {
                return true
            } else {
                return false
            }
        },
        resize: function () {
            if (this.ishtml5) {
                var vid = this.videoId;
                var obj = document.getElementById(vid);
                obj.height = obj.videoHeight;
                return true
            }
        },
        Play_Flash: function () {
            var flashvars = _$[20] + vFile + _$[21] + vMp4url + _$[22] + vAutoPlayX + _$[23] + vEndTimeX + _$[24] + vLogoPathX + _$[25] + vPic;
            video = _$[26] + vID + _$[27] + this.videoId + _$[28] + vID + _$[29] + vWidth + _$[30] + vHeight + _$[31] + _$[32] + vPlayer + _$[33] + _$[34] + flashvars + _$[35] + _$[36] + _$[37] + _$[38] + _$[39] + _$[40] + this.videoId + _$[41] + vID + _$[42] + vPlayer + _$[43] + vWidth + _$[44] + vHeight + _$[45] + flashvars + _$[46] + _$[47];
            return video
        },
        Play_HTML5: function () {
            document.writeln(_$[48] + vCssurlX + _$[49]);
            var myAutoPlay = _$[50];
            var myOntime = _$[51];
            if (vEndTimeX > 0) {
                myOntime = _$[52]
            };
            if (vAutoPlayX == _$[53]) {
                myAutoPlay = _$[54]
            };
            if (/iPad/i.test(ua)) {
                video = _$[55] + vID + _$[56] + this.videoId + _$[57] + vID + _$[58] + myOntime + _$[59] + vWidth + _$[60] + vHeight + _$[61] + vPic + _$[62] + myAutoPlay + _$[63] + _$[64] + vMp4url + _$[65] + _$[66]
            } else {
                video = _$[67] + vID + _$[68] + this.videoId + _$[69] + vID + _$[70] + myOntime + _$[71] + vWidth + _$[72] + vHeight + _$[73] + vPic + _$[74] + myAutoPlay + _$[75] + _$[76] + vMp4url + _$[77] + _$[78] + vLogoPathX + _$[79]
            };
            return video
        },
        init: function () {
            var hasFlash = 0;
            var flashVersion = 0;
            if (document.all) {
                var swf = new ActiveXObject(_$[80]);
                if (swf) {
                    hasFlash = 1;
                    VSwf = swf.GetVariable(_$[81]);
                    flashVersion = parseInt(VSwf.split(_$[82])[1].split(_$[83])[0])
                }
            } else {
                if (navigator.plugins && navigator.plugins.length > 0) {
                    var swf = navigator.plugins[_$[84]];
                    if (swf) {
                        hasFlash = 1;
                        var words = swf.description.split(_$[85]);
                        for (var i = 0; i < words.length; ++i) {
                            if (isNaN(parseInt(words[i]))) continue;
                            flashVersion = parseInt(words[i])
                        }
                    }
                }
            };
            switch (vPlayModX) {
                case 1:
                    if (this.isMobile()) {
                        document.writeln(this.Play_HTML5())
                    } else {
                        if (this.isVideoCanPlay()) {
                            document.writeln(this.Play_HTML5())
                        } else {
                            document.writeln(this.Play_Flash())
                        }
                    };
                    break;
                case 2:
                    if (this.isMobile()) {
                        if (/android/i.test(ua)) {
                            document.writeln(this.Play_Flash())
                        } else {
                            document.writeln(this.Play_HTML5())
                        }
                    } else {
                        if (hasFlash == 0) {
                            document.writeln(_$[86] + vHeight + _$[87]);
                            c
                        } else {
                            document.writeln(this.Play_Flash())
                        }
                    };
                    break;
                case 0:
                default:
                    if (this.isMobile()) {
                        document.writeln(this.Play_HTML5())
                    } else {
                        if (hasFlash == 0) {
                            document.writeln(this.Play_HTML5())
                        } else {
                            document.writeln(this.Play_Flash())
                        }
                    };
                    break
            }
        }
    };
    window.initCuPlayer = initCuPlayer
})(window);
initCuPlayer.init();

可以看到后面是解码出来很多代码,前面有一个编码的数组。通过简单的观察,我将字符串中的\x 替换为 \u, 做了些格式转换,为了换行,我在每个字符串后面加入了一个\x0a换行符。 放入NATIVE转ASCII的转换工具中,效果如下。

css/videos.min.css
undefined
css/videos.min.css
yes
undefined
yes
undefined
0
images/logo.png
undefined
images/logo.png
undefined
0
CuPlayer4.5
CuPlayer
video/mp4
video
undefined
probably
maybe
JcScpFile=
&JcScpVideoPath=
&JcScpAutoPlay=
&JcScpEndTime=
&JcScpLogoPath=
&JcScpImg=
<div class="CuPc" id="
"><object id="

_object" width="
" height="
" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
<param name="movie" value="
" />
<param name="flashvars" value="
" />
<param name="allowFullScreen" value="true" />
<param name="bgcolor" value="#000000" />
<param name="allowScriptAccess" value="always"0/>
<param name="wmode" value="opaque" />
<embed id="

_embed" src="
" type="application/x-shockwave-flash" allowsc2iptaccess="always" allowfullscreen="true" wmo4e="opaque" width="
" height="
" flashvars="
" bgcolor="#000000"></embed>
</object></div>
<link rel="stylesheet" type="text/css" href="
"/>

on
ontimeupdate
yes
autoplay
<div class="CuPad" id="
"><video id="

" "getNext(true)" 
="progressUpdate()"  controls="controls" widthd"
"  height="
"  poster="
" playsinline style="background:#000000;" 
 class="video-js vjs-big-play-centered" preloa4="none"  data-setup="ReGeXbObJ" >
<source src="
" type="video/mp4" />
</video></div>
<div class="CuMob" id="
"><video id="

" "getNext(true)" 
="progressUpdate()"  controls="controls" widthd"
" height="
" poster="
" playsinline style="background:#000000;"  
 class="video-js vjs-big-play-centered" preloa4="none" data-setup="ReGeXbObJ" >
<source src="
" type="video/mp4" />
</video><div class="playlogo" style="backgroun4:url(
) no-repeat left top;"></div></div>
ShockwaveFlash.ShockwaveFlash
$version
 
,
Shockwave Flash
 
<p style="background:#000000; height:
px; color:#ffffff;padding:10px;">由于您未安装<b style="color:#ffff00;">flash播放器</b>视频无法播放,<a target="_blank" href="http://www.adobe.com/go/getflashplayer_cn" style="color:red;">点击这里安装</a> 。<br>谷歌Chrome浏览器用户,安装<b style="color:#ffff00;">flash播放器</b>后,弹出"运行Flash"选项时,请点击"允许"以启用该播放器插件。<br></p>

最终替换效果如下


var _$ = ['css/videos.min.css',
  'undefined',
  'css/videos.min.css',
  'yes',
  'undefined',
  'yes',
  'undefined',
  '0',
  'images/logo.png',
  'undefined',
  'images/logo.png',
  'undefined',
  '0',
  'CuPlayer4.5',
  'CuPlayer',
  'video/mp4',
  'video',
  'undefined',
  'probably',
  'maybe',
  'JcScpFile=',
  '&JcScpVideoPath=',
  '&JcScpAutoPlay=',
  '&JcScpEndTime=',
  '&JcScpLogoPath=',
  '&JcScpImg=',
  '<div class="CuPc" id="',
  '"><object id="',
  '_object" width="',
  '" height="',
  '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">',
  '<param name="movie" value="',
  '" />',
  '<param name="flashvars" value="',
  '" />',
  '<param name="allowFullScreen" value="true" />',
  '<param name="bgcolor" value="#000000" />',
  '<param name="allowScriptAccess" value="always"0/>',
  '<param name="wmode" value="opaque" />',
  '<embed id="',
  '_embed" src="',
  '" type="application/x-shockwave-flash" allowsc2iptaccess="always" allowfullscreen="true" wmo4e="opaque" width="',
  '" height="',
  '" flashvars="',
  '" bgcolor="#000000"></embed>',
  '</object></div>',
  '<link rel="stylesheet" type="text/css" href="',
  '"/>',
  'on',
  'ontimeupdate',
  'yes',
  'autoplay',
  '<div class="CuPad" id="',
  '"><video id="',
  '" "getNext(true)" ',
  '="progressUpdate()"  controls="controls" widthd"',
  '"  height="',
  '"  poster="',
  '" playsinline style="background:#000000;" ',
  ' class="video-js vjs-big-play-centered" preloa4="none"  data-setup="ReGeXbObJ" >',
  '<source src="',
  '" type="video/mp4" />',
  '</video></div>',
  '<div class="CuMob" id="',
  '"><video id="',
  '" "getNext(true)" ',
  '="progressUpdate()"  controls="controls" widthd"',
  '" height="',
  '" poster="',
  '" playsinline style="background:#000000;"  ',
  ' class="video-js vjs-big-play-centered" preloa4="none" data-setup="ReGeXbObJ" >',
  '<source src="',
  '" type="video/mp4" />',
  '</video><div class="playlogo" style="backgroun4:url(',
  ') no-repeat left top;"></div></div>',
  'ShockwaveFlash.ShockwaveFlash',
  '$version',
  ',',
  'Shockwave Flash',
  '<p style="background:#000000; height:',
  'px; color:#ffffff;padding:10px;">由于您未安装<b style="color:#ffff00;">flash播放器</b>视频无法播放,<a target="_blank" href="http://www.adobe.com/go/getflashplayer_cn" style="color:red;">点击这里安装</a> 。<br>谷歌Chrome浏览器用户,安装<b style="color:#ffff00;">flash播放器</b>后,弹出"运行Flash"选项时,请点击"允许"以启用该播放器插件。<br></p>',
];
(function (window, undefined) {
  var document = window.document,
    navigator = window.navigator,
    location = window.location;
  var ua = navigator.userAgent;
  var vCssurlX = _$[0];
  if (_$[1] == typeof vCssurl) {
    vCssurlX = _$[2]
  } else {
    vCssurlX = vCssurl
  };
  var vAutoPlayX = _$[3];
  if (_$[4] == typeof vAutoPlay) {
    vAutoPlayX = _$[5]
  } else {
    vAutoPlayX = vAutoPlay
  };
  var vEndTimeX = 0;
  if (_$[6] == typeof vEndTime) {
    vEndTimeX = _$[7]
  } else {
    vEndTimeX = vEndTime
  };
  var vLogoPathX = _$[8];
  if (_$[9] == typeof vLogoPath) {
    vLogoPathX = _$[10]
  } else {
    vLogoPathX = vLogoPath
  };
  var vPlayModX = 0;
  if (_$[11] == typeof vPlayMod) {
    vPlayModX = _$[12]
  } else {
    vPlayModX = vPlayMod
  };
  var initCuPlayer = {
    name: _$[13],
    videoId: _$[14],
    ishtml5: 0,
    video_type: _$[15],
    isVideoCanPlay: function (video_type) {
      var video_element = document.createElement(_$[16]);
      if (typeof (video_element.canPlayType) == _$[17]) {
        return false
      };
      var result = video_element.canPlayType(video_type);
      if ((result == _$[18]) || (result == _$[19])) {
        return true
      };
      return true;
    },
    isMobile: function () {
      if (/iPad/i.test(ua) || /iPhone/i.test(ua) || /android/i.test(ua) || /Windows Phone/i.test(ua) || /webOS/i.test(ua) || /BlackBerry/i.test(ua)) {
        return true
      } else if (/palm/i.test(ua) || /webos/i.test(ua)) {
        return true
      } else {
        return false
      }
    },
    resize: function () {
      if (this.ishtml5) {
        var vid = this.videoId;
        var obj = document.getElementById(vid);
        obj.height = obj.videoHeight;
        return true
      }
    },
    Play_Flash: function () {
      var flashvars = _$[20] + vFile + _$[21] + vMp4url + _$[22] + vAutoPlayX + _$[23] + vEndTimeX + _$[24] + vLogoPathX + _$[25] + vPic;
      video = _$[26] + vID + _$[27] + this.videoId + _$[28] + vID + _$[29] + vWidth + _$[30] + vHeight + _$[31] + _$[32] + vPlayer + _$[33] + _$[34] + flashvars + _$[35] + _$[36] + _$[37] + _$[38] + _$[39] + _$[40] + this.videoId + _$[41] + vID + _$[42] + vPlayer + _$[43] + vWidth + _$[44] + vHeight + _$[45] + flashvars + _$[46] + _$[47];
      return video
    },
    Play_HTML5: function () {
      document.writeln(_$[48] + vCssurlX + _$[49]);
      var myAutoPlay = _$[50];
      var myOntime = _$[51];
      if (vEndTimeX > 0) {
        myOntime = _$[52]
      };
      if (vAutoPlayX == _$[53]) {
        myAutoPlay = _$[54]
      };
      if (/iPad/i.test(ua)) {
        video = _$[55] + vID + _$[56] + this.videoId + _$[57] + vID + _$[58] + myOntime + _$[59] + vWidth + _$[60] + vHeight + _$[61] + vPic + _$[62] + myAutoPlay + _$[63] + _$[64] + vMp4url + _$[65] + _$[66]
      } else {
        video = _$[67] + vID + _$[68] + this.videoId + _$[69] + vID + _$[70] + myOntime + _$[71] + vWidth + _$[72] + vHeight + _$[73] + vPic + _$[74] + myAutoPlay + _$[75] + _$[76] + vMp4url + _$[77] + _$[78] + vLogoPathX + _$[79]
      };
      return video
    },
    init: function () {
      var hasFlash = 0;
      var flashVersion = 0;
      if (document.all) {
        var swf = new ActiveXObject(_$[80]);
        if (swf) {
          hasFlash = 1;
          VSwf = swf.GetVariable(_$[81]);
          flashVersion = parseInt(VSwf.split(_$[82])[1].split(_$[83])[0])
        }
      } else {
        if (navigator.plugins && navigator.plugins.length > 0) {
          var swf = navigator.plugins[_$[84]];
          if (swf) {
            hasFlash = 1;
            var words = swf.description.split(_$[85]);
            for (var i = 0; i < words.length; ++i) {
              if (isNaN(parseInt(words[i]))) continue;
              flashVersion = parseInt(words[i])
            }
          }
        }
      };
      switch (vPlayModX) {
        case 1:
          if (this.isMobile()) {
            document.writeln(this.Play_HTML5())
          } else {
            if (this.isVideoCanPlay()) {
              document.writeln(this.Play_HTML5())
            } else {
              document.writeln(this.Play_Flash())
            }
          };
          break;
        case 2:
          if (this.isMobile()) {
            if (/android/i.test(ua)) {
              document.writeln(this.Play_Flash())
            } else {
              document.writeln(this.Play_HTML5())
            }
          } else {
            if (hasFlash == 0) {
              document.writeln(_$[86] + vHeight + _$[87]);
              c
            } else {
              document.writeln(this.Play_Flash())
            }
          };
          break;
        case 0:
        default:
          if (this.isMobile()) {
            document.writeln(this.Play_HTML5())
          } else {
            if (hasFlash == 0) {
              document.writeln(this.Play_HTML5())
            } else {
              document.writeln(this.Play_Flash())
            }
          };
          break
      }
    }
  };
  window.initCuPlayer = initCuPlayer
})(window);
initCuPlayer.init();

虽然还是能够转换成可读的代码,但是这种形式的代码还是比较有创意的,感谢大佬开源代码。
欢迎大家留言交流。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值