mirror of
https://github.com/horsicq/Detect-It-Easy.git
synced 2026-06-24 01:54:08 +00:00
25 lines
No EOL
688 B
JavaScript
Executable file
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();
|
|
} |