// Detect It Easy: detection rule file
// Authors: hypn0, BJNFNE, DosX

meta("compiler", "Intel C/C++");

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

    const watermarkPos = 0x4ce;

    if (PE.compareEP("83ec..56ff15........8bf08a063c..75..8a46..463c..74..84c074..8a46..463c..75..803e..75..46eb")) {
        bDetected = true;
    } else if (!PE.is64() && PE.compare("'Intel(R) C++ Compiler for 32-bit applications'", watermarkPos)) {
        sVersion = PE.getString(watermarkPos + 55, 8);
        if (sVersion && sVersion.indexOf(" ") !== -1) {
            sVersion = sVersion.split(" ")[0];
        } else {
            sVersion = String();
        }

        bDetected = true;
    }

    sLang = "C/C++";

    return result();
}