From 68d8b7955fb162ab8fcd6a3e640ee7f07667e42e Mon Sep 17 00:00:00 2001 From: Nightkingale <63483138+Nightkingale@users.noreply.github.com> Date: Wed, 22 Jan 2025 21:45:37 -0700 Subject: [PATCH] Search string specifically in MiiImageUrl --- source/backup.cpp | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/source/backup.cpp b/source/backup.cpp index efaa486..97b5d0e 100644 --- a/source/backup.cpp +++ b/source/backup.cpp @@ -1,4 +1,6 @@ #include +#include +#include #include @@ -105,14 +107,23 @@ backup_account() } bool network_account_found = false; - if (content.find("nintendo") != std::string::npos) { - // Nintendo Network ID is linked to the account. - backup_path = NNID_BACKUP; - network_account_found = true; - } else if (content.find("pretendo") != std::string::npos) { - // Pretendo Network ID is linked to the account. - backup_path = PNID_BACKUP; - network_account_found = true; + std::istringstream file_contentstream(content); + std::string line; + + while (std::getline(file_contentstream, line)) { + if (line.find("MiiImageUrl") != std::string::npos) { + if (line.find("nintendo") != std::string::npos) { + // Nintendo Network ID is linked to the account. + backup_path = NNID_BACKUP; + network_account_found = true; + break; + } else if (line.find("pretendo") != std::string::npos) { + // Pretendo Network ID is linked to the account. + backup_path = PNID_BACKUP; + network_account_found = true; + break; + } + } } if (!network_account_found) {