From 6069cbb1cb5570c77ea99cd197529d3f6934dacf Mon Sep 17 00:00:00 2001 From: jakcron Date: Tue, 15 May 2018 21:36:04 +0800 Subject: [PATCH] [nstool] Remove magic values. --- programs/nstool/source/NcaProcess.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/programs/nstool/source/NcaProcess.cpp b/programs/nstool/source/NcaProcess.cpp index 559d2d0..f7bb715 100644 --- a/programs/nstool/source/NcaProcess.cpp +++ b/programs/nstool/source/NcaProcess.cpp @@ -242,12 +242,12 @@ void NcaProcess::validateNcaSignatures() // validate signature[1] if (mHdr.getContentType() == nx::nca::TYPE_PROGRAM) { - if (mPartitions[0].format_type == nx::nca::FORMAT_PFS0) + if (mPartitions[nx::nca::PARTITION_CODE].format_type == nx::nca::FORMAT_PFS0) { - if (mPartitions[0].reader != nullptr) + if (mPartitions[nx::nca::PARTITION_CODE].reader != nullptr) { PfsProcess exefs; - exefs.setInputFile(mPartitions[0].reader, mPartitions[0].offset + mPartitions[0].data_offset, mPartitions[0].data_size); + exefs.setInputFile(mPartitions[nx::nca::PARTITION_CODE].reader, mPartitions[nx::nca::PARTITION_CODE].offset + mPartitions[nx::nca::PARTITION_CODE].data_offset, mPartitions[nx::nca::PARTITION_CODE].data_size); exefs.setCliOutputMode(OUTPUT_MINIMAL); exefs.process(); @@ -257,7 +257,7 @@ void NcaProcess::validateNcaSignatures() const nx::PfsHeader::sFile& file = exefs.getPfsHeader().getFileList()[exefs.getPfsHeader().getFileList().getIndexOf(kNpdmExefsPath)]; NpdmProcess npdm; - npdm.setInputFile(mPartitions[0].reader, mPartitions[0].offset + mPartitions[0].data_offset + file.offset, file.size); + npdm.setInputFile(mPartitions[nx::nca::PARTITION_CODE].reader, mPartitions[nx::nca::PARTITION_CODE].offset + mPartitions[nx::nca::PARTITION_CODE].data_offset + file.offset, file.size); npdm.setCliOutputMode(OUTPUT_MINIMAL); npdm.process();