// DIE's signature file
// Author: LinXP
// Status: WIP

init("archive","Windows Imaging Format");

function detect(bShowType,bShowVersion,bShowOptions)
{
    if(Binary.getSize()>=9)
    {
	
        if(Binary.compare("'MSWIM'000000"))
        {
            bDetected=true;
            sName +=" (.WIM)"
            if (Binary.isVerbose())
            {
                sOptions = "{"+Binary.read_UUID(0x18)+"}";
            }

            switch(Binary.read_uint16(0x12))
            {
                case 0: sOption("No compression");      break;
                case 2: sOption("XPRESS compression");  break;
                case 4: sOption("LZX compression");     break;
                case 8: sOption("LZMS compression");    break;
                default: bDetected=false; 
            }
            sOption("Part Number:" + Binary.read_uint16(0x28) + "/"+Binary.read_uint16(0x2A)); 

        }

        else if(Binary.compare("'WLPWM'000000"))
        {
            bDetected=true; 
            sName +=", wimlib (.WIM)"
        }

    }

    return result(bShowType,bShowVersion,bShowOptions);
}
