From b24c56c21de0ba7601b6a123ea7a066a0d14bc8a Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Wed, 11 Nov 2026 14:04:33 +0000 Subject: [PATCH] Decompile 2 functions in Source/Contents/Navigation/NavigationRoute.cpp, Source/Contents/Navigation/NavigationSource.cpp, ... Batch #17138 by eAthena: 0 byte-identical, 2 confirmed by peer review. - fn_19385 CNaviData::ParseSearchKind: logic confirmed by peer review - fn_09129 CTipBoxMgr::RegisterLuaFunctions: logic confirmed by peer review Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- .../Contents/Navigation/NavigationRoute.cpp | 64 +++++++++---------- Source/Contents/Tables/TipBoxTitles.cpp | 10 +-- 2 files changed, 37 insertions(+), 37 deletions(-) diff --git a/Source/Contents/Navigation/NavigationRoute.cpp b/Source/Contents/Navigation/NavigationRoute.cpp index 62f65c942..f63688c1d 100644 --- a/Source/Contents/Navigation/NavigationRoute.cpp +++ b/Source/Contents/Navigation/NavigationRoute.cpp @@ -1149,42 +1149,42 @@ __declspec(noinline) bool CNaviData::Search(std::string query, int type, std::ve // OFFSET: 0x00B891C0 // FUNCTION: fn_19385 int CNaviData::ParseSearchKind(std::vector& tokens) { - if (std::strncmp(tokens[0].c_str(), LookupMessage(MSI_NAVIGATION_ZZALL), std::strlen(LookupMessage(MSI_NAVIGATION_ZZALL))) != 0) { - return 1; - } - std::size_t prefixLength = std::strlen(LookupMessage(MSI_SHOP_ITEM_BAY_TITLE)); - if (prefixLength < tokens[0].size() && std::strncmp(tokens[0].c_str(), LookupMessage(MSI_SHOP_ITEM_BAY_TITLE), prefixLength) == 0) { - std::string token(tokens[0]); - const char* separator = std::strstr(token.c_str(), LookupMessage(MSI_SHOP_ITEM_BAY_MAG1)); - std::string minimum; - std::string maximum; - if (separator == nullptr) { - minimum.assign(token.c_str() + prefixLength, token.c_str() + token.size()); - maximum = minimum; - } else { - minimum.assign(token.c_str() + prefixLength, separator); - maximum.assign(separator + std::strlen(LookupMessage(MSI_SHOP_ITEM_BAY_MAG1)), token.c_str() + token.size()); - if (maximum.size() == 0) { - maximum = "500"; + if (std::strncmp(tokens[0].c_str(), LookupMessage(MSI_NAVIGATION_ZZALL), std::strlen(LookupMessage(MSI_NAVIGATION_ZZALL))) == 0) { + std::size_t prefixLength = std::strlen(LookupMessage(MSI_SHOP_ITEM_BAY_TITLE)); + if (prefixLength < tokens[0].size() && std::strncmp(tokens[0].c_str(), LookupMessage(MSI_SHOP_ITEM_BAY_TITLE), prefixLength) == 0) { + std::string token(tokens[0]); + const char* separator = std::strstr(token.c_str(), LookupMessage(MSI_SHOP_ITEM_BAY_MAG1)); + std::string minimum; + std::string maximum; + if (separator == nullptr) { + minimum.assign(token.c_str() + prefixLength, token.c_str() + token.size()); + maximum = minimum; + } else { + minimum.assign(token.c_str() + prefixLength, separator); + maximum.assign(separator + std::strlen(LookupMessage(MSI_SHOP_ITEM_BAY_MAG1)), token.c_str() + token.size()); + if (maximum.size() == 0) { + maximum = "500"; + } } + int low = std::atoi(minimum.c_str()); + int high = std::atoi(maximum.c_str()); + int kind; + if (low < 1 || high < 1 || low > high) { + kind = 0; + } else { + tokens.clear(); + tokens.push_back(minimum); + tokens.push_back(maximum); + kind = 3; + } + return kind; } - int low = std::atoi(minimum.c_str()); - int high = std::atoi(maximum.c_str()); - int kind; - if (low < 1 || high < 1 || low > high) { - kind = 0; - } else { - tokens.clear(); - tokens.push_back(minimum); - tokens.push_back(maximum); - kind = 3; + if (std::strncmp(tokens[0].c_str(), LookupMessage(MSI_SHOP_ITEM_BAY_MAG2), std::strlen(LookupMessage(MSI_SHOP_ITEM_BAY_MAG2))) == 0) { + return 2; } - return kind; + return std::strncmp(tokens[0].c_str(), "$$DB", 4) == 0 ? 4 : 0; } - if (std::strncmp(tokens[0].c_str(), LookupMessage(MSI_SHOP_ITEM_BAY_MAG2), std::strlen(LookupMessage(MSI_SHOP_ITEM_BAY_MAG2))) == 0) { - return 2; - } - return std::strncmp(tokens[0].c_str(), "$$DB", 4) == 0 ? 4 : 0; + return 1; } // OFFSET: 0x00B896E0 diff --git a/Source/Contents/Tables/TipBoxTitles.cpp b/Source/Contents/Tables/TipBoxTitles.cpp index 89c690247..dd2b876ba 100644 --- a/Source/Contents/Tables/TipBoxTitles.cpp +++ b/Source/Contents/Tables/TipBoxTitles.cpp @@ -333,13 +333,13 @@ bool CTipBoxMgr::RegisterLuaFunctions() { return false; } - if (lua_toboolean(state.GetState(), -2)) { - return true; + if (!lua_toboolean(state.GetState(), -2)) { + const std::string message = std::string("error found :") + lua_tostring(state.GetState(), -1); + MessageBoxA(nullptr, message.c_str(), "TipBox", MB_OK); + return false; } - const std::string message = std::string("error found :") + lua_tostring(state.GetState(), -1); - MessageBoxA(nullptr, message.c_str(), "TipBox", MB_OK); - return false; + return true; } // OFFSET: 0x007AD890