{"success":true,"data":{"ext":"dex","name":"Dalvik executable file","description":"Dalvik executable (DEX) is the bytecode file format used by the Android runtime, originally created by Google and maintained as part of the Android platform. It stores compiled application code for Android apps and is used by the system to install and run software, including code distributed in APK packages and converted from other Java-based formats. DEX files are generally safe, though as executable code they should be obtained from trusted sources and may be analyzed for malicious behavior.","mime":["application/x-dex"],"risk_level":"Safe","signatures":[{"hex":"64 65 78 0A","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"}]},{"hex":"64 65 78 0A 30 33 35 00","offset":0,"sources":[{"name":"Wikipedia","url":"https://en.wikipedia.org/wiki/List_of_file_signatures"}]}],"related":["aar","apk","class","jar"],"usage":{"python":"def is_dex(file_path: str) -> bool:\n    \"\"\"Check if file is a valid DEX by magic bytes.\"\"\"\n    signature = bytes([0x64, 0x65, 0x78, 0x0A])\n    with open(file_path, \"rb\") as f:\n        return f.read(4) == signature","node":"function isDEX(buffer: Buffer): boolean {\n  const signature = Buffer.from([0x64, 0x65, 0x78, 0x0A]);\n  return buffer.subarray(0, 4).equals(signature);\n}","go":"func IsDEX(data []byte) bool {\n    signature := []byte{0x64, 0x65, 0x78, 0x0A}\n    if len(data) < 4 {\n        return false\n    }\n    return bytes.Equal(data[:4], signature)\n}"},"category":"Executables"}}