forked from dummyvx/decodeObfuscator
-
Notifications
You must be signed in to change notification settings - Fork 5
/
common.js
74 lines (40 loc) · 1.64 KB
/
common.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//ob解混淆
globalThis.common = () => {
//字面量解混淆
console.info("traverse Hex or Unicode String.......");
traverse(ast, simplifyLiteral);
console.info("constantFold.......");
traverse(ast, constantFold);
console.info("delete Repeat Define.......");
traverse(ast, deleteRepeatDefine);
traverse(ast, SimplifyIfStatement);
traverse(ast, standardLoop);
console.info("resolve Sequence.......");
traverse(ast, resolveSequence);
console.info("traverse CallExpress To ToLiteral.......");
traverse(ast, CallExpressToLiteral);
console.info("constantFold.......");
traverse(ast, constantFold);
//object key值Literal
console.info("Object Preconditioning .......");
traverse(ast, keyToLiteral);
traverse(ast, preDecodeObject);
//处理object
console.info("Object Decode .......\n");
traverse(ast, decodeObject);
console.info("Control Flow Decoding.......");
traverse(ast, decodeControlFlow);
console.info("constantFold.......");
traverse(ast, constantFold);
console.info("remove Dead Code.......");
traverse(ast, removeDeadCode);
ast = parser.parse(generator(ast).code);
traverse(ast, removeDeadCode);
console.info("simplifyLiteral.......");
traverse(ast, simplifyLiteral);
// console.info("deleteObfuscatorCode.......");
//可能会误删一些代码,可屏蔽
// traverse(ast, deleteObfuscatorCode);
console.info("FormatMember...");
traverse(ast, FormatMember);
}