// DIE's signature file

init("packer","PKLITE");

function detect(bShowType,bShowVersion,bShowOptions)
{
    if(MSDOS.compare("'PKLITE'",0x1E)||MSDOS.compare("'PKlite'",0x1E))
    {
        var bBit=MSDOS.readByte(0x1D);
        sVersion=(bBit&0x7)+"."+("0"+MSDOS.readByte(0x1C)).slice(-2);

        if(bBit&0x8)
        {
            sOptions="Extra compression";
        }
        if(bBit&0x10)
        {
            sOptions=sOptions.append("Multi-segment file");
        }

        bDetected=1;
    }
    else if(MSDOS.compareEP("1FB409BA....CD21B8....CD21"))
    {
        sVersion="1.50";
        sOptions="CRC check";
        bDetected=1;
    }
    else if(MSDOS.compareEP("50B8....BA....05....3B060200"))
    {
        sVersion="1.50";
        bDetected=1;
    }
    else if(MSDOS.compareEP("B8....BA....05....3B060200"))
    {
        sVersion="1.12-1.13";
        bDetected=1;
    }
    else if(MSDOS.compareEP("b8....ba....05....2d....fa8ed0fb2d....8ec050b9....33ff57be....fc565706518cc88ec0"))
    {
        sVersion="1.12";
        sOptions="extra compression";
        bDetected=1;
    }
    else if(MSDOS.compareEP("ba....b8....05....3B06....73..2d....fa8ed0fb2d....8ec050b9....33ff57be....fcf3a5cb"))
    {
        sVersion="1.1x";
        bDetected=1;
    }
    else if(MSDOS.compareEP("b8....05....3B06....72..cd20b9....2d....8ed02d....8ec006ba....be....33ff571e571feb"))
    {
        sVersion="1.1x";
        bDetected=1;
    }
    else if(MSDOS.compareEP("B8....BA....3bc473..8bc42d....25....8bf8b9....be....fcf3a58bd8b1..d3eb8cd903d95333db53cb"))
    {
        sVersion="1.12, 1.20";
        bDetected=1;
    }
    else if(MSDOS.compareEP("50532b06....0a06....8b1e....5b58b8....ba....8cdb03d83b1e....73..83eb..fa8ed3bc....fb"))
    {
        sVersion="1.05";
        bDetected=1;
    }
    else if(MSDOS.compareEP("8cd805....ba....903b06....72..b409ba....cd21cd20"))
    {
        sVersion="1.15";
        bDetected=1;
    }
    else if(MSDOS.compareEP("B8....BA....8cdb03d83b1e....73..83eb..fa8ed3bc....fb83eb..8ec353b9....33ff57be....fcf3a5cb"))
    {
        sVersion="1.03-1.05";
        bDetected=1;
    }

    return result(bShowType,bShowVersion,bShowOptions);
}
