-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQuickBOSSDecrypt.js
More file actions
53 lines (46 loc) · 1.6 KB
/
QuickBOSSDecrypt.js
File metadata and controls
53 lines (46 loc) · 1.6 KB
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
const fs = require('node:fs');
const boss = require('@pretendonetwork/boss-crypto');
let help;
let filename;
let BOSS_AES_KEY;
const platform = "js";
// NOTE: You can uncomment the following line and fill in the BOSS AES key to avoid having to enter it manually for every command.
// BOSS_AES_KEY = "boss_aes_key_goes_here"
if (platform == "win64") {
if (BOSS_AES_KEY == null) {
help = `Usage: QuickBOSSDecrypt.exe <file> <BOSS AES key>`;
} else {
help = `Usage: QuickBOSSDecrypt.exe <file>`;
};
} else if (platform == "unixlike") {
if (BOSS_AES_KEY == null) {
help = `Usage: ./QuickBOSSDecrypt <file> <BOSS AES key>`;
} else {
help = `Usage: ./QuickBOSSDecrypt <file>`;
};
} else if (platform == "js") {
if (BOSS_AES_KEY == null) {
help = `Usage: node QuickBOSSDecrypt.js <file> <BOSS AES key>`;
} else {
help = `Usage: node QuickBOSSDecrypt.js <file>`;
};
};
process.argv.forEach(function (val, index, array) {
if (array.length < 3 || array.length > 4 || array.length == 3 && BOSS_AES_KEY == null || val == "--help" || val == "-h") {
console.log(help);
process.exit(0);
} else if (index == 2) {
filename = val;
} else if (index == 3) {
if (BOSS_AES_KEY == null) {
BOSS_AES_KEY = val;
};
};
});
if (!fs.existsSync(filename)) {
console.log("Error: File not found.");
process.exit(1);
};
const { payload_contents } = boss.decrypt3DS(filename, BOSS_AES_KEY);
fs.writeFileSync(filename + ".dec", payload_contents[0].content);
console.log("Successfully decrypted file.");