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).
This commit is contained in:
parent
95b2493382
commit
3d35011282
1 changed files with 12 additions and 11 deletions
|
|
@ -489,16 +489,17 @@ void Replay::ResetFile() {
|
|||
std::vector<unsigned char> Replay::ReadSection(int id) {
|
||||
std::vector<unsigned char> 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<long>(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<long>(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<unsigned char>& data) {
|
|||
|
||||
if (this->header.signature != this->header.closingSignature) {
|
||||
std::uint32_t fileOffset = this->fileOffset;
|
||||
ReplayRecordHeader record{};
|
||||
ReplayRecordHeader record;
|
||||
int count = static_cast<int>(this->header.records) - 1;
|
||||
|
||||
if (count > 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue