Reorganize code

This commit is contained in:
Pengfei
2021-08-09 16:34:03 +08:00
parent b331f50b91
commit 9fbdf6f529
6 changed files with 306 additions and 321 deletions
+11 -12
View File
@@ -42,7 +42,11 @@ bool NCCHContainer::Load() {
if (is_loaded) if (is_loaded)
return true; return true;
if (file->IsOpen()) { if (!file->IsOpen()) {
LOG_WARNING(Service_FS, "Failed to open");
return false;
}
// Reset read pointer in case this file has been read before. // Reset read pointer in case this file has been read before.
file->Seek(0, SEEK_SET); file->Seek(0, SEEK_SET);
@@ -146,8 +150,7 @@ bool NCCHContainer::Load() {
LOG_DEBUG(Loader, "NCCH version 1"); LOG_DEBUG(Loader, "NCCH version 1");
// In this version, CTR for each section is the section offset prefixed by partition // In this version, CTR for each section is the section offset prefixed by partition
// ID, as if the entire NCCH image is encrypted using a single CTR stream. // ID, as if the entire NCCH image is encrypted using a single CTR stream.
std::copy(ncch_header.partition_id, ncch_header.partition_id + 8, std::copy(ncch_header.partition_id, ncch_header.partition_id + 8, exheader_ctr.begin());
exheader_ctr.begin());
exefs_ctr = romfs_ctr = exheader_ctr; exefs_ctr = romfs_ctr = exheader_ctr;
auto u32ToBEArray = [](u32 value) -> std::array<u8, 4> { auto u32ToBEArray = [](u32 value) -> std::array<u8, 4> {
return std::array<u8, 4>{ return std::array<u8, 4>{
@@ -160,8 +163,7 @@ bool NCCHContainer::Load() {
auto offset_exheader = u32ToBEArray(0x200); // exheader offset auto offset_exheader = u32ToBEArray(0x200); // exheader offset
auto offset_exefs = u32ToBEArray(ncch_header.exefs_offset * kBlockSize); auto offset_exefs = u32ToBEArray(ncch_header.exefs_offset * kBlockSize);
auto offset_romfs = u32ToBEArray(ncch_header.romfs_offset * kBlockSize); auto offset_romfs = u32ToBEArray(ncch_header.romfs_offset * kBlockSize);
std::copy(offset_exheader.begin(), offset_exheader.end(), std::copy(offset_exheader.begin(), offset_exheader.end(), exheader_ctr.begin() + 12);
exheader_ctr.begin() + 12);
std::copy(offset_exefs.begin(), offset_exefs.end(), exefs_ctr.begin() + 12); std::copy(offset_exefs.begin(), offset_exefs.end(), exefs_ctr.begin() + 12);
std::copy(offset_romfs.begin(), offset_romfs.end(), romfs_ctr.begin() + 12); std::copy(offset_romfs.begin(), offset_romfs.end(), romfs_ctr.begin() + 12);
} else { } else {
@@ -175,8 +177,7 @@ bool NCCHContainer::Load() {
// System archives and DLC don't have an extended header but have RomFS // System archives and DLC don't have an extended header but have RomFS
if (ncch_header.extended_header_size) { if (ncch_header.extended_header_size) {
if (file->ReadBytes(&exheader_header, sizeof(exheader_header)) != if (file->ReadBytes(&exheader_header, sizeof(exheader_header)) != sizeof(exheader_header)) {
sizeof(exheader_header)) {
LOG_ERROR(Service_FS, "Could not read exheader from file"); LOG_ERROR(Service_FS, "Could not read exheader from file");
return false; return false;
} }
@@ -210,8 +211,7 @@ bool NCCHContainer::Load() {
u8 resource_limit_category = u8 resource_limit_category =
exheader_header.arm11_system_local_caps.resource_limit_category; exheader_header.arm11_system_local_caps.resource_limit_category;
LOG_DEBUG(Service_FS, "Name: {}", LOG_DEBUG(Service_FS, "Name: {}", exheader_header.codeset_info.name);
exheader_header.codeset_info.name);
LOG_DEBUG(Service_FS, "Program ID: {:016X}", ncch_header.program_id); LOG_DEBUG(Service_FS, "Program ID: {:016X}", ncch_header.program_id);
LOG_DEBUG(Service_FS, "Entry point: 0x{:08X}", entry_point); LOG_DEBUG(Service_FS, "Entry point: 0x{:08X}", entry_point);
LOG_DEBUG(Service_FS, "Code size: 0x{:08X}", code_size); LOG_DEBUG(Service_FS, "Code size: 0x{:08X}", code_size);
@@ -241,8 +241,8 @@ bool NCCHContainer::Load() {
if (is_encrypted) { if (is_encrypted) {
CryptoPP::byte* data = reinterpret_cast<CryptoPP::byte*>(&exefs_header); CryptoPP::byte* data = reinterpret_cast<CryptoPP::byte*>(&exefs_header);
CryptoPP::CTR_Mode<CryptoPP::AES>::Decryption(primary_key.data(), CryptoPP::CTR_Mode<CryptoPP::AES>::Decryption(primary_key.data(), primary_key.size(),
primary_key.size(), exefs_ctr.data()) exefs_ctr.data())
.ProcessData(data, data, sizeof(exefs_header)); .ProcessData(data, data, sizeof(exefs_header));
} }
@@ -252,7 +252,6 @@ bool NCCHContainer::Load() {
if (ncch_header.romfs_offset != 0 && ncch_header.romfs_size != 0) if (ncch_header.romfs_offset != 0 && ncch_header.romfs_size != 0)
has_romfs = true; has_romfs = true;
}
is_loaded = true; is_loaded = true;
return true; return true;
+34 -56
View File
@@ -535,10 +535,29 @@ bool SDMCImporter::LoadTMD(const ContentSpecifier& specifier, TitleMetadata& out
return LoadTMD(specifier.type, specifier.id, out); return LoadTMD(specifier.type, specifier.id, out);
} }
std::shared_ptr<FileUtil::IOFile> SDMCImporter::OpenContent(const ContentSpecifier& specifier,
u32 content_id) const {
if (IsNandTitle(specifier.type)) {
const auto path =
fmt::format("{}{:08x}/{:08x}/content/{:08x}.app", config.system_titles_path,
(specifier.id >> 32), (specifier.id & 0xFFFFFFFF), content_id);
return std::make_shared<FileUtil::IOFile>(path, "rb");
} else {
// For DLCs, there one subfolder every 256 titles, but in practice hardcoded 00000000
// should be fine (also matches GodMode9 behaviour)
const auto format_str = specifier.type == ContentType::DLC
? "/title/{:08x}/{:08x}/content/00000000/{:08x}.app"
: "/title/{:08x}/{:08x}/content/{:08x}.app";
const auto path =
fmt::format(format_str, (specifier.id >> 32), (specifier.id & 0xFFFFFFFF), content_id);
return std::make_shared<SDMCFile>(config.sdmc_path, path, "rb");
}
}
// English short title name, extdata id, icon // English short title name, extdata id, icon
using TitleData = std::tuple<std::string, u64, std::vector<u16>>; using TitleData = std::tuple<std::string, u64, std::vector<u16>>;
TitleData LoadTitleData(NCCHContainer& ncch) { static TitleData LoadTitleData(NCCHContainer& ncch) {
std::string codeset_name; std::string codeset_name;
ncch.ReadCodesetName(codeset_name); ncch.ReadCodesetName(codeset_name);
@@ -634,11 +653,7 @@ bool SDMCImporter::DumpCXI(const ContentSpecifier& specifier, std::string destin
return false; return false;
} }
const auto boot_content_path = dump_cxi_ncch = std::make_unique<NCCHContainer>(OpenContent(specifier, tmd.GetBootContentID()));
fmt::format("/title/{:08x}/{:08x}/content/{:08x}.app", specifier.id >> 32,
(specifier.id & 0xFFFFFFFF), tmd.GetBootContentID());
dump_cxi_ncch = std::make_unique<NCCHContainer>(
std::make_shared<SDMCFile>(config.sdmc_path, boot_content_path, "rb"));
if (destination.back() == '/' || destination.back() == '\\') { if (destination.back() == '/' || destination.back() == '\\') {
auto_filename = true; auto_filename = true;
@@ -703,13 +718,6 @@ bool SDMCImporter::BuildCIA(CIABuildType build_type, const ContentSpecifier& spe
return false; return false;
} }
const bool is_nand = IsNandTitle(specifier.type);
const auto physical_path =
is_nand ? fmt::format("{}{:08x}/{:08x}/content/", config.system_titles_path,
(specifier.id >> 32), (specifier.id & 0xFFFFFFFF))
: fmt::format("{}title/{:08x}/{:08x}/content/", config.sdmc_path,
(specifier.id >> 32), (specifier.id & 0xFFFFFFFF));
if (destination.back() == '/' || destination.back() == '\\') { if (destination.back() == '/' || destination.back() == '\\') {
auto_filename = true; auto_filename = true;
} }
@@ -722,15 +730,12 @@ bool SDMCImporter::BuildCIA(CIABuildType build_type, const ContentSpecifier& spe
if (destination.back() != '/' && destination.back() != '\\') { if (destination.back() != '/' && destination.back() != '\\') {
destination.push_back('/'); destination.push_back('/');
} }
const auto boot_content_path = auto file = OpenContent(specifier, tmd.GetBootContentID());
fmt::format("{}{:08x}.app", physical_path, tmd.GetBootContentID()); if (!file) {
NCCHContainer ncch; LOG_ERROR(Core, "Could not open boot content");
if (is_nand) { return false;
ncch.OpenFile(std::make_shared<FileUtil::IOFile>(boot_content_path, "rb"));
} else {
const auto relative_path = boot_content_path.substr(config.sdmc_path.size() - 1);
ncch.OpenFile(std::make_shared<SDMCFile>(config.sdmc_path, relative_path, "rb"));
} }
NCCHContainer ncch(std::move(file));
const auto filename = const auto filename =
fmt::format("{} (v{}).{}", GetTitleFileName(ncch), tmd.GetTitleVersionString(), fmt::format("{} (v{}).{}", GetTitleFileName(ncch), tmd.GetTitleVersionString(),
BuildTypeExts.at(static_cast<std::size_t>(build_type))); BuildTypeExts.at(static_cast<std::size_t>(build_type)));
@@ -749,28 +754,18 @@ bool SDMCImporter::BuildCIA(CIABuildType build_type, const ContentSpecifier& spe
} }
for (const auto& tmd_chunk : tmd.tmd_chunks) { for (const auto& tmd_chunk : tmd.tmd_chunks) {
// For DLCs, there one subfolder every 256 titles, but in practice hardcoded 00000000 auto file = OpenContent(specifier, tmd_chunk.id);
// should be fine (also matches GodMode9) if (!file) {
const auto sub_folder =
specifier.type == ContentType::DLC ? physical_path + "00000000/" : physical_path;
const auto path = fmt::format("{}{:08x}.app", sub_folder, static_cast<u32>(tmd_chunk.id));
if (!FileUtil::Exists(path)) {
if (static_cast<u16>(tmd_chunk.type) & 0x4000) { // optional if (static_cast<u16>(tmd_chunk.type) & 0x4000) { // optional
continue; continue;
} }
LOG_ERROR(Core, "Content {:08x} does not exist", static_cast<u32>(tmd_chunk.id)); LOG_ERROR(Core, "Could not open content {:08x}", static_cast<u32>(tmd_chunk.id));
ret = false; ret = false;
return false; return false;
} }
if (is_nand) { NCCHContainer ncch(std::move(file));
NCCHContainer ncch(std::make_shared<FileUtil::IOFile>(path, "rb"));
ret = cia_builder->AddContent(tmd_chunk.id, ncch); ret = cia_builder->AddContent(tmd_chunk.id, ncch);
} else {
const auto relative_path = path.substr(config.sdmc_path.size() - 1);
NCCHContainer ncch(std::make_shared<SDMCFile>(config.sdmc_path, relative_path, "rb"));
ret = cia_builder->AddContent(tmd_chunk.id, ncch);
}
if (!ret) { if (!ret) {
return false; return false;
} }
@@ -821,35 +816,18 @@ bool SDMCImporter::CheckTitleContents(const ContentSpecifier& specifier,
Common::ProgressCallbackWrapper wrapper{specifier.maximum_size}; Common::ProgressCallbackWrapper wrapper{specifier.maximum_size};
const bool is_nand = IsNandTitle(specifier.type);
const auto physical_path =
is_nand ? fmt::format("{}{:08x}/{:08x}/content/", config.system_titles_path,
(specifier.id >> 32), (specifier.id & 0xFFFFFFFF))
: fmt::format("{}title/{:08x}/{:08x}/content/", config.sdmc_path,
(specifier.id >> 32), (specifier.id & 0xFFFFFFFF));
for (const auto& tmd_chunk : tmd.tmd_chunks) { for (const auto& tmd_chunk : tmd.tmd_chunks) {
// For DLCs, there one subfolder every 256 titles, but in practice hardcoded 00000000 auto file = OpenContent(specifier, tmd_chunk.id);
// should be fine (also matches GodMode9) if (!file) {
const auto sub_folder =
specifier.type == ContentType::DLC ? physical_path + "00000000/" : physical_path;
const auto path = fmt::format("{}{:08x}.app", sub_folder, static_cast<u32>(tmd_chunk.id));
if (!FileUtil::Exists(path)) {
if (static_cast<u16>(tmd_chunk.type) & 0x4000) { // optional if (static_cast<u16>(tmd_chunk.type) & 0x4000) { // optional
continue; continue;
} }
LOG_INFO(Core, "Content {:08x} does not exist", static_cast<u32>(tmd_chunk.id)); LOG_INFO(Core, "Could not open content {:08x}", static_cast<u32>(tmd_chunk.id));
return false; return false;
} }
std::shared_ptr<FileUtil::IOFile> source_file;
if (is_nand) {
source_file = std::make_shared<FileUtil::IOFile>(path, "rb");
} else {
const auto relative_path = path.substr(config.sdmc_path.size() - 1);
source_file = std::make_shared<SDMCFile>(config.sdmc_path, relative_path, "rb");
}
std::shared_ptr<HashOnlyFile> dest_file = std::make_shared<HashOnlyFile>(); std::shared_ptr<HashOnlyFile> dest_file = std::make_shared<HashOnlyFile>();
if (!file_decryptor.CryptAndWriteFile(source_file, source_file->GetSize(), dest_file, if (!file_decryptor.CryptAndWriteFile(file, file->GetSize(), dest_file,
wrapper.Wrap(callback))) { wrapper.Wrap(callback))) {
return false; return false;
} }
+2 -2
View File
@@ -176,8 +176,8 @@ public:
bool LoadTMD(const ContentSpecifier& specifier, TitleMetadata& out) const; bool LoadTMD(const ContentSpecifier& specifier, TitleMetadata& out) const;
std::string GetTitleContentsPath(const ContentSpecifier& specifier) const; std::string GetTitleContentsPath(const ContentSpecifier& specifier) const;
std::shared_ptr<FileUtil::IOFile> OpenBootContent(const ContentSpecifier& specifier, std::shared_ptr<FileUtil::IOFile> OpenContent(const ContentSpecifier& specifier,
const TitleMetadata& tmd) const; u32 content_id) const;
std::shared_ptr<TicketDB>& GetTicketDB() { std::shared_ptr<TicketDB>& GetTicketDB() {
return ticket_db; return ticket_db;
+1 -1
View File
@@ -490,7 +490,7 @@ void ImportDialog::OnContextMenu(const QPoint& point) {
[this, specifier] { StartBuildingCIASingle(specifier); }); [this, specifier] { StartBuildingCIASingle(specifier); });
QAction* show_title_info = context_menu.addAction(tr("Show Title Info")); QAction* show_title_info = context_menu.addAction(tr("Show Title Info"));
connect(show_title_info, &QAction::triggered, [this, specifier] { connect(show_title_info, &QAction::triggered, [this, specifier] {
TitleInfoDialog dialog(this, config, *importer, specifier); TitleInfoDialog dialog(this, *importer, specifier);
dialog.exec(); dialog.exec();
}); });
} }
+68 -65
View File
@@ -15,8 +15,8 @@
#include "frontend/title_info_dialog.h" #include "frontend/title_info_dialog.h"
#include "ui_title_info_dialog.h" #include "ui_title_info_dialog.h"
TitleInfoDialog::TitleInfoDialog(QWidget* parent, const Core::Config& config, TitleInfoDialog::TitleInfoDialog(QWidget* parent, Core::SDMCImporter& importer_,
Core::SDMCImporter& importer_, Core::ContentSpecifier specifier_) Core::ContentSpecifier specifier_)
: QDialog(parent), ui(std::make_unique<Ui::TitleInfoDialog>()), importer(importer_), : QDialog(parent), ui(std::make_unique<Ui::TitleInfoDialog>()), importer(importer_),
specifier(std::move(specifier_)) { specifier(std::move(specifier_)) {
@@ -25,39 +25,62 @@ TitleInfoDialog::TitleInfoDialog(QWidget* parent, const Core::Config& config,
const double scale = qApp->desktop()->logicalDpiX() / 96.0; const double scale = qApp->desktop()->logicalDpiX() / 96.0;
resize(static_cast<int>(width() * scale), static_cast<int>(height() * scale)); resize(static_cast<int>(width() * scale), static_cast<int>(height() * scale));
LoadInfo(config); LoadInfo();
connect(ui->buttonBox, &QDialogButtonBox::accepted, this, &TitleInfoDialog::accept); connect(ui->buttonBox, &QDialogButtonBox::accepted, this, &TitleInfoDialog::accept);
} }
TitleInfoDialog::~TitleInfoDialog() = default; TitleInfoDialog::~TitleInfoDialog() = default;
void TitleInfoDialog::LoadInfo(const Core::Config& config) { void TitleInfoDialog::LoadInfo() {
// Load TMD & boot NCCH
Core::TitleMetadata tmd; Core::TitleMetadata tmd;
if (!importer.LoadTMD(specifier, tmd)) { Core::NCCHContainer ncch;
if (!importer.LoadTMD(specifier, tmd) ||
!ncch.OpenFile(importer.OpenContent(specifier, tmd.GetBootContentID()))) {
QMessageBox::warning(this, tr("threeSD"), tr("Could not load title information.")); QMessageBox::warning(this, tr("threeSD"), tr("Could not load title information."));
reject(); reject();
return; return;
} }
ui->versionLineEdit->setText(QString::fromStdString(tmd.GetTitleVersionString()));
ui->titleIDLineEdit->setText(QStringLiteral("%1").arg(specifier.id, 16, 16, QLatin1Char{'0'}));
const bool is_nand = Core::IsNandTitle(specifier.type); // Load SMDH from boot NCCH
const auto physical_path = bool has_smdh = false;
is_nand ? fmt::format("{}{:08x}/{:08x}/content/", config.system_titles_path, std::vector<u8> smdh_buffer;
(specifier.id >> 32), (specifier.id & 0xFFFFFFFF)) if (ncch.LoadSectionExeFS("icon", smdh_buffer) && smdh_buffer.size() == sizeof(Core::SMDH) &&
: fmt::format("{}title/{:08x}/{:08x}/content/", config.sdmc_path, Core::IsValidSMDH(smdh_buffer)) {
(specifier.id >> 32), (specifier.id & 0xFFFFFFFF));
const auto boot_content_path = has_smdh = true;
fmt::format("{}{:08x}.app", physical_path, tmd.GetBootContentID()); std::memcpy(&smdh, smdh_buffer.data(), smdh_buffer.size());
Core::NCCHContainer ncch;
if (is_nand) {
ncch.OpenFile(std::make_shared<FileUtil::IOFile>(boot_content_path, "rb"));
} else {
const auto relative_path = boot_content_path.substr(config.sdmc_path.size() - 1);
ncch.OpenFile(std::make_shared<Core::SDMCFile>(config.sdmc_path, relative_path, "rb"));
} }
// Basic info
ui->versionLineEdit->setText(QString::fromStdString(tmd.GetTitleVersionString()));
LoadEncryption(ncch);
ui->titleIDLineEdit->setText(QStringLiteral("%1").arg(specifier.id, 16, 16, QLatin1Char{'0'}));
// Icons
if (has_smdh) {
ui->iconLargeLabel->setPixmap(
QPixmap::fromImage(QImage(reinterpret_cast<const uchar*>(smdh.GetIcon(true).data()), 48,
48, QImage::Format::Format_RGB16)));
ui->iconSmallLabel->setPixmap(
QPixmap::fromImage(QImage(reinterpret_cast<const uchar*>(smdh.GetIcon(false).data()),
24, 24, QImage::Format::Format_RGB16)));
}
// Names
if (has_smdh) {
InitializeLanguageComboBox();
} else {
ui->namesGroupBox->setVisible(false);
}
// Checks
InitializeChecks(tmd);
}
void TitleInfoDialog::LoadEncryption(Core::NCCHContainer& ncch) {
static const std::unordered_map<Core::EncryptionType, const char*> EncryptionTypeMap{{ static const std::unordered_map<Core::EncryptionType, const char*> EncryptionTypeMap{{
{Core::EncryptionType::None, QT_TR_NOOP("None")}, {Core::EncryptionType::None, QT_TR_NOOP("None")},
{Core::EncryptionType::FixedKey, QT_TR_NOOP("FixedKey")}, {Core::EncryptionType::FixedKey, QT_TR_NOOP("FixedKey")},
@@ -78,50 +101,6 @@ void TitleInfoDialog::LoadInfo(const Core::Config& config) {
encryption_text.append(tr(" (Seed)")); encryption_text.append(tr(" (Seed)"));
} }
ui->encryptionLineEdit->setText(encryption_text); ui->encryptionLineEdit->setText(encryption_text);
// Checks
const bool tmd_legit = tmd.ValidateSignature() && tmd.VerifyHashes();
if (tmd_legit) {
ui->tmdCheckLabel->setText(tr("Legit"));
} else {
ui->tmdCheckLabel->setText(tr("Illegit"));
}
if (const auto& ticket_db = importer.GetTicketDB();
ticket_db && ticket_db->tickets.count(specifier.id)) {
const bool ticket_legit = ticket_db->tickets.at(specifier.id).ValidateSignature();
if (ticket_legit) {
ui->ticketCheckLabel->setText(tr("Legit"));
} else {
ui->ticketCheckLabel->setText(tr("Illegit"));
}
} else {
ui->ticketCheckLabel->setText(tr("Missing"));
}
connect(ui->contentsCheckButton, &QPushButton::clicked, this,
&TitleInfoDialog::ExecuteContentsCheck);
// Load SMDH
std::vector<u8> smdh_buffer;
if (!ncch.LoadSectionExeFS("icon", smdh_buffer) || smdh_buffer.size() != sizeof(Core::SMDH) ||
!Core::IsValidSMDH(smdh_buffer)) {
LOG_WARNING(Core, "Failed to load SMDH");
ui->namesGroupBox->setEnabled(false);
return;
}
std::memcpy(&smdh, smdh_buffer.data(), smdh_buffer.size());
// Load icon
ui->iconLargeLabel->setPixmap(
QPixmap::fromImage(QImage(reinterpret_cast<const uchar*>(smdh.GetIcon(true).data()), 48, 48,
QImage::Format::Format_RGB16)));
ui->iconSmallLabel->setPixmap(
QPixmap::fromImage(QImage(reinterpret_cast<const uchar*>(smdh.GetIcon(false).data()), 24,
24, QImage::Format::Format_RGB16)));
// Load names
InitializeLanguageComboBox();
} }
void TitleInfoDialog::InitializeLanguageComboBox() { void TitleInfoDialog::InitializeLanguageComboBox() {
@@ -172,6 +151,30 @@ void TitleInfoDialog::UpdateNames() {
QString::fromStdString(Common::UTF16BufferToUTF8(title.publisher))); QString::fromStdString(Common::UTF16BufferToUTF8(title.publisher)));
} }
void TitleInfoDialog::InitializeChecks(Core::TitleMetadata& tmd) {
const bool tmd_legit = tmd.ValidateSignature() && tmd.VerifyHashes();
if (tmd_legit) {
ui->tmdCheckLabel->setText(tr("Legit"));
} else {
ui->tmdCheckLabel->setText(tr("Illegit"));
}
if (const auto& ticket_db = importer.GetTicketDB();
ticket_db && ticket_db->tickets.count(specifier.id)) {
const bool ticket_legit = ticket_db->tickets.at(specifier.id).ValidateSignature();
if (ticket_legit) {
ui->ticketCheckLabel->setText(tr("Legit"));
} else {
ui->ticketCheckLabel->setText(tr("Illegit"));
}
} else {
ui->ticketCheckLabel->setText(tr("Missing"));
}
connect(ui->contentsCheckButton, &QPushButton::clicked, this,
&TitleInfoDialog::ExecuteContentsCheck);
}
void TitleInfoDialog::ExecuteContentsCheck() { void TitleInfoDialog::ExecuteContentsCheck() {
auto* job = new SimpleJob( auto* job = new SimpleJob(
this, this,
+8 -3
View File
@@ -9,6 +9,7 @@
namespace Core { namespace Core {
struct Config; struct Config;
class ContentSpecifier; class ContentSpecifier;
class NCCHContainer;
class SDMCImporter; class SDMCImporter;
class TitleMetadata; class TitleMetadata;
} // namespace Core } // namespace Core
@@ -21,13 +22,17 @@ class TitleInfoDialog : public QDialog {
Q_OBJECT Q_OBJECT
public: public:
explicit TitleInfoDialog(QWidget* parent, const Core::Config& config, explicit TitleInfoDialog(QWidget* parent, Core::SDMCImporter& importer,
Core::SDMCImporter& importer, Core::ContentSpecifier specifier); Core::ContentSpecifier specifier);
~TitleInfoDialog(); ~TitleInfoDialog();
private: private:
void LoadInfo(const Core::Config& config); void LoadInfo();
void LoadEncryption(Core::NCCHContainer& ncch);
void InitializeLanguageComboBox(); void InitializeLanguageComboBox();
void InitializeChecks(Core::TitleMetadata& tmd);
void UpdateNames(); void UpdateNames();
void ExecuteContentsCheck(); void ExecuteContentsCheck();