mirror of
https://github.com/horsicq/Detect-It-Easy.git
synced 2026-06-24 01:54:08 +00:00
20 lines
No EOL
481 B
JavaScript
Executable file
20 lines
No EOL
481 B
JavaScript
Executable file
// Detect It Easy: detection rule file
|
|
// Author: horsicq <horsicq@gmail.com>
|
|
|
|
// https://en.wikipedia.org/wiki/PDF
|
|
meta("format", "PDF");
|
|
|
|
function detect() {
|
|
if (/^\%PDF-\d+\.\d+/.test(File.read_ansiString(0, 10))) {
|
|
sVersion = File.getString(5, 3);
|
|
bDetected = true;
|
|
|
|
var c = 0;
|
|
for (i = 8; i < 15; i++)
|
|
if (File.read_uint8(i) & 0x80) c++;
|
|
|
|
if (c) sOptions = "binary data";
|
|
}
|
|
|
|
return result();
|
|
} |