java 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #------------------------------------------------------------
  2. # $File: java,v 1.21 2019/02/18 17:58:50 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