// DIE's signature file
// Author: Arjan Onwezen
// Info: https://gist.github.com/lgg/e6ccc6e212d18dd2ecd8a8c116fb1e45

init("format", "KeePass");

function detect(bShowType, bShowVersion, bShowOptions) {
    if (Binary.compare("03 D9 A2 9A")) {
        bDetected = 1;
        if (Binary.compare("65 FB 4B B5", 4)) {
            sName = "KeePass 1.x (.KBD)"
        }
        if (Binary.compare("66 FB 4B B5", 4)) {
            sName = "KeePass 2.x pre-release (alpha & beta) (.KBDX)"
        }
        if (Binary.compare("67 FB 4B B5", 4)) {
            sName = "KeePass 2.x (.KBDX)"
        }
    }

    return result(bShowType, bShowVersion, bShowOptions);
}