// Detect It Easy: detection rule file
// Author: Kaens (TG @kaens)

meta("image", "Zlib-packed BMP file (.ZBM)");

function detect() {

    // found in ex. Snails for Palm OS, .zbm are simply zlib archives at offset 0x10 of uncompressed bitmap images
    if (X.c("'ZBMP'") && X.c("78DA", 0x10) && (w = X.U32(4)) && w < 0x10000 && (h = X.U32(8)) && h < 0x10000) {
        bDetected = true;
        sOptions = w + 'x' + h; //if(n=X.U32(0xC) sOption(n,'x'))
    }

    return result();
}