forked from dummyvx/decodeObfuscator
-
Notifications
You must be signed in to change notification settings - Fork 5
/
manwa.js
56 lines (48 loc) · 1.37 KB
/
manwa.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
/**
https://manwa2.site/static/js/ch.js?v=202208132
漫蛙正文图片aes解密密钥解析
*/
globalThis.manwa = () => {
//解ob混淆
load('common')
//evalPacker混淆
load('evalPacker')
let wrappedAesFunctionName = null
let set = new Set()
// find function with CryptoJS
const findWrappedAesFunction = {
FunctionDeclaration(path) {
const code = generator(path.node).code
if (/CryptoJS/.test(code)) {
wrappedAesFunctionName = path.node.id.name;
console.info("解密函数", generator(path.node).code)
}
}
}
const findAesKey = {
CallExpression(path) {
const { callee, arguments } = path.node
if (callee.name === wrappedAesFunctionName &&
arguments.length >= 2
) {
//解密函数(目标,密钥, 其他)
console.info("调用", generator(path.node).code)
let key = arguments[1]
set.add(getBindingValue(key, path))
}
}
}
traverse(ast, findWrappedAesFunction);
traverse(ast, findAesKey);
let keys = JSON.stringify(Array.from(set));
if (typeof require == "function") {
let keysFile = "./manwa_keys.json";
const fs = require('fs');
fs.writeFile(keysFile, keys, () => {});
console.info(`manwa漫画密钥文件: ${keysFile}`);
} else {
globalThis.keys = keys;
console.info("密钥保存到keys变量")
}
console.log(keys);
}