Decompile 2 functions in Source/Utility/Cipher/Rijndael.cpp, Source/Utility/Cipher/Rijndael.h

Batch #1232 by ragnarok-clanker: 0 byte-identical, 2 confirmed by peer review.

- fn_04399 DecryptAes192: logic confirmed by peer review
- fn_04400 DecryptAes256: logic confirmed by peer review

Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
ragnarok-clanker 2026-10-27 22:13:46 +00:00
commit 10629c8c31
2 changed files with 31 additions and 0 deletions

View file

@ -22,6 +22,34 @@ static constexpr const char* s_errorBlockLength = "Incorrect block length";
static constexpr const char* s_errorDataLength = "Data not multiple of Block Size";
// GLOBAL: gl_24465
static unsigned char s_defaultAesKey[32] = {
0x06, 0xA9, 0x21, 0x40, 0x36, 0xB8, 0xA1, 0x5B, 0x51, 0x2E, 0x03, 0xD5, 0x34, 0x12, 0x00, 0x06,
0x06, 0xA9, 0x21, 0x40, 0x36, 0xB8, 0xA1, 0x5B, 0x51, 0x2E, 0x03, 0xD5, 0x34, 0x12, 0x00, 0x06,
};
// GLOBAL: gl_24466
static unsigned char s_defaultAesChain[32] = {
0x3D, 0xAF, 0xBA, 0x42, 0x9D, 0x9E, 0xB4, 0x30, 0xB4, 0x22, 0xDA, 0x80, 0x2C, 0x9F, 0xAC, 0x41,
0x3D, 0xAF, 0xBA, 0x42, 0x9D, 0x9E, 0xB4, 0x30, 0xB4, 0x22, 0xDA, 0x80, 0x2C, 0x9F, 0xAC, 0x41,
};
// OFFSET: 0x00617EA0
// FUNCTION: fn_04399
void DecryptAes192(const char* input, char* output) {
CRijndael cipher;
cipher.MakeKey(reinterpret_cast<const char*>(s_defaultAesKey), reinterpret_cast<const char*>(s_defaultAesChain), 24, 24);
cipher.DecryptBlock(input, output);
}
// OFFSET: 0x00617F40
// FUNCTION: fn_04400
void DecryptAes256(const char* input, char* output) {
CRijndael cipher;
cipher.MakeKey(reinterpret_cast<const char*>(s_defaultAesKey), reinterpret_cast<const char*>(s_defaultAesChain), 32, 32);
cipher.DecryptBlock(input, output);
}
const char* CRijndael::sm_chain0 = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
const int CRijndael::sm_shifts[3][4][2] = {{{0, 0}, {1, 3}, {2, 2}, {3, 1}}, {{0, 0}, {1, 5}, {2, 4}, {3, 3}}, {{0, 0}, {1, 7}, {3, 5}, {4, 4}}};

View file

@ -77,6 +77,9 @@ private:
/* 0454 */ int t[MAX_BC];
};
void DecryptAes192(const char* input, char* output);
void DecryptAes256(const char* input, char* output);
#if defined(_WIN32) && !defined(_WIN64)
static_assert(sizeof(CRijndael) == 0x474);
#endif