head	1.1;
branch	1.1.1;
access;
symbols
	netbsd-11-0-RC4:1.1.1.12
	netbsd-11-0-RC3:1.1.1.12
	netbsd-11-0-RC2:1.1.1.12
	netbsd-11-0-RC1:1.1.1.12
	perseant-exfatfs-base-20250801:1.1.1.12
	netbsd-11:1.1.1.12.0.6
	netbsd-11-base:1.1.1.12
	netbsd-10-1-RELEASE:1.1.1.12
	perseant-exfatfs-base-20240630:1.1.1.12
	perseant-exfatfs:1.1.1.12.0.4
	perseant-exfatfs-base:1.1.1.12
	netbsd-8-3-RELEASE:1.1.1.8
	netbsd-9-4-RELEASE:1.1.1.10
	netbsd-10-0-RELEASE:1.1.1.12
	netbsd-10-0-RC6:1.1.1.12
	netbsd-10-0-RC5:1.1.1.12
	netbsd-10-0-RC4:1.1.1.12
	netbsd-10-0-RC3:1.1.1.12
	netbsd-10-0-RC2:1.1.1.12
	netbsd-10-0-RC1:1.1.1.12
	FILE5_45:1.1.1.12
	netbsd-10:1.1.1.12.0.2
	netbsd-10-base:1.1.1.12
	FILE5_43:1.1.1.12
	netbsd-9-3-RELEASE:1.1.1.10
	cjep_sun2x-base1:1.1.1.11
	cjep_sun2x:1.1.1.11.0.4
	cjep_sun2x-base:1.1.1.11
	cjep_staticlib_x-base1:1.1.1.11
	netbsd-9-2-RELEASE:1.1.1.10
	cjep_staticlib_x:1.1.1.11.0.2
	cjep_staticlib_x-base:1.1.1.11
	FILE5_40:1.1.1.11
	netbsd-9-1-RELEASE:1.1.1.10
	FILE5_39:1.1.1.10
	phil-wifi-20200421:1.1.1.10
	phil-wifi-20200411:1.1.1.10
	is-mlppp:1.1.1.10.0.4
	is-mlppp-base:1.1.1.10
	phil-wifi-20200406:1.1.1.10
	netbsd-8-2-RELEASE:1.1.1.8
	netbsd-9-0-RELEASE:1.1.1.10
	netbsd-9-0-RC2:1.1.1.10
	FILE5_38:1.1.1.10
	netbsd-9-0-RC1:1.1.1.10
	phil-wifi-20191119:1.1.1.10
	netbsd-9:1.1.1.10.0.2
	netbsd-9-base:1.1.1.10
	phil-wifi-20190609:1.1.1.10
	netbsd-8-1-RELEASE:1.1.1.8
	FILE5_37:1.1.1.10
	netbsd-8-1-RC1:1.1.1.8
	pgoyette-compat-merge-20190127:1.1.1.9.2.1
	pgoyette-compat-20190127:1.1.1.10
	pgoyette-compat-20190118:1.1.1.10
	pgoyette-compat-1226:1.1.1.10
	pgoyette-compat-1126:1.1.1.10
	pgoyette-compat-1020:1.1.1.10
	FILE5_35:1.1.1.10
	pgoyette-compat-0930:1.1.1.9
	pgoyette-compat-0906:1.1.1.9
	netbsd-7-2-RELEASE:1.1.1.5
	pgoyette-compat-0728:1.1.1.9
	netbsd-8-0-RELEASE:1.1.1.8
	phil-wifi:1.1.1.9.0.4
	phil-wifi-base:1.1.1.9
	pgoyette-compat-0625:1.1.1.9
	netbsd-8-0-RC2:1.1.1.8
	pgoyette-compat-0521:1.1.1.9
	pgoyette-compat-0502:1.1.1.9
	pgoyette-compat-0422:1.1.1.9
	netbsd-8-0-RC1:1.1.1.8
	FILE5_33:1.1.1.9
	pgoyette-compat-0415:1.1.1.9
	pgoyette-compat-0407:1.1.1.9
	pgoyette-compat-0330:1.1.1.9
	pgoyette-compat-0322:1.1.1.9
	pgoyette-compat-0315:1.1.1.9
	netbsd-7-1-2-RELEASE:1.1.1.5
	pgoyette-compat:1.1.1.9.0.2
	pgoyette-compat-base:1.1.1.9
	netbsd-7-1-1-RELEASE:1.1.1.5
	matt-nb8-mediatek:1.1.1.8.0.6
	matt-nb8-mediatek-base:1.1.1.8
	FILE5_32:1.1.1.9
	perseant-stdc-iso10646:1.1.1.8.0.4
	perseant-stdc-iso10646-base:1.1.1.8
	netbsd-8:1.1.1.8.0.2
	netbsd-8-base:1.1.1.8
	FILE5_31:1.1.1.8
	prg-localcount2-base3:1.1.1.7
	prg-localcount2-base2:1.1.1.7
	prg-localcount2-base1:1.1.1.7
	prg-localcount2:1.1.1.7.0.2
	prg-localcount2-base:1.1.1.7
	pgoyette-localcount-20170426:1.1.1.7
	bouyer-socketcan-base1:1.1.1.7
	pgoyette-localcount-20170320:1.1.1.7
	netbsd-7-1:1.1.1.5.0.8
	netbsd-7-1-RELEASE:1.1.1.5
	netbsd-7-1-RC2:1.1.1.5
	FILE5_30:1.1.1.7
	netbsd-7-nhusb-base-20170116:1.1.1.5
	bouyer-socketcan:1.1.1.6.0.4
	bouyer-socketcan-base:1.1.1.6
	pgoyette-localcount-20170107:1.1.1.6
	netbsd-7-1-RC1:1.1.1.5
	pgoyette-localcount-20161104:1.1.1.6
	netbsd-7-0-2-RELEASE:1.1.1.5
	localcount-20160914:1.1.1.6
	netbsd-7-nhusb:1.1.1.5.0.6
	netbsd-7-nhusb-base:1.1.1.5
	pgoyette-localcount-20160806:1.1.1.6
	pgoyette-localcount-20160726:1.1.1.6
	pgoyette-localcount:1.1.1.6.0.2
	pgoyette-localcount-base:1.1.1.6
	netbsd-7-0-1-RELEASE:1.1.1.5
	netbsd-7-0:1.1.1.5.0.4
	netbsd-7-0-RELEASE:1.1.1.5
	netbsd-7-0-RC3:1.1.1.5
	netbsd-7-0-RC2:1.1.1.5
	netbsd-7-0-RC1:1.1.1.5
	FILE5_22:1.1.1.6
	FILE5_20:1.1.1.5
	netbsd-6-0-6-RELEASE:1.1.1.2
	netbsd-6-1-5-RELEASE:1.1.1.2
	netbsd-7:1.1.1.5.0.2
	netbsd-7-base:1.1.1.5
	FILE5_19:1.1.1.5
	yamt-pagecache-base9:1.1.1.4
	yamt-pagecache-tag8:1.1.1.2.4.1
	netbsd-6-1-4-RELEASE:1.1.1.2
	netbsd-6-0-5-RELEASE:1.1.1.2
	tls-earlyentropy:1.1.1.4.0.8
	tls-earlyentropy-base:1.1.1.5
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.1.1.4
	riastradh-drm2-base3:1.1.1.4
	netbsd-6-1-3-RELEASE:1.1.1.2
	netbsd-6-0-4-RELEASE:1.1.1.2
	FILE5_16:1.1.1.4
	netbsd-6-1-2-RELEASE:1.1.1.2
	netbsd-6-0-3-RELEASE:1.1.1.2
	netbsd-6-1-1-RELEASE:1.1.1.2
	riastradh-drm2-base2:1.1.1.4
	riastradh-drm2-base1:1.1.1.4
	riastradh-drm2:1.1.1.4.0.6
	riastradh-drm2-base:1.1.1.4
	netbsd-6-1:1.1.1.2.0.14
	netbsd-6-0-2-RELEASE:1.1.1.2
	netbsd-6-1-RELEASE:1.1.1.2
	khorben-n900:1.1.1.4.0.4
	netbsd-6-1-RC4:1.1.1.2
	netbsd-6-1-RC3:1.1.1.2
	agc-symver:1.1.1.4.0.2
	agc-symver-base:1.1.1.4
	FILE5_14:1.1.1.4
	netbsd-6-1-RC2:1.1.1.2
	netbsd-6-1-RC1:1.1.1.2
	yamt-pagecache-base8:1.1.1.3
	FILE_5_12:1.1.1.3
	netbsd-6-0-1-RELEASE:1.1.1.2
	yamt-pagecache-base7:1.1.1.2
	matt-nb6-plus-nbase:1.1.1.2
	yamt-pagecache-base6:1.1.1.2
	netbsd-6-0:1.1.1.2.0.12
	netbsd-6-0-RELEASE:1.1.1.2
	netbsd-6-0-RC2:1.1.1.2
	tls-maxphys:1.1.1.2.0.10
	tls-maxphys-base:1.1.1.5
	matt-nb6-plus:1.1.1.2.0.8
	matt-nb6-plus-base:1.1.1.2
	netbsd-6-0-RC1:1.1.1.2
	yamt-pagecache-base5:1.1.1.2
	yamt-pagecache-base4:1.1.1.2
	FILE5_11:1.1.1.2
	netbsd-6:1.1.1.2.0.6
	netbsd-6-base:1.1.1.2
	yamt-pagecache-base3:1.1.1.2
	yamt-pagecache-base2:1.1.1.2
	yamt-pagecache:1.1.1.2.0.4
	yamt-pagecache-base:1.1.1.2
	FILE5_09:1.1.1.2
	cherry-xenmp:1.1.1.2.0.2
	cherry-xenmp-base:1.1.1.2
	FILE5_07:1.1.1.2
	bouyer-quota2-nbase:1.1.1.1
	bouyer-quota2:1.1.1.1.0.4
	bouyer-quota2-base:1.1.1.1
	matt-mips64-premerge-20101231:1.1.1.1
	matt-premerge-20091211:1.1.1.1
	jym-xensuspend-base:1.1.1.1
	jym-xensuspend:1.1.1.1.0.2
	jym-xensuspend-nbase:1.1.1.1
	FILE5_03:1.1.1.1
	CHRISTOS:1.1.1;
locks; strict;
comment	@# @;


1.1
date	2009.05.08.16.35.07;	author christos;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2009.05.08.16.35.07;	author christos;	state Exp;
branches
	1.1.1.1.2.1;
next	1.1.1.2;

1.1.1.2
date	2011.05.12.20.46.58;	author christos;	state Exp;
branches
	1.1.1.2.4.1
	1.1.1.2.10.1;
next	1.1.1.3;

1.1.1.3
date	2013.01.03.16.27.53;	author christos;	state Exp;
branches;
next	1.1.1.4;

1.1.1.4
date	2013.03.23.15.49.17;	author christos;	state Exp;
branches
	1.1.1.4.8.1;
next	1.1.1.5;

1.1.1.5
date	2014.06.13.01.48.24;	author christos;	state Exp;
branches;
next	1.1.1.6;
commitid	jtTYsE5FmJU6MiEx;

1.1.1.6
date	2015.01.02.20.34.28;	author christos;	state Exp;
branches
	1.1.1.6.2.1
	1.1.1.6.4.1;
next	1.1.1.7;
commitid	VjK78yRsQNs8uu4y;

1.1.1.7
date	2017.02.10.17.42.57;	author christos;	state Exp;
branches;
next	1.1.1.8;
commitid	HAP3kn9Hn6ovMqFz;

1.1.1.8
date	2017.05.24.23.59.57;	author christos;	state Exp;
branches;
next	1.1.1.9;
commitid	WbyOU2LBE5qOyHSz;

1.1.1.9
date	2017.09.08.13.22.42;	author christos;	state Exp;
branches
	1.1.1.9.2.1
	1.1.1.9.4.1;
next	1.1.1.10;
commitid	Hp7DmePhD4aVAo6A;

1.1.1.10
date	2018.10.18.23.54.09;	author christos;	state Exp;
branches;
next	1.1.1.11;
commitid	e8WctwerBeEm4vWA;

1.1.1.11
date	2021.04.09.18.58.01;	author christos;	state Exp;
branches;
next	1.1.1.12;
commitid	W9ddLLbSkHHinEOC;

1.1.1.12
date	2022.09.24.20.07.53;	author christos;	state Exp;
branches;
next	;
commitid	Nf6F9kcpc0EPC9VD;

1.1.1.1.2.1
date	2009.05.08.16.35.07;	author jym;	state dead;
branches;
next	1.1.1.1.2.2;

1.1.1.1.2.2
date	2009.05.13.18.51.55;	author jym;	state Exp;
branches;
next	;

1.1.1.2.4.1
date	2013.01.23.00.04.35;	author yamt;	state Exp;
branches;
next	1.1.1.2.4.2;

1.1.1.2.4.2
date	2014.05.22.15.44.59;	author yamt;	state Exp;
branches;
next	;
commitid	tYJXbWAuFvTh7yBx;

1.1.1.2.10.1
date	2013.02.25.00.26.05;	author tls;	state Exp;
branches;
next	1.1.1.2.10.2;

1.1.1.2.10.2
date	2013.06.23.06.26.32;	author tls;	state Exp;
branches;
next	1.1.1.2.10.3;
commitid	OnlO1cBgtQRcIHUw;

1.1.1.2.10.3
date	2014.08.19.23.46.47;	author tls;	state Exp;
branches;
next	;
commitid	jTnpym9Qu0o4R1Nx;

1.1.1.4.8.1
date	2014.08.10.07.07.10;	author tls;	state Exp;
branches;
next	;
commitid	b1wUlsZGswrdGMLx;

1.1.1.6.2.1
date	2017.03.20.06.52.19;	author pgoyette;	state Exp;
branches;
next	;
commitid	jjw7cAwgyKq7RfKz;

1.1.1.6.4.1
date	2017.04.21.16.51.23;	author bouyer;	state Exp;
branches;
next	;
commitid	dUG7nkTKALCadqOz;

1.1.1.9.2.1
date	2018.10.20.06.58.20;	author pgoyette;	state Exp;
branches;
next	;
commitid	mTSoqZEZ4arHnFWA;

1.1.1.9.4.1
date	2019.06.10.21.44.46;	author christos;	state Exp;
branches;
next	;
commitid	jtc8rnCzWiEEHGqB;


desc
@@


1.1
log
@Initial revision
@
text
@#------------------------------------------------------------------------------
# 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
!:mime	application/x-java-applet
>4	belong		>30		compiled Java class data,
>>6	beshort		x	        version %d.
>>4	beshort		x       	\b%d
# Which is which?
#>>4	belong		0x032d		(Java 1.0)
#>>4	belong		0x032d		(Java 1.1)
>>4	belong		0x002e		(Java 1.2)
>>4	belong		0x002f		(Java 1.3)
>>4	belong		0x0030		(Java 1.4)
>>4	belong		0x0031		(Java 1.5)
>>4	belong		0x0032		(Java 1.6)


0	belong		0xcafebabe
>4	belong		1		Mach-O fat file with 1 architecture
>4	belong		>1
>>4	belong		<20		Mach-O fat file with %ld architectures

0	belong		0xcafed00d	JAR compressed with pack200,
>>5	byte		x		version %d.
>>4	byte		x		\b%d
!:mime	application/x-java-pack200
@


1.1.1.1
log
@from ftp.astron.com
@
text
@@


1.1.1.2
log
@from ftp.astron.com.
- many security related fixes
- no MAXPATHLEN limits
- fixed missing text specification on ascii magic
- new ``pascal'' style string formats
- whitespace comparison fix
- more magic
@
text
@a0 1

a1 1
# $File: cafebabe,v 1.8 2009/09/19 16:28:08 christos Exp $
@


1.1.1.2.10.1
log
@resync with head
@
text
@d3 1
a3 1
# $File: cafebabe,v 1.10 2012/10/31 16:32:01 christos Exp $
a16 1
### JAVA START ###
a30 4
0	belong		0xcafed00d	JAR compressed with pack200,
>>5	byte		x		version %d.
>>4	byte		x		\b%d
!:mime	application/x-java-pack200
d32 4
a40 37

### JAVA END ###
### MACH-O START ###

# 16777216 = 0x01000000
0	name		mach-o		\b [ 
>0	belong		0xffffffff	\bAny
>0	belong		1		\bVax
>0	belong		6		\bMC680x0
>0	belong		7		\bI386
>0	belong		8		\bMIPS
>0	belong		10		\bMC98000
>0	belong		11		\bHPPA
>0	belong		12		\bARM
>0	belong		13		\bMC88000
>0	belong		14		\bSPARC
>0	belong		15		\bI860
>0	belong		16		\bALPHA
>0	belong		17		\bPOWERPC
>0	belong		16777223	\bX86_64
>0	belong		16777233	\bPOWERPC64
>&(8.L)	indirect			: 
>0	belong		x		\b]

0	belong		0xcafebabe
>4	belong		1		Mach-O fat file with 1 architecture:
>>8	use		mach-o
>4	belong		>1
>>4	belong		<20		Mach-O fat file with %ld architectures:
>>>8	use		mach-o
>>>28	use		mach-o
>>>4	belong		>2
>>>>48	use		mach-o
>>>>>4	belong		>3
>>>>>68	use		mach-o

### MACH-O END ###
@


1.1.1.2.10.2
log
@resync from head
@
text
@d3 1
a3 1
# $File: cafebabe,v 1.14 2013/02/27 16:59:59 christos Exp $
d6 5
a10 5
# Since Java bytecode and Mach-O universal binaries 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 universal binary 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 
d33 2
a34 2
>5	byte		x		version %d.
>4	byte		x		\b%d
d39 2
a40 2
>5	byte		x		version %d.
>4	byte		x		\b%d
d46 18
a63 3
0	name		mach-o		\b [
>0	use		mach-o-cpu	\b
>&(8.L)	indirect			\b: 
d67 2
a68 2
>4	belong		1		Mach-O universal binary with 1 architecture:
>>8	use		mach-o		\b
d70 7
a76 7
>>4	belong		<20		Mach-O universal binary with %ld architectures:
>>>8	use		mach-o		\b
>>>28	use		mach-o		\b
>>4	belong		>2
>>>48	use		mach-o		\b
>>4	belong		>3
>>>68	use		mach-o		\b
@


1.1.1.2.10.3
log
@Rebase to HEAD as of a few days ago.
@
text
@d3 1
a3 1
# $File: cafebabe,v 1.16 2014/04/30 21:41:02 christos Exp $
d19 1
a20 1
!:mime	application/x-java-applet
d55 1
a55 1
>>4	belong		<20		Mach-O universal binary with %d architectures:
@


1.1.1.2.4.1
log
@sync with head
@
text
@d3 1
a3 1
# $File: cafebabe,v 1.10 2012/10/31 16:32:01 christos Exp $
a16 1
### JAVA START ###
a30 4
0	belong		0xcafed00d	JAR compressed with pack200,
>>5	byte		x		version %d.
>>4	byte		x		\b%d
!:mime	application/x-java-pack200
d32 4
a40 37

### JAVA END ###
### MACH-O START ###

# 16777216 = 0x01000000
0	name		mach-o		\b [ 
>0	belong		0xffffffff	\bAny
>0	belong		1		\bVax
>0	belong		6		\bMC680x0
>0	belong		7		\bI386
>0	belong		8		\bMIPS
>0	belong		10		\bMC98000
>0	belong		11		\bHPPA
>0	belong		12		\bARM
>0	belong		13		\bMC88000
>0	belong		14		\bSPARC
>0	belong		15		\bI860
>0	belong		16		\bALPHA
>0	belong		17		\bPOWERPC
>0	belong		16777223	\bX86_64
>0	belong		16777233	\bPOWERPC64
>&(8.L)	indirect			: 
>0	belong		x		\b]

0	belong		0xcafebabe
>4	belong		1		Mach-O fat file with 1 architecture:
>>8	use		mach-o
>4	belong		>1
>>4	belong		<20		Mach-O fat file with %ld architectures:
>>>8	use		mach-o
>>>28	use		mach-o
>>>4	belong		>2
>>>>48	use		mach-o
>>>>>4	belong		>3
>>>>>68	use		mach-o

### MACH-O END ###
@


1.1.1.2.4.2
log
@sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs.  ("Protocol error: too many arguments")
@
text
@d3 1
a3 1
# $File: cafebabe,v 1.14 2013/02/27 16:59:59 christos Exp $
d6 5
a10 5
# Since Java bytecode and Mach-O universal binaries 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 universal binary 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 
d33 2
a34 2
>5	byte		x		version %d.
>4	byte		x		\b%d
d39 2
a40 2
>5	byte		x		version %d.
>4	byte		x		\b%d
d46 18
a63 3
0	name		mach-o		\b [
>0	use		mach-o-cpu	\b
>&(8.L)	indirect			\b: 
d67 2
a68 2
>4	belong		1		Mach-O universal binary with 1 architecture:
>>8	use		mach-o		\b
d70 7
a76 7
>>4	belong		<20		Mach-O universal binary with %ld architectures:
>>>8	use		mach-o		\b
>>>28	use		mach-o		\b
>>4	belong		>2
>>>48	use		mach-o		\b
>>4	belong		>3
>>>68	use		mach-o		\b
@


1.1.1.3
log
@from ftp.astron.com
@
text
@d3 1
a3 1
# $File: cafebabe,v 1.10 2012/10/31 16:32:01 christos Exp $
a16 1
### JAVA START ###
a30 4
0	belong		0xcafed00d	JAR compressed with pack200,
>>5	byte		x		version %d.
>>4	byte		x		\b%d
!:mime	application/x-java-pack200
d32 4
a40 37

### JAVA END ###
### MACH-O START ###

# 16777216 = 0x01000000
0	name		mach-o		\b [ 
>0	belong		0xffffffff	\bAny
>0	belong		1		\bVax
>0	belong		6		\bMC680x0
>0	belong		7		\bI386
>0	belong		8		\bMIPS
>0	belong		10		\bMC98000
>0	belong		11		\bHPPA
>0	belong		12		\bARM
>0	belong		13		\bMC88000
>0	belong		14		\bSPARC
>0	belong		15		\bI860
>0	belong		16		\bALPHA
>0	belong		17		\bPOWERPC
>0	belong		16777223	\bX86_64
>0	belong		16777233	\bPOWERPC64
>&(8.L)	indirect			: 
>0	belong		x		\b]

0	belong		0xcafebabe
>4	belong		1		Mach-O fat file with 1 architecture:
>>8	use		mach-o
>4	belong		>1
>>4	belong		<20		Mach-O fat file with %ld architectures:
>>>8	use		mach-o
>>>28	use		mach-o
>>>4	belong		>2
>>>>48	use		mach-o
>>>>>4	belong		>3
>>>>>68	use		mach-o

### MACH-O END ###
@


1.1.1.4
log
@import file-5.14
changes are "name" + "use" keyword features, bug fixes
@
text
@d3 1
a3 1
# $File: cafebabe,v 1.14 2013/02/27 16:59:59 christos Exp $
d6 5
a10 5
# Since Java bytecode and Mach-O universal binaries 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 universal binary 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 
d33 2
a34 2
>5	byte		x		version %d.
>4	byte		x		\b%d
d39 2
a40 2
>5	byte		x		version %d.
>4	byte		x		\b%d
d46 18
a63 3
0	name		mach-o		\b [
>0	use		mach-o-cpu	\b
>&(8.L)	indirect			\b: 
d67 2
a68 2
>4	belong		1		Mach-O universal binary with 1 architecture:
>>8	use		mach-o		\b
d70 7
a76 7
>>4	belong		<20		Mach-O universal binary with %ld architectures:
>>>8	use		mach-o		\b
>>>28	use		mach-o		\b
>>4	belong		>2
>>>48	use		mach-o		\b
>>4	belong		>3
>>>68	use		mach-o		\b
@


1.1.1.4.8.1
log
@Rebase.
@
text
@d3 1
a3 1
# $File: cafebabe,v 1.16 2014/04/30 21:41:02 christos Exp $
d19 1
a20 1
!:mime	application/x-java-applet
d55 1
a55 1
>>4	belong		<20		Mach-O universal binary with %d architectures:
@


1.1.1.5
log
@import file-5.19

2014-06-09   9:04  Christos Zoulas <christos@@zoulas.com>

	* Misc buffer overruns and missing buffer size tests in cdf parsing
	  (Francisco Alonso, Jan Kaluza)

2014-06-02  14:50  Christos Zoulas <christos@@zoulas.com>

	* Enforce limit of 8K on regex searches that have no limits
	* Allow the l modifier for regex to mean line count. Default
	  to byte count. If line count is specified, assume a max
	  of 80 characters per line to limit the byte count.
	* Don't allow conversions to be used for dates, allowing
	  the mask field to be used as an offset.

2014-05-30  12:51  Christos Zoulas <christos@@zoulas.com>

	* Make the range operator limit the length of the
	  regex search.

2014-05-14  19:23  Christos Zoulas <christos@@zoulas.com>

	* PR/347: Windows fixes
	* PR/352: Hangul word processor recognition
	* PR/354: Encoding irregularities in text files

2014-05-06  6:12  Christos Zoulas <christos@@zoulas.com>

	* Fix uninitialized title in CDF files (Jan Kaluza)

2014-05-04  14:55  Christos Zoulas <christos@@zoulas.com>

	* PR/351: Fix compilation of empty files

2014-04-30  17:39  Christos Zoulas <christos@@zoulas.com>

	* Fix integer formats: We don't specify 'l' or
	  'h' and 'hh' specifiers anymore, only 'll' for
	  quads and nothing for the rest. This is so that
	  magic writing is simpler.

2014-04-01  15:25  Christos Zoulas <christos@@zoulas.com>

	* PR/341: Jan Kaluza, fix memory leak
	* PR/342: Jan Kaluza, fix out of bounds read

2014-03-28  15:25  Christos Zoulas <christos@@zoulas.com>

	* Fix issue with long formats not matching fmtcheck
@
text
@d3 1
a3 1
# $File: cafebabe,v 1.16 2014/04/30 21:41:02 christos Exp $
d19 1
a20 1
!:mime	application/x-java-applet
d55 1
a55 1
>>4	belong		<20		Mach-O universal binary with %d architectures:
@


1.1.1.6
log
@Import file-5.22
@
text
@d3 1
a3 1
# $File: cafebabe,v 1.17 2015/01/01 17:07:00 christos Exp $
d48 1
a48 1
>(8.L)	indirect			\b: 
@


1.1.1.6.4.1
log
@Sync with HEAD
@
text
@d3 1
a3 1
# $File: cafebabe,v 1.21 2015/10/15 20:56:51 christos Exp $
a30 2
>>4	belong		0x0033		(Java 1.7)
>>4	belong		0x0034		(Java 1.8)
a52 1
!:mime application/x-mach-binary
a55 1
!:mime application/x-mach-binary
a56 1
>>4	belong		2
d58 1
a58 1
>>4	belong		3
d60 1
a60 1
>>4	belong		4
a61 4
>>4	belong		5
>>>88	use		mach-o		\b
>>4	belong		6
>>>108	use		mach-o		\b
@


1.1.1.6.2.1
log
@Sync with HEAD
@
text
@d3 1
a3 1
# $File: cafebabe,v 1.21 2015/10/15 20:56:51 christos Exp $
a30 2
>>4	belong		0x0033		(Java 1.7)
>>4	belong		0x0034		(Java 1.8)
a52 1
!:mime application/x-mach-binary
a55 1
!:mime application/x-mach-binary
a56 1
>>4	belong		2
d58 1
a58 1
>>4	belong		3
d60 1
a60 1
>>4	belong		4
a61 4
>>4	belong		5
>>>88	use		mach-o		\b
>>4	belong		6
>>>108	use		mach-o		\b
@


1.1.1.7
log
@2017-02-10  12:24  Christos Zoulas <christos@@zoulas.com>

	* release 5.30

2017-02-07  23:27  Christos Zoulas <christos@@zoulas.com>

	* If we exceeded the offset in a search return no match
	  (Christoph Biedl)
	* Be more lenient on corrupt CDF files (Christoph Biedl)

2017-02-04  16:46  Christos Zoulas <christos@@zoulas.com>

	* pacify ubsan sign extension (oss-fuzz/524)

2017-02-01  12:42  Christos Zoulas <christos@@zoulas.com>

	* off by one in cdf parsing (PR/593)
	* report debugging sections in elf (PR/591)

2016-11-06  10:52  Christos Zoulas <christos@@zoulas.com>

	* Allow @@@@@@ in extensions
	* Add missing overflow check in der magic (Jonas Wagner)

2016-10-25  10:40  Christos Zoulas <christos@@zoulas.com>

	* release 5.29

2016-10-24  11:20  Christos Zoulas <christos@@zoulas.com>

	* der getlength overflow (Jonas Wagner)
	* multiple magic file load failure (Christoph Biedl)

2016-10-17  11:26  Christos Zoulas <christos@@zoulas.com>

	* CDF parsing improvements (Guy Helmer)

2016-07-20   7:26  Christos Zoulas <christos@@zoulas.com>

	* Add support for signed indirect offsets

2016-07-18   7:41  Christos Zoulas <christos@@zoulas.com>

	* cat /dev/null | file - should print empty (Christoph Biedl)

2016-07-05  15:20  Christos Zoulas <christos@@zoulas.com>

	* Bump string size from 64 to 96.

2016-06-13  20:20  Christos Zoulas <christos@@zoulas.com>

	* PR/556: Fix separators on annotations.

2016-06-13  19:40  Christos Zoulas <christos@@zoulas.com>

	* release 5.28
	* fix leak on allocation failure

2016-06-01   1:20  Christos Zoulas <christos@@zoulas.com>

	* PR/555: Avoid overflow for offset > nbytes
	* PR/550: Segv on DER parsing:
	    - use the correct variable for length
	    - set offset to 0 on failure.

2016-05-13  12:00  Christos Zoulas <christos@@zoulas.com>

	* release 5.27

2016-04-18   9:35  Christos Zoulas <christos@@zoulas.com>

	* Errors comparing DER entries or computing offsets
	  are just indications of malformed non-DER files.
	  Don't print them.
	* Offset comparison was off-by-one.
	* Fix compression code (Werner Fink)
	* Put new bytes constant in the right file (not the generated one)

2016-04-16  18:34  Christos Zoulas <christos@@zoulas.com>

	* release 5.26

2016-03-31  13:50  Christos Zoulas <christos@@zoulas.com>

	* make the number of bytes read from files configurable.

2016-03-21  13:40  Christos Zoulas <christos@@zoulas.com>

	* Add bounds checks for DER code (discovered by Thomas Jarosch)
	* Change indirect recursion limit to indirect use count and
	  bump from 15 to 50 to prevent abuse.

2016-03-13  20:39  Christos Zoulas <christos@@zoulas.com>

	* Add -00 which prints filename\0description\0

2016-03-01  13:28  Christos Zoulas <christos@@zoulas.com>

	* Fix ID3 indirect parsing

2016-01-19  10:18  Christos Zoulas <christos@@zoulas.com>

	* add DER parsing capability

2015-11-13  10:35  Christos Zoulas <christos@@zoulas.com>

	* provide dprintf(3) for the OS's that don't have it.

2015-11-11  16:25  Christos Zoulas <christos@@zoulas.com>

	* redo the compression code report decompression errors

2015-11-10  23:25  Christos Zoulas <christos@@zoulas.com>

	* REG_STARTEND code is not working as expected, delete it.

2015-11-09  16:05  Christos Zoulas <christos@@zoulas.com>

	* Add zlib support if we have it.

2015-11-05  11:22  Christos Zoulas <christos@@zoulas.com>

	* PR/492: compression forking was broken with magic_buffer.

2015-09-16   9:50  Christos Zoulas <christos@@zoulas.com>

	* release 5.25

2015-09-11  13:25  Christos Zoulas <christos@@zoulas.com>

	* add a limit to the length of regex searches

2015-09-08   9:50  Christos Zoulas <christos@@zoulas.com>

	* fix problems with --parameter (Christoph Biedl)

2015-07-11  10:35  Christos Zoulas <christos@@zoulas.com>

	* Windows fixes PR/466 (Jason Hood)

2015-07-09  10:35  Christos Zoulas <christos@@zoulas.com>

	* release 5.24

2015-06-11   8:52  Christos Zoulas <christos@@zoulas.com>

	* redo long option encoding to fix off-by-one in 5.23

2015-06-10  13:50  Christos Zoulas <christos@@zoulas.com>

	* release 5.23

2015-06-09  16:10  Christos Zoulas <christos@@zoulas.com>

	* Fix issue with regex range for magic with offset
	* Always return true from mget with USE (success to mget not match
	  indication). Fixes mime evaluation after USE magic
	* PR/459: Don't insert magic entries to the list if there are parsing
	  errors for them.

2015-06-03  16:00  Christos Zoulas <christos@@zoulas.com>

	* PR/455: Add utf-7 encoding

2015-06-03  14:30  Christos Zoulas <christos@@zoulas.com>

	* PR/455: Implement -Z, look inside, but don't report on compression
	* PR/454: Fix allocation error on bad magic.

2015-05-29  10:30  Christos Zoulas <christos@@zoulas.com>

	* handle MAGIC_CONTINUE everywhere, not just in softmagic

2015-05-21  14:30  Christos Zoulas <christos@@zoulas.com>

	* don't print descriptions for NAME types when mime.

2015-04-09  15:59  Christos Zoulas <christos@@zoulas.com>

	* Add --extension to list the known extensions for this file type
	  Idea by Andrew J Roazen

2015-02-14  12:23  Christos Zoulas <christos@@zoulas.com>

	* Bump file search buffer size to 1M.

2015-01-09  14:35  Christos Zoulas <christos@@zoulas.com>

	* Fix multiple issues with date formats reported by Christoph Biedl:
		- T_LOCAL meaning was reversed
		- Arithmetic did not work
	  Also stop adjusting daylight savings for gmt printing.

2015-01-05  13:00  Christos Zoulas <christos@@zoulas.com>

	* PR/411: Fix memory corruption from corrupt cdf file.
@
text
@d3 1
a3 1
# $File: cafebabe,v 1.21 2015/10/15 20:56:51 christos Exp $
a30 2
>>4	belong		0x0033		(Java 1.7)
>>4	belong		0x0034		(Java 1.8)
a52 1
!:mime application/x-mach-binary
a55 1
!:mime application/x-mach-binary
a56 1
>>4	belong		2
d58 1
a58 1
>>4	belong		3
d60 1
a60 1
>>4	belong		4
a61 4
>>4	belong		5
>>>88	use		mach-o		\b
>>4	belong		6
>>>108	use		mach-o		\b
@


1.1.1.8
log
@Import file-5.31; mostly oss-fuzz found bugs.
@
text
@d3 1
a3 1
# $File: cafebabe,v 1.22 2017/03/17 21:35:28 christos Exp $
d10 2
a11 2
# 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
d50 1
a50 1
>(8.L)	indirect			\b:
@


1.1.1.9
log
@2017-09-02  11:53  Christos Zoulas <christos@@zoulas.com>

	* release 5.32

2017-08-28  16:37  Christos Zoulas <christos@@zoulas.com>

	* Always reset state in {file,buffer}_apprentice (Krzysztof Wilczynski)

2017-08-27  03:55  Christos Zoulas <christos@@zoulas.com>

	* Fix always true condition (Thomas Jarosch)

2017-05-24  17:30  Christos Zoulas <christos@@zoulas.com>

	* pickier parsing of numeric values in magic files.

2017-05-23  17:55  Christos Zoulas <christos@@zoulas.com>

	* PR/615 add magic_getflags()

2017-05-23  13:55  Christos Zoulas <christos@@zoulas.com>

	* release 5.31

2017-03-17  20:32  Christos Zoulas <christos@@zoulas.com>

	* remove trailing spaces from magic files
	* refactor is_tar
	* better bounds checks for cdf
@
text
@d3 1
a3 1
# $File: cafebabe,v 1.23 2017/05/25 20:07:23 christos Exp $
d50 1
a50 1
>(8.L)	indirect	x		\b:
@


1.1.1.9.4.1
log
@Sync with HEAD
@
text
@d3 1
a3 1
# $File: cafebabe,v 1.24 2018/10/01 23:33:15 christos Exp $
d61 1
a61 1
>>4	belong		>1
d63 1
a63 1
>>4	belong		>2
d65 1
a65 1
>>4	belong		>3
d67 1
a67 1
>>4	belong		>4
d69 1
a69 1
>>4	belong		>5
@


1.1.1.9.2.1
log
@Sync with head
@
text
@d3 1
a3 1
# $File: cafebabe,v 1.24 2018/10/01 23:33:15 christos Exp $
d61 1
a61 1
>>4	belong		>1
d63 1
a63 1
>>4	belong		>2
d65 1
a65 1
>>4	belong		>3
d67 1
a67 1
>>4	belong		>4
d69 1
a69 1
>>4	belong		>5
@


1.1.1.10
log
@2018-10-18  19:32  Christos Zoulas <christos@@zoulas.com>

	* release 5.35

2018-09-10  20:38  Christos Zoulas <christos@@zoulas.com>

	* Add FreeBSD ELF core file support (John Baldwin)

2018-08-20  18:40  Christos Zoulas <christos@@zoulas.com>

	* PR/30: Allow all parameter values to be set (don't treat 0 specially)
	* handle default annotations on the softmagic match instead at the
	  end.

2018-07-25  10:17  Christos Zoulas <christos@@zoulas.com>

	* PR/23: Recognize JSON files

2018-07-25  10:17  Christos Zoulas <christos@@zoulas.com>

	* PR/18: file --mime-encoding should not print mime-type

2018-07-25   8:50  Christos Zoulas <christos@@zoulas.com>

	* release 5.34

2018-06-22  16:38  Christos Zoulas <christos@@zoulas.com>

	* Add Quad indirect offsets

2018-05-24  14:10  Christos Zoulas <christos@@zoulas.com>

	* Enable parsing of ELF dynamic sections to handle PIE better
@
text
@d3 1
a3 1
# $File: cafebabe,v 1.24 2018/10/01 23:33:15 christos Exp $
d61 1
a61 1
>>4	belong		>1
d63 1
a63 1
>>4	belong		>2
d65 1
a65 1
>>4	belong		>3
d67 1
a67 1
>>4	belong		>4
d69 1
a69 1
>>4	belong		>5
@


1.1.1.11
log
@2021-03-30  20:21  Christos Zoulas <christos@@zoulas.com>

	* release 5.40

2021-02-05  16:31  Christos Zoulas <christos@@zoulas.com>

	* PR/234: Add limit to the number of bytes to scan for encoding
	* PR/230: Fix /T (trim flag) for regex

2021-02-01  12:31  Christos Zoulas <christos@@zoulas.com>
	* PR/77: Trim trailing separator.

2020-12-17  15:44  Christos Zoulas <christos@@zoulas.com>

	* PR/211: Convert system read errors from corrupt ELF
	  files into human readable error messages

2020-12-08  16:24  Christos Zoulas <christos@@zoulas.com>

	* fix multithreaded decompression file descriptor issue
	  by using close-on-exec (Denys Vlasenko)

2020-06-27  11:58  Christos Zoulas <christos@@zoulas.com>

	* Exclude surrogate pairs from utf-8 detection (Michael Liu)

2020-06-25  12:53  Christos Zoulas <christos@@zoulas.com>

	* Include # to the list of ignored format chars (Werner Fink)
@
text
@d3 1
a3 1
# $File: cafebabe,v 1.26 2020/12/12 20:01:47 christos Exp $
a17 2
# Reference:	http://en.wikipedia.org/wiki/Java_class_file
# Update:	Joerg Jenderek
d19 1
a19 1
>4	ubelong		>30		compiled Java class data,
d21 2
a22 6
#!:mime	application/java-byte-code
!:ext	class
>>6	ubeshort	x	        version %d.
>>4	ubeshort	x       	\b%d
# for debugging purpose version as hexadecimal to compare with Mach-O universal binary
#>>4	ubelong		x       	(0x%8.8x)
a23 2
# https://docs.oracle.com/javase/specs/jvms/se6/html/ClassFile.doc.html
#>>4	belong		0x002b		(Java 0.?)
a32 10
>>4	belong		0x0035		(Java SE 9)
>>4	belong		0x0036		(Java SE 10)
>>4	belong		0x0037		(Java SE 11)
>>4	belong		0x0038		(Java SE 12)
>>4	belong		0x0039		(Java SE 13)
>>4	belong		0x003A		(Java SE 14)
# pool count unequal zero
#>>8	beshort		x	        \b, pool count 0x%x
# pool table
#>>10	ubequad		x	        \b, pool 0x%16.16llx...
a46 1
# URL:		https://en.wikipedia.org/wiki/Mach-O
a48 3
# for debugging purpose CPU type as hexadecimal
#>0	ubequad		x		CPU=%16.16llx 
# display CPU type as string like: i386 x86_64 ... armv7 armv7k ...
a49 3
# for debugging purpose print offset to 1st mach_header like:
# 1000h 4000h seldom 2d000h 88000h 5b000h 10e000 h
#>8	ubelong		x		at 0x%x offset
a52 3
# Reference:	https://opensource.apple.com/source/cctools/cctools-949.0.1/
#		include/mach-o/fat.h
#		include/mach/machine.h
d57 2
a58 3
# 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:
d61 10
a70 10
>>>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
@


1.1.1.12
log
@Import file-5.43+; last was file-5.40

2022-09-20  17:12  Christos Zoulas <christos@@zoulas.com>

	* fixed various clustefuzz issues

2022-09-19  15:54  Christos Zoulas <christos@@zoulas.com>

	* Fix error detection for decompression code (Vincent Mihalkovic)

2022-09-15  13:50  Christos Zoulas <christos@@zoulas.com>

	* Add MAGIC_NO_COMPRESS_FORK and use it to produce a more
	  meaningful error message if we are sandboxing.

2022-09-15  10:45  Christos Zoulas <christos@@zoulas.com>

	* Add built-in lzip decompression support (Michal Gorny)

2022-09-14  10:35  Christos Zoulas <christos@@zoulas.com>

	* Add built-in zstd decompression support (Martin Rodriguez Reboredo)

2022-09-13  14:55  Christos Zoulas <christos@@zoulas.com>

	* release 5.43

2022-09-10   9:17  Christos Zoulas <christos@@zoulas.com>

	* Add octal indirect magic (Michal Gorny)

2022-08-17  11:43  Christos Zoulas <christos@@zoulas.com>

	* PR/374: avoid infinite loop in non-wide code (piru)
	* PR/373: Obey MAGIC_CONTINUE with multiple magic files (vismarli)

2022-07-26  11:10  Christos Zoulas <christos@@zoulas.com>

	* Fix bug with large flist (Florian Weimer)

2022-07-07  13:21  Christos Zoulas <christos@@zoulas.com>

        * PR/364: Detect non-nul-terminated core filenames from QEMU
	  (mam-ableton)

2022-07-04  15:45  Christos Zoulas <christos@@zoulas.com>

	* PR/359: Add support for http://ndjson.org/ (darose)
	* PR/362: Fix wide printing (ro-ee)
	* PR/358: Fix width for -f - (jpalus)
	* PR/356: Fix JSON constant parsing (davewhite)

2022-06-10   9:40  Christos Zoulas <christos@@zoulas.com>

	* release 5.42

2022-05-31  14:50   Christos Zoulas <christos@@zoulas.com>

	* PR/348: add missing cases to prevent file from aborting on
	  random magic files.

2022-05-27  21:05   Christos Zoulas <christos@@zoulas.com>

	* PR/351: octalify filenames when not raw before printing.

2022-04-18  17:51   Christos Zoulas <christos@@zoulas.com>

	* fix regex cacheing bug (Dirk Mueller)
	* merge file_regcomp and file_regerror() to simplify the code
	  and reduce memory requirements for storing regexes (Dirk Mueller)

2022-03-19  12:56   Christos Zoulas <christos@@zoulas.com>

	* cache regex (Dirk Mueller)
	* detect filesystem full by flushing output (Dirk Mueller)

2021-11-19  12:36   Christos Zoulas <christos@@zoulas.com>

	* implement running decompressor programs using
	  posix_spawnp(2) instead of vfork(2)

2021-10-24  11:51   Christos Zoulas <christos@@zoulas.com>

	* Add support for msdos dates and times

2021-10-20   9:55   Christos Zoulas <christos@@zoulas.com>

	* use the system byte swapping functions if available (Werner Fink)

2021-10-18  11:57  Christos Zoulas <christos@@zoulas.com>

	* release 5.41

2021-09-23  03:51  Christos Zoulas <christos@@zoulas.com>

	* Avinash Sonawane: Fix tzname detection

2021-09-03  09:17  Christos Zoulas <christos@@zoulas.com>

	* Fix relationship tests with "search" magic, don't short circuit
	  logic

2021-07-13  01:06  Christos Zoulas <christos@@zoulas.com>

	* Fix memory leak in compile mode

2021-07-01  03:51  Christos Zoulas <christos@@zoulas.com>

	* PR/272: kiefermat: Only set returnval = 1 when we printed something
	  (in all cases print or !print). This simplifies the logic and fixes
	  the issue in the PR with -k and --mime-type there was no continuation
	  printed before the default case.

2021-06-30  13:07  Christos Zoulas <christos@@zoulas.com>

	* PR/270: Don't translate unprintable characters in %s magic formats
	  when -r
	* PR/269: Avoid undefined behavior with clang (adding offset to NULL)

2021-05-09  18:38  Christos Zoulas <christos@@zoulas.com>

	* Add a new flag (f) that requires that the match is a full word,
	   not a partial word match.
	* Add varint types (unused)

2021-04-19  17:17  Christos Zoulas <christos@@zoulas.com>

	* PR/256: mutableVoid: If the file is less than 3 bytes, use the file
	  length to determine type
	* PR/259: aleksandr.v.novichkov: mime printing through indirect magic
	  is not taken into account, use match directly so that it does.

2021-04-04  17:02  Christos Zoulas <christos@@zoulas.com>

	* count the total bytes found not the total byte positions
	  in order to determine encoding (Anatol Belski)
@
text
@d3 1
a3 1
# $File: cafebabe,v 1.28 2022/07/01 23:24:47 christos Exp $
d28 1
a28 1
#>>4	ubelong		x       	(%#8.8x)
a46 6
>>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)
d48 1
a48 1
#>>8	beshort		x	        \b, pool count %#x
d50 1
a50 1
#>>10	ubequad		x	        \b, pool %#16.16llx...
d74 1
a74 1
#>8	ubelong		x		at %#x offset
@


1.1.1.1.2.1
log
@file cafebabe was added on branch jym-xensuspend on 2009-05-13 18:51:55 +0000
@
text
@d1 38
@


1.1.1.1.2.2
log
@Sync with HEAD.

Second commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
@
text
@a0 38
#------------------------------------------------------------------------------
# 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
!:mime	application/x-java-applet
>4	belong		>30		compiled Java class data,
>>6	beshort		x	        version %d.
>>4	beshort		x       	\b%d
# Which is which?
#>>4	belong		0x032d		(Java 1.0)
#>>4	belong		0x032d		(Java 1.1)
>>4	belong		0x002e		(Java 1.2)
>>4	belong		0x002f		(Java 1.3)
>>4	belong		0x0030		(Java 1.4)
>>4	belong		0x0031		(Java 1.5)
>>4	belong		0x0032		(Java 1.6)


0	belong		0xcafebabe
>4	belong		1		Mach-O fat file with 1 architecture
>4	belong		>1
>>4	belong		<20		Mach-O fat file with %ld architectures

0	belong		0xcafed00d	JAR compressed with pack200,
>>5	byte		x		version %d.
>>4	byte		x		\b%d
!:mime	application/x-java-pack200
@


