INNER CODE UNIT · JavaScript
KEYWORDS
Fausto-404/js-reverse-automation--skill · js-reverse-automation/scripts/ast_candidate_analyzer.js:29
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");
return { line: lines.length, column: lines[lines.length - 1].length };
}
function signalsFor(name, snippet) {
const signals = [];
if (KEYWORDS.test(name)) signals.push("name_keyword");
if (KEYWORDS.test(snippet)) signals.push("source_keyword");
if (/crypto\.subtle|CryptoJS|JSEncrypt|sm-crypto|jsrsasign|forge/i.test(snippet))
signals.push("known_library");