1 #------------------------------------------------------------------------------
3 # Toby Deshane <hac@shoelace.digivill.net>
4 # ines: file(1) magic for Marat's iNES Nintendo Entertainment System
7 0 string NES\032 iNES ROM dump,
9 >5 byte x \b, %dx8k CHR
10 >6 byte&0x01 =0x1 \b, [Vert.]
11 >6 byte&0x01 =0x0 \b, [Horiz.]
12 >6 byte&0x02 =0x2 \b, [SRAM]
13 >6 byte&0x04 =0x4 \b, [Trainer]
14 >6 byte&0x04 =0x8 \b, [4-Scr]
16 #------------------------------------------------------------------------------
17 # gameboy: file(1) magic for the Nintendo (Color) Gameboy raw ROM format
19 0x104 belong 0xCEED6666 Gameboy ROM:
20 >0x134 string >\0 "%.16s"
21 >0x146 byte 0x03 \b,[SGB]
22 >0x147 byte 0x00 \b, [ROM ONLY]
23 >0x147 byte 0x01 \b, [ROM+MBC1]
24 >0x147 byte 0x02 \b, [ROM+MBC1+RAM]
25 >0x147 byte 0x03 \b, [ROM+MBC1+RAM+BATT]
26 >0x147 byte 0x05 \b, [ROM+MBC2]
27 >0x147 byte 0x06 \b, [ROM+MBC2+BATTERY]
28 >0x147 byte 0x08 \b, [ROM+RAM]
29 >0x147 byte 0x09 \b, [ROM+RAM+BATTERY]
30 >0x147 byte 0x0B \b, [ROM+MMM01]
31 >0x147 byte 0x0C \b, [ROM+MMM01+SRAM]
32 >0x147 byte 0x0D \b, [ROM+MMM01+SRAM+BATT]
33 >0x147 byte 0x0F \b, [ROM+MBC3+TIMER+BATT]
34 >0x147 byte 0x10 \b, [ROM+MBC3+TIMER+RAM+BATT]
35 >0x147 byte 0x11 \b, [ROM+MBC3]
36 >0x147 byte 0x12 \b, [ROM+MBC3+RAM]
37 >0x147 byte 0x13 \b, [ROM+MBC3+RAM+BATT]
38 >0x147 byte 0x19 \b, [ROM+MBC5]
39 >0x147 byte 0x1A \b, [ROM+MBC5+RAM]
40 >0x147 byte 0x1B \b, [ROM+MBC5+RAM+BATT]
41 >0x147 byte 0x1C \b, [ROM+MBC5+RUMBLE]
42 >0x147 byte 0x1D \b, [ROM+MBC5+RUMBLE+SRAM]
43 >0x147 byte 0x1E \b, [ROM+MBC5+RUMBLE+SRAM+BATT]
44 >0x147 byte 0x1F \b, [Pocket Camera]
45 >0x147 byte 0xFD \b, [Bandai TAMA5]
46 >0x147 byte 0xFE \b, [Hudson HuC-3]
47 >0x147 byte 0xFF \b, [Hudson HuC-1]
49 >0x148 byte 0 \b, ROM: 256Kbit
50 >0x148 byte 1 \b, ROM: 512Kbit
51 >0x148 byte 2 \b, ROM: 1Mbit
52 >0x148 byte 3 \b, ROM: 2Mbit
53 >0x148 byte 4 \b, ROM: 4Mbit
54 >0x148 byte 5 \b, ROM: 8Mbit
55 >0x148 byte 6 \b, ROM: 16Mbit
56 >0x148 byte 0x52 \b, ROM: 9Mbit
57 >0x148 byte 0x53 \b, ROM: 10Mbit
58 >0x148 byte 0x54 \b, ROM: 12Mbit
60 >0x149 byte 1 \b, RAM: 16Kbit
61 >0x149 byte 2 \b, RAM: 64Kbit
62 >0x149 byte 3 \b, RAM: 128Kbit
63 >0x149 byte 4 \b, RAM: 1Mbit
65 #>0x14e long x \b, CRC: %x
67 #------------------------------------------------------------------------------
68 # genesis: file(1) magic for the Sega MegaDrive/Genesis raw ROM format
70 0x100 string SEGA Sega MegaDrive/Genesis raw ROM dump
71 >0x120 string >\0 Name: "%.16s"
72 >0x110 string >\0 %.16s
73 >0x1B0 string RA with SRAM
75 #------------------------------------------------------------------------------
76 # genesis: file(1) magic for the Super MegaDrive ROM dump format
78 0x280 string EAGN Super MagicDrive ROM dump
79 >0 byte x %dx16k blocks
80 >2 byte 0 \b, last in series or standalone
81 >2 byte >0 \b, split ROM
85 #------------------------------------------------------------------------------
86 # genesis: file(1) alternate magic for the Super MegaDrive ROM dump format
88 0x280 string EAMG Super MagicDrive ROM dump
89 >0 byte x %dx16k blocks
90 >2 byte x \b, last in series or standalone
94 #------------------------------------------------------------------------------
95 # smsgg: file(1) magic for Sega Master System and Game Gear ROM dumps
97 # Does not detect all images. Very preliminary guesswork. Need more data
100 # FIXME: need a little more info...;P
103 #>1 byte 0xED Sega Master System/Game Gear ROM dump
104 #>1 byte 0x31 Sega Master System/Game Gear ROM dump
105 #>1 byte 0xDB Sega Master System/Game Gear ROM dump
106 #>1 byte 0xAF Sega Master System/Game Gear ROM dump
107 #>1 byte 0xC3 Sega Master System/Game Gear ROM dump
109 #------------------------------------------------------------------------------
110 # dreamcast: file(1) uncertain magic for the Sega Dreamcast VMU image format
112 0 belong 0x21068028 Sega Dreamcast VMU game image
113 0 string LCDi Dream Animator file
115 #------------------------------------------------------------------------------
116 # v64: file(1) uncertain magic for the V64 format N64 ROM dumps
118 0 belong 0x37804012 V64 Nintendo 64 ROM dump
120 #------------------------------------------------------------------------------
121 # msx: file(1) magic for MSX game cartridge dumps
123 #0 beshort 0x4142 MSX game cartridge dump
125 #------------------------------------------------------------------------------
126 # Sony Playstation executables (Adam Sjoegren <asjo@diku.dk>) :
127 0 string PS-X\ EXE Sony Playstation executable
131 #------------------------------------------------------------------------------
132 # Microsoft Xbox executables .xbe (Esa Hyytiä <ehyytia@cc.hut.fi>)
133 0 string XBEH XBE, Microsoft Xbox executable
134 # probabilistic checks whether signed or not
137 >>>&2 ulelong =0x0 \b, not signed
140 >>>&2 ulelong >0 \b, signed
141 # expect base address of 0x10000
142 >0x0104 ulelong =0x10000
143 >>(0x0118-0x0FF60) ulelong&0x80000007 0x80000007 \b, all regions
144 >>(0x0118-0x0FF60) ulelong&0x80000007 !0x80000007
145 >>>(0x0118-0x0FF60) ulelong >0 (regions:
146 >>>>(0x0118-0x0FF60) ulelong &0x00000001 NA
147 >>>>(0x0118-0x0FF60) ulelong &0x00000002 Japan
148 >>>>(0x0118-0x0FF60) ulelong &0x00000004 Rest_of_World
149 >>>>(0x0118-0x0FF60) ulelong &0x80000000 Manufacturer
150 >>>(0x0118-0x0FF60) ulelong >0 \b)
152 # --------------------------------
153 # Microsoft Xbox data file formats
154 0 string XIP0 XIP, Microsoft Xbox data
155 0 string XTF0 XTF, Microsoft Xbox data
157 # Atari Lynx cartridge dump (EXE/BLL header)
158 # From: "Stefan A. Haubenthal" <polluks@web.de>
160 0 beshort 0x8008 Lynx cartridge,
161 >2 beshort x RAM start $%04x
164 # Opera file system that is used on the 3DO console
165 # From: Serge van den Boom <svdb@stack.nl>
166 0 string \x01ZZZZZ\x01 3DO "Opera" file system
168 # From Gürkan Sengün <gurkan@linuks.mine.nu>, www.linuks.mine.nu
169 0 string GBS Nintendo Gameboy Music/Audio Data
170 12 string GameBoy\ Music\ Module Nintendo Gameboy Music Module
172 # Playstations Patch Files from: From: Thomas Klausner <tk@giga.or.at>
173 0 string PPF30 Playstation Patch File version 3.0
174 >5 byte 0 \b, PPF 1.0 patch
175 >5 byte 1 \b, PPF 2.0 patch
176 >5 byte 2 \b, PPF 3.0 patch
177 >>56 byte 0 \b, Imagetype BIN (any)
178 >>56 byte 1 \b, Imagetype GI (PrimoDVD)
179 >>57 byte 0 \b, Blockcheck disabled
180 >>57 byte 1 \b, Blockcheck enabled
181 >>58 byte 0 \b, Undo data not available
182 >>58 byte 1 \b, Undo data available
183 >6 string x \b, description: %s
185 0 string PPF20 Playstation Patch File version 2.0
186 >5 byte 0 \b, PPF 1.0 patch
187 >5 byte 1 \b, PPF 2.0 patch
188 >>56 lelong >0 \b, size of file to patch %d
189 >6 string x \b, description: %s
191 0 string PPF10 Playstation Patch File version 1.0
192 >5 byte 0 \b, Simple Encoding
193 >6 string x \b, description: %s
195 # From: Daniel Dawson <ddawson@icehouse.net>
196 # SNES9x .smv "movie" file format.
197 0 string SMV\x1A SNES9x input recording
198 >0x4 lelong x \b, version %d
199 # version 4 is latest so far
201 >>0x8 ledate x \b, recorded at %s
202 >>0xc lelong >0 \b, rerecorded %d times
203 >>0x10 lelong x \b, %d frames long
204 >>0x14 byte >0 \b, data for controller(s):
209 >>>0x14 byte &0x10 #5
210 >>0x15 byte ^0x1 \b, begins from snapshot
211 >>0x15 byte &0x1 \b, begins from reset
212 >>0x15 byte ^0x2 \b, NTSC standard
213 >>0x15 byte &0x2 \b, PAL standard
214 >>0x17 byte &0x1 \b, settings:
215 # WIP1Timing not used as of version 4
217 >>>>0x17 byte &0x2 WIP1Timing
218 >>>0x17 byte &0x4 Left+Right
219 >>>0x17 byte &0x8 VolumeEnvX
220 >>>0x17 byte &0x10 FakeMute
221 >>>0x17 byte &0x20 SyncSound
222 # New flag as of version 4
224 >>>>0x17 byte &0x80 NoCPUShutdown
228 >>>>>0x20 lestring16 x \b, metadata: "%s"
230 >>>0x24 byte >0 \b, port 1:
231 >>>>0x24 byte 1 joypad
232 >>>>0x24 byte 2 mouse
233 >>>>0x24 byte 3 SuperScope
234 >>>>0x24 byte 4 Justifier
235 >>>>0x24 byte 5 multitap
236 >>>0x24 byte >0 \b, port 2:
237 >>>>0x25 byte 1 joypad
238 >>>>0x25 byte 2 mouse
239 >>>>0x25 byte 3 SuperScope
240 >>>>0x25 byte 4 Justifier
241 >>>>0x25 byte 5 multitap
244 >>>>>0x40 lestring16 x \b, metadata: "%s"
245 >>0x17 byte &0x40 \b, ROM:
246 >>>(0x18.l-26) lelong x CRC32 0x%08x
247 >>>(0x18.l-23) string x "%s"
249 # From: "Nelson A. de Oliveira" <naoliv@gmail.com>
251 0 string Warcraft\ III\ recorded\ game %s
253 0 string HM3W Warcraft III map file