From f674d409944cb3d2d582bea1fdb0b03d65c25c2a Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 12 Nov 2026 11:09:29 +0000 Subject: [PATCH] Decompile fn_18105 (myGPack::PakCipher::BuildRoundKeys) Batch #18020 by eAthena: 0 byte-identical, 1 confirmed by peer review. - fn_18105 myGPack::PakCipher::BuildRoundKeys: logic confirmed by peer review Peer-reviewed-by: ragnarok-clanker, Yommy, bibinir Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Archive/PakCipher.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Archive/PakCipher.cpp b/Source/Archive/PakCipher.cpp index 9535428cb..9b27b15dd 100644 --- a/Source/Archive/PakCipher.cpp +++ b/Source/Archive/PakCipher.cpp @@ -180,6 +180,7 @@ namespace myGPack { std::memset(this->m_roundKeys[round], 0, sizeof(this->m_roundKeys[round])); + unsigned bitsPerGroup = 6; for (unsigned i = 0; i < 48; ++i) { std::uint8_t bit = s_keyCompression[i] - 1; unsigned byte; @@ -191,7 +192,7 @@ namespace myGPack { } if (halves[byte] & s_bitMasks[bit & 7]) { - this->m_roundKeys[round][i / 6] |= s_bitMasks[i % 6]; + this->m_roundKeys[round][i / bitsPerGroup] |= s_bitMasks[i % bitsPerGroup]; } } }