1 2#------------------------------------------------------------------------------ 3# $File: database,v 1.68 2022/09/23 19:54:41 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# skip DOS executables CPQ0TD.DRV E30ODI.COM IBM0MONO.DRV by looking for printable 1st character of 1st memo item 412>>>>>>>>>>>512 ubyte >037 413# 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 414>>>>>>>>>>>>512 ubyte <0377 415# unusual dBASE III DBT like adressen.dbt biblio.dbt fsadress.dbt 416>>>>>>>>>>>>>0 use dbase3-memo-print 417# dBASE III DBT like angest.dbt, or garbage PCX DBF 418>>>>>>>>8 ubelong !0 419# skip PCX and some DBF by test for for reserved NULL bytes 420>>>>>>>>>510 ubeshort 0 421# skip bad symples with improbably high free block index above 2 GiB file limit 422>>>>>>>>>>0 ulelong <0x400000 423# skip AI070GEP.EPS by printable 1st character of 1st memo item 424>>>>>>>>>>>512 ubyte >037 425# skip some Microsoft Visual C, OMF library like: BZ2.LIB WATTCPWL.LIB ZLIB.LIB 426>>>>>>>>>>>>512 ubyte <0200 427# skip gluon-ffhat-1.0-tp-link-tl-wr1043n-nd-v2-sysupgrade.bin by printable 2nd character 428>>>>>>>>>>>>>513 ubyte >037 429# skip few (8/758) Microsoft Event Trace Logs (WBEngine.3.etl Wifi.etl) with valid 1st item like 430# "9600.20369.amd64fre.winblue_ltsb_escrow.220427-1727" 431# "9600.19846.amd64fre.winblue_ltsb_escrow.200923-1735" 432# "10586.494.amd64fre.th2_release_sec.160630-1736" 433# by looking for valid terminating character Ctrl-Z 434>>>>>>>>>>>>>>513 search/0x11E \032 435# followed by second character Ctrl-Z implies typical DBT 436>>>>>>>>>>>>>>>&0 ubyte 032 437# examples like: angest.dbt 438>>>>>>>>>>>>>>>>0 use dbase3-memo-print 439>>>>>>>>>>>>>>>&0 ubyte 0 440# no example found here with terminating sequence CTRL-Z + \0 441>>>>>>>>>>>>>>>>0 use dbase3-memo-print 442# dBASE IV DBT with positive block size 443>>>>>>>20 uleshort >0 444# dBASE IV DBT with valid block length like 512, 1024 445# multiple of 2 in between 16 and 16 K ,implies upper and lower bits are zero 446# skip also 3600h 3E00h size 447>>>>>>>>20 uleshort&0xE00f 0 448>>>>>>>>>0 use dbase4-memo-print 449 450# Print the information of dBase III DBT memo file 4510 name dbase3-memo-print 452>0 ubyte x dBase III DBT 453!:mime application/x-dbt 454!:ext dbt 455# instead 3 as version number 0 for unusual examples like biblio.dbt 456>16 ubyte !3 \b, version number %u 457# Number of next available block for appending data 458#>0 lelong =0 \b, next free block index %u 459>0 lelong !0 \b, next free block index %u 460# no positive block length 461#>20 uleshort =0 \b, block length %u 462>20 uleshort !0 \b, block length %u 463# dBase III memo field terminated by \032\032 464# like: "WHAT IS XBASE" test.dbt "Borges, Malte" biblio.dbt "First memo\032\032" T2.DBT 465>512 string >\0 \b, 1st item "%s" 466# For DEBUGGING 467#>512 ubelong x \b, 1ST item %#8.8x 468#>513 search/0x225 \032 FOUND_TERMINATOR 469#>>&0 ubyte 032 2xCTRL_Z 470# fsadress.dbt has 1 Ctrl-Z terminator followed by nil byte 471#>>&0 ubyte 0 1xCTRL_Z 472 473# https://www.clicketyclick.dk/databases/xbase/format/dbt.html 474# Print the information of dBase IV DBT memo file 4750 name dbase4-memo-print 476>0 lelong x dBase IV DBT 477!:mime application/x-dbt 478!:ext dbt 479# 8 character shorted main name of corresponding dBASE IV DBF file 480>8 ubelong >0x20000000 481# skip unusual like for angest.dbt 482>>20 uleshort >0 483>>>8 string >\0 \b of %-.8s.DBF 484# value 0 implies 512 as size 485#>4 ulelong =0 \b, blocks size %u 486# size of blocks not reliable like 0x2020204C in angest.dbt 487>4 ulelong !0 488>>4 ulelong&0x0000003f 0 \b, blocks size %u 489# dBase IV DBT with positive block length (found 512 , 1024) 490>20 uleshort >0 \b, block length %u 491# next available block 492#>0 lelong =0 \b, next free block index %u 493>0 lelong !0 \b, next free block index %u 494>20 uleshort >0 495>>(20.s) ubelong x 496>>>&-4 use dbase4-memofield-print 497# unusual dBase IV DBT without block length (implies 512 as length) 498>20 uleshort =0 499>>512 ubelong x 500>>>&-4 use dbase4-memofield-print 501# Print the information of dBase IV memo field 5020 name dbase4-memofield-print 503# free dBase IV memo field 504>0 ubelong !0xFFFF0800 505>>0 lelong x \b, next free block %u 506>>4 lelong x \b, next used block %u 507# used dBase IV memo field 508>0 ubelong =0xFFFF0800 509# length of memo field 510>>4 lelong x \b, field length %d 511>>>8 string >\0 \b, 1st used item "%s" 512# http://www.dbfree.org/webdocs/1-documentation/0018-developers_stuff_(advanced)/os_related_stuff/xbase_file_format.htm 513# Print the information of FoxPro FPT memo file 5140 name foxpro-memo-print 515>0 belong x FoxPro FPT 516!:mime application/x-fpt 517!:ext fpt 518# Size of blocks for FoxPro ( 64,256 ); probably a multiple of two 519>6 ubeshort x \b, blocks size %u 520# next available block 521#>0 belong =0 \b, next free block index %u 522>0 belong !0 \b, next free block index %u 523# field type ( 0~picture, 1~memo, 2~object ) 524>512 ubelong <3 \b, field type %u 525# length of memo field 526>512 ubelong 1 527>>516 belong >0 \b, field length %d 528>>>520 string >\0 \b, 1st item "%s" 529 530# Summary: DBASE Compound Index file *.CDX and FoxPro index *.IDX 531# From: Joerg Jenderek 532# URL: https://www.clicketyclick.dk/databases/xbase/format/cdx.html 533# https://www.clicketyclick.dk/databases/xbase/format/idx.html 534# https://www.clicketyclick.dk/databases/xbase/format/idx_comp.html 535# Reference: https://mark0.net/download/triddefs_xml.7z/defs/s/sybase-ianywhere-cdx.trid.xml 536# https://mark0.net/download/triddefs_xml.7z/defs/c/cdx-vfp7.trid.xml 537# like: kunde.cdx 5380 ulelong 0x1C00 539>0 use xbase-index 540# like: SYLLABI2.CDX SYLLABUS.CDX 5410 ulelong 0x0800 542>0 use xbase-index 543# often in xBase index pointer to root node 400h 5440 ulelong 0x0400 545# skip most Maple help database *.hdb with version tag handled by ./maple 546>1028 string !version 547# skip Maple help database hsum.hdb checking for valid reserved area 548>>492 quad =0 549# skip remaining Maple help database *.hdb by checking key length 550#>>>12 uleshort !0x000F KEY_LENGTHVALID 551>>>0 use xbase-index 552# display information about dBase/FoxPro index 5530 name xbase-index 554>0 ulelong x xBase 555!:mime application/x-dbase-index 556>14 ubyte &0x40 compound index 557# DCX for FoxPro database index like: TESTDATA.DCX 558!:ext cdx/dcx 559>14 ubyte ^0x40 index 560# only 1 example like: TEST.IDX 561!:ext idx 562# pointer to root node like: 1C00h 800h often 400h 563>0 ulelong !0x400 \b, root pointer %#x 564# Pointer to free node list: often 0 but -1 if not present 565>4 ulelong !0 \b, free node pointer %#x 566# MAYBE number of pages in file (Foxbase, FoxPro 1.x) or 567# http://www.foxpert.com/foxpro/knowlbits/files/knowlbits_200708_1.HTM 568# Whenever Visual FoxPro updates the index file it increments this reserved field 569# Reserved for internal use like: 02000000h 03000000h 460c0000h 780f0000h 89000000h 9fdc0100h often 0 570>8 ulelong !0 \b, reserved counter %#x 571# length of key like: mostly 000Ah 0028h (TEST.IDX) 572>12 uleshort !0x000A \b, key length %#x 573# index options like: 24h E0h E8h 574# 1~a unique index 8~index has FOR clause 32~compact index format 64~compound index header 575# 16~Bit vector (SoftC) 128~Structure index (FoxPro) 576>14 ubyte x \b, index options (%#x 577>14 ubyte &0x01 \b, unique 578>14 ubyte &0x08 \b, has FOR clause 579>14 ubyte &0x10 \b, bit vector (SoftC) 580>14 ubyte &0x20 \b, compact format 581#>14 ubyte &0x40 \b, compound header 582>14 ubyte &0x80 \b, structure 583>14 ubyte x \b) 584# WHAT EXACTLY IS THAT? index signature like: 0 (sybase-ianywhere-cdx.trid.xml) 1 (cdx-vfp7.trid.xml) 585>15 ubyte !0 \b, index signature %u 586# reserved area (0-bytes) til about 500, but not for uncompressed Index files *.idx 587>16 quad !0 \b, at 16 reserved %#llx 588>492 quad !0 \b, at 492 reserved %#llx 589# for IDX variant 590#>14 ubyte ^0x40 IDX 591# for CDX variant 592>14 ubyte &0x40 593# Ascending or descending: 0~ascending 1~descending 594>>502 uleshort x \b, sort order %u 595# Total expression length (FoxPro 2) like: 0 1 596>>504 uleshort !0 \b, expression length %u 597# FOR expression pool length like: 1 598>>506 uleshort !1 \b, FOR expression pool length %#x 599# reserved for internal use like: 0 600>>508 uleshort !0 \b, at 0x508 reserved %#x 601# Key expression pool length like: 1 602>>510 uleshort !1 \b, key expression pool length %#x 603# 512 - 1023 Key & FOR expression pool (uncompiled) 604>>512 quad !0 \b, key expression pool %#llx 605#>>520 quad !0 \b, key expression pool %#llx 606 607# Summary: dBASE IV Printer Form *.PRF 608# From: Joerg Jenderek 609# URL: https://en.wikipedia.org/wiki/.dbf#Other_file_types_found_in_dBASE 610# Reference: https://mark0.net/download/triddefs_xml.7z/defs/p/prf-dbase.trid.xml 6110 ubeshort 0x0400 612# skip some Xbase Index files *.ndx and Infocom (Z-machine 4) *.z4 handled by ./adventure 613# by looking for valid printer driver name extension 614>0x58 search/8 .PR2 615>>0 use xbase-prf 616# display information of dbase print form like printer driver *.PR2 6170 name xbase-prf dBase Printer Form 618!:mime application/x-dbase-prf 619!:ext prf 620# MAYBE version? like: 4~DBASE IV 621#>0 ubyte x \b, version %u 622# MAYBE flag like: 1~with output file name 0~not 623#>2 ubyte !0 \b, flag %u 624# optional printer text output file name like E:\DBASE\IV\T6.txt 625>3 string >\0 \b, output file %s 626# probably padding with nils til 0x53 627#>0x48 uquad !0 \b, at 0x48 padding %#llx 628# dBASE IV printer driver name like: Generic.PR2 ASCII.PR2 629>0x56 string >\0 \b, using printer driver %s 630# 2 is probably last character of previous dBASE printer driver name 631#>0x60 ubyte !0x32 \b, at 0x60 %#x 632# probably padding with nils til 0xa8 633#>0x61 uquad !0 \b, at 0x61 padding %#llx 634# unknown 0x03020300 0x03020100 at 0xa8 635>0xa8 ubelong x \b, at 0xa8 unknown %#8.8x 636# probably padding with nils til 0x2aa 637#>0x2a0 uquad !0 \b, at 0x2a0 padding %#llx 638# unknown 0x100ff7f01000001 at 0x2AB 639>0x2ab ubequad !0x100ff7f01000001 \b, at 0x2ab unknown %#llx 640# unknown 0x0042 at 0x2b3 641>0x2b3 ubeshort !0x0042 \b, at 0x2b3 unknown %#4.4x 642# unknown last 4 bytes at 0x2b6 like: 0 0x23 643>0x2b6 ubelong !0 \b, at 0x2b6 unknown %#8.8x 644 645# TODO: 646# DBASE index file *.NDX 647# dBASE compiled Format *.FMO 648# FoxPro Database memo file *.DCT 649# FoxPro Forms Memo *.SCT 650# FoxPro Generated Menu Program *.MPR 651# FoxPro Report *.FRX 652# FoxPro Report Memo *.FRT 653# Foxpro Generated Screen Program *.SPR 654# Foxpro memo *.PJT 655## End of XBase database stuff 656 657# MS Access database 6584 string Standard\ Jet\ DB Microsoft Access Database 659!:mime application/x-msaccess 6604 string Standard\ ACE\ DB Microsoft Access Database 661!:mime application/x-msaccess 662 663# From: Joerg Jenderek 664# URL: http://fileformats.archiveteam.org/wiki/Extensible_Storage_Engine 665# Reference: https://github.com/libyal/libesedb/archive/master.zip 666# libesedb-master/documentation/ 667# Extensible Storage Engine (ESE) Database File (EDB) format.asciidoc 668# Note: also known as "JET Blue". Used by numerous Windows components such as 669# Windows Search, Mail, Exchange and Active Directory. 6704 ubelong 0xefcdab89 671# unknown1 672>132 ubelong 0 Extensible storage engine 673!:mime application/x-ms-ese 674# file_type 0~database 1~stream 675>>12 ulelong 0 DataBase 676# Security DataBase (sdb) 677!:ext edb/sdb 678>>12 ulelong 1 STreaMing 679!:ext stm 680# format_version 620h 681>>8 uleshort x \b, version %#x 682>>10 uleshort >0 revision %#4.4x 683>>0 ubelong x \b, checksum %#8.8x 684# Page size 4096 8192 32768 685>>236 ulequad x \b, page size %lld 686# database_state 687>>52 ulelong 1 \b, JustCreated 688>>52 ulelong 2 \b, DirtyShutdown 689#>>52 ulelong 3 \b, CleanShutdown 690>>52 ulelong 4 \b, BeingConverted 691>>52 ulelong 5 \b, ForceDetach 692# Windows NT major version when the databases indexes were updated. 693>>216 ulelong x \b, Windows version %d 694# Windows NT minor version 695>>220 ulelong x \b.%d 696 697# From: Joerg Jenderek 698# URL: https://forensicswiki.org/wiki/Windows_Application_Compatibility 699# Note: files contain application compatibility fixes, application compatibility modes and application help messages. 7008 string sdbf 701>7 ubyte 0 702# TAG_TYPE_LIST+TAG_INDEXES 703>>12 uleshort 0x7802 Windows application compatibility Shim DataBase 704# version? 2 3 705#>>>0 ulelong x \b, version %d 706!:mime application/x-ms-sdb 707!:ext sdb 708 709# TDB database from Samba et al - Martin Pool <mbp@samba.org> 7100 string TDB\ file TDB database 711>32 lelong 0x2601196D version 6, little-endian 712>>36 lelong x hash size %d bytes 713 714# SE Linux policy database 7150 lelong 0xf97cff8c SE Linux policy 716>16 lelong x v%d 717>20 lelong 1 MLS 718>24 lelong x %d symbols 719>28 lelong x %d ocons 720 721# ICE authority file data (Wolfram Kleff) 7222 string ICE ICE authority data 723 724# X11 Xauthority file (Wolfram Kleff) 72510 string MIT-MAGIC-COOKIE-1 X11 Xauthority data 72611 string MIT-MAGIC-COOKIE-1 X11 Xauthority data 72712 string MIT-MAGIC-COOKIE-1 X11 Xauthority data 72813 string MIT-MAGIC-COOKIE-1 X11 Xauthority data 72914 string MIT-MAGIC-COOKIE-1 X11 Xauthority data 73015 string MIT-MAGIC-COOKIE-1 X11 Xauthority data 73116 string MIT-MAGIC-COOKIE-1 X11 Xauthority data 73217 string MIT-MAGIC-COOKIE-1 X11 Xauthority data 73318 string MIT-MAGIC-COOKIE-1 X11 Xauthority data 734 735# From: Maxime Henrion <mux@FreeBSD.org> 736# PostgreSQL's custom dump format, Maxime Henrion <mux@FreeBSD.org> 7370 string PGDMP PostgreSQL custom database dump 738>5 byte x - v%d 739>6 byte x \b.%d 740>5 beshort <0x101 \b-0 741>5 beshort >0x100 742>>7 byte x \b-%d 743 744# Type: Advanced Data Format (ADF) database 745# URL: https://www.grc.nasa.gov/WWW/cgns/adf/ 746# From: Nicolas Chauvat <nicolas.chauvat@logilab.fr> 7470 string @(#)ADF\ Database CGNS Advanced Data Format 748 749# Tokyo Cabinet magic data 750# http://tokyocabinet.sourceforge.net/index.html 7510 string ToKyO\ CaBiNeT\n Tokyo Cabinet 752>14 string x \b (%s) 753>32 byte 0 \b, Hash 754!:mime application/x-tokyocabinet-hash 755>32 byte 1 \b, B+ tree 756!:mime application/x-tokyocabinet-btree 757>32 byte 2 \b, Fixed-length 758!:mime application/x-tokyocabinet-fixed 759>32 byte 3 \b, Table 760!:mime application/x-tokyocabinet-table 761>33 byte &1 \b, [open] 762>33 byte &2 \b, [fatal] 763>34 byte x \b, apow=%d 764>35 byte x \b, fpow=%d 765>36 byte &0x01 \b, [large] 766>36 byte &0x02 \b, [deflate] 767>36 byte &0x04 \b, [bzip] 768>36 byte &0x08 \b, [tcbs] 769>36 byte &0x10 \b, [excodec] 770>40 lequad x \b, bnum=%lld 771>48 lequad x \b, rnum=%lld 772>56 lequad x \b, fsiz=%lld 773 774# Type: QDBM Quick Database Manager 775# From: Benoit Sibaud <bsibaud@april.org> 7760 string \\[depot\\]\n\f Quick Database Manager, little endian 7770 string \\[DEPOT\\]\n\f Quick Database Manager, big endian 778 779# Type: TokyoCabinet database 780# URL: http://tokyocabinet.sourceforge.net/ 781# From: Benoit Sibaud <bsibaud@april.org> 7820 string ToKyO\ CaBiNeT\n TokyoCabinet database 783>14 string x (version %s) 784 785# From: Stephane Blondon https://www.yaal.fr 786# Database file for Zope (done by FileStorage) 7870 string FS21 Zope Object Database File Storage v3 (data) 7880 string FS30 Zope Object Database File Storage v4 (data) 789 790# Cache file for the database of Zope (done by ClientStorage) 7910 string ZEC3 Zope Object Database Client Cache File (data) 792 793# IDA (Interactive Disassembler) database 7940 string IDA1 IDA (Interactive Disassembler) database 795 796# Hopper (reverse engineering tool) https://www.hopperapp.com/ 7970 string hopperdb Hopper database 798 799# URL: https://en.wikipedia.org/wiki/Panorama_(database_engine) 800# Reference: http://www.provue.com/Panorama/ 801# From: Joerg Jenderek 802# NOTE: test only versions 4 and 6.0 with Windows 803# length of Panorama database name 8045 ubyte >0 805# look after database name for "some" null bits 806>(5.B+7) ubelong&0xF3ffF000 0 807# look for first keyword 808>>&1 search/2 DESIGN Panorama database 809#!:mime application/x-panorama-database 810!:apple KASXZEPD 811!:ext pan 812# database name 813>>>5 pstring x \b, "%s" 814 815# 816# 817# askSam Database by Stefan A. Haubenthal <polluks@web.de> 8180 string askw40\0 askSam DB 819 820# 821# 822# MUIbase Database Tool by Stefan A. Haubenthal <polluks@web.de> 8230 string MBSTV\040 MUIbase DB 824>6 string x version %s 825 826# 827# CDB database 8280 string NBCDB\012 NetBSD Constant Database 829>7 byte x \b, version %d 830>8 string x \b, for '%s' 831>24 lelong x \b, datasize %d 832>28 lelong x \b, entries %d 833>32 lelong x \b, index %d 834>36 lelong x \b, seed %#x 835 836# 837# Redis RDB - https://redis.io/topics/persistence 8380 string REDIS Redis RDB file, 839>5 regex [0-9][0-9][0-9][0-9] version %s 840 841# Mork database. 842# Used by older versions of Mozilla Suite and Firefox, 843# and current versions of Thunderbird. 844# From: David Korth <gerbilsoft@gerbilsoft.com> 8450 string //\ <!--\ <mdb:mork:z\ v=" Mozilla Mork database 846>23 string x \b, version %.3s 847 848# URL: https://en.wikipedia.org/wiki/Management_Information_Format 849# Reference: https://www.dmtf.org/sites/default/files/standards/documents/DSP0005.pdf 850# From: Joerg Jenderek 851# Note: only tested with monitor asset reports of Dell Display Manager 852# skip start like Language=fr|CA|iso8859-1 8530 search/27/C Start\040Component DMI Management Information Format 854#!:mime text/plain 855!:mime text/x-dmtf-mif 856!:ext mif 857 858