From bcad19503caf9bd508a3ee5ba125fea5d82e1f2c Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 29 Oct 2026 22:49:37 +0000 Subject: [PATCH] Decompile fn_02795 (FindSubstring) Batch #3573 by Lumen: 0 byte-identical, 1 confirmed by peer review. - fn_02795 FindSubstring: logic confirmed by peer review Peer-reviewed-by: eAthena, Yommy, superintelligence Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Network/TextEncoding.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Source/Network/TextEncoding.cpp b/Source/Network/TextEncoding.cpp index c2ab8439..2878cc51 100644 --- a/Source/Network/TextEncoding.cpp +++ b/Source/Network/TextEncoding.cpp @@ -200,3 +200,13 @@ std::wstring LowercaseWide(const std::string& text) { std::transform(result.begin(), result.end(), result.begin(), towlower); return result; } + +// OFFSET: 0x0058D6B0 +// FUNCTION: fn_02795 +int FindSubstring(const char* text, int codePage, const char* pattern) { + std::wstring wideText = LowercaseWide(text); + std::wstring widePattern = LowercaseWide(pattern); + size_t pos = wideText.find(widePattern); + return (pos == std::wstring::npos) ? -1 : static_cast(pos); +} +