From c6d8b9707b0bffec657e937ada5dd66ca504889e Mon Sep 17 00:00:00 2001 From: jakcron Date: Sat, 16 Oct 2021 15:41:45 +0800 Subject: [PATCH] Fix ivfc hash fail bug. --- deps/libnintendo-hac | 2 +- src/NcaProcess.cpp | 47 ++------------------------------------------ 2 files changed, 3 insertions(+), 46 deletions(-) diff --git a/deps/libnintendo-hac b/deps/libnintendo-hac index af43764..d806d65 160000 --- a/deps/libnintendo-hac +++ b/deps/libnintendo-hac @@ -1 +1 @@ -Subproject commit af437641b9d14381baf69c9399f4177cece7840c +Subproject commit d806d65bb7e86e3b24ebbc6ab4279ec2eb92c0bd diff --git a/src/NcaProcess.cpp b/src/NcaProcess.cpp index ccc042f..0c897a2 100644 --- a/src/NcaProcess.cpp +++ b/src/NcaProcess.cpp @@ -336,6 +336,8 @@ void nstool::NcaProcess::generatePartitionConfiguration() // filter out unrecognised hash types, and hash based readers switch (info.hash_type) { + case (nn::hac::nca::HashType::None): + break; case (nn::hac::nca::HashType::HierarchicalSha256): info.reader = std::make_shared(nn::hac::HierarchicalSha256Stream(info.reader, info.hierarchicalsha256_hdr)); break; @@ -576,51 +578,6 @@ void nstool::NcaProcess::processPartitions() } mount_points.push_back( { mount_point_name, partition.fs_meta } ); - - /* - 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)); - } - else - { - pfs.setMountPointName(std::string(getContentTypeForMountStr(mHdr.getContentType())) + ":/"); - } - - if (mPartitionPath[index].doExtract) - pfs.setExtractPath(mPartitionPath[index].path); - pfs.process(); - } - else if (partition.format_type == nn::hac::nca::FormatType::RomFs) - { - RomfsProcess romfs; - romfs.setInputFile(partition.reader); - 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) - romfs.setExtractPath(mPartitionPath[index].path); - romfs.process(); - } - } catch (const tc::Exception& e) { - std::cout << "[WARNING] NCA Partition " << std::dec << index << " not readable (" << e.error() << ")." << std::endl; - } - */ } tc::io::VirtualFileSystem::FileSystemMeta fs_meta = nn::hac::CombinedFsMetaGenerator(mount_points);