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

init("protector", "XerinFuscator");

function detect(bShowType, bShowVersion, bShowOptions) {
    if (PE.isNET() && PE.isNetObjectPresent("XerinAtrribute")) { // At[rr]ibute <- developer mistake
        const
            sectionToCheck = PE.section[0],
            versionStringOffset = PE.findString(sectionToCheck.FileOffset, sectionToCheck.FileSize, "XerinFuscator v");

        if (versionStringOffset) {
            bDetected = true;

            sVersion = "v" + PE.getString(versionStringOffset + 15, 0x10);

            if (PE.isNetObjectPresent("Xerin.Runtime")) sOptions = "XVM";
        }
    }

    return result(bShowType, bShowVersion, bShowOptions);
}