eval(string)函数
<script> eval(function(p, a, c, k, e, d) { p = 'function p(){console.log("p");};function a(){console.log("a");};'; d = function(){console.log("d");} return p; }({},{},{},{},{},{})) p();//p a();//a d();//ncaught ReferenceError: d is not defined </script>
从eval这个函数就可以知道,你不管怎么混淆,你最后重要返回一个字符串给eval函数的
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]);
console.log(p);
return p;
}
运行结果:
下载地址:http://files.cnblogs.com/ghgyj/My97DatePicker%E5%8F%8D%E6%B7%B7%E6%B7%86.zip