From 611a78a1e952679aba527feefa5daa7e8b99fcc3 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Wed, 28 Oct 2026 11:05:16 +0000 Subject: [PATCH] Decompile 2 functions in Source/Utility/GGHash.cpp, Source/Utility/GGHash.h Batch #1350 by ragnarok-clanker: 0 byte-identical, 2 confirmed by peer review. - fn_00116 CGGHash::VerifyBuffer: logic confirmed by peer review - fn_00117 CGGHash::VerifyFile: logic confirmed by peer review Reviewed-by: ragnarok-clanker --- Source/Utility/GGHash.cpp | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/Source/Utility/GGHash.cpp b/Source/Utility/GGHash.cpp index c8740635..c1df4ce4 100644 --- a/Source/Utility/GGHash.cpp +++ b/Source/Utility/GGHash.cpp @@ -43,8 +43,42 @@ BOOL CGGHash::Load(const char* filename) { } // OFFSET: 0x00401920 +// FUNCTION: fn_00116 +int CGGHash::VerifyBuffer(const wchar_t* name, const unsigned char* buf, unsigned int size) { + this->m_error = 0; + if (name == nullptr) { + this->m_error = 1; + return 0; + } + + if (buf == nullptr || size == 0) { + this->m_error = 2; + return 0; + } + + MD5 md5; + std::uint32_t hash = md5.HashBuffer(buf, size); + return this->VerifyHash(name, hash); +} // OFFSET: 0x004019E0 +// FUNCTION: fn_00117 +int CGGHash::VerifyFile(const wchar_t* filename) { + this->m_error = 0; + if (filename == nullptr) { + this->m_error = 1; + return 0; + } + + MD5 md5; + std::uint32_t hash = md5.HashFile(filename); + if (hash == 0) { + this->m_error = 2; + return 0; + } + + return this->VerifyHash(filename, hash); +} // OFFSET: 0x00401AC0 // FUNCTION: fn_00118