From d6928200bc9dfdb6c8fe28a80bc3ff76895a66ee Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Fri, 30 Oct 2026 09:26:43 +0000 Subject: [PATCH] Decompile 2 functions in Source/Utility/Cipher/AES.cpp, Source/Utility/Cipher/AES.h Batch #5208 by Yommy: 0 byte-identical, 2 confirmed by peer review. - fn_18391 CAES::~CAES: logic confirmed by peer review - fn_18398 CAES::Xor: logic confirmed by peer review Peer-reviewed-by: eAthena, youko Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Utility/Cipher/AES.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Source/Utility/Cipher/AES.cpp b/Source/Utility/Cipher/AES.cpp index 74fcfbbd..efa420e9 100644 --- a/Source/Utility/Cipher/AES.cpp +++ b/Source/Utility/Cipher/AES.cpp @@ -464,6 +464,16 @@ CAES::CAES(int keyLength, int blockSize) : m_bKeyInit(false) { } // OFFSET: 0x00B0A550 +// FUNCTION: fn_18391 +CAES::~CAES() { + SecureZeroMemory(this->m_Ke, sizeof(this->m_Ke)); + SecureZeroMemory(this->m_Kd, sizeof(this->m_Kd)); + SecureZeroMemory(this->m_chain0, sizeof(this->m_chain0)); + SecureZeroMemory(this->m_chain, sizeof(this->m_chain)); + SecureZeroMemory(this->tk, sizeof(this->tk)); + SecureZeroMemory(this->a, sizeof(this->a)); + SecureZeroMemory(this->t, sizeof(this->t)); +} // OFFSET: 0x00B0A770 @@ -476,3 +486,13 @@ CAES::CAES(int keyLength, int blockSize) : m_bKeyInit(false) { // OFFSET: 0x00B0B610 // OFFSET: 0x00B0BD70 +// FUNCTION: fn_18398 +void CAES::Xor(unsigned char* destination, const unsigned char* source) { + if (!this->m_bKeyInit) { + throw std::exception(sm_szErrorMsg1); + } + + for (int i = 0; i < this->m_blockSize; ++i) { + destination[i] ^= source[i]; + } +}