Decompile 2 functions in Source/Client/Replay/Replay.cpp

Batch #16840 by eAthena: 0 byte-identical, 2 confirmed by peer review.

- fn_19320 Replay::ReadSection: logic confirmed by peer review
- fn_19329 Replay::CachePacket: logic confirmed by peer review

Peer-reviewed-by: ragnarok-clanker, Yommy, br4yan
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-11-11 11:56:34 +00:00
commit cdf3b777ca

View file

@ -469,7 +469,7 @@ std::vector<unsigned char> Replay::ReadSection(int id) {
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);
data.resize(section.bytes, 0);
std::fseek(this->file, static_cast<long>(section.fileOffset), SEEK_SET);
std::fread(data.data(), section.bytes, 1, this->file);
this->Cipher(section.bytes, data.data());
@ -1016,7 +1016,7 @@ void Replay::CachePacket(std::uint16_t id, std::uint16_t size, const unsigned ch
if (!this->cachedPackets[static_cast<short>(id)].enabled) {
return;
}
this->cachedPackets[static_cast<short>(id)].bytes.resize(size, 0);
this->cachedPackets[static_cast<short>(id)].bytes.resize(size);
this->cachedPackets[static_cast<short>(id)].bytes.assign(data, data + size);
}