java 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #------------------------------------------------------------
  2. # $File: java,v 1.22 2023/01/11 23:59:49 christos Exp $
  3. # Java ByteCode and Mach-O binaries (e.g., Mac OS X) use the
  4. # same magic number, 0xcafebabe, so they are both handled
  5. # in the entry called "cafebabe".
  6. #------------------------------------------------------------
  7. # Java serialization
  8. # From Martin Pool (m.pool@pharos.com.au)
  9. 0 beshort 0xaced Java serialization data
  10. >2 beshort >0x0004 \b, version %d
  11. 0 belong 0xfeedfeed Java KeyStore
  12. !:mime application/x-java-keystore
  13. 0 belong 0xcececece Java JCE KeyStore
  14. !:mime application/x-java-jce-keystore
  15. # Java source
  16. 0 regex \^import.*;$ Java source
  17. !:mime text/x-java
  18. # Java HPROF dumps
  19. # https://java.net/downloads/heap-snapshot/hprof-binary-format.html
  20. 0 string JAVA\x20PROFILE\x201.0.
  21. >0x12 byte 0
  22. >>0x11 ubyte-0x31 <2 Java HPROF dump,
  23. >>>0x17 beqdate/1000 x created %s
  24. # Java jmod module
  25. # See https://hg.openjdk.java.net/jdk9/jdk9/jdk/file/tip/src/java.base/share/classes/jdk/internal/jmod/JmodFile.java
  26. # Grr. 2 byte magic "JM", really? In 2019?
  27. 0 belong 0x4a4d0100 Java jmod module version 1.0
  28. !:mime application/x-java-jmod
  29. # Java jlinked image
  30. # See https://hg.openjdk.java.net/jdk9/jdk9/jdk/file/tip/src/java.base/share/native/libjimage/imageFile.hpp
  31. 0 belong 0xcafedada Java module image (big endian)
  32. >4 beshort >0x00 \b, version %d
  33. >6 beshort x \b.%d
  34. !:mime application/x-java-image
  35. 0 lelong 0xcafedada Java module image (little endian)
  36. >6 leshort >0x00 \b, version %d
  37. >4 leshort x \b.%d
  38. !:mime application/x-java-image
  39. # JAR Manifest & Signature File
  40. # Reference: https://docs.oracle.com/javase/8/docs/technotes/guides/jar/jar.html
  41. 0 string/t Manifest-Version:\x201.0 JAR Manifest
  42. !:ext MF
  43. 0 string/t Signature-Version:\x201.0 JAR Signature File
  44. !:ext SF