Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firmware version not detected for latest firmwares #73

Closed
eliboa opened this issue Jan 27, 2022 · 0 comments
Closed

Firmware version not detected for latest firmwares #73

eliboa opened this issue Jan 27, 2022 · 0 comments
Labels
enhancement New feature or request WIP Work in progress

Comments

@eliboa
Copy link
Owner

eliboa commented Jan 27, 2022

Actually that's not an issue. NxNandManager must be updated to detect new firmware versions.

How it works now

A firmware package contains a specifc title (program): 0100000000000809 (SystemVersion). Materially, this program is binary data stored inside a NCA file (Nintendo Content Archive) whose filename is different for each firmware version.
For example:

  • fce3b0ea366f9c95fe6498b69274b0e7.nca = SystemVersion title for FW 5.1.0
  • 5625cdc21d5f1ca52f6c36ba261505b9.nca = SystemVersion title for FW 10.0.0
  • etc.

A static array in source code, manually updated, references each NCA filename and corresponding version.
When the suitable bis key is provided, NxNandManager will scan the content of SYSTEM:/Contents/registered. If a *.nca file inside this folder matches an entry in the array, you get your firmware version. Simple as that.

How to get the new NCA filename each time the firmware is updated ?

A firmware package is just a bunch of NCAs. All theses files are fully encrypted.
With the right keys, you can decrypt NCA header (first 0xC00 bytes) where the program Id (title Id) is stored. If the program Id is 0100000000000809, you know this is "SystemVersion".

So every time a firmware package is released, with a program like hactool, you can get the SystemVersion's filename by inspecting the package.

What's the problem?

  1. Someone has to decrypt and inspect the content of the firmware package every time a new one is released.
  2. Someone has to update NxNandManager's code (static array).
  3. Someone has to build & release a new version.
  4. End user has to download latest version of NxNM

Solutions

A) Implement NCA header decryption

  • Resolves problem 1, 2, 3 & 4.
  • For end user, this would require importing new keys.

B) Request a remote DB to get the latest nca filenames instead of a static array

  • Resolves problem 2, 3, & 4.
  • Quick win, easy to implement but you still need someone or some algorithm to update the DB.

C) ???

WIP

Solution B. Will only work with Qt (GUI version).

Remote DB ✔️ https://eliboa.com/switch/nca.php
DB request implementation ✔️
Quality tests 🚧

@eliboa eliboa added enhancement New feature or request WIP Work in progress labels Jan 27, 2022
@eliboa eliboa pinned this issue Jan 27, 2022
eliboa referenced this issue Jan 28, 2022
- Removed: detection from journal & play report (doesn't work well for downgraded NAND)
- Added: from GUI, will retry fw detection whith updated nca DB (from eliboa.com) when fw isn't detected in NxStorage init
Repository owner locked and limited conversation to collaborators Jan 28, 2022
@eliboa eliboa converted this issue into discussion #75 Jan 28, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
enhancement New feature or request WIP Work in progress
Projects
None yet
Development

No branches or pull requests

1 participant