// DIE's signature file
// Author: sendersu
/*
Java -> native code
*/

init("compiler", "Excelsior JET");

function detect(bShowType, bShowVersion, bShowOptions) {
    var nFound = 0,
        nOffset;

    for (var i = 0; i <= PE.nLastSection; i++) {
        nOffset = PE.section[i].FileOffset;
        sSection = PE.section[i].Name;
        if (sSection == ".jidata") {
            if (PE.isSignaturePresent(nOffset, 16, "'JIMP'")) {
                ++nFound;
            }
        } else if (sSection == ".jedata") {
            if (PE.isSignaturePresent(nOffset, 16, "'JEXP'")) {
                ++nFound;
            }
        } else if (sSection == ".config") {
            ++nFound;
        }
        if (nFound == 3) {
            bDetected = true;
            break;
        }
    }

    _setLang("Java", bDetected);
    return result(bShowType, bShowVersion, bShowOptions);
}