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.
This commit is contained in:
Pengfei
2021-07-01 14:13:20 +08:00
parent 857bd12a6f
commit e2bef4d705
16 changed files with 326 additions and 88 deletions
+10 -2
View File
@@ -15,6 +15,8 @@ namespace Core {
class CIABuilder;
class SDMCDecryptor;
class TitleDB;
class TitleMetadata;
/**
* Type of an importable content.
@@ -71,7 +73,8 @@ struct Config {
std::string movable_sed_path; ///< Path to movable.sed
std::string bootrom_path; ///< Path to bootrom (boot9.bin) (Sysdata 0)
std::string certs_db_path; ///< Path to certs.db. Used while building CIA.
std::string certs_db_path; ///< Path to certs.db. Used while building CIA.
std::string nand_title_db_path; ///< Path to NAND title.db. Entirely optional.
// The following system files are optional for importing and are only copied so that Citra
// will be able to decrypt imported encrypted ROMs.
@@ -90,7 +93,7 @@ struct Config {
};
// Version of the current dumper.
constexpr int CurrentDumperVersion = 3;
constexpr int CurrentDumperVersion = 4;
class SDMCFile;
class NCCHContainer;
@@ -190,6 +193,8 @@ private:
void DeleteSystemArchive(u64 id) const;
void DeleteSysdata(u64 id) const;
bool LoadTMD(ContentType type, u64 id, TitleMetadata& out) const;
bool is_good{};
Config config;
std::unique_ptr<SDMCDecryptor> decryptor;
@@ -197,6 +202,9 @@ private:
// The NCCH used to dump CXIs.
std::unique_ptr<NCCHContainer> dump_cxi_ncch;
std::unique_ptr<TitleDB> sdmc_title_db{};
std::unique_ptr<TitleDB> nand_title_db{};
};
/**