mirror of
https://github.com/jakcron/nstool.git
synced 2024-12-22 18:55:29 +00:00
Catch when NCA partitions fail to be processed due to apparent corruption.
This commit is contained in:
parent
4145ad10db
commit
24306d80ee
|
@ -570,43 +570,47 @@ void NcaProcess::processPartitions()
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (partition.format_type == nn::hac::nca::FormatType::PartitionFs)
|
try {
|
||||||
{
|
if (partition.format_type == nn::hac::nca::FormatType::PartitionFs)
|
||||||
PfsProcess pfs;
|
|
||||||
pfs.setInputFile(partition.reader);
|
|
||||||
pfs.setCliOutputMode(mCliOutputMode);
|
|
||||||
pfs.setListFs(mListFs);
|
|
||||||
if (mHdr.getContentType() == nn::hac::nca::ContentType::Program)
|
|
||||||
{
|
{
|
||||||
pfs.setMountPointName(std::string(getContentTypeForMountStr(mHdr.getContentType())) + ":/" + nn::hac::ContentArchiveUtil::getProgramContentParititionIndexAsString((nn::hac::nca::ProgramContentPartitionIndex)index));
|
PfsProcess pfs;
|
||||||
|
pfs.setInputFile(partition.reader);
|
||||||
|
pfs.setCliOutputMode(mCliOutputMode);
|
||||||
|
pfs.setListFs(mListFs);
|
||||||
|
if (mHdr.getContentType() == nn::hac::nca::ContentType::Program)
|
||||||
|
{
|
||||||
|
pfs.setMountPointName(std::string(getContentTypeForMountStr(mHdr.getContentType())) + ":/" + nn::hac::ContentArchiveUtil::getProgramContentParititionIndexAsString((nn::hac::nca::ProgramContentPartitionIndex)index));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pfs.setMountPointName(std::string(getContentTypeForMountStr(mHdr.getContentType())) + ":/");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mPartitionPath[index].doExtract)
|
||||||
|
pfs.setExtractPath(mPartitionPath[index].path);
|
||||||
|
pfs.process();
|
||||||
}
|
}
|
||||||
else
|
else if (partition.format_type == nn::hac::nca::FormatType::RomFs)
|
||||||
{
|
{
|
||||||
pfs.setMountPointName(std::string(getContentTypeForMountStr(mHdr.getContentType())) + ":/");
|
RomfsProcess romfs;
|
||||||
}
|
romfs.setInputFile(partition.reader);
|
||||||
|
romfs.setCliOutputMode(mCliOutputMode);
|
||||||
if (mPartitionPath[index].doExtract)
|
romfs.setListFs(mListFs);
|
||||||
pfs.setExtractPath(mPartitionPath[index].path);
|
if (mHdr.getContentType() == nn::hac::nca::ContentType::Program)
|
||||||
pfs.process();
|
{
|
||||||
}
|
romfs.setMountPointName(std::string(getContentTypeForMountStr(mHdr.getContentType())) + ":/" + nn::hac::ContentArchiveUtil::getProgramContentParititionIndexAsString((nn::hac::nca::ProgramContentPartitionIndex)index));
|
||||||
else if (partition.format_type == nn::hac::nca::FormatType::RomFs)
|
}
|
||||||
{
|
else
|
||||||
RomfsProcess romfs;
|
{
|
||||||
romfs.setInputFile(partition.reader);
|
romfs.setMountPointName(std::string(getContentTypeForMountStr(mHdr.getContentType())) + ":/");
|
||||||
romfs.setCliOutputMode(mCliOutputMode);
|
}
|
||||||
romfs.setListFs(mListFs);
|
|
||||||
if (mHdr.getContentType() == nn::hac::nca::ContentType::Program)
|
|
||||||
{
|
|
||||||
romfs.setMountPointName(std::string(getContentTypeForMountStr(mHdr.getContentType())) + ":/" + nn::hac::ContentArchiveUtil::getProgramContentParititionIndexAsString((nn::hac::nca::ProgramContentPartitionIndex)index));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
romfs.setMountPointName(std::string(getContentTypeForMountStr(mHdr.getContentType())) + ":/");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mPartitionPath[index].doExtract)
|
if (mPartitionPath[index].doExtract)
|
||||||
romfs.setExtractPath(mPartitionPath[index].path);
|
romfs.setExtractPath(mPartitionPath[index].path);
|
||||||
romfs.process();
|
romfs.process();
|
||||||
|
}
|
||||||
|
} catch (const fnd::Exception& e) {
|
||||||
|
std::cout << "[WARNING] NCA Partition " << std::dec << index << " not readable (" << e.error() << ")." << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue