aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/r2engine.cpp
diff options
context:
space:
mode:
authorBobTheBob9 <for.oliver.kirkham@gmail.com>2022-07-24 20:55:34 +0100
committerBobTheBob9 <for.oliver.kirkham@gmail.com>2022-07-24 20:55:34 +0100
commit52dc6d143fec8eabb9958bacbdbf6f1b4b4af592 (patch)
tree61473cc529921fa622d7815b06c8530234248034 /NorthstarDLL/r2engine.cpp
parentb0bef05111a95a4cce6250d2b79e2aa5baa6dd98 (diff)
downloadNorthstarLauncher-52dc6d143fec8eabb9958bacbdbf6f1b4b4af592.tar.gz
NorthstarLauncher-52dc6d143fec8eabb9958bacbdbf6f1b4b4af592.zip
add new memory lib
Diffstat (limited to 'NorthstarDLL/r2engine.cpp')
-rw-r--r--NorthstarDLL/r2engine.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/NorthstarDLL/r2engine.cpp b/NorthstarDLL/r2engine.cpp
index 883178ee..451928af 100644
--- a/NorthstarDLL/r2engine.cpp
+++ b/NorthstarDLL/r2engine.cpp
@@ -13,23 +13,21 @@ namespace R2
CEngine* g_pEngine;
void (*CBaseClient__Disconnect)(void* self, uint32_t unknownButAlways1, const char* reason, ...);
-
CBaseClient* g_pClientArray;
server_state_t* g_pServerState;
} // namespace R2
-ON_DLL_LOAD("engine.dll", R2Engine, (HMODULE baseAddress))
+ON_DLL_LOAD("engine.dll", R2Engine, (CModule module))
{
- Cbuf_GetCurrentPlayer = (Cbuf_GetCurrentPlayerType)((char*)baseAddress + 0x120630);
- Cbuf_AddText = (Cbuf_AddTextType)((char*)baseAddress + 0x1203B0);
- Cbuf_Execute = (Cbuf_ExecuteType)((char*)baseAddress + 0x1204B0);
-
- g_pEngine = *(CEngine**)((char*)baseAddress + 0x7D70C8);
+ Cbuf_GetCurrentPlayer = module.Offset(0x120630).As<Cbuf_GetCurrentPlayerType>();
+ Cbuf_AddText = module.Offset(0x1203B0).As<Cbuf_AddTextType>();
+ Cbuf_Execute = module.Offset(0x1204B0).As<Cbuf_ExecuteType>();
- CBaseClient__Disconnect = (void (*)(void*, uint32_t, const char*, ...))((char*)baseAddress + 0x1012C0);
+ g_pEngine = module.Offset(0x7D70C8).Deref().As<CEngine*>(); // new
- g_pServerState = (server_state_t*)((char*)baseAddress + 0x12A53D48);
+ CBaseClient__Disconnect = module.Offset(0x1012C0).As<void(*)(void*, uint32_t, const char*, ...)>();
+ g_pClientArray = module.Offset(0x12A53F90).As<CBaseClient*>();
- g_pClientArray = (CBaseClient*)((char*)baseAddress + 0x12A53F90);
+ g_pServerState = module.Offset(0x12A53D48).As<server_state_t*>();
} \ No newline at end of file