Detect-It-Easy/db/Binary/format_doc.RTF.1.sg
2026-06-20 22:32:01 +02:00

15 lines
No EOL
419 B
JavaScript
Executable file

// Detect It Easy: detection rule file
// Author: horsicq <horsicq@gmail.com>
// https://en.wikipedia.org/wiki/Rich_Text_Format
meta("format", "RTF");
function detect() {
if (/^{\\rtf1?/.test(File.read_ansiString(0, 6))) {
bDetected = true;
for (var i = 4; i < Math.min(File.getSize(), 0x100); i++)
if (File.read_uint8(i) & 0x80) { return; }
}
return result();
}