aboutsummaryrefslogtreecommitdiff
path: root/contrib/file/magic/Magdir/cafebabe
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/file/magic/Magdir/cafebabe')
-rw-r--r--contrib/file/magic/Magdir/cafebabe97
1 files changed, 51 insertions, 46 deletions
diff --git a/contrib/file/magic/Magdir/cafebabe b/contrib/file/magic/Magdir/cafebabe
index 8cc0902b4cd5..eb28a4b27651 100644
--- a/contrib/file/magic/Magdir/cafebabe
+++ b/contrib/file/magic/Magdir/cafebabe
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: cafebabe,v 1.27 2021/04/26 15:56:00 christos Exp $
+# $File: cafebabe,v 1.31 2024/08/30 16:53:22 christos Exp $
# Cafe Babes unite!
#
# Since Java bytecode and Mach-O universal binaries have the same magic number,
@@ -14,10 +14,47 @@
# (and use as a hack). Let's not use 18, because the Mach-O people
# might add another one or two as time goes by...
#
+
+### MACH-O START ###
+# URL: https://en.wikipedia.org/wiki/Mach-O
+
+0 name mach-o \b [
+# for debugging purpose CPU type as hexadecimal
+#>0 ubequad x CPU=%16.16llx
+# display CPU type as string like: i386 x86_64 ... armv7 armv7k ...
+>0 use mach-o-cpu \b
+# for debugging purpose print offset to 1st mach_header like:
+# 1000h 4000h seldom 2d000h 88000h 5b000h 10e000 h
+#>8 ubelong x at %#x offset
+>(8.L) indirect x \b:
+>0 belong x \b]
+
+# Reference: https://opensource.apple.com/source/cctools/cctools-949.0.1/
+# include/mach-o/fat.h
+# include/mach/machine.h
+0 belong 0xcafebabe
+>4 belong 1 Mach-O universal binary with 1 architecture:
+!:mime application/x-mach-binary
+>>8 use mach-o \b
+# nfat_arch; number of CPU architectures; highest is 18 for CPU_TYPE_POWERPC in 2020
+>4 ubelong >1
+>>4 ubelong <20 Mach-O universal binary with %d architectures:
+!:mime application/x-mach-binary
+>>>8 use mach-o \b
+>>>4 ubelong >1
+>>>>28 use mach-o \b
+>>>4 ubelong >2
+>>>>48 use mach-o \b
+>>>4 ubelong >3
+>>>>68 use mach-o \b
+>>>4 ubelong >4
+>>>>88 use mach-o \b
+>>>4 ubelong >5
+>>>>108 use mach-o \b
+### MACH-O END ###
### JAVA START ###
# Reference: http://en.wikipedia.org/wiki/Java_class_file
# Update: Joerg Jenderek
-0 belong 0xcafebabe
>4 ubelong >30 compiled Java class data,
!:mime application/x-java-applet
#!:mime application/java-byte-code
@@ -44,6 +81,18 @@
>>4 belong 0x0038 (Java SE 12)
>>4 belong 0x0039 (Java SE 13)
>>4 belong 0x003A (Java SE 14)
+>>4 belong 0x003B (Java SE 15)
+>>4 belong 0x003C (Java SE 16)
+>>4 belong 0x003D (Java SE 17)
+>>4 belong 0x003E (Java SE 18)
+>>4 belong 0x003F (Java SE 19)
+>>4 belong 0x0040 (Java SE 20)
+>>4 belong 0x0041 (Java SE 21)
+>>4 belong 0x0042 (Java SE 22)
+>>4 belong 0x0043 (Java SE 23)
+>>4 belong 0x0044 (Java SE 24)
+>>4 belong 0x0045 (Java SE 25)
+>>4 belong 0x0046 (Java SE 26)
# pool count unequal zero
#>>8 beshort x \b, pool count %#x
# pool table
@@ -54,48 +103,4 @@
>4 byte x \b%d
!:mime application/x-java-pack200
-
-0 belong 0xcafed00d JAR compressed with pack200,
->5 byte x version %d.
->4 byte x \b%d
-!:mime application/x-java-pack200
-
### JAVA END ###
-### MACH-O START ###
-# URL: https://en.wikipedia.org/wiki/Mach-O
-
-0 name mach-o \b [
-# for debugging purpose CPU type as hexadecimal
-#>0 ubequad x CPU=%16.16llx
-# display CPU type as string like: i386 x86_64 ... armv7 armv7k ...
->0 use mach-o-cpu \b
-# for debugging purpose print offset to 1st mach_header like:
-# 1000h 4000h seldom 2d000h 88000h 5b000h 10e000 h
-#>8 ubelong x at %#x offset
->(8.L) indirect x \b:
->0 belong x \b]
-
-# Reference: https://opensource.apple.com/source/cctools/cctools-949.0.1/
-# include/mach-o/fat.h
-# include/mach/machine.h
-0 belong 0xcafebabe
->4 belong 1 Mach-O universal binary with 1 architecture:
-!:mime application/x-mach-binary
->>8 use mach-o \b
-# nfat_arch; number of CPU architectures; highest is 18 for CPU_TYPE_POWERPC in 2020
->4 ubelong >1
->>4 ubelong <20 Mach-O universal binary with %d architectures:
-!:mime application/x-mach-binary
->>>8 use mach-o \b
->>>4 ubelong >1
->>>>28 use mach-o \b
->>>4 ubelong >2
->>>>48 use mach-o \b
->>>4 ubelong >3
->>>>68 use mach-o \b
->>>4 ubelong >4
->>>>88 use mach-o \b
->>>4 ubelong >5
->>>>108 use mach-o \b
-
-### MACH-O END ###