{"success":true,"data":{"ext":"cab","name":"Microsoft cabinet file","description":"Microsoft Cabinet (CAB) is an archive file format developed and maintained by Microsoft for compressing and packaging files. It is used to distribute software components, Windows updates, device drivers, and installation resources, and it is supported by Windows system tools and several archival utilities. CAB files are generally safe, but like other archives they can conceal malicious content; the format is also associated with older Windows installation and deployment workflows.","mime":["application/vnd.ms-cab-compressed"],"risk_level":"Safe","signatures":[{"hex":"4D 53 43 46","offset":0,"sources":[{"name":"Apache Tika","url":"https://raw.githubusercontent.com/apache/tika/main/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml"},{"name":"Wikipedia","url":"https://en.wikipedia.org/wiki/List_of_file_signatures"},{"name":"Gary Kessler","url":"https://www.garykessler.net/library/file_sigs_GCK_latest.html"},{"name":"Neil Harvey FileSignatures","url":"https://raw.githubusercontent.com/neilharvey/FileSignatures/master/src/FileSignatures/Formats/Cab.cs"}]},{"hex":"49 53 63 28","offset":0,"sources":[{"name":"Wikipedia","url":"https://en.wikipedia.org/wiki/List_of_file_signatures"},{"name":"Gary Kessler","url":"https://www.garykessler.net/library/file_sigs_GCK_latest.html"}]},{"hex":"4D 53 43 46 00 00 00 00","offset":0,"sources":[{"name":"Apache Tika","url":"https://raw.githubusercontent.com/apache/tika/main/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml"}]}],"related":["7z","ace","arj","bz","bz2","cpio"],"usage":{"python":"def is_cab(file_path: str) -> bool:\n    \"\"\"Check if file is a valid CAB by magic bytes.\"\"\"\n    signature = bytes([0x4D, 0x53, 0x43, 0x46])\n    with open(file_path, \"rb\") as f:\n        return f.read(4) == signature","node":"function isCAB(buffer: Buffer): boolean {\n  const signature = Buffer.from([0x4D, 0x53, 0x43, 0x46]);\n  return buffer.subarray(0, 4).equals(signature);\n}","go":"func IsCAB(data []byte) bool {\n    signature := []byte{0x4D, 0x53, 0x43, 0x46}\n    if len(data) < 4 {\n        return false\n    }\n    return bytes.Equal(data[:4], signature)\n}"},"category":"Archives"}}