1
0
Fork 0
mirror of https://github.com/DarkMatterCore/nxdumptool.git synced 2024-11-10 04:31:44 +00:00
Commit graph

32 commits

Author SHA1 Message Date
Pablo Curiel
c6c5667bf0 Change project layout + upgrade license to GPLv3. 2021-03-25 15:26:58 -04:00
Pablo Curiel
3cb6ef93aa Some changes.
* Placed C++ extern "C" blocks inside include guards.

* Added a "clean_all" rule to the Makefile to avoid recompiling libusbhsfs after each time "clean" is used.

* Added static asserts for all structs that may need it throughout the code.

* Preprocessor macros are now used to generate certificate and ticket structs.
2021-03-24 13:25:19 -04:00
MasaGratoR
e0949bba6b
Fix linkage for C++ projects (#79) 2021-03-23 10:06:52 -04:00
Pablo Curiel
0ec60092df Keep indexes and counters for all supported storage IDs.
Speeds up title lookups using a specific storage ID.

Also reworked a bit the way orphan titles are handled. Should be better now.
2021-03-10 09:10:43 -04:00
Pablo Curiel
34c15d92cc Update title.h
I was sleepy.
2021-03-09 21:15:40 -04:00
Pablo Curiel
a01b7846de title: use dynamic pointer arrays.
* Added functions to deal with title info and application metadata reallocations, greatly reducing the number of references to realloc() throughout the code.

* Tweaked gamecardGetHashFileSystemContext() to not return a pointer to a dynamic context.

* Added a type field to Hash FS contexts.
2021-03-09 21:12:01 -04:00
Pablo Curiel
a90d8f2074 Title handler changes.
* Renamed titleRetrieveContentMetaKeysFromDatabase() to titleGenerateTitleInfoFromStorage().

* Moved linked lists generation from titleRetrieveContentMetaKeysFromDatabase() into its own function: titleUpdateTitleInfoLinkedLists().

* Adjusted orphan title checks. It is now explicitly verified if application metadata is available before treating a title as orphan, instead of checking if the parent user application is available.

* Code cleanup in titleRefreshGameCardTitleInfo().

* titleRefreshGameCardTitleInfo() now attempts to update the application metadata pointer in orphan title entries if new application metadata was retrieved after a gamecard was inserted *and* if the orphan title count is currently non-zero.

* Updated titleRemoveGameCardTitleInfoEntries() to make it use titleUpdateTitleInfoLinkedLists().
2021-02-22 17:30:47 -04:00
Pablo Curiel
88793eceea Populate app_metadata pointer in TitleInfo elements that aren't system titles or user applications. 2021-01-31 05:16:05 -04:00
Pablo Curiel
6f43764e1b Improved UMS interface. 2020-12-23 14:43:12 -04:00
Pablo Curiel
fbd250a417 Update copyright years. 2020-12-23 13:48:57 -04:00
Pablo Curiel
57162b5634 CNMT: fixed support for patches. 2020-10-28 00:30:13 -04:00
Pablo Curiel
278afbabfa Title handler bugfixes.
* Fixed possible invalid memory accesses using TitleInfo pointers from gamecard titles if the gamecard they belong to is taken out.
* Fixed invalid for loop condition in _titleGetInfoFromStorageByTitleId() if no gamecard titles have been retrieved.
2020-10-27 17:23:19 -04:00
Pablo Curiel
c44b9c998e Add endpoint max packet size field to the UsbStatus response block.
And fix typos. lol
2020-10-25 11:42:53 -04:00
Pablo Curiel
15431ec2c8 Many changes.
* AES: moved CTR initializing/updating functions here from nca.c.
* BKTR/RomFS/PFS: check if we're dealing with a NCA with titlekey crypto and the titlekey hasn't been retrieved.
* BFTTF: use void pointers for output font data.
* Mem: Only exclude Unmapped/Uo/ThreadLocal/Reserved memory pages if dealing with FS.
* NCA: use content type context pointers inside NCA contexts to manage ContentMeta, ProgramInfo, Nacp and LegalInfo contexts.
* NCA: added 'written' bool elements to patch structs to indicate patch write completion.
* NPDM: remove unnecessary inline functions, generate PFS patch right after changing ACID data, add a pfsWriteEntryPatchToMemoryBuffer wrapper.
* PFS: added PartitionFileSystemFileContext and related functions to deal with NSP headers.
* ProgramInfo: removed unnecessary inline functions.
* Save: added commented code to dump a full system savefile - will probably use it down the road.
* Tik: added support for volatile tickets (thanks to @shchmue and @Whovian9369!), added a rights ID string representation to the Ticket struct, clear Volatile and ELicenseRequired flags in conversions to common tickets.
* Title: added a function to calculate the number of titles (current + siblings) from a TItleInfo block.
* Utils: added a function to generate a dynamically allocated path string using a prefix, a filename and a extension.
* Removed explicit offset checks throughout all the code.
* Codestyle fixes.
* Updated to-do.
2020-10-21 00:27:48 -04:00
Pablo Curiel
5b22fe07f2 More code cleanup. 2020-10-14 14:58:33 -04:00
Pablo Curiel
1c15a096b5 Codestyle fixes + prepare code for NPDM support. 2020-10-08 14:31:09 -04:00
Pablo Curiel
e943e84380 Unified XML generator + finished NACP parsing.
Big thanks to 0Liam.
2020-10-06 11:41:26 -04:00
Pablo Curiel
d385d40862 NACP parsing (part 1).
God, I'm so tired. I'll go play some good old MGS3 and continue this stuff at a later time. It builds, though.
2020-10-03 13:09:29 -04:00
Pablo Curiel
98b7a309b3 CNMT AuthoringTool-like XML generation. 2020-10-02 05:53:58 -04:00
Pablo Curiel
b806c2e7d0 Support multi-program titles in the RomFS dumper. 2020-09-19 02:59:31 -04:00
Pablo Curiel
ace4732fda Functions to generate gamecard/title filenames + fix CRC32 calculation.
Updated the threaded gamecard dumper to reflect these changes.
2020-08-13 22:31:02 -04:00
Pablo Curiel
90c6d8a9f8 Use linked lists to deal with user applications available in multiple storages at the same time. 2020-08-13 14:12:33 -04:00
Pablo Curiel
b11df5e732 Remove unnecessary line breaks. 2020-07-30 18:42:53 -04:00
Pablo Curiel
3f837cef05 Simple functions to deal with orphan titles...
... No way to avoid them, I guess.
2020-07-30 18:37:45 -04:00
Pablo Curiel
bb8cba1eaa Threaded gamecard title info/metadata retrieval. 2020-07-30 17:43:50 -04:00
Pablo Curiel
7c4e7a4db0 New test app: system title NCA section dumper. 2020-07-29 17:02:21 -04:00
Pablo Curiel
5320260b4e Better names for TITLE_* defines. 2020-07-28 02:20:19 -04:00
Pablo Curiel
98f3f85a31 Bunch of title related changes.
* Improved patch and add-on content title ID verification against a base application title ID.
* Implemented linked lists in TitleInfo structs, which make it easier to deal with multiple patches / add-on contents belonging to the same application.
* TitleApplicationMetadata elements are retrieved with titleGetApplicationMetadataEntries() and used by the UI to display title entries. An 'is_system' filter argument is used to determine which kind of metadata should be retrieved. These are ordered by ID (system titles) or alphabetically (user applications) using qsort().
* Added TitleUserApplicationData struct, which is populated when an user application is selected.
* Tweaked titleRefreshGameCardTitleInfo() behaviour a little bit. Now returns true whenever there are title info changes, so the UI can reload the list.
* Temporarily commented out title info logging from titleInitialize().
* Fixed decrypted key retrieval from the NCA key area for patches with titlekey crypto removed.
* Implemented a very small menu to select a title to dump.
2020-07-27 23:32:08 -04:00
Pablo Curiel
62366327ee Reduce memory footprint + hardcode system title names.
Also increased the USB timeout again, since 1 second seems to be too low for gamecard transfers.

Big thanks to Whovian for helping me format that long system title list.
2020-07-26 04:00:54 -04:00
Pablo Curiel
158e424b96 List content infos as part of title list entries.
Finally got rid of location resolver stuff.
2020-07-26 00:57:12 -04:00
Pablo Curiel
2521ac3f15 List titles from the inserted gamecard. 2020-07-25 14:50:42 -04:00
Pablo Curiel
e4a6e0e77a Begin work on title listing stuff. 2020-07-25 01:56:35 -04:00