nstool/src/NacpProcess.cpp

530 lines
20 KiB
C++
Raw Permalink Normal View History

#include "NacpProcess.h"
2022-06-29 13:19:36 +00:00
#include <pietendo/hac/ApplicationControlPropertyUtil.h>
2019-01-31 09:10:19 +00:00
nstool::NacpProcess::NacpProcess() :
2021-10-01 12:46:35 +00:00
mModuleName("nstool::NacpProcess"),
2019-01-31 09:10:19 +00:00
mFile(),
2021-10-01 12:46:35 +00:00
mCliOutputMode(true, false, false, false),
2019-01-31 09:10:19 +00:00
mVerify(false)
{
}
void nstool::NacpProcess::process()
2019-01-31 09:10:19 +00:00
{
importNacp();
if (mCliOutputMode.show_basic_info)
2019-01-31 09:10:19 +00:00
displayNacp();
}
void nstool::NacpProcess::setInputFile(const std::shared_ptr<tc::io::IStream>& file)
2019-01-31 09:10:19 +00:00
{
mFile = file;
}
void nstool::NacpProcess::setCliOutputMode(CliOutputMode type)
2019-01-31 09:10:19 +00:00
{
mCliOutputMode = type;
}
void nstool::NacpProcess::setVerifyMode(bool verify)
2019-01-31 09:10:19 +00:00
{
mVerify = verify;
}
2022-06-29 13:19:36 +00:00
const pie::hac::ApplicationControlProperty& nstool::NacpProcess::getApplicationControlProperty() const
2019-01-31 09:10:19 +00:00
{
return mNacp;
}
void nstool::NacpProcess::importNacp()
2019-01-31 09:10:19 +00:00
{
2021-10-01 12:46:35 +00:00
if (mFile == nullptr)
{
throw tc::Exception(mModuleName, "No file reader set.");
}
2021-10-03 04:01:23 +00:00
if (mFile->canRead() == false || mFile->canSeek() == false)
{
throw tc::NotSupportedException(mModuleName, "Input stream requires read/seek permissions.");
}
2019-01-31 09:10:19 +00:00
2021-10-03 04:01:23 +00:00
// check if file_size does matches expected size
2021-10-01 12:46:35 +00:00
size_t file_size = tc::io::IOUtil::castInt64ToSize(mFile->length());
2022-06-29 13:19:36 +00:00
if (file_size != sizeof(pie::hac::sApplicationControlProperty))
2019-01-31 09:10:19 +00:00
{
2021-10-03 04:01:23 +00:00
throw tc::Exception(mModuleName, "File was incorrect size.");
2019-01-31 09:10:19 +00:00
}
2021-10-01 12:46:35 +00:00
// read cnmt
tc::ByteData scratch = tc::ByteData(file_size);
mFile->seek(0, tc::io::SeekOrigin::Begin);
mFile->read(scratch.data(), scratch.size());
2019-01-31 09:10:19 +00:00
mNacp.fromBytes(scratch.data(), scratch.size());
}
void nstool::NacpProcess::displayNacp()
2019-01-31 09:10:19 +00:00
{
2021-10-01 12:46:35 +00:00
fmt::print("[ApplicationControlProperty]\n");
2020-03-14 02:27:26 +00:00
// Title
if (mNacp.getTitle().size() > 0)
2019-01-31 09:10:19 +00:00
{
2021-10-01 12:46:35 +00:00
fmt::print(" Title:\n");
2020-03-14 02:27:26 +00:00
for (auto itr = mNacp.getTitle().begin(); itr != mNacp.getTitle().end(); itr++)
2019-01-31 09:10:19 +00:00
{
2022-06-29 13:19:36 +00:00
fmt::print(" {:s}:\n", pie::hac::ApplicationControlPropertyUtil::getLanguageAsString(itr->language));
2021-10-01 12:46:35 +00:00
fmt::print(" Name: {:s}\n", itr->name);
fmt::print(" Publisher: {:s}\n", itr->publisher);
2019-01-31 09:10:19 +00:00
}
}
else if (mCliOutputMode.show_extended_info)
2020-03-14 02:27:26 +00:00
{
2021-10-01 12:46:35 +00:00
fmt::print(" Title: None\n");
2020-03-14 02:27:26 +00:00
}
// Isbn
if (mNacp.getIsbn().empty() == false)
{
2021-10-01 12:46:35 +00:00
fmt::print(" ISBN: {:s}\n", mNacp.getIsbn());
2020-03-14 02:27:26 +00:00
}
else if (mCliOutputMode.show_extended_info)
2019-01-31 09:10:19 +00:00
{
2021-10-01 12:46:35 +00:00
fmt::print(" ISBN: (NotSet)\n");
2019-01-31 09:10:19 +00:00
}
2020-03-14 02:27:26 +00:00
// StartupUserAccount
2022-06-29 13:19:36 +00:00
if (mNacp.getStartupUserAccount() != pie::hac::nacp::StartupUserAccount_None || mCliOutputMode.show_extended_info)
2020-03-14 02:27:26 +00:00
{
2022-06-29 13:19:36 +00:00
fmt::print(" StartupUserAccount: {:s}\n", pie::hac::ApplicationControlPropertyUtil::getStartupUserAccountAsString(mNacp.getStartupUserAccount()));
2020-03-14 02:27:26 +00:00
}
// UserAccountSwitchLock
2022-06-29 13:19:36 +00:00
if (mNacp.getUserAccountSwitchLock() != pie::hac::nacp::UserAccountSwitchLock_Disable || mCliOutputMode.show_extended_info)
2019-01-31 09:10:19 +00:00
{
2022-06-29 13:19:36 +00:00
fmt::print(" UserAccountSwitchLock: {:s}\n", pie::hac::ApplicationControlPropertyUtil::getUserAccountSwitchLockAsString(mNacp.getUserAccountSwitchLock()));
2019-01-31 09:10:19 +00:00
}
2020-03-14 02:27:26 +00:00
// AddOnContentRegistrationType
2022-06-29 13:19:36 +00:00
if (mNacp.getAddOnContentRegistrationType() != pie::hac::nacp::AddOnContentRegistrationType_AllOnLaunch || mCliOutputMode.show_extended_info)
2020-03-14 02:27:26 +00:00
{
2022-06-29 13:19:36 +00:00
fmt::print(" AddOnContentRegistrationType: {:s}\n", pie::hac::ApplicationControlPropertyUtil::getAddOnContentRegistrationTypeAsString(mNacp.getAddOnContentRegistrationType()));
2020-03-14 02:27:26 +00:00
}
// Attribute
if (mNacp.getAttribute().size() > 0)
{
2021-10-01 12:46:35 +00:00
fmt::print(" Attribute:\n");
2020-03-14 02:27:26 +00:00
for (auto itr = mNacp.getAttribute().begin(); itr != mNacp.getAttribute().end(); itr++)
{
2022-06-29 13:19:36 +00:00
fmt::print(" {:s}\n", pie::hac::ApplicationControlPropertyUtil::getAttributeFlagAsString(*itr));
2020-03-14 02:27:26 +00:00
}
}
else if (mCliOutputMode.show_extended_info)
2020-03-14 02:27:26 +00:00
{
2021-10-01 12:46:35 +00:00
fmt::print(" Attribute: None\n");
2020-03-14 02:27:26 +00:00
}
// SupportedLanguage
if (mNacp.getSupportedLanguage().size() > 0)
{
2021-10-01 12:46:35 +00:00
fmt::print(" SupportedLanguage:\n");
2020-03-14 02:27:26 +00:00
for (auto itr = mNacp.getSupportedLanguage().begin(); itr != mNacp.getSupportedLanguage().end(); itr++)
{
2022-06-29 13:19:36 +00:00
fmt::print(" {:s}\n", pie::hac::ApplicationControlPropertyUtil::getLanguageAsString(*itr));
2020-03-14 02:27:26 +00:00
}
}
else if (mCliOutputMode.show_extended_info)
2020-03-14 02:27:26 +00:00
{
2021-10-01 12:46:35 +00:00
fmt::print(" SupportedLanguage: None\n");
2020-03-14 02:27:26 +00:00
}
// ParentalControl
if (mNacp.getParentalControl().size() > 0)
{
2021-10-01 12:46:35 +00:00
fmt::print(" ParentalControl:\n");
2020-03-14 02:27:26 +00:00
for (auto itr = mNacp.getParentalControl().begin(); itr != mNacp.getParentalControl().end(); itr++)
{
2022-06-29 13:19:36 +00:00
fmt::print(" {:s}\n", pie::hac::ApplicationControlPropertyUtil::getParentalControlFlagAsString(*itr));
2020-03-14 02:27:26 +00:00
}
}
else if (mCliOutputMode.show_extended_info)
2020-03-14 02:27:26 +00:00
{
2021-10-01 12:46:35 +00:00
fmt::print(" ParentalControl: None\n");
2020-03-14 02:27:26 +00:00
}
// Screenshot
2022-06-29 13:19:36 +00:00
if (mNacp.getScreenshot() != pie::hac::nacp::Screenshot_Allow || mCliOutputMode.show_extended_info)
2020-03-14 02:27:26 +00:00
{
2022-06-29 13:19:36 +00:00
fmt::print(" Screenshot: {:s}\n", pie::hac::ApplicationControlPropertyUtil::getScreenshotAsString(mNacp.getScreenshot()));
2020-03-14 02:27:26 +00:00
}
// VideoCapture
2022-06-29 13:19:36 +00:00
if (mNacp.getVideoCapture() != pie::hac::nacp::VideoCapture_Disable || mCliOutputMode.show_extended_info)
2020-03-14 02:27:26 +00:00
{
2022-06-29 13:19:36 +00:00
fmt::print(" VideoCapture: {:s}\n", pie::hac::ApplicationControlPropertyUtil::getVideoCaptureAsString(mNacp.getVideoCapture()));
2020-03-14 02:27:26 +00:00
}
// DataLossConfirmation
2022-06-29 13:19:36 +00:00
if (mNacp.getDataLossConfirmation() != pie::hac::nacp::DataLossConfirmation_None || mCliOutputMode.show_extended_info)
2020-03-14 02:27:26 +00:00
{
2022-06-29 13:19:36 +00:00
fmt::print(" DataLossConfirmation: {:s}\n", pie::hac::ApplicationControlPropertyUtil::getDataLossConfirmationAsString(mNacp.getDataLossConfirmation()));
2020-03-14 02:27:26 +00:00
}
// PlayLogPolicy
2022-06-29 13:19:36 +00:00
if (mNacp.getPlayLogPolicy() != pie::hac::nacp::PlayLogPolicy_All || mCliOutputMode.show_extended_info)
2020-03-14 02:27:26 +00:00
{
2022-06-29 13:19:36 +00:00
fmt::print(" PlayLogPolicy: {:s}\n", pie::hac::ApplicationControlPropertyUtil::getPlayLogPolicyAsString(mNacp.getPlayLogPolicy()));
2020-03-14 02:27:26 +00:00
}
// PresenceGroupId
if (mNacp.getPresenceGroupId() != 0 || mCliOutputMode.show_extended_info)
2020-03-14 02:27:26 +00:00
{
2021-10-01 12:46:35 +00:00
fmt::print(" PresenceGroupId: 0x{:016x}\n", mNacp.getPresenceGroupId());
2020-03-14 02:27:26 +00:00
}
// RatingAge
if (mNacp.getRatingAge().size() > 0)
{
2021-10-01 12:46:35 +00:00
fmt::print(" RatingAge:\n");
2020-03-14 02:27:26 +00:00
for (auto itr = mNacp.getRatingAge().begin(); itr != mNacp.getRatingAge().end(); itr++)
{
2022-06-29 13:19:36 +00:00
fmt::print(" {:s}:\n", pie::hac::ApplicationControlPropertyUtil::getOrganisationAsString(itr->organisation));
2021-10-01 12:46:35 +00:00
fmt::print(" Age: {:d}\n", itr->age);
2020-03-14 02:27:26 +00:00
}
}
else if (mCliOutputMode.show_extended_info)
2020-03-14 02:27:26 +00:00
{
2021-10-01 12:46:35 +00:00
fmt::print(" RatingAge: None\n");
2020-03-14 02:27:26 +00:00
}
// DisplayVersion
if (mNacp.getDisplayVersion().empty() == false)
{
2021-10-01 12:46:35 +00:00
fmt::print(" DisplayVersion: {:s}\n", mNacp.getDisplayVersion());
2020-03-14 02:27:26 +00:00
}
else if (mCliOutputMode.show_extended_info)
2020-03-14 02:27:26 +00:00
{
2021-10-01 12:46:35 +00:00
fmt::print(" DisplayVersion: (NotSet)\n");
2020-03-14 02:27:26 +00:00
}
// AddOnContentBaseId
if (mNacp.getAddOnContentBaseId() != 0 || mCliOutputMode.show_extended_info)
2020-03-14 02:27:26 +00:00
{
2021-10-01 12:46:35 +00:00
fmt::print(" AddOnContentBaseId: 0x{:016x}\n", mNacp.getAddOnContentBaseId());
2020-03-14 02:27:26 +00:00
}
// SaveDataOwnerId
if (mNacp.getSaveDataOwnerId() != 0 || mCliOutputMode.show_extended_info)
2020-03-14 02:27:26 +00:00
{
2021-10-01 12:46:35 +00:00
fmt::print(" SaveDataOwnerId: 0x{:016x}\n", mNacp.getSaveDataOwnerId());
2020-03-14 02:27:26 +00:00
}
// UserAccountSaveDataSize
if (mNacp.getUserAccountSaveDataSize().size != 0 || mCliOutputMode.show_extended_info)
2020-03-14 02:27:26 +00:00
{
2022-06-29 13:19:36 +00:00
fmt::print(" UserAccountSaveDataSize: {:s}\n", pie::hac::ApplicationControlPropertyUtil::getSaveDataSizeAsString(mNacp.getUserAccountSaveDataSize().size));
2020-03-14 02:27:26 +00:00
}
// UserAccountSaveDataJournalSize
if (mNacp.getUserAccountSaveDataSize().journal_size != 0 || mCliOutputMode.show_extended_info)
2020-03-14 02:27:26 +00:00
{
2022-06-29 13:19:36 +00:00
fmt::print(" UserAccountSaveDataJournalSize: {:s}\n", pie::hac::ApplicationControlPropertyUtil::getSaveDataSizeAsString(mNacp.getUserAccountSaveDataSize().journal_size));
2020-03-14 02:27:26 +00:00
}
// DeviceSaveDataSize
if (mNacp.getDeviceSaveDataSize().size != 0 || mCliOutputMode.show_extended_info)
2020-03-14 02:27:26 +00:00
{
2022-06-29 13:19:36 +00:00
fmt::print(" DeviceSaveDataSize: {:s}\n", pie::hac::ApplicationControlPropertyUtil::getSaveDataSizeAsString(mNacp.getDeviceSaveDataSize().size));
2020-03-14 02:27:26 +00:00
}
// DeviceSaveDataJournalSize
if (mNacp.getDeviceSaveDataSize().journal_size != 0 || mCliOutputMode.show_extended_info)
2020-03-14 02:27:26 +00:00
{
2022-06-29 13:19:36 +00:00
fmt::print(" DeviceSaveDataJournalSize: {:s}\n", pie::hac::ApplicationControlPropertyUtil::getSaveDataSizeAsString(mNacp.getDeviceSaveDataSize().journal_size));
2020-03-14 02:27:26 +00:00
}
// BcatDeliveryCacheStorageSize
if (mNacp.getBcatDeliveryCacheStorageSize() != 0 || mCliOutputMode.show_extended_info)
2020-03-14 02:27:26 +00:00
{
2022-06-29 13:19:36 +00:00
fmt::print(" BcatDeliveryCacheStorageSize: {:s}\n", pie::hac::ApplicationControlPropertyUtil::getSaveDataSizeAsString(mNacp.getBcatDeliveryCacheStorageSize()));
2020-03-14 02:27:26 +00:00
}
// ApplicationErrorCodeCategory
if (mNacp.getApplicationErrorCodeCategory().empty() == false)
{
2021-10-01 12:46:35 +00:00
fmt::print(" ApplicationErrorCodeCategory: {:s}\n", mNacp.getApplicationErrorCodeCategory());
2020-03-14 02:27:26 +00:00
}
else if (mCliOutputMode.show_extended_info)
2020-03-14 02:27:26 +00:00
{
2021-10-01 12:46:35 +00:00
fmt::print(" ApplicationErrorCodeCategory: (NotSet)\n");
2020-03-14 02:27:26 +00:00
}
// LocalCommunicationId
2019-01-31 09:10:19 +00:00
if (mNacp.getLocalCommunicationId().size() > 0)
{
2021-10-01 12:46:35 +00:00
fmt::print(" LocalCommunicationId:\n");
2020-03-14 02:27:26 +00:00
for (auto itr = mNacp.getLocalCommunicationId().begin(); itr != mNacp.getLocalCommunicationId().end(); itr++)
2019-01-31 09:10:19 +00:00
{
2021-10-01 12:46:35 +00:00
fmt::print(" 0x{:016x}\n", *itr);
2019-01-31 09:10:19 +00:00
}
}
else if (mCliOutputMode.show_extended_info)
2019-01-31 09:10:19 +00:00
{
2021-10-01 12:46:35 +00:00
fmt::print(" LocalCommunicationId: None\n");
2019-01-31 09:10:19 +00:00
}
2020-03-14 02:27:26 +00:00
// LogoType
2022-06-29 13:19:36 +00:00
//if (mNacp.getLogoType() != pie::hac::nacp::LogoType_Nintendo || mCliOutputMode.show_extended_info)
2020-03-14 02:27:26 +00:00
//{
2022-06-29 13:19:36 +00:00
fmt::print(" LogoType: {:s}\n", pie::hac::ApplicationControlPropertyUtil::getLogoTypeAsString(mNacp.getLogoType()));
2020-03-14 02:27:26 +00:00
//}
// LogoHandling
2022-06-29 13:19:36 +00:00
if (mNacp.getLogoHandling() != pie::hac::nacp::LogoHandling_Auto || mCliOutputMode.show_extended_info)
2020-03-14 02:27:26 +00:00
{
2022-06-29 13:19:36 +00:00
fmt::print(" LogoHandling: {:s}\n", pie::hac::ApplicationControlPropertyUtil::getLogoHandlingAsString(mNacp.getLogoHandling()));
2020-03-14 02:27:26 +00:00
}
// RuntimeAddOnContentInstall
2022-06-29 13:19:36 +00:00
if (mNacp.getRuntimeAddOnContentInstall() != pie::hac::nacp::RuntimeAddOnContentInstall_Deny || mCliOutputMode.show_extended_info)
2020-03-14 02:27:26 +00:00
{
2022-06-29 13:19:36 +00:00
fmt::print(" RuntimeAddOnContentInstall: {:s}\n", pie::hac::ApplicationControlPropertyUtil::getRuntimeAddOnContentInstallAsString(mNacp.getRuntimeAddOnContentInstall()));
2020-03-14 02:27:26 +00:00
}
// RuntimeParameterDelivery
2022-06-29 13:19:36 +00:00
if (mNacp.getRuntimeParameterDelivery() != pie::hac::nacp::RuntimeParameterDelivery_Always || mCliOutputMode.show_extended_info)
2020-03-14 02:27:26 +00:00
{
2022-06-29 13:19:36 +00:00
fmt::print(" RuntimeParameterDelivery: {:s}\n", pie::hac::ApplicationControlPropertyUtil::getRuntimeParameterDeliveryAsString(mNacp.getRuntimeParameterDelivery()));
2020-03-14 02:27:26 +00:00
}
// CrashReport
2022-06-29 13:19:36 +00:00
if (mNacp.getCrashReport() != pie::hac::nacp::CrashReport_Deny || mCliOutputMode.show_extended_info)
2020-03-14 02:27:26 +00:00
{
2022-06-29 13:19:36 +00:00
fmt::print(" CrashReport: {:s}\n", pie::hac::ApplicationControlPropertyUtil::getCrashReportAsString(mNacp.getCrashReport()));
2020-03-14 02:27:26 +00:00
}
// Hdcp
2022-06-29 13:19:36 +00:00
if (mNacp.getHdcp() != pie::hac::nacp::Hdcp_None || mCliOutputMode.show_extended_info)
2020-03-14 02:27:26 +00:00
{
2022-06-29 13:19:36 +00:00
fmt::print(" Hdcp: {:s}\n", pie::hac::ApplicationControlPropertyUtil::getHdcpAsString(mNacp.getHdcp()));
2020-03-14 02:27:26 +00:00
}
// SeedForPsuedoDeviceId
if (mNacp.getSeedForPsuedoDeviceId() != 0 || mCliOutputMode.show_extended_info)
2020-03-14 02:27:26 +00:00
{
2021-10-01 12:46:35 +00:00
fmt::print(" SeedForPsuedoDeviceId: 0x{:016x}\n", mNacp.getSeedForPsuedoDeviceId());
2020-03-14 02:27:26 +00:00
}
// BcatPassphase
if (mNacp.getBcatPassphase().empty() == false)
{
2021-10-01 12:46:35 +00:00
fmt::print(" BcatPassphase: {:s}\n", mNacp.getBcatPassphase());
2020-03-14 02:27:26 +00:00
}
else if (mCliOutputMode.show_extended_info)
2020-03-14 02:27:26 +00:00
{
2021-10-01 12:46:35 +00:00
fmt::print(" BcatPassphase: (NotSet)\n");
2020-03-14 02:27:26 +00:00
}
// StartupUserAccountOption
if (mNacp.getStartupUserAccountOption().size() > 0)
{
2021-10-01 12:46:35 +00:00
fmt::print(" StartupUserAccountOption:\n");
2020-03-14 02:27:26 +00:00
for (auto itr = mNacp.getStartupUserAccountOption().begin(); itr != mNacp.getStartupUserAccountOption().end(); itr++)
{
2022-06-29 13:19:36 +00:00
fmt::print(" {:s}\n", pie::hac::ApplicationControlPropertyUtil::getStartupUserAccountOptionFlagAsString(*itr));
2020-03-14 02:27:26 +00:00
}
}
else if (mCliOutputMode.show_extended_info)
2020-03-14 02:27:26 +00:00
{
2021-10-01 12:46:35 +00:00
fmt::print(" StartupUserAccountOption: None\n");
2020-03-14 02:27:26 +00:00
}
// UserAccountSaveDataSizeMax
if (mNacp.getUserAccountSaveDataMax().size != 0 || mCliOutputMode.show_extended_info)
2020-03-14 02:27:26 +00:00
{
2022-06-29 13:19:36 +00:00
fmt::print(" UserAccountSaveDataSizeMax: {:s}\n", pie::hac::ApplicationControlPropertyUtil::getSaveDataSizeAsString(mNacp.getUserAccountSaveDataMax().size));
2020-03-14 02:27:26 +00:00
}
// UserAccountSaveDataJournalSizeMax
if (mNacp.getUserAccountSaveDataMax().journal_size != 0 || mCliOutputMode.show_extended_info)
2020-03-14 02:27:26 +00:00
{
2022-06-29 13:19:36 +00:00
fmt::print(" UserAccountSaveDataJournalSizeMax: {:s}\n", pie::hac::ApplicationControlPropertyUtil::getSaveDataSizeAsString(mNacp.getUserAccountSaveDataMax().journal_size));
2020-03-14 02:27:26 +00:00
}
// DeviceSaveDataSizeMax
if (mNacp.getDeviceSaveDataMax().size != 0 || mCliOutputMode.show_extended_info)
2020-03-14 02:27:26 +00:00
{
2022-06-29 13:19:36 +00:00
fmt::print(" DeviceSaveDataSizeMax: {:s}\n", pie::hac::ApplicationControlPropertyUtil::getSaveDataSizeAsString(mNacp.getDeviceSaveDataMax().size));
2020-03-14 02:27:26 +00:00
}
// DeviceSaveDataJournalSizeMax
if (mNacp.getDeviceSaveDataMax().journal_size != 0 || mCliOutputMode.show_extended_info)
2020-03-14 02:27:26 +00:00
{
2022-06-29 13:19:36 +00:00
fmt::print(" DeviceSaveDataJournalSizeMax: {:s}\n", pie::hac::ApplicationControlPropertyUtil::getSaveDataSizeAsString(mNacp.getDeviceSaveDataMax().journal_size));
2020-03-14 02:27:26 +00:00
}
// TemporaryStorageSize
if (mNacp.getTemporaryStorageSize() != 0 || mCliOutputMode.show_extended_info)
2020-03-14 02:27:26 +00:00
{
2022-06-29 13:19:36 +00:00
fmt::print(" TemporaryStorageSize: {:s}\n", pie::hac::ApplicationControlPropertyUtil::getSaveDataSizeAsString(mNacp.getTemporaryStorageSize()));
2020-03-14 02:27:26 +00:00
}
// CacheStorageSize
if (mNacp.getCacheStorageSize().size != 0 || mCliOutputMode.show_extended_info)
2020-03-14 02:27:26 +00:00
{
2022-06-29 13:19:36 +00:00
fmt::print(" CacheStorageSize: {:s}\n", pie::hac::ApplicationControlPropertyUtil::getSaveDataSizeAsString(mNacp.getCacheStorageSize().size));
2020-03-14 02:27:26 +00:00
}
// CacheStorageJournalSize
if (mNacp.getCacheStorageSize().journal_size != 0 || mCliOutputMode.show_extended_info)
2020-03-14 02:27:26 +00:00
{
2022-06-29 13:19:36 +00:00
fmt::print(" CacheStorageJournalSize: {:s}\n", pie::hac::ApplicationControlPropertyUtil::getSaveDataSizeAsString(mNacp.getCacheStorageSize().journal_size));
2020-03-14 02:27:26 +00:00
}
// CacheStorageDataAndJournalSizeMax
if (mNacp.getCacheStorageDataAndJournalSizeMax() != 0 || mCliOutputMode.show_extended_info)
2020-03-14 02:27:26 +00:00
{
2022-06-29 13:19:36 +00:00
fmt::print(" CacheStorageDataAndJournalSizeMax: {:s}\n", pie::hac::ApplicationControlPropertyUtil::getSaveDataSizeAsString(mNacp.getCacheStorageDataAndJournalSizeMax()));
2020-03-14 02:27:26 +00:00
}
// CacheStorageIndexMax
if (mNacp.getCacheStorageIndexMax() != 0 || mCliOutputMode.show_extended_info)
2020-03-14 02:27:26 +00:00
{
2021-10-01 12:46:35 +00:00
fmt::print(" CacheStorageIndexMax: 0x{:04x}\n", mNacp.getCacheStorageIndexMax());
2020-03-14 02:27:26 +00:00
}
// PlayLogQueryableApplicationId
if (mNacp.getPlayLogQueryableApplicationId().size() > 0)
{
2021-10-01 12:46:35 +00:00
fmt::print(" PlayLogQueryableApplicationId:\n");
2020-03-14 02:27:26 +00:00
for (auto itr = mNacp.getPlayLogQueryableApplicationId().begin(); itr != mNacp.getPlayLogQueryableApplicationId().end(); itr++)
{
2021-10-01 12:46:35 +00:00
fmt::print(" 0x{:016x}\n", *itr);
2020-03-14 02:27:26 +00:00
}
}
else if (mCliOutputMode.show_extended_info)
2020-03-14 02:27:26 +00:00
{
2021-10-01 12:46:35 +00:00
fmt::print(" PlayLogQueryableApplicationId: None\n");
2020-03-14 02:27:26 +00:00
}
// PlayLogQueryCapability
2022-06-29 13:19:36 +00:00
if (mNacp.getPlayLogQueryCapability() != pie::hac::nacp::PlayLogQueryCapability_None || mCliOutputMode.show_extended_info)
2019-01-31 09:10:19 +00:00
{
2022-06-29 13:19:36 +00:00
fmt::print(" PlayLogQueryCapability: {:s}\n", pie::hac::ApplicationControlPropertyUtil::getPlayLogQueryCapabilityAsString(mNacp.getPlayLogQueryCapability()));
2019-01-31 09:10:19 +00:00
}
2020-03-14 02:27:26 +00:00
// Repair
if (mNacp.getRepair().size() > 0)
{
2021-10-01 12:46:35 +00:00
fmt::print(" Repair:\n");
2020-03-14 02:27:26 +00:00
for (auto itr = mNacp.getRepair().begin(); itr != mNacp.getRepair().end(); itr++)
{
2022-06-29 13:19:36 +00:00
fmt::print(" {:s}\n", pie::hac::ApplicationControlPropertyUtil::getRepairFlagAsString(*itr));
2020-03-14 02:27:26 +00:00
}
}
else if (mCliOutputMode.show_extended_info)
2019-01-31 09:10:19 +00:00
{
2021-10-01 12:46:35 +00:00
fmt::print(" Repair: None\n");
2019-01-31 09:10:19 +00:00
}
2020-03-14 02:27:26 +00:00
// ProgramIndex
if (mNacp.getProgramIndex() != 0 || mCliOutputMode.show_extended_info)
2019-01-31 09:10:19 +00:00
{
2021-10-01 12:46:35 +00:00
fmt::print(" ProgramIndex: 0x{:02x}\n", mNacp.getProgramIndex());
2020-03-14 02:27:26 +00:00
}
// RequiredNetworkServiceLicenseOnLaunch
if (mNacp.getRequiredNetworkServiceLicenseOnLaunch().size() > 0)
{
2021-10-01 12:46:35 +00:00
fmt::print(" RequiredNetworkServiceLicenseOnLaunch:\n");
2020-03-14 02:27:26 +00:00
for (auto itr = mNacp.getRequiredNetworkServiceLicenseOnLaunch().begin(); itr != mNacp.getRequiredNetworkServiceLicenseOnLaunch().end(); itr++)
{
2022-06-29 13:19:36 +00:00
fmt::print(" {:s}\n", pie::hac::ApplicationControlPropertyUtil::getRequiredNetworkServiceLicenseOnLaunchFlagAsString(*itr));
2020-03-14 02:27:26 +00:00
}
2019-01-31 09:10:19 +00:00
}
else if (mCliOutputMode.show_extended_info)
2019-01-31 09:10:19 +00:00
{
2021-10-01 12:46:35 +00:00
fmt::print(" RequiredNetworkServiceLicenseOnLaunch: None\n");
2019-01-31 09:10:19 +00:00
}
2020-03-14 02:27:26 +00:00
// NeighborDetectionClientConfiguration
auto detect_config = mNacp.getNeighborDetectionClientConfiguration();
if (detect_config.countSendGroupConfig() > 0 || detect_config.countReceivableGroupConfig() > 0)
2019-01-31 09:10:19 +00:00
{
2021-10-01 12:46:35 +00:00
fmt::print(" NeighborDetectionClientConfiguration:\n");
2020-03-14 02:27:26 +00:00
if (detect_config.countSendGroupConfig() > 0)
{
2021-10-01 12:46:35 +00:00
fmt::print(" SendGroupConfig:\n");
fmt::print(" GroupId: 0x{:016x}\n", detect_config.send_data_configuration.group_id);
fmt::print(" Key: {:s}\n", tc::cli::FormatUtil::formatBytesAsString(detect_config.send_data_configuration.key.data(), detect_config.send_data_configuration.key.size(), false, ""));
2020-03-14 02:27:26 +00:00
}
else if (mCliOutputMode.show_extended_info)
2020-03-14 02:27:26 +00:00
{
2021-10-01 12:46:35 +00:00
fmt::print(" SendGroupConfig: None\n");
2020-03-14 02:27:26 +00:00
}
if (detect_config.countReceivableGroupConfig() > 0)
{
2021-10-01 12:46:35 +00:00
fmt::print(" ReceivableGroupConfig:\n");
2022-06-29 13:19:36 +00:00
for (size_t i = 0; i < pie::hac::nacp::kReceivableGroupConfigurationCount; i++)
2020-03-14 02:27:26 +00:00
{
if (detect_config.receivable_data_configuration[i].isNull())
continue;
2021-10-01 12:46:35 +00:00
fmt::print(" GroupId: 0x{:016x}\n", detect_config.receivable_data_configuration[i].group_id);
fmt::print(" Key: {:s}\n", tc::cli::FormatUtil::formatBytesAsString(detect_config.receivable_data_configuration[i].key.data(), detect_config.receivable_data_configuration[i].key.size(), false, ""));
2020-03-14 02:27:26 +00:00
}
}
else if (mCliOutputMode.show_extended_info)
2020-03-14 02:27:26 +00:00
{
2021-10-01 12:46:35 +00:00
fmt::print(" ReceivableGroupConfig: None\n");
2020-03-14 02:27:26 +00:00
}
2019-01-31 09:10:19 +00:00
}
else if (mCliOutputMode.show_extended_info)
2019-01-31 09:10:19 +00:00
{
2021-10-01 12:46:35 +00:00
fmt::print(" NeighborDetectionClientConfiguration: None\n");
2019-01-31 09:10:19 +00:00
}
2020-03-14 02:27:26 +00:00
// JitConfiguration
if (mNacp.getJitConfiguration().is_enabled || mCliOutputMode.show_extended_info)
2019-01-31 09:10:19 +00:00
{
2021-10-01 12:46:35 +00:00
fmt::print(" JitConfiguration:\n");
fmt::print(" IsEnabled: {}\n", mNacp.getJitConfiguration().is_enabled);
fmt::print(" MemorySize: 0x{:016x}\n", mNacp.getJitConfiguration().memory_size);
2019-01-31 09:10:19 +00:00
}
// PlayReportPermission
2022-06-29 13:19:36 +00:00
if (mNacp.getPlayReportPermission() != pie::hac::nacp::PlayReportPermission_None || mCliOutputMode.show_extended_info)
{
2022-06-29 13:19:36 +00:00
fmt::print(" PlayReportPermission: {:s}\n", pie::hac::ApplicationControlPropertyUtil::getPlayReportPermissionAsString(mNacp.getPlayReportPermission()));
}
// CrashScreenshotForProd
2022-06-29 13:19:36 +00:00
if (mNacp.getCrashScreenshotForProd() != pie::hac::nacp::CrashScreenshotForProd_Deny || mCliOutputMode.show_extended_info)
{
2022-06-29 13:19:36 +00:00
fmt::print(" CrashScreenshotForProd: {:s}\n", pie::hac::ApplicationControlPropertyUtil::getCrashScreenshotForProdAsString(mNacp.getCrashScreenshotForProd()));
}
// CrashScreenshotForDev
2022-06-29 13:19:36 +00:00
if (mNacp.getCrashScreenshotForDev() != pie::hac::nacp::CrashScreenshotForDev_Deny || mCliOutputMode.show_extended_info)
{
2022-06-29 13:19:36 +00:00
fmt::print(" CrashScreenshotForDev: {:s}\n", pie::hac::ApplicationControlPropertyUtil::getCrashScreenshotForDevAsString(mNacp.getCrashScreenshotForDev()));
}
// AccessibleLaunchRequiredVersion
if (mNacp.getAccessibleLaunchRequiredVersionApplicationId().size() > 0)
{
2021-10-01 12:46:35 +00:00
fmt::print(" AccessibleLaunchRequiredVersion:\n");
fmt::print(" ApplicationId:\n");
for (auto itr = mNacp.getAccessibleLaunchRequiredVersionApplicationId().begin(); itr != mNacp.getAccessibleLaunchRequiredVersionApplicationId().end(); itr++)
{
2021-10-01 12:46:35 +00:00
fmt::print(" 0x{:016x}\n", *itr);
}
}
else if (mCliOutputMode.show_extended_info)
{
2021-10-01 12:46:35 +00:00
fmt::print(" AccessibleLaunchRequiredVersion: None\n");
}
}