card_image: Add accessors for raw partitions in XCI

This commit is contained in:
Zach Hilman 2019-09-22 21:51:46 -04:00
parent 3952c73aee
commit c4f3400bea
2 changed files with 36 additions and 0 deletions

View File

@ -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();
}

View File

@ -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();