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