Skip to content

[pull] master from GerbilSoft:master#259

Merged
pull[bot] merged 14 commits into
bazzite-org:masterfrom
GerbilSoft:master
Jul 11, 2026
Merged

[pull] master from GerbilSoft:master#259
pull[bot] merged 14 commits into
bazzite-org:masterfrom
GerbilSoft:master

Conversation

@pull

@pull pull Bot commented Jul 11, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

There's two types: one for DSi, and one for 3DS.

- DSi NTRBOOT has more fields set in the headers.
- 3DS NTRBOOT only has a few fields.

- DSi NTRBOOT has some payload that I haven't figured out yet.
- 3DS NTRBOOT has a FIRM payload at 0x7E00. It's encrypted using
  the NTRBOOT key, which is currently incorrectly listed as the
  SPI boot key.

TODO:
- Use Nintendo3DSFirm to show more information about the FIRM payload.
  Will need to decrypt it.
- Add support for NTRBOOT from WLAN firmware (SPIBOOT?).
- Improve the heuristics for detection, since the bootroms don't
  actually need most of these fields.

nds_structs.h: Add NDS_CodeInfo_t, DSi_CodeInfo_t, and constants
for the card control fields. Also add more offset comments.

Thanks to F3l1x_10m for providing test files for the NTRBOOT
implementation.
… NTR boot; add the actual SPI boot keys.

SPI boot is specifically referring to booting from the WLAN firmware,
which isn't usually done.
…to NtrBoot; add the actual SpiBoot keys.

All four are conveniently located in the same 64-byte block at
0x5720 in the protected section of boot9.
Needed in order for KDE to detect .bin files as NTRBOOT.
Add the fields from Nintendo3DSFirm in a new FIRM tab.

Nintendo3DSFirm: Add a constructor taking a storage type:
- NAND FIRM is unencrypted.
- NTR FIRM is encrypted, with one set of keys.
- SPI FIRM is encrypted, with a different set of keys.

The keys are different for NTR/SPI and retail/debug. I'm not sure if
there's an easy way to tell if a given FIRM is retail or debug, so
we'll have to use heuristics. (NTR vs SPI can be determined based
on the container format; anything handled by NintendoDS is NTR.)

TODO: Decrypt the FIRM binary for NTR and SPI.
…ge isNew3DS to Flags.

Five flags are currently defined:
- FLAG_New3DS
- FLAG_Devel
- FLAG_SafeMode
- FLAG_TWL_FIRM
- FLAG_AGB_FIRM

TODO: Add more SAFE_MODE FIRM, and then add devkit, TWL, and AGB
firmware binaries.

Nintendo3DSFirm: Handle the New3DS flag change, and also add TWL and
AGB flag handling, even though they're not used yet.
…loading into a separate function, d->loadFirmBin().

This function will eventually support decrypting the FIRM binary if e.g.
an NTRBOOT or SPIBOOT image is loaded. For now, it works the same as
before, though the FIRM header is *not* included in firmBuf anymore.

The CRC32s still include the FIRM header, so the FIRM header has to be
CRC'd first, followed by the rest of the FIRM binary.
…ad of unitcode.

Unitcode is usually 0 for DSi NTRBOOT, so this asserted on DSi NTRBOOT
ROM images.

NOTE: The title ID is usually all zero for DSi NTRBOOT ROMs, so maybe
we shouldn't show it (or various other fields...).
…FIRM images.

TODO:
- Add an NCCH tab for NCCH FIRMs.
- Add heuristics for prod vs. devel.
…ighaxed signature is found.

This works for homebrew, at least.

TODO: For non-sighaxed signatures, validate it using the prod and devel
public keys to determine if it's retail or debug.
@pull pull Bot locked and limited conversation to collaborators Jul 11, 2026
@pull pull Bot added the ⤵️ pull label Jul 11, 2026
@pull pull Bot merged commit 7f61b1b into bazzite-org:master Jul 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant