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.
This commit is contained in:
zhupengfei
2020-08-07 08:58:09 +08:00
parent 769162e95c
commit 49ddd86b7a
8 changed files with 514 additions and 41 deletions
+9 -2
View File
@@ -12,6 +12,7 @@
#include "core/importer.h"
#include "core/ncch/ncch_container.h"
class ProgressiveJob;
class QTreeWidgetItem;
namespace Ui {
@@ -41,13 +42,19 @@ private:
Core::ContentSpecifier SpecifierFromItem(QTreeWidgetItem* item) const;
void OnContextMenu(const QPoint& point);
void RunProgressiveJob(ProgressiveJob* job);
void StartDumpingCXI(const Core::ContentSpecifier& content);
Core::NCCHContainer dump_cxi_container; // NCCH container used for dumping CXI
QString last_dump_cxi_path; // Used for recording last path in StartDumpingCXI
QString last_dump_cxi_path; // Used for recording last path in StartDumpingCXI
void StartBuildingCIA(const Core::ContentSpecifier& content);
QString last_build_cia_path; // Used for recording last path in StartBuildingCIA
std::unique_ptr<Ui::ImportDialog> ui;
std::string user_path;
bool has_cert_db = false;
Core::SDMCImporter importer;
std::vector<Core::ContentSpecifier> contents;
u64 total_size = 0;