rodecomp/Source/Archive/MemMapPakFile.h
ragnarok-clanker 16625875b3 Decompile fn_18111 (PakRegistry::Add)
Batch #17750 by eAthena: 0 byte-identical, 1 confirmed by peer review.

- fn_18111 PakRegistry::Add: logic confirmed by peer review

Peer-reviewed-by: Yommy, alisonrag, bibinir
Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
2026-11-12 03:18:35 +00:00

37 lines
1 KiB
C++

#ifndef RAGNAROK_SOURCE_ARCHIVE_MEMMAPPAKFILE_H
#define RAGNAROK_SOURCE_ARCHIVE_MEMMAPPAKFILE_H
#include "Archive/PakFile.h"
class CMemMapPakFile : public CPakFile {
public:
// INLINED
explicit CMemMapPakFile(const char* filename) {
this->Initialize();
this->Open(filename);
}
~CMemMapPakFile() override;
void Initialize();
bool Open(const char* filename);
__declspec(noinline) void Close();
std::uint64_t GetSize() const override;
std::uint8_t* Read(std::uint64_t offset, std::uint32_t length) override;
protected:
/* 0004 */ HANDLE m_handle = nullptr;
/* 0008 */ HANDLE m_mapping = nullptr;
/* 000C */ std::uint32_t m_viewSize = 0;
/* 0010 */ std::uint32_t m_windowSize = 0;
/* 0018 */ std::uint64_t m_size = 0;
/* 0020 */ std::uint64_t m_viewOffset = 0;
/* 0028 */ std::uint64_t m_offsetMask = 0;
/* 0030 */ std::uint8_t* m_view = nullptr;
/* 0034 */ std::vector<std::uint8_t> m_buffer;
};
#if defined(_WIN32) && !defined(_WIN64)
static_assert(sizeof(CMemMapPakFile) == 64);
#endif
#endif