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