database 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. #------------------------------------------------------------------------------
  2. # $File: database,v 1.28 2011/09/16 19:40:40 christos Exp $
  3. # database: file(1) magic for various databases
  4. #
  5. # extracted from header/code files by Graeme Wilford (eep2gw@ee.surrey.ac.uk)
  6. #
  7. #
  8. # GDBM magic numbers
  9. # Will be maintained as part of the GDBM distribution in the future.
  10. # <downsj@teeny.org>
  11. 0 belong 0x13579ace GNU dbm 1.x or ndbm database, big endian
  12. !:mime application/x-gdbm
  13. 0 lelong 0x13579ace GNU dbm 1.x or ndbm database, little endian
  14. !:mime application/x-gdbm
  15. 0 string GDBM GNU dbm 2.x database
  16. !:mime application/x-gdbm
  17. #
  18. # Berkeley DB
  19. #
  20. # Ian Darwin's file /etc/magic files: big/little-endian version.
  21. #
  22. # Hash 1.85/1.86 databases store metadata in network byte order.
  23. # Btree 1.85/1.86 databases store the metadata in host byte order.
  24. # Hash and Btree 2.X and later databases store the metadata in host byte order.
  25. 0 long 0x00061561 Berkeley DB
  26. !:mime application/x-dbm
  27. >8 belong 4321
  28. >>4 belong >2 1.86
  29. >>4 belong <3 1.85
  30. >>4 belong >0 (Hash, version %d, native byte-order)
  31. >8 belong 1234
  32. >>4 belong >2 1.86
  33. >>4 belong <3 1.85
  34. >>4 belong >0 (Hash, version %d, little-endian)
  35. 0 belong 0x00061561 Berkeley DB
  36. >8 belong 4321
  37. >>4 belong >2 1.86
  38. >>4 belong <3 1.85
  39. >>4 belong >0 (Hash, version %d, big-endian)
  40. >8 belong 1234
  41. >>4 belong >2 1.86
  42. >>4 belong <3 1.85
  43. >>4 belong >0 (Hash, version %d, native byte-order)
  44. 0 long 0x00053162 Berkeley DB 1.85/1.86
  45. >4 long >0 (Btree, version %d, native byte-order)
  46. 0 belong 0x00053162 Berkeley DB 1.85/1.86
  47. >4 belong >0 (Btree, version %d, big-endian)
  48. 0 lelong 0x00053162 Berkeley DB 1.85/1.86
  49. >4 lelong >0 (Btree, version %d, little-endian)
  50. 12 long 0x00061561 Berkeley DB
  51. >16 long >0 (Hash, version %d, native byte-order)
  52. 12 belong 0x00061561 Berkeley DB
  53. >16 belong >0 (Hash, version %d, big-endian)
  54. 12 lelong 0x00061561 Berkeley DB
  55. >16 lelong >0 (Hash, version %d, little-endian)
  56. 12 long 0x00053162 Berkeley DB
  57. >16 long >0 (Btree, version %d, native byte-order)
  58. 12 belong 0x00053162 Berkeley DB
  59. >16 belong >0 (Btree, version %d, big-endian)
  60. 12 lelong 0x00053162 Berkeley DB
  61. >16 lelong >0 (Btree, version %d, little-endian)
  62. 12 long 0x00042253 Berkeley DB
  63. >16 long >0 (Queue, version %d, native byte-order)
  64. 12 belong 0x00042253 Berkeley DB
  65. >16 belong >0 (Queue, version %d, big-endian)
  66. 12 lelong 0x00042253 Berkeley DB
  67. >16 lelong >0 (Queue, version %d, little-endian)
  68. # From Max Bowsher.
  69. 12 long 0x00040988 Berkeley DB
  70. >16 long >0 (Log, version %d, native byte-order)
  71. 12 belong 0x00040988 Berkeley DB
  72. >16 belong >0 (Log, version %d, big-endian)
  73. 12 lelong 0x00040988 Berkeley DB
  74. >16 lelong >0 (Log, version %d, little-endian)
  75. #
  76. #
  77. # Round Robin Database Tool by Tobias Oetiker <oetiker@ee.ethz.ch>
  78. 0 string RRD RRDTool DB
  79. >4 string x version %s
  80. #----------------------------------------------------------------------
  81. # ROOT: file(1) magic for ROOT databases
  82. #
  83. 0 string root\0 ROOT file
  84. >4 belong x Version %d
  85. >33 belong x (Compression: %d)
  86. # XXX: Weak magic.
  87. # Alex Ott <ott@jet.msk.su>
  88. ## Paradox file formats
  89. #2 leshort 0x0800 Paradox
  90. #>0x39 byte 3 v. 3.0
  91. #>0x39 byte 4 v. 3.5
  92. #>0x39 byte 9 v. 4.x
  93. #>0x39 byte 10 v. 5.x
  94. #>0x39 byte 11 v. 5.x
  95. #>0x39 byte 12 v. 7.x
  96. #>>0x04 byte 0 indexed .DB data file
  97. #>>0x04 byte 1 primary index .PX file
  98. #>>0x04 byte 2 non-indexed .DB data file
  99. #>>0x04 byte 3 non-incrementing secondary index .Xnn file
  100. #>>0x04 byte 4 secondary index .Ynn file
  101. #>>0x04 byte 5 incrementing secondary index .Xnn file
  102. #>>0x04 byte 6 non-incrementing secondary index .XGn file
  103. #>>0x04 byte 7 secondary index .YGn file
  104. #>>>0x04 byte 8 incrementing secondary index .XGn file
  105. ## XBase database files
  106. #0 byte 0x02
  107. #>8 leshort >0
  108. #>>12 leshort 0 FoxBase
  109. #!:mime application/x-dbf
  110. #>>>0x04 lelong 0 (no records)
  111. #>>>0x04 lelong >0 (%ld records)
  112. #
  113. #0 byte 0x03
  114. #!:mime application/x-dbf
  115. #>8 leshort >0
  116. #>>12 leshort 0 FoxBase+, FoxPro, dBaseIII+, dBaseIV, no memo
  117. #>>>0x04 lelong 0 (no records)
  118. #>>>0x04 lelong >0 (%ld records)
  119. #
  120. #0 byte 0x04
  121. #!:mime application/x-dbf
  122. #>8 leshort >0
  123. #>>12 leshort 0 dBASE IV no memo file
  124. #>>>0x04 lelong 0 (no records)
  125. #>>>0x04 lelong >0 (%ld records)
  126. #
  127. #0 byte 0x05
  128. #!:mime application/x-dbf
  129. #>8 leshort >0
  130. #>>12 leshort 0 dBASE V no memo file
  131. #>>>0x04 lelong 0 (no records)
  132. #>>>0x04 lelong >0 (%ld records)
  133. #
  134. #0 byte 0x30
  135. #!:mime application/x-dbf
  136. #>8 leshort >0
  137. #>>12 leshort 0 Visual FoxPro
  138. #>>>0x04 lelong 0 (no records)
  139. #>>>0x04 lelong >0 (%ld records)
  140. #
  141. #0 byte 0x43
  142. #!:mime application/x-dbf
  143. #>8 leshort >0
  144. #>>12 leshort 0 FlagShip with memo var size
  145. #>>>0x04 lelong 0 (no records)
  146. #>>>0x04 lelong >0 (%ld records)
  147. #
  148. #0 byte 0x7b
  149. #!:mime application/x-dbf
  150. #>8 leshort >0
  151. #>>12 leshort 0 dBASEIV with memo
  152. #>>>0x04 lelong 0 (no records)
  153. #>>>0x04 lelong >0 (%ld records)
  154. #
  155. #0 byte 0x83
  156. #!:mime application/x-dbf
  157. #>8 leshort >0
  158. #>>12 leshort 0 FoxBase+, dBaseIII+ with memo
  159. #>>>0x04 lelong 0 (no records)
  160. #>>>0x04 lelong >0 (%ld records)
  161. #
  162. #0 byte 0x8b
  163. #!:mime application/x-dbf
  164. #>8 leshort >0
  165. #>>12 leshort 0 dBaseIV with memo
  166. #>>>0x04 lelong 0 (no records)
  167. #>>>0x04 lelong >0 (%ld records)
  168. #
  169. #0 byte 0x8e
  170. #!:mime application/x-dbf
  171. #>8 leshort >0
  172. #>>12 leshort 0 dBaseIV with SQL Table
  173. #>>>0x04 lelong 0 (no records)
  174. #>>>0x04 lelong >0 (%ld records)
  175. #
  176. #0 byte 0xb3
  177. #!:mime application/x-dbf
  178. #>8 leshort >0
  179. #>>12 leshort 0 FlagShip with .dbt memo
  180. #>>>0x04 lelong 0 (no records)
  181. #>>>0x04 lelong >0 (%ld records)
  182. #
  183. #0 byte 0xf5
  184. #!:mime application/x-dbf
  185. #>8 leshort >0
  186. #>>12 leshort 0 FoxPro with memo
  187. #>>>0x04 lelong 0 (no records)
  188. #>>>0x04 lelong >0 (%ld records)
  189. #
  190. #0 leshort 0x0006 DBase 3 index file
  191. # MS Access database
  192. 4 string Standard\ Jet\ DB Microsoft Access Database
  193. !:mime application/x-msaccess
  194. # TDB database from Samba et al - Martin Pool <mbp@samba.org>
  195. 0 string TDB\ file TDB database
  196. >32 lelong 0x2601196D version 6, little-endian
  197. >>36 lelong x hash size %d bytes
  198. # SE Linux policy database
  199. 0 lelong 0xf97cff8c SE Linux policy
  200. >16 lelong x v%d
  201. >20 lelong 1 MLS
  202. >24 lelong x %d symbols
  203. >28 lelong x %d ocons
  204. # ICE authority file data (Wolfram Kleff)
  205. 2 string ICE ICE authority data
  206. # X11 Xauthority file (Wolfram Kleff)
  207. 10 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
  208. 11 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
  209. 12 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
  210. 13 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
  211. 14 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
  212. 15 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
  213. 16 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
  214. 17 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
  215. 18 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
  216. # From: Maxime Henrion <mux@FreeBSD.org>
  217. # PostgreSQL's custom dump format, Maxime Henrion <mux@FreeBSD.org>
  218. 0 string PGDMP PostgreSQL custom database dump
  219. >5 byte x - v%d
  220. >6 byte x \b.%d
  221. >5 beshort <0x101 \b-0
  222. >5 beshort >0x100
  223. >>7 byte x \b-%d
  224. # Type: Advanced Data Format (ADF) database
  225. # URL: http://www.grc.nasa.gov/WWW/cgns/adf/
  226. # From: Nicolas Chauvat <nicolas.chauvat@logilab.fr>
  227. 0 string @(#)ADF\ Database CGNS Advanced Data Format
  228. # Tokyo Cabinet magic data
  229. # http://tokyocabinet.sourceforge.net/index.html
  230. 0 string ToKyO\ CaBiNeT\n Tokyo Cabinet
  231. >14 string x \b (%s)
  232. >32 byte 0 \b, Hash
  233. !:mime application/x-tokyocabinet-hash
  234. >32 byte 1 \b, B+ tree
  235. !:mime application/x-tokyocabinet-btree
  236. >32 byte 2 \b, Fixed-length
  237. !:mime application/x-tokyocabinet-fixed
  238. >32 byte 3 \b, Table
  239. !:mime application/x-tokyocabinet-table
  240. >33 byte &1 \b, [open]
  241. >33 byte &2 \b, [fatal]
  242. >34 byte x \b, apow=%d
  243. >35 byte x \b, fpow=%d
  244. >36 byte &0x01 \b, [large]
  245. >36 byte &0x02 \b, [deflate]
  246. >36 byte &0x04 \b, [bzip]
  247. >36 byte &0x08 \b, [tcbs]
  248. >36 byte &0x10 \b, [excodec]
  249. >40 lequad x \b, bnum=%lld
  250. >48 lequad x \b, rnum=%lld
  251. >56 lequad x \b, fsiz=%lld
  252. # G-IR database made by gobject-introspect toolset,
  253. # http://live.gnome.org/GObjectIntrospection
  254. 0 string GOBJ\nMETADATA\r\n\032 G-IR binary database
  255. >16 byte x \b, v%d
  256. >17 byte x \b.%d
  257. >20 leshort x \b, %d entries
  258. >22 leshort x \b/%d local
  259. # Type: QDBM Quick Database Manager
  260. # From: Benoit Sibaud <bsibaud@april.org>
  261. 0 string \\[depot\\]\n\f Quick Database Manager, little endian
  262. 0 string \\[DEPOT\\]\n\f Quick Database Manager, big endian
  263. # Type: TokyoCabinet database
  264. # URL: http://tokyocabinet.sourceforge.net/
  265. # From: Benoit Sibaud <bsibaud@april.org>
  266. 0 string ToKyO\ CaBiNeT\n TokyoCabinet database
  267. >14 string x (version %s)
  268. # From: Stéphane Blondon http://www.yaal.fr
  269. # Database file for Zope (done by FileStorage)
  270. 0 string FS21 Zope Object Database File Storage (data)
  271. # Cache file for the database of Zope (done by ClientStorage)
  272. 0 string ZEC3 Zope Object Database Client Cache File (data)