1
0
Fork 0
mirror of https://github.com/DarkMatterCore/nxdumptool.git synced 2024-11-26 04:02:11 +00:00
nxdumptool/include/core
Pablo Curiel 9c7a57e028 title: init gc title storage by HFS as fallback
Makes it possible to generate TitleInfo and TitleApplicationMetadata elements for gamecards that can't be used with ncm (e.g. Kiosk / Quest gamecards under retail, non-Quest units). This is achieved by:

1. Retrieving a Hash FS context for the gamecard's secure partition.
2. Initializing NCA and CNMT contexts for all of the Meta NCAs within the secure partition.
3. Manually generating NcmContentMetaKey and NcmContentInfo elements per each CNMT context.
4. Creating TitleInfo elements using the generated NcmContentMetaKey and NcmContentInfo elements.
5. Initializing NCA and NACP contexts for the base (or update) Control NCAs within the secure partition.
6. Manually generating a NsApplicationControlData element per each NACP context.
7. Creating TitleApplicationMetadata elements using the generated NsApplicationControlData elements.

Afterwards, gamecard title/content enumeration and all other features that rely on it (e.g. NSP, NCA, NCA FS) work as expected. Please note that this process is only carried out if regular title storage initialization fails.

Other changes include:

* title: reorder code.
* title: add TitleGameCardContentMetaContext struct.
* title: rename titleGetInfoFromStorageByTitleId() -> titleGetTitleInfoEntryFromStorageByTitleId().
* title: add titleInitializeGameCardTitleStorageByHashFileSystem().
* title: rename titleGenerateDummySystemMetadataEntry() -> titleGetSystemMetadataEntry().
* title: rename titleRetrieveUserApplicationMetadataByTitleId() -> titleGenerateUserMetadataEntryFromNs().
* title: move ns logic from titleRetrieveUserApplicationMetadataByTitleId() into a new function: titleGetApplicationControlDataFromNs().
* title: add titleGenerateUserMetadataEntryFromControlNca().
* title: add titleGetApplicationControlDataFromControlNca().
* title: add titleInitializeUserMetadataEntryFromControlData().
* title: add titleGenerateTitleInfoEntriesByHashFileSystemForGameCardTitleStorage().
* title: move TitleInfo generation logic from titleGenerateTitleInfoEntriesForTitleStorage() into a new function: titleGenerateTitleInfoEntry().
* title: add titleInitializeTitleInfoApplicationMetadataFromControlNca().
* title: add titleGetGameCardContentMetaContexts().
* title: add titleFreeGameCardContentMetaContexts().
* title: add titleGetContentInfosByGameCardContentMetaContext().
* title: rename _titleGetInfoFromStorageByTitleId() -> _titleGetTitleInfoEntryFromStorageByTitleId().
* title: rename titleSystemTitleMetadataEntrySortFunction() -> titleSystemMetadataSortFunction().
* title: rename titleUserApplicationMetadataEntrySortFunction() -> titleUserMetadataSortFunction().
* title: rename titleInfoEntrySortFunction() -> titleInfoSortFunction().
* title: add titleGameCardContentMetaContextSortFunction().

* codebase: update to reflect the rest of the changes.
2024-08-18 15:29:57 +02:00
..
devoptab Improve directory layout while we still can. 2024-04-30 23:01:42 +02:00
fatfs Improve directory layout while we still can. 2024-04-30 23:01:42 +02:00
aes.h [skip ci] Update copyright year. 2024-04-12 11:49:03 +02:00
bfttf.h [skip ci] Update copyright year. 2024-04-12 11:49:03 +02:00
bktr.h [skip ci] Update copyright year. 2024-04-12 11:49:03 +02:00
cert.h [skip ci] Update copyright year. 2024-04-12 11:49:03 +02:00
cnmt.h [skip ci] Update copyright year. 2024-04-12 11:49:03 +02:00
config.h Remove all references to NSWDB. 2024-05-02 15:38:39 +02:00
elf_symbol.h [skip ci] Update copyright year. 2024-04-12 11:49:03 +02:00
es.h [skip ci] Update copyright year. 2024-04-12 11:49:03 +02:00
fs_ext.h Some updates 2024-08-06 22:57:54 +02:00
gamecard.h nca: fix impl issues in ncaInitializeContextCommon() 2024-08-12 12:10:34 +02:00
hfs.h [skip ci] Update copyright year. 2024-04-12 11:49:03 +02:00
hos_version_structs.h Improve directory layout while we still can. 2024-04-30 23:01:42 +02:00
http.h [skip ci] Update copyright year. 2024-04-12 11:49:03 +02:00
key_sources.h [skip ci] Update copyright year. 2024-04-12 11:49:03 +02:00
keys.h [skip ci] Update copyright year. 2024-04-12 11:49:03 +02:00
legal_info.h [skip ci] Update copyright year. 2024-04-12 11:49:03 +02:00
lz4.h Some updates 2024-08-06 22:57:54 +02:00
mem.h nso: update read logic 2024-08-08 12:27:54 +02:00
nacp.h [skip ci] Update copyright year. 2024-04-12 11:49:03 +02:00
nca.h nca: add ncaInitializeContextByHashFileSystemEntry 2024-08-11 20:15:45 +02:00
nca_storage.h [skip ci] Update copyright year. 2024-04-12 11:49:03 +02:00
npdm.h Some updates 2024-08-06 22:57:54 +02:00
nso.h nso: update read logic 2024-08-08 12:27:54 +02:00
nxdt_bfsar.h [skip ci] Update copyright year. 2024-04-12 11:49:03 +02:00
nxdt_includes.h Improve directory layout while we still can. 2024-04-30 23:01:42 +02:00
nxdt_json.h [skip ci] Update copyright year. 2024-04-12 11:49:03 +02:00
nxdt_log.h FileWriter: remove call to ftruncate() 2024-05-03 15:14:32 +02:00
nxdt_utils.h utils: report IsT flag at startup 2024-05-26 13:31:43 +02:00
pfs.h [skip ci] Update copyright year. 2024-04-12 11:49:03 +02:00
program_info.h [skip ci] Update copyright year. 2024-04-12 11:49:03 +02:00
romfs.h [skip ci] Update copyright year. 2024-04-12 11:49:03 +02:00
rsa.h [skip ci] Update copyright year. 2024-04-12 11:49:03 +02:00
save.h [skip ci] Update copyright year. 2024-04-12 11:49:03 +02:00
service_guard.h [skip ci] Update copyright year. 2024-04-12 11:49:03 +02:00
services.h [skip ci] Update copyright year. 2024-04-12 11:49:03 +02:00
sha3.h [skip ci] Update copyright year. 2024-04-12 11:49:03 +02:00
signature.h [skip ci] Update copyright year. 2024-04-12 11:49:03 +02:00
smc.h [skip ci] Update copyright year. 2024-04-12 11:49:03 +02:00
tik.h [skip ci] Update copyright year. 2024-04-12 11:49:03 +02:00
title.h title: init gc title storage by HFS as fallback 2024-08-18 15:29:57 +02:00
ums.h Add DataTransferTaskFrame and GameCardImageDumpTaskFrame classes 2024-04-29 15:26:12 +02:00
usb.h [ci skip] Add GameCardImageDumpTask and FileWriter classes 2024-04-25 01:49:04 +02:00