1 2#------------------------------------------------------------------------------ |
3# $File: database,v 1.43 2014/10/28 15:47:39 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. --- 173 unchanged lines hidden (view full) --- 205>>>>>>>>>>>>8 uleshort >0 206>>>>>>>>>>>>(8.s+1) ubyte >0 207>>>>>>>>>>>>>8 uleshort >0 \b, at offset %d 208>>>>>>>>>>>>>(8.s+1) ubyte >0 209>>>>>>>>>>>>>>&-1 string >\0 1st record "%s" 210# for multiple index files (*.MDX) Production flag,tag numbers(<=0x30),tag length(<=0x20), reserverd (NULL) 211>>>>>>>24 ubelong&0x0133f7ff >0 212# test for reserved NULL byte |
213>>>>>>>>47 ubyte 0 |
214# test for valid TAG key format (0x10 or 0) 215>>>>>>>>>559 ubyte&0xeF 0 216# test MM <= 12 |
217>>>>>>>>>>45 ubeshort <0x0C20 218>>>>>>>>>>>45 ubyte >0 219>>>>>>>>>>>>46 ubyte <32 220>>>>>>>>>>>>>46 ubyte >0 |
221#!:mime application/x-mdx |
222>>>>>>>>>>>>>>0 use xbase-type 223>>>>>>>>>>>>>>0 ubyte x \b MDX 224>>>>>>>>>>>>>>1 ubyte x \b, creation-date 225>>>>>>>>>>>>>>1 use xbase-date 226>>>>>>>>>>>>>>44 ubyte x \b, update-date 227>>>>>>>>>>>>>>44 use xbase-date |
228# No.of tags in use (1,2,5,12) |
229>>>>>>>>>>>>>>28 uleshort x \b, %d |
230# No. of entries in tag (0x30) |
231>>>>>>>>>>>>>>25 ubyte x \b/%d tags |
232# Length of tag |
233>>>>>>>>>>>>>>26 ubyte x * %d |
234# 1st tag name_ 235>>>>>>>>>>>>>548 string x \b, 1st tag "%.11s" 236# 2nd tag name 237#>>>>>>>>>>>>(26.b+548) string x \b, 2nd tag "%.11s" 238# 239# Print the xBase names of different version variants 2400 name xbase-type 241>0 ubyte <2 --- 98 unchanged lines hidden (view full) --- 340>>>0 ulelong >0 341# skip many JPG. ZIP, BZ2 by test for reserved bytes NULL , 0|2 , 0|1 , low byte of block size 342>>>>17 ubelong&0xFFfdFE00 0x00000000 343# skip many RAR by test for low byte 0 ,high byte 0|2|even of block size, 0|a|e|d7 , 0|64h 344>>>>>20 ubelong&0xFF01209B 0x00000000 345# dBASE III 346>>>>>>16 ubyte 3 347# dBASE III DBT |
348>>>>>>>0 use dbase3-memo-print 349# dBASE III DBT without version, dBASE IV DBT , FoxPro FPT , or many ZIP , DBF garbage |
350>>>>>>16 ubyte 0 |
351# unusual dBASE III DBT like angest.dbt, dBASE IV DBT with block size 0 , FoxPro FPT , or garbage PCX DBF 352>>>>>>>20 uleshort 0 353# FoxPro FPT , unusual dBASE III DBT like biblio.dbt or garbage 354>>>>>>>>8 ulong =0 355>>>>>>>>>6 ubeshort >0 356# skip emacs.PIF 357>>>>>>>>>>4 ushort 0 358>>>>>>>>>>>0 use foxpro-memo-print 359# dBASE III DBT , garbage 360>>>>>>>>>6 ubeshort 0 |
361# skip MM*DD*.bin by test for for reserved NULL byte |
362>>>>>>>>>>510 ubeshort 0 363# skip TK-DOS11.img image by looking for memo text 364>>>>>>>>>>>512 ubelong <0xfeffff03 365# skip EFI executables by looking for memo text 366>>>>>>>>>>>>512 ubelong >0x1F202020 367>>>>>>>>>>>>>513 ubyte >0 368# unusual dBASE III DBT like adressen.dbt 369>>>>>>>>>>>>>>0 use dbase3-memo-print 370# dBASE III DBT like angest.dbt, or garbage PCX DBF 371>>>>>>>>8 ubelong !0 372# skip PCX and some DBF by test for for reserved NULL bytes 373>>>>>>>>>510 ubeshort 0 374# skip some DBF by test of invalid version 375>>>>>>>>>>0 ubyte >5 376>>>>>>>>>>>0 ubyte <48 377>>>>>>>>>>>>0 use dbase3-memo-print 378# dBASE IV DBT with positive block size 379>>>>>>>20 uleshort >0 380>>>>>>>>0 use dbase4-memo-print |
381 |
382# Print the information of dBase III DBT memo file 3830 name dbase3-memo-print 384>0 ubyte x dBase III DBT 385# instead 3 as version number 0 for unusual examples like biblio.dbt 386>16 ubyte !3 \b, version number %u |
387# Number of next available block for appending data |
388#>0 lelong =0 \b, next free block index %u 389>0 lelong !0 \b, next free block index %u 390# no positiv block length 391#>20 uleshort =0 \b, block length %u 392>20 uleshort !0 \b, block length %u 393# dBase III memo field terminated by \032\032 394>512 string >\0 \b, 1st item "%s" 395# Print the information of dBase IV DBT memo file 3960 name dbase4-memo-print 397>0 lelong x dBase IV DBT 398# 8 character shorted main name of coresponding dBASE IV DBF file 399>8 ubelong >0x20000000 400# skip unusual like for angest.dbt 401>>20 uleshort >0 402>>>8 string >\0 \b of %-.8s.DBF 403# value 0 implies 512 as size 404#>4 ulelong =0 \b, blocks size %u 405# size of blocks not reliable like 0x2020204C in angest.dbt 406>4 ulelong !0 407>>4 ulelong&0x0000003f 0 \b, blocks size %u 408# dBase IV DBT with positive block length (found 512 , 1024) 409>20 uleshort >0 \b, block length %u 410# next available block 411#>0 lelong =0 \b, next free block index %u 412>0 lelong !0 \b, next free block index %u 413>20 uleshort >0 414>>(20.s) ubelong x 415>>>&-4 use dbase4-memofield-print 416# unusual dBase IV DBT without block length (implies 512 as length) 417>20 uleshort =0 418>>512 ubelong x 419>>>&-4 use dbase4-memofield-print 420# Print the information of dBase IV memo field 4210 name dbase4-memofield-print 422# free dBase IV memo field 423>0 ubelong !0xFFFF0800 424>>0 lelong x \b, next free block %u 425>>4 lelong x \b, next used block %u 426# used dBase IV memo field 427>0 ubelong =0xFFFF0800 428# length of memo field 429>>4 lelong x \b, field length %d 430>>>8 string >\0 \b, 1st used item "%s" 431# Print the information of FoxPro FPT memo file 4320 name foxpro-memo-print 433>0 belong x FoxPro FPT 434# Size of blocks for FoxPro ( 64,256 ) 435>6 ubeshort x \b, blocks size %u 436# next available block 437#>0 belong =0 \b, next free block index %u 438>0 belong !0 \b, next free block index %u 439# field type ( 0~picture, 1~memo, 2~object ) 440>512 ubelong <3 \b, field type %u 441# length of memo field 442>512 ubelong 1 443>>516 belong >0 \b, field length %d 444>>>520 string >\0 \b, 1st item "%s" |
445 446# TODO: 447# DBASE index file *.NDX 448# DBASE Compound Index file *.CDX 449# dBASE IV Printer Driver *.PRF 450## End of XBase database stuff 451 452# MS Access database --- 89 unchanged lines hidden --- |