diff --git a/programs/nstool/source/EsTikProcess.cpp b/programs/nstool/source/EsTikProcess.cpp index 5bae731..4832276 100644 --- a/programs/nstool/source/EsTikProcess.cpp +++ b/programs/nstool/source/EsTikProcess.cpp @@ -122,9 +122,21 @@ void EsTikProcess::displayTicket() std::cout << " Title Key:" << std::endl; std::cout << " EncMode: " << getTitleKeyPersonalisationStr(body.getTitleKeyEncType()) << std::endl; std::cout << " KeyGeneration: " << std::dec << (uint32_t)body.getCommonKeyId() << std::endl; - std::cout << " Data:" << std::endl; - size_t size = body.getTitleKeyEncType() == nn::es::ticket::RSA2048 ? fnd::rsa::kRsa2048Size : fnd::aes::kAes128KeySize; - fnd::SimpleTextOutput::hexDump(body.getEncTitleKey(), size, 0x10, 6); + if (body.getTitleKeyEncType() == nn::es::ticket::RSA2048) + { + std::cout << " Data:" << std::endl; + for (size_t i = 0; i < 0x10; i++) + std::cout << " " << fnd::SimpleTextOutput::arrayToString(body.getEncTitleKey() + 0x10*i, 0x10, true, ":") << std::endl; + } + else if (body.getTitleKeyEncType() == nn::es::ticket::AES128_CBC) + { + std::cout << " Data:" << std::endl; + std::cout << " " << fnd::SimpleTextOutput::arrayToString(body.getEncTitleKey(), 0x10, true, ":") << std::endl; + } + else + { + std::cout << " Data: " << std::endl; + } std::cout << " Version: v" << _SPLIT_VER(body.getTicketVersion()); if (_HAS_BIT(mCliOutputMode, OUTPUT_EXTENDED)) diff --git a/programs/nstool/source/UserSettings.cpp b/programs/nstool/source/UserSettings.cpp index 7ea6125..e9ad32e 100644 --- a/programs/nstool/source/UserSettings.cpp +++ b/programs/nstool/source/UserSettings.cpp @@ -431,7 +431,7 @@ void UserSettings::populateKeyset(sCmdArgs& args) { fnd::aes::sAes128Key tmp_key; fnd::Vec tmp_raw; - fnd::SimpleTextOutput::stringToArray(args.nca_bodykey.var, tmp_raw); + fnd::SimpleTextOutput::stringToArray(args.nca_titlekey.var, tmp_raw); if (tmp_raw.size() != sizeof(fnd::aes::sAes128Key)) throw fnd::Exception(kModuleName, "Key: \"--titlekey\" has incorrect length"); memcpy(tmp_key.key, tmp_raw.data(), 16);