mirror of
https://github.com/jakcron/nstool.git
synced 2024-12-22 18:55:29 +00:00
Begin SparseFs impl
This commit is contained in:
parent
289470d2a8
commit
42de7f6bdc
|
@ -239,6 +239,21 @@ void nstool::NcaProcess::generatePartitionConfiguration()
|
||||||
throw tc::Exception(mModuleName, fmt::format("NCA FS Header [{:d}] Version({:d}): UNSUPPORTED", partition.header_index, fs_header.version.unwrap()));
|
throw tc::Exception(mModuleName, fmt::format("NCA FS Header [{:d}] Version({:d}): UNSUPPORTED", partition.header_index, fs_header.version.unwrap()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// detect sparse
|
||||||
|
if (fs_header.sparse_info.generation.unwrap() != 0)
|
||||||
|
{
|
||||||
|
fmt::print("[IsSparse]\n");
|
||||||
|
fmt::print(" bucket:\n");
|
||||||
|
fmt::print(" offset: 0x{:x}\n", fs_header.sparse_info.bucket.offset.unwrap());
|
||||||
|
fmt::print(" size: 0x{:x}\n", fs_header.sparse_info.bucket.offset.unwrap());
|
||||||
|
fmt::print(" header:\n");
|
||||||
|
fmt::print(" st_magic: {:s}\n", ((tc::bn::string<4>*)&fs_header.sparse_info.bucket.header.st_magic)->str());
|
||||||
|
fmt::print(" version: 0x{:x}\n", fs_header.sparse_info.bucket.header.version.unwrap());
|
||||||
|
fmt::print(" entry_count: {:d}\n", fs_header.sparse_info.bucket.header.entry_count.unwrap());
|
||||||
|
fmt::print(" physical_offset: 0x{:x}\n", fs_header.sparse_info.physical_offset.unwrap());
|
||||||
|
fmt::print(" generation: 0x{:x}\n", fs_header.sparse_info.generation.unwrap());
|
||||||
|
}
|
||||||
|
|
||||||
// setup AES-CTR
|
// setup AES-CTR
|
||||||
nn::hac::ContentArchiveUtil::getNcaPartitionAesCtr(&fs_header, info.aes_ctr.data());
|
nn::hac::ContentArchiveUtil::getNcaPartitionAesCtr(&fs_header, info.aes_ctr.data());
|
||||||
|
|
||||||
|
|
|
@ -85,6 +85,11 @@ private:
|
||||||
tc::Optional<nn::hac::detail::aes128_key_t> aes_ctr;
|
tc::Optional<nn::hac::detail::aes128_key_t> aes_ctr;
|
||||||
} mContentKey;
|
} mContentKey;
|
||||||
|
|
||||||
|
struct SparseInfo
|
||||||
|
{
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
// raw partition data
|
// raw partition data
|
||||||
struct sPartitionInfo
|
struct sPartitionInfo
|
||||||
{
|
{
|
||||||
|
@ -106,6 +111,9 @@ private:
|
||||||
|
|
||||||
// crypto metadata
|
// crypto metadata
|
||||||
nn::hac::detail::aes_iv_t aes_ctr;
|
nn::hac::detail::aes_iv_t aes_ctr;
|
||||||
|
|
||||||
|
// sparse metadata
|
||||||
|
SparseInfo sparse_info;
|
||||||
};
|
};
|
||||||
|
|
||||||
std::array<sPartitionInfo, nn::hac::nca::kPartitionNum> mPartitions;
|
std::array<sPartitionInfo, nn::hac::nca::kPartitionNum> mPartitions;
|
||||||
|
|
Loading…
Reference in a new issue