diff --git a/Source/Utility/GGHash.cpp b/Source/Utility/GGHash.cpp new file mode 100644 index 0000000..d6d0723 --- /dev/null +++ b/Source/Utility/GGHash.cpp @@ -0,0 +1,17 @@ +#include "Utility/GGHash.h" + +// OFFSET: 0x004012B0 + +// OFFSET: 0x00401870 +// FUNCTION: fn_00113 +DWORD CGGHash::GetSize() const { + return this->m_size; +} + +// OFFSET: 0x00401880 +// FUNCTION: fn_00114 +DWORD CGGHash::GetError() const { + return this->m_error; +} + +// OFFSET: 0x00401AC0 diff --git a/Source/Utility/GGHash.h b/Source/Utility/GGHash.h new file mode 100644 index 0000000..885f564 --- /dev/null +++ b/Source/Utility/GGHash.h @@ -0,0 +1,35 @@ +#ifndef RAGNAROK_SOURCE_UTILITY_GGHASH_H +#define RAGNAROK_SOURCE_UTILITY_GGHASH_H + +#include +#include + +class CGGHash { +public: + CGGHash(); + virtual ~CGGHash(); + + DWORD GetSize() const; + DWORD GetError() const; + +protected: + // INLINED + void Clear() { + this->m_error = 0; + this->m_size = 0; + if (this->m_data) { + std::free(this->m_data); + this->m_data = nullptr; + } + } + + /* 0004 */ DWORD m_error; + /* 0008 */ DWORD m_size; + /* 000C */ BYTE* m_data; +}; + +#if defined(_WIN32) && !defined(_WIN64) +static_assert(sizeof(CGGHash) == 16); +#endif + +#endif diff --git a/data/compile.json b/data/compile.json index 1e31473..9109cb1 100644 --- a/data/compile.json +++ b/data/compile.json @@ -629,6 +629,7 @@ "Source/Utility/Cipher/Rijndael.cpp": 0, "Source/Utility/Cipher/XorBytes.cpp": 0, "Source/Utility/FileSignatureVerifier.cpp": 0, + "Source/Utility/GGHash.cpp": 0, "Source/Utility/GuidParse.cpp": 0, "Source/Utility/Hash/MD5.cpp": 0, "Source/Utility/Hash/XxHash32.cpp": 0,