diff options
| author | Leo Lam <leolino.lam@gmail.com> | 2017-07-04 13:46:18 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-07-04 13:46:18 +0200 |
| commit | e0b94b55b87ce3e0698564a87773afa04459957b (patch) | |
| tree | cc4b6996ca6056f82836f70cc5cbc74fd9353af7 /Source/Core/DiscIO/DiscExtractor.h | |
| parent | aa1d750f30f94e2c80ecc3e8ad9cc865e2076b78 (diff) | |
| parent | a59edfe8cf4c3dd9275058ca1acd88019a3f6abf (diff) | |
Merge pull request #5651 from JosJuice/new-disc-extraction
Use new format for disc extraction
Diffstat (limited to 'Source/Core/DiscIO/DiscExtractor.h')
| -rw-r--r-- | Source/Core/DiscIO/DiscExtractor.h | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/Source/Core/DiscIO/DiscExtractor.h b/Source/Core/DiscIO/DiscExtractor.h new file mode 100644 index 0000000000..b3a1332c4b --- /dev/null +++ b/Source/Core/DiscIO/DiscExtractor.h @@ -0,0 +1,67 @@ +// Copyright 2017 Dolphin Emulator Project +// Licensed under GPLv2+ +// Refer to the license.txt file included. + +#pragma once + +#include <functional> +#include <optional> + +#include "Common/CommonTypes.h" + +namespace DiscIO +{ +class FileInfo; +struct Partition; +class Volume; + +std::string DirectoryNameForPartitionType(u32 partition_type); + +u64 ReadFile(const Volume& volume, const Partition& partition, const FileInfo* file_info, + u8* buffer, u64 max_buffer_size, u64 offset_in_file = 0); +bool ExportData(const Volume& volume, const Partition& partition, u64 offset, u64 size, + const std::string& export_filename); +bool ExportFile(const Volume& volume, const Partition& partition, const FileInfo* file_info, + const std::string& export_filename); + +// update_progress is called once for each child (file or directory). +// If update_progress returns true, the extraction gets cancelled. +// filesystem_path is supposed to be the path corresponding to the directory argument. +void ExportDirectory(const Volume& volume, const Partition partition, const FileInfo& directory, + bool recursive, const std::string& filesystem_path, + const std::string& export_folder, + const std::function<bool(const std::string& path)>& update_progress); + +// To export everything listed below, you can use ExportSystemData + +bool ExportWiiUnencryptedHeader(const Volume& volume, const std::string& export_filename); +bool ExportWiiRegionData(const Volume& volume, const std::string& export_filename); + +bool ExportTicket(const Volume& volume, const Partition& partition, + const std::string& export_filename); +bool ExportTMD(const Volume& volume, const Partition& partition, + const std::string& export_filename); +bool ExportCertificateChain(const Volume& volume, const Partition& partition, + const std::string& export_filename); +bool ExportH3Hashes(const Volume& volume, const Partition& partition, + const std::string& export_filename); + +bool ExportHeader(const Volume& volume, const Partition& partition, + const std::string& export_filename); +bool ExportBI2Data(const Volume& volume, const Partition& partition, + const std::string& export_filename); +bool ExportApploader(const Volume& volume, const Partition& partition, + const std::string& export_filename); +std::optional<u64> GetBootDOLOffset(const Volume& volume, const Partition& partition); +std::optional<u32> GetBootDOLSize(const Volume& volume, const Partition& partition, u64 dol_offset); +bool ExportDOL(const Volume& volume, const Partition& partition, + const std::string& export_filename); +std::optional<u64> GetFSTOffset(const Volume& volume, const Partition& partition); +std::optional<u64> GetFSTSize(const Volume& volume, const Partition& partition); +bool ExportFST(const Volume& volume, const Partition& partition, + const std::string& export_filename); + +bool ExportSystemData(const Volume& volume, const Partition& partition, + const std::string& export_folder); + +} // namespace DiscIO |
