Refactored dynamically linking ntdll
This commit is contained in:
@ -1,6 +1,5 @@
|
||||
#include <windows.h>
|
||||
|
||||
#include <ntdll.h>
|
||||
#include <ace.h>
|
||||
#include <game.h>
|
||||
#include <core.h>
|
||||
@ -8,6 +7,9 @@
|
||||
#include <msg.h>
|
||||
#include <tx.h>
|
||||
|
||||
#define NTDLL_DYNAMIC_LINK_IMPL
|
||||
#include <ntdll.h>
|
||||
|
||||
#include <main.h>
|
||||
|
||||
HMODULE this_module;
|
||||
@ -76,7 +78,7 @@ BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved) {
|
||||
this_module = instance;
|
||||
|
||||
// Dynamically link functions from ntdll
|
||||
ntdll_link();
|
||||
_ntdll_link();
|
||||
|
||||
// Detect which game the user is trying to run
|
||||
struct game_data game;
|
||||
|
||||
@ -1,11 +0,0 @@
|
||||
#include <ntdll.h>
|
||||
|
||||
LdrRegisterDllNotification_t LdrRegisterDllNotification;
|
||||
LdrUnregisterDllNotification_t LdrUnregisterDllNotification;
|
||||
|
||||
void ntdll_link() {
|
||||
HMODULE ntdll = GetModuleHandleA("ntdll.dll");
|
||||
|
||||
LdrRegisterDllNotification = (LdrRegisterDllNotification_t)GetProcAddress(ntdll, "LdrRegisterDllNotification");
|
||||
LdrUnregisterDllNotification = (LdrUnregisterDllNotification_t)GetProcAddress(ntdll, "LdrUnregisterDllNotification");
|
||||
}
|
||||
Reference in New Issue
Block a user