mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
* 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
55 lines
1.3 KiB
C++
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;
|
|
}
|