// DIE's signature file
// https://github.com/DosX-dev/ASM-Guard

init("protector", "ASM Guard");

function detect(bShowType, bShowVersion, bShowOptions) {
    if (PE.isOverlayPresent()) {
        var nOffset = PE.getOverlayOffset();
        var nSize = PE.getOverlaySize();

        if (!PE.isDeepScan()) {
            if (nSize > 0x100) {
                nSize = 0x100;
            }
        }

        if (PE.findSignature(nOffset, nSize, "'asmg-protected'00") != -1) {
            sVersion = "2.XX";
            bDetected = true;
        } else if (PE.isSectionNamePresent("ASMGUARD")) {
            sVersion = "2.XX";
            bDetected = true;
        }
    }

    return result(bShowType, bShowVersion, bShowOptions);
}