Commit Graph

42 Commits

Author SHA1 Message Date
Pengfei 781d76bdab Use destructor to release file handle
Instead of relying on writing `file.reset()`s
2021-08-02 00:53:03 +08:00
Pengfei aed564fb25 Add Legit CIA building 2021-07-31 17:28:00 +08:00
Pengfei 75f79e10d1 Generalize QuickDecryptor 2021-07-31 17:25:56 +08:00
Pengfei 7115c30f76 Fix TMD signature validation 2021-07-31 17:23:33 +08:00
Pengfei 3021cfe5f0 Changes to TMD and CIA builder
Prepare for legit CIA.
2021-07-30 17:07:42 +08:00
Pengfei d14ea03271 Refactor code - Add Signature class 2021-07-30 14:47:53 +08:00
Pengfei 15b1af7dd1 Add signature validation to TMD 2021-07-29 23:27:13 +08:00
Pengfei 502e05dc2b Add CIABuildType to CIABuilder; Add legit ticket handling 2021-07-29 16:38:41 +08:00
Pengfei 325832f318 Misc changes to ticket, cert and CIA 2021-07-28 00:27:01 +08:00
Pengfei d8c79c5d2a Critical bug fix 2021-07-28 00:13:48 +08:00
Pengfei 79dfe4fc8b Add certificate, and certs.db parsing 2021-07-17 00:34:32 +08:00
Pengfei 55db5f110f Simplify TitleKeysBin implementation to a simple function 2021-07-16 21:46:10 +08:00
Pengfei 23226b2b37 Properly set crypto flags as GodMode9 does; remove pointless zeroing 2021-07-09 20:32:08 +08:00
Pengfei b90fb11109 Fixing things again 2021-07-09 20:25:49 +08:00
Pengfei 76b0912a9a Add proper support for CIA title keys
1. Support for `ticket.db`
2. Support for `gm9/support/encTitleKeys.bin`
3. Set the title key and common key index when building standard CIA
2021-07-09 20:08:42 +08:00
Pengfei 3429d9e965 Add in complete Ticket support from Citra 2021-07-07 12:03:06 +08:00
Pengfei be5701b7ee Do not create seeddb when loading it 2021-07-06 16:48:10 +08:00
Pengfei 19bc9d0210 Use GodMode9 naming scheme 2021-07-01 15:22:38 +08:00
Pengfei e2bef4d705 Add support for title.db, and use title.db to augment TMD finding
Also added support for system title CIA building, and fixed various minor issues.
Also moved MakeMagic to Common.
2021-07-01 14:13:20 +08:00
Pengfei 2575e7fdde Unify ProgressCallbacks to a Common::ProgressCallback 2021-06-28 22:50:16 +08:00
Pengfei 412aeaa0d4 Use Github Actions instead of Travis
Moved MSVC to Github Actions as well.
2021-06-27 00:11:09 +08:00
zhupengfei b06440aefb Fix some LGTM alerts 2020-08-07 16:03:22 +08:00
zhupengfei 66b09ffa27 A bunch of fixes to CIA building
1. Clean stale state
2. DLC CIAs
3. Build content index for ticket better
2020-08-07 12:28:47 +08:00
zhupengfei 49ddd86b7a Add CIA building
Quite a lot of code, yeah.

The built CIA is almost identical to GM9, with the following differences:
1. Paddings are zeroed out
2. Title key is not written (GM9 gets it from support data/ticket db)
3. Ticket content index is slightly different (GM9 likely takes it from the legit ticket, while we are building a fake one)

The 2, 3 points can be fixed probably.
2020-08-07 08:58:09 +08:00
zhupengfei 769162e95c ncch_container: Fix progress report in DecryptToFile
The total size should now be correct
2020-08-07 08:55:38 +08:00
zhupengfei bf3fe550f8 ncch: Fix Secure1 with seed
Citra's code was wrong here.
2020-08-06 23:03:19 +08:00
zhupengfei ac6f95c067 tmd: Changes in preparation for CIA building 2020-08-06 20:34:59 +08:00
zhupengfei 13409503bf ncch: Fix some issues with DecryptToFile
Now have byte-for-byte accuracy against Godmode9

Now uses a file instead of a path

Preliminary work to support non-executable files
2020-08-06 20:34:10 +08:00
zhupengfei c8f510188c core/ncch: Add ticket
Added structure and fake ticket building (from GodMode9)
2020-08-03 22:47:09 +08:00
zhupengfei 10122a376c Re-add TMD modification code from Citra 2020-08-02 15:49:07 +08:00
zhupengfei 1f91cbdaec Use virtual classes instead of templates for file interfaces
For convenience.
2020-08-01 09:47:44 +08:00
zhupengfei 450cef3fca Added a fallback title based on codeset info 2020-05-15 22:34:39 +08:00
zhupengfei b19803c4d3 Add support for system titles 2020-05-14 23:14:59 +08:00
zhupengfei 24bdf0a156 core, frontend: Add 'Dump CXI file' option
Right click on an application in the Select Contents dialog.
2020-05-02 00:06:46 +08:00
zhupengfei 2c4dd84d49 Correctly load seeds 2020-05-01 15:05:01 +08:00
zhupengfei 0f7ebef23f Fixed a crash 2020-05-01 13:11:10 +08:00
zhupengfei c27589ce53 core: Add DecryptToFile in NCCHContainer 2020-05-01 11:59:24 +08:00
zhupengfei b5b2fa32cb core/ncch: Add back secondary key derivation from Citra
Along with RomFS CTR, etc.
2020-04-30 20:03:54 +08:00
zhupengfei 6b7faf2c05 core: Add support for proper SeedDB import
This now merges the SeedDB to import with the one already existing
2020-04-18 23:34:51 +08:00
zhupengfei 0708744a17 Added encryption scheme display. 2020-01-17 10:10:58 +08:00
zhupengfei 5d675d605a Add system archives import 2019-10-02 16:00:32 +08:00
zhupengfei 895cbb272c Add in NCCH, TMD and SMDH from Citra (to get game title) 2019-09-27 22:11:27 +08:00