diff options
-rw-r--r-- | src/core/file_sys/card_image.cpp | 29 | ||||
-rw-r--r-- | src/core/file_sys/card_image.h | 7 |
2 files changed, 36 insertions, 0 deletions
diff --git a/src/core/file_sys/card_image.cpp b/src/core/file_sys/card_image.cpp index c79f0885e..a6a68b748 100644 --- a/src/core/file_sys/card_image.cpp +++ b/src/core/file_sys/card_image.cpp @@ -139,6 +139,35 @@ VirtualDir XCI::GetLogoPartition() { return GetPartition(XCIPartition::Logo); } +VirtualFile XCI::GetPartitionRaw(XCIPartition partition) const { + return partitions_raw[static_cast<std::size_t>(partition)]; +} + +VirtualFile XCI::GetSecurePartitionRaw() const { + return GetPartitionRaw(XCIPartition::Secure); +} + +VirtualFile XCI::GetStoragePartition0() const { + return std::make_shared<OffsetVfsFile>(file, update_normal_partition_end, 0, "partition0"); +} + +VirtualFile XCI::GetStoragePartition1() const { + return std::make_shared<OffsetVfsFile>(file, file->GetSize() - update_normal_partition_end, + update_normal_partition_end, "partition1"); +} + +VirtualFile XCI::GetNormalPartitionRaw() const { + return GetPartitionRaw(XCIPartition::Normal); +} + +VirtualFile XCI::GetUpdatePartitionRaw() const { + return GetPartitionRaw(XCIPartition::Update); +} + +VirtualFile XCI::GetLogoPartitionRaw() const { + return GetPartitionRaw(XCIPartition::Logo); +} + u64 XCI::GetProgramTitleID() const { return secure_partition->GetProgramTitleID(); } diff --git a/src/core/file_sys/card_image.h b/src/core/file_sys/card_image.h index ea2ad7741..c2ee0ea99 100644 --- a/src/core/file_sys/card_image.h +++ b/src/core/file_sys/card_image.h @@ -92,6 +92,13 @@ public: VirtualDir GetUpdatePartition(); VirtualDir GetLogoPartition(); + VirtualFile GetPartitionRaw(XCIPartition partition) const; + VirtualFile GetSecurePartitionRaw() const; + VirtualFile GetStoragePartition0() const; + VirtualFile GetStoragePartition1() const; + VirtualFile GetNormalPartitionRaw() const; + VirtualFile GetUpdatePartitionRaw() const; + VirtualFile GetLogoPartitionRaw() const; u64 GetProgramTitleID() const; u32 GetSystemUpdateVersion(); |