From f8e22f448dd3351fb0eab4dca174cca6014cb903 Mon Sep 17 00:00:00 2001 From: Noah Pistilli Date: Sat, 28 Jun 2025 18:28:02 -0400 Subject: [PATCH] IOS/KD: Pad Wii Numbers to 16 digits --- Source/Core/Core/IOS/Network/KD/NetKDRequest.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Core/Core/IOS/Network/KD/NetKDRequest.cpp b/Source/Core/Core/IOS/Network/KD/NetKDRequest.cpp index 19c8652f4a..d0d49fef9b 100644 --- a/Source/Core/Core/IOS/Network/KD/NetKDRequest.cpp +++ b/Source/Core/Core/IOS/Network/KD/NetKDRequest.cpp @@ -391,7 +391,7 @@ NWC24::ErrorCode NetKDRequestDevice::KDCheckMail(u32* mail_flag, u32* interval) // On a real Wii, a response to a challenge is expected and would be verified by KD. const std::string hmac_message = - fmt::format("{}\nw{}\n{}\n{}", random_number, m_config.Id(), str_mail_flag, str_interval); + fmt::format("{}\nw{:016}\n{}\n{}", random_number, m_config.Id(), str_mail_flag, str_interval); std::array hashed{}; Common::HMAC::HMACWithSHA1( MAIL_CHECK_KEY, @@ -533,7 +533,7 @@ NWC24::ErrorCode NetKDRequestDevice::KDSendMail() m_send_list.ReadSendList(); const std::string auth = - fmt::format("mlid=w{}\r\npasswd={}", m_config.Id(), m_config.GetPassword()); + fmt::format("mlid=w{:016}\r\npasswd={}", m_config.Id(), m_config.GetPassword()); std::vector multiform = {{"mlid", auth}}; std::vector mails = m_send_list.GetMailToSend(); @@ -932,8 +932,8 @@ IPCReply NetKDRequestDevice::HandleRequestRegisterUserId(const IOS::HLE::IOCtlRe const Common::SettingsReader settings_reader{data}; const std::string serno = settings_reader.GetValue("SERNO"); - const std::string form_data = - fmt::format("mlid=w{}&hdid={}&rgncd={}", m_config.Id(), m_ios.GetIOSC().GetDeviceId(), serno); + const std::string form_data = fmt::format("mlid=w{:016}&hdid={}&rgncd={}", m_config.Id(), + m_ios.GetIOSC().GetDeviceId(), serno); const Common::HttpRequest::Response response = m_http.Post(m_config.GetAccountURL(), form_data); if (!response)