// DIE's signature file

init("compiler","Free Basic");

function detect(bShowType,bShowVersion,bShowOptions)
{
    if(PE.compareEP("5589E583EC08C70424..000000FF15........E8..FFFFFF89EC31C05DC389F65589E583EC08"))
    {
        // Free Basic is really MinGW, so make an extra check.
        // Well, it works for the one file I have on hand...
        if(PE.section[".rdata"])
        {
            var nOffset=PE.section[".rdata"].FileOffset;
            var nSize=PE.section[".rdata"].FileSize;
            if(nSize>0x800&&PE.isSignaturePresent(nOffset+nSize-0x800,0x800,"'FreeBASIC'"))
            {
                sVersion="0.14+";
                bDetected=1;
            }
        }
    }
    else if(PE.compareEP("E8....0000E801000000C35589E5"))
    {
        sVersion="0.11";
        bDetected=1;
    }

    return result(bShowType,bShowVersion,bShowOptions);
}
