From 3d35011282d633304ea22ae9ee22400f249ebe39 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Wed, 4 Nov 2026 17:58:36 +0000 Subject: [PATCH] Decompile 3 functions in Source/Client/Replay.cpp, Source/Client/Replay.h Batch #10879 by cremane: 0 byte-identical, 3 confirmed by peer review. - fn_19320 Replay::ReadSection: logic confirmed by peer review - fn_19321 ReplayFileList::Refresh: logic confirmed by peer review (already on main) - fn_19322 Replay::ParseMetadata: logic confirmed by peer review Peer-reviewed-by: Tanke, dori, StrawberrysherbetIX Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Client/Replay.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/Source/Client/Replay.cpp b/Source/Client/Replay.cpp index 1ce856683..df70641de 100644 --- a/Source/Client/Replay.cpp +++ b/Source/Client/Replay.cpp @@ -489,16 +489,17 @@ void Replay::ResetFile() { std::vector Replay::ReadSection(int id) { std::vector data; - if (id >= 1 && id <= 25) { - const int index = this->FindSection(id); + if (id < 1 || id > 25) { + return data; + } - if (index != -1 && this->sections[index].fileOffset != 0 && this->sections[index].bytes != 0) { - const ReplaySection& section = this->sections[index]; - data.resize(section.bytes); - std::fseek(this->file, static_cast(section.fileOffset), SEEK_SET); - std::fread(data.data(), section.bytes, 1, this->file); - this->Cipher(section.bytes, data.data()); - } + const int index = this->FindSection(id); + if (index != -1 && this->sections[index].fileOffset != 0 && this->sections[index].bytes != 0) { + const ReplaySection& section = this->sections[index]; + data.resize(section.bytes); + std::fseek(this->file, static_cast(section.fileOffset), SEEK_SET); + std::fread(data.data(), section.bytes, 1, this->file); + this->Cipher(section.bytes, data.data()); } return data; @@ -539,7 +540,7 @@ std::uint32_t Replay::ParseMetadata(const std::vector& data) { if (this->header.signature != this->header.closingSignature) { std::uint32_t fileOffset = this->fileOffset; - ReplayRecordHeader record{}; + ReplayRecordHeader record; int count = static_cast(this->header.records) - 1; if (count > 0) {