From adf7f2f57e1ef7e22b69e130aeb4e35137c956a7 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Wed, 4 Nov 2026 22:46:34 +0000 Subject: [PATCH] Decompile 5 functions in Source/UI/Text/UITextViewerLinks.cpp, Source/UI/Text/TextMarkup.cpp, ... Batch #11248 by kyoshi: 0 byte-identical, 5 confirmed by peer review. - fn_16949 ExtractNavigationTextLinks: logic confirmed by peer review - fn_16950 ExtractTextLinks: logic confirmed by peer review - fn_16951 ExtractTipBoxTextLinks: logic confirmed by peer review - fn_16952 ExtractUrlTextLinks: logic confirmed by peer review - fn_16980 HasTextLinks: logic confirmed by peer review Peer-reviewed-by: Yommy, dori, cremane Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/UI/Text/TextMarkup.cpp | 32 ++++++++++++++++++---------- Source/UI/Text/TextMarkup.h | 5 ++++- Source/UI/Text/UITextViewerLinks.cpp | 12 +++++++++++ 3 files changed, 37 insertions(+), 12 deletions(-) diff --git a/Source/UI/Text/TextMarkup.cpp b/Source/UI/Text/TextMarkup.cpp index 197748be..dd08b50f 100644 --- a/Source/UI/Text/TextMarkup.cpp +++ b/Source/UI/Text/TextMarkup.cpp @@ -19,6 +19,15 @@ static const std::string g_naviTagBegin = ""; // GLOBAL: gl_24594 static const std::string g_naviTagEnd = ""; +// GLOBAL: gl_25478 +static const std::string g_infoTagBegin = ""; + +// GLOBAL: gl_25479 +static const std::string g_infoTagEnd = ""; + +// GLOBAL: gl_25480 +static const std::string g_itemLinkTagOpen = ""; + // GLOBAL: gl_24595 static const std::string g_itemTagBegin = ""; @@ -33,8 +42,8 @@ static const std::string g_questTagEnd = ""; // OFFSET: 0x00A7CA90 // FUNCTION: fn_16949 -void ExtractNavigationTextLinks(std::string&& text, std::vector& links) { - ExtractTextLinks(std::move(text), g_naviTagBegin, g_naviTagEnd, links); +void ExtractNavigationTextLinks(const std::string& text, std::vector& links) { + ExtractTextLinks(text, g_naviTagBegin, g_naviTagEnd, links); } // GLOBAL: gl_24597 @@ -45,8 +54,8 @@ static const std::string g_tipBoxTagEnd = ""; // OFFSET: 0x00A7D690 // FUNCTION: fn_16951 -void ExtractTipBoxTextLinks(std::string&& text, std::vector& links) { - ExtractTextLinks(std::move(text), g_tipBoxTagBegin, g_tipBoxTagEnd, links); +void ExtractTipBoxTextLinks(const std::string& text, std::vector& links) { + ExtractTextLinks(text, g_tipBoxTagBegin, g_tipBoxTagEnd, links); } // GLOBAL: gl_24591 @@ -57,15 +66,15 @@ static const std::string g_urlTagEnd = ""; // OFFSET: 0x00A7D6B0 // FUNCTION: fn_16952 -void ExtractUrlTextLinks(std::string&& text, std::vector& links) { - ExtractTextLinks(std::move(text), g_urlTagBegin, g_urlTagEnd, links); +void ExtractUrlTextLinks(const std::string& text, std::vector& links) { + ExtractTextLinks(text, g_urlTagBegin, g_urlTagEnd, links); } // OFFSET: 0x00A81A70 // FUNCTION: fn_16980 bool HasTextLinks(const std::string& text) { - return text.find("") != std::string::npos || text.find("") != std::string::npos || text.find("") != std::string::npos || - text.find("") != std::string::npos || text.find("") != std::string::npos || text.find("") != std::string::npos; + return text.find(g_urlTagBegin) != std::string::npos || text.find(g_itemTagBegin) != std::string::npos || text.find(g_tipBoxTagBegin) != std::string::npos || + text.find(g_naviTagBegin) != std::string::npos || text.find(g_itemLinkTagOpen) != std::string::npos || text.find(g_questTagBegin) != std::string::npos; } // OFFSET: 0x008791E0 @@ -202,7 +211,8 @@ std::string RemoveTextLinkInfo(std::string text) { // OFFSET: 0x00A7CAB0 // FUNCTION: fn_16950 -void ExtractTextLinks(std::string text, const std::string& begin, const std::string& end, std::vector& links) { +void ExtractTextLinks(const std::string& source, const std::string& begin, const std::string& end, std::vector& links) { + std::string text = source; auto position = text.find(begin); if (position == std::string::npos) { @@ -224,12 +234,12 @@ void ExtractTextLinks(std::string text, const std::string& begin, const std::str std::string display = tail.substr(0, close); std::string metadata; - const auto info = display.find(""); + const auto info = display.find(g_infoTagBegin); if (info != std::string::npos) { display = tail.substr(0, info); metadata = tail.substr(info + 6); - const auto infoEnd = metadata.find(""); + const auto infoEnd = metadata.find(g_infoTagEnd); if (infoEnd != std::string::npos) { metadata.resize(infoEnd); diff --git a/Source/UI/Text/TextMarkup.h b/Source/UI/Text/TextMarkup.h index 860b9b1c..05ff7cc6 100644 --- a/Source/UI/Text/TextMarkup.h +++ b/Source/UI/Text/TextMarkup.h @@ -23,7 +23,10 @@ std::string DisplayQuestTextTag(const std::string& text); std::string DisplayTipBoxTextTag(const std::string& text); std::string DisplayUrlTextTag(const std::string& text); std::string RemoveTextLinkInfo(std::string text); -void ExtractTextLinks(std::string text, const std::string& begin, const std::string& end, std::vector& links); +void ExtractTextLinks(const std::string& source, const std::string& begin, const std::string& end, std::vector& links); +void ExtractNavigationTextLinks(const std::string& text, std::vector& links); +void ExtractTipBoxTextLinks(const std::string& text, std::vector& links); +void ExtractUrlTextLinks(const std::string& text, std::vector& links); void SplitTextLinkArguments(std::string text, std::vector& arguments); #if defined(_WIN32) && !defined(_WIN64) diff --git a/Source/UI/Text/UITextViewerLinks.cpp b/Source/UI/Text/UITextViewerLinks.cpp index 935c7ad3..5e1d17e9 100644 --- a/Source/UI/Text/UITextViewerLinks.cpp +++ b/Source/UI/Text/UITextViewerLinks.cpp @@ -17,6 +17,18 @@ #include #include +// GLOBAL: gl_24664 +static const std::string g_viewerItemTagBegin = ""; + +// GLOBAL: gl_24665 +static const std::string g_viewerItemTagEnd = ""; + +// GLOBAL: gl_24666 +static const std::string g_viewerQuestTagBegin = ""; + +// GLOBAL: gl_24667 +static const std::string g_viewerQuestTagEnd = ""; + // OFFSET: 0x0091B800 // FUNCTION: fn_12605 std::string UINewChatWnd::ConvertChat(std::string text) {