mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Merge pull request #8 from PixieCore/master
Renamed hook and memory addresses, FIxed calling original in isPersis…
This commit is contained in:
commit
d8ba5a3740
@ -46,8 +46,8 @@ namespace
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* ==== CCLIENT ========================================================================================================================================================= */
|
||||
DWORD64 p_Persistence_IsReady = /*0x140315CF0*/ reinterpret_cast<DWORD64>(PatternScan("r5apex.exe", "3B 15 ?? ?? ?? ?? 7D 33"));
|
||||
bool (*org_Persistence_IsReady)(__int64 entidx, int client) = (bool(*)(__int64, int))p_Persistence_IsReady;
|
||||
DWORD64 p_CVEngineServer_IsPersistenceDataAvailable = /*0x140315CF0*/ reinterpret_cast<DWORD64>(PatternScan("r5apex.exe", "3B 15 ?? ?? ?? ?? 7D 33"));
|
||||
bool (*org_CVEngineServer_IsPersistenceDataAvailable)(__int64 thisptr /*Class thisptr usually CVEngineServer*/, int client) = (bool(*)(__int64, int))p_CVEngineServer_IsPersistenceDataAvailable;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* ==== UTILITY ========================================================================================================================================================= */
|
||||
|
@ -160,7 +160,7 @@ int HMSG_EngineError(char* fmt, va_list args)
|
||||
}
|
||||
|
||||
// TODO: turn this into a playerstruct constructor if it ever becomes necessary
|
||||
bool HPersistence_IsReady(__int64 entidx, int client)
|
||||
bool HCVEngineClient_IsPersistenceDataAvailable(__int64 thisptr, int client)
|
||||
{
|
||||
static bool isPersistenceVarSet[256];
|
||||
|
||||
@ -182,7 +182,8 @@ bool HPersistence_IsReady(__int64 entidx, int client)
|
||||
printf("\n");
|
||||
isPersistenceVarSet[client] = true;
|
||||
}
|
||||
return org_Persistence_IsReady;
|
||||
|
||||
return org_CVEngineServer_IsPersistenceDataAvailable(thisptr, client);
|
||||
}
|
||||
|
||||
//#################################################################################
|
||||
@ -209,7 +210,7 @@ void InstallENHooks()
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Hook Utility functions
|
||||
DetourAttach((LPVOID*)&org_MSG_EngineError, &HMSG_EngineError);
|
||||
DetourAttach((LPVOID*)&org_Persistence_IsReady, &HPersistence_IsReady);
|
||||
DetourAttach((LPVOID*)&org_CVEngineServer_IsPersistenceDataAvailable, &HCVEngineClient_IsPersistenceDataAvailable);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Commit the transaction
|
||||
@ -245,7 +246,7 @@ void RemoveENHooks()
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Unhook Utility functions
|
||||
DetourDetach((LPVOID*)&org_MSG_EngineError, &HMSG_EngineError);
|
||||
DetourDetach((LPVOID*)&org_Persistence_IsReady, &HPersistence_IsReady);
|
||||
DetourDetach((LPVOID*)&org_CVEngineServer_IsPersistenceDataAvailable, &HCVEngineClient_IsPersistenceDataAvailable);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Commit the transaction
|
||||
|
Loading…
x
Reference in New Issue
Block a user