Commit Graph

601 Commits

Author SHA1 Message Date
Pablo Curiel b8992d1fdc Follow latest Switchbrew changes. 2022-04-18 23:59:25 +02:00
Pablo Curiel 215b677f02 keys: use __getline() to parse keys file.
* keysGetKeyAndValueFromFile() is now thread-safe -- may be useful for people reusing code from nxdumptool. The dynamic buffer allocated by __getline() must be freed by the caller. Furthermore, this fixes an out-of-bounds issue while writing data to the static array that was being used with fgets().
* Empty lines are now considered failures.
* keysGetKeyAndValueFromFile() now validates the value string and converts it to lowercase as well.
* Adjusted the example regex in the description for keysGetKeyAndValueFromFile() to accurately match what the function actually does.
* Added helper macros to keysReadKeysFromFile().
2022-04-18 23:38:18 +02:00
enderghast13 4a512db93c
nxdt_host.py: update license (#108) 2022-03-31 04:37:23 +02:00
Kookies fcf0fcbedb
Add comments to build script (#107) 2022-03-22 20:55:06 +01:00
Pablo Curiel 77fa25e0e0 HOS 14.0.0 shenanigans. 2022-03-22 02:20:09 +01:00
Pablo Curiel e0cf57d8a5 nca: SparseInfo support (part 2).
Handle the has_sparse_flag wherever needed.
2022-03-21 03:19:39 +01:00
Pablo Curiel 8d8f19b229 nca: SparseInfo support (part 1).
Proper CTR IV and context are generated to decrypt the SparseInfo IndirectBucket. More to come at a later time.
2022-03-21 02:49:54 +01:00
Pablo Curiel b51dd1674c gamecard: remove references to boot partition. 2022-03-18 20:23:11 +01:00
Pablo Curiel 2b59f7b65c gc_dumper: add back option to append key area.
Turned on by default. This is a measure to avoid hac2l warnings.
2022-03-18 18:23:56 +01:00
Pablo Curiel 7189943680 More changes.
* gc_dumper: fixed Card ID Set dumping.

* nacp: updated structs and enums to match latest changes (big thanks to @0Liam !), added helper macros.

* cnmt: added helper macros.

* program_info: added helper macros.

* exception_handler: added helper macros.

* nxdt_utils: only create output directories if the app isn't a PoC build.

* todo: changed task priority order. Sparse/compressed section support is mandatory and must be implemented ASAP.
2022-03-18 17:48:16 +01:00
Pablo Curiel 9604b5923d romfs_dumper: get latest patch from linked list. 2022-03-17 20:29:44 +01:00
Pablo Curiel 2fa61dc228 Update copyright year. 2022-03-17 13:58:40 +01:00
Pablo Curiel 278cb5c72a Some changes.
* nxdt_includes: renamed VersionType1 to Version and tweaked it to add the application_version struct, renamed VersionType2 to SdkAddOnVersion.

* gc_dumper: use utilsGeneratePath() to truncate generated filenames to safe filesystem limits. Thanks to n0tw0rk for reporting the issue and testing the changes!

* nxdt_host.py: fixed a string formatting issue that made it impossible to unpack data from the SendFileProperties command block under certain circumstances.

* gamecard: modified GameCardKeySource to add a value field, added GameCardFlags_HasCa10Certificate flag.

* utils: utilsGeneratePath() no longer adds a dot on its own if it's not part of the provided extension string.
2022-03-17 13:37:24 +01:00
Pablo Curiel b9018a7df0 gc_dumper: fix gamecard detection.
I'm dumb, sorry.
2022-03-04 13:25:12 +01:00
Pablo Curiel f9eb335a70 libs: update libusbhsfs. 2022-03-04 13:24:28 +01:00
Pablo Curiel fabb15bbe4 Fix home button exit on all PoCs. 2022-02-19 06:03:06 +01:00
Pablo Curiel c99f6776a7 keys: use dev.keys instead of prod.keys under dev units. 2022-02-10 19:05:07 +01:00
Pablo Curiel ffe327b868 Merge branch 'rewrite' of https://github.com/DarkMatterCore/nxdumptool into rewrite 2022-02-09 05:53:53 +01:00
Pablo Curiel 24c2bfe775 Update FUNDING.yml 2022-02-09 05:53:38 +01:00
Whovian9369 3d5187dd1f
Add working github workflow to rewrite branch, builds libusbhsfs + nxdt rewrite (#106)
* Add working github workflow to branch, builds libusbhsfs + nxdt rewrite

* Fix build to actually work with dkp-toolchain-vars from mirror site

* Update `build.sh` so Github Actions properly finishes the build process for the Rewrite

* Update dkp-toolchain-vars - v1.0.0-2 link to Wayback mirror
2022-02-09 05:52:04 +01:00
Pablo Curiel 376199b5cb keys: don't look up a key entry if it's not mandatory. 2022-02-09 05:38:13 +01:00
Pablo Curiel f6d133d793 gc_dumper: change info TXT layout. 2022-02-07 01:32:39 +01:00
Pablo Curiel 3999e48c43 Update gc_dumper.c 2022-02-06 03:33:03 +01:00
Pablo Curiel fea5f8803d gc_dumper: generate text file with dump info. 2022-02-06 03:30:42 +01:00
Pablo Curiel 7bec356181 Forgot this one.
It hasn't been an easy road.
2022-02-04 21:18:35 +01:00
Pablo Curiel 8c312ca636 Add SD card + Card ID Set support to gamecard PoC. 2022-02-04 03:04:43 +01:00
Pablo Curiel 8168a5ac84 gamecard: cache LAFW blob during interface initialization.
Other changes include:

* Codestyle fixes.
* Remove references to GameCardKeyArea in the usb_gc_dumper PoC.
* Remove option to append key area to output XCI dumps in usb_gc_dumper PoC.
2022-02-03 04:39:54 +01:00
Johnson e79b03afeb
Add support for dumping full GameCardSecurityInformation (#105)
* Add support for dumping full GameCardSecurityInformation

* Add support for dumping LAFW

* Clear out ASIC session hash data

Co-authored-by: Pablo Curiel <pabloacurielz@gmail.com>
2022-02-03 02:22:57 +01:00
Pablo Curiel 4929330e32 gamecard: support ID set dumping. 2022-02-03 02:13:20 +01:00
Pablo Curiel 9cc1d64694 Update references to latest HOS version. 2022-01-20 18:09:03 +01:00
Whovian9369 da8165e778
Update `build.sh` to archive debug ELFs after build (#102) 2021-12-04 07:14:35 +01:00
Pablo Curiel 421f0f1482 tik: fix building. 2021-12-02 15:31:56 +01:00
Pablo Curiel 132fa3c6f0 Some small NACP and Ticket fixes.
Thanks to @0Liam
2021-12-01 18:35:19 +01:00
Pablo Curiel ffd2d8f8a4 nxdt_host.py: small fixes. 2021-12-01 13:18:31 +01:00
Pablo Curiel de1ba425a1 Update AuthoringTool XML generation to SDK 13.0.0.
Big thanks to @0Liam
2021-09-26 17:59:41 -04:00
Pablo Curiel cd300fe149 Fix PoC building. 2021-09-04 00:17:17 -04:00
Pablo Curiel 3f9cde8185 Implemented exception handler.
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.
2021-08-25 16:48:01 -04:00
Pablo Curiel 4bea23b758 Minor header fixes. 2021-08-12 01:04:46 -04:00
Pablo Curiel 5a0543ef68 RootView: implement wrappers for public task functions.
Other changes include:

* GameCardTab: moved const strings to gamecard.c for easier maintenance.
* Codebase: reworked tab classes to make them use the wrappers provided by RootView instead of passing task object pointers.
2021-08-11 03:17:57 -04:00
Pablo Curiel 3dffce2995 Set common footer. 2021-08-08 11:50:20 -04:00
Pablo Curiel 3e3469b471 Update todo.txt 2021-08-08 03:59:02 -04:00
Pablo Curiel 405df0c81a FocusableItem: reestructure class.
Other changes include:

* Codebase: update all references to FocusableLabel and FocusableTable constructors to match the changes in FocusableItem.
* FocusableTable: objects can now be highlighted, but the highlight background won't be drawn.
* http: set low speed limit and time values.
2021-08-08 03:39:21 -04:00
Pablo Curiel ba0c5d9e35 utils: implement utilsIsApplicationUpdatable().
Also removed legacy code that has already been reimplemented.
2021-08-07 05:44:36 -04:00
Pablo Curiel 28cd0ce10f OptionsTab: fully implement application update feature.
Other changes include:

* Codebase: move JSON parsing logic from config.c/h to nxdt_json.c/h.
* Codebase: replace all calls to localtime() with localtime_r() to guarantee thread-safety.
* Codebase: updated todo.txt.
* utils: implement utilsParseGitHubReleaseJsonData(), utilsFreeGitHubReleaseJsonData(), utilsGetApplicationUpdatedState() and utilsGetApplicationUpdatedState().
* utils: add extra logic to move the application's NRO to its proper path if the launch path isn't the right one (commented out at this moment).
* utils: add extra logic to replace the application's NRO at exit (commented out at this moment).
* defines: add DEVOPTAB_SDMC_DEVICE and tweak GitHub URL macros.
* DownloadTask: set percentage to 0 if the download size is unknown.
* DownloadTask: fix ETA string formatting.
* OptionsTab: repurpose OptionsTabUpdateFileDialogContent into OptionsTabUpdateProgress.
* OptionsTab: implement OptionsTabUpdateApplicationFrame.
* RootView: move date formatting into the static GetFormattedDateString() method.
* Makefile: use _GNU_SOURCE as part of CFLAGS to use strptime().
2021-08-07 04:42:03 -04:00
Pablo Curiel 3f16e3f835 PoC: use 7z instead of tar. 2021-08-03 03:15:06 -04:00
Pablo Curiel 230e3d2cee PoC: fix building + implement AuthoringTool data option. 2021-08-03 02:37:04 -04:00
Pablo Curiel 7c5aae39e6 config: add append_authoringtool_data boolean. 2021-08-03 00:22:33 -04:00
Pablo Curiel 962cf00ba9 Display a CrashFrame warning at startup if the application is running under applet mode.
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().
2021-07-30 17:07:26 -04:00
Pablo Curiel bc842d8905 OptionsTab: check if an Internet connection is available before starting an update. 2021-07-29 15:55:31 -04:00
Pablo Curiel 841fd73fbf utils: implement utilsSetLongRunningProcessState().
Other changes include:

* DownloadTask: use utilsSetLongRunningProcessState() to control HOME button block status, screen dimming and auto sleep.
* Add missing utilsCommitSdCardFileSystemChanges() calls throughout the codebase.
2021-07-29 12:48:32 -04:00