From d60b4ece075f24bd56a1a7bdf897bea2d9a90d3e Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Fri, 6 Nov 2026 06:04:41 +0000 Subject: [PATCH] Decompile fn_03420 (CCommonObject::OpenCsv) Batch #13136 by SapitoSucio: 1 byte-identical, 0 confirmed by peer review. - fn_03420 CCommonObject::OpenCsv: byte-identical Merged automatically: every function is byte-identical to the original. --- Source/Contents/MessageTable.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Source/Contents/MessageTable.cpp b/Source/Contents/MessageTable.cpp index cf26fe15..625431f3 100644 --- a/Source/Contents/MessageTable.cpp +++ b/Source/Contents/MessageTable.cpp @@ -4788,18 +4788,21 @@ bool CCommonObject::OpenCsv(const char* name, CFile& file) { } const unsigned char* data = static_cast(file.GetData()); - if (file.GetSize() >= 2) { + const unsigned int size = file.GetSize(); + if (size >= 2) { + int encoding = 0; if (data[0] == 0xFF && data[1] == 0xFE) { - std::string message = FormatOwnedString("Not Match Encoding Type : %d", 5); - return false; + encoding = 5; + } else if (data[0] == 0xFE && data[1] == 0xFF) { + encoding = 7; } - if (data[0] == 0xFE && data[1] == 0xFF) { - std::string message = FormatOwnedString("Not Match Encoding Type : %d", 7); + if (encoding != 0) { + std::string message = FormatOwnedString("Not Match Encoding Type : %d", encoding); return false; } } - if (file.GetSize() >= 3 && data[0] == 0xEF && data[1] == 0xBB && data[2] == 0xBF) { + if (size >= 3 && data[0] == 0xEF && data[1] == 0xBB && data[2] == 0xBF) { file.Seek(3, FILE_CURRENT); } return true;