database 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. #------------------------------------------------------------------------------
  2. # database: file(1) magic for various databases
  3. #
  4. # extracted from header/code files by Graeme Wilford (eep2gw@ee.surrey.ac.uk)
  5. #
  6. #
  7. # GDBM magic numbers
  8. # Will be maintained as part of the GDBM distribution in the future.
  9. # <downsj@teeny.org>
  10. 0 belong 0x13579ace GNU dbm 1.x or ndbm database, big endian
  11. 0 lelong 0x13579ace GNU dbm 1.x or ndbm database, little endian
  12. 0 string GDBM GNU dbm 2.x database
  13. #
  14. # Berkeley DB
  15. #
  16. # Ian Darwin's file /etc/magic files: big/little-endian version.
  17. #
  18. # Hash 1.85/1.86 databases store metadata in network byte order.
  19. # Btree 1.85/1.86 databases store the metadata in host byte order.
  20. # Hash and Btree 2.X and later databases store the metadata in host byte order.
  21. 0 long 0x00061561 Berkeley DB
  22. >8 belong 4321
  23. >>4 belong >2 1.86
  24. >>4 belong <3 1.85
  25. >>4 belong >0 (Hash, version %d, native byte-order)
  26. >8 belong 1234
  27. >>4 belong >2 1.86
  28. >>4 belong <3 1.85
  29. >>4 belong >0 (Hash, version %d, little-endian)
  30. 0 belong 0x00061561 Berkeley DB
  31. >8 belong 4321
  32. >>4 belong >2 1.86
  33. >>4 belong <3 1.85
  34. >>4 belong >0 (Hash, version %d, big-endian)
  35. >8 belong 1234
  36. >>4 belong >2 1.86
  37. >>4 belong <3 1.85
  38. >>4 belong >0 (Hash, version %d, native byte-order)
  39. 0 long 0x00053162 Berkeley DB 1.85/1.86
  40. >4 long >0 (Btree, version %d, native byte-order)
  41. 0 belong 0x00053162 Berkeley DB 1.85/1.86
  42. >4 belong >0 (Btree, version %d, big-endian)
  43. 0 lelong 0x00053162 Berkeley DB 1.85/1.86
  44. >4 lelong >0 (Btree, version %d, little-endian)
  45. 12 long 0x00061561 Berkeley DB
  46. >16 long >0 (Hash, version %d, native byte-order)
  47. 12 belong 0x00061561 Berkeley DB
  48. >16 belong >0 (Hash, version %d, big-endian)
  49. 12 lelong 0x00061561 Berkeley DB
  50. >16 lelong >0 (Hash, version %d, little-endian)
  51. 12 long 0x00053162 Berkeley DB
  52. >16 long >0 (Btree, version %d, native byte-order)
  53. 12 belong 0x00053162 Berkeley DB
  54. >16 belong >0 (Btree, version %d, big-endian)
  55. 12 lelong 0x00053162 Berkeley DB
  56. >16 lelong >0 (Btree, version %d, little-endian)
  57. 12 long 0x00042253 Berkeley DB
  58. >16 long >0 (Queue, version %d, native byte-order)
  59. 12 belong 0x00042253 Berkeley DB
  60. >16 belong >0 (Queue, version %d, big-endian)
  61. 12 lelong 0x00042253 Berkeley DB
  62. >16 lelong >0 (Queue, version %d, little-endian)
  63. # From Max Bowsher.
  64. 12 long 0x00040988 Berkeley DB
  65. >16 long >0 (Log, version %d, native byte-order)
  66. 12 belong 0x00040988 Berkeley DB
  67. >16 belong >0 (Log, version %d, big-endian)
  68. 12 lelong 0x00040988 Berkeley DB
  69. >16 lelong >0 (Log, version %d, little-endian)
  70. #
  71. #
  72. # Round Robin Database Tool by Tobias Oetiker <oetiker@ee.ethz.ch>
  73. 0 string RRD RRDTool DB
  74. >4 string x version %s
  75. #----------------------------------------------------------------------
  76. # ROOT: file(1) magic for ROOT databases
  77. #
  78. 0 string root\0 ROOT file
  79. >4 belong x Version %d
  80. >33 belong x (Compression: %d)
  81. # XXX: Weak magic.
  82. # Alex Ott <ott@jet.msk.su>
  83. ## Paradox file formats
  84. #2 leshort 0x0800 Paradox
  85. #>0x39 byte 3 v. 3.0
  86. #>0x39 byte 4 v. 3.5
  87. #>0x39 byte 9 v. 4.x
  88. #>0x39 byte 10 v. 5.x
  89. #>0x39 byte 11 v. 5.x
  90. #>0x39 byte 12 v. 7.x
  91. #>>0x04 byte 0 indexed .DB data file
  92. #>>0x04 byte 1 primary index .PX file
  93. #>>0x04 byte 2 non-indexed .DB data file
  94. #>>0x04 byte 3 non-incrementing secondary index .Xnn file
  95. #>>0x04 byte 4 secondary index .Ynn file
  96. #>>0x04 byte 5 incrementing secondary index .Xnn file
  97. #>>0x04 byte 6 non-incrementing secondary index .XGn file
  98. #>>0x04 byte 7 secondary index .YGn file
  99. #>>>0x04 byte 8 incrementing secondary index .XGn file
  100. ## XBase database files
  101. #0 byte 0x02
  102. #>8 leshort >0
  103. #>>12 leshort 0 FoxBase
  104. #>>>0x04 lelong 0 (no records)
  105. #>>>0x04 lelong >0 (%ld records)
  106. #
  107. #0 byte 0x03
  108. #>8 leshort >0
  109. #>>12 leshort 0 FoxBase+, FoxPro, dBaseIII+, dBaseIV, no memo
  110. #>>>0x04 lelong 0 (no records)
  111. #>>>0x04 lelong >0 (%ld records)
  112. #
  113. #0 byte 0x04
  114. #>8 leshort >0
  115. #>>12 leshort 0 dBASE IV no memo file
  116. #>>>0x04 lelong 0 (no records)
  117. #>>>0x04 lelong >0 (%ld records)
  118. #
  119. #0 byte 0x05
  120. #>8 leshort >0
  121. #>>12 leshort 0 dBASE V no memo file
  122. #>>>0x04 lelong 0 (no records)
  123. #>>>0x04 lelong >0 (%ld records)
  124. #
  125. #0 byte 0x30
  126. #>8 leshort >0
  127. #>>12 leshort 0 Visual FoxPro
  128. #>>>0x04 lelong 0 (no records)
  129. #>>>0x04 lelong >0 (%ld records)
  130. #
  131. #0 byte 0x43
  132. #>8 leshort >0
  133. #>>12 leshort 0 FlagShip with memo var size
  134. #>>>0x04 lelong 0 (no records)
  135. #>>>0x04 lelong >0 (%ld records)
  136. #
  137. #0 byte 0x7b
  138. #>8 leshort >0
  139. #>>12 leshort 0 dBASEIV with memo
  140. #>>>0x04 lelong 0 (no records)
  141. #>>>0x04 lelong >0 (%ld records)
  142. #
  143. #0 byte 0x83
  144. #>8 leshort >0
  145. #>>12 leshort 0 FoxBase+, dBaseIII+ with memo
  146. #>>>0x04 lelong 0 (no records)
  147. #>>>0x04 lelong >0 (%ld records)
  148. #
  149. #0 byte 0x8b
  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 0x8e
  156. #>8 leshort >0
  157. #>>12 leshort 0 dBaseIV with SQL Table
  158. #>>>0x04 lelong 0 (no records)
  159. #>>>0x04 lelong >0 (%ld records)
  160. #
  161. #0 byte 0xb3
  162. #>8 leshort >0
  163. #>>12 leshort 0 FlagShip with .dbt memo
  164. #>>>0x04 lelong 0 (no records)
  165. #>>>0x04 lelong >0 (%ld records)
  166. #
  167. #0 byte 0xf5
  168. #>8 leshort >0
  169. #>>12 leshort 0 FoxPro with memo
  170. #>>>0x04 lelong 0 (no records)
  171. #>>>0x04 lelong >0 (%ld records)
  172. #
  173. #0 leshort 0x0006 DBase 3 index file
  174. # MS Access database
  175. 4 string Standard\ Jet\ DB Microsoft Access Database
  176. # TDB database from Samba et al - Martin Pool <mbp@samba.org>
  177. 0 string TDB\ file TDB database
  178. >32 lelong 0x2601196D version 6, little-endian
  179. >>36 lelong x hash size %d bytes
  180. # SE Linux policy database
  181. 0 lelong 0xf97cff8c SE Linux policy
  182. >16 lelong x v%d
  183. >20 lelong 1 MLS
  184. >24 lelong x %d symbols
  185. >28 lelong x %d ocons
  186. # ICE authority file data (Wolfram Kleff)
  187. 2 string ICE ICE authority data
  188. # X11 Xauthority file (Wolfram Kleff)
  189. 10 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
  190. 11 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
  191. 12 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
  192. 13 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
  193. 14 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
  194. 15 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
  195. 16 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
  196. 17 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
  197. 18 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
  198. # From: Maxime Henrion <mux@FreeBSD.org>
  199. # PostgreSQL's custom dump format, Maxime Henrion <mux@FreeBSD.org>
  200. 0 string PGDMP PostgreSQL custom database dump
  201. >5 byte x - v%d
  202. >6 byte x \b.%d
  203. >5 beshort <=0x100 \b-0
  204. >5 beshort >0x100
  205. >>7 byte x \b-%d