* aes: add aes128EcbCrypt() as a one-shot function to perform AES-128-ECB crypto. The rest of the codebase now calls this function whenever suitable.
* fs_ext: add const keyword to IPC input structs wherever suitable.
* key_sources: add hardcoded master key vectors (prod, dev); master KEK sources (Erista, Mariko); master key source; ticket common key source; SMC key type sources; SMC seal key masks; AES key generation source; NCA header KEK source; NCA header key source and NCA KAEK sources. Also fixed the hardcoded gamecard CardInfo key source for dev units (it was previously generated using retail keydata, my bad).
* keys: remove keysGetNcaMainSignatureModulus(); remove keysDecryptNcaKeyAreaEntry(); repurpose keyset struct to only hold keys that can actually be used for the current hardware type; remove KeysGameCardKeyset; remove keysIsXXModulusYYMandatory() helpers; remove keysRetrieveKeysFromProgramMemory(); remove keysDeriveSealedNcaKeyAreaEncryptionKeys(); add keysDeriveMasterKeys() and keysDerivePerGenerationKeys(); rename keysDeriveGameCardKeys() -> keysDeriveGcCardInfoKey(); add small reimplementations of GenerateAesKek, LoadAesKey and GenerateAesKey; add keysLoadAesKeyFromAesKek() and keysGenerateAesKeyFromAesKek() wrappers. Furthermore, master key derivation is now carried out manually using hardcoded key sources and the last known master key, which is loaded from the Lockpick_RCM keys file -- if the last known master key is unavailable, the key derivation algorithm will then fallback to TSEC root key / Mariko KEK based key derivation, depending on the hardware type.
* nca: add hardcoded NCA man signature moduli (prod, dev); merge ncaDecryptKeyArea() and ncaEncryptKeyArea() into ncaKeyAreaCrypt().
* nxdt_utils: add utilsIsMarikoUnit(); remove _utilsAppletModeCheck(); rename utilsAppletModeCheck() -> utilsIsAppletMode().
* services: remove spl:mig dependency (yay).
* smc: add SmcKeyType enum; add SmcSealKey enum; add SmcGenerateAesKekOption struct; add smcPrepareGenerateAesKekOption().
* Update libusbhsfs.
* Update borealis.
* nsp_dumper: force free size retrieval after dumping an NSP.
* title: add titleGetGameCardApplicationMetadataEntries().
* Makefile: remove -gdwarf-4 flag.
* nxdt_utils: treat NT_MAX_FILENAME_LENGTH as bytes instead of codepoints, add "TiB" to the array of supported size suffixes.
* GameCardTab: add ProcessGameCardStatus() and PopulateList(), manage list updates in the same fashion as TitlesTab, display message about how to mitigate launch errors after exiting the application, display available applications in the inserted gamecard, display message about how to perform individual operations on the gamecard titles.
* main: add a try/catch block to intercept any possible exceptions thrown while the application is running + use brls::Application::crash() to gracefully exit afterwards. Temporarily disable Applet Mode support.
* exception_handler: use LOG_LEVEL_ERROR.
* LayeredErrorFrame: add GetListFirstFocusableChild().
The exception handler is capable of logging CPU registers and a stack trace using the current log implementation.
Furthermore, if borealis has been initialized, it'll also display the PC register value using a CrashFrame. Otherwise, console output is used to display the same message.
Other changes include:
* utils: made utilsPrintConsoleError non-static.
* utils: implemented a workaround to restore console output after initializing nxlink.
Other changes include:
* defines: added NON_MOVEABLE macro.
* AsyncTask: set class as non-moveable, too.
* RootView: provide an override for getDefaultFocus().
* StatusInfoTask: replace GetStatusInfoData with IsInternetConnectionAvailable().
* Tasks are now immediately started by their constructor function.
* Events are now part of the class of each task type, in order to avoid instantiating each one of them and passing them as a constructor argument.
* GetTaskEvent() has been added to each task class, which returns a pointer to the private event. This will be used to subscribe Borealis views to a particular event.
* Title and UMS tasks now both cache application metadata and UMS device info using private vectors. Pointers to these private vectors can now be retrieved using public functions GetApplicationMetadata() and GetUmsDevices(), respectively.
* core: implemented SCOPED_TRY_LOCK macro. Specific functions are now using it instead of SCOPED_LOCK to avoid potentially locking the Borealis UI.
* UI: implemented background tasks for Borealis, which call functions that now use SCOPED_TRY_LOCK.
* Rewrote mutex handling throughout the code to use a small, macro-based scoped lock implementation.
* Removed extern variables from common.h - launch path management is now completely handled in utils.c.
* Updated NpdmSystemCallId_Count to reflect changes introduced in 12.0.0.
* Added NcaMainSignatureKeyGeneration enum.
* NCA main signature moduli are now retrieved from FS .rodata at runtime.
* Simplified lock management in usb.c by using a single global mutex with scoped locks instead of three different r/w locks.
* Updated FatFs to R0.14b.
* Enabled 64-bit LBA support in FatFs to potentially support custom eMMC replacements / resized USER partitions in the future.
* Updated LZ4 to v1.9.3.
* Fixed typos.
* USB gamecard dumper PoC now only dumps the Initial Data area.
* Updated to-do list.
These files will be modified to slowly add features from the nxdumptool rewrite codebase.
This commit effectively makes it impossible to build the previous PoC. The code from each PoC will be reused, though, so it hasn't been removed.