168349Sobrien 268349Sobrien#------------------------------------------------------------------------------ 3284193Sdelphij# $File: database,v 1.43 2014/10/28 15:47:39 christos Exp $ 468349Sobrien# database: file(1) magic for various databases 568349Sobrien# 668349Sobrien# extracted from header/code files by Graeme Wilford (eep2gw@ee.surrey.ac.uk) 768349Sobrien# 868349Sobrien# 968349Sobrien# GDBM magic numbers 1068349Sobrien# Will be maintained as part of the GDBM distribution in the future. 1168349Sobrien# <downsj@teeny.org> 12284193Sdelphij0 belong 0x13579acd GNU dbm 1.x or ndbm database, big endian, 32-bit 13186690Sobrien!:mime application/x-gdbm 14284193Sdelphij0 belong 0x13579ace GNU dbm 1.x or ndbm database, big endian, old 15186690Sobrien!:mime application/x-gdbm 16284193Sdelphij0 belong 0x13579acf GNU dbm 1.x or ndbm database, big endian, 64-bit 17284193Sdelphij!:mime application/x-gdbm 18284193Sdelphij0 lelong 0x13579acd GNU dbm 1.x or ndbm database, little endian, 32-bit 19284193Sdelphij!:mime application/x-gdbm 20284193Sdelphij0 lelong 0x13579ace GNU dbm 1.x or ndbm database, little endian, old 21284193Sdelphij!:mime application/x-gdbm 22284193Sdelphij0 lelong 0x13579acf GNU dbm 1.x or ndbm database, little endian, 64-bit 23284193Sdelphij!:mime application/x-gdbm 2468349Sobrien0 string GDBM GNU dbm 2.x database 25186690Sobrien!:mime application/x-gdbm 2668349Sobrien# 2768349Sobrien# Berkeley DB 2868349Sobrien# 2968349Sobrien# Ian Darwin's file /etc/magic files: big/little-endian version. 3068349Sobrien# 3168349Sobrien# Hash 1.85/1.86 databases store metadata in network byte order. 3268349Sobrien# Btree 1.85/1.86 databases store the metadata in host byte order. 3368349Sobrien# Hash and Btree 2.X and later databases store the metadata in host byte order. 3468349Sobrien 3568349Sobrien0 long 0x00061561 Berkeley DB 36186690Sobrien!:mime application/x-dbm 3768349Sobrien>8 belong 4321 3868349Sobrien>>4 belong >2 1.86 3968349Sobrien>>4 belong <3 1.85 4068349Sobrien>>4 belong >0 (Hash, version %d, native byte-order) 4168349Sobrien>8 belong 1234 4268349Sobrien>>4 belong >2 1.86 4368349Sobrien>>4 belong <3 1.85 4468349Sobrien>>4 belong >0 (Hash, version %d, little-endian) 4568349Sobrien 4668349Sobrien0 belong 0x00061561 Berkeley DB 4768349Sobrien>8 belong 4321 4868349Sobrien>>4 belong >2 1.86 4968349Sobrien>>4 belong <3 1.85 5068349Sobrien>>4 belong >0 (Hash, version %d, big-endian) 5168349Sobrien>8 belong 1234 5268349Sobrien>>4 belong >2 1.86 5368349Sobrien>>4 belong <3 1.85 5468349Sobrien>>4 belong >0 (Hash, version %d, native byte-order) 5568349Sobrien 5668349Sobrien0 long 0x00053162 Berkeley DB 1.85/1.86 5768349Sobrien>4 long >0 (Btree, version %d, native byte-order) 5868349Sobrien0 belong 0x00053162 Berkeley DB 1.85/1.86 5968349Sobrien>4 belong >0 (Btree, version %d, big-endian) 6068349Sobrien0 lelong 0x00053162 Berkeley DB 1.85/1.86 6168349Sobrien>4 lelong >0 (Btree, version %d, little-endian) 6268349Sobrien 6368349Sobrien12 long 0x00061561 Berkeley DB 6468349Sobrien>16 long >0 (Hash, version %d, native byte-order) 6568349Sobrien12 belong 0x00061561 Berkeley DB 6668349Sobrien>16 belong >0 (Hash, version %d, big-endian) 6768349Sobrien12 lelong 0x00061561 Berkeley DB 6868349Sobrien>16 lelong >0 (Hash, version %d, little-endian) 6968349Sobrien 7068349Sobrien12 long 0x00053162 Berkeley DB 7168349Sobrien>16 long >0 (Btree, version %d, native byte-order) 7268349Sobrien12 belong 0x00053162 Berkeley DB 7368349Sobrien>16 belong >0 (Btree, version %d, big-endian) 7468349Sobrien12 lelong 0x00053162 Berkeley DB 7568349Sobrien>16 lelong >0 (Btree, version %d, little-endian) 7668349Sobrien 7768349Sobrien12 long 0x00042253 Berkeley DB 7868349Sobrien>16 long >0 (Queue, version %d, native byte-order) 7968349Sobrien12 belong 0x00042253 Berkeley DB 8068349Sobrien>16 belong >0 (Queue, version %d, big-endian) 8168349Sobrien12 lelong 0x00042253 Berkeley DB 8268349Sobrien>16 lelong >0 (Queue, version %d, little-endian) 83159764Sobrien 84159764Sobrien# From Max Bowsher. 85159764Sobrien12 long 0x00040988 Berkeley DB 86159764Sobrien>16 long >0 (Log, version %d, native byte-order) 87159764Sobrien12 belong 0x00040988 Berkeley DB 88159764Sobrien>16 belong >0 (Log, version %d, big-endian) 89159764Sobrien12 lelong 0x00040988 Berkeley DB 90159764Sobrien>16 lelong >0 (Log, version %d, little-endian) 91159764Sobrien 9280588Sobrien# 9380588Sobrien# 9480588Sobrien# Round Robin Database Tool by Tobias Oetiker <oetiker@ee.ethz.ch> 95267843Sdelphij0 string/b RRD\0 RRDTool DB 96267843Sdelphij>4 string/b x version %s 97267843Sdelphij 98267843Sdelphij>>10 short !0 16bit aligned 99267843Sdelphij>>>10 bedouble 8.642135e+130 big-endian 100267843Sdelphij>>>>18 short x 32bit long (m68k) 101267843Sdelphij 102267843Sdelphij>>10 short 0 103267843Sdelphij>>>12 long !0 32bit aligned 104267843Sdelphij>>>>12 bedouble 8.642135e+130 big-endian 105267843Sdelphij>>>>>20 long 0 64bit long 106267843Sdelphij>>>>>20 long !0 32bit long 107267843Sdelphij>>>>12 ledouble 8.642135e+130 little-endian 108267843Sdelphij>>>>>24 long 0 64bit long 109267843Sdelphij>>>>>24 long !0 32bit long (i386) 110267843Sdelphij>>>>12 string \x43\x2b\x1f\x5b\x2f\x25\xc0\xc7 middle-endian 111267843Sdelphij>>>>>24 short !0 32bit long (arm) 112267843Sdelphij 113267843Sdelphij>>8 quad 0 64bit aligned 114267843Sdelphij>>>16 bedouble 8.642135e+130 big-endian 115267843Sdelphij>>>>24 long 0 64bit long (s390x) 116267843Sdelphij>>>>24 long !0 32bit long (hppa/mips/ppc/s390/SPARC) 117267843Sdelphij>>>16 ledouble 8.642135e+130 little-endian 118267843Sdelphij>>>>28 long 0 64bit long (alpha/amd64/ia64) 119267843Sdelphij>>>>28 long !0 32bit long (armel/mipsel) 120267843Sdelphij 121103373Sobrien#---------------------------------------------------------------------- 122103373Sobrien# ROOT: file(1) magic for ROOT databases 123103373Sobrien# 124103373Sobrien0 string root\0 ROOT file 125103373Sobrien>4 belong x Version %d 126103373Sobrien>33 belong x (Compression: %d) 127133359Sobrien 128133359Sobrien# XXX: Weak magic. 129133359Sobrien# Alex Ott <ott@jet.msk.su> 130133359Sobrien## Paradox file formats 131133359Sobrien#2 leshort 0x0800 Paradox 132133359Sobrien#>0x39 byte 3 v. 3.0 133133359Sobrien#>0x39 byte 4 v. 3.5 134133359Sobrien#>0x39 byte 9 v. 4.x 135133359Sobrien#>0x39 byte 10 v. 5.x 136133359Sobrien#>0x39 byte 11 v. 5.x 137133359Sobrien#>0x39 byte 12 v. 7.x 138133359Sobrien#>>0x04 byte 0 indexed .DB data file 139133359Sobrien#>>0x04 byte 1 primary index .PX file 140133359Sobrien#>>0x04 byte 2 non-indexed .DB data file 141133359Sobrien#>>0x04 byte 3 non-incrementing secondary index .Xnn file 142133359Sobrien#>>0x04 byte 4 secondary index .Ynn file 143133359Sobrien#>>0x04 byte 5 incrementing secondary index .Xnn file 144133359Sobrien#>>0x04 byte 6 non-incrementing secondary index .XGn file 145133359Sobrien#>>0x04 byte 7 secondary index .YGn file 146133359Sobrien#>>>0x04 byte 8 incrementing secondary index .XGn file 147186690Sobrien 148133359Sobrien## XBase database files 149267843Sdelphij# updated by Joerg Jenderek at Feb 2013 150267843Sdelphij# http://www.dbase.com/Knowledgebase/INT/db7_file_fmt.htm 151267843Sdelphij# http://www.clicketyclick.dk/databases/xbase/format/dbf.html 152267843Sdelphij# http://home.f1.htw-berlin.de/scheibl/db/intern/dBase.htm 153267843Sdelphij# inspect VVYYMMDD , where 1<= MM <= 12 and 1<= DD <= 31 154267843Sdelphij0 ubelong&0x0000FFFF <0x00000C20 155267843Sdelphij# skip Infocom game Z-machine 156267843Sdelphij>2 ubyte >0 157267843Sdelphij# skip Androids *.xml 158267843Sdelphij>>3 ubyte >0 159267843Sdelphij>>>3 ubyte <32 160267843Sdelphij# 1 < version VV 161267843Sdelphij>>>>0 ubyte >1 162267843Sdelphij# skip HELP.CA3 by test for reserved byte ( NULL ) 163267843Sdelphij>>>>>27 ubyte 0 164267843Sdelphij# reserved bytes not always 0 ; also found 0x3901 (T4.DBF) ,0x7101 (T5.DBF,T6.DBF) 165267843Sdelphij#>>>>>30 ubeshort x 30NULL?%x 166267843Sdelphij# possible production flag,tag numbers(<=0x30),tag length(<=0x20), reserved (NULL) 167267843Sdelphij>>>>>>24 ubelong&0xffFFFFff >0x01302000 168267843Sdelphij# .DBF or .MDX 169267843Sdelphij>>>>>>24 ubelong&0xffFFFFff <0x01302001 170267843Sdelphij# for Xbase Database file (*.DBF) reserved (NULL) for multi-user 171267843Sdelphij>>>>>>>24 ubelong&0xffFFFFff =0 172267843Sdelphij# test for 2 reserved NULL bytes,transaction and encryption byte flag 173267843Sdelphij>>>>>>>>12 ubelong&0xFFFFfEfE 0 174267843Sdelphij# test for MDX flag 175267843Sdelphij>>>>>>>>>28 ubyte x 176267843Sdelphij>>>>>>>>>28 ubyte&0xf8 0 177267843Sdelphij# header size >= 32 178267843Sdelphij>>>>>>>>>>8 uleshort >31 179267843Sdelphij# skip PIC15736.PCX by test for language driver name or field name 180267843Sdelphij>>>>>>>>>>>32 ubyte >0 181267843Sdelphij#!:mime application/x-dbf; charset=unknown-8bit ?? 182267843Sdelphij#!:mime application/x-dbase 183267843Sdelphij>>>>>>>>>>>>0 use xbase-type 184267843Sdelphij# database file 185267843Sdelphij>>>>>>>>>>>>0 ubyte x \b DBF 186267843Sdelphij>>>>>>>>>>>>4 lelong 0 \b, no records 187267843Sdelphij>>>>>>>>>>>>4 lelong >0 \b, %d record 188267843Sdelphij# plural s appended 189267843Sdelphij>>>>>>>>>>>>>4 lelong >1 \bs 190267843Sdelphij# http://www.clicketyclick.dk/databases/xbase/format/dbf_check.html#CHECK_DBF 191267843Sdelphij# 1 <= record size <= 4000 (dBase 3,4) or 32 * KB (=0x8000) 192267843Sdelphij>>>>>>>>>>>>10 uleshort x * %d 193267843Sdelphij# file size = records * record size + header size 194267843Sdelphij>>>>>>>>>>>>1 ubyte x \b, update-date 195267843Sdelphij>>>>>>>>>>>>1 use xbase-date 196267843Sdelphij# http://msdn.microsoft.com/de-de/library/cc483186(v=vs.71).aspx 197267843Sdelphij#>>>>>>>>>>>>29 ubyte =0 \b, codepage ID=0x%x 198267843Sdelphij# 2~cp850 , 3~cp1252 , 0x1b~?? ; what code page is 0x1b ? 199267843Sdelphij>>>>>>>>>>>>29 ubyte >0 \b, codepage ID=0x%x 200267843Sdelphij#>>>>>>>>>>>>28 ubyte&0x01 0 \b, no index file 201267843Sdelphij>>>>>>>>>>>>28 ubyte&0x01 1 \b, with index file .MDX 202267843Sdelphij>>>>>>>>>>>>28 ubyte&0x02 2 \b, with memo .FPT 203267843Sdelphij>>>>>>>>>>>>28 ubyte&0x04 4 \b, DataBaseContainer 204267843Sdelphij# 1st record offset + 1 = header size 205267843Sdelphij>>>>>>>>>>>>8 uleshort >0 206267843Sdelphij>>>>>>>>>>>>(8.s+1) ubyte >0 207267843Sdelphij>>>>>>>>>>>>>8 uleshort >0 \b, at offset %d 208267843Sdelphij>>>>>>>>>>>>>(8.s+1) ubyte >0 209267843Sdelphij>>>>>>>>>>>>>>&-1 string >\0 1st record "%s" 210267843Sdelphij# for multiple index files (*.MDX) Production flag,tag numbers(<=0x30),tag length(<=0x20), reserverd (NULL) 211267843Sdelphij>>>>>>>24 ubelong&0x0133f7ff >0 212267843Sdelphij# test for reserved NULL byte 213284193Sdelphij>>>>>>>>47 ubyte 0 214267843Sdelphij# test for valid TAG key format (0x10 or 0) 215267843Sdelphij>>>>>>>>>559 ubyte&0xeF 0 216267843Sdelphij# test MM <= 12 217284193Sdelphij>>>>>>>>>>45 ubeshort <0x0C20 218284193Sdelphij>>>>>>>>>>>45 ubyte >0 219284193Sdelphij>>>>>>>>>>>>46 ubyte <32 220284193Sdelphij>>>>>>>>>>>>>46 ubyte >0 221267843Sdelphij#!:mime application/x-mdx 222284193Sdelphij>>>>>>>>>>>>>>0 use xbase-type 223284193Sdelphij>>>>>>>>>>>>>>0 ubyte x \b MDX 224284193Sdelphij>>>>>>>>>>>>>>1 ubyte x \b, creation-date 225284193Sdelphij>>>>>>>>>>>>>>1 use xbase-date 226284193Sdelphij>>>>>>>>>>>>>>44 ubyte x \b, update-date 227284193Sdelphij>>>>>>>>>>>>>>44 use xbase-date 228267843Sdelphij# No.of tags in use (1,2,5,12) 229284193Sdelphij>>>>>>>>>>>>>>28 uleshort x \b, %d 230267843Sdelphij# No. of entries in tag (0x30) 231284193Sdelphij>>>>>>>>>>>>>>25 ubyte x \b/%d tags 232267843Sdelphij# Length of tag 233284193Sdelphij>>>>>>>>>>>>>>26 ubyte x * %d 234267843Sdelphij# 1st tag name_ 235267843Sdelphij>>>>>>>>>>>>>548 string x \b, 1st tag "%.11s" 236267843Sdelphij# 2nd tag name 237267843Sdelphij#>>>>>>>>>>>>(26.b+548) string x \b, 2nd tag "%.11s" 238133359Sobrien# 239267843Sdelphij# Print the xBase names of different version variants 240267843Sdelphij0 name xbase-type 241267843Sdelphij>0 ubyte <2 242267843Sdelphij# 1 < version 243267843Sdelphij>0 ubyte >1 244267843Sdelphij>>0 ubyte 0x02 FoxBase 245267843Sdelphij# FoxBase+/dBaseIII+, no memo 246267843Sdelphij>>0 ubyte 0x03 FoxBase+/dBase III 247267843Sdelphij!:mime application/x-dbf 248267843Sdelphij# dBASE IV no memo file 249267843Sdelphij>>0 ubyte 0x04 dBase IV 250267843Sdelphij!:mime application/x-dbf 251267843Sdelphij# dBASE V no memo file 252267843Sdelphij>>0 ubyte 0x05 dBase V 253267843Sdelphij!:mime application/x-dbf 254267843Sdelphij>>0 ubyte 0x30 Visual FoxPro 255267843Sdelphij!:mime application/x-dbf 256267843Sdelphij>>0 ubyte 0x31 Visual FoxPro, autoincrement 257267843Sdelphij!:mime application/x-dbf 258267843Sdelphij# Visual FoxPro, with field type Varchar or Varbinary 259267843Sdelphij>>0 ubyte 0x32 Visual FoxPro, with field type Varchar 260267843Sdelphij!:mime application/x-dbf 261267843Sdelphij# dBASE IV SQL, no memo;dbv memo var size (Flagship) 262267843Sdelphij>>0 ubyte 0x43 dBase IV, with SQL table 263267843Sdelphij!:mime application/x-dbf 264267843Sdelphij# http://msdn.microsoft.com/en-US/library/st4a0s68(v=vs.80).aspx 265267843Sdelphij#>>0 ubyte 0x62 dBase IV, with SQL table 266186690Sobrien#!:mime application/x-dbf 267267843Sdelphij# dBASE IV, with memo!! 268267843Sdelphij>>0 ubyte 0x7b dBase IV, with memo 269267843Sdelphij!:mime application/x-dbf 270267843Sdelphij# http://msdn.microsoft.com/en-US/library/st4a0s68(v=vs.80).aspx 271267843Sdelphij#>>0 ubyte 0x82 dBase IV, with SQL system 272186690Sobrien#!:mime application/x-dbf 273267843Sdelphij# FoxBase+/dBaseIII+ with memo .DBT! 274267843Sdelphij>>0 ubyte 0x83 FoxBase+/dBase III, with memo .DBT 275267843Sdelphij!:mime application/x-dbf 276267843Sdelphij# VISUAL OBJECTS (first 1.0 versions) for the Dbase III files (NTX clipper driver); memo file 277267843Sdelphij>>0 ubyte 0x87 VISUAL OBJECTS, with memo file 278267843Sdelphij!:mime application/x-dbf 279267843Sdelphij# http://msdn.microsoft.com/en-US/library/st4a0s68(v=vs.80).aspx 280267843Sdelphij#>>0 ubyte 0x8A FoxBase+/dBase III, with memo .DBT 281186690Sobrien#!:mime application/x-dbf 282267843Sdelphij# dBASE IV with memo! 283267843Sdelphij>>0 ubyte 0x8B dBase IV, with memo .DBT 284267843Sdelphij!:mime application/x-dbf 285267843Sdelphij# dBase IV with SQL Table,no memo? 286267843Sdelphij>>0 ubyte 0x8E dBase IV, with SQL table 287267843Sdelphij!:mime application/x-dbf 288267843Sdelphij# .dbv and .dbt memo (Flagship)? 289267843Sdelphij>>0 ubyte 0xB3 Flagship 290267843Sdelphij# http://msdn.microsoft.com/en-US/library/st4a0s68(v=vs.80).aspx 291267843Sdelphij#>>0 ubyte 0xCA dBase IV with memo .DBT 292186690Sobrien#!:mime application/x-dbf 293267843Sdelphij# dBASE IV with SQL table, with memo .DBT 294267843Sdelphij>>0 ubyte 0xCB dBase IV with SQL table, with memo .DBT 295267843Sdelphij!:mime application/x-dbf 296267843Sdelphij# HiPer-Six format;Clipper SIX, with SMT memo file 297267843Sdelphij>>0 ubyte 0xE5 Clipper SIX with memo 298267843Sdelphij!:mime application/x-dbf 299267843Sdelphij# http://msdn.microsoft.com/en-US/library/st4a0s68(v=vs.80).aspx 300267843Sdelphij#>>0 ubyte 0xF4 dBase IV, with SQL table, with memo 301186690Sobrien#!:mime application/x-dbf 302267843Sdelphij>>0 ubyte 0xF5 FoxPro with memo 303267843Sdelphij!:mime application/x-dbf 304267843Sdelphij# http://msdn.microsoft.com/en-US/library/st4a0s68(v=vs.80).aspx 305267843Sdelphij#>>0 ubyte 0xFA FoxPro 2.x, with memo 306186690Sobrien#!:mime application/x-dbf 307267843Sdelphij# unknown version (should not happen) 308267843Sdelphij>>0 default x xBase 309267843Sdelphij!:mime application/x-dbf 310267843Sdelphij>>>0 ubyte x (0x%x) 311267843Sdelphij# flags in version byte 312267843Sdelphij# DBT flag (with dBASE III memo .DBT)!! 313267843Sdelphij# >>0 ubyte&0x80 >0 DBT_FLAG=%x 314267843Sdelphij# memo flag ?? 315267843Sdelphij# >>0 ubyte&0x08 >0 MEMO_FLAG=%x 316267843Sdelphij# SQL flag ?? 317267843Sdelphij# >>0 ubyte&0x70 >0 SQL_FLAG=%x 318267843Sdelphij# test and print the date of xBase .DBF .MDX 319267843Sdelphij0 name xbase-date 320267843Sdelphij# inspect YYMMDD , where 1<= MM <= 12 and 1<= DD <= 31 321267843Sdelphij>0 ubelong x 322267843Sdelphij>1 ubyte <13 323267843Sdelphij>>1 ubyte >0 324267843Sdelphij>>>2 ubyte >0 325267843Sdelphij>>>>2 ubyte <32 326267843Sdelphij>>>>>0 ubyte x 327267843Sdelphij# YY is interpreted as 20YY or 19YY 328267843Sdelphij>>>>>>0 ubyte <100 \b %.2d 329267843Sdelphij# YY is interpreted 1900+YY; TODO: display yy or 20yy instead 1YY 330267843Sdelphij>>>>>>0 ubyte >99 \b %d 331267843Sdelphij>>>>>1 ubyte x \b-%d 332267843Sdelphij>>>>>2 ubyte x \b-%d 333133359Sobrien 334267843Sdelphij# dBase memo files .DBT or .FPT 335267843Sdelphij# http://msdn.microsoft.com/en-us/library/8599s21w(v=vs.80).aspx 336267843Sdelphij16 ubyte <4 337267843Sdelphij>16 ubyte !2 338267843Sdelphij>>16 ubyte !1 339267843Sdelphij# next free block index is positive 340267843Sdelphij>>>0 ulelong >0 341267843Sdelphij# skip many JPG. ZIP, BZ2 by test for reserved bytes NULL , 0|2 , 0|1 , low byte of block size 342267843Sdelphij>>>>17 ubelong&0xFFfdFE00 0x00000000 343267843Sdelphij# skip many RAR by test for low byte 0 ,high byte 0|2|even of block size, 0|a|e|d7 , 0|64h 344267843Sdelphij>>>>>20 ubelong&0xFF01209B 0x00000000 345267843Sdelphij# dBASE III 346267843Sdelphij>>>>>>16 ubyte 3 347267843Sdelphij# dBASE III DBT 348284193Sdelphij>>>>>>>0 use dbase3-memo-print 349284193Sdelphij# dBASE III DBT without version, dBASE IV DBT , FoxPro FPT , or many ZIP , DBF garbage 350267843Sdelphij>>>>>>16 ubyte 0 351284193Sdelphij# unusual dBASE III DBT like angest.dbt, dBASE IV DBT with block size 0 , FoxPro FPT , or garbage PCX DBF 352284193Sdelphij>>>>>>>20 uleshort 0 353284193Sdelphij# FoxPro FPT , unusual dBASE III DBT like biblio.dbt or garbage 354284193Sdelphij>>>>>>>>8 ulong =0 355284193Sdelphij>>>>>>>>>6 ubeshort >0 356284193Sdelphij# skip emacs.PIF 357284193Sdelphij>>>>>>>>>>4 ushort 0 358284193Sdelphij>>>>>>>>>>>0 use foxpro-memo-print 359284193Sdelphij# dBASE III DBT , garbage 360284193Sdelphij>>>>>>>>>6 ubeshort 0 361267843Sdelphij# skip MM*DD*.bin by test for for reserved NULL byte 362284193Sdelphij>>>>>>>>>>510 ubeshort 0 363284193Sdelphij# skip TK-DOS11.img image by looking for memo text 364284193Sdelphij>>>>>>>>>>>512 ubelong <0xfeffff03 365284193Sdelphij# skip EFI executables by looking for memo text 366284193Sdelphij>>>>>>>>>>>>512 ubelong >0x1F202020 367284193Sdelphij>>>>>>>>>>>>>513 ubyte >0 368284193Sdelphij# unusual dBASE III DBT like adressen.dbt 369284193Sdelphij>>>>>>>>>>>>>>0 use dbase3-memo-print 370284193Sdelphij# dBASE III DBT like angest.dbt, or garbage PCX DBF 371284193Sdelphij>>>>>>>>8 ubelong !0 372284193Sdelphij# skip PCX and some DBF by test for for reserved NULL bytes 373284193Sdelphij>>>>>>>>>510 ubeshort 0 374284193Sdelphij# skip some DBF by test of invalid version 375284193Sdelphij>>>>>>>>>>0 ubyte >5 376284193Sdelphij>>>>>>>>>>>0 ubyte <48 377284193Sdelphij>>>>>>>>>>>>0 use dbase3-memo-print 378284193Sdelphij# dBASE IV DBT with positive block size 379284193Sdelphij>>>>>>>20 uleshort >0 380284193Sdelphij>>>>>>>>0 use dbase4-memo-print 381267843Sdelphij 382284193Sdelphij# Print the information of dBase III DBT memo file 383284193Sdelphij0 name dbase3-memo-print 384284193Sdelphij>0 ubyte x dBase III DBT 385284193Sdelphij# instead 3 as version number 0 for unusual examples like biblio.dbt 386284193Sdelphij>16 ubyte !3 \b, version number %u 387267843Sdelphij# Number of next available block for appending data 388284193Sdelphij#>0 lelong =0 \b, next free block index %u 389284193Sdelphij>0 lelong !0 \b, next free block index %u 390284193Sdelphij# no positiv block length 391284193Sdelphij#>20 uleshort =0 \b, block length %u 392284193Sdelphij>20 uleshort !0 \b, block length %u 393284193Sdelphij# dBase III memo field terminated by \032\032 394284193Sdelphij>512 string >\0 \b, 1st item "%s" 395284193Sdelphij# Print the information of dBase IV DBT memo file 396284193Sdelphij0 name dbase4-memo-print 397284193Sdelphij>0 lelong x dBase IV DBT 398284193Sdelphij# 8 character shorted main name of coresponding dBASE IV DBF file 399284193Sdelphij>8 ubelong >0x20000000 400284193Sdelphij# skip unusual like for angest.dbt 401284193Sdelphij>>20 uleshort >0 402284193Sdelphij>>>8 string >\0 \b of %-.8s.DBF 403284193Sdelphij# value 0 implies 512 as size 404284193Sdelphij#>4 ulelong =0 \b, blocks size %u 405284193Sdelphij# size of blocks not reliable like 0x2020204C in angest.dbt 406284193Sdelphij>4 ulelong !0 407284193Sdelphij>>4 ulelong&0x0000003f 0 \b, blocks size %u 408284193Sdelphij# dBase IV DBT with positive block length (found 512 , 1024) 409284193Sdelphij>20 uleshort >0 \b, block length %u 410284193Sdelphij# next available block 411284193Sdelphij#>0 lelong =0 \b, next free block index %u 412284193Sdelphij>0 lelong !0 \b, next free block index %u 413284193Sdelphij>20 uleshort >0 414284193Sdelphij>>(20.s) ubelong x 415284193Sdelphij>>>&-4 use dbase4-memofield-print 416284193Sdelphij# unusual dBase IV DBT without block length (implies 512 as length) 417284193Sdelphij>20 uleshort =0 418284193Sdelphij>>512 ubelong x 419284193Sdelphij>>>&-4 use dbase4-memofield-print 420284193Sdelphij# Print the information of dBase IV memo field 421284193Sdelphij0 name dbase4-memofield-print 422284193Sdelphij# free dBase IV memo field 423284193Sdelphij>0 ubelong !0xFFFF0800 424284193Sdelphij>>0 lelong x \b, next free block %u 425284193Sdelphij>>4 lelong x \b, next used block %u 426284193Sdelphij# used dBase IV memo field 427284193Sdelphij>0 ubelong =0xFFFF0800 428284193Sdelphij# length of memo field 429284193Sdelphij>>4 lelong x \b, field length %d 430284193Sdelphij>>>8 string >\0 \b, 1st used item "%s" 431284193Sdelphij# Print the information of FoxPro FPT memo file 432284193Sdelphij0 name foxpro-memo-print 433284193Sdelphij>0 belong x FoxPro FPT 434284193Sdelphij# Size of blocks for FoxPro ( 64,256 ) 435284193Sdelphij>6 ubeshort x \b, blocks size %u 436284193Sdelphij# next available block 437284193Sdelphij#>0 belong =0 \b, next free block index %u 438284193Sdelphij>0 belong !0 \b, next free block index %u 439284193Sdelphij# field type ( 0~picture, 1~memo, 2~object ) 440284193Sdelphij>512 ubelong <3 \b, field type %u 441284193Sdelphij# length of memo field 442284193Sdelphij>512 ubelong 1 443284193Sdelphij>>516 belong >0 \b, field length %d 444284193Sdelphij>>>520 string >\0 \b, 1st item "%s" 445267843Sdelphij 446267843Sdelphij# TODO: 447267843Sdelphij# DBASE index file *.NDX 448267843Sdelphij# DBASE Compound Index file *.CDX 449267843Sdelphij# dBASE IV Printer Driver *.PRF 450267843Sdelphij## End of XBase database stuff 451267843Sdelphij 452133359Sobrien# MS Access database 453186690Sobrien4 string Standard\ Jet\ DB Microsoft Access Database 454186690Sobrien!:mime application/x-msaccess 455267843Sdelphij4 string Standard\ ACE\ DB Microsoft Access Database 456267843Sdelphij!:mime application/x-msaccess 457133359Sobrien 458133359Sobrien# TDB database from Samba et al - Martin Pool <mbp@samba.org> 459133359Sobrien0 string TDB\ file TDB database 460133359Sobrien>32 lelong 0x2601196D version 6, little-endian 461133359Sobrien>>36 lelong x hash size %d bytes 462133359Sobrien 463133359Sobrien# SE Linux policy database 464133359Sobrien0 lelong 0xf97cff8c SE Linux policy 465133359Sobrien>16 lelong x v%d 466133359Sobrien>20 lelong 1 MLS 467133359Sobrien>24 lelong x %d symbols 468133359Sobrien>28 lelong x %d ocons 469133359Sobrien 470133359Sobrien# ICE authority file data (Wolfram Kleff) 471133359Sobrien2 string ICE ICE authority data 472133359Sobrien 473133359Sobrien# X11 Xauthority file (Wolfram Kleff) 474133359Sobrien10 string MIT-MAGIC-COOKIE-1 X11 Xauthority data 475133359Sobrien11 string MIT-MAGIC-COOKIE-1 X11 Xauthority data 476133359Sobrien12 string MIT-MAGIC-COOKIE-1 X11 Xauthority data 477133359Sobrien13 string MIT-MAGIC-COOKIE-1 X11 Xauthority data 478133359Sobrien14 string MIT-MAGIC-COOKIE-1 X11 Xauthority data 479133359Sobrien15 string MIT-MAGIC-COOKIE-1 X11 Xauthority data 480133359Sobrien16 string MIT-MAGIC-COOKIE-1 X11 Xauthority data 481133359Sobrien17 string MIT-MAGIC-COOKIE-1 X11 Xauthority data 482133359Sobrien18 string MIT-MAGIC-COOKIE-1 X11 Xauthority data 483175296Sobrien 484175296Sobrien# From: Maxime Henrion <mux@FreeBSD.org> 485175296Sobrien# PostgreSQL's custom dump format, Maxime Henrion <mux@FreeBSD.org> 486175296Sobrien0 string PGDMP PostgreSQL custom database dump 487175296Sobrien>5 byte x - v%d 488175296Sobrien>6 byte x \b.%d 489186690Sobrien>5 beshort <0x101 \b-0 490175296Sobrien>5 beshort >0x100 491175296Sobrien>>7 byte x \b-%d 492175296Sobrien 493186690Sobrien# Type: Advanced Data Format (ADF) database 494186690Sobrien# URL: http://www.grc.nasa.gov/WWW/cgns/adf/ 495186690Sobrien# From: Nicolas Chauvat <nicolas.chauvat@logilab.fr> 496186690Sobrien0 string @(#)ADF\ Database CGNS Advanced Data Format 497192348Sdelphij 498192348Sdelphij# Tokyo Cabinet magic data 499192348Sdelphij# http://tokyocabinet.sourceforge.net/index.html 500192348Sdelphij0 string ToKyO\ CaBiNeT\n Tokyo Cabinet 501192348Sdelphij>14 string x \b (%s) 502192348Sdelphij>32 byte 0 \b, Hash 503192348Sdelphij!:mime application/x-tokyocabinet-hash 504192348Sdelphij>32 byte 1 \b, B+ tree 505192348Sdelphij!:mime application/x-tokyocabinet-btree 506192348Sdelphij>32 byte 2 \b, Fixed-length 507192348Sdelphij!:mime application/x-tokyocabinet-fixed 508192348Sdelphij>32 byte 3 \b, Table 509192348Sdelphij!:mime application/x-tokyocabinet-table 510192348Sdelphij>33 byte &1 \b, [open] 511192348Sdelphij>33 byte &2 \b, [fatal] 512192348Sdelphij>34 byte x \b, apow=%d 513192348Sdelphij>35 byte x \b, fpow=%d 514192348Sdelphij>36 byte &0x01 \b, [large] 515192348Sdelphij>36 byte &0x02 \b, [deflate] 516192348Sdelphij>36 byte &0x04 \b, [bzip] 517192348Sdelphij>36 byte &0x08 \b, [tcbs] 518192348Sdelphij>36 byte &0x10 \b, [excodec] 519192348Sdelphij>40 lequad x \b, bnum=%lld 520192348Sdelphij>48 lequad x \b, rnum=%lld 521192348Sdelphij>56 lequad x \b, fsiz=%lld 522226048Sobrien 523226048Sobrien# Type: QDBM Quick Database Manager 524226048Sobrien# From: Benoit Sibaud <bsibaud@april.org> 525226048Sobrien0 string \\[depot\\]\n\f Quick Database Manager, little endian 526226048Sobrien0 string \\[DEPOT\\]\n\f Quick Database Manager, big endian 527226048Sobrien 528226048Sobrien# Type: TokyoCabinet database 529226048Sobrien# URL: http://tokyocabinet.sourceforge.net/ 530226048Sobrien# From: Benoit Sibaud <bsibaud@april.org> 531226048Sobrien0 string ToKyO\ CaBiNeT\n TokyoCabinet database 532226048Sobrien>14 string x (version %s) 533226048Sobrien 534267843Sdelphij# From: Stephane Blondon http://www.yaal.fr 535226048Sobrien# Database file for Zope (done by FileStorage) 536226048Sobrien0 string FS21 Zope Object Database File Storage (data) 537226048Sobrien# Cache file for the database of Zope (done by ClientStorage) 538226048Sobrien0 string ZEC3 Zope Object Database Client Cache File (data) 539267843Sdelphij 540267843Sdelphij# IDA (Interactive Disassembler) database 541267843Sdelphij0 string IDA1 IDA (Interactive Disassembler) database 542