// Detect It Easy: detection rule file format

// https://github.com/nexe/nexe
init("packer", "nexe");

function detect(bShowType, bShowVersion, bShowOptions) {
    if (!PE.isExportFunctionPresent("napi_wrap"))
        return;

    // Has overlay at all
    bDetected = PE.isOverlayPresent() && PE.getOverlaySize() >= 0x100 && PE.findString(PE.section[1].FileOffset, PE.section[1].FileSize, "nexe~~sentinel") != -1;

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