大家好,这是我在论坛上的第一篇文章。 我正在尝试使用以下代码
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})
参数:
p = '16 2d=2A;16 26=2A;16 4j=2A;16 93=2A;16 3m=2A;1h 9i(c,d){8q(c);1i(d==2A){16 e="47://34."+3B+"/2h/4S/54/3A.2S?3i=6p";3b.3a.35({3c:"4C",4E:e},1h(a){16 b=a.3A.7C;4l=b;6h(b)})}1T{6h(d)}7m()};1h 8q(a){16 b=7i();16 c=\'\';c+=\'<W 1m="9J" 1k="3h" A="r:3o; v-r:3o; 6:F; v-6:F; J-6:7; K:0; I:0 4; L:0; C:V; M:4; 11:4; G:1P; G:1U; u:9y; Z:8P; z-1n:2i; N:t; D:t; H:4; 8-9:u; O-9:1b; X-Y:7; U-13:7; q:1; P:Q(q=R); S:1l;">\';'
a=62
c = 696
k = '||||none||height|normal|text|align|||||||||||||||||opacity|width||visible|left|min|||||style|wjQuery|display|overflow||auto|position|background|border|line|padding|margin|float|visibility|vertical|filter|alpha|100|cursor|font|word|block|div|white|space|top|static|clear|span|wrap|pointer|this|var|attr|24px|img|spacing|baseline|common|src|png|title|color|function|if|img_path|class|default|'.split('|')
e = 0
r = {}
我希望在传递参数后使用document.write()
方法显示函数的输出。但我不知道如何使用匿名函数调用传递它。任何帮助将受到高度赞赏。
答案 0 :(得分:1)
将eval
替换为q =
,然后调用q(p,a,c,k,e,r)
并查看输出,即代码的 String ,并美化为
var 2d = 2A;
var 26 = 2A;
var 4j = 2A;
var 93 = 2A;
var 3m = 2A;
function 9i(c, d) {
8q(c);
if (d == 2A) {
var e = "47://34." + 3B + "/2h/4S/54/3A.2S?3i=6p";
3b.3a.35({
3c: "4C",
4E: e
}, function (a) {
var b = a.3A.7C;
4l = b;
6h(b)
})
}
1T {
6h(d)
}
7m()
};
function 8q(a) {
var b = 7i();
var c = '';
c += '<div 1m="9J" class="3h" style="width:3o; min-width:3o; height:auto; min-height:auto; line-height:normal; padding:0; border:0 none; margin:0; display:block; float:none; clear:none; position:1P; position:1U; left:9y; top:8P; z-1n:2i; visibility:visible; overflow:visible; background:none; text-align:left; vertical-align:baseline; white-space:normal; word-wrap:normal; opacity:1; filter:alpha(opacity=100); cursor:default;">';
请注意,最后一个函数未正确终止,并且两个函数都是非法命名的。
答案 1 :(得分:0)
您可以使用IIFE(立即执行函数表达式)调用匿名函数。将函数包装在括号中(这并不总是必要的,但它不会受到伤害),并使用括号中的参数跟随它:
var p = '16 2d=2A;16 26=2A;16 4j=2A;16 93=2A;16 3m=2A;1h 9i(c,d){8q(c);1i(d==2A){16 e="47://34."+3B+"/2h/4S/54/3A.2S?3i=6p";3b.3a.35({3c:"4C",4E:e},1h(a){16 b=a.3A.7C;4l=b;6h(b)})}1T{6h(d)}7m()};1h 8q(a){16 b=7i();16 c=\'\';c+=\'<W 1m="9J" 1k="3h" A="r:3o; v-r:3o; 6:F; v-6:F; J-6:7; K:0; I:0 4; L:0; C:V; M:4; 11:4; G:1P; G:1U; u:9y; Z:8P; z-1n:2i; N:t; D:t; H:4; 8-9:u; O-9:1b; X-Y:7; U-13:7; q:1; P:Q(q=R); S:1l;">\';';
var a=62;
var c = 696;
var k = '||||none||height|normal|text|align|||||||||||||||||opacity|width||visible|left|min|||||style|wjQuery|display|overflow||auto|position|background|border|line|padding|margin|float|visibility|vertical|filter|alpha|100|cursor|font|word|block|div|white|space|top|static|clear|span|wrap|pointer|this|var|attr|24px|img|spacing|baseline|common|src|png|title|color|function|if|img_path|class|default|'.split('|');
var e = 0;
var r = {};
document.write((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})(p,a,c,k,e,r));