summaryrefslogtreecommitdiffstats
path: root/contrib/file/Magdir/cafebabe
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2007-05-24 16:12:23 +0000
committerobrien <obrien@FreeBSD.org>2007-05-24 16:12:23 +0000
commit09615277daeb6e2f432f5fd5dbc254e4b0428f99 (patch)
tree8763f543fed8d8bd91f35cf2ca469b54b327876c /contrib/file/Magdir/cafebabe
parent0af3611cb630b0c4b7858a027487eec4d9f8d35c (diff)
downloadFreeBSD-src-09615277daeb6e2f432f5fd5dbc254e4b0428f99.zip
FreeBSD-src-09615277daeb6e2f432f5fd5dbc254e4b0428f99.tar.gz
Virgin import of Christos Zoulas's FILE 4.19.
Diffstat (limited to 'contrib/file/Magdir/cafebabe')
-rw-r--r--contrib/file/Magdir/cafebabe21
1 files changed, 21 insertions, 0 deletions
diff --git a/contrib/file/Magdir/cafebabe b/contrib/file/Magdir/cafebabe
new file mode 100644
index 0000000..233411c
--- /dev/null
+++ b/contrib/file/Magdir/cafebabe
@@ -0,0 +1,21 @@
+#------------------------------------------------------------------------------
+# Cafe Babes unite!
+#
+# Since Java bytecode and Mach-O fat-files have the same magic number, the test
+# must be performed in the same "magic" sequence to get both right. The long
+# at offset 4 in a mach-O fat file tells the number of architectures; the short at
+# offset 4 in a Java bytecode file is the JVM minor version and the
+# short at offset 6 is the JVM major version. Since there are only
+# only 18 labeled Mach-O architectures at current, and the first released
+# Java class format was version 43.0, we can safely choose any number
+# between 18 and 39 to test the number of architectures against
+# (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...
+#
+0 belong 0xcafebabe
+>4 belong >30 compiled Java class data,
+>>6 beshort x version %d.
+>>4 beshort x \b%d
+>4 belong 1 Mach-O fat file with 1 architecture
+>4 belong >1
+>>4 belong <20 Mach-O fat file with %ld architectures
OpenPOWER on IntegriCloud