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