// Detect It Easy: detection rule file format

// https://en.wikipedia.org/wiki/AutoIt
init("format", "AutoIt");

function detect(bShowType, bShowVersion, bShowOptions) {
    if (PE.resource["SCRIPT"]) {
        sVersion = "3.XX";
        bDetected = true;
    } else if (PE.compareEP("e8$$$$$$$$8bff558bec83ec..a1........8365....8365....5357bf........bb........3bc774..85c374..f7d0")) {
        if (PE.compareOverlay("a3484bbe986c4aa9")) {
            sVersion = "3.XX";
            bDetected = true;
        }
    } else if (PE.getVersionStringInfo("FileDescription") == "Compiled AutoIt Script") {
        sVersion = PE.getFileVersionMS();
        bDetected = true;
    }

    return result(bShowType, bShowVersion, bShowOptions);
}