adventure 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. #------------------------------------------------------------------------------
  2. # $File: adventure,v 1.17 2017/07/03 16:03:40 christos Exp $
  3. # adventure: file(1) magic for Adventure game files
  4. #
  5. # from Allen Garvin <earendil@faeryland.tamu-commerce.edu>
  6. # Edited by Dave Chapeskie <dchapes@ddm.on.ca> Jun 28, 1998
  7. # Edited by Chris Chittleborough <cchittleborough@yahoo.com.au>, March 2002
  8. #
  9. # ALAN
  10. # I assume there are other, lower versions, but these are the only ones I
  11. # saw in the archive.
  12. 0 beshort 0x0206 ALAN game data
  13. >2 byte <10 version 2.6%d
  14. # Infocom (see z-machine)
  15. #------------------------------------------------------------------------------
  16. # Z-machine: file(1) magic for Z-machine binaries.
  17. # Sanity checks by David Griffith <dave@661.org>
  18. # Updated by Adam Buchbinder <adam.buchbinder@gmail.com>
  19. #
  20. #http://www.gnelson.demon.co.uk/zspec/sect11.html
  21. #http://www.jczorkmid.net/~jpenney/ZSpec11-latest.txt
  22. #http://en.wikipedia.org/wiki/Z-machine
  23. # The first byte is the Z-machine revision; it is always between 1 and 8. We
  24. # had false matches (for instance, inbig5.ocp from the Omega TeX extension as
  25. # well as an occasional MP3 file), so we sanity-check the version number.
  26. #
  27. # It might be possible to sanity-check the release number as well, as it seems
  28. # (at least in classic Infocom games) to always be a relatively small number,
  29. # always under 150 or so, but as this isn't rigorous, we'll wait on that until
  30. # it becomes clear that it's needed.
  31. #
  32. 0 ubyte >0
  33. >0 ubyte <9
  34. >>16 belong&0xfe00f0f0 0x3030
  35. >>>0 ubyte < 10
  36. >>>>2 ubeshort x
  37. >>>>>18 regex [0-9][0-9][0-9][0-9][0-9][0-9]
  38. >>>>>>0 ubyte < 10 Infocom (Z-machine %d
  39. >>>>>>>2 ubeshort x \b, Release %d
  40. >>>>>>>>18 string >\0 \b, Serial %.6s
  41. >>>>>>>>18 string x \b)
  42. !:strength + 40
  43. !:mime application/x-zmachine
  44. #------------------------------------------------------------------------------
  45. # Glulx: file(1) magic for Glulx binaries.
  46. #
  47. # David Griffith <dave@661.org>
  48. # I haven't checked for false matches yet.
  49. #
  50. 0 string Glul Glulx game data
  51. >4 beshort x (Version %d
  52. >>6 byte x \b.%d
  53. >>8 byte x \b.%d)
  54. >36 string Info Compiled by Inform
  55. !:mime application/x-glulx
  56. # For Quetzal and blorb magic see iff
  57. # TADS (Text Adventure Development System) version 2
  58. # All files are machine-independent (games compile to byte-code) and are tagged
  59. # with a version string of the form "V2.<digit>.<digit>\0".
  60. # Game files start with "TADS2 bin\n\r\032\0" then the compiler version.
  61. 0 string TADS2\ bin TADS
  62. >9 belong !0x0A0D1A00 game data, CORRUPTED
  63. >9 belong 0x0A0D1A00
  64. >>13 string >\0 %s game data
  65. !:mime application/x-tads
  66. # Resource files start with "TADS2 rsc\n\r\032\0" then the compiler version.
  67. 0 string TADS2\ rsc TADS
  68. >9 belong !0x0A0D1A00 resource data, CORRUPTED
  69. >9 belong 0x0A0D1A00
  70. >>13 string >\0 %s resource data
  71. !:mime application/x-tads
  72. # Some saved game files start with "TADS2 save/g\n\r\032\0", a little-endian
  73. # 2-byte length N, the N-char name of the game file *without* a NUL (darn!),
  74. # "TADS2 save\n\r\032\0" and the interpreter version.
  75. 0 string TADS2\ save/g TADS
  76. >12 belong !0x0A0D1A00 saved game data, CORRUPTED
  77. >12 belong 0x0A0D1A00
  78. >>(16.s+32) string >\0 %s saved game data
  79. !:mime application/x-tads
  80. # Other saved game files start with "TADS2 save\n\r\032\0" and the interpreter
  81. # version.
  82. 0 string TADS2\ save TADS
  83. >10 belong !0x0A0D1A00 saved game data, CORRUPTED
  84. >10 belong 0x0A0D1A00
  85. >>14 string >\0 %s saved game data
  86. !:mime application/x-tads
  87. # TADS (Text Adventure Development System) version 3
  88. # Game files start with "T3-image\015\012\032"
  89. 0 string T3-image\015\012\032
  90. >11 leshort x TADS 3 game data (format version %d)
  91. # Saved game files start with "T3-state-v####\015\012\032"
  92. # where #### is a format version number
  93. 0 string T3-state-v
  94. >14 string \015\012\032 TADS 3 saved game data (format version
  95. >>10 byte x %c
  96. >>11 byte x \b%c
  97. >>12 byte x \b%c
  98. >>13 byte x \b%c)
  99. !:mime application/x-t3vm-image
  100. # edited by David Griffith <dave@661.org>
  101. # Danny Milosavljevic <danny.milo@gmx.net>
  102. # These are ADRIFT (adventure game standard) game files, extension .taf
  103. # Checked from source at (http://www.adrift.co/) and various taf files
  104. # found at the Interactive Fiction Archive (http://ifarchive.org/)
  105. 0 belong 0x3C423FC9
  106. >4 belong 0x6A87C2CF Adrift game file version
  107. >>8 belong 0x94453661 3.80
  108. >>8 belong 0x94453761 3.90
  109. >>8 belong 0x93453E61 4.0
  110. >>8 belong 0x92453E61 5.0
  111. >>8 default x unknown
  112. !:mime application/x-adrift