From acd76a33737b2ac888cda0e53be11bd8c2aaa2f8 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Sat, 31 Oct 2026 17:23:24 +0000 Subject: [PATCH] Decompile fn_00486 (JsonCppLoader::sub_4F3C70) Batch #8381 by gordaoprogramas: 0 byte-identical, 1 confirmed by peer review. - fn_00486 JsonCppLoader::sub_4F3C70: logic confirmed by peer review Peer-reviewed-by: eAthena, Romain, System4z Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Utility/JsonCppLoader.cpp | 23 +++++++++++++++++++++++ Source/Utility/JsonCppLoader.h | 2 ++ 2 files changed, 25 insertions(+) diff --git a/Source/Utility/JsonCppLoader.cpp b/Source/Utility/JsonCppLoader.cpp index 9893718e..f5031961 100644 --- a/Source/Utility/JsonCppLoader.cpp +++ b/Source/Utility/JsonCppLoader.cpp @@ -4,6 +4,29 @@ #include #include +// OFFSET: 0x004F3C70 +// FUNCTION: fn_00486 +bool JsonCppLoader::sub_4F3C70(std::vector& buffer, bool bson) { + if (buffer.empty()) { + this->Fail("error : JsonCppLoader::Load failed (reason : 비어있는 버퍼가 전달되었습니다.)"); + return false; + } + + bool parsed; + if (bson) { + parsed = this->sub_4F3DF0(buffer); + } else { + parsed = this->sub_4F4040(buffer); + } + + if (parsed) { + this->loaded = true; + return true; + } + + return false; +} + // OFFSET: 0x004F4180 // FUNCTION: fn_00491 void JsonCppLoader::Fail(const char* format, ...) { diff --git a/Source/Utility/JsonCppLoader.h b/Source/Utility/JsonCppLoader.h index 73bf3d1f..fb93c9b8 100644 --- a/Source/Utility/JsonCppLoader.h +++ b/Source/Utility/JsonCppLoader.h @@ -180,6 +180,8 @@ public: bool GetIntVectorValue(const JsonValue& node, const std::string& key, std::vector* out); bool GetBoolValue(const JsonValue& node, const std::string& key, bool* out); bool sub_4F3C70(std::vector& buffer, bool bson); + bool sub_4F3DF0(std::vector& buffer); + bool sub_4F4040(std::vector& buffer); bool sub_50C2A0(std::map* out); bool sub_50AE30(std::map* out); bool sub_50B830(std::map* out);