1b6cee71dSXin LI 2b6cee71dSXin LI#------------------------------------------------------------------------------ 3*282e23f0SXin LI# $File: database,v 1.49 2016/06/11 17:01:51 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 150b6cee71dSXin LI# http://www.dbase.com/Knowledgebase/INT/db7_file_fmt.htm 151b6cee71dSXin LI# http://www.clicketyclick.dk/databases/xbase/format/dbf.html 152b6cee71dSXin LI# http://home.f1.htw-berlin.de/scheibl/db/intern/dBase.htm 153b6cee71dSXin LI# inspect VVYYMMDD , where 1<= MM <= 12 and 1<= DD <= 31 154b6cee71dSXin LI0 ubelong&0x0000FFFF <0x00000C20 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 185b6cee71dSXin LI>>>>>>>>>>>>0 ubyte x \b DBF 186b6cee71dSXin LI>>>>>>>>>>>>4 lelong 0 \b, no records 187b6cee71dSXin LI>>>>>>>>>>>>4 lelong >0 \b, %d record 188b6cee71dSXin LI# plural s appended 189b6cee71dSXin LI>>>>>>>>>>>>>4 lelong >1 \bs 190b6cee71dSXin LI# http://www.clicketyclick.dk/databases/xbase/format/dbf_check.html#CHECK_DBF 191b6cee71dSXin LI# 1 <= record size <= 4000 (dBase 3,4) or 32 * KB (=0x8000) 192b6cee71dSXin LI>>>>>>>>>>>>10 uleshort x * %d 193b6cee71dSXin LI# file size = records * record size + header size 194b6cee71dSXin LI>>>>>>>>>>>>1 ubyte x \b, update-date 195b6cee71dSXin LI>>>>>>>>>>>>1 use xbase-date 196b6cee71dSXin LI# http://msdn.microsoft.com/de-de/library/cc483186(v=vs.71).aspx 197b6cee71dSXin LI#>>>>>>>>>>>>29 ubyte =0 \b, codepage ID=0x%x 198b6cee71dSXin LI# 2~cp850 , 3~cp1252 , 0x1b~?? ; what code page is 0x1b ? 199b6cee71dSXin LI>>>>>>>>>>>>29 ubyte >0 \b, codepage ID=0x%x 200b6cee71dSXin LI#>>>>>>>>>>>>28 ubyte&0x01 0 \b, no index file 201b6cee71dSXin LI>>>>>>>>>>>>28 ubyte&0x01 1 \b, with index file .MDX 202b6cee71dSXin LI>>>>>>>>>>>>28 ubyte&0x02 2 \b, with memo .FPT 203b6cee71dSXin LI>>>>>>>>>>>>28 ubyte&0x04 4 \b, DataBaseContainer 204b6cee71dSXin LI# 1st record offset + 1 = header size 205b6cee71dSXin LI>>>>>>>>>>>>8 uleshort >0 206b6cee71dSXin LI>>>>>>>>>>>>(8.s+1) ubyte >0 207b6cee71dSXin LI>>>>>>>>>>>>>8 uleshort >0 \b, at offset %d 208b6cee71dSXin LI>>>>>>>>>>>>>(8.s+1) ubyte >0 209b6cee71dSXin LI>>>>>>>>>>>>>>&-1 string >\0 1st record "%s" 210b6cee71dSXin LI# for multiple index files (*.MDX) Production flag,tag numbers(<=0x30),tag length(<=0x20), reserverd (NULL) 211b6cee71dSXin LI>>>>>>>24 ubelong&0x0133f7ff >0 212b6cee71dSXin LI# test for reserved NULL byte 213c2931133SXin LI>>>>>>>>47 ubyte 0 214b6cee71dSXin LI# test for valid TAG key format (0x10 or 0) 215b6cee71dSXin LI>>>>>>>>>559 ubyte&0xeF 0 216b6cee71dSXin LI# test MM <= 12 217c2931133SXin LI>>>>>>>>>>45 ubeshort <0x0C20 218c2931133SXin LI>>>>>>>>>>>45 ubyte >0 219c2931133SXin LI>>>>>>>>>>>>46 ubyte <32 220c2931133SXin LI>>>>>>>>>>>>>46 ubyte >0 221b6cee71dSXin LI#!:mime application/x-mdx 222c2931133SXin LI>>>>>>>>>>>>>>0 use xbase-type 223c2931133SXin LI>>>>>>>>>>>>>>0 ubyte x \b MDX 224c2931133SXin LI>>>>>>>>>>>>>>1 ubyte x \b, creation-date 225c2931133SXin LI>>>>>>>>>>>>>>1 use xbase-date 226c2931133SXin LI>>>>>>>>>>>>>>44 ubyte x \b, update-date 227c2931133SXin LI>>>>>>>>>>>>>>44 use xbase-date 228b6cee71dSXin LI# No.of tags in use (1,2,5,12) 229c2931133SXin LI>>>>>>>>>>>>>>28 uleshort x \b, %d 230b6cee71dSXin LI# No. of entries in tag (0x30) 231c2931133SXin LI>>>>>>>>>>>>>>25 ubyte x \b/%d tags 232b6cee71dSXin LI# Length of tag 233c2931133SXin LI>>>>>>>>>>>>>>26 ubyte x * %d 234b6cee71dSXin LI# 1st tag name_ 235b6cee71dSXin LI>>>>>>>>>>>>>548 string x \b, 1st tag "%.11s" 236b6cee71dSXin LI# 2nd tag name 237b6cee71dSXin LI#>>>>>>>>>>>>(26.b+548) string x \b, 2nd tag "%.11s" 238b6cee71dSXin LI# 239b6cee71dSXin LI# Print the xBase names of different version variants 240b6cee71dSXin LI0 name xbase-type 241b6cee71dSXin LI>0 ubyte <2 242b6cee71dSXin LI# 1 < version 243b6cee71dSXin LI>0 ubyte >1 244b6cee71dSXin LI>>0 ubyte 0x02 FoxBase 245b6cee71dSXin LI# FoxBase+/dBaseIII+, no memo 246b6cee71dSXin LI>>0 ubyte 0x03 FoxBase+/dBase III 247b6cee71dSXin LI!:mime application/x-dbf 248b6cee71dSXin LI# dBASE IV no memo file 249b6cee71dSXin LI>>0 ubyte 0x04 dBase IV 250b6cee71dSXin LI!:mime application/x-dbf 251b6cee71dSXin LI# dBASE V no memo file 252b6cee71dSXin LI>>0 ubyte 0x05 dBase V 253b6cee71dSXin LI!:mime application/x-dbf 254b6cee71dSXin LI>>0 ubyte 0x30 Visual FoxPro 255b6cee71dSXin LI!:mime application/x-dbf 256b6cee71dSXin LI>>0 ubyte 0x31 Visual FoxPro, autoincrement 257b6cee71dSXin LI!:mime application/x-dbf 258b6cee71dSXin LI# Visual FoxPro, with field type Varchar or Varbinary 259b6cee71dSXin LI>>0 ubyte 0x32 Visual FoxPro, with field type Varchar 260b6cee71dSXin LI!:mime application/x-dbf 261b6cee71dSXin LI# dBASE IV SQL, no memo;dbv memo var size (Flagship) 262b6cee71dSXin LI>>0 ubyte 0x43 dBase IV, with SQL table 263b6cee71dSXin LI!:mime application/x-dbf 264b6cee71dSXin LI# http://msdn.microsoft.com/en-US/library/st4a0s68(v=vs.80).aspx 265b6cee71dSXin LI#>>0 ubyte 0x62 dBase IV, with SQL table 266b6cee71dSXin LI#!:mime application/x-dbf 267b6cee71dSXin LI# dBASE IV, with memo!! 268b6cee71dSXin LI>>0 ubyte 0x7b dBase IV, with memo 269b6cee71dSXin LI!:mime application/x-dbf 270b6cee71dSXin LI# http://msdn.microsoft.com/en-US/library/st4a0s68(v=vs.80).aspx 271b6cee71dSXin LI#>>0 ubyte 0x82 dBase IV, with SQL system 272b6cee71dSXin LI#!:mime application/x-dbf 273b6cee71dSXin LI# FoxBase+/dBaseIII+ with memo .DBT! 274b6cee71dSXin LI>>0 ubyte 0x83 FoxBase+/dBase III, with memo .DBT 275b6cee71dSXin LI!:mime application/x-dbf 276b6cee71dSXin LI# VISUAL OBJECTS (first 1.0 versions) for the Dbase III files (NTX clipper driver); memo file 277b6cee71dSXin LI>>0 ubyte 0x87 VISUAL OBJECTS, with memo file 278b6cee71dSXin LI!:mime application/x-dbf 279b6cee71dSXin LI# http://msdn.microsoft.com/en-US/library/st4a0s68(v=vs.80).aspx 280b6cee71dSXin LI#>>0 ubyte 0x8A FoxBase+/dBase III, with memo .DBT 281b6cee71dSXin LI#!:mime application/x-dbf 282b6cee71dSXin LI# dBASE IV with memo! 283b6cee71dSXin LI>>0 ubyte 0x8B dBase IV, with memo .DBT 284b6cee71dSXin LI!:mime application/x-dbf 285b6cee71dSXin LI# dBase IV with SQL Table,no memo? 286b6cee71dSXin LI>>0 ubyte 0x8E dBase IV, with SQL table 287b6cee71dSXin LI!:mime application/x-dbf 288b6cee71dSXin LI# .dbv and .dbt memo (Flagship)? 289b6cee71dSXin LI>>0 ubyte 0xB3 Flagship 290b6cee71dSXin LI# http://msdn.microsoft.com/en-US/library/st4a0s68(v=vs.80).aspx 291b6cee71dSXin LI#>>0 ubyte 0xCA dBase IV with memo .DBT 292b6cee71dSXin LI#!:mime application/x-dbf 293b6cee71dSXin LI# dBASE IV with SQL table, with memo .DBT 294b6cee71dSXin LI>>0 ubyte 0xCB dBase IV with SQL table, with memo .DBT 295b6cee71dSXin LI!:mime application/x-dbf 296b6cee71dSXin LI# HiPer-Six format;Clipper SIX, with SMT memo file 297b6cee71dSXin LI>>0 ubyte 0xE5 Clipper SIX with memo 298b6cee71dSXin LI!:mime application/x-dbf 299b6cee71dSXin LI# http://msdn.microsoft.com/en-US/library/st4a0s68(v=vs.80).aspx 300b6cee71dSXin LI#>>0 ubyte 0xF4 dBase IV, with SQL table, with memo 301b6cee71dSXin LI#!:mime application/x-dbf 302b6cee71dSXin LI>>0 ubyte 0xF5 FoxPro with memo 303b6cee71dSXin LI!:mime application/x-dbf 304b6cee71dSXin LI# http://msdn.microsoft.com/en-US/library/st4a0s68(v=vs.80).aspx 305b6cee71dSXin LI#>>0 ubyte 0xFA FoxPro 2.x, with memo 306b6cee71dSXin LI#!:mime application/x-dbf 307b6cee71dSXin LI# unknown version (should not happen) 308b6cee71dSXin LI>>0 default x xBase 309b6cee71dSXin LI!:mime application/x-dbf 310b6cee71dSXin LI>>>0 ubyte x (0x%x) 311b6cee71dSXin LI# flags in version byte 312b6cee71dSXin LI# DBT flag (with dBASE III memo .DBT)!! 313b6cee71dSXin LI# >>0 ubyte&0x80 >0 DBT_FLAG=%x 314b6cee71dSXin LI# memo flag ?? 315b6cee71dSXin LI# >>0 ubyte&0x08 >0 MEMO_FLAG=%x 316b6cee71dSXin LI# SQL flag ?? 317b6cee71dSXin LI# >>0 ubyte&0x70 >0 SQL_FLAG=%x 318b6cee71dSXin LI# test and print the date of xBase .DBF .MDX 319b6cee71dSXin LI0 name xbase-date 320b6cee71dSXin LI# inspect YYMMDD , where 1<= MM <= 12 and 1<= DD <= 31 321b6cee71dSXin LI>0 ubelong x 322b6cee71dSXin LI>1 ubyte <13 323b6cee71dSXin LI>>1 ubyte >0 324b6cee71dSXin LI>>>2 ubyte >0 325b6cee71dSXin LI>>>>2 ubyte <32 326b6cee71dSXin LI>>>>>0 ubyte x 327b6cee71dSXin LI# YY is interpreted as 20YY or 19YY 328b6cee71dSXin LI>>>>>>0 ubyte <100 \b %.2d 329b6cee71dSXin LI# YY is interpreted 1900+YY; TODO: display yy or 20yy instead 1YY 330b6cee71dSXin LI>>>>>>0 ubyte >99 \b %d 331b6cee71dSXin LI>>>>>1 ubyte x \b-%d 332b6cee71dSXin LI>>>>>2 ubyte x \b-%d 333b6cee71dSXin LI 334b6cee71dSXin LI# dBase memo files .DBT or .FPT 335b6cee71dSXin LI# http://msdn.microsoft.com/en-us/library/8599s21w(v=vs.80).aspx 336b6cee71dSXin LI16 ubyte <4 337b6cee71dSXin LI>16 ubyte !2 338b6cee71dSXin LI>>16 ubyte !1 339b6cee71dSXin LI# next free block index is positive 340b6cee71dSXin LI>>>0 ulelong >0 341b6cee71dSXin LI# skip many JPG. ZIP, BZ2 by test for reserved bytes NULL , 0|2 , 0|1 , low byte of block size 342b6cee71dSXin LI>>>>17 ubelong&0xFFfdFE00 0x00000000 343b6cee71dSXin LI# skip many RAR by test for low byte 0 ,high byte 0|2|even of block size, 0|a|e|d7 , 0|64h 344b6cee71dSXin LI>>>>>20 ubelong&0xFF01209B 0x00000000 345b6cee71dSXin LI# dBASE III 346b6cee71dSXin LI>>>>>>16 ubyte 3 347b6cee71dSXin LI# dBASE III DBT 348c2931133SXin LI>>>>>>>0 use dbase3-memo-print 349c2931133SXin LI# dBASE III DBT without version, dBASE IV DBT , FoxPro FPT , or many ZIP , DBF garbage 350b6cee71dSXin LI>>>>>>16 ubyte 0 351c2931133SXin LI# unusual dBASE III DBT like angest.dbt, dBASE IV DBT with block size 0 , FoxPro FPT , or garbage PCX DBF 352c2931133SXin LI>>>>>>>20 uleshort 0 353c2931133SXin LI# FoxPro FPT , unusual dBASE III DBT like biblio.dbt or garbage 354c2931133SXin LI>>>>>>>>8 ulong =0 355c2931133SXin LI>>>>>>>>>6 ubeshort >0 356c2931133SXin LI# skip emacs.PIF 357c2931133SXin LI>>>>>>>>>>4 ushort 0 358c2931133SXin LI>>>>>>>>>>>0 use foxpro-memo-print 359c2931133SXin LI# dBASE III DBT , garbage 360c2931133SXin LI>>>>>>>>>6 ubeshort 0 361b6cee71dSXin LI# skip MM*DD*.bin by test for for reserved NULL byte 362c2931133SXin LI>>>>>>>>>>510 ubeshort 0 363c2931133SXin LI# skip TK-DOS11.img image by looking for memo text 364c2931133SXin LI>>>>>>>>>>>512 ubelong <0xfeffff03 365c2931133SXin LI# skip EFI executables by looking for memo text 366c2931133SXin LI>>>>>>>>>>>>512 ubelong >0x1F202020 367c2931133SXin LI>>>>>>>>>>>>>513 ubyte >0 368c2931133SXin LI# unusual dBASE III DBT like adressen.dbt 369c2931133SXin LI>>>>>>>>>>>>>>0 use dbase3-memo-print 370c2931133SXin LI# dBASE III DBT like angest.dbt, or garbage PCX DBF 371c2931133SXin LI>>>>>>>>8 ubelong !0 372c2931133SXin LI# skip PCX and some DBF by test for for reserved NULL bytes 373c2931133SXin LI>>>>>>>>>510 ubeshort 0 374c2931133SXin LI# skip some DBF by test of invalid version 375c2931133SXin LI>>>>>>>>>>0 ubyte >5 376c2931133SXin LI>>>>>>>>>>>0 ubyte <48 377c2931133SXin LI>>>>>>>>>>>>0 use dbase3-memo-print 378c2931133SXin LI# dBASE IV DBT with positive block size 379c2931133SXin LI>>>>>>>20 uleshort >0 3803e41d09dSXin LI# dBASE IV DBT with valid block length like 512, 1024 3813e41d09dSXin LI# multiple of 2 in between 16 and 16 K ,implies upper and lower bits are zero 3823e41d09dSXin LI>>>>>>>>20 uleshort&0x800f 0 3833e41d09dSXin LI>>>>>>>>>0 use dbase4-memo-print 384b6cee71dSXin LI 385c2931133SXin LI# Print the information of dBase III DBT memo file 386c2931133SXin LI0 name dbase3-memo-print 387c2931133SXin LI>0 ubyte x dBase III DBT 388c2931133SXin LI# instead 3 as version number 0 for unusual examples like biblio.dbt 389c2931133SXin LI>16 ubyte !3 \b, version number %u 390b6cee71dSXin LI# Number of next available block for appending data 391c2931133SXin LI#>0 lelong =0 \b, next free block index %u 392c2931133SXin LI>0 lelong !0 \b, next free block index %u 393c2931133SXin LI# no positiv block length 394c2931133SXin LI#>20 uleshort =0 \b, block length %u 395c2931133SXin LI>20 uleshort !0 \b, block length %u 396c2931133SXin LI# dBase III memo field terminated by \032\032 397c2931133SXin LI>512 string >\0 \b, 1st item "%s" 398c2931133SXin LI# Print the information of dBase IV DBT memo file 399c2931133SXin LI0 name dbase4-memo-print 400c2931133SXin LI>0 lelong x dBase IV DBT 4013e41d09dSXin LI!:mime application/x-dbt 4023e41d09dSXin LI!:ext dbt 403c2931133SXin LI# 8 character shorted main name of coresponding dBASE IV DBF file 404c2931133SXin LI>8 ubelong >0x20000000 405c2931133SXin LI# skip unusual like for angest.dbt 406c2931133SXin LI>>20 uleshort >0 407c2931133SXin LI>>>8 string >\0 \b of %-.8s.DBF 408c2931133SXin LI# value 0 implies 512 as size 409c2931133SXin LI#>4 ulelong =0 \b, blocks size %u 410c2931133SXin LI# size of blocks not reliable like 0x2020204C in angest.dbt 411c2931133SXin LI>4 ulelong !0 412c2931133SXin LI>>4 ulelong&0x0000003f 0 \b, blocks size %u 413c2931133SXin LI# dBase IV DBT with positive block length (found 512 , 1024) 414c2931133SXin LI>20 uleshort >0 \b, block length %u 415c2931133SXin LI# next available block 416c2931133SXin LI#>0 lelong =0 \b, next free block index %u 417c2931133SXin LI>0 lelong !0 \b, next free block index %u 418c2931133SXin LI>20 uleshort >0 419c2931133SXin LI>>(20.s) ubelong x 420c2931133SXin LI>>>&-4 use dbase4-memofield-print 421c2931133SXin LI# unusual dBase IV DBT without block length (implies 512 as length) 422c2931133SXin LI>20 uleshort =0 423b6cee71dSXin LI>>512 ubelong x 424c2931133SXin LI>>>&-4 use dbase4-memofield-print 425c2931133SXin LI# Print the information of dBase IV memo field 426c2931133SXin LI0 name dbase4-memofield-print 427c2931133SXin LI# free dBase IV memo field 428c2931133SXin LI>0 ubelong !0xFFFF0800 429c2931133SXin LI>>0 lelong x \b, next free block %u 430c2931133SXin LI>>4 lelong x \b, next used block %u 431c2931133SXin LI# used dBase IV memo field 432c2931133SXin LI>0 ubelong =0xFFFF0800 433c2931133SXin LI# length of memo field 434c2931133SXin LI>>4 lelong x \b, field length %d 435c2931133SXin LI>>>8 string >\0 \b, 1st used item "%s" 436c2931133SXin LI# Print the information of FoxPro FPT memo file 437c2931133SXin LI0 name foxpro-memo-print 438c2931133SXin LI>0 belong x FoxPro FPT 439c2931133SXin LI# Size of blocks for FoxPro ( 64,256 ) 440c2931133SXin LI>6 ubeshort x \b, blocks size %u 441c2931133SXin LI# next available block 442c2931133SXin LI#>0 belong =0 \b, next free block index %u 443c2931133SXin LI>0 belong !0 \b, next free block index %u 444c2931133SXin LI# field type ( 0~picture, 1~memo, 2~object ) 445c2931133SXin LI>512 ubelong <3 \b, field type %u 446c2931133SXin LI# length of memo field 447c2931133SXin LI>512 ubelong 1 448c2931133SXin LI>>516 belong >0 \b, field length %d 449c2931133SXin LI>>>520 string >\0 \b, 1st item "%s" 450b6cee71dSXin LI 451b6cee71dSXin LI# TODO: 452b6cee71dSXin LI# DBASE index file *.NDX 453b6cee71dSXin LI# DBASE Compound Index file *.CDX 454b6cee71dSXin LI# dBASE IV Printer Driver *.PRF 455b6cee71dSXin LI## End of XBase database stuff 456b6cee71dSXin LI 457b6cee71dSXin LI# MS Access database 458b6cee71dSXin LI4 string Standard\ Jet\ DB Microsoft Access Database 459b6cee71dSXin LI!:mime application/x-msaccess 460b6cee71dSXin LI4 string Standard\ ACE\ DB Microsoft Access Database 461b6cee71dSXin LI!:mime application/x-msaccess 462b6cee71dSXin LI 4633e41d09dSXin LI# From: Joerg Jenderek 4643e41d09dSXin LI# URL: http://fileformats.archiveteam.org/wiki/Extensible_Storage_Engine 4653e41d09dSXin LI# Reference: https://github.com/libyal/libesedb/archive/master.zip 4663e41d09dSXin LI# libesedb-master/documentation/ 4673e41d09dSXin LI# Extensible Storage Engine (ESE) Database File (EDB) format.asciidoc 4683e41d09dSXin LI# Note: also known as "JET Blue". Used by numerous Windows components such as 4693e41d09dSXin LI# Windows Search, Mail, Exchange and Active Directory. 4703e41d09dSXin LI4 ubelong 0xefcdab89 4713e41d09dSXin LI# unknown1 4723e41d09dSXin LI>132 ubelong 0 Extensible storage engine 4733e41d09dSXin LI!:mime application/x-ms-ese 4743e41d09dSXin LI# file_type 0~database 1~stream 4753e41d09dSXin LI>>12 ulelong 0 DataBase 4763e41d09dSXin LI# Security DataBase (sdb) 4773e41d09dSXin LI!:ext edb/sdb 4783e41d09dSXin LI>>12 ulelong 1 STreaMing 4793e41d09dSXin LI!:ext stm 4803e41d09dSXin LI# format_version 620h 4813e41d09dSXin LI>>8 uleshort x \b, version 0x%x 4823e41d09dSXin LI>>10 uleshort >0 revision 0x%4.4x 4833e41d09dSXin LI>>0 ubelong x \b, checksum 0x%8.8x 4843e41d09dSXin LI# Page size 4096 8192 32768 4853e41d09dSXin LI>>236 ulequad x \b, page size %lld 4863e41d09dSXin LI# database_state 4873e41d09dSXin LI>>52 ulelong 1 \b, JustCreated 4883e41d09dSXin LI>>52 ulelong 2 \b, DirtyShutdown 4893e41d09dSXin LI#>>52 ulelong 3 \b, CleanShutdown 4903e41d09dSXin LI>>52 ulelong 4 \b, BeingConverted 4913e41d09dSXin LI>>52 ulelong 5 \b, ForceDetach 4923e41d09dSXin LI# Windows�NT major version when the databases indexes were updated. 4933e41d09dSXin LI>>216 ulelong x \b, Windows version %d 4943e41d09dSXin LI# Windows�NT minor version 4953e41d09dSXin LI>>220 ulelong x \b.%d 4963e41d09dSXin LI 4973e41d09dSXin LI# From: Joerg Jenderek 4983e41d09dSXin LI# URL: http://forensicswiki.org/wiki/Windows_Application_Compatibility 4993e41d09dSXin LI# Note: files contain application compatibility fixes, application compatibility modes and application help messages. 5003e41d09dSXin LI8 string sdbf 5013e41d09dSXin LI>7 ubyte 0 5023e41d09dSXin LI# TAG_TYPE_LIST+TAG_INDEXES 5033e41d09dSXin LI>>12 uleshort 0x7802 Windows application compatibility Shim DataBase 5043e41d09dSXin LI# version? 2 3 5053e41d09dSXin LI#>>>0 ulelong x \b, version %d 5063e41d09dSXin LI!:mime application/x-ms-sdb 5073e41d09dSXin LI!:ext sdb 5083e41d09dSXin LI 509b6cee71dSXin LI# TDB database from Samba et al - Martin Pool <mbp@samba.org> 510b6cee71dSXin LI0 string TDB\ file TDB database 511b6cee71dSXin LI>32 lelong 0x2601196D version 6, little-endian 512b6cee71dSXin LI>>36 lelong x hash size %d bytes 513b6cee71dSXin LI 514b6cee71dSXin LI# SE Linux policy database 515b6cee71dSXin LI0 lelong 0xf97cff8c SE Linux policy 516b6cee71dSXin LI>16 lelong x v%d 517b6cee71dSXin LI>20 lelong 1 MLS 518b6cee71dSXin LI>24 lelong x %d symbols 519b6cee71dSXin LI>28 lelong x %d ocons 520b6cee71dSXin LI 521b6cee71dSXin LI# ICE authority file data (Wolfram Kleff) 522b6cee71dSXin LI2 string ICE ICE authority data 523b6cee71dSXin LI 524b6cee71dSXin LI# X11 Xauthority file (Wolfram Kleff) 525b6cee71dSXin LI10 string MIT-MAGIC-COOKIE-1 X11 Xauthority data 526b6cee71dSXin LI11 string MIT-MAGIC-COOKIE-1 X11 Xauthority data 527b6cee71dSXin LI12 string MIT-MAGIC-COOKIE-1 X11 Xauthority data 528b6cee71dSXin LI13 string MIT-MAGIC-COOKIE-1 X11 Xauthority data 529b6cee71dSXin LI14 string MIT-MAGIC-COOKIE-1 X11 Xauthority data 530b6cee71dSXin LI15 string MIT-MAGIC-COOKIE-1 X11 Xauthority data 531b6cee71dSXin LI16 string MIT-MAGIC-COOKIE-1 X11 Xauthority data 532b6cee71dSXin LI17 string MIT-MAGIC-COOKIE-1 X11 Xauthority data 533b6cee71dSXin LI18 string MIT-MAGIC-COOKIE-1 X11 Xauthority data 534b6cee71dSXin LI 535b6cee71dSXin LI# From: Maxime Henrion <mux@FreeBSD.org> 536b6cee71dSXin LI# PostgreSQL's custom dump format, Maxime Henrion <mux@FreeBSD.org> 537b6cee71dSXin LI0 string PGDMP PostgreSQL custom database dump 538b6cee71dSXin LI>5 byte x - v%d 539b6cee71dSXin LI>6 byte x \b.%d 540b6cee71dSXin LI>5 beshort <0x101 \b-0 541b6cee71dSXin LI>5 beshort >0x100 542b6cee71dSXin LI>>7 byte x \b-%d 543b6cee71dSXin LI 544b6cee71dSXin LI# Type: Advanced Data Format (ADF) database 545b6cee71dSXin LI# URL: http://www.grc.nasa.gov/WWW/cgns/adf/ 546b6cee71dSXin LI# From: Nicolas Chauvat <nicolas.chauvat@logilab.fr> 547b6cee71dSXin LI0 string @(#)ADF\ Database CGNS Advanced Data Format 548b6cee71dSXin LI 549b6cee71dSXin LI# Tokyo Cabinet magic data 550b6cee71dSXin LI# http://tokyocabinet.sourceforge.net/index.html 551b6cee71dSXin LI0 string ToKyO\ CaBiNeT\n Tokyo Cabinet 552b6cee71dSXin LI>14 string x \b (%s) 553b6cee71dSXin LI>32 byte 0 \b, Hash 554b6cee71dSXin LI!:mime application/x-tokyocabinet-hash 555b6cee71dSXin LI>32 byte 1 \b, B+ tree 556b6cee71dSXin LI!:mime application/x-tokyocabinet-btree 557b6cee71dSXin LI>32 byte 2 \b, Fixed-length 558b6cee71dSXin LI!:mime application/x-tokyocabinet-fixed 559b6cee71dSXin LI>32 byte 3 \b, Table 560b6cee71dSXin LI!:mime application/x-tokyocabinet-table 561b6cee71dSXin LI>33 byte &1 \b, [open] 562b6cee71dSXin LI>33 byte &2 \b, [fatal] 563b6cee71dSXin LI>34 byte x \b, apow=%d 564b6cee71dSXin LI>35 byte x \b, fpow=%d 565b6cee71dSXin LI>36 byte &0x01 \b, [large] 566b6cee71dSXin LI>36 byte &0x02 \b, [deflate] 567b6cee71dSXin LI>36 byte &0x04 \b, [bzip] 568b6cee71dSXin LI>36 byte &0x08 \b, [tcbs] 569b6cee71dSXin LI>36 byte &0x10 \b, [excodec] 570b6cee71dSXin LI>40 lequad x \b, bnum=%lld 571b6cee71dSXin LI>48 lequad x \b, rnum=%lld 572b6cee71dSXin LI>56 lequad x \b, fsiz=%lld 573b6cee71dSXin LI 574b6cee71dSXin LI# Type: QDBM Quick Database Manager 575b6cee71dSXin LI# From: Benoit Sibaud <bsibaud@april.org> 576b6cee71dSXin LI0 string \\[depot\\]\n\f Quick Database Manager, little endian 577b6cee71dSXin LI0 string \\[DEPOT\\]\n\f Quick Database Manager, big endian 578b6cee71dSXin LI 579b6cee71dSXin LI# Type: TokyoCabinet database 580b6cee71dSXin LI# URL: http://tokyocabinet.sourceforge.net/ 581b6cee71dSXin LI# From: Benoit Sibaud <bsibaud@april.org> 582b6cee71dSXin LI0 string ToKyO\ CaBiNeT\n TokyoCabinet database 583b6cee71dSXin LI>14 string x (version %s) 584b6cee71dSXin LI 585b6cee71dSXin LI# From: Stephane Blondon http://www.yaal.fr 586b6cee71dSXin LI# Database file for Zope (done by FileStorage) 5879fc5c47fSXin LI0 string FS21 Zope Object Database File Storage v3 (data) 5889fc5c47fSXin LI0 string FS30 Zope Object Database File Storage v4 (data) 5899fc5c47fSXin LI 590b6cee71dSXin LI# Cache file for the database of Zope (done by ClientStorage) 591b6cee71dSXin LI0 string ZEC3 Zope Object Database Client Cache File (data) 592b6cee71dSXin LI 593b6cee71dSXin LI# IDA (Interactive Disassembler) database 594b6cee71dSXin LI0 string IDA1 IDA (Interactive Disassembler) database 5959ce06829SXin LI 5969ce06829SXin LI# Hopper (reverse engineering tool) http://www.hopperapp.com/ 5979ce06829SXin LI0 string hopperdb Hopper database 5989ce06829SXin LI 5993e41d09dSXin LI# URL: https://en.wikipedia.org/wiki/Panorama_(database_engine) 6003e41d09dSXin LI# Reference: http://www.provue.com/Panorama/ 6013e41d09dSXin LI# From: Joerg Jenderek 6023e41d09dSXin LI# NOTE: test only versions 4 and 6.0 with Windows 6033e41d09dSXin LI# length of Panorama database name 6043e41d09dSXin LI5 ubyte >0 6053e41d09dSXin LI# look after database name for "some" null bits 6063e41d09dSXin LI>(5.B+7) ubelong&0xF3ffF000 0 6073e41d09dSXin LI# look for first keyword 6083e41d09dSXin LI>>&1 search/2 DESIGN Panorama database 6093e41d09dSXin LI#!:mime application/x-panorama-database 6103e41d09dSXin LI!:apple KASXZEPD 6113e41d09dSXin LI!:ext pan 6123e41d09dSXin LI# database name 6133e41d09dSXin LI>>>5 pstring x \b, "%s" 614*282e23f0SXin LI 615*282e23f0SXin LI# 616*282e23f0SXin LI# 617*282e23f0SXin LI# askSam Database by Stefan A. Haubenthal <polluks@web.de> 618*282e23f0SXin LI0 string askw40\0 askSam DB 619*282e23f0SXin LI 620*282e23f0SXin LI# 621*282e23f0SXin LI# 622*282e23f0SXin LI# MUIbase Database Tool by Stefan A. Haubenthal <polluks@web.de> 623*282e23f0SXin LI0 string MBSTV\040 MUIbase DB 624*282e23f0SXin LI>6 string x version %s 625