xref: /netbsd-src/external/bsd/file/dist/magic/magdir/database (revision e15daa8be9575f7ad2ca804c7c7c2d7f8e182d98)
11b108b8bSchristos
21b108b8bSchristos#------------------------------------------------------------------------------
3*e15daa8bSchristos# $File: database,v 1.69 2023/01/12 00:14:04 christos Exp $
41b108b8bSchristos# database:  file(1) magic for various databases
51b108b8bSchristos#
61b108b8bSchristos# extracted from header/code files by Graeme Wilford (eep2gw@ee.surrey.ac.uk)
71b108b8bSchristos#
81b108b8bSchristos#
91b108b8bSchristos# GDBM magic numbers
101b108b8bSchristos#  Will be maintained as part of the GDBM distribution in the future.
111b108b8bSchristos#  <downsj@teeny.org>
12ebfd1121Schristos0	belong	0x13579acd	GNU dbm 1.x or ndbm database, big endian, 32-bit
131b108b8bSchristos!:mime	application/x-gdbm
14ebfd1121Schristos0	belong	0x13579ace	GNU dbm 1.x or ndbm database, big endian, old
15ebfd1121Schristos!:mime	application/x-gdbm
16ebfd1121Schristos0	belong	0x13579acf	GNU dbm 1.x or ndbm database, big endian, 64-bit
17ebfd1121Schristos!:mime	application/x-gdbm
18ebfd1121Schristos0	lelong	0x13579acd	GNU dbm 1.x or ndbm database, little endian, 32-bit
19ebfd1121Schristos!:mime	application/x-gdbm
20ebfd1121Schristos0	lelong	0x13579ace	GNU dbm 1.x or ndbm database, little endian, old
21ebfd1121Schristos!:mime	application/x-gdbm
22ebfd1121Schristos0	lelong	0x13579acf	GNU dbm 1.x or ndbm database, little endian, 64-bit
231b108b8bSchristos!:mime	application/x-gdbm
241b108b8bSchristos0	string	GDBM		GNU dbm 2.x database
251b108b8bSchristos!:mime	application/x-gdbm
261b108b8bSchristos#
271b108b8bSchristos# Berkeley DB
281b108b8bSchristos#
291b108b8bSchristos# Ian Darwin's file /etc/magic files: big/little-endian version.
301b108b8bSchristos#
311b108b8bSchristos# Hash 1.85/1.86 databases store metadata in network byte order.
321b108b8bSchristos# Btree 1.85/1.86 databases store the metadata in host byte order.
331b108b8bSchristos# Hash and Btree 2.X and later databases store the metadata in host byte order.
341b108b8bSchristos
351b108b8bSchristos0	long	0x00061561	Berkeley DB
361b108b8bSchristos!:mime	application/x-dbm
371b108b8bSchristos>8	belong	4321
381b108b8bSchristos>>4	belong	>2		1.86
391b108b8bSchristos>>4	belong	<3		1.85
401b108b8bSchristos>>4	belong	>0		(Hash, version %d, native byte-order)
411b108b8bSchristos>8	belong	1234
421b108b8bSchristos>>4	belong	>2		1.86
431b108b8bSchristos>>4	belong	<3		1.85
441b108b8bSchristos>>4	belong	>0		(Hash, version %d, little-endian)
451b108b8bSchristos
461b108b8bSchristos0	belong	0x00061561	Berkeley DB
471b108b8bSchristos>8	belong	4321
481b108b8bSchristos>>4	belong	>2		1.86
491b108b8bSchristos>>4	belong	<3		1.85
501b108b8bSchristos>>4	belong	>0		(Hash, version %d, big-endian)
511b108b8bSchristos>8	belong	1234
521b108b8bSchristos>>4	belong	>2		1.86
531b108b8bSchristos>>4	belong	<3		1.85
541b108b8bSchristos>>4	belong	>0		(Hash, version %d, native byte-order)
551b108b8bSchristos
561b108b8bSchristos0	long	0x00053162	Berkeley DB 1.85/1.86
571b108b8bSchristos>4	long	>0		(Btree, version %d, native byte-order)
581b108b8bSchristos0	belong	0x00053162	Berkeley DB 1.85/1.86
591b108b8bSchristos>4	belong	>0		(Btree, version %d, big-endian)
601b108b8bSchristos0	lelong	0x00053162	Berkeley DB 1.85/1.86
611b108b8bSchristos>4	lelong	>0		(Btree, version %d, little-endian)
621b108b8bSchristos
631b108b8bSchristos12	long	0x00061561	Berkeley DB
641b108b8bSchristos>16	long	>0		(Hash, version %d, native byte-order)
651b108b8bSchristos12	belong	0x00061561	Berkeley DB
661b108b8bSchristos>16	belong	>0		(Hash, version %d, big-endian)
671b108b8bSchristos12	lelong	0x00061561	Berkeley DB
681b108b8bSchristos>16	lelong	>0		(Hash, version %d, little-endian)
691b108b8bSchristos
701b108b8bSchristos12	long	0x00053162	Berkeley DB
711b108b8bSchristos>16	long	>0		(Btree, version %d, native byte-order)
721b108b8bSchristos12	belong	0x00053162	Berkeley DB
731b108b8bSchristos>16	belong	>0		(Btree, version %d, big-endian)
741b108b8bSchristos12	lelong	0x00053162	Berkeley DB
751b108b8bSchristos>16	lelong	>0		(Btree, version %d, little-endian)
761b108b8bSchristos
771b108b8bSchristos12	long	0x00042253	Berkeley DB
781b108b8bSchristos>16	long	>0		(Queue, version %d, native byte-order)
791b108b8bSchristos12	belong	0x00042253	Berkeley DB
801b108b8bSchristos>16	belong	>0		(Queue, version %d, big-endian)
811b108b8bSchristos12	lelong	0x00042253	Berkeley DB
821b108b8bSchristos>16	lelong	>0		(Queue, version %d, little-endian)
831b108b8bSchristos
841b108b8bSchristos# From Max Bowsher.
851b108b8bSchristos12	long	0x00040988	Berkeley DB
861b108b8bSchristos>16	long	>0		(Log, version %d, native byte-order)
871b108b8bSchristos12	belong	0x00040988	Berkeley DB
881b108b8bSchristos>16	belong	>0		(Log, version %d, big-endian)
891b108b8bSchristos12	lelong	0x00040988	Berkeley DB
901b108b8bSchristos>16	lelong	>0		(Log, version %d, little-endian)
911b108b8bSchristos
921b108b8bSchristos#
931b108b8bSchristos#
941b108b8bSchristos# Round Robin Database Tool by Tobias Oetiker <oetiker@ee.ethz.ch>
958df916c0Schristos0	string/b	RRD\0		RRDTool DB
968df916c0Schristos>4	string/b	x		version %s
97012fd133Schristos
98012fd133Schristos>>10	short		!0		16bit aligned
99012fd133Schristos>>>10	bedouble	8.642135e+130	big-endian
100012fd133Schristos>>>>18	short		x		32bit long (m68k)
101012fd133Schristos
102012fd133Schristos>>10	short		0
103012fd133Schristos>>>12	long		!0		32bit aligned
104012fd133Schristos>>>>12	bedouble	8.642135e+130	big-endian
105012fd133Schristos>>>>>20 long		0		64bit long
106012fd133Schristos>>>>>20 long		!0		32bit long
107012fd133Schristos>>>>12	ledouble	8.642135e+130	little-endian
108012fd133Schristos>>>>>24 long		0		64bit long
109012fd133Schristos>>>>>24 long		!0		32bit long (i386)
110012fd133Schristos>>>>12	string		\x43\x2b\x1f\x5b\x2f\x25\xc0\xc7	middle-endian
111012fd133Schristos>>>>>24 short		!0		32bit long (arm)
112012fd133Schristos
113012fd133Schristos>>8	quad		0		64bit aligned
114012fd133Schristos>>>16	bedouble	8.642135e+130	big-endian
115012fd133Schristos>>>>24	long		0		64bit long (s390x)
116012fd133Schristos>>>>24	long		!0		32bit long (hppa/mips/ppc/s390/SPARC)
117012fd133Schristos>>>16	ledouble	8.642135e+130	little-endian
118012fd133Schristos>>>>28	long		0		64bit long (alpha/amd64/ia64)
119012fd133Schristos>>>>28	long		!0		32bit long (armel/mipsel)
120012fd133Schristos
1211b108b8bSchristos#----------------------------------------------------------------------
1221b108b8bSchristos# ROOT: file(1) magic for ROOT databases
1231b108b8bSchristos#
1241b108b8bSchristos0       string  root\0  ROOT file
1251b108b8bSchristos>4      belong  x       Version %d
1261b108b8bSchristos>33     belong  x       (Compression: %d)
1271b108b8bSchristos
1281b108b8bSchristos# XXX: Weak magic.
1291b108b8bSchristos# Alex Ott <ott@jet.msk.su>
1301b108b8bSchristos## Paradox file formats
1311b108b8bSchristos#2	  leshort	0x0800	Paradox
1321b108b8bSchristos#>0x39	  byte		3	v. 3.0
1331b108b8bSchristos#>0x39	  byte		4	v. 3.5
1341b108b8bSchristos#>0x39	  byte		9	v. 4.x
1351b108b8bSchristos#>0x39	  byte		10	v. 5.x
1361b108b8bSchristos#>0x39	  byte		11	v. 5.x
1371b108b8bSchristos#>0x39	  byte		12	v. 7.x
1381b108b8bSchristos#>>0x04	  byte		0	indexed .DB data file
1391b108b8bSchristos#>>0x04	  byte		1	primary index .PX file
1401b108b8bSchristos#>>0x04	  byte		2	non-indexed .DB data file
1411b108b8bSchristos#>>0x04	  byte		3	non-incrementing secondary index .Xnn file
1421b108b8bSchristos#>>0x04	  byte		4	secondary index .Ynn file
1431b108b8bSchristos#>>0x04	  byte		5	incrementing secondary index .Xnn file
1441b108b8bSchristos#>>0x04	  byte		6	non-incrementing secondary index .XGn file
1451b108b8bSchristos#>>0x04	  byte		7	secondary index .YGn file
1461b108b8bSchristos#>>>0x04	  byte		8	incrementing secondary index .XGn file
1471b108b8bSchristos
1481b108b8bSchristos## XBase database files
14952df37c7Schristos# updated by Joerg Jenderek at Feb 2013
150dc958920Schristos# https://www.dbase.com/Knowledgebase/INT/db7_file_fmt.htm
151dc958920Schristos# https://www.clicketyclick.dk/databases/xbase/format/dbf.html
15252df37c7Schristos# inspect VVYYMMDD , where 1<= MM <= 12 and 1<= DD <= 31
15352df37c7Schristos0	ubelong&0x0000FFFF		<0x00000C20
154a77ebd86Schristos!:strength +10
15552df37c7Schristos# skip Infocom game Z-machine
15652df37c7Schristos>2		ubyte			>0
15752df37c7Schristos# skip Androids *.xml
15852df37c7Schristos>>3		ubyte			>0
15952df37c7Schristos>>>3		ubyte			<32
16052df37c7Schristos# 1 < version VV
16152df37c7Schristos>>>>0		ubyte			>1
16252df37c7Schristos# skip HELP.CA3 by test for reserved byte ( NULL )
16352df37c7Schristos>>>>>27		ubyte			0
16452df37c7Schristos# reserved bytes not always 0 ; also found 0x3901 (T4.DBF) ,0x7101 (T5.DBF,T6.DBF)
16552df37c7Schristos#>>>>>30		ubeshort     		x		30NULL?%x
16652df37c7Schristos# possible production flag,tag numbers(<=0x30),tag length(<=0x20), reserved (NULL)
16752df37c7Schristos>>>>>>24	ubelong&0xffFFFFff	>0x01302000
16852df37c7Schristos# .DBF or .MDX
16952df37c7Schristos>>>>>>24	ubelong&0xffFFFFff	<0x01302001
17052df37c7Schristos# for Xbase Database file (*.DBF) reserved (NULL) for multi-user
17152df37c7Schristos>>>>>>>24	ubelong&0xffFFFFff	=0
17252df37c7Schristos# test for 2 reserved NULL bytes,transaction and encryption byte flag
17352df37c7Schristos>>>>>>>>12	ubelong&0xFFFFfEfE	0
17452df37c7Schristos# test for MDX flag
17552df37c7Schristos>>>>>>>>>28	ubyte			x
17652df37c7Schristos>>>>>>>>>28	ubyte&0xf8		0
17752df37c7Schristos# header size >= 32
17852df37c7Schristos>>>>>>>>>>8	uleshort		>31
17952df37c7Schristos# skip PIC15736.PCX by test for language driver name or field name
18052df37c7Schristos>>>>>>>>>>>32	ubyte			>0
18152df37c7Schristos#!:mime	application/x-dbf; charset=unknown-8bit ??
18252df37c7Schristos#!:mime	application/x-dbase
18352df37c7Schristos>>>>>>>>>>>>0	use			xbase-type
18452df37c7Schristos# database file
185a77ebd86Schristos>>>>>>>>>>>>28	ubyte&0x04		=0		\b DBF
186a77ebd86Schristos!:ext	dbf
187a77ebd86Schristos>>>>>>>>>>>>28	ubyte&0x04		=4		\b DataBaseContainer
188a77ebd86Schristos!:ext	dbc
18952df37c7Schristos>>>>>>>>>>>>4	lelong			0		\b, no records
190012fd133Schristos>>>>>>>>>>>>4	lelong			>0		\b, %d record
19152df37c7Schristos# plural s appended
19252df37c7Schristos>>>>>>>>>>>>>4	lelong			>1		\bs
193dc958920Schristos# https://www.clicketyclick.dk/databases/xbase/format/dbf_check.html#CHECK_DBF
19452df37c7Schristos# 1 <= record size <= 4000 (dBase 3,4) or 32 * KB (=0x8000)
19552df37c7Schristos>>>>>>>>>>>>10	uleshort		x		* %d
19652df37c7Schristos# file size = records * record size + header size
19752df37c7Schristos>>>>>>>>>>>>1	ubyte			x		\b, update-date
19852df37c7Schristos>>>>>>>>>>>>1	use			xbase-date
199dc958920Schristos# https://msdn.microsoft.com/de-de/library/cc483186(v=vs.71).aspx
200a77ebd86Schristos#>>>>>>>>>>>>29	ubyte			=0		\b, codepage ID=%#x
20152df37c7Schristos# 2~cp850 , 3~cp1252 , 0x1b~?? ; what code page is 0x1b ?
202a77ebd86Schristos>>>>>>>>>>>>29	ubyte			>0		\b, codepage ID=%#x
20352df37c7Schristos#>>>>>>>>>>>>28	ubyte&0x01		0		\b, no index file
204a77ebd86Schristos# MDX or CDX index
20552df37c7Schristos>>>>>>>>>>>>28	ubyte&0x01		1		\b, with index file .MDX
20652df37c7Schristos>>>>>>>>>>>>28	ubyte&0x02		2		\b, with memo .FPT
207a77ebd86Schristos#>>>>>>>>>>>>28	ubyte&0x04		4		\b, DataBaseContainer
20852df37c7Schristos# 1st record offset + 1 = header size
20952df37c7Schristos>>>>>>>>>>>>8	uleshort		>0
21052df37c7Schristos>>>>>>>>>>>>(8.s+1)	ubyte		>0
21152df37c7Schristos>>>>>>>>>>>>>8		uleshort	>0		\b, at offset %d
21252df37c7Schristos>>>>>>>>>>>>>(8.s+1)	ubyte		>0
21352df37c7Schristos>>>>>>>>>>>>>>&-1	string		>\0		1st record "%s"
21441da50d8Schristos# for multiple index files (*.MDX) Production flag,tag numbers(<=0x30),tag length(<=0x20), reserved (NULL)
21552df37c7Schristos>>>>>>>24	ubelong&0x0133f7ff	>0
21652df37c7Schristos# test for reserved NULL byte
2173c9d2f35Schristos>>>>>>>>47	ubyte			0
21852df37c7Schristos# test for valid TAG key format (0x10 or 0)
21952df37c7Schristos>>>>>>>>>559	ubyte&0xeF		0
22052df37c7Schristos# test MM <= 12
2213c9d2f35Schristos>>>>>>>>>>45	ubeshort		<0x0C20
2223c9d2f35Schristos>>>>>>>>>>>45	ubyte			>0
2233c9d2f35Schristos>>>>>>>>>>>>46	ubyte			<32
2243c9d2f35Schristos>>>>>>>>>>>>>46	ubyte			>0
22552df37c7Schristos#!:mime	application/x-mdx
2263c9d2f35Schristos>>>>>>>>>>>>>>0		use		xbase-type
2273c9d2f35Schristos>>>>>>>>>>>>>>0		ubyte		x		\b MDX
2283c9d2f35Schristos>>>>>>>>>>>>>>1		ubyte		x		\b, creation-date
2293c9d2f35Schristos>>>>>>>>>>>>>>1		use		xbase-date
2303c9d2f35Schristos>>>>>>>>>>>>>>44	ubyte		x		\b, update-date
2313c9d2f35Schristos>>>>>>>>>>>>>>44	use		xbase-date
23252df37c7Schristos# No.of tags in use (1,2,5,12)
2333c9d2f35Schristos>>>>>>>>>>>>>>28	uleshort	x		\b, %d
23452df37c7Schristos# No. of entries in tag (0x30)
2353c9d2f35Schristos>>>>>>>>>>>>>>25	ubyte		x		\b/%d tags
23652df37c7Schristos#  Length of tag
2373c9d2f35Schristos>>>>>>>>>>>>>>26	ubyte		x		* %d
23852df37c7Schristos# 1st tag name_
23952df37c7Schristos>>>>>>>>>>>>>548	string		x		\b, 1st tag "%.11s"
24052df37c7Schristos# 2nd tag name
24152df37c7Schristos#>>>>>>>>>>>>(26.b+548)	string		x		\b, 2nd tag "%.11s"
2421b108b8bSchristos#
24352df37c7Schristos#		Print the xBase names of different version variants
24452df37c7Schristos0	name				xbase-type
24552df37c7Schristos>0	ubyte		<2
24652df37c7Schristos# 1 < version
24752df37c7Schristos>0	ubyte		>1
24852df37c7Schristos>>0	ubyte		0x02		FoxBase
249a77ebd86Schristos!:mime	application/x-dbf
250a77ebd86Schristos# like: ACCESS.DBF USER.DBF dbase3date.dbf mitarbei.dbf produkte.dbf umlaut-test-v2.dbf
25152df37c7Schristos# FoxBase+/dBaseIII+, no memo
25252df37c7Schristos>>0	ubyte		0x03		FoxBase+/dBase III
253012fd133Schristos!:mime	application/x-dbf
254a77ebd86Schristos# like: 92DATA.DBF MSCATLOG.DBF SYLLABI2.DBF SYLLABUS.DBF T4.DBF Teleadr.dbf us_city.dbf
25552df37c7Schristos# dBASE IV no memo file
25652df37c7Schristos>>0	ubyte		0x04		dBase IV
257012fd133Schristos!:mime	application/x-dbf
258a77ebd86Schristos# like: Quattro-test11.dbf umlaut-test-v4.dbf
25952df37c7Schristos# dBASE V no memo file
26052df37c7Schristos>>0	ubyte		0x05		dBase V
261012fd133Schristos!:mime	application/x-dbf
262a77ebd86Schristos# like: dbase4double.dbf Quattro-test2.dbf umlaut-test7.dbf
263a77ebd86Schristos!:ext	dbf
264a77ebd86Schristos# probably Apollo Database Server 9.7? xBase (0x6)
265a77ebd86Schristos>>0	ubyte		0x06		Apollo
266a77ebd86Schristos!:mime	application/x-dbf
267a77ebd86Schristos# like: ALIAS.DBF CRYPT.DBF PROCS.DBF USERS.DBF
268a77ebd86Schristos# https://docs.microsoft.com/en-us/previous-versions/visualstudio/foxpro/st4a0s68(v=vs.80)
269a77ebd86Schristos>>0	ubyte		0x2F		FoxBase+/Dbase III plus, no memo
270a77ebd86Schristos!:mime	application/x-dbf
271a77ebd86Schristos# no example
27252df37c7Schristos>>0	ubyte		0x30		Visual FoxPro
273012fd133Schristos!:mime	application/x-dbf
274a77ebd86Schristos# like: 26FRX.DBF 30DBC.DBF 30DBCPRO.DBF BEHINDSC.DBF USER_LEV.DBF
275a77ebd86Schristos# Microsoft Visual FoxPro Database Container File like: FOXPRO-DB-TEST.DBC TESTDATA.DBC TASTRADE.DBC
27652df37c7Schristos>>0	ubyte		0x31		Visual FoxPro, autoincrement
277012fd133Schristos!:mime	application/x-dbf
278a77ebd86Schristos# like: AI_Table.DBF dbase_31.dbf w_cityFoxpro.dbf
27952df37c7Schristos# Visual FoxPro, with field type Varchar or Varbinary
28052df37c7Schristos>>0	ubyte		0x32		Visual FoxPro, with field type Varchar
281012fd133Schristos!:mime	application/x-dbf
282a77ebd86Schristos# like: dbase_32.dbf
28352df37c7Schristos# dBASE IV SQL, no memo;dbv memo var size (Flagship)
28452df37c7Schristos>>0	ubyte		0x43		dBase IV, with SQL table
285012fd133Schristos!:mime	application/x-dbf
286a77ebd86Schristos# like: ASSEMBLY.DBF INVENTRY.DBF STAFF.DBF
287a77ebd86Schristos# https://docs.microsoft.com/en-us/previous-versions/visualstudio/foxpro/st4a0s68(v=vs.80)
288a77ebd86Schristos>>0	ubyte		0x62		dBase IV, with SQL table
289012fd133Schristos#!:mime	application/x-dbf
290a77ebd86Schristos# no example
29152df37c7Schristos# dBASE IV, with memo!!
29252df37c7Schristos>>0	ubyte		0x7b		dBase IV, with memo
293012fd133Schristos!:mime	application/x-dbf
294a77ebd86Schristos# like: test3memo.DBF dbase5.DBF
295a77ebd86Schristos# https://docs.microsoft.com/en-us/previous-versions/visualstudio/foxpro/st4a0s68(v=vs.80)
296a77ebd86Schristos>>0	ubyte		0x82		dBase IV, with SQL system
297012fd133Schristos#!:mime	application/x-dbf
298a77ebd86Schristos# no example
29952df37c7Schristos# FoxBase+/dBaseIII+ with memo .DBT!
30052df37c7Schristos>>0	ubyte		0x83		FoxBase+/dBase III, with memo .DBT
301012fd133Schristos!:mime	application/x-dbf
302a77ebd86Schristos# like: T2.DBF t3.DBF biblio.dbf dbase_83.dbf dbase3dbt0_4.dbf fsadress.dbf stop.dbf
30352df37c7Schristos# VISUAL OBJECTS (first 1.0 versions) for the Dbase III files (NTX clipper driver); memo file
30452df37c7Schristos>>0	ubyte		0x87		VISUAL OBJECTS, with memo file
305012fd133Schristos!:mime	application/x-dbf
306a77ebd86Schristos# like: ACCESS.DBF dbase3date.dbf dbase3float.dbf holdings.dbf mitarbei.dbf
307a77ebd86Schristos# https://docs.microsoft.com/en-us/previous-versions/visualstudio/foxpro/st4a0s68(v=vs.80)
308a77ebd86Schristos>>0	ubyte		0x8A		FoxBase+/dBase III, with memo .DBT
309012fd133Schristos#!:mime	application/x-dbf
310a77ebd86Schristos# no example
31152df37c7Schristos# dBASE IV with memo!
31252df37c7Schristos>>0	ubyte		0x8B		dBase IV, with memo .DBT
313012fd133Schristos!:mime	application/x-dbf
314a77ebd86Schristos# like: animals.dbf archive.dbf callin.dbf dbase_8b.dbf phnebook.dbf t6.dbf
31552df37c7Schristos# dBase IV with SQL Table,no memo?
31652df37c7Schristos>>0	ubyte		0x8E		dBase IV, with SQL table
317012fd133Schristos!:mime	application/x-dbf
318a77ebd86Schristos# like: dbase5.DBF test3memo.DBF test-memo.DBF
31952df37c7Schristos# .dbv and .dbt memo (Flagship)?
32052df37c7Schristos>>0	ubyte		0xB3		Flagship
321a77ebd86Schristos!:mime	application/x-dbf
322a77ebd86Schristos# no example
323a77ebd86Schristos# https://docs.microsoft.com/en-us/previous-versions/visualstudio/foxpro/st4a0s68(v=vs.80)
324a77ebd86Schristos>>0	ubyte		0xCA		dBase IV with memo .DBT
325012fd133Schristos#!:mime	application/x-dbf
326a77ebd86Schristos# no example
32752df37c7Schristos# dBASE IV with SQL table, with memo .DBT
32852df37c7Schristos>>0	ubyte		0xCB		dBase IV with SQL table, with memo .DBT
329012fd133Schristos!:mime	application/x-dbf
330a77ebd86Schristos# like: dbase5.DBF test3memo.DBF test-memo.DBF
33152df37c7Schristos# HiPer-Six format;Clipper SIX, with SMT memo file
33252df37c7Schristos>>0	ubyte		0xE5		Clipper SIX with memo
333012fd133Schristos!:mime	application/x-dbf
334a77ebd86Schristos# like: dbase5.DBF test3memo.DBF test-memo.DBF testClipper.dbf DATA.DBF
335a77ebd86Schristos# https://docs.microsoft.com/en-us/previous-versions/visualstudio/foxpro/st4a0s68(v=vs.80)
336a77ebd86Schristos>>0	ubyte		0xF4		dBase IV, with SQL table, with memo
337012fd133Schristos#!:mime	application/x-dbf
338a77ebd86Schristos# no example
33952df37c7Schristos>>0	ubyte		0xF5		FoxPro with memo
340012fd133Schristos!:mime	application/x-dbf
341a77ebd86Schristos# like: CUSTOMER.DBF FOXUSER1.DBF Invoice.DBF NG.DBF OBJSAMP.DBF dbase_f5.dbf kunde.dbf
342a77ebd86Schristos# probably Apollo Database Server 9.7 with SQL and memo mask? xBase (0xF6)
343a77ebd86Schristos>>0	ubyte		0xF6		Apollo, with SQL table with memo
344a77ebd86Schristos!:mime	application/x-dbf
345a77ebd86Schristos# like: SCRIPTS.DBF
346a77ebd86Schristos# https://docs.microsoft.com/en-us/previous-versions/visualstudio/foxpro/st4a0s68(v=vs.80)
34752df37c7Schristos#>>0	ubyte		0xFA		FoxPro 2.x, with memo
348012fd133Schristos#!:mime	application/x-dbf
349a77ebd86Schristos# no example
350012fd133Schristos# unknown version (should not happen)
35152df37c7Schristos>>0	default		x		xBase
352012fd133Schristos!:mime	application/x-dbf
353a77ebd86Schristos>>>0	ubyte		x		(%#x)
35452df37c7Schristos# flags in version byte
35552df37c7Schristos# DBT flag (with dBASE III memo .DBT)!!
35652df37c7Schristos# >>0	ubyte&0x80	>0		DBT_FLAG=%x
35752df37c7Schristos# memo flag ??
35852df37c7Schristos# >>0	ubyte&0x08	>0		MEMO_FLAG=%x
35952df37c7Schristos# SQL flag ??
36052df37c7Schristos# >>0	ubyte&0x70	>0		SQL_FLAG=%x
36152df37c7Schristos#		test and print the date of xBase .DBF .MDX
36252df37c7Schristos0	name				xbase-date
36352df37c7Schristos# inspect YYMMDD , where 1<= MM <= 12 and 1<= DD <= 31
36452df37c7Schristos>0	ubelong		x
36552df37c7Schristos>1	ubyte		<13
36652df37c7Schristos>>1	ubyte		>0
36752df37c7Schristos>>>2	ubyte		>0
36852df37c7Schristos>>>>2	ubyte		<32
36952df37c7Schristos>>>>>0	ubyte		x
37052df37c7Schristos# YY is interpreted as 20YY or 19YY
37152df37c7Schristos>>>>>>0	ubyte		<100		\b %.2d
37252df37c7Schristos# YY is interpreted 1900+YY; TODO: display yy or 20yy instead 1YY
37352df37c7Schristos>>>>>>0	ubyte		>99		\b %d
37452df37c7Schristos>>>>>1	ubyte		x		\b-%d
37552df37c7Schristos>>>>>2	ubyte		x		\b-%d
37652df37c7Schristos
37752df37c7Schristos#	dBase memo files .DBT or .FPT
378dc958920Schristos# https://msdn.microsoft.com/en-us/library/8599s21w(v=vs.80).aspx
37952df37c7Schristos16		ubyte		<4
38052df37c7Schristos>16		ubyte		!2
38152df37c7Schristos>>16		ubyte		!1
38252df37c7Schristos# next free block index is positive
38352df37c7Schristos>>>0		ulelong		>0
38452df37c7Schristos# skip many JPG. ZIP, BZ2 by test for reserved bytes NULL , 0|2 , 0|1 , low byte of block size
385eff51ed2Schristos>>>>17		ubelong&0xFFfdFEff	0x00000000
38652df37c7Schristos# skip many RAR by test for low byte 0 ,high byte 0|2|even of block size, 0|a|e|d7 , 0|64h
38752df37c7Schristos>>>>>20		ubelong&0xFF01209B	0x00000000
38852df37c7Schristos# dBASE III
38952df37c7Schristos>>>>>>16	ubyte		3
390*e15daa8bSchristos# skip with invalid "low" 1st item "\0\0\0\0" StateRepository-Deployment.srd-shm "\001\010\0\0" gcry_cast5.mod
391*e15daa8bSchristos>>>>>>>512	ubyte		>040
392*e15daa8bSchristos# skip with valid 1st item "rintf" keylayouts.mod
393*e15daa8bSchristos# by looking for valid terminating character Ctrl-Z like in test.dbt
394*e15daa8bSchristos>>>>>>>>513 search/3308	\032
395*e15daa8bSchristos# skip GRUB plan9.mod with invalid second terminating character 007
396*e15daa8bSchristos# by checking second terminating character Ctrl-Z like in test.dbt
397*e15daa8bSchristos>>>>>>>>>&0 ubyte		032
398*e15daa8bSchristos# dBASE III DBT with two Ctr-Z terminating characters
399*e15daa8bSchristos>>>>>>>>>>0	use		dbase3-memo-print
400*e15daa8bSchristos# second terminating character \0 like in dbase-memo.dbt or GRUB nativedisk.mod
401*e15daa8bSchristos>>>>>>>>>&0 ubyte		0
402*e15daa8bSchristos# skip GRUB nativedisk.mod with grub_mod_init\0grub_mod_fini\0grub_fs_autoload_hook\0
403*e15daa8bSchristos>>>>>>>>>>0x1ad string		!grub_mod_init
404*e15daa8bSchristos# like dbase-memo.dbt
405*e15daa8bSchristos>>>>>>>>>>>0	use		dbase3-memo-print
4063c9d2f35Schristos# dBASE III DBT without version, dBASE IV DBT , FoxPro FPT , or many ZIP , DBF garbage
40752df37c7Schristos>>>>>>16	ubyte		0
4083c9d2f35Schristos# unusual dBASE III DBT like angest.dbt, dBASE IV DBT with block size 0 , FoxPro FPT ,  or garbage PCX DBF
4093c9d2f35Schristos>>>>>>>20	uleshort	0
4103c9d2f35Schristos# FoxPro FPT , unusual dBASE III DBT like biblio.dbt or garbage
4113c9d2f35Schristos>>>>>>>>8	ulong		=0
4123c9d2f35Schristos>>>>>>>>>6	ubeshort	>0
4133c9d2f35Schristos# skip emacs.PIF
4143c9d2f35Schristos>>>>>>>>>>4	ushort		0
415eff51ed2Schristos# check for valid FoxPro field type
416eff51ed2Schristos>>>>>>>>>>>512	ubelong		<3
417a77ebd86Schristos# skip LXMDCLN4.OUT LXMDCLN6.OUT LXMDALG6.OUT with invalid blocksize 170=AAh
418a77ebd86Schristos>>>>>>>>>>>>6	ubeshort&0x002f	0
419a77ebd86Schristos>>>>>>>>>>>>>0	use		foxpro-memo-print
4203c9d2f35Schristos# dBASE III DBT , garbage
421eff51ed2Schristos# skip WORD1XW.DOC with improbably high free block index
42203c288bbSchristos>>>>>>>>>0	ulelong		<0x400000
42303c288bbSchristos# skip WinStore.App.exe by looking for printable 2nd character of 1st memo item
42403c288bbSchristos>>>>>>>>>>513	ubyte		>037
425a77ebd86Schristos# skip DOS executables CPQ0TD.DRV E30ODI.COM IBM0MONO.DRV by looking for printable 1st character of 1st memo item
426a77ebd86Schristos>>>>>>>>>>>512	ubyte		>037
427a77ebd86Schristos# 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
428a77ebd86Schristos>>>>>>>>>>>>512	ubyte		<0377
429*e15daa8bSchristos# skip some Commodore 64 Art Studio (Deep_Strike.aas dragon's_lair_ii.aas), some Atari DEGAS Elite bitmap (ELEPHANT.PC3 ST.PC2)
430*e15daa8bSchristos# some probably old GRUB modules (part_sun.mod) and virtual-boy-wario-land.vb.
431*e15daa8bSchristos# by looking for valid terminating character Ctrl-Z
432*e15daa8bSchristos>>>>>>>>>>>>>513 search/523	\032
433*e15daa8bSchristos# Atari DEGAS bitmap ST.PC2 with 0370 as second terminating character
434*e15daa8bSchristos#>>>>>>>>>>>>>>&0 ubyte		x		2ND_CHAR_IS=%o
435*e15daa8bSchristos# dBASE III DBT with two Ctr-Z terminating characters like dbase3dbt0_1.dbt dbase_83.dbt
436*e15daa8bSchristos>>>>>>>>>>>>>>&0 ubyte		032
437*e15daa8bSchristos>>>>>>>>>>>>>>>0 use		dbase3-memo-print
438*e15daa8bSchristos# second terminating character \0 like in pcidump.mod or fsadress.dbt umlaut-dbf-cmd.dbt
439*e15daa8bSchristos>>>>>>>>>>>>>>&0 ubyte		0
440*e15daa8bSchristos# look for old GRUB module pcidump.mod with specific content "pcidump\0Show raw dump of the PCI configuration space"
441*e15daa8bSchristos>>>>>>>>>>>>>>>514 search/0x11E	pcidump\0Show
442*e15daa8bSchristos# dBASE III DBT with Ctr-Z + \0 terminating characters like fsadress.dbt
443*e15daa8bSchristos>>>>>>>>>>>>>>>514 default	x
444*e15daa8bSchristos# unusual dBASE III DBT like fsadress.dbt umlaut-dbf-cmd.dbt
445*e15daa8bSchristos>>>>>>>>>>>>>>>>0 use		dbase3-memo-print
4463c9d2f35Schristos# dBASE III DBT like angest.dbt, or garbage PCX DBF
4473c9d2f35Schristos>>>>>>>>8	ubelong		!0
4483c9d2f35Schristos# skip PCX and some DBF by test for for reserved NULL bytes
4493c9d2f35Schristos>>>>>>>>>510	ubeshort	0
45003c288bbSchristos# skip bad symples with improbably high free block index above 2 GiB file limit
45103c288bbSchristos>>>>>>>>>>0	ulelong		<0x400000
45203c288bbSchristos# skip AI070GEP.EPS by printable 1st character of 1st memo item
45303c288bbSchristos>>>>>>>>>>>512	ubyte		>037
454a77ebd86Schristos# skip some Microsoft Visual C, OMF library like: BZ2.LIB WATTCPWL.LIB ZLIB.LIB
455a77ebd86Schristos>>>>>>>>>>>>512	ubyte		<0200
45603c288bbSchristos# skip gluon-ffhat-1.0-tp-link-tl-wr1043n-nd-v2-sysupgrade.bin by printable 2nd character
457a77ebd86Schristos>>>>>>>>>>>>>513 ubyte		>037
458a77ebd86Schristos# skip few (8/758) Microsoft Event Trace Logs (WBEngine.3.etl Wifi.etl) with valid 1st item like
459a77ebd86Schristos# "9600.20369.amd64fre.winblue_ltsb_escrow.220427-1727"
460a77ebd86Schristos# "9600.19846.amd64fre.winblue_ltsb_escrow.200923-1735"
461a77ebd86Schristos# "10586.494.amd64fre.th2_release_sec.160630-1736"
462a77ebd86Schristos# by looking for valid terminating character Ctrl-Z
463a77ebd86Schristos>>>>>>>>>>>>>>513 search/0x11E	\032
464a77ebd86Schristos# followed by second character Ctrl-Z implies typical DBT
465a77ebd86Schristos>>>>>>>>>>>>>>>&0	ubyte	032
466a77ebd86Schristos# examples like: angest.dbt
467a77ebd86Schristos>>>>>>>>>>>>>>>>0	use	dbase3-memo-print
468a77ebd86Schristos>>>>>>>>>>>>>>>&0	ubyte	0
469a77ebd86Schristos# no example found here with terminating sequence CTRL-Z + \0
470a77ebd86Schristos>>>>>>>>>>>>>>>>0	use	dbase3-memo-print
4713c9d2f35Schristos# dBASE IV DBT with positive block size
4723c9d2f35Schristos>>>>>>>20	uleshort	>0
473ae9cfef6Schristos# dBASE IV DBT with valid block length like 512, 1024
474ae9cfef6Schristos# multiple of 2 in between 16 and 16 K ,implies upper and lower bits are zero
475eff51ed2Schristos# skip also 3600h 3E00h size
476eff51ed2Schristos>>>>>>>>20	uleshort&0xE00f	0
477ae9cfef6Schristos>>>>>>>>>0	use		dbase4-memo-print
47852df37c7Schristos
4793c9d2f35Schristos#		Print the information of dBase III DBT memo file
4803c9d2f35Schristos0	name				dbase3-memo-print
4813c9d2f35Schristos>0	ubyte			x		dBase III DBT
482eff51ed2Schristos!:mime	application/x-dbt
483eff51ed2Schristos!:ext	dbt
4843c9d2f35Schristos# instead 3 as version number 0 for unusual examples like biblio.dbt
4853c9d2f35Schristos>16	ubyte			!3		\b, version number %u
48652df37c7Schristos# Number of next available block for appending data
4873c9d2f35Schristos#>0	lelong			=0		\b, next free block index %u
4883c9d2f35Schristos>0	lelong			!0		\b, next free block index %u
48925f16eeaSchristos# no positive block length
4903c9d2f35Schristos#>20	uleshort		=0		\b, block length %u
4913c9d2f35Schristos>20	uleshort		!0		\b, block length %u
492*e15daa8bSchristos# dBase III memo field terminated often by \032\032
493a77ebd86Schristos# like: "WHAT IS XBASE" test.dbt "Borges, Malte" biblio.dbt "First memo\032\032" T2.DBT
4943c9d2f35Schristos>512	string			>\0		\b, 1st item "%s"
495a77ebd86Schristos# For DEBUGGING
496a77ebd86Schristos#>512	ubelong			x		\b, 1ST item %#8.8x
497a77ebd86Schristos#>513	search/0x225		\032		FOUND_TERMINATOR
498a77ebd86Schristos#>>&0	ubyte			032		2xCTRL_Z
499a77ebd86Schristos# fsadress.dbt has 1 Ctrl-Z terminator followed by nil byte
500a77ebd86Schristos#>>&0	ubyte			0		1xCTRL_Z
501a77ebd86Schristos
502eff51ed2Schristos# https://www.clicketyclick.dk/databases/xbase/format/dbt.html
5033c9d2f35Schristos#		Print the information of dBase IV DBT memo file
5043c9d2f35Schristos0	name				dbase4-memo-print
5053c9d2f35Schristos>0		lelong		x		dBase IV DBT
506ae9cfef6Schristos!:mime	application/x-dbt
507ae9cfef6Schristos!:ext dbt
50825f16eeaSchristos# 8 character shorted main name of corresponding dBASE IV DBF file
5093c9d2f35Schristos>8		ubelong		>0x20000000
5103c9d2f35Schristos# skip unusual like for angest.dbt
5113c9d2f35Schristos>>20		uleshort	>0
5123c9d2f35Schristos>>>8		string		>\0		\b of %-.8s.DBF
5133c9d2f35Schristos# value 0 implies 512 as size
5143c9d2f35Schristos#>4		ulelong		=0		\b, blocks size %u
5153c9d2f35Schristos# size of blocks not reliable like 0x2020204C in angest.dbt
5163c9d2f35Schristos>4		ulelong		!0
5173c9d2f35Schristos>>4		ulelong&0x0000003f	0	\b, blocks size %u
5183c9d2f35Schristos# dBase IV DBT with positive block length (found 512 , 1024)
5193c9d2f35Schristos>20		uleshort	>0		\b, block length %u
5203c9d2f35Schristos# next available block
5213c9d2f35Schristos#>0		lelong		=0		\b, next free block index %u
5223c9d2f35Schristos>0		lelong		!0		\b, next free block index %u
5233c9d2f35Schristos>20		uleshort	>0
5243c9d2f35Schristos>>(20.s)	ubelong		x
5253c9d2f35Schristos>>>&-4		use		dbase4-memofield-print
5263c9d2f35Schristos# unusual dBase IV DBT without block length (implies 512 as length)
5273c9d2f35Schristos>20		uleshort	=0
52852df37c7Schristos>>512		ubelong		x
5293c9d2f35Schristos>>>&-4		use				dbase4-memofield-print
5303c9d2f35Schristos#		Print the information of dBase IV memo field
5313c9d2f35Schristos0	name			dbase4-memofield-print
5323c9d2f35Schristos# free dBase IV memo field
5333c9d2f35Schristos>0		ubelong		!0xFFFF0800
5343c9d2f35Schristos>>0		lelong		x		\b, next free block %u
5353c9d2f35Schristos>>4		lelong		x		\b, next used block %u
5363c9d2f35Schristos# used dBase IV memo field
5373c9d2f35Schristos>0		ubelong		=0xFFFF0800
5383c9d2f35Schristos# length of memo field
5393c9d2f35Schristos>>4		lelong		x		\b, field length %d
5403c9d2f35Schristos>>>8		string		>\0		\b, 1st used item "%s"
541eff51ed2Schristos# http://www.dbfree.org/webdocs/1-documentation/0018-developers_stuff_(advanced)/os_related_stuff/xbase_file_format.htm
5423c9d2f35Schristos#		Print the information of FoxPro FPT memo file
5433c9d2f35Schristos0	name				foxpro-memo-print
5443c9d2f35Schristos>0		belong		x		FoxPro FPT
545eff51ed2Schristos!:mime	application/x-fpt
546eff51ed2Schristos!:ext	fpt
547a77ebd86Schristos# Size of blocks for FoxPro ( 64,256 ); probably a multiple of two
5483c9d2f35Schristos>6		ubeshort	x		\b, blocks size %u
5493c9d2f35Schristos# next available block
5503c9d2f35Schristos#>0		belong		=0		\b, next free block index %u
5513c9d2f35Schristos>0		belong		!0		\b, next free block index %u
5523c9d2f35Schristos# field type ( 0~picture, 1~memo, 2~object )
5533c9d2f35Schristos>512		ubelong		<3		\b, field type %u
5543c9d2f35Schristos# length of memo field
5553c9d2f35Schristos>512		ubelong		1
5563c9d2f35Schristos>>516		belong		>0		\b, field length %d
5573c9d2f35Schristos>>>520		string		>\0		\b, 1st item "%s"
55852df37c7Schristos
559a77ebd86Schristos# Summary:	DBASE Compound Index file *.CDX and FoxPro index *.IDX
560a77ebd86Schristos# From:		Joerg Jenderek
561a77ebd86Schristos# URL:		https://www.clicketyclick.dk/databases/xbase/format/cdx.html
562a77ebd86Schristos#		https://www.clicketyclick.dk/databases/xbase/format/idx.html
563a77ebd86Schristos#		https://www.clicketyclick.dk/databases/xbase/format/idx_comp.html
564a77ebd86Schristos# Reference:	https://mark0.net/download/triddefs_xml.7z/defs/s/sybase-ianywhere-cdx.trid.xml
565a77ebd86Schristos#		https://mark0.net/download/triddefs_xml.7z/defs/c/cdx-vfp7.trid.xml
566a77ebd86Schristos# like: kunde.cdx
567a77ebd86Schristos0	ulelong		0x1C00
568a77ebd86Schristos>0	use			xbase-index
569a77ebd86Schristos# like: SYLLABI2.CDX SYLLABUS.CDX
570a77ebd86Schristos0	ulelong		0x0800
571a77ebd86Schristos>0	use			xbase-index
572a77ebd86Schristos# often in xBase index pointer to root node 400h
573a77ebd86Schristos0	ulelong		0x0400
574a77ebd86Schristos# skip most Maple help database *.hdb with version tag handled by ./maple
575a77ebd86Schristos>1028	string		!version
576a77ebd86Schristos# skip Maple help database hsum.hdb checking for valid reserved area
577a77ebd86Schristos>>492	quad		=0
578a77ebd86Schristos# skip remaining Maple help database *.hdb by checking key length
579a77ebd86Schristos#>>>12	uleshort	!0x000F			KEY_LENGTHVALID
580a77ebd86Schristos>>>0	use			xbase-index
581a77ebd86Schristos#	display information about dBase/FoxPro index
582a77ebd86Schristos0	name			xbase-index
583a77ebd86Schristos>0	ulelong		x			xBase
584a77ebd86Schristos!:mime	application/x-dbase-index
585a77ebd86Schristos>14	ubyte		&0x40			compound index
586a77ebd86Schristos# DCX for FoxPro database index like: TESTDATA.DCX
587a77ebd86Schristos!:ext	cdx/dcx
588a77ebd86Schristos>14	ubyte		^0x40			index
589a77ebd86Schristos# only 1 example like: TEST.IDX
590a77ebd86Schristos!:ext	idx
591a77ebd86Schristos# pointer to root node like: 1C00h 800h often 400h
592a77ebd86Schristos>0	ulelong		!0x400			\b, root pointer %#x
593a77ebd86Schristos# Pointer to free node list: often 0 but -1 if not present
594a77ebd86Schristos>4	ulelong		!0			\b, free node pointer %#x
595a77ebd86Schristos# MAYBE number of pages in file (Foxbase, FoxPro 1.x) or
596a77ebd86Schristos# http://www.foxpert.com/foxpro/knowlbits/files/knowlbits_200708_1.HTM
597a77ebd86Schristos# Whenever Visual FoxPro updates the index file it increments this reserved field
598a77ebd86Schristos# Reserved for internal use like: 02000000h 03000000h 460c0000h 780f0000h 89000000h 9fdc0100h often 0
599a77ebd86Schristos>8	ulelong		!0			\b, reserved counter %#x
600a77ebd86Schristos# length of key like: mostly 000Ah 0028h (TEST.IDX)
601a77ebd86Schristos>12	uleshort	!0x000A			\b, key length %#x
602a77ebd86Schristos# index options like: 24h E0h E8h
603a77ebd86Schristos# 1~a unique index 8~index has FOR clause 32~compact index format 64~compound index header
604a77ebd86Schristos# 16~Bit vector (SoftC) 128~Structure index (FoxPro)
605a77ebd86Schristos>14	ubyte		x			\b, index options (%#x
606a77ebd86Schristos>14	ubyte		&0x01			\b, unique
607a77ebd86Schristos>14	ubyte		&0x08			\b, has FOR clause
608a77ebd86Schristos>14	ubyte		&0x10			\b, bit vector (SoftC)
609a77ebd86Schristos>14	ubyte		&0x20			\b, compact format
610a77ebd86Schristos#>14	ubyte		&0x40			\b, compound header
611a77ebd86Schristos>14	ubyte		&0x80			\b, structure
612a77ebd86Schristos>14	ubyte		x			\b)
613a77ebd86Schristos# WHAT EXACTLY IS THAT? index signature like: 0 (sybase-ianywhere-cdx.trid.xml) 1 (cdx-vfp7.trid.xml)
614a77ebd86Schristos>15	ubyte		!0			\b, index signature %u
615a77ebd86Schristos# reserved area (0-bytes) til about 500, but not for uncompressed Index files *.idx
616a77ebd86Schristos>16	quad		!0			\b, at 16 reserved %#llx
617a77ebd86Schristos>492	quad		!0			\b, at 492 reserved %#llx
618a77ebd86Schristos# for IDX variant
619a77ebd86Schristos#>14	ubyte		^0x40			IDX
620a77ebd86Schristos# for CDX variant
621a77ebd86Schristos>14	ubyte		&0x40
622a77ebd86Schristos# Ascending or descending: 0~ascending 1~descending
623a77ebd86Schristos>>502	uleshort	x			\b, sort order %u
624a77ebd86Schristos# Total expression length (FoxPro 2) like: 0 1
625a77ebd86Schristos>>504	uleshort	!0			\b, expression length %u
626a77ebd86Schristos# FOR expression pool length like: 1
627a77ebd86Schristos>>506	uleshort	!1			\b, FOR expression pool length %#x
628a77ebd86Schristos# reserved for internal use like: 0
629a77ebd86Schristos>>508	uleshort	!0			\b, at 0x508 reserved %#x
630a77ebd86Schristos# Key expression pool length like: 1
631a77ebd86Schristos>>510	uleshort	!1			\b, key expression pool length %#x
632a77ebd86Schristos# 512 - 1023 Key & FOR expression pool (uncompiled)
633a77ebd86Schristos>>512	quad		!0			\b, key expression pool %#llx
634a77ebd86Schristos#>>520	quad		!0			\b, key expression pool %#llx
635a77ebd86Schristos
636a77ebd86Schristos# Summary:	dBASE IV Printer Form *.PRF
637a77ebd86Schristos# From:		Joerg Jenderek
638a77ebd86Schristos# URL:		https://en.wikipedia.org/wiki/.dbf#Other_file_types_found_in_dBASE
639a77ebd86Schristos# Reference:	https://mark0.net/download/triddefs_xml.7z/defs/p/prf-dbase.trid.xml
640a77ebd86Schristos0	ubeshort	0x0400
641a77ebd86Schristos# skip some Xbase Index files *.ndx and Infocom (Z-machine 4) *.z4 handled by ./adventure
642a77ebd86Schristos# by looking for valid printer driver name extension
643a77ebd86Schristos>0x58	search/8	.PR2
644a77ebd86Schristos>>0	use			xbase-prf
645a77ebd86Schristos#	display information of dbase print form like printer driver *.PR2
646a77ebd86Schristos0	name			xbase-prf	dBase Printer Form
647a77ebd86Schristos!:mime	application/x-dbase-prf
648a77ebd86Schristos!:ext	prf
649a77ebd86Schristos# MAYBE version? like: 4~DBASE IV
650a77ebd86Schristos#>0	ubyte		x			\b, version %u
651a77ebd86Schristos# MAYBE flag like: 1~with output file name 0~not
652a77ebd86Schristos#>2	ubyte		!0			\b, flag %u
653a77ebd86Schristos# optional printer text output file name like E:\DBASE\IV\T6.txt
654a77ebd86Schristos>3	string		>\0			\b, output file %s
655a77ebd86Schristos# probably padding with nils til 0x53
656a77ebd86Schristos#>0x48	 uquad		!0			\b, at 0x48 padding %#llx
657a77ebd86Schristos# dBASE IV printer driver name like: Generic.PR2 ASCII.PR2
658a77ebd86Schristos>0x56	string		>\0			\b, using printer driver %s
659a77ebd86Schristos# 2 is probably last character of previous dBASE printer driver name
660a77ebd86Schristos#>0x60	ubyte		!0x32			\b, at 0x60 %#x
661a77ebd86Schristos# probably padding with nils til 0xa8
662a77ebd86Schristos#>0x61	uquad		!0			\b, at 0x61 padding %#llx
663a77ebd86Schristos# unknown 0x03020300 0x03020100 at 0xa8
664a77ebd86Schristos>0xa8	ubelong 	x			\b, at 0xa8 unknown %#8.8x
665a77ebd86Schristos# probably padding with nils til 0x2aa
666a77ebd86Schristos#>0x2a0	uquad		!0			\b, at 0x2a0 padding %#llx
667a77ebd86Schristos# unknown 0x100ff7f01000001 at 0x2AB
668a77ebd86Schristos>0x2ab	ubequad		!0x100ff7f01000001	\b, at 0x2ab unknown %#llx
669a77ebd86Schristos# unknown 0x0042 at 0x2b3
670a77ebd86Schristos>0x2b3	ubeshort 	!0x0042			\b, at 0x2b3 unknown %#4.4x
671a77ebd86Schristos# unknown last 4 bytes at 0x2b6 like: 0 0x23
672a77ebd86Schristos>0x2b6	ubelong		!0			\b, at 0x2b6 unknown %#8.8x
673a77ebd86Schristos
67452df37c7Schristos# TODO:
67552df37c7Schristos# DBASE index file *.NDX
676a77ebd86Schristos# dBASE compiled Format *.FMO
677a77ebd86Schristos# FoxPro Database memo file *.DCT
678a77ebd86Schristos# FoxPro Forms Memo *.SCT
679a77ebd86Schristos# FoxPro Generated Menu Program *.MPR
680a77ebd86Schristos# FoxPro Report *.FRX
681a77ebd86Schristos# FoxPro Report Memo *.FRT
682a77ebd86Schristos# Foxpro Generated Screen Program *.SPR
683a77ebd86Schristos# Foxpro memo *.PJT
68452df37c7Schristos## End of XBase database stuff
6851b108b8bSchristos
6861b108b8bSchristos# MS Access database
6871b108b8bSchristos4	string	Standard\ Jet\ DB	Microsoft Access Database
6881b108b8bSchristos!:mime	application/x-msaccess
6892ae0d66fSchristos4	string	Standard\ ACE\ DB	Microsoft Access Database
6902ae0d66fSchristos!:mime	application/x-msaccess
6911b108b8bSchristos
692ae9cfef6Schristos# From: Joerg Jenderek
693ae9cfef6Schristos# URL: http://fileformats.archiveteam.org/wiki/Extensible_Storage_Engine
694ae9cfef6Schristos# Reference: https://github.com/libyal/libesedb/archive/master.zip
695ae9cfef6Schristos#	libesedb-master/documentation/
696ae9cfef6Schristos#	Extensible Storage Engine (ESE) Database File (EDB) format.asciidoc
697ae9cfef6Schristos# Note: also known as "JET Blue". Used by numerous Windows components such as
698ae9cfef6Schristos# Windows Search, Mail, Exchange and Active Directory.
699ae9cfef6Schristos4	ubelong		0xefcdab89
700ae9cfef6Schristos# unknown1
701ae9cfef6Schristos>132	ubelong		0		Extensible storage engine
702ae9cfef6Schristos!:mime	application/x-ms-ese
703ae9cfef6Schristos# file_type 0~database 1~stream
704ae9cfef6Schristos>>12	ulelong		0		DataBase
705ae9cfef6Schristos# Security DataBase (sdb)
706ae9cfef6Schristos!:ext	edb/sdb
707ae9cfef6Schristos>>12	ulelong		1		STreaMing
708ae9cfef6Schristos!:ext	stm
709ae9cfef6Schristos# format_version 620h
710a77ebd86Schristos>>8	uleshort	x		\b, version %#x
711a77ebd86Schristos>>10	uleshort	>0		revision %#4.4x
712a77ebd86Schristos>>0	ubelong		x	 	\b, checksum %#8.8x
713ae9cfef6Schristos# Page size 4096 8192 32768
714ae9cfef6Schristos>>236	ulequad		x		\b, page size %lld
715ae9cfef6Schristos# database_state
716ae9cfef6Schristos>>52	ulelong		1		\b, JustCreated
717ae9cfef6Schristos>>52	ulelong		2		\b, DirtyShutdown
718ae9cfef6Schristos#>>52	ulelong		3		\b, CleanShutdown
719ae9cfef6Schristos>>52	ulelong		4		\b, BeingConverted
720ae9cfef6Schristos>>52	ulelong		5		\b, ForceDetach
72103c288bbSchristos# Windows NT major version when the databases indexes were updated.
722ae9cfef6Schristos>>216	ulelong		x		\b, Windows version %d
72303c288bbSchristos# Windows NT minor version
724ae9cfef6Schristos>>220	ulelong		x		\b.%d
725ae9cfef6Schristos
726ae9cfef6Schristos# From: Joerg Jenderek
727dc958920Schristos# URL: https://forensicswiki.org/wiki/Windows_Application_Compatibility
728ae9cfef6Schristos# Note: files contain application compatibility fixes, application compatibility modes and application help messages.
729ae9cfef6Schristos8	string		sdbf
730ae9cfef6Schristos>7	ubyte		0
731ae9cfef6Schristos# TAG_TYPE_LIST+TAG_INDEXES
732ae9cfef6Schristos>>12	uleshort	0x7802		Windows application compatibility Shim DataBase
733ae9cfef6Schristos# version? 2 3
734ae9cfef6Schristos#>>>0	ulelong		x		\b, version %d
735ae9cfef6Schristos!:mime	application/x-ms-sdb
736ae9cfef6Schristos!:ext	sdb
737ae9cfef6Schristos
7381b108b8bSchristos# TDB database from Samba et al - Martin Pool <mbp@samba.org>
7391b108b8bSchristos0	string	TDB\ file		TDB database
7401b108b8bSchristos>32	lelong	0x2601196D		version 6, little-endian
7411b108b8bSchristos>>36	lelong	x			hash size %d bytes
7421b108b8bSchristos
7431b108b8bSchristos# SE Linux policy database
7441b108b8bSchristos0       lelong  0xf97cff8c      SE Linux policy
7451b108b8bSchristos>16     lelong  x               v%d
7461b108b8bSchristos>20     lelong  1      MLS
7471b108b8bSchristos>24     lelong  x       %d symbols
7481b108b8bSchristos>28     lelong  x       %d ocons
7491b108b8bSchristos
7501b108b8bSchristos# ICE authority file data (Wolfram Kleff)
7511b108b8bSchristos2	string		ICE		ICE authority data
7521b108b8bSchristos
7531b108b8bSchristos# X11 Xauthority file (Wolfram Kleff)
7541b108b8bSchristos10	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
7551b108b8bSchristos11	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
7561b108b8bSchristos12	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
7571b108b8bSchristos13	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
7581b108b8bSchristos14	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
7591b108b8bSchristos15	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
7601b108b8bSchristos16	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
7611b108b8bSchristos17	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
7621b108b8bSchristos18	string		MIT-MAGIC-COOKIE-1	X11 Xauthority data
7631b108b8bSchristos
7641b108b8bSchristos# From: Maxime Henrion <mux@FreeBSD.org>
7651b108b8bSchristos# PostgreSQL's custom dump format, Maxime Henrion <mux@FreeBSD.org>
7661b108b8bSchristos0	string		PGDMP		PostgreSQL custom database dump
7671b108b8bSchristos>5	byte		x		- v%d
7681b108b8bSchristos>6	byte		x		\b.%d
7691b108b8bSchristos>5	beshort		<0x101		\b-0
7701b108b8bSchristos>5	beshort		>0x100
7711b108b8bSchristos>>7	byte		x		\b-%d
7721b108b8bSchristos
7731b108b8bSchristos# Type: Advanced Data Format (ADF) database
774dc958920Schristos# URL:  https://www.grc.nasa.gov/WWW/cgns/adf/
7751b108b8bSchristos# From: Nicolas Chauvat <nicolas.chauvat@logilab.fr>
7761b108b8bSchristos0	string	@(#)ADF\ Database	CGNS Advanced Data Format
7771b108b8bSchristos
7781b108b8bSchristos# Tokyo Cabinet magic data
7791b108b8bSchristos# http://tokyocabinet.sourceforge.net/index.html
7801b108b8bSchristos0	string		ToKyO\ CaBiNeT\n	Tokyo Cabinet
7811b108b8bSchristos>14	string		x			\b (%s)
7821b108b8bSchristos>32	byte		0			\b, Hash
7831b108b8bSchristos!:mime	application/x-tokyocabinet-hash
7841b108b8bSchristos>32	byte		1			\b, B+ tree
7851b108b8bSchristos!:mime	application/x-tokyocabinet-btree
7861b108b8bSchristos>32	byte		2			\b, Fixed-length
7871b108b8bSchristos!:mime	application/x-tokyocabinet-fixed
7881b108b8bSchristos>32	byte		3			\b, Table
7891b108b8bSchristos!:mime	application/x-tokyocabinet-table
7901b108b8bSchristos>33	byte		&1			\b, [open]
7911b108b8bSchristos>33	byte		&2			\b, [fatal]
7921b108b8bSchristos>34	byte		x			\b, apow=%d
7931b108b8bSchristos>35	byte		x			\b, fpow=%d
7941b108b8bSchristos>36	byte		&0x01			\b, [large]
7951b108b8bSchristos>36	byte		&0x02			\b, [deflate]
7961b108b8bSchristos>36	byte		&0x04			\b, [bzip]
7971b108b8bSchristos>36	byte		&0x08			\b, [tcbs]
7981b108b8bSchristos>36	byte		&0x10			\b, [excodec]
7991b108b8bSchristos>40	lequad		x			\b, bnum=%lld
8001b108b8bSchristos>48	lequad		x			\b, rnum=%lld
8011b108b8bSchristos>56	lequad		x			\b, fsiz=%lld
8025ccaa8c0Schristos
8035ccaa8c0Schristos# Type:	QDBM Quick Database Manager
8045ccaa8c0Schristos# From:	Benoit Sibaud <bsibaud@april.org>
8055ccaa8c0Schristos0	string		\\[depot\\]\n\f		Quick Database Manager, little endian
8065ccaa8c0Schristos0	string		\\[DEPOT\\]\n\f		Quick Database Manager, big endian
8075ccaa8c0Schristos
8085ccaa8c0Schristos# Type:	TokyoCabinet database
8095ccaa8c0Schristos# URL:	http://tokyocabinet.sourceforge.net/
8105ccaa8c0Schristos# From:	Benoit Sibaud <bsibaud@april.org>
8115ccaa8c0Schristos0	string		ToKyO\ CaBiNeT\n	TokyoCabinet database
8125ccaa8c0Schristos>14	string		x			(version %s)
813f2668affSchristos
814dc958920Schristos# From:  Stephane Blondon https://www.yaal.fr
815f2668affSchristos# Database file for Zope (done by FileStorage)
816ae9cfef6Schristos0	string	FS21	Zope Object Database File Storage v3 (data)
817ae9cfef6Schristos0	string	FS30	Zope Object Database File Storage v4 (data)
818ae9cfef6Schristos
819f2668affSchristos# Cache file for the database of Zope (done by ClientStorage)
820f2668affSchristos0	string		ZEC3	Zope Object Database Client Cache File (data)
8212ae0d66fSchristos
8222ae0d66fSchristos# IDA (Interactive Disassembler) database
8232ae0d66fSchristos0	string		IDA1	IDA (Interactive Disassembler) database
824ae9cfef6Schristos
825dc958920Schristos# Hopper (reverse engineering tool) https://www.hopperapp.com/
826ae9cfef6Schristos0	string		hopperdb	Hopper database
827ae9cfef6Schristos
828ae9cfef6Schristos# URL: https://en.wikipedia.org/wiki/Panorama_(database_engine)
829ae9cfef6Schristos# Reference: http://www.provue.com/Panorama/
830ae9cfef6Schristos# From: Joerg Jenderek
831ae9cfef6Schristos# NOTE: test only versions 4 and 6.0 with Windows
832ae9cfef6Schristos# length of Panorama database name
833ae9cfef6Schristos5	ubyte				>0
834ae9cfef6Schristos# look after database name for "some" null bits
835ae9cfef6Schristos>(5.B+7)	ubelong&0xF3ffF000	0
836ae9cfef6Schristos# look for first keyword
837ae9cfef6Schristos>>&1		search/2		DESIGN		Panorama database
838ae9cfef6Schristos#!:mime	application/x-panorama-database
839ae9cfef6Schristos!:apple	KASXZEPD
840ae9cfef6Schristos!:ext	pan
841ae9cfef6Schristos# database name
842ae9cfef6Schristos>>>5	pstring				x		\b, "%s"
843ae9cfef6Schristos
844ae9cfef6Schristos#
845ae9cfef6Schristos#
846ae9cfef6Schristos# askSam Database by Stefan A. Haubenthal <polluks@web.de>
847ae9cfef6Schristos0	string	askw40\0	askSam DB
848ae9cfef6Schristos
849ae9cfef6Schristos#
850ae9cfef6Schristos#
851ae9cfef6Schristos# MUIbase Database Tool by Stefan A. Haubenthal <polluks@web.de>
852ae9cfef6Schristos0	string	MBSTV\040	MUIbase DB
853ae9cfef6Schristos>6	string	x		version %s
854008b33e8Schristos
855008b33e8Schristos#
856008b33e8Schristos# CDB database
857008b33e8Schristos0	string	NBCDB\012	NetBSD Constant Database
858008b33e8Schristos>7	byte	x		\b, version %d
859008b33e8Schristos>8	string	x		\b, for '%s'
860008b33e8Schristos>24	lelong	x		\b, datasize %d
861008b33e8Schristos>28	lelong	x		\b, entries %d
862008b33e8Schristos>32	lelong	x		\b, index %d
863008b33e8Schristos>36	lelong	x		\b, seed %#x
864006f8008Schristos
865006f8008Schristos#
866006f8008Schristos# Redis RDB - https://redis.io/topics/persistence
867006f8008Schristos0	string	REDIS			Redis RDB file,
868006f8008Schristos>5	regex	[0-9][0-9][0-9][0-9]	version %s
869006f8008Schristos
870006f8008Schristos# Mork database.
871006f8008Schristos# Used by older versions of Mozilla Suite and Firefox,
872006f8008Schristos# and current versions of Thunderbird.
873006f8008Schristos# From: David Korth <gerbilsoft@gerbilsoft.com>
874006f8008Schristos0	string	//\ <!--\ <mdb:mork:z\ v="	Mozilla Mork database
875006f8008Schristos>23	string	x		\b, version %.3s
87603c288bbSchristos
87703c288bbSchristos# URL:		https://en.wikipedia.org/wiki/Management_Information_Format
87803c288bbSchristos# Reference:	https://www.dmtf.org/sites/default/files/standards/documents/DSP0005.pdf
87903c288bbSchristos# From:		Joerg Jenderek
88003c288bbSchristos# Note:		only tested with monitor asset reports of Dell Display Manager
88103c288bbSchristos#		skip start like Language=fr|CA|iso8859-1
88203c288bbSchristos0	search/27/C	Start\040Component	DMI Management Information Format
88303c288bbSchristos#!:mime	text/plain
88403c288bbSchristos!:mime	text/x-dmtf-mif
88503c288bbSchristos!:ext	mif
88603c288bbSchristos
887