Skip to content

Setting NoCrypto NCCH flag causes ROMs to fail to load #1827

Open
@Popax21

Description

@Popax21

Recently, I've been toying around with getting a console running Luma3DS to play custom CCI / .3ds cartridge ROMs using a Sky3DS+ flash cart (mostly just for the fun of it). I've been successful in getting the flash cart to pick up these ROMs as valid by reencrypting their title keys (using this script I wrote, alternatively using the -target p option for makerom works as well). This results in gm9 picking up and validating the files just fine, however they do not show up in the home menu when the flashcart is inserted.

Here's the output of ctrtool -y -q <file> for both the original CIA of Super Mario 3D land I dumped using gm9, and the converted .3ds file created using makerom -ciatocci <CIA file> -o <3ds file> and my own script (note that I have tried all three makerom -target options, and none of them work):

  • CIA file:
[ctrtool::CiaProcess ERROR] Signature for Ticket was invalid.
[ctrtool::CiaProcess ERROR] Signature for TitleMetaData was invalid.
[ctrtool::NcchProcess ERROR] Signature for NcchHeader was invalid.
  • 3ds file:
[ctrtool::CciProcess ERROR] Signature for NcsdCommonHeader was invalid.
[ctrtool::NcchProcess ERROR] Signature for NcchHeader was invalid.

Note that the only other invalid signature in the .3ds file is the one in the NCSD header (the NCCH header signature is invalid in both the CIA and CCI, and its check is, to my knowledge, patched by Luma3DS anyway). This leads me to the conclusion that Luma3DS currently does not patch these NCSD signature checks. I also checked the source code, and also could not find these patches (maybe they exist and I just missed them though). Additionally, I tried to verify this theory by signing a CCI file's header with developer keys (using makerom -target d ...), and setting my console's UNITINFO to be that of a developer unit, but this also failed - I believe this to be the case because the patched UNITINFO only affects the arm11 side (according to the docs), while to my knowledge signature checks reside on the arm9 side.

Note that I have at least a bit of experience when it comes to reverse engineering, however I have no experience specifically reverse engineering 3DS firmware. If someone could give me some pointers on how to get started with this / where to look first, I would be willing to help find / write a patch for the relevant check(s).

PS: I am aware that flashcards like the Sky3DS+ are made completely obsolete by CFW like Luma3DS, and that using such patched ROMs on unmodified systems will never work. However, I've started work on this project more for the technical challenge than the practicality, and I still believe that patching these header checks would at least not hurt anyone, assuming the effort to find/patch them isn't too high.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions