Panoptes 1.0.0
Endpoint Detection and Response
Loading...
Searching...
No Matches
dllmain.cpp File Reference
#include <Windows.h>
#include "hook.hpp"
#include "hook_trace.hpp"

Go to the source code of this file.

Functions

BOOL APIENTRY DllMain (HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)

Function Documentation

◆ DllMain()

BOOL APIENTRY DllMain ( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved )

Definition at line 5 of file dllmain.cpp.

6{
7 switch (ul_reason_for_call)
8 {
9 case DLL_PROCESS_ATTACH:
10 DisableThreadLibraryCalls(hModule);
11 // Register before the hooks are placed so the first detection is not lost
13 PlaceHooks();
14
15 break;
16 case DLL_PROCESS_DETACH:
17 UnHook();
19 break;
20 }
21 return TRUE;
22}
VOID UnHook()
The UnHook function removes the hooks from the NTDLL functions.
Definition hook.cpp:1052
VOID PlaceHooks()
The PlaceHooks function places the hooks on the NTDLL functions.
Definition hook.cpp:1019
VOID HookTraceInit()
Registers the provider. Call before placing the hooks.
VOID HookTraceUninit()
Unregisters the provider. Call after removing the hooks.

References HookTraceInit(), HookTraceUninit(), PlaceHooks(), and UnHook().