diff --git a/Source/Utility/GGHash.cpp b/Source/Utility/GGHash.cpp index 84f42fbb..c8740635 100644 --- a/Source/Utility/GGHash.cpp +++ b/Source/Utility/GGHash.cpp @@ -53,5 +53,34 @@ CGGHash::~CGGHash() { } // OFFSET: 0x00401B10 +// FUNCTION: fn_00119 +int CGGHash::VerifyBuffer(const char* 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; + } + + WCHAR wideName[260]; + MultiByteToWideChar(CP_ACP, 0, name, -1, wideName, 260); + return this->VerifyBuffer(wideName, buf, size); +} // OFFSET: 0x00401BB0 +// FUNCTION: fn_00120 +int CGGHash::VerifyFile(const char* filename) { + this->m_error = 0; + if (filename == nullptr) { + this->m_error = 1; + return 0; + } + + WCHAR wideFileName[260]; + MultiByteToWideChar(CP_ACP, 0, filename, -1, wideFileName, 260); + return this->VerifyFile(wideFileName); +}