Detect-It-Easy/db/ELF/Rust.4.sg
2024-11-07 00:17:07 +03:00

25 lines
No EOL
688 B
JavaScript
Executable file

// Detect It Easy: detection rule file format
// Author: fernandom - menteb.in
init("compiler", "Rust");
function detect() {
if (ELF.isStringInTablePresent(".strtab", "rust_panic")) {
bDetected = true;
var nSection = ELF.getSectionNumber(".debug_str"),
nOffset = ELF.getSectionFileOffset(nSection),
nSize = ELF.getSectionFileSize(nSection);
if (nSize > 0) {
var nStringOffset = ELF.findString(nOffset, 6, "rustc ");
if (nStringOffset != -1) {
sVersion = ELF.getString(nStringOffset);
}
}
}
_setLang("Rust", bDetected);
return result();
}