xref: /freebsd/contrib/file/magic/Magdir/database (revision 898496ee09ed2b7d25f6807edc4515628196ec0a)
1b6cee71dSXin LI
2b6cee71dSXin LI#------------------------------------------------------------------------------
3*898496eeSXin LI# $File: database,v 1.69 2023/01/12 00:14:04 christos Exp $
4b6cee71dSXin LI# database:  file(1) magic for various databases
5b6cee71dSXin LI#
6b6cee71dSXin LI# extracted from header/code files by Graeme Wilford (eep2gw@ee.surrey.ac.uk)
7b6cee71dSXin LI#
8b6cee71dSXin LI#
9b6cee71dSXin LI# GDBM magic numbers
10b6cee71dSXin LI#  Will be maintained as part of the GDBM distribution in the future.
11b6cee71dSXin LI#  <downsj@teeny.org>
12c2931133SXin LI0	belong	0x13579acd	GNU dbm 1.x or ndbm database, big endian, 32-bit
13b6cee71dSXin LI!:mime	application/x-gdbm
14c2931133SXin LI0	belong	0x13579ace	GNU dbm 1.x or ndbm database, big endian, old
15c2931133SXin LI!:mime	application/x-gdbm
16c2931133SXin LI0	belong	0x13579acf	GNU dbm 1.x or ndbm database, big endian, 64-bit
17c2931133SXin LI!:mime	application/x-gdbm
18c2931133SXin LI0	lelong	0x13579acd	GNU dbm 1.x or ndbm database, little endian, 32-bit
19c2931133SXin LI!:mime	application/x-gdbm
20c2931133SXin LI0	lelong	0x13579ace	GNU dbm 1.x or ndbm database, little endian, old
21c2931133SXin LI!:mime	application/x-gdbm
22c2931133SXin LI0	lelong	0x13579acf	GNU dbm 1.x or ndbm database, little endian, 64-bit
23b6cee71dSXin LI!:mime	application/x-gdbm
24b6cee71dSXin LI0	string	GDBM		GNU dbm 2.x database
25b6cee71dSXin LI!:mime	application/x-gdbm
26b6cee71dSXin LI#
27b6cee71dSXin LI# Berkeley DB
28b6cee71dSXin LI#
29b6cee71dSXin LI# Ian Darwin's file /etc/magic files: big/little-endian version.
30b6cee71dSXin LI#
31b6cee71dSXin LI# Hash 1.85/1.86 databases store metadata in network byte order.
32b6cee71dSXin LI# Btree 1.85/1.86 databases store the metadata in host byte order.
33b6cee71dSXin LI# Hash and Btree 2.X and later databases store the metadata in host byte order.
34b6cee71dSXin LI
35b6cee71dSXin LI0	long	0x00061561	Berkeley DB
36b6cee71dSXin LI!:mime	application/x-dbm
37b6cee71dSXin LI>8	belong	4321
38b6cee71dSXin LI>>4	belong	>2		1.86
39b6cee71dSXin LI>>4	belong	<3		1.85
40b6cee71dSXin LI>>4	belong	>0		(Hash, version %d, native byte-order)
41b6cee71dSXin LI>8	belong	1234
42b6cee71dSXin LI>>4	belong	>2		1.86
43b6cee71dSXin LI>>4	belong	<3		1.85
44b6cee71dSXin LI>>4	belong	>0		(Hash, version %d, little-endian)
45b6cee71dSXin LI
46b6cee71dSXin LI0	belong	0x00061561	Berkeley DB
47b6cee71dSXin LI>8	belong	4321
48b6cee71dSXin LI>>4	belong	>2		1.86
49b6cee71dSXin LI>>4	belong	<3		1.85
50b6cee71dSXin LI>>4	belong	>0		(Hash, version %d, big-endian)
51b6cee71dSXin LI>8	belong	1234
52b6cee71dSXin LI>>4	belong	>2		1.86
53b6cee71dSXin LI>>4	belong	<3		1.85
54b6cee71dSXin LI>>4	belong	>0		(Hash, version %d, native byte-order)
55b6cee71dSXin LI
56b6cee71dSXin LI0	long	0x00053162	Berkeley DB 1.85/1.86
57b6cee71dSXin LI>4	long	>0		(Btree, version %d, native byte-order)
58b6cee71dSXin LI0	belong	0x00053162	Berkeley DB 1.85/1.86
59b6cee71dSXin LI>4	belong	>0		(Btree, version %d, big-endian)
60b6cee71dSXin LI0	lelong	0x00053162	Berkeley DB 1.85/1.86
61b6cee71dSXin LI>4	lelong	>0		(Btree, version %d, little-endian)
62b6cee71dSXin LI
63b6cee71dSXin LI12	long	0x00061561	Berkeley DB
64b6cee71dSXin LI>16	long	>0		(Hash, version %d, native byte-order)
65b6cee71dSXin LI12	belong	0x00061561	Berkeley DB
66b6cee71dSXin LI>16	belong	>0		(Hash, version %d, big-endian)
67b6cee71dSXin LI12	lelong	0x00061561	Berkeley DB
68b6cee71dSXin LI>16	lelong	>0		(Hash, version %d, little-endian)
69b6cee71dSXin LI
70b6cee71dSXin LI12	long	0x00053162	Berkeley DB
71b6cee71dSXin LI>16	long	>0		(Btree, version %d, native byte-order)
72b6cee71dSXin LI12	belong	0x00053162	Berkeley DB
73b6cee71dSXin LI>16	belong	>0		(Btree, version %d, big-endian)
74b6cee71dSXin LI12	lelong	0x00053162	Berkeley DB
75b6cee71dSXin LI>16	lelong	>0		(Btree, version %d, little-endian)
76b6cee71dSXin LI
77b6cee71dSXin LI12	long	0x00042253	Berkeley DB
78b6cee71dSXin LI>16	long	>0		(Queue, version %d, native byte-order)
79b6cee71dSXin LI12	belong	0x00042253	Berkeley DB
80b6cee71dSXin LI>16	belong	>0		(Queue, version %d, big-endian)
81b6cee71dSXin LI12	lelong	0x00042253	Berkeley DB
82b6cee71dSXin LI>16	lelong	>0		(Queue, version %d, little-endian)
83b6cee71dSXin LI
84b6cee71dSXin LI# From Max Bowsher.
85b6cee71dSXin LI12	long	0x00040988	Berkeley DB
86b6cee71dSXin LI>16	long	>0		(Log, version %d, native byte-order)
87b6cee71dSXin LI12	belong	0x00040988	Berkeley DB
88b6cee71dSXin LI>16	belong	>0		(Log, version %d, big-endian)
89b6cee71dSXin LI12	lelong	0x00040988	Berkeley DB
90b6cee71dSXin LI>16	lelong	>0		(Log, version %d, little-endian)
91b6cee71dSXin LI
92b6cee71dSXin LI#
93b6cee71dSXin LI#
94b6cee71dSXin LI# Round Robin Database Tool by Tobias Oetiker <oetiker@ee.ethz.ch>
95b6cee71dSXin LI0	string/b	RRD\0		RRDTool DB
96b6cee71dSXin LI>4	string/b	x		version %s
97b6cee71dSXin LI
98b6cee71dSXin LI>>10	short		!0		16bit aligned
99b6cee71dSXin LI>>>10	bedouble	8.642135e+130	big-endian
100b6cee71dSXin LI>>>>18	short		x		32bit long (m68k)
101b6cee71dSXin LI
102b6cee71dSXin LI>>10	short		0
103b6cee71dSXin LI>>>12	long		!0		32bit aligned
104b6cee71dSXin LI>>>>12	bedouble	8.642135e+130	big-endian
105b6cee71dSXin LI>>>>>20 long		0		64bit long
106b6cee71dSXin LI>>>>>20 long		!0		32bit long
107b6cee71dSXin LI>>>>12	ledouble	8.642135e+130	little-endian
108b6cee71dSXin LI>>>>>24 long		0		64bit long
109b6cee71dSXin LI>>>>>24 long		!0		32bit long (i386)
110b6cee71dSXin LI>>>>12	string		\x43\x2b\x1f\x5b\x2f\x25\xc0\xc7	middle-endian
111b6cee71dSXin LI>>>>>24 short		!0		32bit long (arm)
112b6cee71dSXin LI
113b6cee71dSXin LI>>8	quad		0		64bit aligned
114b6cee71dSXin LI>>>16	bedouble	8.642135e+130	big-endian
115b6cee71dSXin LI>>>>24	long		0		64bit long (s390x)
116b6cee71dSXin LI>>>>24	long		!0		32bit long (hppa/mips/ppc/s390/SPARC)
117b6cee71dSXin LI>>>16	ledouble	8.642135e+130	little-endian
118b6cee71dSXin LI>>>>28	long		0		64bit long (alpha/amd64/ia64)
119b6cee71dSXin LI>>>>28	long		!0		32bit long (armel/mipsel)
120b6cee71dSXin LI
121b6cee71dSXin LI#----------------------------------------------------------------------
122b6cee71dSXin LI# ROOT: file(1) magic for ROOT databases
123b6cee71dSXin LI#
124b6cee71dSXin LI0       string  root\0  ROOT file
125b6cee71dSXin LI>4      belong  x       Version %d
126b6cee71dSXin LI>33     belong  x       (Compression: %d)
127b6cee71dSXin LI
128b6cee71dSXin LI# XXX: Weak magic.
129b6cee71dSXin LI# Alex Ott <ott@jet.msk.su>
130b6cee71dSXin LI## Paradox file formats
131b6cee71dSXin LI#2	  leshort	0x0800	Paradox
132b6cee71dSXin LI#>0x39	  byte		3	v. 3.0
133b6cee71dSXin LI#>0x39	  byte		4	v. 3.5
134b6cee71dSXin LI#>0x39	  byte		9	v. 4.x
135b6cee71dSXin LI#>0x39	  byte		10	v. 5.x
136b6cee71dSXin LI#>0x39	  byte		11	v. 5.x
137b6cee71dSXin LI#>0x39	  byte		12	v. 7.x
138b6cee71dSXin LI#>>0x04	  byte		0	indexed .DB data file
139b6cee71dSXin LI#>>0x04	  byte		1	primary index .PX file
140b6cee71dSXin LI#>>0x04	  byte		2	non-indexed .DB data file
141b6cee71dSXin LI#>>0x04	  byte		3	non-incrementing secondary index .Xnn file
142b6cee71dSXin LI#>>0x04	  byte		4	secondary index .Ynn file
143b6cee71dSXin LI#>>0x04	  byte		5	incrementing secondary index .Xnn file
144b6cee71dSXin LI#>>0x04	  byte		6	non-incrementing secondary index .XGn file
145b6cee71dSXin LI#>>0x04	  byte		7	secondary index .YGn file
146b6cee71dSXin LI#>>>0x04	  byte		8	incrementing secondary index .XGn file
147b6cee71dSXin LI
148b6cee71dSXin LI## XBase database files
149b6cee71dSXin LI# updated by Joerg Jenderek at Feb 2013
15048c779cdSXin LI# https://www.dbase.com/Knowledgebase/INT/db7_file_fmt.htm
15148c779cdSXin LI# https://www.clicketyclick.dk/databases/xbase/format/dbf.html
152b6cee71dSXin LI# inspect VVYYMMDD , where 1<= MM <= 12 and 1<= DD <= 31
153b6cee71dSXin LI0	ubelong&0x0000FFFF		<0x00000C20
154a4d6d3b8SXin LI!:strength +10
155b6cee71dSXin LI# skip Infocom game Z-machine
156b6cee71dSXin LI>2		ubyte			>0
157b6cee71dSXin LI# skip Androids *.xml
158b6cee71dSXin LI>>3		ubyte			>0
159b6cee71dSXin LI>>>3		ubyte			<32
160b6cee71dSXin LI# 1 < version VV
161b6cee71dSXin LI>>>>0		ubyte			>1
162b6cee71dSXin LI# skip HELP.CA3 by test for reserved byte ( NULL )
163b6cee71dSXin LI>>>>>27		ubyte			0
164b6cee71dSXin LI# reserved bytes not always 0 ; also found 0x3901 (T4.DBF) ,0x7101 (T5.DBF,T6.DBF)
165b6cee71dSXin LI#>>>>>30		ubeshort     		x		30NULL?%x
166b6cee71dSXin LI# possible production flag,tag numbers(<=0x30),tag length(<=0x20), reserved (NULL)
167b6cee71dSXin LI>>>>>>24	ubelong&0xffFFFFff	>0x01302000
168b6cee71dSXin LI# .DBF or .MDX
169b6cee71dSXin LI>>>>>>24	ubelong&0xffFFFFff	<0x01302001
170b6cee71dSXin LI# for Xbase Database file (*.DBF) reserved (NULL) for multi-user
171b6cee71dSXin LI>>>>>>>24	ubelong&0xffFFFFff	=0
172b6cee71dSXin LI# test for 2 reserved NULL bytes,transaction and encryption byte flag
173b6cee71dSXin LI>>>>>>>>12	ubelong&0xFFFFfEfE	0
174b6cee71dSXin LI# test for MDX flag
175b6cee71dSXin LI>>>>>>>>>28	ubyte			x
176b6cee71dSXin LI>>>>>>>>>28	ubyte&0xf8		0
177b6cee71dSXin LI# header size >= 32
178b6cee71dSXin LI>>>>>>>>>>8	uleshort		>31
179b6cee71dSXin LI# skip PIC15736.PCX by test for language driver name or field name
180b6cee71dSXin LI>>>>>>>>>>>32	ubyte			>0
181b6cee71dSXin LI#!:mime	application/x-dbf; charset=unknown-8bit ??
182b6cee71dSXin LI#!:mime	application/x-dbase
183b6cee71dSXin LI>>>>>>>>>>>>0	use			xbase-type
184b6cee71dSXin LI# database file
18543a5ec4eSXin LI>>>>>>>>>>>>28	ubyte&0x04		=0		\b DBF
18643a5ec4eSXin LI!:ext	dbf
18743a5ec4eSXin LI>>>>>>>>>>>>28	ubyte&0x04		=4		\b DataBaseContainer
18843a5ec4eSXin LI!:ext	dbc
189b6cee71dSXin LI>>>>>>>>>>>>4	lelong			0		\b, no records
190b6cee71dSXin LI>>>>>>>>>>>>4	lelong			>0		\b, %d record
191b6cee71dSXin LI# plural s appended
192b6cee71dSXin LI>>>>>>>>>>>>>4	lelong			>1		\bs
19348c779cdSXin LI# https://www.clicketyclick.dk/databases/xbase/format/dbf_check.html#CHECK_DBF
194b6cee71dSXin LI# 1 <= record size <= 4000 (dBase 3,4) or 32 * KB (=0x8000)
195b6cee71dSXin LI>>>>>>>>>>>>10	uleshort		x		* %d
196b6cee71dSXin LI# file size = records * record size + header size
197b6cee71dSXin LI>>>>>>>>>>>>1	ubyte			x		\b, update-date
198b6cee71dSXin LI>>>>>>>>>>>>1	use			xbase-date
19948c779cdSXin LI# https://msdn.microsoft.com/de-de/library/cc483186(v=vs.71).aspx
20043a5ec4eSXin LI#>>>>>>>>>>>>29	ubyte			=0		\b, codepage ID=%#x
201b6cee71dSXin LI# 2~cp850 , 3~cp1252 , 0x1b~?? ; what code page is 0x1b ?
20243a5ec4eSXin LI>>>>>>>>>>>>29	ubyte			>0		\b, codepage ID=%#x
203b6cee71dSXin LI#>>>>>>>>>>>>28	ubyte&0x01		0		\b, no index file
20443a5ec4eSXin LI# MDX or CDX index
205b6cee71dSXin LI>>>>>>>>>>>>28	ubyte&0x01		1		\b, with index file .MDX
206b6cee71dSXin LI>>>>>>>>>>>>28	ubyte&0x02		2		\b, with memo .FPT
20743a5ec4eSXin LI#>>>>>>>>>>>>28	ubyte&0x04		4		\b, DataBaseContainer
208b6cee71dSXin LI# 1st record offset + 1 = header size
209b6cee71dSXin LI>>>>>>>>>>>>8	uleshort		>0
210b6cee71dSXin LI>>>>>>>>>>>>(8.s+1)	ubyte		>0
211b6cee71dSXin LI>>>>>>>>>>>>>8		uleshort	>0		\b, at offset %d
212b6cee71dSXin LI>>>>>>>>>>>>>(8.s+1)	ubyte		>0
213b6cee71dSXin LI>>>>>>>>>>>>>>&-1	string		>\0		1st record "%s"
21440427ccaSGordon Tetlow# for multiple index files (*.MDX) Production flag,tag numbers(<=0x30),tag length(<=0x20), reserved (NULL)
215b6cee71dSXin LI>>>>>>>24	ubelong&0x0133f7ff	>0
216b6cee71dSXin LI# test for reserved NULL byte
217c2931133SXin LI>>>>>>>>47	ubyte			0
218b6cee71dSXin LI# test for valid TAG key format (0x10 or 0)
219b6cee71dSXin LI>>>>>>>>>559	ubyte&0xeF		0
220b6cee71dSXin LI# test MM <= 12
221c2931133SXin LI>>>>>>>>>>45	ubeshort		<0x0C20
222c2931133SXin LI>>>>>>>>>>>45	ubyte			>0
223c2931133SXin LI>>>>>>>>>>>>46	ubyte			<32
224c2931133SXin LI>>>>>>>>>>>>>46	ubyte			>0
225b6cee71dSXin LI#!:mime	application/x-mdx
226c2931133SXin LI>>>>>>>>>>>>>>0		use		xbase-type
227c2931133SXin LI>>>>>>>>>>>>>>0		ubyte		x		\b MDX
228c2931133SXin LI>>>>>>>>>>>>>>1		ubyte		x		\b, creation-date
229c2931133SXin LI>>>>>>>>>>>>>>1		use		xbase-date
230c2931133SXin LI>>>>>>>>>>>>>>44	ubyte		x		\b, update-date
231c2931133SXin LI>>>>>>>>>>>>>>44	use		xbase-date
232b6cee71dSXin LI# No.of tags in use (1,2,5,12)
233c2931133SXin LI>>>>>>>>>>>>>>28	uleshort	x		\b, %d
234b6cee71dSXin LI# No. of entries in tag (0x30)
235c2931133SXin LI>>>>>>>>>>>>>>25	ubyte		x		\b/%d tags
236b6cee71dSXin LI#  Length of tag
237c2931133SXin LI>>>>>>>>>>>>>>26	ubyte		x		* %d
238b6cee71dSXin LI# 1st tag name_
239b6cee71dSXin LI>>>>>>>>>>>>>548	string		x		\b, 1st tag "%.11s"
240b6cee71dSXin LI# 2nd tag name
241b6cee71dSXin LI#>>>>>>>>>>>>(26.b+548)	string		x		\b, 2nd tag "%.11s"
242b6cee71dSXin LI#
243b6cee71dSXin LI#		Print the xBase names of different version variants
244b6cee71dSXin LI0	name				xbase-type
245b6cee71dSXin LI>0	ubyte		<2
246b6cee71dSXin LI# 1 < version
247b6cee71dSXin LI>0	ubyte		>1
248b6cee71dSXin LI>>0	ubyte		0x02		FoxBase
24943a5ec4eSXin LI!:mime	application/x-dbf
25043a5ec4eSXin LI# like: ACCESS.DBF USER.DBF dbase3date.dbf mitarbei.dbf produkte.dbf umlaut-test-v2.dbf
251b6cee71dSXin LI# FoxBase+/dBaseIII+, no memo
252b6cee71dSXin LI>>0	ubyte		0x03		FoxBase+/dBase III
253b6cee71dSXin LI!:mime	application/x-dbf
25443a5ec4eSXin LI# like: 92DATA.DBF MSCATLOG.DBF SYLLABI2.DBF SYLLABUS.DBF T4.DBF Teleadr.dbf us_city.dbf
255b6cee71dSXin LI# dBASE IV no memo file
256b6cee71dSXin LI>>0	ubyte		0x04		dBase IV
257b6cee71dSXin LI!:mime	application/x-dbf
25843a5ec4eSXin LI# like: Quattro-test11.dbf umlaut-test-v4.dbf
259b6cee71dSXin LI# dBASE V no memo file
260b6cee71dSXin LI>>0	ubyte		0x05		dBase V
261b6cee71dSXin LI!:mime	application/x-dbf
26243a5ec4eSXin LI# like: dbase4double.dbf Quattro-test2.dbf umlaut-test7.dbf
26343a5ec4eSXin LI!:ext	dbf
26443a5ec4eSXin LI# probably Apollo Database Server 9.7? xBase (0x6)
26543a5ec4eSXin LI>>0	ubyte		0x06		Apollo
26643a5ec4eSXin LI!:mime	application/x-dbf
26743a5ec4eSXin LI# like: ALIAS.DBF CRYPT.DBF PROCS.DBF USERS.DBF
26843a5ec4eSXin LI# https://docs.microsoft.com/en-us/previous-versions/visualstudio/foxpro/st4a0s68(v=vs.80)
26943a5ec4eSXin LI>>0	ubyte		0x2F		FoxBase+/Dbase III plus, no memo
27043a5ec4eSXin LI!:mime	application/x-dbf
27143a5ec4eSXin LI# no example
272b6cee71dSXin LI>>0	ubyte		0x30		Visual FoxPro
273b6cee71dSXin LI!:mime	application/x-dbf
27443a5ec4eSXin LI# like: 26FRX.DBF 30DBC.DBF 30DBCPRO.DBF BEHINDSC.DBF USER_LEV.DBF
27543a5ec4eSXin LI# Microsoft Visual FoxPro Database Container File like: FOXPRO-DB-TEST.DBC TESTDATA.DBC TASTRADE.DBC
276b6cee71dSXin LI>>0	ubyte		0x31		Visual FoxPro, autoincrement
277b6cee71dSXin LI!:mime	application/x-dbf
27843a5ec4eSXin LI# like: AI_Table.DBF dbase_31.dbf w_cityFoxpro.dbf
279b6cee71dSXin LI# Visual FoxPro, with field type Varchar or Varbinary
280b6cee71dSXin LI>>0	ubyte		0x32		Visual FoxPro, with field type Varchar
281b6cee71dSXin LI!:mime	application/x-dbf
28243a5ec4eSXin LI# like: dbase_32.dbf
283b6cee71dSXin LI# dBASE IV SQL, no memo;dbv memo var size (Flagship)
284b6cee71dSXin LI>>0	ubyte		0x43		dBase IV, with SQL table
285b6cee71dSXin LI!:mime	application/x-dbf
28643a5ec4eSXin LI# like: ASSEMBLY.DBF INVENTRY.DBF STAFF.DBF
28743a5ec4eSXin LI# https://docs.microsoft.com/en-us/previous-versions/visualstudio/foxpro/st4a0s68(v=vs.80)
28843a5ec4eSXin LI>>0	ubyte		0x62		dBase IV, with SQL table
289b6cee71dSXin LI#!:mime	application/x-dbf
29043a5ec4eSXin LI# no example
291b6cee71dSXin LI# dBASE IV, with memo!!
292b6cee71dSXin LI>>0	ubyte		0x7b		dBase IV, with memo
293b6cee71dSXin LI!:mime	application/x-dbf
29443a5ec4eSXin LI# like: test3memo.DBF dbase5.DBF
29543a5ec4eSXin LI# https://docs.microsoft.com/en-us/previous-versions/visualstudio/foxpro/st4a0s68(v=vs.80)
29643a5ec4eSXin LI>>0	ubyte		0x82		dBase IV, with SQL system
297b6cee71dSXin LI#!:mime	application/x-dbf
29843a5ec4eSXin LI# no example
299b6cee71dSXin LI# FoxBase+/dBaseIII+ with memo .DBT!
300b6cee71dSXin LI>>0	ubyte		0x83		FoxBase+/dBase III, with memo .DBT
301b6cee71dSXin LI!:mime	application/x-dbf
30243a5ec4eSXin LI# like: T2.DBF t3.DBF biblio.dbf dbase_83.dbf dbase3dbt0_4.dbf fsadress.dbf stop.dbf
303b6cee71dSXin LI# VISUAL OBJECTS (first 1.0 versions) for the Dbase III files (NTX clipper driver); memo file
304b6cee71dSXin LI>>0	ubyte		0x87		VISUAL OBJECTS, with memo file
305b6cee71dSXin LI!:mime	application/x-dbf
30643a5ec4eSXin LI# like: ACCESS.DBF dbase3date.dbf dbase3float.dbf holdings.dbf mitarbei.dbf
30743a5ec4eSXin LI# https://docs.microsoft.com/en-us/previous-versions/visualstudio/foxpro/st4a0s68(v=vs.80)
30843a5ec4eSXin LI>>0	ubyte		0x8A		FoxBase+/dBase III, with memo .DBT
309b6cee71dSXin LI#!:mime	application/x-dbf
31043a5ec4eSXin LI# no example
311b6cee71dSXin LI# dBASE IV with memo!
312b6cee71dSXin LI>>0	ubyte		0x8B		dBase IV, with memo .DBT
313b6cee71dSXin LI!:mime	application/x-dbf
31443a5ec4eSXin LI# like: animals.dbf archive.dbf callin.dbf dbase_8b.dbf phnebook.dbf t6.dbf
315b6cee71dSXin LI# dBase IV with SQL Table,no memo?
316b6cee71dSXin LI>>0	ubyte		0x8E		dBase IV, with SQL table
317b6cee71dSXin LI!:mime	application/x-dbf
31843a5ec4eSXin LI# like: dbase5.DBF test3memo.DBF test-memo.DBF
319b6cee71dSXin LI# .dbv and .dbt memo (Flagship)?
320b6cee71dSXin LI>>0	ubyte		0xB3		Flagship
32143a5ec4eSXin LI!:mime	application/x-dbf
32243a5ec4eSXin LI# no example
32343a5ec4eSXin LI# https://docs.microsoft.com/en-us/previous-versions/visualstudio/foxpro/st4a0s68(v=vs.80)
32443a5ec4eSXin LI>>0	ubyte		0xCA		dBase IV with memo .DBT
325b6cee71dSXin LI#!:mime	application/x-dbf
32643a5ec4eSXin LI# no example
327b6cee71dSXin LI# dBASE IV with SQL table, with memo .DBT
328b6cee71dSXin LI>>0	ubyte		0xCB		dBase IV with SQL table, with memo .DBT
329b6cee71dSXin LI!:mime	application/x-dbf
33043a5ec4eSXin LI# like: dbase5.DBF test3memo.DBF test-memo.DBF
331b6cee71dSXin LI# HiPer-Six format;Clipper SIX, with SMT memo file
332b6cee71dSXin LI>>0	ubyte		0xE5		Clipper SIX with memo
333b6cee71dSXin LI!:mime	application/x-dbf
33443a5ec4eSXin LI# like: dbase5.DBF test3memo.DBF test-memo.DBF testClipper.dbf DATA.DBF
33543a5ec4eSXin LI# https://docs.microsoft.com/en-us/previous-versions/visualstudio/foxpro/st4a0s68(v=vs.80)
33643a5ec4eSXin LI>>0	ubyte		0xF4		dBase IV, with SQL table, with memo
337b6cee71dSXin LI#!:mime	application/x-dbf
33843a5ec4eSXin LI# no example
339b6cee71dSXin LI>>0	ubyte		0xF5		FoxPro with memo
340b6cee71dSXin LI!:mime	application/x-dbf
34143a5ec4eSXin LI# like: CUSTOMER.DBF FOXUSER1.DBF Invoice.DBF NG.DBF OBJSAMP.DBF dbase_f5.dbf kunde.dbf
34243a5ec4eSXin LI# probably Apollo Database Server 9.7 with SQL and memo mask? xBase (0xF6)
34343a5ec4eSXin LI>>0	ubyte		0xF6		Apollo, with SQL table with memo
34443a5ec4eSXin LI!:mime	application/x-dbf
34543a5ec4eSXin LI# like: SCRIPTS.DBF
34643a5ec4eSXin LI# https://docs.microsoft.com/en-us/previous-versions/visualstudio/foxpro/st4a0s68(v=vs.80)
347b6cee71dSXin LI#>>0	ubyte		0xFA		FoxPro 2.x, with memo
348b6cee71dSXin LI#!:mime	application/x-dbf
34943a5ec4eSXin LI# no example
350b6cee71dSXin LI# unknown version (should not happen)
351b6cee71dSXin LI>>0	default		x		xBase
352b6cee71dSXin LI!:mime	application/x-dbf
35343a5ec4eSXin LI>>>0	ubyte		x		(%#x)
354b6cee71dSXin LI# flags in version byte
355b6cee71dSXin LI# DBT flag (with dBASE III memo .DBT)!!
356b6cee71dSXin LI# >>0	ubyte&0x80	>0		DBT_FLAG=%x
357b6cee71dSXin LI# memo flag ??
358b6cee71dSXin LI# >>0	ubyte&0x08	>0		MEMO_FLAG=%x
359b6cee71dSXin LI# SQL flag ??
360b6cee71dSXin LI# >>0	ubyte&0x70	>0		SQL_FLAG=%x
361b6cee71dSXin LI#		test and print the date of xBase .DBF .MDX
362b6cee71dSXin LI0	name				xbase-date
363b6cee71dSXin LI# inspect YYMMDD , where 1<= MM <= 12 and 1<= DD <= 31
364b6cee71dSXin LI>0	ubelong		x
365b6cee71dSXin LI>1	ubyte		<13
366b6cee71dSXin LI>>1	ubyte		>0
367b6cee71dSXin LI>>>2	ubyte		>0
368b6cee71dSXin LI>>>>2	ubyte		<32
369b6cee71dSXin LI>>>>>0	ubyte		x
370b6cee71dSXin LI# YY is interpreted as 20YY or 19YY
371b6cee71dSXin LI>>>>>>0	ubyte		<100		\b %.2d
372b6cee71dSXin LI# YY is interpreted 1900+YY; TODO: display yy or 20yy instead 1YY
373b6cee71dSXin LI>>>>>>0	ubyte		>99		\b %d
374b6cee71dSXin LI>>>>>1	ubyte		x		\b-%d
375b6cee71dSXin LI>>>>>2	ubyte		x		\b-%d
376b6cee71dSXin LI
377b6cee71dSXin LI#	dBase memo files .DBT or .FPT
37848c779cdSXin LI# https://msdn.microsoft.com/en-us/library/8599s21w(v=vs.80).aspx
379b6cee71dSXin LI16		ubyte		<4
380b6cee71dSXin LI>16		ubyte		!2
381b6cee71dSXin LI>>16		ubyte		!1
382b6cee71dSXin LI# next free block index is positive
383b6cee71dSXin LI>>>0		ulelong		>0
384b6cee71dSXin LI# skip many JPG. ZIP, BZ2 by test for reserved bytes NULL , 0|2 , 0|1 , low byte of block size
385d38c30c0SXin LI>>>>17		ubelong&0xFFfdFEff	0x00000000
386b6cee71dSXin LI# skip many RAR by test for low byte 0 ,high byte 0|2|even of block size, 0|a|e|d7 , 0|64h
387b6cee71dSXin LI>>>>>20		ubelong&0xFF01209B	0x00000000
388b6cee71dSXin LI# dBASE III
389b6cee71dSXin LI>>>>>>16	ubyte		3
390*898496eeSXin LI# skip with invalid "low" 1st item "\0\0\0\0" StateRepository-Deployment.srd-shm "\001\010\0\0" gcry_cast5.mod
391*898496eeSXin LI>>>>>>>512	ubyte		>040
392*898496eeSXin LI# skip with valid 1st item "rintf" keylayouts.mod
393*898496eeSXin LI# by looking for valid terminating character Ctrl-Z like in test.dbt
394*898496eeSXin LI>>>>>>>>513 search/3308	\032
395*898496eeSXin LI# skip GRUB plan9.mod with invalid second terminating character 007
396*898496eeSXin LI# by checking second terminating character Ctrl-Z like in test.dbt
397*898496eeSXin LI>>>>>>>>>&0 ubyte		032
398*898496eeSXin LI# dBASE III DBT with two Ctr-Z terminating characters
399*898496eeSXin LI>>>>>>>>>>0	use		dbase3-memo-print
400*898496eeSXin LI# second terminating character \0 like in dbase-memo.dbt or GRUB nativedisk.mod
401*898496eeSXin LI>>>>>>>>>&0 ubyte		0
402*898496eeSXin LI# skip GRUB nativedisk.mod with grub_mod_init\0grub_mod_fini\0grub_fs_autoload_hook\0
403*898496eeSXin LI>>>>>>>>>>0x1ad string		!grub_mod_init
404*898496eeSXin LI# like dbase-memo.dbt
405*898496eeSXin LI>>>>>>>>>>>0	use		dbase3-memo-print
406c2931133SXin LI# dBASE III DBT without version, dBASE IV DBT , FoxPro FPT , or many ZIP , DBF garbage
407b6cee71dSXin LI>>>>>>16	ubyte		0
408c2931133SXin LI# unusual dBASE III DBT like angest.dbt, dBASE IV DBT with block size 0 , FoxPro FPT ,  or garbage PCX DBF
409c2931133SXin LI>>>>>>>20	uleshort	0
410c2931133SXin LI# FoxPro FPT , unusual dBASE III DBT like biblio.dbt or garbage
411c2931133SXin LI>>>>>>>>8	ulong		=0
412c2931133SXin LI>>>>>>>>>6	ubeshort	>0
413c2931133SXin LI# skip emacs.PIF
414c2931133SXin LI>>>>>>>>>>4	ushort		0
415d38c30c0SXin LI# check for valid FoxPro field type
416d38c30c0SXin LI>>>>>>>>>>>512	ubelong		<3
417a4d6d3b8SXin LI# skip LXMDCLN4.OUT LXMDCLN6.OUT LXMDALG6.OUT with invalid blocksize 170=AAh
418a4d6d3b8SXin LI>>>>>>>>>>>>6	ubeshort&0x002f	0
419a4d6d3b8SXin LI>>>>>>>>>>>>>0	use		foxpro-memo-print
420c2931133SXin LI# dBASE III DBT , garbage
421d38c30c0SXin LI# skip WORD1XW.DOC with improbably high free block index
4222726a701SXin LI>>>>>>>>>0	ulelong		<0x400000
4232726a701SXin LI# skip WinStore.App.exe by looking for printable 2nd character of 1st memo item
4242726a701SXin LI>>>>>>>>>>513	ubyte		>037
425a2dfb722SXin LI# skip DOS executables CPQ0TD.DRV E30ODI.COM IBM0MONO.DRV by looking for printable 1st character of 1st memo item
426a2dfb722SXin LI>>>>>>>>>>>512	ubyte		>037
427*898496eeSXin LI# skip few (14/758) Microsoft Event Trace Logs (boot_BASE+CSWITCH_1.etl DlTel-Merge.etl UpdateUx.006.etl) with invalid "high" 1st item \377\377
428*898496eeSXin LI>>>>>>>>>>>>512	ubyte		<0377
429*898496eeSXin LI# skip some Commodore 64 Art Studio (Deep_Strike.aas dragon's_lair_ii.aas), some Atari DEGAS Elite bitmap (ELEPHANT.PC3 ST.PC2)
430*898496eeSXin LI# some probably old GRUB modules (part_sun.mod) and virtual-boy-wario-land.vb.
431*898496eeSXin LI# by looking for valid terminating character Ctrl-Z
432*898496eeSXin LI>>>>>>>>>>>>>513 search/523	\032
433*898496eeSXin LI# Atari DEGAS bitmap ST.PC2 with 0370 as second terminating character
434*898496eeSXin LI#>>>>>>>>>>>>>>&0 ubyte		x		2ND_CHAR_IS=%o
435*898496eeSXin LI# dBASE III DBT with two Ctr-Z terminating characters like dbase3dbt0_1.dbt dbase_83.dbt
436*898496eeSXin LI>>>>>>>>>>>>>>&0 ubyte		032
437*898496eeSXin LI>>>>>>>>>>>>>>>0 use		dbase3-memo-print
438*898496eeSXin LI# second terminating character \0 like in pcidump.mod or fsadress.dbt umlaut-dbf-cmd.dbt
439*898496eeSXin LI>>>>>>>>>>>>>>&0 ubyte		0
440*898496eeSXin LI# look for old GRUB module pcidump.mod with specific content "pcidump\0Show raw dump of the PCI configuration space"
441*898496eeSXin LI>>>>>>>>>>>>>>>514 search/0x11E	pcidump\0Show
442*898496eeSXin LI# dBASE III DBT with Ctr-Z + \0 terminating characters like fsadress.dbt
443*898496eeSXin LI>>>>>>>>>>>>>>>514 default	x
444*898496eeSXin LI# unusual dBASE III DBT like fsadress.dbt umlaut-dbf-cmd.dbt
445*898496eeSXin LI>>>>>>>>>>>>>>>>0 use		dbase3-memo-print
446c2931133SXin LI# dBASE III DBT like angest.dbt, or garbage PCX DBF
447c2931133SXin LI>>>>>>>>8	ubelong		!0
448c2931133SXin LI# skip PCX and some DBF by test for for reserved NULL bytes
449c2931133SXin LI>>>>>>>>>510	ubeshort	0
4502726a701SXin LI# skip bad symples with improbably high free block index above 2 GiB file limit
4512726a701SXin LI>>>>>>>>>>0	ulelong		<0x400000
4522726a701SXin LI# skip AI070GEP.EPS by printable 1st character of 1st memo item
4532726a701SXin LI>>>>>>>>>>>512	ubyte		>037
454a4d6d3b8SXin LI# skip some Microsoft Visual C, OMF library like: BZ2.LIB WATTCPWL.LIB ZLIB.LIB
455a4d6d3b8SXin LI>>>>>>>>>>>>512	ubyte		<0200
4562726a701SXin LI# skip gluon-ffhat-1.0-tp-link-tl-wr1043n-nd-v2-sysupgrade.bin by printable 2nd character
457a4d6d3b8SXin LI>>>>>>>>>>>>>513 ubyte		>037
458*898496eeSXin LI# skip few (8/758) Microsoft Event Trace Logs (WBEngine.3.etl Wifi.etl) with valid 1st item like
459*898496eeSXin LI# "9600.20369.amd64fre.winblue_ltsb_escrow.220427-1727"
460*898496eeSXin LI# "9600.19846.amd64fre.winblue_ltsb_escrow.200923-1735"
461*898496eeSXin LI# "10586.494.amd64fre.th2_release_sec.160630-1736"
462*898496eeSXin LI# by looking for valid terminating character Ctrl-Z
463*898496eeSXin LI>>>>>>>>>>>>>>513 search/0x11E	\032
464*898496eeSXin LI# followed by second character Ctrl-Z implies typical DBT
465*898496eeSXin LI>>>>>>>>>>>>>>>&0	ubyte	032
466*898496eeSXin LI# examples like: angest.dbt
467*898496eeSXin LI>>>>>>>>>>>>>>>>0	use	dbase3-memo-print
468*898496eeSXin LI>>>>>>>>>>>>>>>&0	ubyte	0
469*898496eeSXin LI# no example found here with terminating sequence CTRL-Z + \0
470*898496eeSXin LI>>>>>>>>>>>>>>>>0	use	dbase3-memo-print
471c2931133SXin LI# dBASE IV DBT with positive block size
472c2931133SXin LI>>>>>>>20	uleshort	>0
4733e41d09dSXin LI# dBASE IV DBT with valid block length like 512, 1024
4743e41d09dSXin LI# multiple of 2 in between 16 and 16 K ,implies upper and lower bits are zero
475d38c30c0SXin LI# skip also 3600h 3E00h size
476d38c30c0SXin LI>>>>>>>>20	uleshort&0xE00f	0
4773e41d09dSXin LI>>>>>>>>>0	use		dbase4-memo-print
478b6cee71dSXin LI
479c2931133SXin LI#		Print the information of dBase III DBT memo file
480c2931133SXin LI0	name				dbase3-memo-print
481c2931133SXin LI>0	ubyte			x		dBase III DBT
482d38c30c0SXin LI!:mime	application/x-dbt
483d38c30c0SXin LI!:ext	dbt
484c2931133SXin LI# instead 3 as version number 0 for unusual examples like biblio.dbt
485c2931133SXin LI>16	ubyte			!3		\b, version number %u
486b6cee71dSXin LI# Number of next available block for appending data
487c2931133SXin LI#>0	lelong			=0		\b, next free block index %u
488c2931133SXin LI>0	lelong			!0		\b, next free block index %u
48943a5ec4eSXin LI# no positive block length
490c2931133SXin LI#>20	uleshort		=0		\b, block length %u
491c2931133SXin LI>20	uleshort		!0		\b, block length %u
492*898496eeSXin LI# dBase III memo field terminated often by \032\032
493a4d6d3b8SXin LI# like: "WHAT IS XBASE" test.dbt "Borges, Malte" biblio.dbt "First memo\032\032" T2.DBT
494c2931133SXin LI>512	string			>\0		\b, 1st item "%s"
495a4d6d3b8SXin LI# For DEBUGGING
496a4d6d3b8SXin LI#>512	ubelong			x		\b, 1ST item %#8.8x
497*898496eeSXin LI#>513	search/0x225		\032		FOUND_TERMINATOR
498*898496eeSXin LI#>>&0	ubyte			032		2xCTRL_Z
499*898496eeSXin LI# fsadress.dbt has 1 Ctrl-Z terminator followed by nil byte
500*898496eeSXin LI#>>&0	ubyte			0		1xCTRL_Z
501*898496eeSXin LI
502d38c30c0SXin LI# https://www.clicketyclick.dk/databases/xbase/format/dbt.html
503c2931133SXin LI#		Print the information of dBase IV DBT memo file
504c2931133SXin LI0	name				dbase4-memo-print
505c2931133SXin LI>0		lelong		x		dBase IV DBT
5063e41d09dSXin LI!:mime	application/x-dbt
5073e41d09dSXin LI!:ext dbt
50843a5ec4eSXin LI# 8 character shorted main name of corresponding dBASE IV DBF file
509c2931133SXin LI>8		ubelong		>0x20000000
510c2931133SXin LI# skip unusual like for angest.dbt
511c2931133SXin LI>>20		uleshort	>0
512c2931133SXin LI>>>8		string		>\0		\b of %-.8s.DBF
513c2931133SXin LI# value 0 implies 512 as size
514c2931133SXin LI#>4		ulelong		=0		\b, blocks size %u
515c2931133SXin LI# size of blocks not reliable like 0x2020204C in angest.dbt
516c2931133SXin LI>4		ulelong		!0
517c2931133SXin LI>>4		ulelong&0x0000003f	0	\b, blocks size %u
518c2931133SXin LI# dBase IV DBT with positive block length (found 512 , 1024)
519c2931133SXin LI>20		uleshort	>0		\b, block length %u
520c2931133SXin LI# next available block
521c2931133SXin LI#>0		lelong		=0		\b, next free block index %u
522c2931133SXin LI>0		lelong		!0		\b, next free block index %u
523c2931133SXin LI>20		uleshort	>0
524c2931133SXin LI>>(20.s)	ubelong		x
525c2931133SXin LI>>>&-4		use		dbase4-memofield-print
526c2931133SXin LI# unusual dBase IV DBT without block length (implies 512 as length)
527c2931133SXin LI>20		uleshort	=0
528b6cee71dSXin LI>>512		ubelong		x
529c2931133SXin LI>>>&-4		use				dbase4-memofield-print
530c2931133SXin LI#		Print the information of dBase IV memo field
531c2931133SXin LI0	name			dbase4-memofield-print
532c2931133SXin LI# free dBase IV memo field
533c2931133SXin LI>0		ubelong		!0xFFFF0800
534c2931133SXin LI>>0		lelong		x		\b, next free block %u
535c2931133SXin LI>>4		lelong		x		\b, next used block %u
536c2931133SXin LI# used dBase IV memo field
537c2931133SXin LI>0		ubelong		=0xFFFF0800
538c2931133SXin LI# length of memo field
539c2931133SXin LI>>4		lelong		x		\b, field length %d
540c2931133SXin LI>>>8		string		>\0		\b, 1st used item "%s"
541d38c30c0SXin LI# http://www.dbfree.org/webdocs/1-documentation/0018-developers_stuff_(advanced)/os_related_stuff/xbase_file_format.htm
542c2931133SXin LI#		Print the information of FoxPro FPT memo file
543c2931133SXin LI0	name				foxpro-memo-print
544c2931133SXin LI>0		belong		x		FoxPro FPT
545d38c30c0SXin LI!:mime	application/x-fpt
546d38c30c0SXin LI!:ext	fpt
547a4d6d3b8SXin LI# Size of blocks for FoxPro ( 64,256 ); probably a multiple of two
548c2931133SXin LI>6		ubeshort	x		\b, blocks size %u
549c2931133SXin LI# next available block
550c2931133SXin LI#>0		belong		=0		\b, next free block index %u
551c2931133SXin LI>0		belong		!0		\b, next free block index %u
552c2931133SXin LI# field type ( 0~picture, 1~memo, 2~object )
553c2931133SXin LI>512		ubelong		<3		\b, field type %u
554c2931133SXin LI# length of memo field
555c2931133SXin LI>512		ubelong		1
556c2931133SXin LI>>516		belong		>0		\b, field length %d
557c2931133SXin LI>>>520		string		>\0		\b, 1st item "%s"
558b6cee71dSXin LI
55943a5ec4eSXin LI# Summary:	DBASE Compound Index file *.CDX and FoxPro index *.IDX
56043a5ec4eSXin LI# From:		Joerg Jenderek
56143a5ec4eSXin LI# URL:		https://www.clicketyclick.dk/databases/xbase/format/cdx.html
56243a5ec4eSXin LI#		https://www.clicketyclick.dk/databases/xbase/format/idx.html
56343a5ec4eSXin LI#		https://www.clicketyclick.dk/databases/xbase/format/idx_comp.html
56443a5ec4eSXin LI# Reference:	https://mark0.net/download/triddefs_xml.7z/defs/s/sybase-ianywhere-cdx.trid.xml
56543a5ec4eSXin LI#		https://mark0.net/download/triddefs_xml.7z/defs/c/cdx-vfp7.trid.xml
56643a5ec4eSXin LI# like: kunde.cdx
56743a5ec4eSXin LI0	ulelong		0x1C00
56843a5ec4eSXin LI>0	use			xbase-index
56943a5ec4eSXin LI# like: SYLLABI2.CDX SYLLABUS.CDX
57043a5ec4eSXin LI0	ulelong		0x0800
57143a5ec4eSXin LI>0	use			xbase-index
57243a5ec4eSXin LI# often in xBase index pointer to root node 400h
57343a5ec4eSXin LI0	ulelong		0x0400
57443a5ec4eSXin LI# skip most Maple help database *.hdb with version tag handled by ./maple
57543a5ec4eSXin LI>1028	string		!version
57643a5ec4eSXin LI# skip Maple help database hsum.hdb checking for valid reserved area
57743a5ec4eSXin LI>>492	quad		=0
57843a5ec4eSXin LI# skip remaining Maple help database *.hdb by checking key length
57943a5ec4eSXin LI#>>>12	uleshort	!0x000F			KEY_LENGTHVALID
58043a5ec4eSXin LI>>>0	use			xbase-index
58143a5ec4eSXin LI#	display information about dBase/FoxPro index
58243a5ec4eSXin LI0	name			xbase-index
58343a5ec4eSXin LI>0	ulelong		x			xBase
58443a5ec4eSXin LI!:mime	application/x-dbase-index
58543a5ec4eSXin LI>14	ubyte		&0x40			compound index
58643a5ec4eSXin LI# DCX for FoxPro database index like: TESTDATA.DCX
58743a5ec4eSXin LI!:ext	cdx/dcx
58843a5ec4eSXin LI>14	ubyte		^0x40			index
58943a5ec4eSXin LI# only 1 example like: TEST.IDX
59043a5ec4eSXin LI!:ext	idx
59143a5ec4eSXin LI# pointer to root node like: 1C00h 800h often 400h
59243a5ec4eSXin LI>0	ulelong		!0x400			\b, root pointer %#x
59343a5ec4eSXin LI# Pointer to free node list: often 0 but -1 if not present
59443a5ec4eSXin LI>4	ulelong		!0			\b, free node pointer %#x
59543a5ec4eSXin LI# MAYBE number of pages in file (Foxbase, FoxPro 1.x) or
59643a5ec4eSXin LI# http://www.foxpert.com/foxpro/knowlbits/files/knowlbits_200708_1.HTM
59743a5ec4eSXin LI# Whenever Visual FoxPro updates the index file it increments this reserved field
59843a5ec4eSXin LI# Reserved for internal use like: 02000000h 03000000h 460c0000h 780f0000h 89000000h 9fdc0100h often 0
59943a5ec4eSXin LI>8	ulelong		!0			\b, reserved counter %#x
60043a5ec4eSXin LI# length of key like: mostly 000Ah 0028h (TEST.IDX)
60143a5ec4eSXin LI>12	uleshort	!0x000A			\b, key length %#x
60243a5ec4eSXin LI# index options like: 24h E0h E8h
60343a5ec4eSXin LI# 1~a unique index 8~index has FOR clause 32~compact index format 64~compound index header
60443a5ec4eSXin LI# 16~Bit vector (SoftC) 128~Structure index (FoxPro)
60543a5ec4eSXin LI>14	ubyte		x			\b, index options (%#x
60643a5ec4eSXin LI>14	ubyte		&0x01			\b, unique
60743a5ec4eSXin LI>14	ubyte		&0x08			\b, has FOR clause
60843a5ec4eSXin LI>14	ubyte		&0x10			\b, bit vector (SoftC)
60943a5ec4eSXin LI>14	ubyte		&0x20			\b, compact format
61043a5ec4eSXin LI#>14	ubyte		&0x40			\b, compound header
61143a5ec4eSXin LI>14	ubyte		&0x80			\b, structure
61243a5ec4eSXin LI>14	ubyte		x			\b)
61343a5ec4eSXin LI# WHAT EXACTLY IS THAT? index signature like: 0 (sybase-ianywhere-cdx.trid.xml) 1 (cdx-vfp7.trid.xml)
61443a5ec4eSXin LI>15	ubyte		!0			\b, index signature %u
61543a5ec4eSXin LI# reserved area (0-bytes) til about 500, but not for uncompressed Index files *.idx
61643a5ec4eSXin LI>16	quad		!0			\b, at 16 reserved %#llx
61743a5ec4eSXin LI>492	quad		!0			\b, at 492 reserved %#llx
61843a5ec4eSXin LI# for IDX variant
61943a5ec4eSXin LI#>14	ubyte		^0x40			IDX
62043a5ec4eSXin LI# for CDX variant
62143a5ec4eSXin LI>14	ubyte		&0x40
62243a5ec4eSXin LI# Ascending or descending: 0~ascending 1~descending
62343a5ec4eSXin LI>>502	uleshort	x			\b, sort order %u
62443a5ec4eSXin LI# Total expression length (FoxPro 2) like: 0 1
62543a5ec4eSXin LI>>504	uleshort	!0			\b, expression length %u
62643a5ec4eSXin LI# FOR expression pool length like: 1
62743a5ec4eSXin LI>>506	uleshort	!1			\b, FOR expression pool length %#x
62843a5ec4eSXin LI# reserved for internal use like: 0
62943a5ec4eSXin LI>>508	uleshort	!0			\b, at 0x508 reserved %#x
63043a5ec4eSXin LI# Key expression pool length like: 1
63143a5ec4eSXin LI>>510	uleshort	!1			\b, key expression pool length %#x
63243a5ec4eSXin LI# 512 - 1023 Key & FOR expression pool (uncompiled)
63343a5ec4eSXin LI>>512	quad		!0			\b, key expression pool %#llx
63443a5ec4eSXin LI#>>520	quad		!0			\b, key expression pool %#llx
63543a5ec4eSXin LI
63643a5ec4eSXin LI# Summary:	dBASE IV Printer Form *.PRF
63743a5ec4eSXin LI# From:		Joerg Jenderek
63843a5ec4eSXin LI# URL:		https://en.wikipedia.org/wiki/.dbf#Other_file_types_found_in_dBASE
63943a5ec4eSXin LI# Reference:	https://mark0.net/download/triddefs_xml.7z/defs/p/prf-dbase.trid.xml
64043a5ec4eSXin LI0	ubeshort	0x0400
64143a5ec4eSXin LI# skip some Xbase Index files *.ndx and Infocom (Z-machine 4) *.z4 handled by ./adventure
64243a5ec4eSXin LI# by looking for valid printer driver name extension
64343a5ec4eSXin LI>0x58	search/8	.PR2
64443a5ec4eSXin LI>>0	use			xbase-prf
64543a5ec4eSXin LI#	display information of dbase print form like printer driver *.PR2
64643a5ec4eSXin LI0	name			xbase-prf	dBase Printer Form
64743a5ec4eSXin LI!:mime	application/x-dbase-prf
64843a5ec4eSXin LI!:ext	prf
64943a5ec4eSXin LI# MAYBE version? like: 4~DBASE IV
65043a5ec4eSXin LI#>0	ubyte		x			\b, version %u
65143a5ec4eSXin LI# MAYBE flag like: 1~with output file name 0~not
65243a5ec4eSXin LI#>2	ubyte		!0			\b, flag %u
65343a5ec4eSXin LI# optional printer text output file name like E:\DBASE\IV\T6.txt
65443a5ec4eSXin LI>3	string		>\0			\b, output file %s
65543a5ec4eSXin LI# probably padding with nils til 0x53
65643a5ec4eSXin LI#>0x48	 uquad		!0			\b, at 0x48 padding %#llx
65743a5ec4eSXin LI# dBASE IV printer driver name like: Generic.PR2 ASCII.PR2
65843a5ec4eSXin LI>0x56	string		>\0			\b, using printer driver %s
65943a5ec4eSXin LI# 2 is probably last character of previous dBASE printer driver name
66043a5ec4eSXin LI#>0x60	ubyte		!0x32			\b, at 0x60 %#x
66143a5ec4eSXin LI# probably padding with nils til 0xa8
66243a5ec4eSXin LI#>0x61	uquad		!0			\b, at 0x61 padding %#llx
66343a5ec4eSXin LI# unknown 0x03020300 0x03020100 at 0xa8
66443a5ec4eSXin LI>0xa8	ubelong 	x			\b, at 0xa8 unknown %#8.8x
66543a5ec4eSXin LI# probably padding with nils til 0x2aa
66643a5ec4eSXin LI#>0x2a0	uquad		!0			\b, at 0x2a0 padding %#llx
66743a5ec4eSXin LI# unknown 0x100ff7f01000001 at 0x2AB
66843a5ec4eSXin LI>0x2ab	ubequad		!0x100ff7f01000001	\b, at 0x2ab unknown %#llx
66943a5ec4eSXin LI# unknown 0x0042 at 0x2b3
67043a5ec4eSXin LI>0x2b3	ubeshort 	!0x0042			\b, at 0x2b3 unknown %#4.4x
67143a5ec4eSXin LI# unknown last 4 bytes at 0x2b6 like: 0 0x23
67243a5ec4eSXin LI>0x2b6	ubelong		!0			\b, at 0x2b6 unknown %#8.8x
67343a5ec4eSXin LI
674b6cee71dSXin LI# TODO:
675b6cee71dSXin LI# DBASE index file *.NDX
67643a5ec4eSXin LI# dBASE compiled Format *.FMO
67743a5ec4eSXin LI# FoxPro Database memo file *.DCT
67843a5ec4eSXin LI# FoxPro Forms Memo *.SCT
67943a5ec4eSXin LI# FoxPro Generated Menu Program *.MPR
68043a5ec4eSXin LI# FoxPro Report *.FRX
68143a5ec4eSXin LI# FoxPro Report Memo *.FRT
68243a5ec4eSXin LI# Foxpro Generated Screen Program *.SPR
68343a5ec4eSXin LI# Foxpro memo *.PJT
684b6cee71dSXin LI## End of XBase database stuff
685b6cee71dSXin LI
686b6cee71dSXin LI# MS Access database
687b6cee71dSXin LI4	string	Standard\ Jet\ DB	Microsoft Access Database
688b6cee71dSXin LI!:mime	application/x-msaccess
689b6cee71dSXin LI4	string	Standard\ ACE\ DB	Microsoft Access Database
690b6cee71dSXin LI!:mime	application/x-msaccess
691b6cee71dSXin LI
6923e41d09dSXin LI# From: Joerg Jenderek
6933e41d09dSXin LI# URL: http://fileformats.archiveteam.org/wiki/Extensible_Storage_Engine
6943e41d09dSXin LI# Reference: https://github.com/libyal/libesedb/archive/master.zip
6953e41d09dSXin LI#	libesedb-master/documentation/
6963e41d09dSXin LI#	Extensible Storage Engine (ESE) Database File (EDB) format.asciidoc
6973e41d09dSXin LI# Note: also known as "JET Blue". Used by numerous Windows components such as
6983e41d09dSXin LI# Windows Search, Mail, Exchange and Active Directory.
6993e41d09dSXin LI4	ubelong		0xefcdab89
7003e41d09dSXin LI# unknown1
7013e41d09dSXin LI>132	ubelong		0		Extensible storage engine
7023e41d09dSXin LI!:mime	application/x-ms-ese
7033e41d09dSXin LI# file_type 0~database 1~stream
7043e41d09dSXin LI>>12	ulelong		0		DataBase
7053e41d09dSXin LI# Security DataBase (sdb)
7063e41d09dSXin LI!:ext	edb/sdb
7073e41d09dSXin LI>>12	ulelong		1		STreaMing
7083e41d09dSXin LI!:ext	stm
7093e41d09dSXin LI# format_version 620h
71043a5ec4eSXin LI>>8	uleshort	x		\b, version %#x
71143a5ec4eSXin LI>>10	uleshort	>0		revision %#4.4x
71243a5ec4eSXin LI>>0	ubelong		x	 	\b, checksum %#8.8x
7133e41d09dSXin LI# Page size 4096 8192 32768
7143e41d09dSXin LI>>236	ulequad		x		\b, page size %lld
7153e41d09dSXin LI# database_state
7163e41d09dSXin LI>>52	ulelong		1		\b, JustCreated
7173e41d09dSXin LI>>52	ulelong		2		\b, DirtyShutdown
7183e41d09dSXin LI#>>52	ulelong		3		\b, CleanShutdown
7193e41d09dSXin LI>>52	ulelong		4		\b, BeingConverted
7203e41d09dSXin LI>>52	ulelong		5		\b, ForceDetach
7212726a701SXin LI# Windows NT major version when the databases indexes were updated.
7223e41d09dSXin LI>>216	ulelong		x		\b, Windows version %d
7232726a701SXin LI# Windows NT minor version
7243e41d09dSXin LI>>220	ulelong		x		\b.%d
7253e41d09dSXin LI
7263e41d09dSXin LI# From: Joerg Jenderek
72748c779cdSXin LI# URL: https://forensicswiki.org/wiki/Windows_Application_Compatibility
7283e41d09dSXin LI# Note: files contain application compatibility fixes, application compatibility modes and application help messages.
7293e41d09dSXin LI8	string		sdbf
7303e41d09dSXin LI>7	ubyte		0
7313e41d09dSXin LI# TAG_TYPE_LIST+TAG_INDEXES
7323e41d09dSXin LI>>12	uleshort	0x7802		Windows application compatibility Shim DataBase
7333e41d09dSXin LI# version? 2 3
7343e41d09dSXin LI#>>>0	ulelong		x		\b, version %d
7353e41d09dSXin LI!:mime	application/x-ms-sdb
7363e41d09dSXin LI!:ext	sdb
7373e41d09dSXin LI
738b6cee71dSXin LI# TDB database from Samba et al - Martin Pool <mbp@samba.org>
739b6cee71dSXin LI0	string	TDB\ file		TDB database
740b6cee71dSXin LI>32	lelong	0x2601196D		version 6, little-endian
741b6cee71dSXin LI>>36	lelong	x			hash size %d bytes
742b6cee71dSXin LI
743b6cee71dSXin LI# SE Linux policy database
744b6cee71dSXin LI0       lelong  0xf97cff8c      SE Linux policy
745b6cee71dSXin LI>16     lelong  x               v%d
746b6cee71dSXin LI>20     lelong  1      MLS
747b6cee71dSXin LI>24     lelong  x       %d symbols
748b6cee71dSXin LI>28     lelong  x       %d ocons
749b6cee71dSXin LI
750b6cee71dSXin LI# ICE authority file data (Wolfram Kleff)
751b6cee71dSXin LI2	string		ICE		ICE authority data
752b6cee71dSXin LI
753b6cee71dSXin LI# X11 Xauthority file (Wolfram Kleff)
754b6cee71dSXin LI10	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
755b6cee71dSXin LI11	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
756b6cee71dSXin LI12	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
757b6cee71dSXin LI13	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
758b6cee71dSXin LI14	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
759b6cee71dSXin LI15	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
760b6cee71dSXin LI16	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
761b6cee71dSXin LI17	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
762b6cee71dSXin LI18	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
763b6cee71dSXin LI
764b6cee71dSXin LI# From: Maxime Henrion <mux@FreeBSD.org>
765b6cee71dSXin LI# PostgreSQL's custom dump format, Maxime Henrion <mux@FreeBSD.org>
766b6cee71dSXin LI0	string		PGDMP		PostgreSQL custom database dump
767b6cee71dSXin LI>5	byte		x		- v%d
768b6cee71dSXin LI>6	byte		x		\b.%d
769b6cee71dSXin LI>5	beshort		<0x101		\b-0
770b6cee71dSXin LI>5	beshort		>0x100
771b6cee71dSXin LI>>7	byte		x		\b-%d
772b6cee71dSXin LI
773b6cee71dSXin LI# Type: Advanced Data Format (ADF) database
77448c779cdSXin LI# URL:  https://www.grc.nasa.gov/WWW/cgns/adf/
775b6cee71dSXin LI# From: Nicolas Chauvat <nicolas.chauvat@logilab.fr>
776b6cee71dSXin LI0	string	@(#)ADF\ Database	CGNS Advanced Data Format
777b6cee71dSXin LI
778b6cee71dSXin LI# Tokyo Cabinet magic data
779b6cee71dSXin LI# http://tokyocabinet.sourceforge.net/index.html
780b6cee71dSXin LI0	string		ToKyO\ CaBiNeT\n	Tokyo Cabinet
781b6cee71dSXin LI>14	string		x			\b (%s)
782b6cee71dSXin LI>32	byte		0			\b, Hash
783b6cee71dSXin LI!:mime	application/x-tokyocabinet-hash
784b6cee71dSXin LI>32	byte		1			\b, B+ tree
785b6cee71dSXin LI!:mime	application/x-tokyocabinet-btree
786b6cee71dSXin LI>32	byte		2			\b, Fixed-length
787b6cee71dSXin LI!:mime	application/x-tokyocabinet-fixed
788b6cee71dSXin LI>32	byte		3			\b, Table
789b6cee71dSXin LI!:mime	application/x-tokyocabinet-table
790b6cee71dSXin LI>33	byte		&1			\b, [open]
791b6cee71dSXin LI>33	byte		&2			\b, [fatal]
792b6cee71dSXin LI>34	byte		x			\b, apow=%d
793b6cee71dSXin LI>35	byte		x			\b, fpow=%d
794b6cee71dSXin LI>36	byte		&0x01			\b, [large]
795b6cee71dSXin LI>36	byte		&0x02			\b, [deflate]
796b6cee71dSXin LI>36	byte		&0x04			\b, [bzip]
797b6cee71dSXin LI>36	byte		&0x08			\b, [tcbs]
798b6cee71dSXin LI>36	byte		&0x10			\b, [excodec]
799b6cee71dSXin LI>40	lequad		x			\b, bnum=%lld
800b6cee71dSXin LI>48	lequad		x			\b, rnum=%lld
801b6cee71dSXin LI>56	lequad		x			\b, fsiz=%lld
802b6cee71dSXin LI
803b6cee71dSXin LI# Type:	QDBM Quick Database Manager
804b6cee71dSXin LI# From:	Benoit Sibaud <bsibaud@april.org>
805b6cee71dSXin LI0	string		\\[depot\\]\n\f		Quick Database Manager, little endian
806b6cee71dSXin LI0	string		\\[DEPOT\\]\n\f		Quick Database Manager, big endian
807b6cee71dSXin LI
808b6cee71dSXin LI# Type:	TokyoCabinet database
809b6cee71dSXin LI# URL:	http://tokyocabinet.sourceforge.net/
810b6cee71dSXin LI# From:	Benoit Sibaud <bsibaud@april.org>
811b6cee71dSXin LI0	string		ToKyO\ CaBiNeT\n	TokyoCabinet database
812b6cee71dSXin LI>14	string		x			(version %s)
813b6cee71dSXin LI
81448c779cdSXin LI# From:  Stephane Blondon https://www.yaal.fr
815b6cee71dSXin LI# Database file for Zope (done by FileStorage)
8169fc5c47fSXin LI0	string	FS21	Zope Object Database File Storage v3 (data)
8179fc5c47fSXin LI0	string	FS30	Zope Object Database File Storage v4 (data)
8189fc5c47fSXin LI
819b6cee71dSXin LI# Cache file for the database of Zope (done by ClientStorage)
820b6cee71dSXin LI0	string		ZEC3	Zope Object Database Client Cache File (data)
821b6cee71dSXin LI
822b6cee71dSXin LI# IDA (Interactive Disassembler) database
823b6cee71dSXin LI0	string		IDA1	IDA (Interactive Disassembler) database
8249ce06829SXin LI
82548c779cdSXin LI# Hopper (reverse engineering tool) https://www.hopperapp.com/
8269ce06829SXin LI0	string		hopperdb	Hopper database
8279ce06829SXin LI
8283e41d09dSXin LI# URL: https://en.wikipedia.org/wiki/Panorama_(database_engine)
8293e41d09dSXin LI# Reference: http://www.provue.com/Panorama/
8303e41d09dSXin LI# From: Joerg Jenderek
8313e41d09dSXin LI# NOTE: test only versions 4 and 6.0 with Windows
8323e41d09dSXin LI# length of Panorama database name
8333e41d09dSXin LI5	ubyte				>0
8343e41d09dSXin LI# look after database name for "some" null bits
8353e41d09dSXin LI>(5.B+7)	ubelong&0xF3ffF000	0
8363e41d09dSXin LI# look for first keyword
8373e41d09dSXin LI>>&1		search/2		DESIGN		Panorama database
8383e41d09dSXin LI#!:mime	application/x-panorama-database
8393e41d09dSXin LI!:apple	KASXZEPD
8403e41d09dSXin LI!:ext	pan
8413e41d09dSXin LI# database name
8423e41d09dSXin LI>>>5	pstring				x		\b, "%s"
843282e23f0SXin LI
844282e23f0SXin LI#
845282e23f0SXin LI#
846282e23f0SXin LI# askSam Database by Stefan A. Haubenthal <polluks@web.de>
847282e23f0SXin LI0	string	askw40\0	askSam DB
848282e23f0SXin LI
849282e23f0SXin LI#
850282e23f0SXin LI#
851282e23f0SXin LI# MUIbase Database Tool by Stefan A. Haubenthal <polluks@web.de>
852282e23f0SXin LI0	string	MBSTV\040	MUIbase DB
853282e23f0SXin LI>6	string	x		version %s
85440427ccaSGordon Tetlow
85540427ccaSGordon Tetlow#
85640427ccaSGordon Tetlow# CDB database
85740427ccaSGordon Tetlow0	string	NBCDB\012	NetBSD Constant Database
85840427ccaSGordon Tetlow>7	byte	x		\b, version %d
85940427ccaSGordon Tetlow>8	string	x		\b, for '%s'
86040427ccaSGordon Tetlow>24	lelong	x		\b, datasize %d
86140427ccaSGordon Tetlow>28	lelong	x		\b, entries %d
86240427ccaSGordon Tetlow>32	lelong	x		\b, index %d
86340427ccaSGordon Tetlow>36	lelong	x		\b, seed %#x
8642dc4dbb9SEitan Adler
8652dc4dbb9SEitan Adler#
8662dc4dbb9SEitan Adler# Redis RDB - https://redis.io/topics/persistence
8672dc4dbb9SEitan Adler0	string	REDIS			Redis RDB file,
8682dc4dbb9SEitan Adler>5	regex	[0-9][0-9][0-9][0-9]	version %s
8692dc4dbb9SEitan Adler
8702dc4dbb9SEitan Adler# Mork database.
8712dc4dbb9SEitan Adler# Used by older versions of Mozilla Suite and Firefox,
8722dc4dbb9SEitan Adler# and current versions of Thunderbird.
8732dc4dbb9SEitan Adler# From: David Korth <gerbilsoft@gerbilsoft.com>
8742dc4dbb9SEitan Adler0	string	//\ <!--\ <mdb:mork:z\ v="	Mozilla Mork database
8752dc4dbb9SEitan Adler>23	string	x		\b, version %.3s
8762726a701SXin LI
8772726a701SXin LI# URL:		https://en.wikipedia.org/wiki/Management_Information_Format
8782726a701SXin LI# Reference:	https://www.dmtf.org/sites/default/files/standards/documents/DSP0005.pdf
8792726a701SXin LI# From:		Joerg Jenderek
8802726a701SXin LI# Note:		only tested with monitor asset reports of Dell Display Manager
8812726a701SXin LI#		skip start like Language=fr|CA|iso8859-1
8822726a701SXin LI0	search/27/C	Start\040Component	DMI Management Information Format
8832726a701SXin LI#!:mime	text/plain
8842726a701SXin LI!:mime	text/x-dmtf-mif
8852726a701SXin LI!:ext	mif
8862726a701SXin LI
887