1
0
Fork 0
mirror of https://github.com/DarkMatterCore/nxdumptool.git synced 2024-11-22 18:26:39 +00:00
Commit graph

328 commits

Author SHA1 Message Date
Pablo Curiel
f526d4e6f4 Crypto changes.
* Implemented RSA-2048-PSS + SHA256 signature verification.

* Refactored RSA-2048-OAEP decryption steps to use mbedtls function calls.

* Implemented NCA header main signature verification.

* Replaced Björn Samuelsson's CRC32 algorithm with the hardware accelerated CRC32 checksum calculation from libnx (latest commit with support for calculation in blocks).
2021-05-21 09:34:43 -04:00
Pablo Curiel
f82d7a3db4 Small code refactor (part 2).
* 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.
2021-05-18 08:32:43 -04:00
Pablo Curiel
85f146f50c Add uppercase hex string generation to utilsGenerateHexStringFromData(). 2021-05-11 18:36:15 -04:00
Pablo Curiel
4c0c7d2c56 Small code refactor.
* Refactored keydata handling.

* Sealed NCA KAEKs are now generated at startup, and NCA key area entries are now decrypted by keysDecryptNcaKeyAreaEntry(), reducing the number of calls to spl functions.

* The eTicket RSA device key is now retrieved and decrypted at startup. RSA-OAEP wrapped titlekeys are now decrypted by keysDecryptRsaOaepWrappedTitleKey().

* Renamed titlekek -> ticket common key throughout the codebase.

* Added NcaKeyAreaEncryptionKeyIndex_Count and NcaKeyGeneration_Max enum values to nca.h.

* Proper usage of strcasecmp() in some functions.

* Moved syscall hint checks from keys.c to mem.c.

* Define illegal FS characters as an array rather than a char pointer.

* Services are now initialized before the CFW type checks.

* Fixed pcv/clkrst service initialization.

* Implemented additional thread safety and logfile output to service functions.

* Slightly tweaked running service checks.

* Added proper Markdown documentation for the USB ABI.
2021-05-11 02:00:33 -04:00
Pablo Curiel
455b86179b Verify NCA FS section header hash. 2021-04-26 01:51:01 -04:00
Pablo Curiel
17dd24bc92 Modified NCA key area handling + restored PoC building.
* Avoid performing any crypto operations on null NCA key area entries.

* Added commented out code to handle the aes_ctr_ex NCA key area entry, just in case we end up needing it at some point.
2021-04-25 19:10:34 -04:00
Pablo Curiel
32a031943f Update libusbhsfs. 2021-04-21 00:38:45 -04:00
Pablo Curiel
6d08c7e94c Support HOS 12.0.x. 2021-04-20 18:43:37 -04:00
Pablo Curiel
d50b6ccac8 Update fs_ext.h 2021-04-07 10:30:55 -04:00
Pablo Curiel
460bee888b Match changes to the XCI page in Switchbrew. 2021-04-05 20:40:57 -04:00
Pablo Curiel
86dbe3ffd8 Update gamecard.h 2021-04-05 16:21:46 -04:00
Whovian9369
50cb464a02
Fixes icon.jpg location in README (#82)
Fixes icon.jpg location in README - Previously unchanged from when file location changes for Borealis related changes.
2021-04-03 09:17:43 -04:00
Pablo Curiel
7c2d16714c Use legacy Borealis fork + add files from the legacy Borealis example.
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.
2021-03-30 15:30:10 -04:00
Pablo Curiel
3d5b3757ec Use legacy Borealis. 2021-03-29 17:57:36 -04:00
Pablo Curiel
194389b73f Some changes.
* Remove references to the secondary Nintendo Extended BFTTF because it's identical to the first one.

* Use format attribute in functions that need it (and fixed errors I made in the past).
2021-03-29 14:27:35 -04:00
Pablo Curiel
45b2e2398f Update Makefile 2021-03-26 00:36:00 -04:00
Pablo Curiel
11da814fb2 Fix building issues with Borealis. 2021-03-26 00:35:14 -04:00
Pablo Curiel
e92c6e536b Add Borealis as a git submodule. 2021-03-25 22:49:59 -04:00
Pablo Curiel
c6c5667bf0 Change project layout + upgrade license to GPLv3. 2021-03-25 15:26:58 -04:00
Pablo Curiel
dd9cf1f41d Remove references to Freetype and LVGL. 2021-03-25 03:22:32 -04:00
Pablo Curiel
1e58ed4f8a Makefile: build as a C++ project.
Yes, we'll be using Borealis.
2021-03-24 20:45:31 -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
MasaGratoR
e9a9a5abcc
Change include of atomic to be compatible with C++ (#78) 2021-03-22 10:30:12 -04:00
Pablo Curiel
ae3b7266a0 Fix NACP bitflag checks. 2021-03-20 03:13:16 -04:00
Pablo Curiel
ecefbe6163 Use latest PyInstaller instead of cx_Freeze to generate a standalone Windows EXE. 2021-03-20 00:47:57 -04:00
Pablo Curiel
2bc9bae11b Small icon correction.
Looks a bit better now. Mad Paint skillz.
2021-03-19 22:36:04 -04:00
Pablo Curiel
a016ba92db More host script changes.
* Added text files with required module information, which can be used with pip.

* Added a batch file to build a ZIP archive with a standalone copy of the script, which can be used to run it under Windows systems without Python.

* Further tweaked the way the progress bar window works.

* Debug messages are no longer printed to the log.

* Rearranged some parts of the code.
2021-03-19 21:59:53 -04:00
Pablo Curiel
491b70d715 Windows taskbar progress.
We're embedding the type library as well because reasons.
2021-03-17 17:19:44 -04:00
Pablo Curiel
a291408b9d Host script changes.
* Use Python keywords in conditional blocks.
* Use one-liners whenever possible.
* Removed unused code.
* Only use a progress bar if the overall file size is greater than the hardcoded threshold value.
2021-03-17 13:25:30 -04:00
Pablo Curiel
2103c08582 Remove exit messagebox. 2021-03-16 11:54:17 -04:00
Pablo Curiel
b0607e9c6e Update nxdt_host.pyw 2021-03-16 11:52:10 -04:00
Pablo Curiel
479a36f671 Unified progress bar for all NSP file entries. 2021-03-16 11:44:48 -04:00
Pablo Curiel
a7984de0c8 Send Git commit hash as part of the StartSession block. 2021-03-16 01:08:38 -04:00
Pablo Curiel
97cd7eb53e Minor changes. 2021-03-16 00:25:19 -04:00
Pablo Curiel
e70979248a Fix crashes related to tqdm.
Use our own child window with strings generated by tqdm.format_meter() instead of relying on tqdm_tk.
2021-03-15 23:28:06 -04:00
Pablo Curiel
651e5d5f87 Update nxdt_host.pyw 2021-03-15 11:38:38 -04:00
Pablo Curiel
0a88d055b8 Host script UI. 2021-03-15 11:31:52 -04:00
Pablo Curiel
f8e10081d6 Update title.c 2021-03-12 12:47:40 -04:00
Pablo Curiel
08fbdb862d Update nxdt_host.py 2021-03-11 20:40:27 -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
8be5460229 Store last log message using a small stack buffer.
Will be used to print error messages down the road.
2021-03-08 10:44:11 -04:00
Pablo Curiel
43f744326f Minor fixes.
* The new logfile handler should now work properly.

* A UTF-8 BOM is now written at the start of every new logfile.
2021-03-08 07:11:28 -04:00
Pablo Curiel
3bc14696ec New logfile handler.
* Ported the logfile handler from libusbhsfs, with some slight modifications.

* Rewrote hash file system handling from scratch. I had been wanting to do this for some months now, it's a lot better now.

* Code cleanup.
2021-03-07 19:22:49 -04:00
Pablo Curiel
bcc688061e Account for orphan system titles as well.
Yeah, system titles we have no hardcoded metadata for, basically.
2021-03-02 01:22:10 -04:00
Pablo Curiel
a384137636 Fix compatibility with latest libusbhsfs commit. 2021-03-02 00:39:51 -04:00
Pablo Curiel
4399709aca Update libusbhsfs 2021-03-02 00:33:28 -04:00
Pablo Curiel
56a4b2f747 Update utils.c 2021-02-27 05:55:25 -04:00