INNER CODE UNIT · JavaScript
args
Fausto-404/js-reverse-automation--skill · js-reverse-automation/scripts/ast_candidate_analyzer.js:20
function args() {
const out = {};
for (let i = 2; i < process.argv.length; i += 2)
out[process.argv[i].replace(/^--/, "")] = process.argv[i + 1];
if (!out.input || !out.output)
throw new Error("Usage: ast_candidate_analyzer.js --input bundle.js --output static_candidates.json");
return out;
}
const KEYWORDS = /encrypt|decrypt|cipher|sign|hmac|digest|hash|rsa|aes|des|sm2|sm3|sm4|md5|sha|base64|crypto/i;
function sourceSnippet(code, start, end) {
return code.slice(start || 0, Math.min(end || code.length, (start || 0) + 1200));
}
function locationFromOffset(code, offset) {
const before = code.slice(0, offset);
const lines = before.split("\n");