1b6cee71dSXin LI 2b6cee71dSXin LI#------------------------------------------------------------------------------ 3*2726a701SXin LI# $File: console,v 1.55 2020/04/19 17:30:55 christos Exp $ 4b6cee71dSXin LI# Console game magic 5b6cee71dSXin LI# Toby Deshane <hac@shoelace.digivill.net> 6b6cee71dSXin LI 73e41d09dSXin LI# ines: file(1) magic for Marat's iNES Nintendo Entertainment System ROM dump format 83e41d09dSXin LI# Updated by David Korth <gerbilsoft@gerbilsoft.com> 93e41d09dSXin LI# References: 1048c779cdSXin LI# - https://wiki.nesdev.com/w/index.php/INES 1148c779cdSXin LI# - https://wiki.nesdev.com/w/index.php/NES_2.0 1240427ccaSGordon Tetlow 1340427ccaSGordon Tetlow# Common header for iNES, NES 2.0, and Wii U iNES. 1440427ccaSGordon Tetlow0 name nes-rom-image-ines 153e41d09dSXin LI>7 byte&0x0C =0x8 (NES 2.0) 163e41d09dSXin LI>4 byte x \b: %ux16k PRG 1740427ccaSGordon Tetlow>5 byte x \b, %ux8k CHR 183e41d09dSXin LI>6 byte&0x08 =0x8 [4-Scr] 193e41d09dSXin LI>6 byte&0x09 =0x0 [H-mirror] 203e41d09dSXin LI>6 byte&0x09 =0x1 [V-mirror] 213e41d09dSXin LI>6 byte&0x02 =0x2 [SRAM] 223e41d09dSXin LI>6 byte&0x04 =0x4 [Trainer] 233e41d09dSXin LI>7 byte&0x03 =0x2 [PC10] 2440427ccaSGordon Tetlow>7 byte&0x03 =0x1 [VS] 253e41d09dSXin LI>>7 byte&0x0C =0x8 263e41d09dSXin LI# NES 2.0: VS PPU 273e41d09dSXin LI>>>13 byte&0x0F =0x0 \b, RP2C03B 283e41d09dSXin LI>>>13 byte&0x0F =0x1 \b, RP2C03G 293e41d09dSXin LI>>>13 byte&0x0F =0x2 \b, RP2C04-0001 303e41d09dSXin LI>>>13 byte&0x0F =0x3 \b, RP2C04-0002 313e41d09dSXin LI>>>13 byte&0x0F =0x4 \b, RP2C04-0003 323e41d09dSXin LI>>>13 byte&0x0F =0x5 \b, RP2C04-0004 333e41d09dSXin LI>>>13 byte&0x0F =0x6 \b, RP2C03B 343e41d09dSXin LI>>>13 byte&0x0F =0x7 \b, RP2C03C 353e41d09dSXin LI>>>13 byte&0x0F =0x8 \b, RP2C05-01 363e41d09dSXin LI>>>13 byte&0x0F =0x9 \b, RP2C05-02 373e41d09dSXin LI>>>13 byte&0x0F =0xA \b, RP2C05-03 383e41d09dSXin LI>>>13 byte&0x0F =0xB \b, RP2C05-04 393e41d09dSXin LI>>>13 byte&0x0F =0xC \b, RP2C05-05 403e41d09dSXin LI# TODO: VS protection hardware? 413e41d09dSXin LI>>7 byte x \b] 423e41d09dSXin LI# NES 2.0-specific flags. 433e41d09dSXin LI>7 byte&0x0C =0x8 443e41d09dSXin LI>>12 byte&0x03 =0x0 [NTSC] 453e41d09dSXin LI>>12 byte&0x03 =0x1 [PAL] 463e41d09dSXin LI>>12 byte&0x02 =0x2 [NTSC+PAL] 473e41d09dSXin LI 4840427ccaSGordon Tetlow# Standard iNES ROM header. 4940427ccaSGordon Tetlow0 string NES\x1A NES ROM image (iNES) 502dc4dbb9SEitan Adler!:mime application/x-nes-rom 5140427ccaSGordon Tetlow>0 use nes-rom-image-ines 5240427ccaSGordon Tetlow 5340427ccaSGordon Tetlow# Wii U Virtual Console iNES ROM header. 5440427ccaSGordon Tetlow0 belong 0x4E455300 NES ROM image (Wii U Virtual Console) 552dc4dbb9SEitan Adler!:mime application/x-nes-rom 5640427ccaSGordon Tetlow>0 use nes-rom-image-ines 5740427ccaSGordon Tetlow 583e41d09dSXin LI#------------------------------------------------------------------------------ 593e41d09dSXin LI# unif: file(1) magic for UNIF-format Nintendo Entertainment System ROM images 6048c779cdSXin LI# Reference: https://wiki.nesdev.com/w/index.php/UNIF 613e41d09dSXin LI# From: David Korth <gerbilsoft@gerbilsoft.com> 623e41d09dSXin LI# 633e41d09dSXin LI# NOTE: The UNIF format uses chunks instead of a fixed header, 643e41d09dSXin LI# so most of the data isn't easily parseable. 653e41d09dSXin LI# 663e41d09dSXin LI0 string UNIF 6740427ccaSGordon Tetlow>4 lelong <16 NES ROM image (UNIF v%d format) 682dc4dbb9SEitan Adler!:mime application/x-nes-rom 69b6cee71dSXin LI 70b6cee71dSXin LI#------------------------------------------------------------------------------ 71282e23f0SXin LI# fds: file(1) magic for Famciom Disk System disk images 7248c779cdSXin LI# Reference: https://wiki.nesdev.com/w/index.php/Family_Computer_Disk_System#.FDS_format 73282e23f0SXin LI# From: David Korth <gerbilsoft@gerbilsoft.com> 74282e23f0SXin LI# TODO: Check "Disk info block" and get info from that in addition to the optional header. 75282e23f0SXin LI 76282e23f0SXin LI# Disk info block. (block 1) 77282e23f0SXin LI0 name nintendo-fds-disk-info-block 78282e23f0SXin LI>23 byte !1 FMC- 79282e23f0SXin LI>23 byte 1 FSC- 80282e23f0SXin LI>16 string x \b%.3s 8140427ccaSGordon Tetlow>15 byte x \b, mfr %02X 82282e23f0SXin LI>20 byte x (Rev.%02u) 83282e23f0SXin LI 84282e23f0SXin LI# Headered version. 85282e23f0SXin LI0 string FDS\x1A 8640427ccaSGordon Tetlow>0x11 string *NINTENDO-HVC* Famicom Disk System disk image: 872dc4dbb9SEitan Adler!:mime application/x-fds-disk 88282e23f0SXin LI>>0x10 use nintendo-fds-disk-info-block 89282e23f0SXin LI>4 byte 1 (%u side) 90282e23f0SXin LI>4 byte !1 (%u sides) 91282e23f0SXin LI 92282e23f0SXin LI# Unheadered version. 9340427ccaSGordon Tetlow1 string *NINTENDO-HVC* Famicom Disk System disk image: 942dc4dbb9SEitan Adler!:mime application/x-fds-disk 95282e23f0SXin LI>0 use nintendo-fds-disk-info-block 96282e23f0SXin LI 97282e23f0SXin LI#------------------------------------------------------------------------------ 9840427ccaSGordon Tetlow# tnes: file(1) magic for TNES-format Nintendo Entertainment System ROM images 9940427ccaSGordon Tetlow# Used by Nintendo 3DS NES Virtual Console games. 10040427ccaSGordon Tetlow# From: David Korth <gerbilsoft@gerbilsoft.com> 10140427ccaSGordon Tetlow# 10240427ccaSGordon Tetlow0 string TNES NES ROM image (Nintendo 3DS Virtual Console) 1032dc4dbb9SEitan Adler!:mime application/x-nes-rom 10440427ccaSGordon Tetlow>4 byte 100 \b: FDS, 10540427ccaSGordon Tetlow>>0x2010 use nintendo-fds-disk-info-block 10640427ccaSGordon Tetlow>4 byte !100 \b: TNES mapper %u 10740427ccaSGordon Tetlow>>5 byte x \b, %ux8k PRG 10840427ccaSGordon Tetlow>>6 byte x \b, %ux8k CHR 10940427ccaSGordon Tetlow>>7 byte&0x08 =1 [WRAM] 11040427ccaSGordon Tetlow>>8 byte&0x09 =1 [H-mirror] 11140427ccaSGordon Tetlow>>8 byte&0x09 =2 [V-mirror] 11240427ccaSGordon Tetlow>>8 byte&0x02 =3 [VRAM] 11340427ccaSGordon Tetlow 11440427ccaSGordon Tetlow#------------------------------------------------------------------------------ 115b6cee71dSXin LI# gameboy: file(1) magic for the Nintendo (Color) Gameboy raw ROM format 1163e41d09dSXin LI# Reference: http://gbdev.gg8.se/wiki/articles/The_Cartridge_Header 117b6cee71dSXin LI# 1183e41d09dSXin LI0x104 bequad 0xCEED6666CC0D000B Game Boy ROM image 1192dc4dbb9SEitan Adler# TODO: application/x-gameboy-color-rom for GBC. 1202dc4dbb9SEitan Adler!:mime application/x-gameboy-rom 1213e41d09dSXin LI>0x143 byte&0x80 0x80 1223e41d09dSXin LI>>0x134 string >\0 \b: "%.15s" 1233e41d09dSXin LI>0x143 byte&0x80 !0x80 1243e41d09dSXin LI>>0x134 string >\0 \b: "%.16s" 1253e41d09dSXin LI>0x14c byte x (Rev.%02u) 126b6cee71dSXin LI 1273e41d09dSXin LI# Machine type. (SGB, CGB, SGB+CGB) 1283e41d09dSXin LI>0x14b byte 0x33 1293e41d09dSXin LI>>0x146 byte 0x03 1303e41d09dSXin LI>>>0x143 byte&0x80 0x80 [SGB+CGB] 1313e41d09dSXin LI>>>0x143 byte&0x80 !0x80 [SGB] 1323e41d09dSXin LI>>0x146 byte !0x03 1333e41d09dSXin LI>>>0x143 byte&0xC0 0x80 [CGB] 1343e41d09dSXin LI>>>0x143 byte&0xC0 0xC0 [CGB ONLY] 1352dc4dbb9SEitan Adler>0x14b byte !0x33 1363e41d09dSXin LI 1373e41d09dSXin LI# Mapper. 1383e41d09dSXin LI>0x147 byte 0x00 [ROM ONLY] 1393e41d09dSXin LI>0x147 byte 0x01 [MBC1] 1403e41d09dSXin LI>0x147 byte 0x02 [MBC1+RAM] 1413e41d09dSXin LI>0x147 byte 0x03 [MBC1+RAM+BATT] 1423e41d09dSXin LI>0x147 byte 0x05 [MBC2] 1433e41d09dSXin LI>0x147 byte 0x06 [MBC2+BATTERY] 1443e41d09dSXin LI>0x147 byte 0x08 [ROM+RAM] 1453e41d09dSXin LI>0x147 byte 0x09 [ROM+RAM+BATTERY] 1463e41d09dSXin LI>0x147 byte 0x0B [MMM01] 1473e41d09dSXin LI>0x147 byte 0x0C [MMM01+SRAM] 1483e41d09dSXin LI>0x147 byte 0x0D [MMM01+SRAM+BATT] 1493e41d09dSXin LI>0x147 byte 0x0F [MBC3+TIMER+BATT] 1503e41d09dSXin LI>0x147 byte 0x10 [MBC3+TIMER+RAM+BATT] 1513e41d09dSXin LI>0x147 byte 0x11 [MBC3] 1523e41d09dSXin LI>0x147 byte 0x12 [MBC3+RAM] 1533e41d09dSXin LI>0x147 byte 0x13 [MBC3+RAM+BATT] 1543e41d09dSXin LI>0x147 byte 0x19 [MBC5] 1553e41d09dSXin LI>0x147 byte 0x1A [MBC5+RAM] 1563e41d09dSXin LI>0x147 byte 0x1B [MBC5+RAM+BATT] 1573e41d09dSXin LI>0x147 byte 0x1C [MBC5+RUMBLE] 1583e41d09dSXin LI>0x147 byte 0x1D [MBC5+RUMBLE+SRAM] 1593e41d09dSXin LI>0x147 byte 0x1E [MBC5+RUMBLE+SRAM+BATT] 1603e41d09dSXin LI>0x147 byte 0xFC [Pocket Camera] 1613e41d09dSXin LI>0x147 byte 0xFD [Bandai TAMA5] 1623e41d09dSXin LI>0x147 byte 0xFE [Hudson HuC-3] 1633e41d09dSXin LI>0x147 byte 0xFF [Hudson HuC-1] 1643e41d09dSXin LI 1653e41d09dSXin LI# ROM size. 166b6cee71dSXin LI>0x148 byte 0 \b, ROM: 256Kbit 167b6cee71dSXin LI>0x148 byte 1 \b, ROM: 512Kbit 168b6cee71dSXin LI>0x148 byte 2 \b, ROM: 1Mbit 169b6cee71dSXin LI>0x148 byte 3 \b, ROM: 2Mbit 170b6cee71dSXin LI>0x148 byte 4 \b, ROM: 4Mbit 171b6cee71dSXin LI>0x148 byte 5 \b, ROM: 8Mbit 172b6cee71dSXin LI>0x148 byte 6 \b, ROM: 16Mbit 1733e41d09dSXin LI>0x148 byte 7 \b, ROM: 32Mbit 174b6cee71dSXin LI>0x148 byte 0x52 \b, ROM: 9Mbit 175b6cee71dSXin LI>0x148 byte 0x53 \b, ROM: 10Mbit 176b6cee71dSXin LI>0x148 byte 0x54 \b, ROM: 12Mbit 177b6cee71dSXin LI 1783e41d09dSXin LI# RAM size. 179b6cee71dSXin LI>0x149 byte 1 \b, RAM: 16Kbit 180b6cee71dSXin LI>0x149 byte 2 \b, RAM: 64Kbit 181b6cee71dSXin LI>0x149 byte 3 \b, RAM: 128Kbit 182b6cee71dSXin LI>0x149 byte 4 \b, RAM: 1Mbit 1833e41d09dSXin LI>0x149 byte 5 \b, RAM: 512Kbit 184b6cee71dSXin LI 185b6cee71dSXin LI#------------------------------------------------------------------------------ 1863e41d09dSXin LI# genesis: file(1) magic for various Sega Mega Drive / Genesis ROM image and disc formats 1873e41d09dSXin LI# Updated by David Korth <gerbilsoft@gerbilsoft.com> 1883e41d09dSXin LI# References: 18948c779cdSXin LI# - https://www.retrodev.com/segacd.html 1903e41d09dSXin LI# - http://devster.monkeeh.com/sega/32xguide1.txt 191b6cee71dSXin LI# 1923e41d09dSXin LI 1933e41d09dSXin LI# Common Sega Mega Drive header format. 1943e41d09dSXin LI# FIXME: Name fields are 48 bytes, but have spaces for padding instead of 00s. 1953e41d09dSXin LI0 name sega-mega-drive-header 1963e41d09dSXin LI# ROM title. (Use domestic if present; if not, use international.) 1973e41d09dSXin LI>0x120 byte >0x20 1983e41d09dSXin LI>>0x120 string >\0 \b: "%.16s" 1993e41d09dSXin LI>0x120 byte <0x21 2003e41d09dSXin LI>>0x150 string >\0 \b: "%.16s" 2013e41d09dSXin LI# Other information. 2023e41d09dSXin LI>0x180 string >\0 (%.14s 2033e41d09dSXin LI>>0x110 string >\0 \b, %.16s 2043e41d09dSXin LI>0x180 byte 0 2053e41d09dSXin LI>>0x110 string >\0 (%.16s 2063e41d09dSXin LI>0 byte x \b) 2073e41d09dSXin LI 2083e41d09dSXin LI# TODO: Check for 32X CD? 2093e41d09dSXin LI# Sega Mega CD disc images: 2048-byte sectors. 2103e41d09dSXin LI0 string SEGADISCSYSTEM\ \ Sega Mega CD disc image 2112dc4dbb9SEitan Adler!:mime application/x-sega-cd-rom 2123e41d09dSXin LI>0 use sega-mega-drive-header 2133e41d09dSXin LI>0 byte x \b, 2048-byte sectors 2143e41d09dSXin LI0 string SEGABOOTDISC\ \ \ \ Sega Mega CD disc image 2152dc4dbb9SEitan Adler!:mime application/x-sega-cd-rom 2163e41d09dSXin LI>0 use sega-mega-drive-header 2173e41d09dSXin LI>0 byte x \b, 2048-byte sectors 2183e41d09dSXin LI# Sega Mega CD disc images: 2352-byte sectors. 2193e41d09dSXin LI0x10 string SEGADISCSYSTEM\ \ Sega Mega CD disc image 2202dc4dbb9SEitan Adler!:mime application/x-sega-cd-rom 2213e41d09dSXin LI>0x10 use sega-mega-drive-header 2223e41d09dSXin LI>0 byte x \b, 2352-byte sectors 2233e41d09dSXin LI0x10 string SEGABOOTDISC\ \ \ \ Sega Mega CD disc image 2242dc4dbb9SEitan Adler!:mime application/x-sega-cd-rom 2253e41d09dSXin LI>0x10 use sega-mega-drive-header 2263e41d09dSXin LI>0 byte x \b, 2352-byte sectors 2273e41d09dSXin LI 2283e41d09dSXin LI# Sega Mega Drive, 32X, Pico, and Mega CD Boot ROM images. 2293e41d09dSXin LI0x100 string SEGA 2303e41d09dSXin LI>0x3C0 bequad 0x4D41525320434845 Sega 32X ROM image 2312dc4dbb9SEitan Adler!:mime application/x-genesis-32x-rom 2323e41d09dSXin LI>>0 use sega-mega-drive-header 2333e41d09dSXin LI>0x3C0 bequad !0x4D41525320434845 2343e41d09dSXin LI>>0x105 belong 0x5049434F Sega Pico ROM image 2352dc4dbb9SEitan Adler!:mime application/x-sega-pico-rom 2363e41d09dSXin LI>>>0 use sega-mega-drive-header 2373e41d09dSXin LI>>0x105 belong !0x5049434F 2383e41d09dSXin LI>>>0x180 beshort 0x4252 Sega Mega CD Boot ROM image 2392dc4dbb9SEitan Adler!:mime application/x-genesis-rom 2403e41d09dSXin LI>>>0x180 beshort !0x4252 Sega Mega Drive / Genesis ROM image 2412dc4dbb9SEitan Adler!:mime application/x-genesis-rom 2423e41d09dSXin LI>>>0 use sega-mega-drive-header 243b6cee71dSXin LI 244b6cee71dSXin LI#------------------------------------------------------------------------------ 245b6cee71dSXin LI# genesis: file(1) magic for the Super MegaDrive ROM dump format 246b6cee71dSXin LI# 2473e41d09dSXin LI 2483e41d09dSXin LI# NOTE: Due to interleaving, we can't display anything 2493e41d09dSXin LI# other than the copier header information. 2503e41d09dSXin LI0 name sega-genesis-smd-header 251b6cee71dSXin LI>0 byte x %dx16k blocks 252b6cee71dSXin LI>2 byte 0 \b, last in series or standalone 253b6cee71dSXin LI>2 byte >0 \b, split ROM 2543e41d09dSXin LI 2553e41d09dSXin LI# "Sega Genesis" header. 2563e41d09dSXin LI0x280 string EAGN 2573e41d09dSXin LI>8 beshort 0xAABB Sega Mega Drive / Genesis ROM image (SMD format): 2582dc4dbb9SEitan Adler!:mime application/x-genesis-rom 2593e41d09dSXin LI>>0 use sega-genesis-smd-header 2603e41d09dSXin LI 2613e41d09dSXin LI# "Sega Mega Drive" header. 2623e41d09dSXin LI0x280 string EAMG 2633e41d09dSXin LI>8 beshort 0xAABB Sega Mega Drive / Genesis ROM image (SMD format): 2642dc4dbb9SEitan Adler!:mime application/x-genesis-rom 2653e41d09dSXin LI>>0 use sega-genesis-smd-header 266b6cee71dSXin LI 267b6cee71dSXin LI#------------------------------------------------------------------------------ 2683e41d09dSXin LI# smsgg: file(1) magic for Sega Master System and Game Gear ROM images 2693e41d09dSXin LI# Detects all Game Gear and export Sega Master System ROM images, 2703e41d09dSXin LI# and some Japanese Sega Master System ROM images. 2713e41d09dSXin LI# From: David Korth <gerbilsoft@gerbilsoft.com> 27248c779cdSXin LI# Reference: https://www.smspower.org/Development/ROMHeader 273b6cee71dSXin LI# 2743e41d09dSXin LI 2753e41d09dSXin LI# General SMS header rule. 2763e41d09dSXin LI# The SMS boot ROM checks the header at three locations. 2773e41d09dSXin LI0 name sega-master-system-rom-header 2783e41d09dSXin LI# Machine type. 2793e41d09dSXin LI>0x0F byte&0xF0 0x30 Sega Master System 2802dc4dbb9SEitan Adler!:mime application/x-sms-rom 2813e41d09dSXin LI>0x0F byte&0xF0 0x40 Sega Master System 2822dc4dbb9SEitan Adler!:mime application/x-sms-rom 2833e41d09dSXin LI>0x0F byte&0xF0 0x50 Sega Game Gear 2842dc4dbb9SEitan Adler!:mime application/x-gamegear-rom 2853e41d09dSXin LI>0x0F byte&0xF0 0x60 Sega Game Gear 2862dc4dbb9SEitan Adler!:mime application/x-gamegear-rom 2873e41d09dSXin LI>0x0F byte&0xF0 0x70 Sega Game Gear 2882dc4dbb9SEitan Adler!:mime application/x-gamegear-rom 2892dc4dbb9SEitan Adler>0x0F default x Sega Master System / Game Gear 2902dc4dbb9SEitan Adler!:mime application/x-sms-rom 2913e41d09dSXin LI>0 byte x ROM image: 2923e41d09dSXin LI# Product code. 2933e41d09dSXin LI>0x0E byte&0xF0 0x10 1 2943e41d09dSXin LI>0x0E byte&0xF0 0x20 2 2953e41d09dSXin LI>0x0E byte&0xF0 0x30 3 2963e41d09dSXin LI>0x0E byte&0xF0 0x40 4 2973e41d09dSXin LI>0x0E byte&0xF0 0x50 5 2983e41d09dSXin LI>0x0E byte&0xF0 0x60 6 2993e41d09dSXin LI>0x0E byte&0xF0 0x70 7 3003e41d09dSXin LI>0x0E byte&0xF0 0x80 8 3013e41d09dSXin LI>0x0E byte&0xF0 0x90 9 3023e41d09dSXin LI>0x0E byte&0xF0 0xA0 10 3033e41d09dSXin LI>0x0E byte&0xF0 0xB0 11 3043e41d09dSXin LI>0x0E byte&0xF0 0xC0 12 3053e41d09dSXin LI>0x0E byte&0xF0 0xD0 13 3063e41d09dSXin LI>0x0E byte&0xF0 0xE0 14 3073e41d09dSXin LI>0x0E byte&0xF0 0xF0 15 3083e41d09dSXin LI# If the product code is 5 digits, we'll need to backspace here. 3093e41d09dSXin LI>0x0E byte&0xF0 !0 3103e41d09dSXin LI>>0x0C leshort x \b%04x 3113e41d09dSXin LI>0x0E byte&0xF0 0 3123e41d09dSXin LI>>0x0C leshort x %04x 3133e41d09dSXin LI# Revision. 3143e41d09dSXin LI>0x0E byte&0x0F x (Rev.%02d) 3153e41d09dSXin LI# ROM size. (Used for the boot ROM checksum routine.) 3163e41d09dSXin LI>0x0F byte&0x0F 0x0A (8 KB) 3173e41d09dSXin LI>0x0F byte&0x0F 0x0B (16 KB) 3183e41d09dSXin LI>0x0F byte&0x0F 0x0C (32 KB) 3193e41d09dSXin LI>0x0F byte&0x0F 0x0D (48 KB) 3203e41d09dSXin LI>0x0F byte&0x0F 0x0E (64 KB) 3213e41d09dSXin LI>0x0F byte&0x0F 0x0F (128 KB) 3223e41d09dSXin LI>0x0F byte&0x0F 0x00 (256 KB) 3233e41d09dSXin LI>0x0F byte&0x0F 0x01 (512 KB) 3243e41d09dSXin LI>0x0F byte&0x0F 0x02 (1 MB) 3253e41d09dSXin LI 3263e41d09dSXin LI# SMS/GG header locations. 3273e41d09dSXin LI0x7FF0 string TMR\ SEGA 3283e41d09dSXin LI>0x7FF0 use sega-master-system-rom-header 3293e41d09dSXin LI0x3FF0 string TMR\ SEGA 3303e41d09dSXin LI>0x3FF0 use sega-master-system-rom-header 3313e41d09dSXin LI0x1FF0 string TMR\ SEGA 3323e41d09dSXin LI>0x1FF0 use sega-master-system-rom-header 333b6cee71dSXin LI 334b6cee71dSXin LI#------------------------------------------------------------------------------ 3353e41d09dSXin LI# saturn: file(1) magic for the Sega Saturn disc image format. 3363e41d09dSXin LI# From: David Korth <gerbilsoft@gerbilsoft.com> 337b6cee71dSXin LI# 3383e41d09dSXin LI 3393e41d09dSXin LI# Common Sega Saturn disc header format. 3403e41d09dSXin LI# NOTE: Title is 112 bytes, but we're only showing 32 due to space padding. 3413e41d09dSXin LI# TODO: Release date, device information, region code, others? 3423e41d09dSXin LI0 name sega-saturn-disc-header 3433e41d09dSXin LI>0x60 string >\0 \b: "%.32s" 3443e41d09dSXin LI>0x20 string >\0 (%.10s 3453e41d09dSXin LI>>0x2A string >\0 \b, %.6s) 3463e41d09dSXin LI>>0x2A byte 0 \b) 3473e41d09dSXin LI 3483e41d09dSXin LI# 2048-byte sector version. 3493e41d09dSXin LI0 string SEGA\ SEGASATURN\ Sega Saturn disc image 3502dc4dbb9SEitan Adler!:mime application/x-saturn-rom 3513e41d09dSXin LI>0 use sega-saturn-disc-header 3523e41d09dSXin LI>0 byte x (2048-byte sectors) 3533e41d09dSXin LI# 2352-byte sector version. 3543e41d09dSXin LI0x10 string SEGA\ SEGASATURN\ Sega Saturn disc image 3552dc4dbb9SEitan Adler!:mime application/x-saturn-rom 3563e41d09dSXin LI>0x10 use sega-saturn-disc-header 3573e41d09dSXin LI>0 byte x (2352-byte sectors) 3583e41d09dSXin LI 3593e41d09dSXin LI#------------------------------------------------------------------------------ 3603e41d09dSXin LI# dreamcast: file(1) magic for the Sega Dreamcast disc image format. 3613e41d09dSXin LI# From: David Korth <gerbilsoft@gerbilsoft.com> 36248c779cdSXin LI# Reference: https://mc.pp.se/dc/ip0000.bin.html 363b6cee71dSXin LI# 3643e41d09dSXin LI 3653e41d09dSXin LI# Common Sega Dreamcast disc header format. 3663e41d09dSXin LI# NOTE: Title is 128 bytes, but we're only showing 32 due to space padding. 3673e41d09dSXin LI# TODO: Release date, device information, region code, others? 3683e41d09dSXin LI0 name sega-dreamcast-disc-header 3693e41d09dSXin LI>0x80 string >\0 \b: "%.32s" 3703e41d09dSXin LI>0x40 string >\0 (%.10s 3713e41d09dSXin LI>>0x4A string >\0 \b, %.6s) 3723e41d09dSXin LI>>0x4A byte 0 \b) 3733e41d09dSXin LI 3743e41d09dSXin LI# 2048-byte sector version. 3753e41d09dSXin LI0 string SEGA\ SEGAKATANA\ Sega Dreamcast disc image 3762dc4dbb9SEitan Adler!:mime application/x-dc-rom 3773e41d09dSXin LI>0 use sega-dreamcast-disc-header 3783e41d09dSXin LI>0 byte x (2048-byte sectors) 3793e41d09dSXin LI# 2352-byte sector version. 3803e41d09dSXin LI0x10 string SEGA\ SEGAKATANA\ Sega Dreamcast disc image 3812dc4dbb9SEitan Adler!:mime application/x-dc-rom 3823e41d09dSXin LI>0x10 use sega-dreamcast-disc-header 3833e41d09dSXin LI>0 byte x (2352-byte sectors) 384b6cee71dSXin LI 385b6cee71dSXin LI#------------------------------------------------------------------------------ 386b6cee71dSXin LI# dreamcast: file(1) uncertain magic for the Sega Dreamcast VMU image format 387b6cee71dSXin LI# 388b6cee71dSXin LI0 belong 0x21068028 Sega Dreamcast VMU game image 389b6cee71dSXin LI0 string LCDi Dream Animator file 390b6cee71dSXin LI 391b6cee71dSXin LI#------------------------------------------------------------------------------ 3923e41d09dSXin LI# z64: file(1) magic for the Z64 format N64 ROM dumps 3933e41d09dSXin LI# Reference: http://forum.pj64-emu.com/showthread.php?t=2239 3943e41d09dSXin LI# From: David Korth <gerbilsoft@gerbilsoft.com> 395b6cee71dSXin LI# 3963e41d09dSXin LI0 bequad 0x803712400000000F Nintendo 64 ROM image 3972dc4dbb9SEitan Adler!:mime application/x-n64-rom 3983e41d09dSXin LI>0x20 string >\0 \b: "%.20s" 3993e41d09dSXin LI>0x3B string x (%.4s 4003e41d09dSXin LI>0x3F byte x \b, Rev.%02u) 401b6cee71dSXin LI 4023e41d09dSXin LI#------------------------------------------------------------------------------ 4033e41d09dSXin LI# v64: file(1) magic for the V64 format N64 ROM dumps 4043e41d09dSXin LI# Same as z64 format, but with 16-bit byteswapping. 4053e41d09dSXin LI# 4063e41d09dSXin LI0 bequad 0x3780401200000F00 Nintendo 64 ROM image (V64) 4072dc4dbb9SEitan Adler!:mime application/x-n64-rom 4083e41d09dSXin LI 4093e41d09dSXin LI#------------------------------------------------------------------------------ 4103e41d09dSXin LI# n64-swap2: file(1) magic for the swap2 format N64 ROM dumps 4113e41d09dSXin LI# Same as z64 format, but with swapped 16-bit words. 4123e41d09dSXin LI# 4133e41d09dSXin LI0 bequad 0x12408037000F0000 Nintendo 64 ROM image (wordswapped) 4142dc4dbb9SEitan Adler!:mime application/x-n64-rom 4153e41d09dSXin LI 4163e41d09dSXin LI#------------------------------------------------------------------------------ 4173e41d09dSXin LI# n64-le32: file(1) magic for the 32-bit byteswapped format N64 ROM dumps 4183e41d09dSXin LI# Same as z64 format, but with 32-bit byteswapping. 4193e41d09dSXin LI# 4203e41d09dSXin LI0 bequad 0x401237800F000000 Nintendo 64 ROM image (32-bit byteswapped) 4212dc4dbb9SEitan Adler!:mime application/x-n64-rom 4223e41d09dSXin LI 4233e41d09dSXin LI#------------------------------------------------------------------------------ 4243e41d09dSXin LI# gba: file(1) magic for the Nintendo Game Boy Advance raw ROM format 42548c779cdSXin LI# Reference: https://problemkaputt.de/gbatek.htm#gbacartridgeheader 4263e41d09dSXin LI# 4273e41d09dSXin LI# Original version from: "Nelson A. de Oliveira" <naoliv@gmail.com> 4283e41d09dSXin LI# Updated version from: David Korth <gerbilsoft@gerbilsoft.com> 4293e41d09dSXin LI# 4303e41d09dSXin LI4 bequad 0x24FFAE51699AA221 Game Boy Advance ROM image 4312dc4dbb9SEitan Adler!:mime application/x-gba-rom 4323e41d09dSXin LI>0xA0 string >\0 \b: "%.12s" 4333e41d09dSXin LI>0xAC string x (%.6s 4343e41d09dSXin LI>0xBC byte x \b, Rev.%02u) 4353e41d09dSXin LI 4363e41d09dSXin LI#------------------------------------------------------------------------------ 4373e41d09dSXin LI# nds: file(1) magic for the Nintendo DS(i) raw ROM format 43848c779cdSXin LI# Reference: https://problemkaputt.de/gbatek.htm#dscartridgeheader 4393e41d09dSXin LI# 4403e41d09dSXin LI# Original version from: "Nelson A. de Oliveira" <naoliv@gmail.com> 4413e41d09dSXin LI# Updated version from: David Korth <gerbilsoft@gerbilsoft.com> 4423e41d09dSXin LI# 4433e41d09dSXin LI0xC0 bequad 0x24FFAE51699AA221 Nintendo DS ROM image 4442dc4dbb9SEitan Adler!:mime application/x-nintendo-ds-rom 4453e41d09dSXin LI>0x00 string >\0 \b: "%.12s" 4463e41d09dSXin LI>0x0C string x (%.6s 4473e41d09dSXin LI>0x1E byte x \b, Rev.%02u) 4483e41d09dSXin LI>0x12 byte 2 (DSi enhanced) 4493e41d09dSXin LI>0x12 byte 3 (DSi only) 45040427ccaSGordon Tetlow# Secure Area check. 45140427ccaSGordon Tetlow>0x20 lelong <0x4000 (homebrew) 45240427ccaSGordon Tetlow>0x20 lelong >0x3FFF 45340427ccaSGordon Tetlow>>0x4000 lequad 0x0000000000000000 (multiboot) 45440427ccaSGordon Tetlow>>0x4000 lequad !0x0000000000000000 45540427ccaSGordon Tetlow>>>0x4000 lequad 0xE7FFDEFFE7FFDEFF (decrypted) 45640427ccaSGordon Tetlow>>>0x4000 lequad !0xE7FFDEFFE7FFDEFF 45740427ccaSGordon Tetlow>>>>0x1000 lequad 0x0000000000000000 (encrypted) 45840427ccaSGordon Tetlow>>>>0x1000 lequad !0x0000000000000000 (mask ROM) 4593e41d09dSXin LI 4603e41d09dSXin LI#------------------------------------------------------------------------------ 4613e41d09dSXin LI# nds_passme: file(1) magic for Nintendo DS ROM images for GBA cartridge boot. 4623e41d09dSXin LI# This is also used for loading .nds files using the MSET exploit on 3DS. 4633e41d09dSXin LI# Reference: https://github.com/devkitPro/ndstool/blob/master/source/ndscreate.cpp 4643e41d09dSXin LI0xC0 bequad 0xC8604FE201708FE2 Nintendo DS Slot-2 ROM image (PassMe) 4652dc4dbb9SEitan Adler!:mime application/x-nintendo-ds-rom 4663e41d09dSXin LI 4673e41d09dSXin LI#------------------------------------------------------------------------------ 4683e41d09dSXin LI# ngp: file(1) magic for the Neo Geo Pocket (Color) raw ROM format. 4693e41d09dSXin LI# From: David Korth <gerbilsoft@gerbilsoft.com> 4703e41d09dSXin LI# References: 4713e41d09dSXin LI# - https://neogpc.googlecode.com/svn-history/r10/trunk/src/core/neogpc.cpp 47248c779cdSXin LI# - https://www.devrs.com/ngp/files/ngpctech.txt 4733e41d09dSXin LI# 4743e41d09dSXin LI0x0A string BY\ SNK\ CORPORATION Neo Geo Pocket 4752dc4dbb9SEitan Adler!:mime application/x-neo-geo-pocket-rom 4763e41d09dSXin LI>0x23 byte 0x10 Color 4773e41d09dSXin LI>0 byte x ROM image 4783e41d09dSXin LI>0x24 string >\0 \b: "%.12s" 4793e41d09dSXin LI>0x1F byte 0xFF (debug mode enabled) 480b6cee71dSXin LI 481b6cee71dSXin LI#------------------------------------------------------------------------------ 482b6cee71dSXin LI# msx: file(1) magic for MSX game cartridge dumps 483b6cee71dSXin LI# Too simple - MPi 484b6cee71dSXin LI#0 beshort 0x4142 MSX game cartridge dump 485b6cee71dSXin LI 486b6cee71dSXin LI#------------------------------------------------------------------------------ 487b6cee71dSXin LI# Sony Playstation executables (Adam Sjoegren <asjo@diku.dk>) : 488b6cee71dSXin LI0 string PS-X\ EXE Sony Playstation executable 4893e41d09dSXin LI>16 lelong x PC=0x%08x, 4903e41d09dSXin LI>20 lelong !0 GP=0x%08x, 4913e41d09dSXin LI>24 lelong !0 .text=[0x%08x, 4923e41d09dSXin LI>>28 lelong x \b0x%x], 4933e41d09dSXin LI>32 lelong !0 .data=[0x%08x, 4943e41d09dSXin LI>>36 lelong x \b0x%x], 4953e41d09dSXin LI>40 lelong !0 .bss=[0x%08x, 4963e41d09dSXin LI>>44 lelong x \b0x%x], 4973e41d09dSXin LI>48 lelong !0 Stack=0x%08x, 4983e41d09dSXin LI>48 lelong =0 No Stack!, 4993e41d09dSXin LI>52 lelong !0 StackSize=0x%x, 5003e41d09dSXin LI#>76 string >\0 (%s) 501b6cee71dSXin LI# Area: 502b6cee71dSXin LI>113 string x (%s) 503b6cee71dSXin LI 5043e41d09dSXin LI# CPE executables 5053e41d09dSXin LI0 string CPE CPE executable 5063e41d09dSXin LI>3 byte x (version %d) 5073e41d09dSXin LI 508b6cee71dSXin LI#------------------------------------------------------------------------------ 509b6cee71dSXin LI# Microsoft Xbox executables .xbe (Esa Hyytia <ehyytia@cc.hut.fi>) 51048c779cdSXin LI0 string XBEH Microsoft Xbox executable 511d38c30c0SXin LI!:mime audio/x-xbox-executable 512d38c30c0SXin LI!:ext xbe 51348c779cdSXin LI# expect base address of 0x10000 51448c779cdSXin LI>0x0104 ulelong =0x10000 51548c779cdSXin LI>>(0x0118.l-0x0FFF4) lestring16 x \b: "%.40s" 51648c779cdSXin LI>>(0x0118.l-0x0FFF5) byte x (%c 51748c779cdSXin LI>>(0x0118.l-0x0FFF6) byte x \b%c- 51848c779cdSXin LI>>(0x0118.l-0x0FFF8) uleshort x \b%03u) 51948c779cdSXin LI>>(0x0118.l-0x0FF60) ulelong&0x80000007 0x80000007 \b, all regions 52048c779cdSXin LI>>(0x0118.l-0x0FF60) ulelong&0x80000007 !0x80000007 52148c779cdSXin LI>>>(0x0118.l-0x0FF60) ulelong >0 (regions: 52248c779cdSXin LI>>>>(0x0118.l-0x0FF60) ulelong &0x00000001 NA 52348c779cdSXin LI>>>>(0x0118.l-0x0FF60) ulelong &0x00000002 Japan 52448c779cdSXin LI>>>>(0x0118.l-0x0FF60) ulelong &0x00000004 Rest_of_World 52548c779cdSXin LI>>>>(0x0118.l-0x0FF60) ulelong &0x80000000 Manufacturer 52648c779cdSXin LI>>>(0x0118.l-0x0FF60) ulelong >0 \b) 527b6cee71dSXin LI# probabilistic checks whether signed or not 528b6cee71dSXin LI>0x0004 ulelong =0x0 529b6cee71dSXin LI>>&2 ulelong =0x0 530b6cee71dSXin LI>>>&2 ulelong =0x0 \b, not signed 531b6cee71dSXin LI>0x0004 ulelong >0 532b6cee71dSXin LI>>&2 ulelong >0 533b6cee71dSXin LI>>>&2 ulelong >0 \b, signed 534b6cee71dSXin LI 535b6cee71dSXin LI# -------------------------------- 536b6cee71dSXin LI# Microsoft Xbox data file formats 537b6cee71dSXin LI0 string XIP0 XIP, Microsoft Xbox data 538b6cee71dSXin LI0 string XTF0 XTF, Microsoft Xbox data 539b6cee71dSXin LI 54048c779cdSXin LI#------------------------------------------------------------------------------ 54148c779cdSXin LI# Microsoft Xbox 360 executables (.xex) 54248c779cdSXin LI# From: David Korth <gerbilsoft@gerbilsoft.com> 54348c779cdSXin LI# References: 54448c779cdSXin LI# - https://free60project.github.io/wiki/XEX.html 54548c779cdSXin LI# - https://github.com/xenia-project/xenia/blob/HEAD/src/xenia/kernel/util/xex2_info.h 54648c779cdSXin LI 54748c779cdSXin LI# Title ID (part of Execution ID section) 54848c779cdSXin LI0 name xbox-360-xex-execution-id 54948c779cdSXin LI>(0.L+0xC) byte x (%c 55048c779cdSXin LI>(0.L+0xD) byte x \b%c 551d38c30c0SXin LI>(0.L+0xE) beshort x \b-%04u, media ID: 552d38c30c0SXin LI>(0.L) belong x %08X) 553d38c30c0SXin LI 554d38c30c0SXin LI# Region code (part of Security Info) 555d38c30c0SXin LI0 name xbox-360-xex-region-code 556d38c30c0SXin LI>0 ubelong 0xFFFFFFFF \b, all regions 557d38c30c0SXin LI>0 ubelong !0xFFFFFFFF 558d38c30c0SXin LI>>0 ubelong >0 (regions: 559d38c30c0SXin LI>>0 ubelong&0x000000FF 0x000000FF USA 560d38c30c0SXin LI>>0 ubelong&0x00000100 0x00000100 Japan 561d38c30c0SXin LI>>0 ubelong&0x00000200 0x00000200 China 562d38c30c0SXin LI>>0 ubelong&0x0000FC00 0x0000FC00 Asia 563d38c30c0SXin LI>>0 ubelong&0x00FF0000 0x00FF0000 PAL 564d38c30c0SXin LI>>0 ubelong&0x00FF0000 0x00FE0000 PAL [except AU/NZ] 565d38c30c0SXin LI>>0 ubelong&0x00FF0000 0x00010000 AU/NZ 566d38c30c0SXin LI>>0 ubelong&0xFF000000 0xFF000000 Other 567d38c30c0SXin LI>>0 ubelong >0 \b) 56848c779cdSXin LI 56948c779cdSXin LI0 string XEX2 Microsoft Xbox 360 executable 570d38c30c0SXin LI!:mime audio/x-xbox360-executable 571d38c30c0SXin LI!:ext xex 57248c779cdSXin LI>0x18 search/0x100 \x00\x04\x00\x06 57348c779cdSXin LI>>&0 use xbox-360-xex-execution-id 574d38c30c0SXin LI>(0x010.L+0x178) use xbox-360-xex-region-code 57548c779cdSXin LI 576d38c30c0SXin LI0 string XEX1 Microsoft Xbox 360 executable (XEX1) 577d38c30c0SXin LI!:mime audio/x-xbox360-executable 578d38c30c0SXin LI!:ext xex 579d38c30c0SXin LI>0x18 search/0x100 \x00\x04\x00\x06 580d38c30c0SXin LI>>&0 use xbox-360-xex-execution-id 581d38c30c0SXin LI>(0x010.L+0x154) use xbox-360-xex-region-code 58248c779cdSXin LI 583d38c30c0SXin LI#------------------------------------------------------------------------------ 584d38c30c0SXin LI# Microsoft Xbox 360 packages 585d38c30c0SXin LI# From: David Korth <gerbilsoft@gerbilsoft.com> 586d38c30c0SXin LI# References: 587d38c30c0SXin LI# - https://free60project.github.io/wiki/STFS.html 588d38c30c0SXin LI# - https://github.com/xenia-project/xenia/blob/HEAD/src/xenia/kernel/util/xex2_info.h 589d38c30c0SXin LI 590d38c30c0SXin LI# TODO: More information for console-signed packages. 591d38c30c0SXin LI 592d38c30c0SXin LI0 name xbox-360-package 593d38c30c0SXin LI>0x360 byte x (%c 594d38c30c0SXin LI>0x361 byte x \b%c 595d38c30c0SXin LI>0x362 beshort x \b-%04u, media ID: 596d38c30c0SXin LI>0x354 belong x %08X) 597d38c30c0SXin LI>0x344 belong x \b, content type: 598d38c30c0SXin LI>>0x344 belong 0x1 Saved Game 599d38c30c0SXin LI>>0x344 belong 0x2 Marketplace Content 600d38c30c0SXin LI>>0x344 belong 0x3 Publisher 601d38c30c0SXin LI>>0x344 belong 0x1000 Xbox 360 Title 602d38c30c0SXin LI>>0x344 belong 0x2000 IPTV Pause Buffer 603d38c30c0SXin LI>>0x344 belong 0x4000 Installed Game 604d38c30c0SXin LI>>0x344 belong 0x5000 Original Xbox Game 605d38c30c0SXin LI>>0x344 belong 0x9000 Avatar Item 606d38c30c0SXin LI>>0x344 belong 0x10000 Profile 607d38c30c0SXin LI>>0x344 belong 0x20000 Gamer Picture 608d38c30c0SXin LI>>0x344 belong 0x30000 Theme 609d38c30c0SXin LI>>0x344 belong 0x40000 Cache File 610d38c30c0SXin LI>>0x344 belong 0x50000 Storage Download 611d38c30c0SXin LI>>0x344 belong 0x60000 Xbox Saved Game 612d38c30c0SXin LI>>0x344 belong 0x70000 Xbox Download 613d38c30c0SXin LI>>0x344 belong 0x80000 Game Demo 614d38c30c0SXin LI>>0x344 belong 0x90000 Video 615d38c30c0SXin LI>>0x344 belong 0xA0000 Game 616d38c30c0SXin LI>>0x344 belong 0xB0000 Installer 617d38c30c0SXin LI>>0x344 belong 0xC0000 Game Trailer 618d38c30c0SXin LI>>0x344 belong 0xD0000 Arcade Title 619d38c30c0SXin LI>>0x344 belong 0xE0000 XNA 620d38c30c0SXin LI>>0x344 belong 0xF0000 License Store 621d38c30c0SXin LI>>0x344 belong 0x100000 Movie 622d38c30c0SXin LI>>0x344 belong 0x200000 TV 623d38c30c0SXin LI>>0x344 belong 0x300000 Music Video 624d38c30c0SXin LI>>0x344 belong 0x400000 Game Video 625d38c30c0SXin LI>>0x344 belong 0x500000 Podcast Video 626d38c30c0SXin LI>>0x344 belong 0x600000 Viral Video 627d38c30c0SXin LI>>0x344 belong 0x2000000 Community Game 628d38c30c0SXin LI 629d38c30c0SXin LI0 string CON\x20 Microsoft Xbox 360 package (console-signed) 630d38c30c0SXin LI>0 use xbox-360-package 631*2726a701SXin LI0 string PIRS 632*2726a701SXin LI>0 belong 0 Microsoft Xbox 360 package (non-Xbox Live) 633*2726a701SXin LI>>0 use xbox-360-package 634*2726a701SXin LI0 string LIVE 635*2726a701SXin LI>0x104 belong 0 Microsoft Xbox 360 package (Xbox Live) 636*2726a701SXin LI>>0 use xbox-360-package 63748c779cdSXin LI 638b6cee71dSXin LI# Atari Lynx cartridge dump (EXE/BLL header) 639b6cee71dSXin LI# From: "Stefan A. Haubenthal" <polluks@web.de> 640b6cee71dSXin LI 641b6cee71dSXin LI# Double-check that the image type matches too, 0x8008 conflicts with 642b6cee71dSXin LI# 8 character OMF-86 object file headers. 643b6cee71dSXin LI0 beshort 0x8008 644b6cee71dSXin LI>6 string BS93 Lynx homebrew cartridge 6452dc4dbb9SEitan Adler!:mime application/x-atari-lynx-rom 646b6cee71dSXin LI>>2 beshort x \b, RAM start $%04x 647b6cee71dSXin LI>6 string LYNX Lynx cartridge 6482dc4dbb9SEitan Adler!:mime application/x-atari-lynx-rom 649b6cee71dSXin LI>>2 beshort x \b, RAM start $%04x 650b6cee71dSXin LI 651b6cee71dSXin LI# Opera file system that is used on the 3DO console 652b6cee71dSXin LI# From: Serge van den Boom <svdb@stack.nl> 653b6cee71dSXin LI0 string \x01ZZZZZ\x01 3DO "Opera" file system 654b6cee71dSXin LI 65558a0f0d0SEitan Adler# From: Alex Myczko <alex@aiei.ch> 6565f0216bdSXin LI# From: David Pflug <david@pflug.email> 6575f0216bdSXin LI# is the offset 12 or the offset 16 correct? 6585f0216bdSXin LI# GBS (Game Boy Sound) magic 6595f0216bdSXin LI# ftp://ftp.modland.com/pub/documents/format_documentation/\ 6605f0216bdSXin LI# Gameboy%20Sound%20System%20(.gbs).txt 661b6cee71dSXin LI0 string GBS Nintendo Gameboy Music/Audio Data 6625f0216bdSXin LI#12 string GameBoy\ Music\ Module Nintendo Gameboy Music Module 6632dc4dbb9SEitan Adler>16 string >\0 ("%.32s" by 6642dc4dbb9SEitan Adler>48 string >\0 %.32s, copyright 6652dc4dbb9SEitan Adler>80 string >\0 %.32s), 6662dc4dbb9SEitan Adler>3 byte x version %u, 6672dc4dbb9SEitan Adler>4 byte x %u tracks 668b6cee71dSXin LI 66940427ccaSGordon Tetlow# IPS Patch Files from: From: Thomas Klausner <tk@giga.or.at> 67048c779cdSXin LI# see https://zerosoft.zophar.net/ips.php 67140427ccaSGordon Tetlow0 string PATCH IPS patch file 672*2726a701SXin LI!:ext ips 673*2726a701SXin LI 674*2726a701SXin LI# BPS Patch Files - from: David Korth <gerbilsoft@gerbilsoft.com> 675*2726a701SXin LI# Reference: https://www.romhacking.net/documents/746/ 676*2726a701SXin LI0 string BPS1 BPS patch file 677*2726a701SXin LI!:ext bps 678*2726a701SXin LI 679*2726a701SXin LI# APS Patch Files - from: David Korth <gerbilsoft@gerbilsoft.com> 680*2726a701SXin LI# Reference: https://github.com/btimofeev/UniPatcher/wiki/APS-(N64) 681*2726a701SXin LI0 string APS10 APS patch file 682*2726a701SXin LI!:ext aps 683*2726a701SXin LI>5 byte 0 \b, simple patch 684*2726a701SXin LI>5 byte 1 \b, N64-specific patch for 685*2726a701SXin LI>>58 byte x N%c 686*2726a701SXin LI>>59 byte x \b%c 687*2726a701SXin LI>>60 byte x \b%c 688*2726a701SXin LI>7 byte !0x20 689*2726a701SXin LI# FIXME: /T specifier isn't working with a fixed-length string. 690*2726a701SXin LI>>7 string x \b: "%.50s" 691*2726a701SXin LI 692*2726a701SXin LI# UPS Patch Files - from: David Korth <gerbilsoft@gerbilsoft.com> 693*2726a701SXin LI# Reference: http://fileformats.archiveteam.org/wiki/UPS_(binary_patch_format) 694*2726a701SXin LI0 string UPS1 UPS patch file 695*2726a701SXin LI!:ext ups 69640427ccaSGordon Tetlow 697b6cee71dSXin LI# Playstations Patch Files from: From: Thomas Klausner <tk@giga.or.at> 698b6cee71dSXin LI0 string PPF30 Playstation Patch File version 3.0 699b6cee71dSXin LI>5 byte 0 \b, PPF 1.0 patch 700b6cee71dSXin LI>5 byte 1 \b, PPF 2.0 patch 701b6cee71dSXin LI>5 byte 2 \b, PPF 3.0 patch 702b6cee71dSXin LI>>56 byte 0 \b, Imagetype BIN (any) 703b6cee71dSXin LI>>56 byte 1 \b, Imagetype GI (PrimoDVD) 704b6cee71dSXin LI>>57 byte 0 \b, Blockcheck disabled 705b6cee71dSXin LI>>57 byte 1 \b, Blockcheck enabled 706b6cee71dSXin LI>>58 byte 0 \b, Undo data not available 707b6cee71dSXin LI>>58 byte 1 \b, Undo data available 708b6cee71dSXin LI>6 string x \b, description: %s 709b6cee71dSXin LI 710b6cee71dSXin LI0 string PPF20 Playstation Patch File version 2.0 711b6cee71dSXin LI>5 byte 0 \b, PPF 1.0 patch 712b6cee71dSXin LI>5 byte 1 \b, PPF 2.0 patch 713b6cee71dSXin LI>>56 lelong >0 \b, size of file to patch %d 714b6cee71dSXin LI>6 string x \b, description: %s 715b6cee71dSXin LI 716b6cee71dSXin LI0 string PPF10 Playstation Patch File version 1.0 717b6cee71dSXin LI>5 byte 0 \b, Simple Encoding 718b6cee71dSXin LI>6 string x \b, description: %s 719b6cee71dSXin LI 720b6cee71dSXin LI# From: Daniel Dawson <ddawson@icehouse.net> 721b6cee71dSXin LI# SNES9x .smv "movie" file format. 722b6cee71dSXin LI0 string SMV\x1A SNES9x input recording 723b6cee71dSXin LI>0x4 lelong x \b, version %d 724b6cee71dSXin LI# version 4 is latest so far 725b6cee71dSXin LI>0x4 lelong <5 726b6cee71dSXin LI>>0x8 ledate x \b, recorded at %s 727b6cee71dSXin LI>>0xc lelong >0 \b, rerecorded %d times 728b6cee71dSXin LI>>0x10 lelong x \b, %d frames long 729b6cee71dSXin LI>>0x14 byte >0 \b, data for controller(s): 730b6cee71dSXin LI>>>0x14 byte &0x1 #1 731b6cee71dSXin LI>>>0x14 byte &0x2 #2 732b6cee71dSXin LI>>>0x14 byte &0x4 #3 733b6cee71dSXin LI>>>0x14 byte &0x8 #4 734b6cee71dSXin LI>>>0x14 byte &0x10 #5 735b6cee71dSXin LI>>0x15 byte ^0x1 \b, begins from snapshot 736b6cee71dSXin LI>>0x15 byte &0x1 \b, begins from reset 737b6cee71dSXin LI>>0x15 byte ^0x2 \b, NTSC standard 738b6cee71dSXin LI>>0x15 byte &0x2 \b, PAL standard 739b6cee71dSXin LI>>0x17 byte &0x1 \b, settings: 740b6cee71dSXin LI# WIP1Timing not used as of version 4 741b6cee71dSXin LI>>>0x4 lelong <4 742b6cee71dSXin LI>>>>0x17 byte &0x2 WIP1Timing 743b6cee71dSXin LI>>>0x17 byte &0x4 Left+Right 744b6cee71dSXin LI>>>0x17 byte &0x8 VolumeEnvX 745b6cee71dSXin LI>>>0x17 byte &0x10 FakeMute 746b6cee71dSXin LI>>>0x17 byte &0x20 SyncSound 747b6cee71dSXin LI# New flag as of version 4 748b6cee71dSXin LI>>>0x4 lelong >3 749b6cee71dSXin LI>>>>0x17 byte &0x80 NoCPUShutdown 750b6cee71dSXin LI>>0x4 lelong <4 751b6cee71dSXin LI>>>0x18 lelong >0x23 752b6cee71dSXin LI>>>>0x20 leshort !0 753b6cee71dSXin LI>>>>>0x20 lestring16 x \b, metadata: "%s" 754b6cee71dSXin LI>>0x4 lelong >3 755b6cee71dSXin LI>>>0x24 byte >0 \b, port 1: 756b6cee71dSXin LI>>>>0x24 byte 1 joypad 757b6cee71dSXin LI>>>>0x24 byte 2 mouse 758b6cee71dSXin LI>>>>0x24 byte 3 SuperScope 759b6cee71dSXin LI>>>>0x24 byte 4 Justifier 760b6cee71dSXin LI>>>>0x24 byte 5 multitap 761b6cee71dSXin LI>>>0x24 byte >0 \b, port 2: 762b6cee71dSXin LI>>>>0x25 byte 1 joypad 763b6cee71dSXin LI>>>>0x25 byte 2 mouse 764b6cee71dSXin LI>>>>0x25 byte 3 SuperScope 765b6cee71dSXin LI>>>>0x25 byte 4 Justifier 766b6cee71dSXin LI>>>>0x25 byte 5 multitap 767b6cee71dSXin LI>>>0x18 lelong >0x43 768b6cee71dSXin LI>>>>0x40 leshort !0 769b6cee71dSXin LI>>>>>0x40 lestring16 x \b, metadata: "%s" 770b6cee71dSXin LI>>0x17 byte &0x40 \b, ROM: 771b6cee71dSXin LI>>>(0x18.l-26) lelong x CRC32 0x%08x 772b6cee71dSXin LI>>>(0x18.l-23) string x "%s" 773b6cee71dSXin LI 774b6cee71dSXin LI# Type: scummVM savegame files 775b6cee71dSXin LI# From: Sven Hartge <debian@ds9.argh.org> 776b6cee71dSXin LI0 string SCVM ScummVM savegame 777b6cee71dSXin LI>12 string >\0 "%s" 7783e41d09dSXin LI 7793e41d09dSXin LI#------------------------------------------------------------------------------ 7803e41d09dSXin LI# Nintendo GameCube / Wii file formats. 7813e41d09dSXin LI# 7823e41d09dSXin LI 7833e41d09dSXin LI# Type: Nintendo GameCube/Wii common disc header data. 7843e41d09dSXin LI# From: David Korth <gerbilsoft@gerbilsoft.com> 78548c779cdSXin LI# Reference: https://wiibrew.org/wiki/Wii_Disc 7863e41d09dSXin LI0 name nintendo-gcn-disc-common 7873e41d09dSXin LI>0x20 string x "%.64s" 7883e41d09dSXin LI>0x00 string x (%.6s 7893e41d09dSXin LI>0x06 byte >0 7903e41d09dSXin LI>>0x06 byte 1 \b, Disc 2 7913e41d09dSXin LI>>0x06 byte 2 \b, Disc 3 7923e41d09dSXin LI>>0x06 byte 3 \b, Disc 4 7933e41d09dSXin LI>0x07 byte x \b, Rev.%02u) 7942dc4dbb9SEitan Adler>0x18 belong 0x5D1C9EA3 7952dc4dbb9SEitan Adler>>0x60 beshort 0x0101 \b (Unencrypted) 796*2726a701SXin LI>0x200 string NKIT \b (NKit compressed) 797*2726a701SXin LI 7983e41d09dSXin LI 7993e41d09dSXin LI# Type: Nintendo GameCube disc image 8003e41d09dSXin LI# From: David Korth <gerbilsoft@gerbilsoft.com> 80148c779cdSXin LI# Reference: https://wiibrew.org/wiki/Wii_Disc 8023e41d09dSXin LI0x1C belong 0xC2339F3D Nintendo GameCube disc image: 8032dc4dbb9SEitan Adler!:mime application/x-gamecube-rom 8043e41d09dSXin LI>0 use nintendo-gcn-disc-common 8053e41d09dSXin LI 806282e23f0SXin LI# Type: Nintendo GameCube embedded disc image 807282e23f0SXin LI# Commonly found on demo discs. 808282e23f0SXin LI# From: David Korth <gerbilsoft@gerbilsoft.com> 809282e23f0SXin LI# Reference: http://hitmen.c02.at/files/yagcd/yagcd/index.html#idx14.8 810282e23f0SXin LI0 belong 0xAE0F38A2 811282e23f0SXin LI>0x0C belong 0x00100000 812282e23f0SXin LI>>(8.L+0x1C) belong 0xC2339F3D Nintendo GameCube embedded disc image: 8132dc4dbb9SEitan Adler!:mime application/x-gamecube-rom 814282e23f0SXin LI>>>(8.L) use nintendo-gcn-disc-common 815282e23f0SXin LI 8163e41d09dSXin LI# Type: Nintendo Wii disc image 8173e41d09dSXin LI# From: David Korth <gerbilsoft@gerbilsoft.com> 81848c779cdSXin LI# Reference: https://wiibrew.org/wiki/Wii_Disc 8193e41d09dSXin LI0x18 belong 0x5D1C9EA3 Nintendo Wii disc image: 8203e41d09dSXin LI>0 use nintendo-gcn-disc-common 8213e41d09dSXin LI 8223e41d09dSXin LI# Type: Nintendo Wii disc image (WBFS format) 8233e41d09dSXin LI# From: David Korth <gerbilsoft@gerbilsoft.com> 82448c779cdSXin LI# Reference: https://wiibrew.org/wiki/Wii_Disc 8253e41d09dSXin LI0 string WBFS 8263e41d09dSXin LI>0x218 belong 0x5D1C9EA3 Nintendo Wii disc image (WBFS format): 8272dc4dbb9SEitan Adler!:mime application/x-wii-rom 8283e41d09dSXin LI>>0x200 use nintendo-gcn-disc-common 8293e41d09dSXin LI 83040427ccaSGordon Tetlow# Type: Nintendo GameCube/Wii disc image (CISO format) 83140427ccaSGordon Tetlow# NOTE: This is NOT the same as Compact ISO or PSP CISO, 83240427ccaSGordon Tetlow# though it has the same magic number. 83340427ccaSGordon Tetlow0 string CISO 83440427ccaSGordon Tetlow# Other fields are used to determine what type of CISO this is: 83540427ccaSGordon Tetlow# - 0x04 == 0x00200000: GameCube/Wii CISO (block_size) 83640427ccaSGordon Tetlow# - 0x10 == 0x00000800: PSP CISO (ISO-9660 sector size) 83740427ccaSGordon Tetlow# - None of the above: Compact ISO. 83840427ccaSGordon Tetlow>4 lelong 0x200000 83940427ccaSGordon Tetlow>>8 byte 1 84040427ccaSGordon Tetlow>>>0x801C belong 0xC2339F3D Nintendo GameCube disc image (CISO format): 8412dc4dbb9SEitan Adler!:mime application/x-wii-rom 84240427ccaSGordon Tetlow>>>>0x8000 use nintendo-gcn-disc-common 84340427ccaSGordon Tetlow>>>0x8018 belong 0x5D1C9EA3 Nintendo Wii disc image (CISO format): 8442dc4dbb9SEitan Adler!:mime application/x-wii-rom 84540427ccaSGordon Tetlow>>>>0x8000 use nintendo-gcn-disc-common 84640427ccaSGordon Tetlow 84740427ccaSGordon Tetlow# Type: Nintendo GameCube/Wii disc image (GCZ format) 84840427ccaSGordon Tetlow# Due to zlib compression, we can't get the actual disc information. 84940427ccaSGordon Tetlow0 lelong 0xB10BC001 85040427ccaSGordon Tetlow>4 lelong 0 Nintendo GameCube disc image (GCZ format) 8512dc4dbb9SEitan Adler!:mime application/x-gamecube-rom 85240427ccaSGordon Tetlow>4 lelong 1 Nintendo Wii disc image (GCZ format) 8532dc4dbb9SEitan Adler!:mime application/x-wii-rom 8542dc4dbb9SEitan Adler>4 default x Nintendo GameCube/Wii disc image (GCZ format) 85540427ccaSGordon Tetlow 85640427ccaSGordon Tetlow# Type: Nintendo GameCube/Wii disc image (WDF format) 85740427ccaSGordon Tetlow0 string WII\001DISC 85840427ccaSGordon Tetlow>8 belong 1 85940427ccaSGordon Tetlow# WDFv1 86040427ccaSGordon Tetlow>>0x54 belong 0xC2339F3D Nintendo GameCube disc image (WDFv1 format): 8612dc4dbb9SEitan Adler!:mime application/x-gamecube-rom 86240427ccaSGordon Tetlow>>>0x38 use nintendo-gcn-disc-common 86340427ccaSGordon Tetlow>>0x58 belong 0x5D1C9EA3 Nintendo Wii disc image (WDFv1 format): 8642dc4dbb9SEitan Adler!:mime application/x-wii-rom 86540427ccaSGordon Tetlow>>>0x38 use nintendo-gcn-disc-common 86640427ccaSGordon Tetlow>8 belong 2 86740427ccaSGordon Tetlow# WDFv2 86840427ccaSGordon Tetlow>>(12.L+0x1C) belong 0xC2339F3D Nintendo GameCube disc image (WDFv2 format): 8692dc4dbb9SEitan Adler!:mime application/x-gamecube-rom 87040427ccaSGordon Tetlow>>>(12.L) use nintendo-gcn-disc-common 87140427ccaSGordon Tetlow>>(12.L+0x18) belong 0x5D1C9EA3 Nintendo Wii disc image (WDFv2 format): 8722dc4dbb9SEitan Adler!:mime application/x-wii-rom 87340427ccaSGordon Tetlow>>>(12.L) use nintendo-gcn-disc-common 87440427ccaSGordon Tetlow 87540427ccaSGordon Tetlow# Type: Nintendo GameCube/Wii disc image (WIA format) 87640427ccaSGordon Tetlow0 string WIA\001 Nintendo 87740427ccaSGordon Tetlow>0x48 belong 1 GameCube 8782dc4dbb9SEitan Adler!:mime application/x-gamecube-rom 87940427ccaSGordon Tetlow>0x48 belong 2 Wii 8802dc4dbb9SEitan Adler!:mime application/x-wii-rom 8812dc4dbb9SEitan Adler>0x48 default x GameCube/Wii 88240427ccaSGordon Tetlow>0x48 belong x disc image (WIA format): 88340427ccaSGordon Tetlow>>0x58 use nintendo-gcn-disc-common 88440427ccaSGordon Tetlow 8852dc4dbb9SEitan Adler# Type: Nintendo GameCube/Wii disc image (with SDK header) 8862dc4dbb9SEitan Adler# From: David Korth <gerbilsoft@gerbilsoft.com> 88748c779cdSXin LI# Reference: https://wiibrew.org/wiki/Wii_Disc 8882dc4dbb9SEitan Adler0 belong 0xFFFF0000 8892dc4dbb9SEitan Adler>0x18 belong 0x00000000 8902dc4dbb9SEitan Adler>>0x1C belong 0x00000000 8912dc4dbb9SEitan Adler>>>0x8018 belong 0x5D1C9EA3 Nintendo Wii SDK disc image: 89248c779cdSXin LI!:mime application/x-wii-rom 8932dc4dbb9SEitan Adler>>>>0x8000 use nintendo-gcn-disc-common 8942dc4dbb9SEitan Adler>>>0x801C belong 0xC2339F3D Nintendo GameCube SDK disc image: 89548c779cdSXin LI!:mime application/x-gamecube-rom 8962dc4dbb9SEitan Adler>>>>0x8000 use nintendo-gcn-disc-common 8972dc4dbb9SEitan Adler 8983e41d09dSXin LI#------------------------------------------------------------------------------ 8993e41d09dSXin LI# Nintendo 3DS file formats. 9003e41d09dSXin LI# 9013e41d09dSXin LI 9023e41d09dSXin LI# Type: Nintendo 3DS "NCSD" image. (game cards and eMMC) 9033e41d09dSXin LI# From: David Korth <gerbilsoft@gerbilsoft.com> 9043e41d09dSXin LI# Reference: https://www.3dbrew.org/wiki/NCSD 9053e41d09dSXin LI0x100 string NCSD 9063e41d09dSXin LI>0x118 lequad 0 Nintendo 3DS Game Card image 907282e23f0SXin LI# NCCH header for partition 0. (game data) 908282e23f0SXin LI>>0x1150 string >\0 \b: "%.16s" 909282e23f0SXin LI>>0x312 byte x (Rev.%02u) 910282e23f0SXin LI>>0x118C byte 2 (New3DS only) 9113e41d09dSXin LI>>0x18D byte 0 (inner device) 9123e41d09dSXin LI>>0x18D byte 1 (Card1) 9133e41d09dSXin LI>>0x18D byte 2 (Card2) 9143e41d09dSXin LI>>0x18D byte 3 (extended device) 9153e41d09dSXin LI>0x118 bequad 0x0102020202000000 Nintendo 3DS eMMC dump (Old3DS) 9163e41d09dSXin LI>0x118 bequad 0x0102020203000000 Nintendo 3DS eMMC dump (New3DS) 9173e41d09dSXin LI 918282e23f0SXin LI# Nintendo 3DS version code. 919282e23f0SXin LI# Reference: https://www.3dbrew.org/wiki/Titles 920282e23f0SXin LI# Format: leshort containing three fields: 921282e23f0SXin LI# - 6-bit: Major 922282e23f0SXin LI# - 6-bit: Minor 923282e23f0SXin LI# - 4-bit: Revision 924282e23f0SXin LI# NOTE: Only supporting major/minor versions from 0-15 right now. 925282e23f0SXin LI# NOTE: Should be prefixed with "v". 926282e23f0SXin LI0 name nintendo-3ds-version-code 927282e23f0SXin LI# Raw version. 928282e23f0SXin LI>0 leshort x \b%u, 929282e23f0SXin LI# Major version. 930282e23f0SXin LI>0 leshort&0xFC00 0x0000 0 931282e23f0SXin LI>0 leshort&0xFC00 0x0400 1 932282e23f0SXin LI>0 leshort&0xFC00 0x0800 2 933282e23f0SXin LI>0 leshort&0xFC00 0x0C00 3 934282e23f0SXin LI>0 leshort&0xFC00 0x1000 4 935282e23f0SXin LI>0 leshort&0xFC00 0x1400 5 936282e23f0SXin LI>0 leshort&0xFC00 0x1800 6 937282e23f0SXin LI>0 leshort&0xFC00 0x1C00 7 938282e23f0SXin LI>0 leshort&0xFC00 0x2000 8 939282e23f0SXin LI>0 leshort&0xFC00 0x2400 9 940282e23f0SXin LI>0 leshort&0xFC00 0x2800 10 941282e23f0SXin LI>0 leshort&0xFC00 0x2C00 11 942282e23f0SXin LI>0 leshort&0xFC00 0x3000 12 943282e23f0SXin LI>0 leshort&0xFC00 0x3400 13 944282e23f0SXin LI>0 leshort&0xFC00 0x3800 14 945282e23f0SXin LI>0 leshort&0xFC00 0x3C00 15 946282e23f0SXin LI# Minor version. 947282e23f0SXin LI>0 leshort&0x03F0 0x0000 \b.0 948282e23f0SXin LI>0 leshort&0x03F0 0x0010 \b.1 949282e23f0SXin LI>0 leshort&0x03F0 0x0020 \b.2 950282e23f0SXin LI>0 leshort&0x03F0 0x0030 \b.3 951282e23f0SXin LI>0 leshort&0x03F0 0x0040 \b.4 952282e23f0SXin LI>0 leshort&0x03F0 0x0050 \b.5 953282e23f0SXin LI>0 leshort&0x03F0 0x0060 \b.6 954282e23f0SXin LI>0 leshort&0x03F0 0x0070 \b.7 955282e23f0SXin LI>0 leshort&0x03F0 0x0080 \b.8 956282e23f0SXin LI>0 leshort&0x03F0 0x0090 \b.9 957282e23f0SXin LI>0 leshort&0x03F0 0x00A0 \b.10 958282e23f0SXin LI>0 leshort&0x03F0 0x00B0 \b.11 959282e23f0SXin LI>0 leshort&0x03F0 0x00C0 \b.12 960282e23f0SXin LI>0 leshort&0x03F0 0x00D0 \b.13 961282e23f0SXin LI>0 leshort&0x03F0 0x00E0 \b.14 962282e23f0SXin LI>0 leshort&0x03F0 0x00F0 \b.15 963282e23f0SXin LI# Revision. 964282e23f0SXin LI>0 leshort&0x000F x \b.%u 965282e23f0SXin LI 9663e41d09dSXin LI# Type: Nintendo 3DS "NCCH" container. 9673e41d09dSXin LI# https://www.3dbrew.org/wiki/NCCH 9683e41d09dSXin LI0x100 string NCCH Nintendo 3DS 9693e41d09dSXin LI>0x18D byte&2 0 File Archive (CFA) 9703e41d09dSXin LI>0x18D byte&2 2 Executable Image (CXI) 971282e23f0SXin LI>0x150 string >\0 \b: "%.16s" 972282e23f0SXin LI>0x18D byte 0x05 973282e23f0SXin LI>>0x10E leshort x (Old3DS System Update v 974282e23f0SXin LI>>0x10E use nintendo-3ds-version-code 975282e23f0SXin LI>>0x10E leshort x \b) 976282e23f0SXin LI>0x18D byte 0x15 977282e23f0SXin LI>>0x10E leshort x (New3DS System Update v 978282e23f0SXin LI>>0x10E use nintendo-3ds-version-code 979282e23f0SXin LI>>0x10E leshort x \b) 980282e23f0SXin LI>0x18D byte !0x05 981282e23f0SXin LI>>0x18D byte !0x15 982282e23f0SXin LI>>>0x112 byte x (v 983282e23f0SXin LI>>>0x112 use nintendo-3ds-version-code 984282e23f0SXin LI>>>0x112 byte x \b) 985282e23f0SXin LI>0x18C byte 2 (New3DS only) 9863e41d09dSXin LI 9873e41d09dSXin LI# Type: Nintendo 3DS "SMDH" file. (application description) 9883e41d09dSXin LI# From: David Korth <gerbilsoft@gerbilsoft.com> 9893e41d09dSXin LI# Reference: https://3dbrew.org/wiki/SMDH 9903e41d09dSXin LI0 string SMDH Nintendo 3DS SMDH file 9913e41d09dSXin LI>0x208 leshort !0 9923e41d09dSXin LI>>0x208 lestring16 x \b: "%.128s" 9933e41d09dSXin LI>>0x388 leshort !0 9943e41d09dSXin LI>>>0x388 lestring16 x by %.128s 9953e41d09dSXin LI>0x208 leshort 0 9963e41d09dSXin LI>>0x008 leshort !0 9973e41d09dSXin LI>>>0x008 lestring16 x \b: "%.128s" 9983e41d09dSXin LI>>>0x188 leshort !0 9993e41d09dSXin LI>>>>0x188 lestring16 x by %.128s 10003e41d09dSXin LI 10013e41d09dSXin LI# Type: Nintendo 3DS Homebrew Application. 10023e41d09dSXin LI# From: David Korth <gerbilsoft@gerbilsoft.com> 100340427ccaSGordon Tetlow# Reference: https://3dbrew.org/wiki/3DSX_Format 10043e41d09dSXin LI0 string 3DSX Nintendo 3DS Homebrew Application (3DSX) 10053e41d09dSXin LI 10063e41d09dSXin LI#------------------------------------------------------------------------------ 10073e41d09dSXin LI# a7800: file(1) magic for the Atari 7800 raw ROM format. 10083e41d09dSXin LI# From: David Korth <gerbilsoft@gerbilsoft.com> 10093e41d09dSXin LI# Reference: https://sites.google.com/site/atari7800wiki/a78-header 10103e41d09dSXin LI 10113e41d09dSXin LI0 byte >0 10123e41d09dSXin LI>0 byte <3 10133e41d09dSXin LI>>1 string ATARI7800 Atari 7800 ROM image 10142dc4dbb9SEitan Adler!:mime application/x-atari-7800-rom 10153e41d09dSXin LI>>>0x11 string >\0 \b: "%.32s" 10163e41d09dSXin LI# Display type. 10173e41d09dSXin LI>>>0x39 byte 0 (NTSC) 10183e41d09dSXin LI>>>0x39 byte 1 (PAL) 10193e41d09dSXin LI>>>0x36 byte&1 1 (POKEY) 10203e41d09dSXin LI 10213e41d09dSXin LI#------------------------------------------------------------------------------ 10223e41d09dSXin LI# vectrex: file(1) magic for the GCE Vectrex raw ROM format. 10233e41d09dSXin LI# From: David Korth <gerbilsoft@gerbilsoft.com> 10243e41d09dSXin LI# Reference: http://www.playvectrex.com/designit/chrissalo/hello1.htm 10253e41d09dSXin LI# 10263e41d09dSXin LI# NOTE: Title is terminated with 0x80, not 0. 10273e41d09dSXin LI# The header is terminated with a 0, so that will 10283e41d09dSXin LI# terminate the title as well. 10293e41d09dSXin LI# 10303e41d09dSXin LI0 string g\ GCE Vectrex ROM image 10313e41d09dSXin LI>0x11 string >\0 \b: "%.16s" 103240427ccaSGordon Tetlow 103340427ccaSGordon Tetlow#------------------------------------------------------------------------------ 103440427ccaSGordon Tetlow# amiibo: file(1) magic for Nintendo amiibo NFC dumps. 103540427ccaSGordon Tetlow# From: David Korth <gerbilsoft@gerbilsoft.com> 103640427ccaSGordon Tetlow# Reference: https://www.3dbrew.org/wiki/Amiibo 103740427ccaSGordon Tetlow0x00 byte 0x04 103840427ccaSGordon Tetlow>0x0A beshort 0x0FE0 103940427ccaSGordon Tetlow>>0x0C belong 0xF110FFEE 104040427ccaSGordon Tetlow>>>0x208 beshort 0x0100 104140427ccaSGordon Tetlow>>>>0x020A byte 0x0F 104240427ccaSGordon Tetlow>>>>>0x020C bequad 0x000000045F000000 104340427ccaSGordon Tetlow>>>>>>0x5B byte 0x02 104440427ccaSGordon Tetlow>>>>>>>0x54 belong x Nintendo amiibo NFC dump - amiibo ID: %08X- 104540427ccaSGordon Tetlow>>>>>>>0x58 belong x \b%08X 1046*2726a701SXin LI 1047*2726a701SXin LI#------------------------------------------------------------------------------ 1048*2726a701SXin LI# Type: Nintendo Switch XCI (Game Cartridge Image) 1049*2726a701SXin LI# From: Benjamin Lowry <ben@ben.gmbh> 1050*2726a701SXin LI# Reference: https://switchbrew.org/wiki/Gamecard_Format 1051*2726a701SXin LI0x100 string HEAD 1052*2726a701SXin LI>0x10D byte 0xFA Nintendo Switch cartridge image (XCI), 1GB 1053*2726a701SXin LI>0x10D byte 0xF8 Nintendo Switch cartridge image (XCI), 2GB 1054*2726a701SXin LI>0x10D byte 0xF0 Nintendo Switch cartridge image (XCI), 4GB 1055*2726a701SXin LI>0x10D byte 0xE0 Nintendo Switch cartridge image (XCI), 8GB 1056*2726a701SXin LI>0x10D byte 0xE1 Nintendo Switch cartridge image (XCI), 16GB 1057*2726a701SXin LI>0x10D byte 0xE2 Nintendo Switch cartridge image (XCI), 32GB 1058*2726a701SXin LI 1059*2726a701SXin LI#------------------------------------------------------------------------------ 1060*2726a701SXin LI# Type: Nintendo Switch Executable 1061*2726a701SXin LI# From: Benjamin Lowry <ben@ben.gmbh> 1062*2726a701SXin LI# Reference: https://switchbrew.org/wiki/NSO 1063*2726a701SXin LI0x00 string NSO0 Nintendo Switch executable (NSO) 1064*2726a701SXin LI 1065*2726a701SXin LI#------------------------------------------------------------------------------ 1066*2726a701SXin LI# Type: Nintendo Switch PFS0 1067*2726a701SXin LI# From: Benjamin Lowry <ben@ben.gmbh> 1068*2726a701SXin LI# Reference: https://switchbrew.org/wiki/NCA_Format#PFS0 1069*2726a701SXin LI0x00 string PFS0 Nintendo Switch partition filesystem (PFS0) 1070*2726a701SXin LI>0x04 ulelong x \b, %d files 1071*2726a701SXin LI 1072*2726a701SXin LI#------------------------------------------------------------------------------ 1073*2726a701SXin LI# amiibo: file(1) magic for Nintendo Badge Arcade files. 1074*2726a701SXin LI# From: David Korth <gerbilsoft@gerbilsoft.com> 1075*2726a701SXin LI# References: 1076*2726a701SXin LI# - https://github.com/GerbilSoft/rom-properties/issues/92 1077*2726a701SXin LI# - https://github.com/CaitSith2/BadgeArcadeTool 1078*2726a701SXin LI# - https://github.com/TheMachinumps/Advanced-badge-editor 1079*2726a701SXin LI 1080*2726a701SXin LI# PRBS: Individual badge and/or mega badge. 1081*2726a701SXin LI0 string PRBS 1082*2726a701SXin LI>0x44 byte >0x20 Nintendo Badge Arcade 1083*2726a701SXin LI>>0xB8 ulelong <2 1084*2726a701SXin LI>>>0xBC ulelong <2 badge: 1085*2726a701SXin LI>>>0xBC ulelong >1 Mega Badge 1086*2726a701SXin LI>>>>0xB8 ulelong x (%ux 1087*2726a701SXin LI>>>>0xBC ulelong x \b%u): 1088*2726a701SXin LI>>0xB8 ulelong >1 Mega Badge 1089*2726a701SXin LI>>>0xB8 ulelong x (%ux 1090*2726a701SXin LI>>>0xBC ulelong x \b%u): 1091*2726a701SXin LI>0x44 string x "%s" 1092*2726a701SXin LI>0x3C ulelong x \b, badge ID: %u 1093*2726a701SXin LI>0x74 byte >0x20 1094*2726a701SXin LI>>0x74 string x \b, set: "%s" 1095*2726a701SXin LI>0xA8 ulelong !0xFFFFFFFF 1096*2726a701SXin LI>>0xA8 ulelong x \b, launch title ID: %08X 1097*2726a701SXin LI>>0xA4 ulelong x \b-%08X 1098*2726a701SXin LI 1099*2726a701SXin LI# CABS: Badge set. 1100*2726a701SXin LI0 string CABS 1101*2726a701SXin LI>0x2C byte >0x20 Nintendo Badge Arcade badge set: 1102*2726a701SXin LI>>0x2C string x "%.48s" 1103*2726a701SXin LI>>0x24 ulelong x \b, set ID: %u 1104