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