1#	$OpenBSD: database,v 1.6 2009/04/24 18:54:34 chl Exp $
2
3#------------------------------------------------------------------------------
4# database:  file(1) magic for various databases
5#
6# extracted from header/code files by Graeme Wilford (eep2gw@ee.surrey.ac.uk)
7#
8#
9# GDBM magic numbers
10#  Will be maintained as part of the GDBM distribution in the future.
11#  <downsj@teeny.org>
120	belong	0x13579ace	GNU dbm 1.x or ndbm database, big endian
13!:mime	application/x-gdbm
140	lelong	0x13579ace	GNU dbm 1.x or ndbm database, little endian
15!:mime	application/x-gdbm
160	string	GDBM		GNU dbm 2.x database
17!:mime	application/x-gdbm
18#
19# Berkeley DB
20#
21# Ian Darwin's file /etc/magic files: big/little-endian version.
22#
23# Hash 1.85/1.86 databases store metadata in network byte order.
24# Btree 1.85/1.86 databases store the metadata in host byte order.
25# Hash and Btree 2.X and later databases store the metadata in host byte order.
26
270	long	0x00061561	Berkeley DB
28!:mime	application/x-dbm
29>8	belong	4321
30>>4	belong	>2		1.86
31>>4	belong	<3		1.85
32>>4	belong	>0		(Hash, version %d, native byte-order)
33>8	belong	1234
34>>4	belong	>2		1.86
35>>4	belong	<3		1.85
36>>4	belong	>0		(Hash, version %d, little-endian)
37
380	belong	0x00061561	Berkeley DB
39>8	belong	4321
40>>4	belong	>2		1.86
41>>4	belong	<3		1.85
42>>4	belong	>0		(Hash, version %d, big-endian)
43>8	belong	1234
44>>4	belong	>2		1.86
45>>4	belong	<3		1.85
46>>4	belong	>0		(Hash, version %d, native byte-order)
47
480	long	0x00053162	Berkeley DB 1.85/1.86
49>4	long	>0		(Btree, version %d, native byte-order)
500	belong	0x00053162	Berkeley DB 1.85/1.86
51>4	belong	>0		(Btree, version %d, big-endian)
520	lelong	0x00053162	Berkeley DB 1.85/1.86
53>4	lelong	>0		(Btree, version %d, little-endian)
54
5512	long	0x00061561	Berkeley DB
56>16	long	>0		(Hash, version %d, native byte-order)
5712	belong	0x00061561	Berkeley DB
58>16	belong	>0		(Hash, version %d, big-endian)
5912	lelong	0x00061561	Berkeley DB
60>16	lelong	>0		(Hash, version %d, little-endian)
61
6212	long	0x00053162	Berkeley DB
63>16	long	>0		(Btree, version %d, native byte-order)
6412	belong	0x00053162	Berkeley DB
65>16	belong	>0		(Btree, version %d, big-endian)
6612	lelong	0x00053162	Berkeley DB
67>16	lelong	>0		(Btree, version %d, little-endian)
68
6912	long	0x00042253	Berkeley DB
70>16	long	>0		(Queue, version %d, native byte-order)
7112	belong	0x00042253	Berkeley DB
72>16	belong	>0		(Queue, version %d, big-endian)
7312	lelong	0x00042253	Berkeley DB
74>16	lelong	>0		(Queue, version %d, little-endian)
75
76# From Max Bowsher.
7712	long	0x00040988	Berkeley DB
78>16	long	>0		(Log, version %d, native byte-order)
7912	belong	0x00040988	Berkeley DB 
80>16	belong	>0		(Log, version %d, big-endian)
8112	lelong	0x00040988	Berkeley DB
82>16	lelong	>0		(Log, version %d, little-endian)
83
84#
85#
86# Round Robin Database Tool by Tobias Oetiker <oetiker@ee.ethz.ch>
870	string	RRD		RRDTool DB
88>4	string	x		version %s
89#----------------------------------------------------------------------
90# ROOT: file(1) magic for ROOT databases
91#
920       string  root\0  ROOT file
93>4      belong  x       Version %d
94>33     belong  x       (Compression: %d)
95
96# XXX: Weak magic.
97# Alex Ott <ott@jet.msk.su>
98## Paradox file formats
99#2	  leshort	0x0800	Paradox 
100#>0x39	  byte		3	v. 3.0 
101#>0x39	  byte		4	v. 3.5 
102#>0x39	  byte		9	v. 4.x 
103#>0x39	  byte		10	v. 5.x 
104#>0x39	  byte		11	v. 5.x 
105#>0x39	  byte		12	v. 7.x 
106#>>0x04	  byte		0	indexed .DB data file 
107#>>0x04	  byte		1	primary index .PX file 
108#>>0x04	  byte		2	non-indexed .DB data file 
109#>>0x04	  byte		3	non-incrementing secondary index .Xnn file 
110#>>0x04	  byte		4	secondary index .Ynn file 
111#>>0x04	  byte		5	incrementing secondary index .Xnn file 
112#>>0x04	  byte		6	non-incrementing secondary index .XGn file 
113#>>0x04	  byte		7	secondary index .YGn file 
114#>>>0x04	  byte		8	incrementing secondary index .XGn file 
115
116## XBase database files
117#0      byte       0x02	
118#>8     leshort	  >0
119#>>12   leshort    0	FoxBase 
120#!:mime	application/x-dbf
121#>>>0x04	lelong		0		(no records)
122#>>>0x04	lelong		>0		(%ld records)
123#
124#0      byte       0x03	
125#!:mime	application/x-dbf
126#>8     leshort	  >0
127#>>12   leshort    0	FoxBase+, FoxPro, dBaseIII+, dBaseIV, no memo 
128#>>>0x04	lelong		0		(no records)
129#>>>0x04	lelong		>0		(%ld records)
130#
131#0      byte       0x04	
132#!:mime	application/x-dbf
133#>8     leshort	  >0
134#>>12   leshort    0	dBASE IV no memo file 
135#>>>0x04	lelong		0		(no records)
136#>>>0x04	lelong		>0		(%ld records)
137#
138#0      byte       0x05	
139#!:mime	application/x-dbf
140#>8     leshort	  >0
141#>>12   leshort    0	dBASE V no memo file 
142#>>>0x04	lelong		0		(no records)
143#>>>0x04	lelong		>0		(%ld records)
144#
145#0      byte       0x30
146#!:mime	application/x-dbf
147#>8     leshort	  >0
148#>>12   leshort    0	Visual FoxPro 
149#>>>0x04	lelong		0		(no records)
150#>>>0x04	lelong		>0		(%ld records)
151#
152#0      byte       0x43
153#!:mime	application/x-dbf
154#>8     leshort	  >0
155#>>12   leshort    0	FlagShip with memo var size 
156#>>>0x04	lelong		0		(no records)
157#>>>0x04	lelong		>0		(%ld records)
158#
159#0      byte       0x7b
160#!:mime	application/x-dbf
161#>8     leshort	  >0
162#>>12   leshort    0	dBASEIV with memo 
163#>>>0x04	lelong		0		(no records)
164#>>>0x04	lelong		>0		(%ld records)
165#
166#0      byte       0x83	
167#!:mime	application/x-dbf
168#>8     leshort	  >0
169#>>12   leshort    0	FoxBase+, dBaseIII+ with memo 
170#>>>0x04	lelong		0		(no records)
171#>>>0x04	lelong		>0		(%ld records)
172#
173#0      byte       0x8b
174#!:mime	application/x-dbf
175#>8     leshort	  >0
176#>>12   leshort    0	dBaseIV with memo 
177#>>>0x04	lelong		0		(no records)
178#>>>0x04	lelong		>0		(%ld records)
179#
180#0      byte       0x8e	
181#!:mime	application/x-dbf
182#>8     leshort	  >0
183#>>12   leshort    0	dBaseIV with SQL Table 
184#>>>0x04	lelong		0		(no records)
185#>>>0x04	lelong		>0		(%ld records)
186#
187#0      byte       0xb3
188#!:mime	application/x-dbf
189#>8     leshort	  >0
190#>>12   leshort    0	FlagShip with .dbt memo 
191#>>>0x04	lelong		0		(no records)
192#>>>0x04	lelong		>0		(%ld records)
193#
194#0      byte       0xf5
195#!:mime	application/x-dbf
196#>8     leshort	  >0
197#>>12   leshort    0	FoxPro with memo 
198#>>>0x04	lelong		0		(no records)
199#>>>0x04	lelong		>0		(%ld records)
200#
201#0	leshort		0x0006		DBase 3 index file
202
203# MS Access database
2044	string	Standard\ Jet\ DB	Microsoft Access Database
205!:mime	application/x-msaccess
206
207# TDB database from Samba et al - Martin Pool <mbp@samba.org>
2080	string	TDB\ file		TDB database
209>32	lelong	0x2601196D		version 6, little-endian
210>>36	lelong	x			hash size %d bytes
211
212# SE Linux policy database
2130       lelong  0xf97cff8c      SE Linux policy
214>16     lelong  x               v%d
215>20     lelong  1      MLS
216>24     lelong  x       %d symbols
217>28     lelong  x       %d ocons
218
219# ICE authority file data (Wolfram Kleff)
2202	string		ICE		ICE authority data
221
222# X11 Xauthority file (Wolfram Kleff)
22310	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
22411	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
22512	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
22613	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
22714	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
22815	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
22916	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
23017	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
23118	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
232
233# From: Maxime Henrion <mux@FreeBSD.org>
234# PostgreSQL's custom dump format, Maxime Henrion <mux@FreeBSD.org>
2350	string		PGDMP		PostgreSQL custom database dump
236>5	byte		x		- v%d
237>6	byte		x		\b.%d
238>5	beshort		<=0x100		\b-0
239>5	beshort		>0x100
240>>7	byte		x		\b-%d
241
242# Type: Advanced Data Format (ADF) database
243# URL:  http://www.grc.nasa.gov/WWW/cgns/adf/
244# From: Nicolas Chauvat <nicolas.chauvat@logilab.fr>
2450	string	@(#)ADF\ Database	CGNS Advanced Data Format
246