1 2#------------------------------------------------------------------------------ 3# $File: sql,v 1.18 2015/12/04 20:38:43 christos Exp $ 4# sql: file(1) magic for SQL files 5# 6# From: "Marty Leisner" <mleisner@eng.mc.xerox.com> 7# Recognize some MySQL files. 8# Elan Ruusamae <glen@delfi.ee>, added MariaDB signatures 9# from https://bazaar.launchpad.net/~maria-captains/maria/5.5/view/head:/support-files/magic 10# 110 beshort 0xfe01 MySQL table definition file 12>2 byte x Version %d 130 belong&0xffffff00 0xfefe0700 MySQL MyISAM index file 14>3 byte x Version %d 150 belong&0xffffff00 0xfefe0800 MySQL MyISAM compressed data file 16>3 byte x Version %d 170 belong&0xffffff00 0xfefe0900 MySQL Maria index file 18>3 byte x Version %d 190 belong&0xffffff00 0xfefe0A00 MySQL Maria compressed data file 20>3 byte x Version %d 210 belong&0xffffff00 0xfefe0500 MySQL ISAM index file 22>3 byte x Version %d 230 belong&0xffffff00 0xfefe0600 MySQL ISAM compressed data file 24>3 byte x Version %d 250 string \376bin MySQL replication log 260 belong&0xffffff00 0xfefe0b00 27>4 string MARIALOG MySQL Maria transaction log file 28>>3 byte x Version %d 290 belong&0xffffff00 0xfefe0c00 30>4 string MACF MySQL Maria control file 31>>3 byte x Version %d 32 33#------------------------------------------------------------------------------ 34# iRiver H Series database file 35# From Ken Guest <ken@linux.ie> 36# As observed from iRivNavi.iDB and unencoded firmware 37# 380 string iRivDB iRiver Database file 39>11 string >\0 Version %s 40>39 string iHP-100 [H Series] 41 42#------------------------------------------------------------------------------ 43# SQLite database files 44# Ken Guest <ken@linux.ie>, Ty Sarna, Zack Weinberg 45# 46# Version 1 used GDBM internally; its files cannot be distinguished 47# from other GDBM files. 48# 49# Version 2 used this format: 500 string **\ This\ file\ contains\ an\ SQLite SQLite 2.x database 51 52# Version 3 of SQLite allows applications to embed their own "user version" 53# number in the database at offset 60. Later, SQLite added an "application id" 54# at offset 68 that is preferred over "user version" for indicating the 55# associated application. 56# 570 string SQLite\ format\ 3 SQLite 3.x database 58!:mime application/x-sqlite3 59# seldom found extension sqlite3 like in SyncData.sqlite3 60# db 61# Avira Antivir use extension "dbe" like in avevtdb.dbe, avguard_tchk.dbe 62# Unfortunately extension sqlite also used for other databases starting with string 63# "TTCONTAINER" like in tracks.sqlite contentconsumer.sqlite contentproducerrepository.sqlite 64# and with string "ZV-zlib" in like extra.sqlite 65!:ext sqlite/sqlite3/db/dbe 66>60 belong =0x5f4d544e (Monotone source repository) 67>68 belong =0x0f055112 (Fossil checkout) 68>68 belong =0x0f055113 (Fossil global configuration) 69>68 belong =0x0f055111 (Fossil repository) 70>68 belong =0x42654462 (Bentley Systems BeSQLite Database) 71>68 belong =0x42654c6e (Bentley Systems Localization File) 72>68 belong =0x47504b47 (OGC GeoPackage file) 73>68 default x 74>>68 belong !0 \b, application id %u 75>>60 belong !0 \b, user version %d 76>96 belong x \b, last written using SQLite version %d 77 78 79# SQLite Write-Ahead Log from SQLite version >= 3.7.0 80# http://www.sqlite.org/fileformat.html#walformat 810 belong&0xfffffffe 0x377f0682 SQLite Write-Ahead Log, 82!:ext sqlite-wal/db-wal 83>4 belong x version %d 84 85# SQLite Rollback Journal 86# http://www.sqlite.org/fileformat.html#rollbackjournal 870 string \xd9\xd5\x05\xf9\x20\xa1\x63\xd7 SQLite Rollback Journal 88 89# Panasonic channel list database svl.bin or svl.db added by Joerg Jenderek 90# https://github.com/PredatH0r/ChanSort 910 string PSDB\0 Panasonic channel list DataBase 92!:ext db/bin 93#!:mime application/x-db-svl-panasonic 94>126 string SQLite\ format\ 3 95#!:mime application/x-panasonic-sqlite3 96>>&-15 indirect x \b; contains 97