{"success":true,"data":{"ext":"com","name":"Windows/DOS executable file","description":"The COM file format is a legacy executable format created for MS-DOS and maintained for compatibility by Microsoft and DOS-compatible systems. It is used for simple command-line utilities, bootstrapping programs, and small executables loaded directly into memory by DOS-compatible environments. Because COM files can contain arbitrary executable code and are frequently associated with malware, they should be handled cautiously, especially on legacy or emulated systems.","mime":["application/x-msdownload"],"risk_level":"High","signatures":[{"hex":"4D 5A","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":"Gary Kessler","url":"https://www.garykessler.net/library/file_sigs_GCK_latest.html"}]}],"related":["dll","exe","sys","a","bin","elf"],"usage":{"python":"def is_com(file_path: str) -> bool:\n    \"\"\"Check if file is a valid COM by magic bytes.\"\"\"\n    signature = bytes([0x4D, 0x5A])\n    with open(file_path, \"rb\") as f:\n        return f.read(2) == signature","node":"function isCOM(buffer: Buffer): boolean {\n  const signature = Buffer.from([0x4D, 0x5A]);\n  return buffer.subarray(0, 2).equals(signature);\n}","go":"func IsCOM(data []byte) bool {\n    signature := []byte{0x4D, 0x5A}\n    if len(data) < 2 {\n        return false\n    }\n    return bytes.Equal(data[:2], signature)\n}"},"category":"Executables"}}