Batch #3333 by youko: 0 byte-identical, 26 confirmed by peer review. - fn_24308 myGPack::CGPakUpdate::`scalar deleting destructor': logic confirmed by peer review (annotation added to existing code) - fn_24309 myGPack::CNotifier::~CNotifier: logic confirmed by peer review (annotation added to existing code) - fn_24331 AdtestexeProcessName::operator(): logic confirmed by peer review (annotation added to existing code) - fn_24332 RagexeMProcessName::operator(): logic confirmed by peer review (annotation added to existing code) - fn_24333 SakexeMProcessName::operator(): logic confirmed by peer review (annotation added to existing code) - fn_24334 Kernel32LibraryName::operator(): logic confirmed by peer review (annotation added to existing code) - fn_24335 PsapiLibraryName::operator(): logic confirmed by peer review (annotation added to existing code) - fn_24336 CreateToolhelp32SnapshotName::operator(): logic confirmed by peer review (annotation added to existing code) - fn_24337 EnumProcessesName::operator(): logic confirmed by peer review (annotation added to existing code) - fn_24338 AdventurerAgencyCreateInstanceName::operator(): logic confirmed by peer review (annotation added to existing code) - fn_24339 RequestJoinPartyCreateInstanceName::operator(): logic confirmed by peer review (annotation added to existing code) - fn_24340 AdventureGuideCreateInstanceName::operator(): logic confirmed by peer review (annotation added to existing code) - fn_24341 GoodResultName::operator(): logic confirmed by peer review (annotation added to existing code) - fn_24342 Process32FirstName::operator(): logic confirmed by peer review (annotation added to existing code) - fn_24343 EnumProcessModulesName::operator(): logic confirmed by peer review (annotation added to existing code) - fn_24344 Process32NextName::operator(): logic confirmed by peer review (annotation added to existing code) - fn_24345 GetModuleBaseNameAName::operator(): logic confirmed by peer review (annotation added to existing code) - fn_24346 RagexeModuleName::operator(): logic confirmed by peer review (annotation added to existing code) - fn_24347 RagexeProcessName::operator(): logic confirmed by peer review (annotation added to existing code) - fn_24348 SakexeModuleName::operator(): logic confirmed by peer review (annotation added to existing code) - fn_24349 SakexeProcessName::operator(): logic confirmed by peer review (annotation added to existing code) - fn_24350 RagexereModuleName::operator(): logic confirmed by peer review (annotation added to existing code) - fn_24351 RagexereProcessName::operator(): logic confirmed by peer review (annotation added to existing code) - fn_24352 RagtestexeProcessName::operator(): logic confirmed by peer review (annotation added to existing code) - fn_24353 SaktestexeProcessName::operator(): logic confirmed by peer review (annotation added to existing code) - fn_24359 RemovePath: logic confirmed by peer review (annotation added to existing code) Peer-reviewed-by: eAthena, alisonrag, superintelligence Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
75 lines
1.7 KiB
C++
75 lines
1.7 KiB
C++
#ifndef RAGNAROK_SOURCE_ARCHIVE_GPAKUPDATE_H
|
|
#define RAGNAROK_SOURCE_ARCHIVE_GPAKUPDATE_H
|
|
|
|
#include "Archive/GPak.h"
|
|
#include "Archive/PakFile.h"
|
|
#include "Archive/PakName.h"
|
|
|
|
#include <compare>
|
|
#include <cstddef>
|
|
#include <cstdint>
|
|
#include <list>
|
|
#include <set>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace myGPack {
|
|
|
|
class CNotifier {
|
|
public:
|
|
// OFFSET: 0x00E55AC0
|
|
// FUNCTION: fn_24309
|
|
virtual ~CNotifier() {
|
|
}
|
|
|
|
virtual void Notify(std::uint64_t current, std::uint64_t total) {
|
|
}
|
|
};
|
|
|
|
class CGPakRead : public CGPak {
|
|
public:
|
|
bool ReadEntry(PakEntry* entry, void* buffer);
|
|
void CollectNames(std::set<std::string>& names) const;
|
|
};
|
|
|
|
struct PakFreeBlock {
|
|
/* 0000 */ std::uint32_t size;
|
|
/* 0008 */ std::uint64_t offset;
|
|
|
|
auto operator<=>(const PakFreeBlock& other) const = default;
|
|
};
|
|
|
|
static_assert(sizeof(PakFreeBlock) == 16);
|
|
static_assert(offsetof(PakFreeBlock, offset) == 8);
|
|
|
|
class CGPakUpdate : public CGPakRead {
|
|
public:
|
|
CGPakUpdate();
|
|
~CGPakUpdate() override;
|
|
|
|
bool Open(const char* filename);
|
|
bool Commit(CNotifier* notifier);
|
|
void Close();
|
|
|
|
protected:
|
|
bool RemoveObsoleteEntries();
|
|
void BuildFreeBlocks();
|
|
std::uint64_t Allocate(std::uint32_t size);
|
|
bool CopyEntry(const PakName& name);
|
|
|
|
/* 0148 */ std::list<CGPakRead*> m_sources;
|
|
/* 0150 */ std::set<std::string> m_names;
|
|
/* 0158 */ std::vector<PakEntry> m_added;
|
|
/* 0164 */ std::set<PakFreeBlock> m_freeBlocks;
|
|
/* 0170 */ CWritePakFile m_output;
|
|
/* 0190 */ CNotifier m_notifier;
|
|
/* 0194 */ std::vector<std::uint8_t> m_auxiliary;
|
|
};
|
|
|
|
}
|
|
|
|
#if defined(_WIN32) && !defined(_WIN64)
|
|
static_assert(sizeof(myGPack::CGPakUpdate) == 416);
|
|
#endif
|
|
|
|
#endif
|