简易版 对 JavaScript 解混淆

原始代码

1
2
3
_$_=["","\x77\x72\x69\x74\x65","\x6c\x65\x6e\x67\x74\x68","\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74","\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65","\x73\x75\x62\x73\x74\x72","\x40","\x65"];var a={e:function(__0,__1){var __2,__3,__4,__5=_$_[0];if(__1==0){eval(__5)}else if(__1==1){document[_$_[1]](__0)}else{for(__3=0;__3<__0[_$_[2]];__3++){if(__3!=__4){__2=__0[_$_[3]](__3);if(__2>=33&&__2<=79){__5=__5+String[_$_[4]](__2+47)}else if(__2>=80&&__2<=126){__5=__5+String[_$_[4]](__2-47)}else{__4=__3+1;if(__0[_$_[5]](__4,1)==_$_[6]){__5=__5+String[_$_[4]](__2+5)}else{__5=__5+__0[_$_[5]](__3,1)}}}}a[_$_[7]](__5,1)}}};a.e("k9E>=m\r,\n,");a.e("k9625m\r,\n,");
a.e("kE:E=6m ,k^E:E=6m\r,\n,");a.e("k^9625m\r,\n,");a.e("k7C2>6D6E ,7C2>6DA24:?8lQ_Q ,3@C56ClQ_Q ,C@HDlQ_Q ,7C2>63@C56ClQ_Qm\r,\n,");a.e("k7C2>6 ,?2>6lQ>2:?Q ,DC4lQTegTedTerTerTeuTasTeaTe`TehTecTfdTatTebTeuTesTasTeeTedTfaTedTedTasTatTebTeuTesTatTe`TfbTf_Q ,D4C@==:?8lQ2FE@Q ,?@C6D:K6lQ?@C6D:K6Qm\r,\n,");a.e("k^7C2>6D6Em\r,\n,");a.e("k^9E>=m");

预处理

js16解码
http://tool.leavesongs.com/

自动格式化
http://tool.oschina.net/codeformat/js/

格式化
https://tool.lu/js/

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
_$_ = ["", "write", "length", "charCodeAt", "fromCharCode", "substr", "@", "e"];
var a = {
e: function(__0, __1) {
var __2, __3, __4, __5 = _$_[0];
if (__1 == 0) {
eval(__5)
} else if (__1 == 1) {
document[_$_[1]](__0)
} else {
for (__3 = 0; __3 < __0[_$_[2]]; __3++) {
if (__3 != __4) {
__2 = __0[_$_[3]](__3);
if (__2 >= 33 && __2 <= 79) {
__5 = __5 + String[_$_[4]](__2 + 47)
} else if (__2 >= 80 && __2 <= 126) {
__5 = __5 + String[_$_[4]](__2 - 47)
} else {
__4 = __3 + 1;
if (__0[_$_[5]](__4, 1) == _$_[6]) {
__5 = __5 + String[_$_[4]](__2 + 5)
} else {
__5 = __5 + __0[_$_[5]](__3, 1)
}
}
}
}
a[_$_[7]](__5, 1)
}
}
};
a.e("k9E>=m\r,\n,");
a.e("k9625m\r,\n,");
a.e("kE:E=6m ,k^E:E=6m\r,\n,");
a.e("k^9625m\r,\n,");
a.e("k7C2>6D6E ,7C2>6DA24:?8lQ_Q ,3@C56ClQ_Q ,C@HDlQ_Q ,7C2>63@C56ClQ_Qm\r,\n,");
a.e("k7C2>6 ,?2>6lQ>2:?Q ,DC4lQTegTedTerTerTeuTasTeaTe`TehTecTfdTatTebTeuTesTasTeeTedTfaTedTedTasTatTebTeuTesTatTe`TfbTf_Q ,D4C@==:?8lQ2FE@Q ,?@C6D:K6lQ?@C6D:K6Qm\r,\n,");
a.e("k^7C2>6D6Em\r,\n,");
a.e("k^9E>=m");

结果

使用VS Code 右键替换变量名
在console中输出解密结果。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
_$_ = ["", "write", "length", "charCodeAt", "fromCharCode", "substr", "@", "e"];
var a = {
e: function(para1, para2) {
var i_charcode, i, pre_idx, result = "";
if (para2 == 0) {
eval(result)
} else if (para2 == 1) {
// document["write"](para1)
document.write(para1)
} else {
for (i = 0; i < para1["length"]; i++) {
if (i != pre_idx) {
i_charcode = para1["charCodeAt"](i);
if (i_charcode >= 33 && i_charcode <= 79) {
result = result + String["fromCharCode"](i_charcode + 47)
} else if (i_charcode >= 80 && i_charcode <= 126) {
result = result + String["fromCharCode"](i_charcode - 47)
} else {
pre_idx = i + 1;
if (para1["substr"](pre_idx, 1) == "@") {
result = result + String["fromCharCode"](i_charcode + 5)
} else {
result = result + para1["substr"](i, 1)
}
}
}
}
console.log(result)
a["e"](result, 1)
}
}
};
a.e("k9E>=m\r,\n,");
a.e("k9625m\r,\n,");
a.e("kE:E=6m ,k^E:E=6m\r,\n,");
a.e("k^9625m\r,\n,");
a.e("k7C2>6D6E ,7C2>6DA24:?8lQ_Q ,3@C56ClQ_Q ,C@HDlQ_Q ,7C2>63@C56ClQ_Qm\r,\n,");
a.e("k7C2>6 ,?2>6lQ>2:?Q ,DC4lQTegTedTerTerTeuTasTeaTe`TehTecTfdTatTebTeuTesTasTeeTedTfaTedTedTasTatTebTeuTesTatTe`TfbTf_Q ,D4C@==:?8lQ2FE@Q ,?@C6D:K6lQ?@C6D:K6Qm\r,\n,");
a.e("k^7C2>6D6Em\r,\n,");
a.e("k^9E>=m");