2021-10-17 14:51:35 +02:00
|
|
|
#include "windows.h"
|
|
|
|
|
#include "detours.h"
|
|
|
|
|
#include <vector>
|
2021-10-18 12:39:15 +02:00
|
|
|
#include "ClientDetours.h"
|
2021-10-17 14:51:35 +02:00
|
|
|
#include "Logger.h"
|
2021-10-20 07:26:45 +02:00
|
|
|
#include "ClientArguments.h"
|
2021-10-20 10:11:40 +02:00
|
|
|
#include "ClientNetwork.h"
|
2021-10-19 12:47:32 +02:00
|
|
|
#include "scripts.generated.h"
|
2021-10-17 14:51:35 +02:00
|
|
|
|
2021-10-18 12:39:15 +02:00
|
|
|
class Main
|
|
|
|
|
{
|
|
|
|
|
public:
|
2021-10-23 12:09:38 +02:00
|
|
|
static void startup()
|
|
|
|
|
{
|
|
|
|
|
LOG_INFO << "Client starting up";
|
|
|
|
|
// gets this from scripts.generated.ih
|
|
|
|
|
__init_scripts();
|
|
|
|
|
ClientNetwork::initialize();
|
|
|
|
|
ClientArguments::initialize(GetCommandLineA());
|
|
|
|
|
ClientDetours::Apply();
|
|
|
|
|
}
|
2021-10-18 12:39:15 +02:00
|
|
|
};
|
|
|
|
|
|
2021-10-17 14:51:35 +02:00
|
|
|
extern "C" {
|
2021-10-23 12:09:38 +02:00
|
|
|
// The function we register in the exe to load this dll
|
|
|
|
|
__declspec(dllexport) void ClientExtensionsDummy() {}
|
2021-10-17 14:51:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved)
|
|
|
|
|
{
|
2021-10-23 12:09:38 +02:00
|
|
|
if (fdwReason == DLL_PROCESS_ATTACH)
|
|
|
|
|
{
|
|
|
|
|
DisableThreadLibraryCalls(hinstDLL);
|
|
|
|
|
Main::startup();
|
|
|
|
|
}
|
|
|
|
|
return TRUE;
|
2021-10-17 14:51:35 +02:00
|
|
|
}
|