From baf3a3b188cb996a9994c18960e914f292b43841 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sat, 17 Jun 2017 16:53:55 +0200 Subject: [PATCH] DiscExtractor: Don't hardcode names in ExportApploader and ExportDOL --- Source/Core/DiscIO/DiscExtractor.cpp | 8 ++++---- Source/Core/DiscIO/DiscExtractor.h | 5 +++-- Source/Core/DolphinWX/ISOProperties/FilesystemPanel.cpp | 9 +++++---- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Source/Core/DiscIO/DiscExtractor.cpp b/Source/Core/DiscIO/DiscExtractor.cpp index 8adbcf02fe..323fe706f2 100644 --- a/Source/Core/DiscIO/DiscExtractor.cpp +++ b/Source/Core/DiscIO/DiscExtractor.cpp @@ -72,7 +72,7 @@ bool ExportFile(const Volume& volume, const Partition& partition, const FileInfo } bool ExportApploader(const Volume& volume, const Partition& partition, - const std::string& export_folder) + const std::string& export_filename) { if (!IsDisc(volume.GetVolumeType())) return false; @@ -85,7 +85,7 @@ bool ExportApploader(const Volume& volume, const Partition& partition, *apploader_size += *trailer_size + header_size; DEBUG_LOG(DISCIO, "Apploader size -> %x", *apploader_size); - return ExportData(volume, partition, 0x2440, *apploader_size, export_folder + "/apploader.img"); + return ExportData(volume, partition, 0x2440, *apploader_size, export_filename); } std::optional GetBootDOLOffset(const Volume& volume, const Partition& partition) @@ -129,7 +129,7 @@ std::optional GetBootDOLSize(const Volume& volume, const Partition& partiti return dol_size; } -bool ExportDOL(const Volume& volume, const Partition& partition, const std::string& export_folder) +bool ExportDOL(const Volume& volume, const Partition& partition, const std::string& export_filename) { if (!IsDisc(volume.GetVolumeType())) return false; @@ -141,7 +141,7 @@ bool ExportDOL(const Volume& volume, const Partition& partition, const std::stri if (!dol_size) return false; - return ExportData(volume, partition, *dol_offset, *dol_size, export_folder + "/boot.dol"); + return ExportData(volume, partition, *dol_offset, *dol_size, export_filename); } } // namespace DiscIO diff --git a/Source/Core/DiscIO/DiscExtractor.h b/Source/Core/DiscIO/DiscExtractor.h index 2d5299e970..6061075b9f 100644 --- a/Source/Core/DiscIO/DiscExtractor.h +++ b/Source/Core/DiscIO/DiscExtractor.h @@ -21,9 +21,10 @@ bool ExportData(const Volume& volume, const Partition& partition, u64 offset, u6 bool ExportFile(const Volume& volume, const Partition& partition, const FileInfo* file_info, const std::string& export_filename); bool ExportApploader(const Volume& volume, const Partition& partition, - const std::string& export_folder); + const std::string& export_filename); std::optional GetBootDOLOffset(const Volume& volume, const Partition& partition); std::optional GetBootDOLSize(const Volume& volume, const Partition& partition, u64 dol_offset); -bool ExportDOL(const Volume& volume, const Partition& partition, const std::string& export_folder); +bool ExportDOL(const Volume& volume, const Partition& partition, + const std::string& export_filename); } // namespace DiscIO diff --git a/Source/Core/DolphinWX/ISOProperties/FilesystemPanel.cpp b/Source/Core/DolphinWX/ISOProperties/FilesystemPanel.cpp index c375931aae..b77cde850e 100644 --- a/Source/Core/DolphinWX/ISOProperties/FilesystemPanel.cpp +++ b/Source/Core/DolphinWX/ISOProperties/FilesystemPanel.cpp @@ -283,11 +283,11 @@ void FilesystemPanel::OnExtractHeaderData(wxCommandEvent& event) bool ret = false; if (event.GetId() == ID_EXTRACT_APPLOADER) { - ret = DiscIO::ExportApploader(*m_opened_iso, partition, WxStrToStr(path)); + ret = DiscIO::ExportApploader(*m_opened_iso, partition, WxStrToStr(path) + "/apploader.img"); } else if (event.GetId() == ID_EXTRACT_DOL) { - ret = DiscIO::ExportDOL(*m_opened_iso, partition, WxStrToStr(path)); + ret = DiscIO::ExportDOL(*m_opened_iso, partition, WxStrToStr(path) + "/boot.dol"); } if (!ret) @@ -437,8 +437,9 @@ void FilesystemPanel::ExtractDirectories(const std::string& full_path, { if (full_path.empty()) // Root { - DiscIO::ExportApploader(*m_opened_iso, filesystem.GetPartition(), output_folder); - DiscIO::ExportDOL(*m_opened_iso, filesystem.GetPartition(), output_folder); + DiscIO::ExportApploader(*m_opened_iso, filesystem.GetPartition(), + output_folder + "/apploader.img"); + DiscIO::ExportDOL(*m_opened_iso, filesystem.GetPartition(), output_folder + "/boot.dol"); } std::unique_ptr file_info = filesystem.FindFileInfo(full_path);