mirror of
https://github.com/tswow/tswow
synced 2026-08-14 20:29:06 -04:00
37 lines
852 B
C++
37 lines
852 B
C++
#include "windows.h"
|
|
#include "detours.h"
|
|
#include <vector>
|
|
#include "ClientDetours.h"
|
|
#include "Logger.h"
|
|
#include "ClientArguments.h"
|
|
#include "ClientNetwork.h"
|
|
#include "scripts.generated.h"
|
|
|
|
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();
|
|
}
|
|
};
|
|
|
|
extern "C" {
|
|
// The function we register in the exe to load this dll
|
|
__declspec(dllexport) void ClientExtensionsDummy() {}
|
|
}
|
|
|
|
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved)
|
|
{
|
|
if (fdwReason == DLL_PROCESS_ATTACH)
|
|
{
|
|
DisableThreadLibraryCalls(hinstDLL);
|
|
Main::startup();
|
|
}
|
|
return TRUE;
|
|
}
|