diff options
author | Sergeanur <s.anureev@yandex.ua> | 2021-01-08 22:42:42 +0100 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2021-01-08 22:42:42 +0100 |
commit | a871da4fbe3094a74295b5c00089bc24334ead56 (patch) | |
tree | 89f731295a9227fc4cf4ea7e6588b5f01468437d /src/leeds/base/relocatableChunk.h | |
parent | Level 4 (diff) | |
download | re3-a871da4fbe3094a74295b5c00089bc24334ead56.tar re3-a871da4fbe3094a74295b5c00089bc24334ead56.tar.gz re3-a871da4fbe3094a74295b5c00089bc24334ead56.tar.bz2 re3-a871da4fbe3094a74295b5c00089bc24334ead56.tar.lz re3-a871da4fbe3094a74295b5c00089bc24334ead56.tar.xz re3-a871da4fbe3094a74295b5c00089bc24334ead56.tar.zst re3-a871da4fbe3094a74295b5c00089bc24334ead56.zip |
Diffstat (limited to '')
-rw-r--r-- | src/leeds/base/relocatableChunk.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/leeds/base/relocatableChunk.h b/src/leeds/base/relocatableChunk.h new file mode 100644 index 00000000..ea910240 --- /dev/null +++ b/src/leeds/base/relocatableChunk.h @@ -0,0 +1,51 @@ +#pragma once + +namespace base +{ + // TODO(LCS): add actual struct fields + + struct sChunkHeader; + struct sDataBlock; + struct sFileLine; + + class cRelocatableChunk + { + public: + void* Load(void* data, bool bShrink); + void* Load(const char* name, bool bShrink); + void Fixup(const sChunkHeader& header, void* data); + void Fixup(void* data); + void* Shrink(const sChunkHeader& header, void* data); + void* Shrink(void* data); + }; + + class cRelocatableChunkClassInfo + { + public: + cRelocatableChunkClassInfo(const char* class_name, const void* pVmt, int size); + }; + + class cRelocatableChunkWriter + { + public: + cRelocatableChunkWriter(); + ~cRelocatableChunkWriter(); + + void AddPatch(void* addr); + void AddPatchWithInfo(const char* str, int unk, void* addr); + void AllocateRaw(void* addr, uint32 size, uint32 align, bool a5 = false, bool a6 = false); + + void Clear(); + void Class(void* ptr, const cRelocatableChunkClassInfo& classInfo); + void DebugFileLine(void*); + + void PatchFunc(void* ptr); + + bool IsAllocated(void* addr); + + void Reserve(int, int); + + void Save(const char* filename, uint32 a3, uint32 a4, bool a5); + void Save(void* file, uint32 a3, uint32 a4, bool a5, sChunkHeader* pHeader); + }; +};
\ No newline at end of file |