// Detect It Easy: detection rule file
// Author: Arjan Onwezen
// Info: https://gist.github.com/lgg/e6ccc6e212d18dd2ecd8a8c116fb1e45
// Rewritten by BJNFNE

meta("format", "KeePass");

function detect() {
    if (Binary.compare("03 D9 A2 9A")) {
        bDetected = true;
        if (Binary.compare("65 FB 4B B5", 4)) {
            sVersion = "1.X";
            sOptions = ".KBD";
            bDetected = true;
        }
        if (Binary.compare("66 FB 4B B5", 4)) {
            sVersion = "2.X, pre-release (alpha/beta)";
            sOptions = ".KBDX";
            bDetected = true;
        }
        if (Binary.compare("67 FB 4B B5", 4)) {
            sVersion = "2.X";
            sOptions = ".KBDX";
            bDetected = true;
        }
    }

    return result();
}