d0k3 / GodMode9

GodMode9 Explorer - A full access file browser for the Nintendo 3DS console :godmode:
GNU General Public License v3.0
2.12k stars 191 forks source link

[FEATURE REQUEST] System Update on CTR (Old 3DS) dev units #753

Open GerbilSoft opened 2 years ago

GerbilSoft commented 2 years ago

Officially, Nintendo only supports using CTR cards to run system updaters on Old 3DS development units. This makes it impossible to do a system update and/or region change if you don't have both an official CTR flash cart and a device that can write to one, e.g. a Partner-CTR Debugger.

It's possible to extract the CIAs from a CSU system update file manually, and based on this, it should be possible for GM9 to extract and install the CIAs using its virtual filesystem.

Mounting a System Update CSU presents an NCCH section called content0.game.app. This NCCH section, when mounted, has two important files in /romfs/contents:

An extraction utility for Contents.cnt can be found here: https://github.com/toiry921/CupTheCnt This utility can be better integrated into GM9 to provide e.g. a virtual CIA drive for the Contents.cnt+CupList files.

NOTE: GM9 seems to only support mounting the CSU/CCI and NCCH as G:, which makes it impossible to mount an NCCH section within a CSU. This can probably be worked around somehow.

The upgrade procedure is as follows:

  1. Install all of the CIAs as listed in CupList.
  2. Update the FIRM partition. (Start+Y in DevMenu)

The official System Updater also supports region changing. I'm not entirely sure what's involved with this, but I do have a saved NAND image from 0.24.67 EUR and 0.24.68 USA, so I will compare to the two and see what's changed.

I suspect region changing does the following:

  1. Remove all out-of-region CIAs from NAND. (There may be a hard-coded list; I'm not sure.)
  2. Change a region value somewhere.
  3. System format.
GerbilSoft commented 2 years ago

Some notes from diffing the two NANDs:

d0k3 commented 2 years ago

This sounds like it may make sense, I'll look into it!