* Import linux-x86-32/64 and darwin-x86-32 sflib includedirs * Simplify data installation for magic, egg, syscall and asm * Set R2_INCDIR in r_userconf * Make ragg2-cc much smarter - use ragg2 -v to get paths and version - accept new flags -a -b -k for arch, bits and kernel - supports crosscompilation --HG-- rename : libr/magic/d/OpenBSD => libr/magic/d/default/OpenBSD rename : libr/magic/d/archive => libr/magic/d/default/archive rename : libr/magic/d/cafebabe => libr/magic/d/default/cafebabe rename : libr/magic/d/cisco => libr/magic/d/default/cisco rename : libr/magic/d/database => libr/magic/d/default/database rename : libr/magic/d/editors => libr/magic/d/default/editors rename : libr/magic/d/elf => libr/magic/d/default/elf rename : libr/magic/d/filesystems => libr/magic/d/default/filesystems rename : libr/magic/d/flash => libr/magic/d/default/flash rename : libr/magic/d/freebsd => libr/magic/d/default/freebsd rename : libr/magic/d/gimp => libr/magic/d/default/gimp rename : libr/magic/d/images => libr/magic/d/default/images rename : libr/magic/d/java => libr/magic/d/default/java rename : libr/magic/d/jpeg => libr/magic/d/default/jpeg rename : libr/magic/d/linux => libr/magic/d/default/linux rename : libr/magic/d/mail.news => libr/magic/d/default/mail.news rename : libr/magic/d/matroska => libr/magic/d/default/matroska rename : libr/magic/d/mime => libr/magic/d/default/mime rename : libr/magic/d/msdos => libr/magic/d/default/msdos rename : libr/magic/d/netbsd => libr/magic/d/default/netbsd rename : libr/magic/d/pdf => libr/magic/d/default/pdf rename : libr/magic/d/perl => libr/magic/d/default/perl rename : libr/magic/d/python => libr/magic/d/default/python rename : libr/magic/d/riff => libr/magic/d/default/riff rename : libr/magic/d/sniffer => libr/magic/d/default/sniffer rename : libr/magic/d/sql => libr/magic/d/default/sql rename : libr/magic/d/sun => libr/magic/d/default/sun rename : libr/magic/d/uuencode => libr/magic/d/default/uuencode
27 lines
1.2 KiB
Text
27 lines
1.2 KiB
Text
# $OpenBSD: cafebabe,v 1.3 2009/04/24 18:54:34 chl Exp $
|
|
|
|
#------------------------------------------------------------------------------
|
|
# 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 beshort 0xcafe
|
|
>2 beshort 0xbabe
|
|
!:mime application/x-java-applet
|
|
>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
|
|
>2 beshort 0xd00d JAR compressed with pack200
|
|
!:mime application/x-java-pack200
|