-
Notifications
You must be signed in to change notification settings - Fork 2
/
cloudflare_deobfuscator.ts
35 lines (27 loc) · 1.05 KB
/
cloudflare_deobfuscator.ts
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
// @ts-ignore
const process = require('process');
// @ts-ignore
const fs = require("fs");
// @ts-ignore
const deobfuscators = require("./deobfuscators");
const userSpecifiedInput = process.argv[2];
const userSpecifiedOutput = process.argv[3];
if (userSpecifiedInput) {
console.log("input " + userSpecifiedInput);
}
if (userSpecifiedOutput) {
console.log("output " + userSpecifiedOutput);
}
// const inputFile = "./playground.js";
// const outputFile = "./playground.deobf.js";
const inputFile = userSpecifiedInput || "captcha_v1.js";
const outputFile = userSpecifiedOutput || "./captcha_v1.deobfuscated.js"
// const inputFile = "hcaptcha.js";
// const outputFile = "./hcaptcha.deobfuscated.js"
// const inputFile = "hcaptcha-challenge.js";
// const outputFile = "./hcaptcha-challenge.deobfuscated.js"
// const inputFile = "hcaptcha-checkbox.js";
// const outputFile = "./hcaptcha-checkbox.deobfuscated.js"
var script = fs.readFileSync(inputFile, "utf8");
const deobfuscated = deobfuscators.v1Main(script);
fs.writeFileSync(outputFile, deobfuscated, {encoding: "utf8"})