From f1507f54ba163c1dee89694d6e875f2ab5d40452 Mon Sep 17 00:00:00 2001 From: Christos Zoulas Date: Sat, 23 Jun 2018 16:36:37 +0000 Subject: [PATCH] Added unofficial MIME types from xdg/shared-mime-info. (David Korth) --- magic/Magdir/console | 56 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/magic/Magdir/console b/magic/Magdir/console index 453240d3..b8d663b8 100644 --- a/magic/Magdir/console +++ b/magic/Magdir/console @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: console,v 1.36 2018/06/23 16:36:27 christos Exp $ +# $File: console,v 1.37 2018/06/23 16:36:37 christos Exp $ # Console game magic # Toby Deshane @@ -47,10 +47,12 @@ # Standard iNES ROM header. 0 string NES\x1A NES ROM image (iNES) +!:mime application/x-nes-rom >0 use nes-rom-image-ines # Wii U Virtual Console iNES ROM header. 0 belong 0x4E455300 NES ROM image (Wii U Virtual Console) +!:mime application/x-nes-rom >0 use nes-rom-image-ines #------------------------------------------------------------------------------ @@ -63,6 +65,7 @@ # 0 string UNIF >4 lelong <16 NES ROM image (UNIF v%d format) +!:mime application/x-nes-rom #------------------------------------------------------------------------------ # fds: file(1) magic for Famciom Disk System disk images @@ -81,12 +84,14 @@ # Headered version. 0 string FDS\x1A >0x11 string *NINTENDO-HVC* Famicom Disk System disk image: +!:mime application/x-fds-disk >>0x10 use nintendo-fds-disk-info-block >4 byte 1 (%u side) >4 byte !1 (%u sides) # Unheadered version. 1 string *NINTENDO-HVC* Famicom Disk System disk image: +!:mime application/x-fds-disk >0 use nintendo-fds-disk-info-block #------------------------------------------------------------------------------ @@ -95,6 +100,7 @@ # From: David Korth # 0 string TNES NES ROM image (Nintendo 3DS Virtual Console) +!:mime application/x-nes-rom >4 byte 100 \b: FDS, >>0x2010 use nintendo-fds-disk-info-block >4 byte !100 \b: TNES mapper %u @@ -110,6 +116,8 @@ # Reference: http://gbdev.gg8.se/wiki/articles/The_Cartridge_Header # 0x104 bequad 0xCEED6666CC0D000B Game Boy ROM image +# TODO: application/x-gameboy-color-rom for GBC. +!:mime application/x-gameboy-rom >0x143 byte&0x80 0x80 >>0x134 string >\0 \b: "%.15s" >0x143 byte&0x80 !0x80 @@ -124,6 +132,7 @@ >>0x146 byte !0x03 >>>0x143 byte&0xC0 0x80 [CGB] >>>0x143 byte&0xC0 0xC0 [CGB ONLY] +>0x14b byte !0x33 # Mapper. >0x147 byte 0x00 [ROM ONLY] @@ -199,29 +208,37 @@ # TODO: Check for 32X CD? # Sega Mega CD disc images: 2048-byte sectors. 0 string SEGADISCSYSTEM\ \ Sega Mega CD disc image +!:mime application/x-sega-cd-rom >0 use sega-mega-drive-header >0 byte x \b, 2048-byte sectors 0 string SEGABOOTDISC\ \ \ \ Sega Mega CD disc image +!:mime application/x-sega-cd-rom >0 use sega-mega-drive-header >0 byte x \b, 2048-byte sectors # Sega Mega CD disc images: 2352-byte sectors. 0x10 string SEGADISCSYSTEM\ \ Sega Mega CD disc image +!:mime application/x-sega-cd-rom >0x10 use sega-mega-drive-header >0 byte x \b, 2352-byte sectors 0x10 string SEGABOOTDISC\ \ \ \ Sega Mega CD disc image +!:mime application/x-sega-cd-rom >0x10 use sega-mega-drive-header >0 byte x \b, 2352-byte sectors # Sega Mega Drive, 32X, Pico, and Mega CD Boot ROM images. 0x100 string SEGA >0x3C0 bequad 0x4D41525320434845 Sega 32X ROM image +!:mime application/x-genesis-32x-rom >>0 use sega-mega-drive-header >0x3C0 bequad !0x4D41525320434845 >>0x105 belong 0x5049434F Sega Pico ROM image +!:mime application/x-sega-pico-rom >>>0 use sega-mega-drive-header >>0x105 belong !0x5049434F >>>0x180 beshort 0x4252 Sega Mega CD Boot ROM image +!:mime application/x-genesis-rom >>>0x180 beshort !0x4252 Sega Mega Drive / Genesis ROM image +!:mime application/x-genesis-rom >>>0 use sega-mega-drive-header #------------------------------------------------------------------------------ @@ -238,11 +255,13 @@ # "Sega Genesis" header. 0x280 string EAGN >8 beshort 0xAABB Sega Mega Drive / Genesis ROM image (SMD format): +!:mime application/x-genesis-rom >>0 use sega-genesis-smd-header # "Sega Mega Drive" header. 0x280 string EAMG >8 beshort 0xAABB Sega Mega Drive / Genesis ROM image (SMD format): +!:mime application/x-genesis-rom >>0 use sega-genesis-smd-header #------------------------------------------------------------------------------ @@ -258,12 +277,19 @@ 0 name sega-master-system-rom-header # Machine type. >0x0F byte&0xF0 0x30 Sega Master System +!:mime application/x-sms-rom >0x0F byte&0xF0 0x40 Sega Master System +!:mime application/x-sms-rom >0x0F byte&0xF0 0x50 Sega Game Gear +!:mime application/x-gamegear-rom >0x0F byte&0xF0 0x60 Sega Game Gear +!:mime application/x-gamegear-rom >0x0F byte&0xF0 0x70 Sega Game Gear +!:mime application/x-gamegear-rom >0x0F byte&0xF0 <0x30 Sega Master System / Game Gear +!:mime application/x-sms-rom >0x0F byte&0xF0 >0x70 Sega Master System / Game Gear +!:mime application/x-sms-rom >0 byte x ROM image: # Product code. >0x0E byte&0xF0 0x10 1 @@ -323,10 +349,12 @@ # 2048-byte sector version. 0 string SEGA\ SEGASATURN\ Sega Saturn disc image +!:mime application/x-saturn-rom >0 use sega-saturn-disc-header >0 byte x (2048-byte sectors) # 2352-byte sector version. 0x10 string SEGA\ SEGASATURN\ Sega Saturn disc image +!:mime application/x-saturn-rom >0x10 use sega-saturn-disc-header >0 byte x (2352-byte sectors) @@ -347,10 +375,12 @@ # 2048-byte sector version. 0 string SEGA\ SEGAKATANA\ Sega Dreamcast disc image +!:mime application/x-dc-rom >0 use sega-dreamcast-disc-header >0 byte x (2048-byte sectors) # 2352-byte sector version. 0x10 string SEGA\ SEGAKATANA\ Sega Dreamcast disc image +!:mime application/x-dc-rom >0x10 use sega-dreamcast-disc-header >0 byte x (2352-byte sectors) @@ -366,6 +396,7 @@ # From: David Korth # 0 bequad 0x803712400000000F Nintendo 64 ROM image +!:mime application/x-n64-rom >0x20 string >\0 \b: "%.20s" >0x3B string x (%.4s >0x3F byte x \b, Rev.%02u) @@ -375,18 +406,21 @@ # Same as z64 format, but with 16-bit byteswapping. # 0 bequad 0x3780401200000F00 Nintendo 64 ROM image (V64) +!:mime application/x-n64-rom #------------------------------------------------------------------------------ # n64-swap2: file(1) magic for the swap2 format N64 ROM dumps # Same as z64 format, but with swapped 16-bit words. # 0 bequad 0x12408037000F0000 Nintendo 64 ROM image (wordswapped) +!:mime application/x-n64-rom #------------------------------------------------------------------------------ # n64-le32: file(1) magic for the 32-bit byteswapped format N64 ROM dumps # Same as z64 format, but with 32-bit byteswapping. # 0 bequad 0x401237800F000000 Nintendo 64 ROM image (32-bit byteswapped) +!:mime application/x-n64-rom #------------------------------------------------------------------------------ # gba: file(1) magic for the Nintendo Game Boy Advance raw ROM format @@ -396,6 +430,7 @@ # Updated version from: David Korth # 4 bequad 0x24FFAE51699AA221 Game Boy Advance ROM image +!:mime application/x-gba-rom >0xA0 string >\0 \b: "%.12s" >0xAC string x (%.6s >0xBC byte x \b, Rev.%02u) @@ -408,6 +443,7 @@ # Updated version from: David Korth # 0xC0 bequad 0x24FFAE51699AA221 Nintendo DS ROM image +!:mime application/x-nintendo-ds-rom >0x00 string >\0 \b: "%.12s" >0x0C string x (%.6s >0x1E byte x \b, Rev.%02u) @@ -428,6 +464,7 @@ # This is also used for loading .nds files using the MSET exploit on 3DS. # Reference: https://github.com/devkitPro/ndstool/blob/master/source/ndscreate.cpp 0xC0 bequad 0xC8604FE201708FE2 Nintendo DS Slot-2 ROM image (PassMe) +!:mime application/x-nintendo-ds-rom #------------------------------------------------------------------------------ # ngp: file(1) magic for the Neo Geo Pocket (Color) raw ROM format. @@ -437,6 +474,7 @@ # - http://www.devrs.com/ngp/files/ngpctech.txt # 0x0A string BY\ SNK\ CORPORATION Neo Geo Pocket +!:mime application/x-neo-geo-pocket-rom >0x23 byte 0x10 Color >0 byte x ROM image >0x24 string >\0 \b: "%.12s" @@ -502,8 +540,10 @@ # 8 character OMF-86 object file headers. 0 beshort 0x8008 >6 string BS93 Lynx homebrew cartridge +!:mime application/x-atari-lynx-rom >>2 beshort x \b, RAM start $%04x >6 string LYNX Lynx cartridge +!:mime application/x-atari-lynx-rom >>2 beshort x \b, RAM start $%04x # Opera file system that is used on the 3DO console @@ -630,6 +670,7 @@ # From: David Korth # Reference: http://wiibrew.org/wiki/Wii_Disc 0x1C belong 0xC2339F3D Nintendo GameCube disc image: +!:mime application/x-gamecube-rom >0 use nintendo-gcn-disc-common # Type: Nintendo GameCube embedded disc image @@ -639,6 +680,7 @@ 0 belong 0xAE0F38A2 >0x0C belong 0x00100000 >>(8.L+0x1C) belong 0xC2339F3D Nintendo GameCube embedded disc image: +!:mime application/x-gamecube-rom >>>(8.L) use nintendo-gcn-disc-common # Type: Nintendo Wii disc image @@ -652,6 +694,7 @@ # Reference: http://wiibrew.org/wiki/Wii_Disc 0 string WBFS >0x218 belong 0x5D1C9EA3 Nintendo Wii disc image (WBFS format): +!:mime application/x-wii-rom >>0x200 use nintendo-gcn-disc-common # Type: Nintendo GameCube/Wii disc image (CISO format) @@ -665,15 +708,19 @@ >4 lelong 0x200000 >>8 byte 1 >>>0x801C belong 0xC2339F3D Nintendo GameCube disc image (CISO format): +!:mime application/x-wii-rom >>>>0x8000 use nintendo-gcn-disc-common >>>0x8018 belong 0x5D1C9EA3 Nintendo Wii disc image (CISO format): +!:mime application/x-wii-rom >>>>0x8000 use nintendo-gcn-disc-common # Type: Nintendo GameCube/Wii disc image (GCZ format) # Due to zlib compression, we can't get the actual disc information. 0 lelong 0xB10BC001 >4 lelong 0 Nintendo GameCube disc image (GCZ format) +!:mime application/x-gamecube-rom >4 lelong 1 Nintendo Wii disc image (GCZ format) +!:mime application/x-wii-rom >4 lelong >1 Nintendo GameCube/Wii disc image (GCZ format) # Type: Nintendo GameCube/Wii disc image (WDF format) @@ -681,21 +728,27 @@ >8 belong 1 # WDFv1 >>0x54 belong 0xC2339F3D Nintendo GameCube disc image (WDFv1 format): +!:mime application/x-gamecube-rom >>>0x38 use nintendo-gcn-disc-common >>0x58 belong 0x5D1C9EA3 Nintendo Wii disc image (WDFv1 format): +!:mime application/x-wii-rom >>>0x38 use nintendo-gcn-disc-common >8 belong 2 # WDFv2 >>(12.L+0x1C) belong 0xC2339F3D Nintendo GameCube disc image (WDFv2 format): +!:mime application/x-gamecube-rom >>>(12.L) use nintendo-gcn-disc-common >>(12.L+0x18) belong 0x5D1C9EA3 Nintendo Wii disc image (WDFv2 format): +!:mime application/x-wii-rom >>>(12.L) use nintendo-gcn-disc-common # Type: Nintendo GameCube/Wii disc image (WIA format) 0 string WIA\001 Nintendo >0x48 belong 0 GameCube/Wii >0x48 belong 1 GameCube +!:mime application/x-gamecube-rom >0x48 belong 2 Wii +!:mime application/x-wii-rom >0x48 belong >2 GameCube/Wii >0x48 belong x disc image (WIA format): >>0x58 use nintendo-gcn-disc-common @@ -816,6 +869,7 @@ 0 byte >0 >0 byte <3 >>1 string ATARI7800 Atari 7800 ROM image +!:mime application/x-atari-7800-rom >>>0x11 string >\0 \b: "%.32s" # Display type. >>>0x39 byte 0 (NTSC) -- 2.40.0