linux revision 68349
1
2#------------------------------------------------------------------------------
3# linux:  file(1) magic for Linux files
4#
5# Values for Linux/i386 binaries, from Daniel Quinlan <quinlan@yggdrasil.com>
6# The following basic Linux magic is useful for reference, but using
7# "long" magic is a better practice in order to avoid collisions.
8#
9# 2	leshort		100		Linux/i386
10# >0	leshort		0407		impure executable (OMAGIC)
11# >0	leshort		0410		pure executable (NMAGIC)
12# >0	leshort		0413		demand-paged executable (ZMAGIC)
13# >0	leshort		0314		demand-paged executable (QMAGIC)
14#
150	lelong		0x00640107	Linux/i386 impure executable (OMAGIC)
16>16	lelong		0		\b, stripped
170	lelong		0x00640108	Linux/i386 pure executable (NMAGIC)
18>16	lelong		0		\b, stripped
190	lelong		0x0064010b	Linux/i386 demand-paged executable (ZMAGIC)
20>16	lelong		0		\b, stripped
210	lelong		0x006400cc	Linux/i386 demand-paged executable (QMAGIC)
22>16	lelong		0		\b, stripped
23#
240	string		\007\001\000	Linux/i386 object file
25>20	lelong		>0x1020		\b, DLL library
26# Linux-8086 stuff:
270	string		\01\03\020\04	Linux-8086 impure executable
28>28	long		!0		not stripped
290	string		\01\03\040\04	Linux-8086 executable
30>28	long		!0		not stripped
31#
320	string		\243\206\001\0	Linux-8086 object file
33#
340	string		\01\03\020\20	Minix-386 impure executable
35>28	long		!0		not stripped
360	string		\01\03\040\20	Minix-386 executable
37>28	long		!0		not stripped
38# core dump file, from Bill Reynolds <bill@goshawk.lanl.gov>
39216	lelong		0421		Linux/i386 core file
40>220	string		>\0		of '%s'
41>200	lelong		>0		(signal %d)
42#
43# LILO boot/chain loaders, from Daniel Quinlan <quinlan@yggdrasil.com>
44# this can be overridden by the DOS executable (COM) entry
452	string		LILO		Linux/i386 LILO boot/chain loader
46#
47# Debian Packages, from Peter Tobias <tobias@server.et-inf.fho-emden.de>
480	string		0.9
49>8	byte		0x0a		old Debian Binary Package
50>>3	byte		>0		\b, created by dpkg 0.9%c
51>>4	byte		>0		pl%c
52# PSF fonts, from H. Peter Anvin <hpa@yggdrasil.com>
530	leshort		0x0436		Linux/i386 PC Screen Font data,
54>2	byte		0		256 characters, no directory,
55>2	byte		1		512 characters, no directory,
56>2	byte		2		256 characters, Unicode directory,
57>2	byte		3		512 characters, Unicode directory,
58>3	byte		>0		8x%d
59# Linux swap file, from Daniel Quinlan <quinlan@yggdrasil.com>
604086	string		SWAP-SPACE	Linux/i386 swap file
61# ECOFF magic for OSF/1 and Linux (only tested under Linux though)
62#
63#	from Erik Troan (ewt@redhat.com) examining od dumps, so this
64#		could be wrong
65#      updated by David Mosberger (davidm@azstarnet.com) based on
66#      GNU BFD and MIPS info found below.
67#
680	leshort		0x0183		ECOFF alpha
69>24	leshort		0407		executable
70>24	leshort		0410		pure
71>24	leshort		0413		demand paged
72>8	long		>0		not stripped
73>8	long		0		stripped
74>23	leshort		>0		- version %ld.
75#
76# Linux kernel boot images, from Albert Cahalan <acahalan@cs.uml.edu>
77# and others such as Axel Kohlmeyer <akohlmey@rincewind.chemie.uni-ulm.de>
78# and Nicol�s Lichtmaier <nick@debian.org>
79# All known start with: b8 c0 07 8e d8 b8 00 90 8e c0 b9 00 01 29 f6 29
80514		string	HdrS		Linux kernel
81>518		leshort	>0
82>>529		byte	0		zImage data,
83>>529		byte	1		bzImage data,
84>0x048c		byte	0x31
85>>0x048c	string	x		version %s
86>0x0493		byte	0x31
87>>0x0493	string	x		version %s
88>0x048c		byte	0x32
89>>0x048c	string	x		version %s
90>0x0493		byte	0x32
91>>0x0493	string	x		version %s
92>0x04df		byte	0x32
93>>0x04df	string	x		version %s
94>0x04fb		byte	0x32
95>>0x04fb	string	x		version %s
96# This also matches new kernels, which were caught above by "HdrS".
970		belong	0xb8c0078e	Linux kernel
98>0x1e3		string	Loading		version 1.3.79 or older
99>0x1e9		string	Loading		from prehistoric times
100# LSM entries - Nicol�s Lichtmaier <nick@feedback.net.ar>
1010	string	Begin3	Linux Software Map entry text
102