A pattern mask identifies bits in the pattern to ignore when searching for a pattern in a file. The following is an example of a file content sniffer with a pattern mask:
0 string BMxxxx\000\000 &0xffff00000000ffff image/bmp
The pattern and mask in the example are as follows:
Pattern |
B |
M |
x |
x |
x |
x |
\000 |
\000 |
Mask |
ff |
ff |
00 |
00 |
00 |
00 |
ff |
ff |
The pattern and mask specify a file with the following characteristics:
The file begins with BM.
BM is followed by four bytes with any values.
The four bytes are followed by \000\000.
The file content sniffer specifies that the MIME type of files that match the pattern and mask is image/bmp.