aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/keyvalues.cpp
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-05-11 14:53:04 +0100
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-05-11 14:53:04 +0100
commitc9771185a73ffb324887a85f6d2185bd14da374d (patch)
tree7afe536c0a2a061ebeb13b9275739cd76e104db4 /NorthstarDedicatedTest/keyvalues.cpp
parent035c1b1dceeaae7c17798c60f37a229fa5a0d83b (diff)
downloadNorthstarLauncher-c9771185a73ffb324887a85f6d2185bd14da374d.tar.gz
NorthstarLauncher-c9771185a73ffb324887a85f6d2185bd14da374d.zip
replace files in ReadFromCache
Diffstat (limited to 'NorthstarDedicatedTest/keyvalues.cpp')
-rw-r--r--NorthstarDedicatedTest/keyvalues.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/NorthstarDedicatedTest/keyvalues.cpp b/NorthstarDedicatedTest/keyvalues.cpp
index 0d6ae964..f79ff194 100644
--- a/NorthstarDedicatedTest/keyvalues.cpp
+++ b/NorthstarDedicatedTest/keyvalues.cpp
@@ -7,20 +7,9 @@
#include <fstream>
-// hook forward defs
typedef char (*KeyValues__LoadFromBufferType)(
void* self, const char* resourceName, const char* pBuffer, void* pFileSystem, void* a5, void* a6, int a7);
KeyValues__LoadFromBufferType KeyValues__LoadFromBuffer;
-char KeyValues__LoadFromBufferHook(
- void* self, const char* resourceName, const char* pBuffer, void* pFileSystem, void* a5, void* a6, int a7);
-
-ON_DLL_LOAD("engine.dll", KeyValues, [](HMODULE baseAddress)
-{
- HookEnabler hook;
- ENABLER_CREATEHOOK(
- hook, (char*)baseAddress + 0x426C30, &KeyValues__LoadFromBufferHook, reinterpret_cast<LPVOID*>(&KeyValues__LoadFromBuffer));
-})
-
char KeyValues__LoadFromBufferHook(void* self, const char* resourceName, const char* pBuffer, void* pFileSystem, void* a5, void* a6, int a7)
{
static void* pSavedFilesystemPtr = nullptr;
@@ -135,4 +124,11 @@ void ModManager::TryBuildKeyValues(const char* filename)
m_modFiles.insert(std::make_pair(normalisedPath, overrideFile));
else
m_modFiles[normalisedPath] = overrideFile;
-} \ No newline at end of file
+}
+
+ON_DLL_LOAD("engine.dll", KeyValues, [](HMODULE baseAddress)
+{
+ HookEnabler hook;
+ ENABLER_CREATEHOOK(
+ hook, (char*)baseAddress + 0x426C30, &KeyValues__LoadFromBufferHook, reinterpret_cast<LPVOID*>(&KeyValues__LoadFromBuffer));
+}) \ No newline at end of file