// DIE's signature file

init("installer","Wise Installer");

function detect(bShowType,bShowVersion,bShowOptions)
{
    if(PE.getOverlaySize()>80)
    {
        var nOffset=PE.getOverlayOffset()+77;
        if(PE.readDword(nOffset)==PE.getSize())
        {
            bDetected=1;
        }
        else if(PE.section[".WISE"])
        {
            bDetected=1;
        }
        else if(PE.compareEP("558bec81ec........5356576a..ff15........ff15........8bf08975..8a063c..0f85........8a46..46"))
        {
            bDetected=1;
        }
        else if(PE.compareEP("558bec81ec........5356576a..5e6a..8975..ff15........ff15........8bf8897d..8a073c..0f85........8a47..47"))
        {
            bDetected=1;
        }
    }
    else if(PE.compareEP("81ec........535556576a..ff15........33db895c24..895c24..895c24..895c24..895c24..ff15........8a08894424"))
    {
        if(PE.isSectionNamePresent(".WISE"))
        {
            sOptions="CAB";
            bDetected=1;
        }
    }
    if(PE.isSectionNamePresent(".WISE"))
    {
        if(PE.findSignature(PE.getSectionFileOffset(PE.getSectionNumber(".WISE")), 0x1000, "'Wise Installation Wizard...'")!=-1)
        {
            bDetected=1;
        }
    }
    if(PE.compareEP("64a1........558bec6a..68........68........50648925........83ec..5356578965..ff15"))
    {
        var nOffset=PE.getOverlayOffset();
        var nZipsig=PE.findSignature(nOffset,0x1000,"504b0304");
        if(nZipsig!=-1)
        {
            sOptions="ZIP";
            bDetected=1;
        }
        else if(PE.compareOverlay("'MSCF'0000"))
        {
            sOptions="CAB";
            bDetected=1;
        }
    }

    return result(bShowType,bShowVersion,bShowOptions);
}
