r5sdk/r5dev/dllmain.cpp
Amos 850bbc19ef Code refactor + improvents
* Move all utilities to single implementation file
* Remove unnecessary code in .cpp and .h
* Patch opcodes in runtime instead of patching raw PE file
* Move launch parameters to cfg folder instead
* Move back to pattern scan instead of hardcoded offsets
* Change langauge to new ISO C++17 standard
2021-06-08 10:54:49 -07:00

55 lines
1.3 KiB
C++

#include <Windows.h>
#include <string>
#include "r5dev.h"
#include "hooks.h"
#include "opcptc.h"
#include "console.h"
#include "utility.h"
//---------------------------------------------------------------------------------
// Init
//---------------------------------------------------------------------------------
void InitializeR5Dev()
{
SetupConsole();
InstallHooks();
InstallOpcodes();
printf("+-----------------------------------------------------------------------------+\n");
printf("| R5 DEV -- INITIALIZED ------------------------------------------------- |\n");
printf("+-----------------------------------------------------------------------------+\n");
printf("\n");
}
void TerminateR5Dev()
{
RemoveHooks();
FreeConsole();
}
//---------------------------------------------------------------------------------
// Main
//---------------------------------------------------------------------------------
BOOL APIENTRY DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpReserved)
{
switch (dwReason)
{
case DLL_PROCESS_ATTACH:
{
InitializeR5Dev();
break;
}
case DLL_PROCESS_DETACH:
{
TerminateR5Dev();
break;
}
}
return TRUE;
}