2 #------------------------------------------------------------------------------
3 # animation: file(1) magic for animation/movie formats
6 # MPEG, FLI, DL originally from vax@ccwf.cc.utexas.edu (VaX#n8)
7 # FLC, SGI, Apple originally from Daniel Quinlan (quinlan@yggdrasil.com)
9 # MPEG animation format
10 0 belong 0x000001b3 MPEG video stream data
11 #>4 beshort&0xfff0 x (%d x
12 #>5 beshort&0x0fff x %d)
13 0 belong 0x000001ba MPEG system stream data
16 # from dreesen@math.fu-berlin.de
19 # This conflicts with the FF FE signature for UTF-16-encoded Unicode
20 # text, which will be identified as an MP3 file. I don't have any MP3s
21 # so I don't know how to (or even if it's possible to) change this to
22 # tell the two apart. enf@pobox.com
29 >>>2 byte&0xf0 =0x10 \b, 32 kBits
30 >>>2 byte&0xf0 =0x20 \b, 40 kBits
31 >>>2 byte&0xf0 =0x30 \b, 48 kBits
32 >>>2 byte&0xf0 =0x40 \b, 56 kBits
33 >>>2 byte&0xf0 =0x50 \b, 64 kBits
34 >>>2 byte&0xf0 =0x60 \b, 80 kBits
35 >>>2 byte&0xf0 =0x70 \b, 96 kBits
36 >>>2 byte&0xf0 =0x80 \b, 112 kBits
37 >>>2 byte&0xf0 =0x90 \b, 128 kBits
38 >>>2 byte&0xf0 =0xA0 \b, 160 kBits
39 >>>2 byte&0xf0 =0xB0 \b, 192 kBits
40 >>>2 byte&0xf0 =0xC0 \b, 224 kBits
41 >>>2 byte&0xf0 =0xD0 \b, 256 kBits
42 >>>2 byte&0xf0 =0xE0 \b, 320 kBits
45 >>>2 byte&0xf0 =0x10 \b, 32 kBits
46 >>>2 byte&0xf0 =0x20 \b, 48 kBits
47 >>>2 byte&0xf0 =0x30 \b, 56 kBits
48 >>>2 byte&0xf0 =0x40 \b, 64 kBits
49 >>>2 byte&0xf0 =0x50 \b, 80 kBits
50 >>>2 byte&0xf0 =0x60 \b, 96 kBits
51 >>>2 byte&0xf0 =0x70 \b, 112 kBits
52 >>>2 byte&0xf0 =0x80 \b, 128 kBits
53 >>>2 byte&0xf0 =0x90 \b, 160 kBits
54 >>>2 byte&0xf0 =0xA0 \b, 192 kBits
55 >>>2 byte&0xf0 =0xB0 \b, 224 kBits
56 >>>2 byte&0xf0 =0xC0 \b, 256 kBits
57 >>>2 byte&0xf0 =0xD0 \b, 320 kBits
58 >>>2 byte&0xf0 =0xE0 \b, 384 kBits
60 >>2 byte&0x0C =0x00 \b, 44.1 kHz
61 >>2 byte&0x0C =0x04 \b, 48 kHz
62 >>2 byte&0x0C =0x08 \b, 32 kHz
69 >>2 byte&0xf0 =0x10 \b, 8 kBits
70 >>2 byte&0xf0 =0x20 \b, 16 kBits
71 >>2 byte&0xf0 =0x30 \b, 24 kBits
72 >>2 byte&0xf0 =0x40 \b, 32 kBits
73 >>2 byte&0xf0 =0x50 \b, 40 kBits
74 >>2 byte&0xf0 =0x60 \b, 48 kBits
75 >>2 byte&0xf0 =0x70 \b, 56 kBits
76 >>2 byte&0xf0 =0x80 \b, 64 kBits
77 >>2 byte&0xf0 =0x90 \b, 80 kBits
78 >>2 byte&0xf0 =0xA0 \b, 96 kBits
79 >>2 byte&0xf0 =0xB0 \b, 112 kBits
80 >>2 byte&0xf0 =0xC0 \b, 128 kBits
81 >>2 byte&0xf0 =0xD0 \b, 144 kBits
82 >>2 byte&0xf0 =0xE0 \b, 160 kBits
84 >>2 byte&0x0C =0x00 \b, 22.05 kHz
85 >>2 byte&0x0C =0x04 \b, 24 kHz
86 >>2 byte&0x0C =0x08 \b, 16 kHz
88 >3 byte&0xC0 =0x00 \b, Stereo
89 >3 byte&0xC0 =0x40 \b, JStereo
90 >3 byte&0xC0 =0x80 \b, Dual-Ch
91 >3 byte&0xC0 =0xC0 \b, Mono
92 #>1 byte&0x01 =0x00 \b, Error Protection
93 #>2 byte&0x02 =0x02 \b, Padding
94 #>2 byte&0x01 =0x01 \b, Private
95 #>3 byte&0x08 =0x08 \b, Copyright
96 #>3 byte&0x04 =0x04 \b, Original
97 #>3 byte&0x03 1 \b, Emphasis 5
98 #>3 byte&0x03 3 \b, Emphasis c
100 # FLI animation format
101 4 leshort 0xAF11 FLI file
102 >6 leshort x - %d frames,
103 >8 leshort x width=%d pixels,
104 >10 leshort x height=%d pixels,
105 >12 leshort x depth=%d,
106 >16 leshort x ticks/frame=%d
107 # FLC animation format
108 4 leshort 0xAF12 FLC file
109 >6 leshort x - %d frames
110 >8 leshort x width=%d pixels,
111 >10 leshort x height=%d pixels,
112 >12 leshort x depth=%d,
113 >16 leshort x ticks/frame=%d
115 # DL animation format
116 # XXX - collision with most `mips' magic
118 # I couldn't find a real magic number for these, however, this
119 # -appears- to work. Note that it might catch other files, too, so be
122 # Note that title and author appear in the two 20-byte chunks
123 # at decimal offsets 2 and 22, respectively, but they are XOR'ed with
124 # 255 (hex FF)! The DL format is really bad.
126 #0 byte 1 DL version 1, medium format (160x100, 4 images/screen)
127 #>42 byte x - %d screens,
128 #>43 byte x %d commands
129 #0 byte 2 DL version 2
130 #>1 byte 1 - large format (320x200,1 image/screen),
131 #>1 byte 2 - medium format (160x100,4 images/screen),
132 #>1 byte >2 - unknown format,
133 #>42 byte x %d screens,
134 #>43 byte x %d commands
135 # Based on empirical evidence, DL version 3 have several nulls following the
136 # \003. Most of them start with non-null values at hex offset 0x34 or so.
137 #0 string \3\0\0\0\0\0\0\0\0\0\0\0 DL version 3
139 # SGI and Apple formats
140 0 string MOVI Silicon Graphics movie file
141 4 string moov Apple QuickTime movie file (moov)
142 4 string mdat Apple QuickTime movie file (mdat)
144 # iso 13818 transport stream
146 # from Oskar Schirmer <schirmer@scara.com> Feb 3, 2001 (ISO 13818.1)
147 # (the following is a little bit restrictive and works fine for a stream
148 # that starts with PAT properly. it won't work for stream data, that is
149 # cut from an input device data right in the middle, but this shouldn't
151 # syncbyte 8 bit 0x47
153 # payload_start 1 bit 1
157 # adaptfld_ctrl 2 bit 1 or 3
158 # conti_count 4 bit 0
159 0 belong&0xFF5FFF1F 0x47400010 MPEG transport stream data
160 >188 byte !0x47 CORRUPTED
162 # ATARI ST relocatable PRG
164 # from Oskar Schirmer <schirmer@scara.com> Feb 3, 2001
165 # (according to Roland Waldi, Oct 21, 1987)
166 # besides the magic 0x601a, the text segment size is checked to be
167 # not larger than 1 MB (which is a lot on ST).
168 0 belong&0xFFFFFFF0 0x601A0000 Atari ST M68K executable
169 >2 belong x (txt=%ld,
171 >10 belong x bss=%ld,
172 >14 belong x sym=%ld)