// Detect It Easy: detection rule file
// Author: horsicq <horsicq@gmail.com>

meta("sfx", "WinRAR");

function detect() {
    if (PE.isNet()) return; // Doesn't support .NET

    var isPkOverlay = PE.compareOverlay("'PK'");

    if (isPkOverlay || PE.compareOverlay("'Rar!'")) {
        if (PE.resource["STARTDLG"] && PE.resource["LICENSEDLG"] || PE.resource["INSTALL"] && PE.resource["SETUP"]) {
            if (isPkOverlay) {
                sOptions = "ZIP";
            }

            bDetected = true;
        }
    }
    if (PE.compareEP("e8$$$$$$$$53bb........e8........85c074..33d28a1083fa..75..40eb")) {
        if (PE.compareOverlay("'Rar!'1a")) {
            bDetected = true;
        }
    }

    return result();
}