Commit Graph

581 Commits

Author SHA1 Message Date
Pablo Curiel 4af144486a gamecard: add support for Header2-related areas
These changes include:

* gamecard: add GAMECARD_HEADER2_OFFSET and GAMECARD_HEADER2_CERT_OFFSET macros.
* gamecard: rename GAMECARD_CERTIFICATE_OFFSET macro to GAMECARD_CERT_OFFSET.
* gamecard: add GameCardFlags2 enum.
* gamecard: update GameCardHeader struct to reflect the new Flags2 field.
* gamecard: add GameCardHeader2, GameCardHeader2EncryptedData and GameCardHeader2Certificate structs.
* gamecard: update gamecardReadHeader() to check if the `Has10Certificate` flag is set in the gamecard header. If it is, the function will read and log both Header2 and Header2Certificate areas, and it will also attempt to verify the RSA signature from the Header2 area.
* gamecard: if a Header2 area is detected, an error will always be triggered for the time being. If anyone comes across this error, please get in touch me.

* gamecard, fs_ext: fix signature field comments.
2024-04-19 15:58:16 +02:00
Pablo Curiel 6dfbb301df [ci skip] Remove void keyword from C++ ctors/dtors 2024-04-19 12:08:44 +02:00
Pablo Curiel de71768380 [ci skip] Improve UI element spacing 2024-04-18 22:20:45 +02:00
Pablo Curiel 17e0edb61c [ci skip] OptionsTab: add option to unmount UMS devices
Uses a SelectListItem element with displayValue set to false to avoid displaying a value string. Furthermore, the default click event callback is replaced to check if any UMS devices are mounted before attempting to display the dropdown menu.

Other changes include:

* UmsTask: define UmsDeviceVectorEntry.
* UmsTask: redefine UmsDeviceVector as a UmsDeviceVectorEntry vector.
* UmsTask: migrate UMS device string generation logic from DumpOptionsFrame::UpdateStorages() to UmsTask::PopulateUmsDeviceVector().

* DumpOptionsFrame: simplify UpdateStorages() to reflect the changes made to UmsTask.
2024-04-18 21:58:47 +02:00
Pablo Curiel 7d7f2d58a8 [ci skip] UI code quality improvements
* Always use value references for periodic Borealis tasks.
* Always use nullptr instead of NULL in C++ headers and modules (except when dealing with functions with C name mangling).
* Update StatusInfoData to use a char array for the IP address instead of directly using the pointer returned by inet_ntoa().
2024-04-18 10:46:29 +02:00
Pablo Curiel bd5fea1fb7 [ci skip] DumpOptionsFrame: use SelectListItem::updateValues method 2024-04-17 21:32:18 +02:00
Pablo Curiel 65b86393c2 Update build.sh 2024-04-15 15:17:47 +02:00
Pablo Curiel 101ae0a361 Update build.sh 2024-04-15 14:47:48 +02:00
Pablo Curiel 87daaf6a40 Silly permissions 2024-04-15 14:43:00 +02:00
Pablo Curiel bfe301ad25 Workflow improvements.
Based on the suggestions mentioned by @TSRBerry in #144.

Speeds up compilation time by using ccache + fallbacks to the latest libnx commit if the build process fails with the libnx build available in the devkitPro image.
2024-04-15 14:30:48 +02:00
Pablo Curiel 27465434d4 [ci skip] GamecardTab: fix transition to DumpOptionsFrame view 2024-04-15 13:47:50 +02:00
Pablo Curiel 9525f37e51 [ci skip] Add DataTransfer* classes.
Adds the DataTransferTask and DataTransferProgressDisplay classes, which use repurposed logic from the DownloadTask and EtaProgressDisplay classes, respectively. The EtaProgressDisplay class and EtaProgressInfo struct have been removed.

Other changes include:

* DownloadTask: heavily simplified logic by using DataTransferTask as the base class.

* DumpOptionsFrame: implement some additional/experimental changes.

* OptionsTab: update logic to use the new DataTransferProgressDisplay class.
2024-04-15 01:53:43 +02:00
Pablo Curiel 8f8fc6af37 [ci skip] Add EtaProgressDisplay class.
Also adds a nxdt::views::EtaProgressInfo struct that's used by EtaProgressDisplay's setProgress() method. It may also be used by child classes of AsyncTask.

Other changes include:

* DownloadTask: remove DownloadTaskProgress struct, update logic to use the new nxdt::views::EtaProgressInfo struct.

* DumpOptionsFrame, GameCardTab: minor formatting fixes.

* OptionsTab: remove OptionsTabUpdateProgress class, update logic to use the new nxdt::views::EtaProgressInfo struct.
2024-04-12 23:08:54 +02:00
Pablo Curiel 789a6d6eb8 [skip ci] GameCardTab: reflect current gamecard dump options
Other changes include:

* gamecard: rename gamecardGetDecryptedCardInfoArea() -> gamecardGetPlaintextCardInfoArea().

* FocusableItem, FocusableTable: add positional arguments for the FocusableItem class constructor.
2024-04-12 13:40:50 +02:00
Pablo Curiel fc5226bfce [skip ci] Update copyright year. 2024-04-12 11:49:03 +02:00
Pablo Curiel 5e333bb92e keys: make latest mkey non-mandatory for older FWs 2024-04-09 02:05:44 +02:00
Pablo Curiel a5e72a45e0 bktr: minor code cleanup
Removes all references to Compressed storages being used as substorages for Indirect storages.

I should have taken care of this in 0f1055c84e, but I guess I just forgot.
2024-04-06 04:41:47 +02:00
Pablo Curiel 54c5677cd0 QoL changes
* codebase: remove all references to Lockpick / Lockpick_RCM.

* keys: retrieve Atmosphère's key generation in keysLoadKeyset().
* keys: replace all "key_gen_val" references with "mkey_index".
* keys: move latest master key checks in keysReadKeysFromFile() to keysDeriveMasterKeys().
* keys: update latest master key checks to determine if nxdumptool's hardcoded master key vectors are outdated, using the key generation value from Atmosphère. If the master key vectors are outdated, and the newer master key(s) are not available, an error will be displayed.

* nxdt_utils: update logic in utilsReplaceIllegalCharacters() to replace consecutive illegal characters with a single underscore.
* nxdt_utils: move servicesGetExosphereApiVersion() to nxdt_utils as utilsGetExosphereApiVersion().
* nxdt_utils: define internal UtilsExosphereApiVersion struct, which is used to parse the output from utilsGetExosphereApiVersion().
* nxdt_utils: add utilsGetAtmosphereVersion(), utilsGetAtmosphereKeyGeneration() and utilsGetAtmosphereTargetFirmware() functions.

* services: remove servicesGetExosphereApiVersion().
* services: Atmosphère version is now retrieved via utilsGetAtmosphereVersion().
2024-04-05 23:25:32 +02:00
Pablo Curiel e3cd2a15eb title: updated hardcoded titles list 2024-03-31 15:04:14 +02:00
Pablo Curiel 9e75a019a9 keys/nca: add new keydata for HOS 18.0.0. 2024-03-31 12:16:37 +02:00
Pablo Curiel 41d053dc96 Update libusbhsfs.
CI/CD workflow has also been updated to avoid building libusbhsfs dependencies.
2024-02-24 11:59:29 +01:00
Pablo Curiel 3c519cd631 I'm dummy 2024-02-17 00:19:29 +01:00
Pablo Curiel c5d6081f08 Fix building with latest libnx commit. 2024-02-16 23:57:08 +01:00
Pablo Curiel 7b707509c7 bktr: perform binary search in bktrGetTreeNodeEntryIndex()
Other changes include:

* poc: fix switching to a different title entry via L/R/ZL/ZR if the content counts don't match. Fixes issues with MGS Master Collection games.
2024-02-16 23:31:24 +01:00
Pablo Curiel 5ffe06508e log: make logGetLastMessage() return a heap buffer 2024-01-20 23:12:55 +01:00
Pablo Curiel 643847be39 host: drop Nuitka's "--onefile" arg
Fixes false-positive AV warnings.
2024-01-20 23:11:21 +01:00
Pablo Curiel 38ff475d9e title: handle NACPs with empty language entries.
Leftover ns application records for factory software yield NACP structs with no identifying strings.

I wasn't expecting this to be a thing.
2024-01-13 21:25:02 +01:00
Pablo Curiel 62c29308db Fix output directory for LFS RomFS dumps.
Fixes #154
2024-01-10 11:44:59 +01:00
Pablo Curiel 7a9b2e9cbc Y'know, I'm busy with New Year's preparations. 2023-12-31 18:45:25 +01:00
Pablo Curiel 35c8203349 Update README.md 2023-12-31 18:33:49 +01:00
Pablo Curiel 62c15ca7cf poc: add browser for gamecard HFS partitions
Just in time for New Year's Eve.

Other changes include:

* title: use snprintf() in filename generation functions + reduce array sizes.
2023-12-31 18:16:49 +01:00
Pablo Curiel c585e8f9d3 poc: add file browser for NCA FS sections.
Takes advantage of the recently implemented devoptab interfaces. Supports individual file dumping and multiple file/dir dumping via highlighting. May possibly need some additional testing. The code could potentially be improved, but I'll look into it at a later time -- I just want to release this now.

Other changes include:

* devoptab: comment out log messages.

* utils: add utilsGetDirectorySize() function.
2023-12-26 01:25:29 +01:00
Pablo Curiel 7a0268eeb0 Update todo.txt 2023-12-22 12:41:34 +01:00
Pablo Curiel 364b3f39dc romfs: use hash buckets for FS entry lookups.
* romfs: add hash bucket fields to RomFileSystemContext struct.
* romfs: remove current offset fields from RomFileSystemContext struct and all functions that relied on them.
* romfs: add romfsCalculateEntryHash().
* romfs: update romfsInitializeContext() to also load file/directory hash buckets.
* romfs: update romfsGetTotalDataSize() to make up for the removed functions.
* romfs: update romfsGetChild*EntryByName() functions to use hash bucket lookups.

Other changes include:

* devoptab: add missing exit macros to some FS operations across all interfaces.

* poc: update extractedRomFsReadThreadFunc() to make up for the removed RomFS functions.
2023-12-22 12:20:27 +01:00
Pablo Curiel ef03aa4cbe Custom devoptab wrappers (part 5).
This commit implements a devoptab wrapper for RomFS sections within NCAs, using code from romfs.c/h.

Other changes include:

* devoptab: add additional safety checks and some minor tweaks to both hfs_dev and pfs_dev calls.
2023-12-21 16:51:26 +01:00
Pablo Curiel 091747d197 Custom devoptab wrappers (part 4).
Improve dirnext() calls in both PFS and HFS devoptab wrappers to make them also return bogus "." and ".." directory entries.

The "st_ino" field is now also being filled for all file entries.

Other changes include:

* libs: update libusbhsfs.
2023-12-21 13:29:53 +01:00
Pablo Curiel e6caff3b17 Custom devoptab wrappers (part 3).
Add some minor tweaks to the devoptab macros.
2023-12-21 02:20:37 +01:00
Pablo Curiel c392a9f126 Custom devoptab wrappers (part 2).
This commit implements a devoptab wrapper for Hash FS sections within gamecard images, using code from hfs.c/h.

Other changes include:

* poc: disable buffering on FILE objects via setvbuf().
* gamecard: fix crash in gamecardInitializeHashFileSystemContext() while calculating the size for the root Hash FS partition.
2023-12-21 00:39:56 +01:00
Pablo Curiel d402776032 Custom devoptab wrappers (part 1).
This commit implements a devoptab wrapper for Partition FS sections within NCAs, using code from pfs.c/h.

Other changes include:

* codebase: use NX_IGNORE_ARG macro where needed.

* hfs: slight tweaks to some of the static functions.

* pfs: slight tweaks to some of the static functions.
* pfs: use pfsIsValidContext() where needed.

* utils: update utilsInitializeResources() to use __system_argc and __system_argv variables from libnx.

* todo: update text file.
2023-12-20 20:32:48 +01:00
Pablo Curiel bfdd9e056e poc: enable update option on ExeFS sections. 2023-12-17 19:03:08 +01:00
Johnson af275a558e
Standardize complete gamecard image (#150)
Makes it possible to retrieve the raw gamecard UID in one go, without having to manually parse the gamecard specific data block.
2023-12-05 19:21:45 +01:00
Pablo Curiel 8c4e432035 Fix building with latest libnx commit. 2023-11-26 23:13:58 +01:00
Pablo Curiel e2c0cbc898 config: add configResetSettings().
Other changes include:

* poc: add a "reset settings" option to the root menu.
* poc: add a message about using the controller sticks to scroll faster.
* poc: update missing ticket message to be more detailed.
* poc: add "retrieved" flag to MenuElementOption struct, which is reset while going back to a parent menu via menuResetAttributes().
* poc: fix index/count values in title selection screens.
2023-11-26 22:54:25 +01:00
Pablo Curiel be00971965 title: log orphan title info at initialization.
Other changes include:

* title: rename titleGetApplicationIdByMetaKey() -> titleGetApplicationIdByContentMetaKey().
2023-11-26 22:17:52 +01:00
Pablo Curiel 1f7d73e8ac tik: recreate forged tickets from scratch if detected 2023-11-26 22:16:39 +01:00
Pablo Curiel b723eb1758 gamecard: add commented out ns call.
`nsEnsureGameCardAccess()` has supposedly helped another user to fix the gamecard launch error after exiting their application, but it's not working under nxdumptool. I have yet to find out why.
2023-11-26 22:13:49 +01:00
Pablo Curiel ea8bc05146 utils: show Discord server link on keyset errors 2023-11-26 22:12:23 +01:00
Pablo Curiel bd1b56e5c2 host: switch to Nuitka-based EXE building.
Other changes include:

* host: rename windows_install_deps.py -> install_deps.py and update it to support multiple operating systems.
* host: restore assertions and fix most static analysis errors related to type aliases and checks.
* host: catch exceptions thrown by usb.core.find() in usbGetDeviceEndpoints().
* host: move code to unconditionally enable 32-bit paths under Windows to uiStartServer() and cliInitialize(), respectively.
* host: remove incomplete file if the ongoing transfer was cancelled and we're not dealing with a NSP file.
2023-11-26 22:10:42 +01:00
bilditup1 300c650b8f
Support for >260 char filenames on Windows (#146)
Co-authored-by: bilditup1 <git@github.com>
2023-11-23 22:33:13 +01:00
Pablo Curiel 9272978039 host: be a little more explicit about new cmds 2023-11-12 11:53:03 +01:00