// Author of detect is KDSS-Research (koffidev365supp@gmail.com)

// Rewritten by DosX
// E-Mail: collab@kay-software.ru
// GitHub: https://github.com/DosX-dev
// Telegram: @DosX_dev

init("packer", "Nuitka");

function detect(bShowType, bShowVersion, bShowOptions) {
    if (PE.isSectionNamePresent(".rdata")) {

        var section = PE.section[".rdata"],
            sectionOffset = section.FileOffset,
            sectionSize = section.FileSize;

        if (PE.findString(sectionOffset, sectionSize, "__nuitka_version__") != -1) {
            bDetected = true;
        } else if (PE.findString(sectionOffset, sectionSize, "NUITKA_ONEFILE_PARENT") != -1) {
            bDetected = true;
            sOptions = "OneFile";
        }
    }
    return result(bShowType, bShowVersion, bShowOptions);
}