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