r5sdk/r5dev/common/netmessages.cpp
PixieCore 1ea4dd6163 Moved SVC_Print::Process to a class method.
* Virtual Method Swap also points to the class method now with some dodgy memory dereferencing.
2022-04-27 18:42:49 +02:00

34 lines
928 B
C++

//===============================================================================//
//
// Purpose:
//
// $NoKeywords: $
//
//===============================================================================//
// netmessages.cpp: implementation of the CNetMessage types.
//
///////////////////////////////////////////////////////////////////////////////////
#include "core/stdafx.h"
#include "common/netmessages.h"
#include "engine/sys_utils.h"
bool SVC_Print::Process()
{
if (this->m_szText)
{
DevMsg(eDLL_T::SERVER, this->m_szText);
}
return true; // Original just return true also.
}
void CNetMessages_Attach()
{
auto SVCPrint = &SVC_Print::Process;
CMemory::HookVirtualMethod((uintptr_t)g_pSVC_Print_VTable, (LPVOID&)SVCPrint, (LPVOID*)&SVC_Print_Process, 3);
}
void CNetMessages_Detach()
{
CMemory::HookVirtualMethod((uintptr_t)g_pSVC_Print_VTable, (LPVOID)p_SVC_Print_Process, (LPVOID*)&SVC_Print_Process, 3);
}