tswow/misc/client-extensions/ClientExtensions/Main.cpp

38 lines
852 B
C++
Raw Permalink Normal View History

2021-10-17 14:51:35 +02:00
#include "windows.h"
#include "detours.h"
#include <vector>
#include "ClientDetours.h"
2021-10-17 14:51:35 +02:00
#include "Logger.h"
#include "ClientArguments.h"
2021-10-20 10:11:40 +02:00
#include "ClientNetwork.h"
#include "scripts.generated.h"
2021-10-17 14:51:35 +02:00
class Main
{
public:
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-17 14:51:35 +02:00
extern "C" {
// 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)
{
if (fdwReason == DLL_PROCESS_ATTACH)
{
DisableThreadLibraryCalls(hinstDLL);
Main::startup();
}
return TRUE;
2021-10-17 14:51:35 +02:00
}