bigly changes (see description)
- use LdrRegisterDllNotification instead of LoadLibraryExW for patching ** LoadLibraryExW is currently still hooked for the UpdatePack7 compatibility fix, I'm looking into other alternatives - more robust error checking - refactored a lot of code to be more reusable - header guards - better logging framework - tighter permissions on the unload event - probably other stuff I forgot about
This commit is contained in:
@@ -1,23 +1,25 @@
|
||||
#include <Windows.h>
|
||||
|
||||
#include "callbacks.h"
|
||||
#include "helpers.h"
|
||||
#include "logging.h"
|
||||
#include "hooks.h"
|
||||
|
||||
#include <Windows.h>
|
||||
|
||||
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {
|
||||
switch (ul_reason_for_call) {
|
||||
switch ( ul_reason_for_call ) {
|
||||
case DLL_PROCESS_ATTACH:
|
||||
{
|
||||
if (!IsOperatingSystemSupported() || IsWow64())
|
||||
if ( !IsOperatingSystemSupported() || IsWow64() )
|
||||
return FALSE;
|
||||
|
||||
|
||||
DisableThreadLibraryCalls(hModule);
|
||||
HANDLE hThread = CreateThread(NULL, 0, NewThreadProc, NULL, 0, NULL);
|
||||
HANDLE hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadProcCallback, (LPVOID)hModule, 0, NULL);
|
||||
CloseHandle(hThread);
|
||||
break;
|
||||
}
|
||||
case DLL_PROCESS_DETACH:
|
||||
logging_free();
|
||||
if ( !lpReserved )
|
||||
FreeNTDLL();
|
||||
FreeLogging();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
Reference in New Issue
Block a user