{"success":true,"data":{"ext":"jar","name":"Java archive; compressed file package for classes and data","description":"Java Archive (JAR) is a ZIP-based file format defined as part of the Java platform, originally created by Sun Microsystems and maintained by Oracle. It is used to package compiled Java classes, metadata, resources, and libraries for application distribution, applets, and modular software deployment. Because JAR files can contain executable code and nested archives, they should be treated cautiously when obtained from untrusted sources and verified before use.","mime":["application/java-archive"],"risk_level":"High","signatures":[{"hex":"50 4B 03 04","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":"50 4B 05 06","offset":0,"sources":[{"name":"Wikipedia","url":"https://en.wikipedia.org/wiki/List_of_file_signatures"}]},{"hex":"50 4B 07 08","offset":0,"sources":[{"name":"Wikipedia","url":"https://en.wikipedia.org/wiki/List_of_file_signatures"}]},{"hex":"4A 41 52 43 53 00","offset":0,"sources":[{"name":"Gary Kessler","url":"https://www.garykessler.net/library/file_sigs_GCK_latest.html"}]},{"hex":"50 4B 03 04 14 00 08 00 08 00","offset":0,"sources":[{"name":"Gary Kessler","url":"https://www.garykessler.net/library/file_sigs_GCK_latest.html"}]},{"hex":"5F 27 A8 89","offset":0,"sources":[{"name":"Gary Kessler","url":"https://www.garykessler.net/library/file_sigs_GCK_latest.html"}]}],"related":["aar","apk","class","dex"],"usage":{"python":"def is_jar(file_path: str) -> bool:\n    \"\"\"Check if file is a valid JAR by magic bytes.\"\"\"\n    signature = bytes([0x50, 0x4B, 0x03, 0x04])\n    with open(file_path, \"rb\") as f:\n        return f.read(4) == signature","node":"function isJAR(buffer: Buffer): boolean {\n  const signature = Buffer.from([0x50, 0x4B, 0x03, 0x04]);\n  return buffer.subarray(0, 4).equals(signature);\n}","go":"func IsJAR(data []byte) bool {\n    signature := []byte{0x50, 0x4B, 0x03, 0x04}\n    if len(data) < 4 {\n        return false\n    }\n    return bytes.Equal(data[:4], signature)\n}"},"category":"Executables"}}