// DIE's signature file

init("format", "Small Web Format (.SWF)");
includeScript("zlib");

function detect(bShowType, bShowVersion, bShowOptions) {
    if (Binary.getSize() >= 8) {
        switch (Binary.getString(0, 3)) {
            case "FWS":
                bDetected = true;
                sOptions = "uncompressed";
                break;
            case "CWS":
                if (detect_zlib(Binary, 0x08)) { bDetected = true; }
                break;
            case "ZWS":
                bDetected = true;
                sOptions = "LZMA";
        }
        if (bDetected) {
            sVersion = Binary.read_uint8(0x03);
        }
    }

    return result(bShowType, bShowVersion, bShowOptions);
}