xref: /dragonfly/contrib/file/magic/Magdir/database (revision ec1c3f3a)
1
2#------------------------------------------------------------------------------
3# $File: database,v 1.67 2022/07/12 18:57:42 christos Exp $
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	0x13579acd	GNU dbm 1.x or ndbm database, big endian, 32-bit
13!:mime	application/x-gdbm
140	belong	0x13579ace	GNU dbm 1.x or ndbm database, big endian, old
15!:mime	application/x-gdbm
160	belong	0x13579acf	GNU dbm 1.x or ndbm database, big endian, 64-bit
17!:mime	application/x-gdbm
180	lelong	0x13579acd	GNU dbm 1.x or ndbm database, little endian, 32-bit
19!:mime	application/x-gdbm
200	lelong	0x13579ace	GNU dbm 1.x or ndbm database, little endian, old
21!:mime	application/x-gdbm
220	lelong	0x13579acf	GNU dbm 1.x or ndbm database, little endian, 64-bit
23!:mime	application/x-gdbm
240	string	GDBM		GNU dbm 2.x database
25!:mime	application/x-gdbm
26#
27# Berkeley DB
28#
29# Ian Darwin's file /etc/magic files: big/little-endian version.
30#
31# Hash 1.85/1.86 databases store metadata in network byte order.
32# Btree 1.85/1.86 databases store the metadata in host byte order.
33# Hash and Btree 2.X and later databases store the metadata in host byte order.
34
350	long	0x00061561	Berkeley DB
36!:mime	application/x-dbm
37>8	belong	4321
38>>4	belong	>2		1.86
39>>4	belong	<3		1.85
40>>4	belong	>0		(Hash, version %d, native byte-order)
41>8	belong	1234
42>>4	belong	>2		1.86
43>>4	belong	<3		1.85
44>>4	belong	>0		(Hash, version %d, little-endian)
45
460	belong	0x00061561	Berkeley DB
47>8	belong	4321
48>>4	belong	>2		1.86
49>>4	belong	<3		1.85
50>>4	belong	>0		(Hash, version %d, big-endian)
51>8	belong	1234
52>>4	belong	>2		1.86
53>>4	belong	<3		1.85
54>>4	belong	>0		(Hash, version %d, native byte-order)
55
560	long	0x00053162	Berkeley DB 1.85/1.86
57>4	long	>0		(Btree, version %d, native byte-order)
580	belong	0x00053162	Berkeley DB 1.85/1.86
59>4	belong	>0		(Btree, version %d, big-endian)
600	lelong	0x00053162	Berkeley DB 1.85/1.86
61>4	lelong	>0		(Btree, version %d, little-endian)
62
6312	long	0x00061561	Berkeley DB
64>16	long	>0		(Hash, version %d, native byte-order)
6512	belong	0x00061561	Berkeley DB
66>16	belong	>0		(Hash, version %d, big-endian)
6712	lelong	0x00061561	Berkeley DB
68>16	lelong	>0		(Hash, version %d, little-endian)
69
7012	long	0x00053162	Berkeley DB
71>16	long	>0		(Btree, version %d, native byte-order)
7212	belong	0x00053162	Berkeley DB
73>16	belong	>0		(Btree, version %d, big-endian)
7412	lelong	0x00053162	Berkeley DB
75>16	lelong	>0		(Btree, version %d, little-endian)
76
7712	long	0x00042253	Berkeley DB
78>16	long	>0		(Queue, version %d, native byte-order)
7912	belong	0x00042253	Berkeley DB
80>16	belong	>0		(Queue, version %d, big-endian)
8112	lelong	0x00042253	Berkeley DB
82>16	lelong	>0		(Queue, version %d, little-endian)
83
84# From Max Bowsher.
8512	long	0x00040988	Berkeley DB
86>16	long	>0		(Log, version %d, native byte-order)
8712	belong	0x00040988	Berkeley DB
88>16	belong	>0		(Log, version %d, big-endian)
8912	lelong	0x00040988	Berkeley DB
90>16	lelong	>0		(Log, version %d, little-endian)
91
92#
93#
94# Round Robin Database Tool by Tobias Oetiker <oetiker@ee.ethz.ch>
950	string/b	RRD\0		RRDTool DB
96>4	string/b	x		version %s
97
98>>10	short		!0		16bit aligned
99>>>10	bedouble	8.642135e+130	big-endian
100>>>>18	short		x		32bit long (m68k)
101
102>>10	short		0
103>>>12	long		!0		32bit aligned
104>>>>12	bedouble	8.642135e+130	big-endian
105>>>>>20 long		0		64bit long
106>>>>>20 long		!0		32bit long
107>>>>12	ledouble	8.642135e+130	little-endian
108>>>>>24 long		0		64bit long
109>>>>>24 long		!0		32bit long (i386)
110>>>>12	string		\x43\x2b\x1f\x5b\x2f\x25\xc0\xc7	middle-endian
111>>>>>24 short		!0		32bit long (arm)
112
113>>8	quad		0		64bit aligned
114>>>16	bedouble	8.642135e+130	big-endian
115>>>>24	long		0		64bit long (s390x)
116>>>>24	long		!0		32bit long (hppa/mips/ppc/s390/SPARC)
117>>>16	ledouble	8.642135e+130	little-endian
118>>>>28	long		0		64bit long (alpha/amd64/ia64)
119>>>>28	long		!0		32bit long (armel/mipsel)
120
121#----------------------------------------------------------------------
122# ROOT: file(1) magic for ROOT databases
123#
1240       string  root\0  ROOT file
125>4      belong  x       Version %d
126>33     belong  x       (Compression: %d)
127
128# XXX: Weak magic.
129# Alex Ott <ott@jet.msk.su>
130## Paradox file formats
131#2	  leshort	0x0800	Paradox
132#>0x39	  byte		3	v. 3.0
133#>0x39	  byte		4	v. 3.5
134#>0x39	  byte		9	v. 4.x
135#>0x39	  byte		10	v. 5.x
136#>0x39	  byte		11	v. 5.x
137#>0x39	  byte		12	v. 7.x
138#>>0x04	  byte		0	indexed .DB data file
139#>>0x04	  byte		1	primary index .PX file
140#>>0x04	  byte		2	non-indexed .DB data file
141#>>0x04	  byte		3	non-incrementing secondary index .Xnn file
142#>>0x04	  byte		4	secondary index .Ynn file
143#>>0x04	  byte		5	incrementing secondary index .Xnn file
144#>>0x04	  byte		6	non-incrementing secondary index .XGn file
145#>>0x04	  byte		7	secondary index .YGn file
146#>>>0x04	  byte		8	incrementing secondary index .XGn file
147
148## XBase database files
149# updated by Joerg Jenderek at Feb 2013
150# https://www.dbase.com/Knowledgebase/INT/db7_file_fmt.htm
151# https://www.clicketyclick.dk/databases/xbase/format/dbf.html
152# inspect VVYYMMDD , where 1<= MM <= 12 and 1<= DD <= 31
1530	ubelong&0x0000FFFF		<0x00000C20
154!:strength +10
155# skip Infocom game Z-machine
156>2		ubyte			>0
157# skip Androids *.xml
158>>3		ubyte			>0
159>>>3		ubyte			<32
160# 1 < version VV
161>>>>0		ubyte			>1
162# skip HELP.CA3 by test for reserved byte ( NULL )
163>>>>>27		ubyte			0
164# reserved bytes not always 0 ; also found 0x3901 (T4.DBF) ,0x7101 (T5.DBF,T6.DBF)
165#>>>>>30		ubeshort     		x		30NULL?%x
166# possible production flag,tag numbers(<=0x30),tag length(<=0x20), reserved (NULL)
167>>>>>>24	ubelong&0xffFFFFff	>0x01302000
168# .DBF or .MDX
169>>>>>>24	ubelong&0xffFFFFff	<0x01302001
170# for Xbase Database file (*.DBF) reserved (NULL) for multi-user
171>>>>>>>24	ubelong&0xffFFFFff	=0
172# test for 2 reserved NULL bytes,transaction and encryption byte flag
173>>>>>>>>12	ubelong&0xFFFFfEfE	0
174# test for MDX flag
175>>>>>>>>>28	ubyte			x
176>>>>>>>>>28	ubyte&0xf8		0
177# header size >= 32
178>>>>>>>>>>8	uleshort		>31
179# skip PIC15736.PCX by test for language driver name or field name
180>>>>>>>>>>>32	ubyte			>0
181#!:mime	application/x-dbf; charset=unknown-8bit ??
182#!:mime	application/x-dbase
183>>>>>>>>>>>>0	use			xbase-type
184# database file
185>>>>>>>>>>>>28	ubyte&0x04		=0		\b DBF
186!:ext	dbf
187>>>>>>>>>>>>28	ubyte&0x04		=4		\b DataBaseContainer
188!:ext	dbc
189>>>>>>>>>>>>4	lelong			0		\b, no records
190>>>>>>>>>>>>4	lelong			>0		\b, %d record
191# plural s appended
192>>>>>>>>>>>>>4	lelong			>1		\bs
193# https://www.clicketyclick.dk/databases/xbase/format/dbf_check.html#CHECK_DBF
194# 1 <= record size <= 4000 (dBase 3,4) or 32 * KB (=0x8000)
195>>>>>>>>>>>>10	uleshort		x		* %d
196# file size = records * record size + header size
197>>>>>>>>>>>>1	ubyte			x		\b, update-date
198>>>>>>>>>>>>1	use			xbase-date
199# https://msdn.microsoft.com/de-de/library/cc483186(v=vs.71).aspx
200#>>>>>>>>>>>>29	ubyte			=0		\b, codepage ID=%#x
201# 2~cp850 , 3~cp1252 , 0x1b~?? ; what code page is 0x1b ?
202>>>>>>>>>>>>29	ubyte			>0		\b, codepage ID=%#x
203#>>>>>>>>>>>>28	ubyte&0x01		0		\b, no index file
204# MDX or CDX index
205>>>>>>>>>>>>28	ubyte&0x01		1		\b, with index file .MDX
206>>>>>>>>>>>>28	ubyte&0x02		2		\b, with memo .FPT
207#>>>>>>>>>>>>28	ubyte&0x04		4		\b, DataBaseContainer
208# 1st record offset + 1 = header size
209>>>>>>>>>>>>8	uleshort		>0
210>>>>>>>>>>>>(8.s+1)	ubyte		>0
211>>>>>>>>>>>>>8		uleshort	>0		\b, at offset %d
212>>>>>>>>>>>>>(8.s+1)	ubyte		>0
213>>>>>>>>>>>>>>&-1	string		>\0		1st record "%s"
214# for multiple index files (*.MDX) Production flag,tag numbers(<=0x30),tag length(<=0x20), reserved (NULL)
215>>>>>>>24	ubelong&0x0133f7ff	>0
216# test for reserved NULL byte
217>>>>>>>>47	ubyte			0
218# test for valid TAG key format (0x10 or 0)
219>>>>>>>>>559	ubyte&0xeF		0
220# test MM <= 12
221>>>>>>>>>>45	ubeshort		<0x0C20
222>>>>>>>>>>>45	ubyte			>0
223>>>>>>>>>>>>46	ubyte			<32
224>>>>>>>>>>>>>46	ubyte			>0
225#!:mime	application/x-mdx
226>>>>>>>>>>>>>>0		use		xbase-type
227>>>>>>>>>>>>>>0		ubyte		x		\b MDX
228>>>>>>>>>>>>>>1		ubyte		x		\b, creation-date
229>>>>>>>>>>>>>>1		use		xbase-date
230>>>>>>>>>>>>>>44	ubyte		x		\b, update-date
231>>>>>>>>>>>>>>44	use		xbase-date
232# No.of tags in use (1,2,5,12)
233>>>>>>>>>>>>>>28	uleshort	x		\b, %d
234# No. of entries in tag (0x30)
235>>>>>>>>>>>>>>25	ubyte		x		\b/%d tags
236#  Length of tag
237>>>>>>>>>>>>>>26	ubyte		x		* %d
238# 1st tag name_
239>>>>>>>>>>>>>548	string		x		\b, 1st tag "%.11s"
240# 2nd tag name
241#>>>>>>>>>>>>(26.b+548)	string		x		\b, 2nd tag "%.11s"
242#
243#		Print the xBase names of different version variants
2440	name				xbase-type
245>0	ubyte		<2
246# 1 < version
247>0	ubyte		>1
248>>0	ubyte		0x02		FoxBase
249!:mime	application/x-dbf
250# like: ACCESS.DBF USER.DBF dbase3date.dbf mitarbei.dbf produkte.dbf umlaut-test-v2.dbf
251# FoxBase+/dBaseIII+, no memo
252>>0	ubyte		0x03		FoxBase+/dBase III
253!:mime	application/x-dbf
254# like: 92DATA.DBF MSCATLOG.DBF SYLLABI2.DBF SYLLABUS.DBF T4.DBF Teleadr.dbf us_city.dbf
255# dBASE IV no memo file
256>>0	ubyte		0x04		dBase IV
257!:mime	application/x-dbf
258# like: Quattro-test11.dbf umlaut-test-v4.dbf
259# dBASE V no memo file
260>>0	ubyte		0x05		dBase V
261!:mime	application/x-dbf
262# like: dbase4double.dbf Quattro-test2.dbf umlaut-test7.dbf
263!:ext	dbf
264# probably Apollo Database Server 9.7? xBase (0x6)
265>>0	ubyte		0x06		Apollo
266!:mime	application/x-dbf
267# like: ALIAS.DBF CRYPT.DBF PROCS.DBF USERS.DBF
268# https://docs.microsoft.com/en-us/previous-versions/visualstudio/foxpro/st4a0s68(v=vs.80)
269>>0	ubyte		0x2F		FoxBase+/Dbase III plus, no memo
270!:mime	application/x-dbf
271# no example
272>>0	ubyte		0x30		Visual FoxPro
273!:mime	application/x-dbf
274# like: 26FRX.DBF 30DBC.DBF 30DBCPRO.DBF BEHINDSC.DBF USER_LEV.DBF
275# Microsoft Visual FoxPro Database Container File like: FOXPRO-DB-TEST.DBC TESTDATA.DBC TASTRADE.DBC
276>>0	ubyte		0x31		Visual FoxPro, autoincrement
277!:mime	application/x-dbf
278# like: AI_Table.DBF dbase_31.dbf w_cityFoxpro.dbf
279# Visual FoxPro, with field type Varchar or Varbinary
280>>0	ubyte		0x32		Visual FoxPro, with field type Varchar
281!:mime	application/x-dbf
282# like: dbase_32.dbf
283# dBASE IV SQL, no memo;dbv memo var size (Flagship)
284>>0	ubyte		0x43		dBase IV, with SQL table
285!:mime	application/x-dbf
286# like: ASSEMBLY.DBF INVENTRY.DBF STAFF.DBF
287# https://docs.microsoft.com/en-us/previous-versions/visualstudio/foxpro/st4a0s68(v=vs.80)
288>>0	ubyte		0x62		dBase IV, with SQL table
289#!:mime	application/x-dbf
290# no example
291# dBASE IV, with memo!!
292>>0	ubyte		0x7b		dBase IV, with memo
293!:mime	application/x-dbf
294# like: test3memo.DBF dbase5.DBF
295# https://docs.microsoft.com/en-us/previous-versions/visualstudio/foxpro/st4a0s68(v=vs.80)
296>>0	ubyte		0x82		dBase IV, with SQL system
297#!:mime	application/x-dbf
298# no example
299# FoxBase+/dBaseIII+ with memo .DBT!
300>>0	ubyte		0x83		FoxBase+/dBase III, with memo .DBT
301!:mime	application/x-dbf
302# like: T2.DBF t3.DBF biblio.dbf dbase_83.dbf dbase3dbt0_4.dbf fsadress.dbf stop.dbf
303# VISUAL OBJECTS (first 1.0 versions) for the Dbase III files (NTX clipper driver); memo file
304>>0	ubyte		0x87		VISUAL OBJECTS, with memo file
305!:mime	application/x-dbf
306# like: ACCESS.DBF dbase3date.dbf dbase3float.dbf holdings.dbf mitarbei.dbf
307# https://docs.microsoft.com/en-us/previous-versions/visualstudio/foxpro/st4a0s68(v=vs.80)
308>>0	ubyte		0x8A		FoxBase+/dBase III, with memo .DBT
309#!:mime	application/x-dbf
310# no example
311# dBASE IV with memo!
312>>0	ubyte		0x8B		dBase IV, with memo .DBT
313!:mime	application/x-dbf
314# like: animals.dbf archive.dbf callin.dbf dbase_8b.dbf phnebook.dbf t6.dbf
315# dBase IV with SQL Table,no memo?
316>>0	ubyte		0x8E		dBase IV, with SQL table
317!:mime	application/x-dbf
318# like: dbase5.DBF test3memo.DBF test-memo.DBF
319# .dbv and .dbt memo (Flagship)?
320>>0	ubyte		0xB3		Flagship
321!:mime	application/x-dbf
322# no example
323# https://docs.microsoft.com/en-us/previous-versions/visualstudio/foxpro/st4a0s68(v=vs.80)
324>>0	ubyte		0xCA		dBase IV with memo .DBT
325#!:mime	application/x-dbf
326# no example
327# dBASE IV with SQL table, with memo .DBT
328>>0	ubyte		0xCB		dBase IV with SQL table, with memo .DBT
329!:mime	application/x-dbf
330# like: dbase5.DBF test3memo.DBF test-memo.DBF
331# HiPer-Six format;Clipper SIX, with SMT memo file
332>>0	ubyte		0xE5		Clipper SIX with memo
333!:mime	application/x-dbf
334# like: dbase5.DBF test3memo.DBF test-memo.DBF testClipper.dbf DATA.DBF
335# https://docs.microsoft.com/en-us/previous-versions/visualstudio/foxpro/st4a0s68(v=vs.80)
336>>0	ubyte		0xF4		dBase IV, with SQL table, with memo
337#!:mime	application/x-dbf
338# no example
339>>0	ubyte		0xF5		FoxPro with memo
340!:mime	application/x-dbf
341# like: CUSTOMER.DBF FOXUSER1.DBF Invoice.DBF NG.DBF OBJSAMP.DBF dbase_f5.dbf kunde.dbf
342# probably Apollo Database Server 9.7 with SQL and memo mask? xBase (0xF6)
343>>0	ubyte		0xF6		Apollo, with SQL table with memo
344!:mime	application/x-dbf
345# like: SCRIPTS.DBF
346# https://docs.microsoft.com/en-us/previous-versions/visualstudio/foxpro/st4a0s68(v=vs.80)
347#>>0	ubyte		0xFA		FoxPro 2.x, with memo
348#!:mime	application/x-dbf
349# no example
350# unknown version (should not happen)
351>>0	default		x		xBase
352!:mime	application/x-dbf
353>>>0	ubyte		x		(%#x)
354# flags in version byte
355# DBT flag (with dBASE III memo .DBT)!!
356# >>0	ubyte&0x80	>0		DBT_FLAG=%x
357# memo flag ??
358# >>0	ubyte&0x08	>0		MEMO_FLAG=%x
359# SQL flag ??
360# >>0	ubyte&0x70	>0		SQL_FLAG=%x
361#		test and print the date of xBase .DBF .MDX
3620	name				xbase-date
363# inspect YYMMDD , where 1<= MM <= 12 and 1<= DD <= 31
364>0	ubelong		x
365>1	ubyte		<13
366>>1	ubyte		>0
367>>>2	ubyte		>0
368>>>>2	ubyte		<32
369>>>>>0	ubyte		x
370# YY is interpreted as 20YY or 19YY
371>>>>>>0	ubyte		<100		\b %.2d
372# YY is interpreted 1900+YY; TODO: display yy or 20yy instead 1YY
373>>>>>>0	ubyte		>99		\b %d
374>>>>>1	ubyte		x		\b-%d
375>>>>>2	ubyte		x		\b-%d
376
377#	dBase memo files .DBT or .FPT
378# https://msdn.microsoft.com/en-us/library/8599s21w(v=vs.80).aspx
37916		ubyte		<4
380>16		ubyte		!2
381>>16		ubyte		!1
382# next free block index is positive
383>>>0		ulelong		>0
384# skip many JPG. ZIP, BZ2 by test for reserved bytes NULL , 0|2 , 0|1 , low byte of block size
385>>>>17		ubelong&0xFFfdFEff	0x00000000
386# skip many RAR by test for low byte 0 ,high byte 0|2|even of block size, 0|a|e|d7 , 0|64h
387>>>>>20		ubelong&0xFF01209B	0x00000000
388# dBASE III
389>>>>>>16	ubyte		3
390# dBASE III DBT
391>>>>>>>0	use		dbase3-memo-print
392# dBASE III DBT without version, dBASE IV DBT , FoxPro FPT , or many ZIP , DBF garbage
393>>>>>>16	ubyte		0
394# unusual dBASE III DBT like angest.dbt, dBASE IV DBT with block size 0 , FoxPro FPT ,  or garbage PCX DBF
395>>>>>>>20	uleshort	0
396# FoxPro FPT , unusual dBASE III DBT like biblio.dbt or garbage
397>>>>>>>>8	ulong		=0
398>>>>>>>>>6	ubeshort	>0
399# skip emacs.PIF
400>>>>>>>>>>4	ushort		0
401# check for valid FoxPro field type
402>>>>>>>>>>>512	ubelong		<3
403# skip LXMDCLN4.OUT LXMDCLN6.OUT LXMDALG6.OUT with invalid blocksize 170=AAh
404>>>>>>>>>>>>6	ubeshort&0x002f	0
405>>>>>>>>>>>>>0	use		foxpro-memo-print
406# dBASE III DBT , garbage
407# skip WORD1XW.DOC with improbably high free block index
408>>>>>>>>>0	ulelong		<0x400000
409# skip WinStore.App.exe by looking for printable 2nd character of 1st memo item
410>>>>>>>>>>513	ubyte		>037
411# skip DOS executables CPQ0TD.DRV E30ODI.COM IBM0MONO.DRV by looking for printable 1st character of 1st memo item
412>>>>>>>>>>>512	ubyte		>037
413# unusual dBASE III DBT like adressen.dbt
414>>>>>>>>>>>>0	use		dbase3-memo-print
415# dBASE III DBT like angest.dbt, or garbage PCX DBF
416>>>>>>>>8	ubelong		!0
417# skip PCX and some DBF by test for for reserved NULL bytes
418>>>>>>>>>510	ubeshort	0
419# skip bad symples with improbably high free block index above 2 GiB file limit
420>>>>>>>>>>0	ulelong		<0x400000
421# skip AI070GEP.EPS by printable 1st character of 1st memo item
422>>>>>>>>>>>512	ubyte		>037
423# skip some Microsoft Visual C, OMF library like: BZ2.LIB WATTCPWL.LIB ZLIB.LIB
424>>>>>>>>>>>>512	ubyte		<0200
425# skip gluon-ffhat-1.0-tp-link-tl-wr1043n-nd-v2-sysupgrade.bin by printable 2nd character
426>>>>>>>>>>>>>513 ubyte		>037
427>>>>>>>>>>>>>>0	use		dbase3-memo-print
428# dBASE IV DBT with positive block size
429>>>>>>>20	uleshort	>0
430# dBASE IV DBT with valid block length like 512, 1024
431# multiple of 2 in between 16 and 16 K ,implies upper and lower bits are zero
432# skip also 3600h 3E00h size
433>>>>>>>>20	uleshort&0xE00f	0
434>>>>>>>>>0	use		dbase4-memo-print
435
436#		Print the information of dBase III DBT memo file
4370	name				dbase3-memo-print
438>0	ubyte			x		dBase III DBT
439!:mime	application/x-dbt
440!:ext	dbt
441# instead 3 as version number 0 for unusual examples like biblio.dbt
442>16	ubyte			!3		\b, version number %u
443# Number of next available block for appending data
444#>0	lelong			=0		\b, next free block index %u
445>0	lelong			!0		\b, next free block index %u
446# no positive block length
447#>20	uleshort		=0		\b, block length %u
448>20	uleshort		!0		\b, block length %u
449# dBase III memo field terminated by \032\032
450# like: "WHAT IS XBASE" test.dbt "Borges, Malte" biblio.dbt "First memo\032\032" T2.DBT
451>512	string			>\0		\b, 1st item "%s"
452# For DEBUGGING
453#>512	ubelong			x		\b, 1ST item %#8.8x
454# https://www.clicketyclick.dk/databases/xbase/format/dbt.html
455#		Print the information of dBase IV DBT memo file
4560	name				dbase4-memo-print
457>0		lelong		x		dBase IV DBT
458!:mime	application/x-dbt
459!:ext dbt
460# 8 character shorted main name of corresponding dBASE IV DBF file
461>8		ubelong		>0x20000000
462# skip unusual like for angest.dbt
463>>20		uleshort	>0
464>>>8		string		>\0		\b of %-.8s.DBF
465# value 0 implies 512 as size
466#>4		ulelong		=0		\b, blocks size %u
467# size of blocks not reliable like 0x2020204C in angest.dbt
468>4		ulelong		!0
469>>4		ulelong&0x0000003f	0	\b, blocks size %u
470# dBase IV DBT with positive block length (found 512 , 1024)
471>20		uleshort	>0		\b, block length %u
472# next available block
473#>0		lelong		=0		\b, next free block index %u
474>0		lelong		!0		\b, next free block index %u
475>20		uleshort	>0
476>>(20.s)	ubelong		x
477>>>&-4		use		dbase4-memofield-print
478# unusual dBase IV DBT without block length (implies 512 as length)
479>20		uleshort	=0
480>>512		ubelong		x
481>>>&-4		use				dbase4-memofield-print
482#		Print the information of dBase IV memo field
4830	name			dbase4-memofield-print
484# free dBase IV memo field
485>0		ubelong		!0xFFFF0800
486>>0		lelong		x		\b, next free block %u
487>>4		lelong		x		\b, next used block %u
488# used dBase IV memo field
489>0		ubelong		=0xFFFF0800
490# length of memo field
491>>4		lelong		x		\b, field length %d
492>>>8		string		>\0		\b, 1st used item "%s"
493# http://www.dbfree.org/webdocs/1-documentation/0018-developers_stuff_(advanced)/os_related_stuff/xbase_file_format.htm
494#		Print the information of FoxPro FPT memo file
4950	name				foxpro-memo-print
496>0		belong		x		FoxPro FPT
497!:mime	application/x-fpt
498!:ext	fpt
499# Size of blocks for FoxPro ( 64,256 ); probably a multiple of two
500>6		ubeshort	x		\b, blocks size %u
501# next available block
502#>0		belong		=0		\b, next free block index %u
503>0		belong		!0		\b, next free block index %u
504# field type ( 0~picture, 1~memo, 2~object )
505>512		ubelong		<3		\b, field type %u
506# length of memo field
507>512		ubelong		1
508>>516		belong		>0		\b, field length %d
509>>>520		string		>\0		\b, 1st item "%s"
510
511# Summary:	DBASE Compound Index file *.CDX and FoxPro index *.IDX
512# From:		Joerg Jenderek
513# URL:		https://www.clicketyclick.dk/databases/xbase/format/cdx.html
514#		https://www.clicketyclick.dk/databases/xbase/format/idx.html
515#		https://www.clicketyclick.dk/databases/xbase/format/idx_comp.html
516# Reference:	https://mark0.net/download/triddefs_xml.7z/defs/s/sybase-ianywhere-cdx.trid.xml
517#		https://mark0.net/download/triddefs_xml.7z/defs/c/cdx-vfp7.trid.xml
518# like: kunde.cdx
5190	ulelong		0x1C00
520>0	use			xbase-index
521# like: SYLLABI2.CDX SYLLABUS.CDX
5220	ulelong		0x0800
523>0	use			xbase-index
524# often in xBase index pointer to root node 400h
5250	ulelong		0x0400
526# skip most Maple help database *.hdb with version tag handled by ./maple
527>1028	string		!version
528# skip Maple help database hsum.hdb checking for valid reserved area
529>>492	quad		=0
530# skip remaining Maple help database *.hdb by checking key length
531#>>>12	uleshort	!0x000F			KEY_LENGTHVALID
532>>>0	use			xbase-index
533#	display information about dBase/FoxPro index
5340	name			xbase-index
535>0	ulelong		x			xBase
536!:mime	application/x-dbase-index
537>14	ubyte		&0x40			compound index
538# DCX for FoxPro database index like: TESTDATA.DCX
539!:ext	cdx/dcx
540>14	ubyte		^0x40			index
541# only 1 example like: TEST.IDX
542!:ext	idx
543# pointer to root node like: 1C00h 800h often 400h
544>0	ulelong		!0x400			\b, root pointer %#x
545# Pointer to free node list: often 0 but -1 if not present
546>4	ulelong		!0			\b, free node pointer %#x
547# MAYBE number of pages in file (Foxbase, FoxPro 1.x) or
548# http://www.foxpert.com/foxpro/knowlbits/files/knowlbits_200708_1.HTM
549# Whenever Visual FoxPro updates the index file it increments this reserved field
550# Reserved for internal use like: 02000000h 03000000h 460c0000h 780f0000h 89000000h 9fdc0100h often 0
551>8	ulelong		!0			\b, reserved counter %#x
552# length of key like: mostly 000Ah 0028h (TEST.IDX)
553>12	uleshort	!0x000A			\b, key length %#x
554# index options like: 24h E0h E8h
555# 1~a unique index 8~index has FOR clause 32~compact index format 64~compound index header
556# 16~Bit vector (SoftC) 128~Structure index (FoxPro)
557>14	ubyte		x			\b, index options (%#x
558>14	ubyte		&0x01			\b, unique
559>14	ubyte		&0x08			\b, has FOR clause
560>14	ubyte		&0x10			\b, bit vector (SoftC)
561>14	ubyte		&0x20			\b, compact format
562#>14	ubyte		&0x40			\b, compound header
563>14	ubyte		&0x80			\b, structure
564>14	ubyte		x			\b)
565# WHAT EXACTLY IS THAT? index signature like: 0 (sybase-ianywhere-cdx.trid.xml) 1 (cdx-vfp7.trid.xml)
566>15	ubyte		!0			\b, index signature %u
567# reserved area (0-bytes) til about 500, but not for uncompressed Index files *.idx
568>16	quad		!0			\b, at 16 reserved %#llx
569>492	quad		!0			\b, at 492 reserved %#llx
570# for IDX variant
571#>14	ubyte		^0x40			IDX
572# for CDX variant
573>14	ubyte		&0x40
574# Ascending or descending: 0~ascending 1~descending
575>>502	uleshort	x			\b, sort order %u
576# Total expression length (FoxPro 2) like: 0 1
577>>504	uleshort	!0			\b, expression length %u
578# FOR expression pool length like: 1
579>>506	uleshort	!1			\b, FOR expression pool length %#x
580# reserved for internal use like: 0
581>>508	uleshort	!0			\b, at 0x508 reserved %#x
582# Key expression pool length like: 1
583>>510	uleshort	!1			\b, key expression pool length %#x
584# 512 - 1023 Key & FOR expression pool (uncompiled)
585>>512	quad		!0			\b, key expression pool %#llx
586#>>520	quad		!0			\b, key expression pool %#llx
587
588# Summary:	dBASE IV Printer Form *.PRF
589# From:		Joerg Jenderek
590# URL:		https://en.wikipedia.org/wiki/.dbf#Other_file_types_found_in_dBASE
591# Reference:	https://mark0.net/download/triddefs_xml.7z/defs/p/prf-dbase.trid.xml
5920	ubeshort	0x0400
593# skip some Xbase Index files *.ndx and Infocom (Z-machine 4) *.z4 handled by ./adventure
594# by looking for valid printer driver name extension
595>0x58	search/8	.PR2
596>>0	use			xbase-prf
597#	display information of dbase print form like printer driver *.PR2
5980	name			xbase-prf	dBase Printer Form
599!:mime	application/x-dbase-prf
600!:ext	prf
601# MAYBE version? like: 4~DBASE IV
602#>0	ubyte		x			\b, version %u
603# MAYBE flag like: 1~with output file name 0~not
604#>2	ubyte		!0			\b, flag %u
605# optional printer text output file name like E:\DBASE\IV\T6.txt
606>3	string		>\0			\b, output file %s
607# probably padding with nils til 0x53
608#>0x48	 uquad		!0			\b, at 0x48 padding %#llx
609# dBASE IV printer driver name like: Generic.PR2 ASCII.PR2
610>0x56	string		>\0			\b, using printer driver %s
611# 2 is probably last character of previous dBASE printer driver name
612#>0x60	ubyte		!0x32			\b, at 0x60 %#x
613# probably padding with nils til 0xa8
614#>0x61	uquad		!0			\b, at 0x61 padding %#llx
615# unknown 0x03020300 0x03020100 at 0xa8
616>0xa8	ubelong 	x			\b, at 0xa8 unknown %#8.8x
617# probably padding with nils til 0x2aa
618#>0x2a0	uquad		!0			\b, at 0x2a0 padding %#llx
619# unknown 0x100ff7f01000001 at 0x2AB
620>0x2ab	ubequad		!0x100ff7f01000001	\b, at 0x2ab unknown %#llx
621# unknown 0x0042 at 0x2b3
622>0x2b3	ubeshort 	!0x0042			\b, at 0x2b3 unknown %#4.4x
623# unknown last 4 bytes at 0x2b6 like: 0 0x23
624>0x2b6	ubelong		!0			\b, at 0x2b6 unknown %#8.8x
625
626# TODO:
627# DBASE index file *.NDX
628# dBASE compiled Format *.FMO
629# FoxPro Database memo file *.DCT
630# FoxPro Forms Memo *.SCT
631# FoxPro Generated Menu Program *.MPR
632# FoxPro Report *.FRX
633# FoxPro Report Memo *.FRT
634# Foxpro Generated Screen Program *.SPR
635# Foxpro memo *.PJT
636## End of XBase database stuff
637
638# MS Access database
6394	string	Standard\ Jet\ DB	Microsoft Access Database
640!:mime	application/x-msaccess
6414	string	Standard\ ACE\ DB	Microsoft Access Database
642!:mime	application/x-msaccess
643
644# From: Joerg Jenderek
645# URL: http://fileformats.archiveteam.org/wiki/Extensible_Storage_Engine
646# Reference: https://github.com/libyal/libesedb/archive/master.zip
647#	libesedb-master/documentation/
648#	Extensible Storage Engine (ESE) Database File (EDB) format.asciidoc
649# Note: also known as "JET Blue". Used by numerous Windows components such as
650# Windows Search, Mail, Exchange and Active Directory.
6514	ubelong		0xefcdab89
652# unknown1
653>132	ubelong		0		Extensible storage engine
654!:mime	application/x-ms-ese
655# file_type 0~database 1~stream
656>>12	ulelong		0		DataBase
657# Security DataBase (sdb)
658!:ext	edb/sdb
659>>12	ulelong		1		STreaMing
660!:ext	stm
661# format_version 620h
662>>8	uleshort	x		\b, version %#x
663>>10	uleshort	>0		revision %#4.4x
664>>0	ubelong		x	 	\b, checksum %#8.8x
665# Page size 4096 8192 32768
666>>236	ulequad		x		\b, page size %lld
667# database_state
668>>52	ulelong		1		\b, JustCreated
669>>52	ulelong		2		\b, DirtyShutdown
670#>>52	ulelong		3		\b, CleanShutdown
671>>52	ulelong		4		\b, BeingConverted
672>>52	ulelong		5		\b, ForceDetach
673# Windows NT major version when the databases indexes were updated.
674>>216	ulelong		x		\b, Windows version %d
675# Windows NT minor version
676>>220	ulelong		x		\b.%d
677
678# From: Joerg Jenderek
679# URL: https://forensicswiki.org/wiki/Windows_Application_Compatibility
680# Note: files contain application compatibility fixes, application compatibility modes and application help messages.
6818	string		sdbf
682>7	ubyte		0
683# TAG_TYPE_LIST+TAG_INDEXES
684>>12	uleshort	0x7802		Windows application compatibility Shim DataBase
685# version? 2 3
686#>>>0	ulelong		x		\b, version %d
687!:mime	application/x-ms-sdb
688!:ext	sdb
689
690# TDB database from Samba et al - Martin Pool <mbp@samba.org>
6910	string	TDB\ file		TDB database
692>32	lelong	0x2601196D		version 6, little-endian
693>>36	lelong	x			hash size %d bytes
694
695# SE Linux policy database
6960       lelong  0xf97cff8c      SE Linux policy
697>16     lelong  x               v%d
698>20     lelong  1      MLS
699>24     lelong  x       %d symbols
700>28     lelong  x       %d ocons
701
702# ICE authority file data (Wolfram Kleff)
7032	string		ICE		ICE authority data
704
705# X11 Xauthority file (Wolfram Kleff)
70610	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
70711	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
70812	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
70913	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
71014	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
71115	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
71216	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
71317	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
71418	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
715
716# From: Maxime Henrion <mux@FreeBSD.org>
717# PostgreSQL's custom dump format, Maxime Henrion <mux@FreeBSD.org>
7180	string		PGDMP		PostgreSQL custom database dump
719>5	byte		x		- v%d
720>6	byte		x		\b.%d
721>5	beshort		<0x101		\b-0
722>5	beshort		>0x100
723>>7	byte		x		\b-%d
724
725# Type: Advanced Data Format (ADF) database
726# URL:  https://www.grc.nasa.gov/WWW/cgns/adf/
727# From: Nicolas Chauvat <nicolas.chauvat@logilab.fr>
7280	string	@(#)ADF\ Database	CGNS Advanced Data Format
729
730# Tokyo Cabinet magic data
731# http://tokyocabinet.sourceforge.net/index.html
7320	string		ToKyO\ CaBiNeT\n	Tokyo Cabinet
733>14	string		x			\b (%s)
734>32	byte		0			\b, Hash
735!:mime	application/x-tokyocabinet-hash
736>32	byte		1			\b, B+ tree
737!:mime	application/x-tokyocabinet-btree
738>32	byte		2			\b, Fixed-length
739!:mime	application/x-tokyocabinet-fixed
740>32	byte		3			\b, Table
741!:mime	application/x-tokyocabinet-table
742>33	byte		&1			\b, [open]
743>33	byte		&2			\b, [fatal]
744>34	byte		x			\b, apow=%d
745>35	byte		x			\b, fpow=%d
746>36	byte		&0x01			\b, [large]
747>36	byte		&0x02			\b, [deflate]
748>36	byte		&0x04			\b, [bzip]
749>36	byte		&0x08			\b, [tcbs]
750>36	byte		&0x10			\b, [excodec]
751>40	lequad		x			\b, bnum=%lld
752>48	lequad		x			\b, rnum=%lld
753>56	lequad		x			\b, fsiz=%lld
754
755# Type:	QDBM Quick Database Manager
756# From:	Benoit Sibaud <bsibaud@april.org>
7570	string		\\[depot\\]\n\f		Quick Database Manager, little endian
7580	string		\\[DEPOT\\]\n\f		Quick Database Manager, big endian
759
760# Type:	TokyoCabinet database
761# URL:	http://tokyocabinet.sourceforge.net/
762# From:	Benoit Sibaud <bsibaud@april.org>
7630	string		ToKyO\ CaBiNeT\n	TokyoCabinet database
764>14	string		x			(version %s)
765
766# From:  Stephane Blondon https://www.yaal.fr
767# Database file for Zope (done by FileStorage)
7680	string	FS21	Zope Object Database File Storage v3 (data)
7690	string	FS30	Zope Object Database File Storage v4 (data)
770
771# Cache file for the database of Zope (done by ClientStorage)
7720	string		ZEC3	Zope Object Database Client Cache File (data)
773
774# IDA (Interactive Disassembler) database
7750	string		IDA1	IDA (Interactive Disassembler) database
776
777# Hopper (reverse engineering tool) https://www.hopperapp.com/
7780	string		hopperdb	Hopper database
779
780# URL: https://en.wikipedia.org/wiki/Panorama_(database_engine)
781# Reference: http://www.provue.com/Panorama/
782# From: Joerg Jenderek
783# NOTE: test only versions 4 and 6.0 with Windows
784# length of Panorama database name
7855	ubyte				>0
786# look after database name for "some" null bits
787>(5.B+7)	ubelong&0xF3ffF000	0
788# look for first keyword
789>>&1		search/2		DESIGN		Panorama database
790#!:mime	application/x-panorama-database
791!:apple	KASXZEPD
792!:ext	pan
793# database name
794>>>5	pstring				x		\b, "%s"
795
796#
797#
798# askSam Database by Stefan A. Haubenthal <polluks@web.de>
7990	string	askw40\0	askSam DB
800
801#
802#
803# MUIbase Database Tool by Stefan A. Haubenthal <polluks@web.de>
8040	string	MBSTV\040	MUIbase DB
805>6	string	x		version %s
806
807#
808# CDB database
8090	string	NBCDB\012	NetBSD Constant Database
810>7	byte	x		\b, version %d
811>8	string	x		\b, for '%s'
812>24	lelong	x		\b, datasize %d
813>28	lelong	x		\b, entries %d
814>32	lelong	x		\b, index %d
815>36	lelong	x		\b, seed %#x
816
817#
818# Redis RDB - https://redis.io/topics/persistence
8190	string	REDIS			Redis RDB file,
820>5	regex	[0-9][0-9][0-9][0-9]	version %s
821
822# Mork database.
823# Used by older versions of Mozilla Suite and Firefox,
824# and current versions of Thunderbird.
825# From: David Korth <gerbilsoft@gerbilsoft.com>
8260	string	//\ <!--\ <mdb:mork:z\ v="	Mozilla Mork database
827>23	string	x		\b, version %.3s
828
829# URL:		https://en.wikipedia.org/wiki/Management_Information_Format
830# Reference:	https://www.dmtf.org/sites/default/files/standards/documents/DSP0005.pdf
831# From:		Joerg Jenderek
832# Note:		only tested with monitor asset reports of Dell Display Manager
833#		skip start like Language=fr|CA|iso8859-1
8340	search/27/C	Start\040Component	DMI Management Information Format
835#!:mime	text/plain
836!:mime	text/x-dmtf-mif
837!:ext	mif
838
839