mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Moved SVC_Print::Process to a class method.
* Virtual Method Swap also points to the class method now with some dodgy memory dereferencing.
This commit is contained in:
parent
3736d71bb1
commit
1ea4dd6163
@ -12,11 +12,11 @@
|
|||||||
#include "common/netmessages.h"
|
#include "common/netmessages.h"
|
||||||
#include "engine/sys_utils.h"
|
#include "engine/sys_utils.h"
|
||||||
|
|
||||||
bool HSVC_Print_Process(SVC_Print* thisptr)
|
bool SVC_Print::Process()
|
||||||
{
|
{
|
||||||
if (thisptr->m_szText)
|
if (this->m_szText)
|
||||||
{
|
{
|
||||||
DevMsg(eDLL_T::SERVER, thisptr->m_szText);
|
DevMsg(eDLL_T::SERVER, this->m_szText);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true; // Original just return true also.
|
return true; // Original just return true also.
|
||||||
@ -24,7 +24,8 @@ bool HSVC_Print_Process(SVC_Print* thisptr)
|
|||||||
|
|
||||||
void CNetMessages_Attach()
|
void CNetMessages_Attach()
|
||||||
{
|
{
|
||||||
CMemory::HookVirtualMethod((uintptr_t)g_pSVC_Print_VTable, (LPVOID)HSVC_Print_Process, (LPVOID*)&SVC_Print_Process, 3);
|
auto SVCPrint = &SVC_Print::Process;
|
||||||
|
CMemory::HookVirtualMethod((uintptr_t)g_pSVC_Print_VTable, (LPVOID&)SVCPrint, (LPVOID*)&SVC_Print_Process, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CNetMessages_Detach()
|
void CNetMessages_Detach()
|
||||||
|
@ -17,6 +17,8 @@ public:
|
|||||||
char padding[8];
|
char padding[8];
|
||||||
const char* m_szText;
|
const char* m_szText;
|
||||||
|
|
||||||
|
bool Process();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
char m_szTextBuffer[2048];
|
char m_szTextBuffer[2048];
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user