xref: /minix3/external/bsd/file/dist/magic/magdir/database (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1ef01931fSBen Gras
2ef01931fSBen Gras#------------------------------------------------------------------------------
3*0a6a1f1dSLionel Sambuc# $File: database,v 1.43 2014/10/28 15:47:39 christos Exp $
4ef01931fSBen Gras# database:  file(1) magic for various databases
5ef01931fSBen Gras#
6ef01931fSBen Gras# extracted from header/code files by Graeme Wilford (eep2gw@ee.surrey.ac.uk)
7ef01931fSBen Gras#
8ef01931fSBen Gras#
9ef01931fSBen Gras# GDBM magic numbers
10ef01931fSBen Gras#  Will be maintained as part of the GDBM distribution in the future.
11ef01931fSBen Gras#  <downsj@teeny.org>
12*0a6a1f1dSLionel Sambuc0	belong	0x13579acd	GNU dbm 1.x or ndbm database, big endian, 32-bit
13ef01931fSBen Gras!:mime	application/x-gdbm
14*0a6a1f1dSLionel Sambuc0	belong	0x13579ace	GNU dbm 1.x or ndbm database, big endian, old
15*0a6a1f1dSLionel Sambuc!:mime	application/x-gdbm
16*0a6a1f1dSLionel Sambuc0	belong	0x13579acf	GNU dbm 1.x or ndbm database, big endian, 64-bit
17*0a6a1f1dSLionel Sambuc!:mime	application/x-gdbm
18*0a6a1f1dSLionel Sambuc0	lelong	0x13579acd	GNU dbm 1.x or ndbm database, little endian, 32-bit
19*0a6a1f1dSLionel Sambuc!:mime	application/x-gdbm
20*0a6a1f1dSLionel Sambuc0	lelong	0x13579ace	GNU dbm 1.x or ndbm database, little endian, old
21*0a6a1f1dSLionel Sambuc!:mime	application/x-gdbm
22*0a6a1f1dSLionel Sambuc0	lelong	0x13579acf	GNU dbm 1.x or ndbm database, little endian, 64-bit
23ef01931fSBen Gras!:mime	application/x-gdbm
24ef01931fSBen Gras0	string	GDBM		GNU dbm 2.x database
25ef01931fSBen Gras!:mime	application/x-gdbm
26ef01931fSBen Gras#
27ef01931fSBen Gras# Berkeley DB
28ef01931fSBen Gras#
29ef01931fSBen Gras# Ian Darwin's file /etc/magic files: big/little-endian version.
30ef01931fSBen Gras#
31ef01931fSBen Gras# Hash 1.85/1.86 databases store metadata in network byte order.
32ef01931fSBen Gras# Btree 1.85/1.86 databases store the metadata in host byte order.
33ef01931fSBen Gras# Hash and Btree 2.X and later databases store the metadata in host byte order.
34ef01931fSBen Gras
35ef01931fSBen Gras0	long	0x00061561	Berkeley DB
36ef01931fSBen Gras!:mime	application/x-dbm
37ef01931fSBen Gras>8	belong	4321
38ef01931fSBen Gras>>4	belong	>2		1.86
39ef01931fSBen Gras>>4	belong	<3		1.85
40ef01931fSBen Gras>>4	belong	>0		(Hash, version %d, native byte-order)
41ef01931fSBen Gras>8	belong	1234
42ef01931fSBen Gras>>4	belong	>2		1.86
43ef01931fSBen Gras>>4	belong	<3		1.85
44ef01931fSBen Gras>>4	belong	>0		(Hash, version %d, little-endian)
45ef01931fSBen Gras
46ef01931fSBen Gras0	belong	0x00061561	Berkeley DB
47ef01931fSBen Gras>8	belong	4321
48ef01931fSBen Gras>>4	belong	>2		1.86
49ef01931fSBen Gras>>4	belong	<3		1.85
50ef01931fSBen Gras>>4	belong	>0		(Hash, version %d, big-endian)
51ef01931fSBen Gras>8	belong	1234
52ef01931fSBen Gras>>4	belong	>2		1.86
53ef01931fSBen Gras>>4	belong	<3		1.85
54ef01931fSBen Gras>>4	belong	>0		(Hash, version %d, native byte-order)
55ef01931fSBen Gras
56ef01931fSBen Gras0	long	0x00053162	Berkeley DB 1.85/1.86
57ef01931fSBen Gras>4	long	>0		(Btree, version %d, native byte-order)
58ef01931fSBen Gras0	belong	0x00053162	Berkeley DB 1.85/1.86
59ef01931fSBen Gras>4	belong	>0		(Btree, version %d, big-endian)
60ef01931fSBen Gras0	lelong	0x00053162	Berkeley DB 1.85/1.86
61ef01931fSBen Gras>4	lelong	>0		(Btree, version %d, little-endian)
62ef01931fSBen Gras
63ef01931fSBen Gras12	long	0x00061561	Berkeley DB
64ef01931fSBen Gras>16	long	>0		(Hash, version %d, native byte-order)
65ef01931fSBen Gras12	belong	0x00061561	Berkeley DB
66ef01931fSBen Gras>16	belong	>0		(Hash, version %d, big-endian)
67ef01931fSBen Gras12	lelong	0x00061561	Berkeley DB
68ef01931fSBen Gras>16	lelong	>0		(Hash, version %d, little-endian)
69ef01931fSBen Gras
70ef01931fSBen Gras12	long	0x00053162	Berkeley DB
71ef01931fSBen Gras>16	long	>0		(Btree, version %d, native byte-order)
72ef01931fSBen Gras12	belong	0x00053162	Berkeley DB
73ef01931fSBen Gras>16	belong	>0		(Btree, version %d, big-endian)
74ef01931fSBen Gras12	lelong	0x00053162	Berkeley DB
75ef01931fSBen Gras>16	lelong	>0		(Btree, version %d, little-endian)
76ef01931fSBen Gras
77ef01931fSBen Gras12	long	0x00042253	Berkeley DB
78ef01931fSBen Gras>16	long	>0		(Queue, version %d, native byte-order)
79ef01931fSBen Gras12	belong	0x00042253	Berkeley DB
80ef01931fSBen Gras>16	belong	>0		(Queue, version %d, big-endian)
81ef01931fSBen Gras12	lelong	0x00042253	Berkeley DB
82ef01931fSBen Gras>16	lelong	>0		(Queue, version %d, little-endian)
83ef01931fSBen Gras
84ef01931fSBen Gras# From Max Bowsher.
85ef01931fSBen Gras12	long	0x00040988	Berkeley DB
86ef01931fSBen Gras>16	long	>0		(Log, version %d, native byte-order)
87ef01931fSBen Gras12	belong	0x00040988	Berkeley DB
88ef01931fSBen Gras>16	belong	>0		(Log, version %d, big-endian)
89ef01931fSBen Gras12	lelong	0x00040988	Berkeley DB
90ef01931fSBen Gras>16	lelong	>0		(Log, version %d, little-endian)
91ef01931fSBen Gras
92ef01931fSBen Gras#
93ef01931fSBen Gras#
94ef01931fSBen Gras# Round Robin Database Tool by Tobias Oetiker <oetiker@ee.ethz.ch>
95*0a6a1f1dSLionel Sambuc0	string/b	RRD\0		RRDTool DB
96*0a6a1f1dSLionel Sambuc>4	string/b	x		version %s
97*0a6a1f1dSLionel Sambuc
98*0a6a1f1dSLionel Sambuc>>10	short		!0		16bit aligned
99*0a6a1f1dSLionel Sambuc>>>10	bedouble	8.642135e+130	big-endian
100*0a6a1f1dSLionel Sambuc>>>>18	short		x		32bit long (m68k)
101*0a6a1f1dSLionel Sambuc
102*0a6a1f1dSLionel Sambuc>>10	short		0
103*0a6a1f1dSLionel Sambuc>>>12	long		!0		32bit aligned
104*0a6a1f1dSLionel Sambuc>>>>12	bedouble	8.642135e+130	big-endian
105*0a6a1f1dSLionel Sambuc>>>>>20 long		0		64bit long
106*0a6a1f1dSLionel Sambuc>>>>>20 long		!0		32bit long
107*0a6a1f1dSLionel Sambuc>>>>12	ledouble	8.642135e+130	little-endian
108*0a6a1f1dSLionel Sambuc>>>>>24 long		0		64bit long
109*0a6a1f1dSLionel Sambuc>>>>>24 long		!0		32bit long (i386)
110*0a6a1f1dSLionel Sambuc>>>>12	string		\x43\x2b\x1f\x5b\x2f\x25\xc0\xc7	middle-endian
111*0a6a1f1dSLionel Sambuc>>>>>24 short		!0		32bit long (arm)
112*0a6a1f1dSLionel Sambuc
113*0a6a1f1dSLionel Sambuc>>8	quad		0		64bit aligned
114*0a6a1f1dSLionel Sambuc>>>16	bedouble	8.642135e+130	big-endian
115*0a6a1f1dSLionel Sambuc>>>>24	long		0		64bit long (s390x)
116*0a6a1f1dSLionel Sambuc>>>>24	long		!0		32bit long (hppa/mips/ppc/s390/SPARC)
117*0a6a1f1dSLionel Sambuc>>>16	ledouble	8.642135e+130	little-endian
118*0a6a1f1dSLionel Sambuc>>>>28	long		0		64bit long (alpha/amd64/ia64)
119*0a6a1f1dSLionel Sambuc>>>>28	long		!0		32bit long (armel/mipsel)
120*0a6a1f1dSLionel Sambuc
121ef01931fSBen Gras#----------------------------------------------------------------------
122ef01931fSBen Gras# ROOT: file(1) magic for ROOT databases
123ef01931fSBen Gras#
124ef01931fSBen Gras0       string  root\0  ROOT file
125ef01931fSBen Gras>4      belong  x       Version %d
126ef01931fSBen Gras>33     belong  x       (Compression: %d)
127ef01931fSBen Gras
128ef01931fSBen Gras# XXX: Weak magic.
129ef01931fSBen Gras# Alex Ott <ott@jet.msk.su>
130ef01931fSBen Gras## Paradox file formats
131ef01931fSBen Gras#2	  leshort	0x0800	Paradox
132ef01931fSBen Gras#>0x39	  byte		3	v. 3.0
133ef01931fSBen Gras#>0x39	  byte		4	v. 3.5
134ef01931fSBen Gras#>0x39	  byte		9	v. 4.x
135ef01931fSBen Gras#>0x39	  byte		10	v. 5.x
136ef01931fSBen Gras#>0x39	  byte		11	v. 5.x
137ef01931fSBen Gras#>0x39	  byte		12	v. 7.x
138ef01931fSBen Gras#>>0x04	  byte		0	indexed .DB data file
139ef01931fSBen Gras#>>0x04	  byte		1	primary index .PX file
140ef01931fSBen Gras#>>0x04	  byte		2	non-indexed .DB data file
141ef01931fSBen Gras#>>0x04	  byte		3	non-incrementing secondary index .Xnn file
142ef01931fSBen Gras#>>0x04	  byte		4	secondary index .Ynn file
143ef01931fSBen Gras#>>0x04	  byte		5	incrementing secondary index .Xnn file
144ef01931fSBen Gras#>>0x04	  byte		6	non-incrementing secondary index .XGn file
145ef01931fSBen Gras#>>0x04	  byte		7	secondary index .YGn file
146ef01931fSBen Gras#>>>0x04	  byte		8	incrementing secondary index .XGn file
147ef01931fSBen Gras
148ef01931fSBen Gras## XBase database files
14984d9c625SLionel Sambuc# updated by Joerg Jenderek at Feb 2013
15084d9c625SLionel Sambuc# http://www.dbase.com/Knowledgebase/INT/db7_file_fmt.htm
15184d9c625SLionel Sambuc# http://www.clicketyclick.dk/databases/xbase/format/dbf.html
15284d9c625SLionel Sambuc# http://home.f1.htw-berlin.de/scheibl/db/intern/dBase.htm
15384d9c625SLionel Sambuc# inspect VVYYMMDD , where 1<= MM <= 12 and 1<= DD <= 31
15484d9c625SLionel Sambuc0	ubelong&0x0000FFFF		<0x00000C20
15584d9c625SLionel Sambuc# skip Infocom game Z-machine
15684d9c625SLionel Sambuc>2		ubyte			>0
15784d9c625SLionel Sambuc# skip Androids *.xml
15884d9c625SLionel Sambuc>>3		ubyte			>0
15984d9c625SLionel Sambuc>>>3		ubyte			<32
16084d9c625SLionel Sambuc# 1 < version VV
16184d9c625SLionel Sambuc>>>>0		ubyte			>1
16284d9c625SLionel Sambuc# skip HELP.CA3 by test for reserved byte ( NULL )
16384d9c625SLionel Sambuc>>>>>27		ubyte			0
16484d9c625SLionel Sambuc# reserved bytes not always 0 ; also found 0x3901 (T4.DBF) ,0x7101 (T5.DBF,T6.DBF)
16584d9c625SLionel Sambuc#>>>>>30		ubeshort     		x		30NULL?%x
16684d9c625SLionel Sambuc# possible production flag,tag numbers(<=0x30),tag length(<=0x20), reserved (NULL)
16784d9c625SLionel Sambuc>>>>>>24	ubelong&0xffFFFFff	>0x01302000
16884d9c625SLionel Sambuc# .DBF or .MDX
16984d9c625SLionel Sambuc>>>>>>24	ubelong&0xffFFFFff	<0x01302001
17084d9c625SLionel Sambuc# for Xbase Database file (*.DBF) reserved (NULL) for multi-user
17184d9c625SLionel Sambuc>>>>>>>24	ubelong&0xffFFFFff	=0
17284d9c625SLionel Sambuc# test for 2 reserved NULL bytes,transaction and encryption byte flag
17384d9c625SLionel Sambuc>>>>>>>>12	ubelong&0xFFFFfEfE	0
17484d9c625SLionel Sambuc# test for MDX flag
17584d9c625SLionel Sambuc>>>>>>>>>28	ubyte			x
17684d9c625SLionel Sambuc>>>>>>>>>28	ubyte&0xf8		0
17784d9c625SLionel Sambuc# header size >= 32
17884d9c625SLionel Sambuc>>>>>>>>>>8	uleshort		>31
17984d9c625SLionel Sambuc# skip PIC15736.PCX by test for language driver name or field name
18084d9c625SLionel Sambuc>>>>>>>>>>>32	ubyte			>0
18184d9c625SLionel Sambuc#!:mime	application/x-dbf; charset=unknown-8bit ??
18284d9c625SLionel Sambuc#!:mime	application/x-dbase
18384d9c625SLionel Sambuc>>>>>>>>>>>>0	use			xbase-type
18484d9c625SLionel Sambuc# database file
18584d9c625SLionel Sambuc>>>>>>>>>>>>0	ubyte			x		\b DBF
18684d9c625SLionel Sambuc>>>>>>>>>>>>4	lelong			0		\b, no records
187*0a6a1f1dSLionel Sambuc>>>>>>>>>>>>4	lelong			>0		\b, %d record
18884d9c625SLionel Sambuc# plural s appended
18984d9c625SLionel Sambuc>>>>>>>>>>>>>4	lelong			>1		\bs
19084d9c625SLionel Sambuc# http://www.clicketyclick.dk/databases/xbase/format/dbf_check.html#CHECK_DBF
19184d9c625SLionel Sambuc# 1 <= record size <= 4000 (dBase 3,4) or 32 * KB (=0x8000)
19284d9c625SLionel Sambuc>>>>>>>>>>>>10	uleshort		x		* %d
19384d9c625SLionel Sambuc# file size = records * record size + header size
19484d9c625SLionel Sambuc>>>>>>>>>>>>1	ubyte			x		\b, update-date
19584d9c625SLionel Sambuc>>>>>>>>>>>>1	use			xbase-date
19684d9c625SLionel Sambuc# http://msdn.microsoft.com/de-de/library/cc483186(v=vs.71).aspx
19784d9c625SLionel Sambuc#>>>>>>>>>>>>29	ubyte			=0		\b, codepage ID=0x%x
19884d9c625SLionel Sambuc# 2~cp850 , 3~cp1252 , 0x1b~?? ; what code page is 0x1b ?
19984d9c625SLionel Sambuc>>>>>>>>>>>>29	ubyte			>0		\b, codepage ID=0x%x
20084d9c625SLionel Sambuc#>>>>>>>>>>>>28	ubyte&0x01		0		\b, no index file
20184d9c625SLionel Sambuc>>>>>>>>>>>>28	ubyte&0x01		1		\b, with index file .MDX
20284d9c625SLionel Sambuc>>>>>>>>>>>>28	ubyte&0x02		2		\b, with memo .FPT
20384d9c625SLionel Sambuc>>>>>>>>>>>>28	ubyte&0x04		4		\b, DataBaseContainer
20484d9c625SLionel Sambuc# 1st record offset + 1 = header size
20584d9c625SLionel Sambuc>>>>>>>>>>>>8	uleshort		>0
20684d9c625SLionel Sambuc>>>>>>>>>>>>(8.s+1)	ubyte		>0
20784d9c625SLionel Sambuc>>>>>>>>>>>>>8		uleshort	>0		\b, at offset %d
20884d9c625SLionel Sambuc>>>>>>>>>>>>>(8.s+1)	ubyte		>0
20984d9c625SLionel Sambuc>>>>>>>>>>>>>>&-1	string		>\0		1st record "%s"
21084d9c625SLionel Sambuc# for multiple index files (*.MDX) Production flag,tag numbers(<=0x30),tag length(<=0x20), reserverd (NULL)
21184d9c625SLionel Sambuc>>>>>>>24	ubelong&0x0133f7ff	>0
21284d9c625SLionel Sambuc# test for reserved NULL byte
213*0a6a1f1dSLionel Sambuc>>>>>>>>47	ubyte			0
21484d9c625SLionel Sambuc# test for valid TAG key format (0x10 or 0)
21584d9c625SLionel Sambuc>>>>>>>>>559	ubyte&0xeF		0
21684d9c625SLionel Sambuc# test MM <= 12
217*0a6a1f1dSLionel Sambuc>>>>>>>>>>45	ubeshort		<0x0C20
218*0a6a1f1dSLionel Sambuc>>>>>>>>>>>45	ubyte			>0
219*0a6a1f1dSLionel Sambuc>>>>>>>>>>>>46	ubyte			<32
220*0a6a1f1dSLionel Sambuc>>>>>>>>>>>>>46	ubyte			>0
22184d9c625SLionel Sambuc#!:mime	application/x-mdx
222*0a6a1f1dSLionel Sambuc>>>>>>>>>>>>>>0		use		xbase-type
223*0a6a1f1dSLionel Sambuc>>>>>>>>>>>>>>0		ubyte		x		\b MDX
224*0a6a1f1dSLionel Sambuc>>>>>>>>>>>>>>1		ubyte		x		\b, creation-date
225*0a6a1f1dSLionel Sambuc>>>>>>>>>>>>>>1		use		xbase-date
226*0a6a1f1dSLionel Sambuc>>>>>>>>>>>>>>44	ubyte		x		\b, update-date
227*0a6a1f1dSLionel Sambuc>>>>>>>>>>>>>>44	use		xbase-date
22884d9c625SLionel Sambuc# No.of tags in use (1,2,5,12)
229*0a6a1f1dSLionel Sambuc>>>>>>>>>>>>>>28	uleshort	x		\b, %d
23084d9c625SLionel Sambuc# No. of entries in tag (0x30)
231*0a6a1f1dSLionel Sambuc>>>>>>>>>>>>>>25	ubyte		x		\b/%d tags
23284d9c625SLionel Sambuc#  Length of tag
233*0a6a1f1dSLionel Sambuc>>>>>>>>>>>>>>26	ubyte		x		* %d
23484d9c625SLionel Sambuc# 1st tag name_
23584d9c625SLionel Sambuc>>>>>>>>>>>>>548	string		x		\b, 1st tag "%.11s"
23684d9c625SLionel Sambuc# 2nd tag name
23784d9c625SLionel Sambuc#>>>>>>>>>>>>(26.b+548)	string		x		\b, 2nd tag "%.11s"
238ef01931fSBen Gras#
23984d9c625SLionel Sambuc#		Print the xBase names of different version variants
24084d9c625SLionel Sambuc0	name				xbase-type
24184d9c625SLionel Sambuc>0	ubyte		<2
24284d9c625SLionel Sambuc# 1 < version
24384d9c625SLionel Sambuc>0	ubyte		>1
24484d9c625SLionel Sambuc>>0	ubyte		0x02		FoxBase
24584d9c625SLionel Sambuc# FoxBase+/dBaseIII+, no memo
24684d9c625SLionel Sambuc>>0	ubyte		0x03		FoxBase+/dBase III
247*0a6a1f1dSLionel Sambuc!:mime	application/x-dbf
24884d9c625SLionel Sambuc# dBASE IV no memo file
24984d9c625SLionel Sambuc>>0	ubyte		0x04		dBase IV
250*0a6a1f1dSLionel Sambuc!:mime	application/x-dbf
25184d9c625SLionel Sambuc# dBASE V no memo file
25284d9c625SLionel Sambuc>>0	ubyte		0x05		dBase V
253*0a6a1f1dSLionel Sambuc!:mime	application/x-dbf
25484d9c625SLionel Sambuc>>0	ubyte		0x30		Visual FoxPro
255*0a6a1f1dSLionel Sambuc!:mime	application/x-dbf
25684d9c625SLionel Sambuc>>0	ubyte		0x31		Visual FoxPro, autoincrement
257*0a6a1f1dSLionel Sambuc!:mime	application/x-dbf
25884d9c625SLionel Sambuc# Visual FoxPro, with field type Varchar or Varbinary
25984d9c625SLionel Sambuc>>0	ubyte		0x32		Visual FoxPro, with field type Varchar
260*0a6a1f1dSLionel Sambuc!:mime	application/x-dbf
26184d9c625SLionel Sambuc# dBASE IV SQL, no memo;dbv memo var size (Flagship)
26284d9c625SLionel Sambuc>>0	ubyte		0x43		dBase IV, with SQL table
263*0a6a1f1dSLionel Sambuc!:mime	application/x-dbf
26484d9c625SLionel Sambuc# http://msdn.microsoft.com/en-US/library/st4a0s68(v=vs.80).aspx
26584d9c625SLionel Sambuc#>>0	ubyte		0x62		dBase IV, with SQL table
266*0a6a1f1dSLionel Sambuc#!:mime	application/x-dbf
26784d9c625SLionel Sambuc# dBASE IV, with memo!!
26884d9c625SLionel Sambuc>>0	ubyte		0x7b		dBase IV, with memo
269*0a6a1f1dSLionel Sambuc!:mime	application/x-dbf
27084d9c625SLionel Sambuc# http://msdn.microsoft.com/en-US/library/st4a0s68(v=vs.80).aspx
27184d9c625SLionel Sambuc#>>0	ubyte		0x82		dBase IV, with SQL system
272*0a6a1f1dSLionel Sambuc#!:mime	application/x-dbf
27384d9c625SLionel Sambuc# FoxBase+/dBaseIII+ with memo .DBT!
27484d9c625SLionel Sambuc>>0	ubyte		0x83		FoxBase+/dBase III, with memo .DBT
275*0a6a1f1dSLionel Sambuc!:mime	application/x-dbf
27684d9c625SLionel Sambuc# VISUAL OBJECTS (first 1.0 versions) for the Dbase III files (NTX clipper driver); memo file
27784d9c625SLionel Sambuc>>0	ubyte		0x87		VISUAL OBJECTS, with memo file
278*0a6a1f1dSLionel Sambuc!:mime	application/x-dbf
27984d9c625SLionel Sambuc# http://msdn.microsoft.com/en-US/library/st4a0s68(v=vs.80).aspx
28084d9c625SLionel Sambuc#>>0	ubyte		0x8A		FoxBase+/dBase III, with memo .DBT
281*0a6a1f1dSLionel Sambuc#!:mime	application/x-dbf
28284d9c625SLionel Sambuc# dBASE IV with memo!
28384d9c625SLionel Sambuc>>0	ubyte		0x8B		dBase IV, with memo .DBT
284*0a6a1f1dSLionel Sambuc!:mime	application/x-dbf
28584d9c625SLionel Sambuc# dBase IV with SQL Table,no memo?
28684d9c625SLionel Sambuc>>0	ubyte		0x8E		dBase IV, with SQL table
287*0a6a1f1dSLionel Sambuc!:mime	application/x-dbf
28884d9c625SLionel Sambuc# .dbv and .dbt memo (Flagship)?
28984d9c625SLionel Sambuc>>0	ubyte		0xB3		Flagship
29084d9c625SLionel Sambuc# http://msdn.microsoft.com/en-US/library/st4a0s68(v=vs.80).aspx
29184d9c625SLionel Sambuc#>>0	ubyte		0xCA		dBase IV with memo .DBT
292*0a6a1f1dSLionel Sambuc#!:mime	application/x-dbf
29384d9c625SLionel Sambuc# dBASE IV with SQL table, with memo .DBT
29484d9c625SLionel Sambuc>>0	ubyte		0xCB		dBase IV with SQL table, with memo .DBT
295*0a6a1f1dSLionel Sambuc!:mime	application/x-dbf
29684d9c625SLionel Sambuc# HiPer-Six format;Clipper SIX, with SMT memo file
29784d9c625SLionel Sambuc>>0	ubyte		0xE5		Clipper SIX with memo
298*0a6a1f1dSLionel Sambuc!:mime	application/x-dbf
29984d9c625SLionel Sambuc# http://msdn.microsoft.com/en-US/library/st4a0s68(v=vs.80).aspx
30084d9c625SLionel Sambuc#>>0	ubyte		0xF4		dBase IV, with SQL table, with memo
301*0a6a1f1dSLionel Sambuc#!:mime	application/x-dbf
30284d9c625SLionel Sambuc>>0	ubyte		0xF5		FoxPro with memo
303*0a6a1f1dSLionel Sambuc!:mime	application/x-dbf
30484d9c625SLionel Sambuc# http://msdn.microsoft.com/en-US/library/st4a0s68(v=vs.80).aspx
30584d9c625SLionel Sambuc#>>0	ubyte		0xFA		FoxPro 2.x, with memo
306*0a6a1f1dSLionel Sambuc#!:mime	application/x-dbf
307*0a6a1f1dSLionel Sambuc# unknown version (should not happen)
30884d9c625SLionel Sambuc>>0	default		x		xBase
309*0a6a1f1dSLionel Sambuc!:mime	application/x-dbf
31084d9c625SLionel Sambuc>>>0	ubyte		x		(0x%x)
31184d9c625SLionel Sambuc# flags in version byte
31284d9c625SLionel Sambuc# DBT flag (with dBASE III memo .DBT)!!
31384d9c625SLionel Sambuc# >>0	ubyte&0x80	>0		DBT_FLAG=%x
31484d9c625SLionel Sambuc# memo flag ??
31584d9c625SLionel Sambuc# >>0	ubyte&0x08	>0		MEMO_FLAG=%x
31684d9c625SLionel Sambuc# SQL flag ??
31784d9c625SLionel Sambuc# >>0	ubyte&0x70	>0		SQL_FLAG=%x
31884d9c625SLionel Sambuc#		test and print the date of xBase .DBF .MDX
31984d9c625SLionel Sambuc0	name				xbase-date
32084d9c625SLionel Sambuc# inspect YYMMDD , where 1<= MM <= 12 and 1<= DD <= 31
32184d9c625SLionel Sambuc>0	ubelong		x
32284d9c625SLionel Sambuc>1	ubyte		<13
32384d9c625SLionel Sambuc>>1	ubyte		>0
32484d9c625SLionel Sambuc>>>2	ubyte		>0
32584d9c625SLionel Sambuc>>>>2	ubyte		<32
32684d9c625SLionel Sambuc>>>>>0	ubyte		x
32784d9c625SLionel Sambuc# YY is interpreted as 20YY or 19YY
32884d9c625SLionel Sambuc>>>>>>0	ubyte		<100		\b %.2d
32984d9c625SLionel Sambuc# YY is interpreted 1900+YY; TODO: display yy or 20yy instead 1YY
33084d9c625SLionel Sambuc>>>>>>0	ubyte		>99		\b %d
33184d9c625SLionel Sambuc>>>>>1	ubyte		x		\b-%d
33284d9c625SLionel Sambuc>>>>>2	ubyte		x		\b-%d
33384d9c625SLionel Sambuc
33484d9c625SLionel Sambuc#	dBase memo files .DBT or .FPT
33584d9c625SLionel Sambuc# http://msdn.microsoft.com/en-us/library/8599s21w(v=vs.80).aspx
33684d9c625SLionel Sambuc16		ubyte		<4
33784d9c625SLionel Sambuc>16		ubyte		!2
33884d9c625SLionel Sambuc>>16		ubyte		!1
33984d9c625SLionel Sambuc# next free block index is positive
34084d9c625SLionel Sambuc>>>0		ulelong		>0
34184d9c625SLionel Sambuc# skip many JPG. ZIP, BZ2 by test for reserved bytes NULL , 0|2 , 0|1 , low byte of block size
34284d9c625SLionel Sambuc>>>>17		ubelong&0xFFfdFE00	0x00000000
34384d9c625SLionel Sambuc# skip many RAR by test for low byte 0 ,high byte 0|2|even of block size, 0|a|e|d7 , 0|64h
34484d9c625SLionel Sambuc>>>>>20		ubelong&0xFF01209B	0x00000000
34584d9c625SLionel Sambuc# dBASE III
34684d9c625SLionel Sambuc>>>>>>16	ubyte		3
34784d9c625SLionel Sambuc# dBASE III DBT
348*0a6a1f1dSLionel Sambuc>>>>>>>0	use		dbase3-memo-print
349*0a6a1f1dSLionel Sambuc# dBASE III DBT without version, dBASE IV DBT , FoxPro FPT , or many ZIP , DBF garbage
35084d9c625SLionel Sambuc>>>>>>16	ubyte		0
351*0a6a1f1dSLionel Sambuc# unusual dBASE III DBT like angest.dbt, dBASE IV DBT with block size 0 , FoxPro FPT ,  or garbage PCX DBF
352*0a6a1f1dSLionel Sambuc>>>>>>>20	uleshort	0
353*0a6a1f1dSLionel Sambuc# FoxPro FPT , unusual dBASE III DBT like biblio.dbt or garbage
354*0a6a1f1dSLionel Sambuc>>>>>>>>8	ulong		=0
355*0a6a1f1dSLionel Sambuc>>>>>>>>>6	ubeshort	>0
356*0a6a1f1dSLionel Sambuc# skip emacs.PIF
357*0a6a1f1dSLionel Sambuc>>>>>>>>>>4	ushort		0
358*0a6a1f1dSLionel Sambuc>>>>>>>>>>>0	use		foxpro-memo-print
359*0a6a1f1dSLionel Sambuc# dBASE III DBT , garbage
360*0a6a1f1dSLionel Sambuc>>>>>>>>>6	ubeshort	0
36184d9c625SLionel Sambuc# skip MM*DD*.bin by test for for reserved NULL byte
362*0a6a1f1dSLionel Sambuc>>>>>>>>>>510	ubeshort	0
363*0a6a1f1dSLionel Sambuc# skip TK-DOS11.img image by looking for memo text
364*0a6a1f1dSLionel Sambuc>>>>>>>>>>>512	ubelong		<0xfeffff03
365*0a6a1f1dSLionel Sambuc# skip EFI executables by looking for memo text
366*0a6a1f1dSLionel Sambuc>>>>>>>>>>>>512	ubelong		>0x1F202020
367*0a6a1f1dSLionel Sambuc>>>>>>>>>>>>>513 ubyte		>0
368*0a6a1f1dSLionel Sambuc# unusual dBASE III DBT like adressen.dbt
369*0a6a1f1dSLionel Sambuc>>>>>>>>>>>>>>0	use		dbase3-memo-print
370*0a6a1f1dSLionel Sambuc# dBASE III DBT like angest.dbt, or garbage PCX DBF
371*0a6a1f1dSLionel Sambuc>>>>>>>>8	ubelong		!0
372*0a6a1f1dSLionel Sambuc# skip PCX and some DBF by test for for reserved NULL bytes
373*0a6a1f1dSLionel Sambuc>>>>>>>>>510	ubeshort	0
374*0a6a1f1dSLionel Sambuc# skip some DBF by test of invalid version
375*0a6a1f1dSLionel Sambuc>>>>>>>>>>0	ubyte		>5
376*0a6a1f1dSLionel Sambuc>>>>>>>>>>>0	ubyte		<48
377*0a6a1f1dSLionel Sambuc>>>>>>>>>>>>0	use		dbase3-memo-print
378*0a6a1f1dSLionel Sambuc# dBASE IV DBT with positive block size
379*0a6a1f1dSLionel Sambuc>>>>>>>20	uleshort	>0
380*0a6a1f1dSLionel Sambuc>>>>>>>>0	use		dbase4-memo-print
38184d9c625SLionel Sambuc
382*0a6a1f1dSLionel Sambuc#		Print the information of dBase III DBT memo file
383*0a6a1f1dSLionel Sambuc0	name				dbase3-memo-print
384*0a6a1f1dSLionel Sambuc>0	ubyte			x		dBase III DBT
385*0a6a1f1dSLionel Sambuc# instead 3 as version number 0 for unusual examples like biblio.dbt
386*0a6a1f1dSLionel Sambuc>16	ubyte			!3		\b, version number %u
38784d9c625SLionel Sambuc# Number of next available block for appending data
388*0a6a1f1dSLionel Sambuc#>0	lelong			=0		\b, next free block index %u
389*0a6a1f1dSLionel Sambuc>0	lelong			!0		\b, next free block index %u
390*0a6a1f1dSLionel Sambuc# no positiv block length
391*0a6a1f1dSLionel Sambuc#>20	uleshort		=0		\b, block length %u
392*0a6a1f1dSLionel Sambuc>20	uleshort		!0		\b, block length %u
393*0a6a1f1dSLionel Sambuc# dBase III memo field terminated by \032\032
394*0a6a1f1dSLionel Sambuc>512	string			>\0		\b, 1st item "%s"
395*0a6a1f1dSLionel Sambuc#		Print the information of dBase IV DBT memo file
396*0a6a1f1dSLionel Sambuc0	name				dbase4-memo-print
397*0a6a1f1dSLionel Sambuc>0		lelong		x		dBase IV DBT
398*0a6a1f1dSLionel Sambuc# 8 character shorted main name of coresponding dBASE IV DBF file
399*0a6a1f1dSLionel Sambuc>8		ubelong		>0x20000000
400*0a6a1f1dSLionel Sambuc# skip unusual like for angest.dbt
401*0a6a1f1dSLionel Sambuc>>20		uleshort	>0
402*0a6a1f1dSLionel Sambuc>>>8		string		>\0		\b of %-.8s.DBF
403*0a6a1f1dSLionel Sambuc# value 0 implies 512 as size
404*0a6a1f1dSLionel Sambuc#>4		ulelong		=0		\b, blocks size %u
405*0a6a1f1dSLionel Sambuc# size of blocks not reliable like 0x2020204C in angest.dbt
406*0a6a1f1dSLionel Sambuc>4		ulelong		!0
407*0a6a1f1dSLionel Sambuc>>4		ulelong&0x0000003f	0	\b, blocks size %u
408*0a6a1f1dSLionel Sambuc# dBase IV DBT with positive block length (found 512 , 1024)
409*0a6a1f1dSLionel Sambuc>20		uleshort	>0		\b, block length %u
410*0a6a1f1dSLionel Sambuc# next available block
411*0a6a1f1dSLionel Sambuc#>0		lelong		=0		\b, next free block index %u
412*0a6a1f1dSLionel Sambuc>0		lelong		!0		\b, next free block index %u
413*0a6a1f1dSLionel Sambuc>20		uleshort	>0
414*0a6a1f1dSLionel Sambuc>>(20.s)	ubelong		x
415*0a6a1f1dSLionel Sambuc>>>&-4		use		dbase4-memofield-print
416*0a6a1f1dSLionel Sambuc# unusual dBase IV DBT without block length (implies 512 as length)
417*0a6a1f1dSLionel Sambuc>20		uleshort	=0
41884d9c625SLionel Sambuc>>512		ubelong		x
419*0a6a1f1dSLionel Sambuc>>>&-4		use				dbase4-memofield-print
420*0a6a1f1dSLionel Sambuc#		Print the information of dBase IV memo field
421*0a6a1f1dSLionel Sambuc0	name			dbase4-memofield-print
422*0a6a1f1dSLionel Sambuc# free dBase IV memo field
423*0a6a1f1dSLionel Sambuc>0		ubelong		!0xFFFF0800
424*0a6a1f1dSLionel Sambuc>>0		lelong		x		\b, next free block %u
425*0a6a1f1dSLionel Sambuc>>4		lelong		x		\b, next used block %u
426*0a6a1f1dSLionel Sambuc# used dBase IV memo field
427*0a6a1f1dSLionel Sambuc>0		ubelong		=0xFFFF0800
428*0a6a1f1dSLionel Sambuc# length of memo field
429*0a6a1f1dSLionel Sambuc>>4		lelong		x		\b, field length %d
430*0a6a1f1dSLionel Sambuc>>>8		string		>\0		\b, 1st used item "%s"
431*0a6a1f1dSLionel Sambuc#		Print the information of FoxPro FPT memo file
432*0a6a1f1dSLionel Sambuc0	name				foxpro-memo-print
433*0a6a1f1dSLionel Sambuc>0		belong		x		FoxPro FPT
434*0a6a1f1dSLionel Sambuc# Size of blocks for FoxPro ( 64,256 )
435*0a6a1f1dSLionel Sambuc>6		ubeshort	x		\b, blocks size %u
436*0a6a1f1dSLionel Sambuc# next available block
437*0a6a1f1dSLionel Sambuc#>0		belong		=0		\b, next free block index %u
438*0a6a1f1dSLionel Sambuc>0		belong		!0		\b, next free block index %u
439*0a6a1f1dSLionel Sambuc# field type ( 0~picture, 1~memo, 2~object )
440*0a6a1f1dSLionel Sambuc>512		ubelong		<3		\b, field type %u
441*0a6a1f1dSLionel Sambuc# length of memo field
442*0a6a1f1dSLionel Sambuc>512		ubelong		1
443*0a6a1f1dSLionel Sambuc>>516		belong		>0		\b, field length %d
444*0a6a1f1dSLionel Sambuc>>>520		string		>\0		\b, 1st item "%s"
44584d9c625SLionel Sambuc
44684d9c625SLionel Sambuc# TODO:
44784d9c625SLionel Sambuc# DBASE index file *.NDX
44884d9c625SLionel Sambuc# DBASE Compound Index file *.CDX
44984d9c625SLionel Sambuc# dBASE IV Printer Driver *.PRF
45084d9c625SLionel Sambuc## End of XBase database stuff
451ef01931fSBen Gras
452ef01931fSBen Gras# MS Access database
453ef01931fSBen Gras4	string	Standard\ Jet\ DB	Microsoft Access Database
454ef01931fSBen Gras!:mime	application/x-msaccess
45584d9c625SLionel Sambuc4	string	Standard\ ACE\ DB	Microsoft Access Database
45684d9c625SLionel Sambuc!:mime	application/x-msaccess
457ef01931fSBen Gras
458ef01931fSBen Gras# TDB database from Samba et al - Martin Pool <mbp@samba.org>
459ef01931fSBen Gras0	string	TDB\ file		TDB database
460ef01931fSBen Gras>32	lelong	0x2601196D		version 6, little-endian
461ef01931fSBen Gras>>36	lelong	x			hash size %d bytes
462ef01931fSBen Gras
463ef01931fSBen Gras# SE Linux policy database
464ef01931fSBen Gras0       lelong  0xf97cff8c      SE Linux policy
465ef01931fSBen Gras>16     lelong  x               v%d
466ef01931fSBen Gras>20     lelong  1      MLS
467ef01931fSBen Gras>24     lelong  x       %d symbols
468ef01931fSBen Gras>28     lelong  x       %d ocons
469ef01931fSBen Gras
470ef01931fSBen Gras# ICE authority file data (Wolfram Kleff)
471ef01931fSBen Gras2	string		ICE		ICE authority data
472ef01931fSBen Gras
473ef01931fSBen Gras# X11 Xauthority file (Wolfram Kleff)
474ef01931fSBen Gras10	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
475ef01931fSBen Gras11	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
476ef01931fSBen Gras12	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
477ef01931fSBen Gras13	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
478ef01931fSBen Gras14	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
479ef01931fSBen Gras15	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
480ef01931fSBen Gras16	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
481ef01931fSBen Gras17	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
482ef01931fSBen Gras18	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
483ef01931fSBen Gras
484ef01931fSBen Gras# From: Maxime Henrion <mux@FreeBSD.org>
485ef01931fSBen Gras# PostgreSQL's custom dump format, Maxime Henrion <mux@FreeBSD.org>
486ef01931fSBen Gras0	string		PGDMP		PostgreSQL custom database dump
487ef01931fSBen Gras>5	byte		x		- v%d
488ef01931fSBen Gras>6	byte		x		\b.%d
489ef01931fSBen Gras>5	beshort		<0x101		\b-0
490ef01931fSBen Gras>5	beshort		>0x100
491ef01931fSBen Gras>>7	byte		x		\b-%d
492ef01931fSBen Gras
493ef01931fSBen Gras# Type: Advanced Data Format (ADF) database
494ef01931fSBen Gras# URL:  http://www.grc.nasa.gov/WWW/cgns/adf/
495ef01931fSBen Gras# From: Nicolas Chauvat <nicolas.chauvat@logilab.fr>
496ef01931fSBen Gras0	string	@(#)ADF\ Database	CGNS Advanced Data Format
497ef01931fSBen Gras
498ef01931fSBen Gras# Tokyo Cabinet magic data
499ef01931fSBen Gras# http://tokyocabinet.sourceforge.net/index.html
500ef01931fSBen Gras0	string		ToKyO\ CaBiNeT\n	Tokyo Cabinet
501ef01931fSBen Gras>14	string		x			\b (%s)
502ef01931fSBen Gras>32	byte		0			\b, Hash
503ef01931fSBen Gras!:mime	application/x-tokyocabinet-hash
504ef01931fSBen Gras>32	byte		1			\b, B+ tree
505ef01931fSBen Gras!:mime	application/x-tokyocabinet-btree
506ef01931fSBen Gras>32	byte		2			\b, Fixed-length
507ef01931fSBen Gras!:mime	application/x-tokyocabinet-fixed
508ef01931fSBen Gras>32	byte		3			\b, Table
509ef01931fSBen Gras!:mime	application/x-tokyocabinet-table
510ef01931fSBen Gras>33	byte		&1			\b, [open]
511ef01931fSBen Gras>33	byte		&2			\b, [fatal]
512ef01931fSBen Gras>34	byte		x			\b, apow=%d
513ef01931fSBen Gras>35	byte		x			\b, fpow=%d
514ef01931fSBen Gras>36	byte		&0x01			\b, [large]
515ef01931fSBen Gras>36	byte		&0x02			\b, [deflate]
516ef01931fSBen Gras>36	byte		&0x04			\b, [bzip]
517ef01931fSBen Gras>36	byte		&0x08			\b, [tcbs]
518ef01931fSBen Gras>36	byte		&0x10			\b, [excodec]
519ef01931fSBen Gras>40	lequad		x			\b, bnum=%lld
520ef01931fSBen Gras>48	lequad		x			\b, rnum=%lld
521ef01931fSBen Gras>56	lequad		x			\b, fsiz=%lld
522835f6802SDirk Vogt
523835f6802SDirk Vogt# Type:	QDBM Quick Database Manager
524835f6802SDirk Vogt# From:	Benoit Sibaud <bsibaud@april.org>
525835f6802SDirk Vogt0	string		\\[depot\\]\n\f		Quick Database Manager, little endian
526835f6802SDirk Vogt0	string		\\[DEPOT\\]\n\f		Quick Database Manager, big endian
527835f6802SDirk Vogt
528835f6802SDirk Vogt# Type:	TokyoCabinet database
529835f6802SDirk Vogt# URL:	http://tokyocabinet.sourceforge.net/
530835f6802SDirk Vogt# From:	Benoit Sibaud <bsibaud@april.org>
531835f6802SDirk Vogt0	string		ToKyO\ CaBiNeT\n	TokyoCabinet database
532835f6802SDirk Vogt>14	string		x			(version %s)
533835f6802SDirk Vogt
53484d9c625SLionel Sambuc# From:  Stephane Blondon http://www.yaal.fr
535835f6802SDirk Vogt# Database file for Zope (done by FileStorage)
536835f6802SDirk Vogt0	string		FS21	Zope Object Database File Storage (data)
537835f6802SDirk Vogt# Cache file for the database of Zope (done by ClientStorage)
538835f6802SDirk Vogt0	string		ZEC3	Zope Object Database Client Cache File (data)
53984d9c625SLionel Sambuc
54084d9c625SLionel Sambuc# IDA (Interactive Disassembler) database
54184d9c625SLionel Sambuc0	string		IDA1	IDA (Interactive Disassembler) database
542