DS-Homebrew / TWiLightMenu

DSi Menu replacement for DS/DSi/3DS/2DS
https://wiki.ds-homebrew.com/twilightmenu/
GNU General Public License v3.0
3.3k stars 205 forks source link

Detect SEGA MegaDrive ROM images through TMSS header #1992

Closed tomrow closed 4 months ago

tomrow commented 2 years ago

It may be possible to exploit the header of a MegaDrive ROM to tell it apart from other filetypes with similar extensions (.BIN, .MD) The MegaDrive has a licensing enforcement program (TradeMark Security System) that bootstraps the game, much like the Game Boy, where a check is made for a 32-bit word "SEGA" at location 0x100 or 0x101 of the ROM. Most commercially released, licensed games except for 11 that were released before TMSS was implemented are compliant. It would be great if TWLMenu++ could use this to detect a ROM where using the extension would otherwise be impossible.

Info: https://segaretro.org/TradeMark_Security_System

NightScript370 commented 2 years ago

If I understand this writing correctly, then the way you are suggesting we implement this license enforcement program is as follows:

Personally, I'd also suggest implementing it for .gen too, with the difference being that the ROM is still shown but with a little warning message (that could be bypassed for legit roms) for ROMs that do not comply with TMSS (instead of not showing the ROM at all, like for MD/BIN)

Two questions I have on this entire idea, though:

  1. I'm not an expert on file formats and such, but could a false positive be shown for legit markdown files?
  2. Wouldn't it be easier to just rename everything to the .gen file format, for the sake of being able to uniquely identify everything?
Masamune3210 commented 2 years ago

You would have to try pretty specifically to have the string SEGA show up in that specific place in a file, as for implementing it for all with the warning, that sounds cool as long as a the few games that came out before TMSS was implemented are ignored or something as to keep issue reports down for those games

bootmii commented 4 months ago

Ishido is an Accolade game from before TMSS was implemented, let alone defeated in court. As such, its entry point is 00 00 02 00 and it does not have the SEGA string at 0x100.

RocketRobz commented 4 months ago

I forgot about this issue. It's already been implemented some versions ago, with the added support of .md files.