From 82e16cbb586d066d5ac8bb33bd841dcca0fa7160 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Sat, 7 Nov 2026 02:23:45 +0000 Subject: [PATCH] Decompile fn_05116 (?ReadAuxiliaryIdentifier@?A0xaee75dd0@@YA_KPBXI@Z) Batch #13811 by eAthena: 0 byte-identical, 1 confirmed by peer review. - fn_05116 ?ReadAuxiliaryIdentifier@?A0xaee75dd0@@YA_KPBXI@Z: logic confirmed by peer review Peer-reviewed-by: Yommy, KWDev, SapitoSucio Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Archive/GPak.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/Archive/GPak.cpp b/Source/Archive/GPak.cpp index 241f2dc7b..d1df57faa 100644 --- a/Source/Archive/GPak.cpp +++ b/Source/Archive/GPak.cpp @@ -99,6 +99,7 @@ namespace { /* 0000 */ std::uint8_t version; /* 0001 */ std::uint8_t unknown_0001[3]; /* 0004 */ std::uint64_t identifier; + /* 000C */ std::uint32_t unknown_000C; }; #pragma pack(pop) @@ -123,7 +124,7 @@ namespace { static_assert(sizeof(PakEntryFileV3) == 21); static_assert(offsetof(PakEntryFileV3, flags) == 12); static_assert(offsetof(PakEntryFileV3, dataOffset) == 13); - static_assert(sizeof(PakAuxiliaryFile) == 12); + static_assert(sizeof(PakAuxiliaryFile) == 16); static_assert(offsetof(PakAuxiliaryFile, identifier) == 4); // INLINED @@ -137,10 +138,9 @@ namespace { // FUNCTION: fn_05116 std::uint64_t ReadAuxiliaryIdentifier(const void* data, std::size_t size) { if (size != 0) { - const auto* bytes = static_cast(data); - if (bytes[0] <= 1) { - PakAuxiliaryFile header; - std::memcpy(&header, data, sizeof(header)); + PakAuxiliaryFile header; + std::memcpy(&header, data, sizeof(header)); + if (header.version <= 1) { return header.identifier; } }