aboutsummaryrefslogtreecommitdiff
path: root/TestDLL/dllmain.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TestDLL/dllmain.cpp')
-rw-r--r--TestDLL/dllmain.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/TestDLL/dllmain.cpp b/TestDLL/dllmain.cpp
index 7904c24..481f4b4 100644
--- a/TestDLL/dllmain.cpp
+++ b/TestDLL/dllmain.cpp
@@ -219,12 +219,12 @@ static bool ConfigureAndInitGDI(void)
return true;
}
-static bool InitAndCheckPtr(PVOID user_ptr)
+static bool InitAndCheckPtr(struct HuntCtx * HuntCtx)
{
char reserved_stack_space[256];
- pEntSys = *(UINT64*)user_ptr;
- iEnt = *(IEntitySystem **)user_ptr;
+ pEntSys = *(UINT64*)(HuntCtx->ppEntSys);
+ iEnt = *HuntCtx->ppEntSys;
ZeroMemory(&reserved_stack_space[0], sizeof reserved_stack_space);
if (iEnt->GetNumEntities() > 65535) {
@@ -328,10 +328,13 @@ static bool InitAndCheckPtr(PVOID user_ptr)
return true;
}
-void APIENTRY LibEntry(PVOID user_ptr)
+void APIENTRY LibEntry(struct HuntCtx * HuntCtx)
{
static bool firstEntry = true;
+ if (!HuntCtx || !HuntCtx->ppEntSys || !HuntCtx->ppGlobalEnv || !HuntCtx->ppCCryAction)
+ return;
+
if (firstEntry) {
firstEntry = false;
#if 0
@@ -341,7 +344,7 @@ void APIENTRY LibEntry(PVOID user_ptr)
"TestDLL Notification",
MB_OK | MB_ICONINFORMATION);
return;
- }
+}
void *bla = malloc(10);
free(bla);
#endif
@@ -349,7 +352,7 @@ void APIENTRY LibEntry(PVOID user_ptr)
HINSTANCE addr = GetModuleHandle(NULL);
_CRT_INIT(addr, DLL_PROCESS_ATTACH, NULL);
- if (!InitAndCheckPtr(user_ptr))
+ if (!InitAndCheckPtr(HuntCtx))
{
return;
}
@@ -433,4 +436,4 @@ void APIENTRY LibEntry(PVOID user_ptr)
}
gdi_radar_process_window_events_nonblocking(ctx);
-} \ No newline at end of file
+ } \ No newline at end of file