Update sig+patch but disable them
It's really cursed and I don't wanna deal with that for now, we can make do without the ONE plugin that needs it
This commit is contained in:
parent
e6f1a6069c
commit
d1f88e0819
@ -68,8 +68,8 @@ struct SrcdsPatch
|
|||||||
#if SOURCE_ENGINE == SE_CSS && defined PLATFORM_LINUX
|
#if SOURCE_ENGINE == SE_CSS && defined PLATFORM_LINUX
|
||||||
{
|
{
|
||||||
"Physics_RunThinkFunctions",
|
"Physics_RunThinkFunctions",
|
||||||
(unsigned char *)"\x8B\x04\x9E\x85\xC0\x74\x13\xA1\x00\x00\x00\x00\x89\x78\x0C\x8B\x04\x9E\x89\x04\x24\xE8\x00\x00\x00\x00",
|
(unsigned char *)"\x8B\x14\x9E\x85\xD2\x74\x00\xA1\x00\x00\x00\x00\x83\xEC\x00\xF3\x0F\x10\x55\x00\xF3\x0F\x11\x50\x00\xFF",
|
||||||
"xxxxxxxx????xxxxxxxxxx????",
|
"xxxxxx?x????xx?xxxx?xxxx?x",
|
||||||
NULL,
|
NULL,
|
||||||
0, 0, 0, false
|
0, 0, 0, false
|
||||||
}
|
}
|
||||||
@ -153,7 +153,7 @@ void (__fastcall *g_pPhysics_SimulateEntity)(CBaseEntity *pEntity) = NULL;
|
|||||||
|
|
||||||
void Physics_SimulateEntity_CustomLoop(CBaseEntity **ppList, int Count, float Startime)
|
void Physics_SimulateEntity_CustomLoop(CBaseEntity **ppList, int Count, float Startime)
|
||||||
{
|
{
|
||||||
CBaseEntity *apPlayers[g_iMaxPlayers];
|
CUtlVectorFixed<CBaseEntity*, 64> apPlayers;
|
||||||
int iPlayers = 0;
|
int iPlayers = 0;
|
||||||
|
|
||||||
// Remove players from list and put into apPlayers
|
// Remove players from list and put into apPlayers
|
||||||
@ -497,19 +497,22 @@ bool PhysHooks::SDK_OnLoad(char *error, size_t maxlength, bool late)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if SOURCE_ENGINE == SE_CSS && defined PLATFORM_LINUX
|
#if SOURCE_ENGINE == SE_CSS && defined PLATFORM_LINUX
|
||||||
// mov [esp+8], edi ; startime
|
// sub esp, 4 ; allocate room on stack for starttime
|
||||||
// mov [esp+4], eax ; count
|
// movss [esp], xmm2 ; startime
|
||||||
// mov [esp], esi ; **list
|
// push eax ; count
|
||||||
|
// push esi ; **list
|
||||||
// call NULL ; <- our func here
|
// call NULL ; <- our func here
|
||||||
// jmp +16 ; jump over useless instructions
|
// add esp, 12 ; fix up stack
|
||||||
static unsigned char aPatch[] = "\x89\x7C\x24\x08\x89\x44\x24\x04\x89\x34\x24\xE8\x00\x00\x00\x00\xEB\x10\x90\x90\x90\x90\x90\x90\x90\x90";
|
// jmp +24 ; jump over useless instructions
|
||||||
|
//"\x8B\x14\x9E\x85\xD2\x74\x00\xA1\x00\x00\x00\x00\x83\xEC\x00\xF3\x0F\x10\x55\x00\xF3\x0F\x11\x50\x00\xFF"
|
||||||
|
static unsigned char aPatch[] = "\x83\xEC\x04\xF3\x0F\x11\x14\x24\x50\x56\xE8\x00\x00\x00\x00\x83\xC4\x0C\xEB\x18\x90\x90\x90\x90\x90\x90";
|
||||||
gs_Patches[0].pPatch = aPatch;
|
gs_Patches[0].pPatch = aPatch;
|
||||||
|
|
||||||
// put our function address into the relative call instruction
|
// put our function address into the relative call instruction
|
||||||
// relative call: new PC = PC + imm1
|
// relative call: new PC = PC + imm1
|
||||||
// call is at + 11 after pPatchAddress
|
// call is at + 10 after pPatchAddress
|
||||||
// PC will be past our call instruction so + 5
|
// PC will be past our call instruction so + 5
|
||||||
*(uintptr_t *)&aPatch[12] = (uintptr_t)Physics_SimulateEntity_CustomLoop - (pPatchAddress + 11 + 5);
|
*(uintptr_t *)&aPatch[11] = (uintptr_t)Physics_SimulateEntity_CustomLoop - (pPatchAddress + 10 + 5);
|
||||||
#elif SOURCE_ENGINE == SE_CSGO && defined PLATFORM_LINUX
|
#elif SOURCE_ENGINE == SE_CSGO && defined PLATFORM_LINUX
|
||||||
// mov [esp+8], edi ; startime
|
// mov [esp+8], edi ; startime
|
||||||
// mov [esp+4], eax ; count
|
// mov [esp+4], eax ; count
|
||||||
@ -545,6 +548,10 @@ bool PhysHooks::SDK_OnLoad(char *error, size_t maxlength, bool late)
|
|||||||
#error "Unsupported platform"
|
#error "Unsupported platform"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
bool bSuccess = true;
|
||||||
|
|
||||||
|
// TODO: Fix this cursed patch
|
||||||
|
/*
|
||||||
// Apply all patches
|
// Apply all patches
|
||||||
for(size_t i = 0; i < sizeof(gs_Patches) / sizeof(*gs_Patches); i++)
|
for(size_t i = 0; i < sizeof(gs_Patches) / sizeof(*gs_Patches); i++)
|
||||||
{
|
{
|
||||||
@ -553,17 +560,17 @@ bool PhysHooks::SDK_OnLoad(char *error, size_t maxlength, bool late)
|
|||||||
|
|
||||||
if(!g_pGameConf->GetMemSig(pPatch->pSignature, (void **)&pPatch->pAddress) || !pPatch->pAddress)
|
if(!g_pGameConf->GetMemSig(pPatch->pSignature, (void **)&pPatch->pAddress) || !pPatch->pAddress)
|
||||||
{
|
{
|
||||||
snprintf(error, maxlength, "Could not find symbol: %s", pPatch->pSignature);
|
g_pSM->LogError(myself, "Could not find symbol: %s", pPatch->pSignature);
|
||||||
SDK_OnUnload();
|
bSuccess = false;
|
||||||
return false;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
pPatch->pPatchAddress = FindPattern(pPatch->pAddress, pPatch->pPatchSignature, pPatch->pPatchPattern, 1024);
|
pPatch->pPatchAddress = FindPattern(pPatch->pAddress, pPatch->pPatchSignature, pPatch->pPatchPattern, 1024);
|
||||||
if(!pPatch->pPatchAddress)
|
if(!pPatch->pPatchAddress)
|
||||||
{
|
{
|
||||||
snprintf(error, maxlength, "Could not find patch signature for symbol: %s", pPatch->pSignature);
|
g_pSM->LogError(myself, "Could not find patch signature for symbol: %s", pPatch->pSignature);
|
||||||
SDK_OnUnload();
|
bSuccess = false;
|
||||||
return false;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
pPatch->pOriginal = (unsigned char *)malloc(PatchLen * sizeof(unsigned char));
|
pPatch->pOriginal = (unsigned char *)malloc(PatchLen * sizeof(unsigned char));
|
||||||
@ -576,10 +583,17 @@ bool PhysHooks::SDK_OnLoad(char *error, size_t maxlength, bool late)
|
|||||||
}
|
}
|
||||||
SourceHook::SetMemAccess((void *)pPatch->pPatchAddress, PatchLen, SH_MEM_READ|SH_MEM_EXEC);
|
SourceHook::SetMemAccess((void *)pPatch->pPatchAddress, PatchLen, SH_MEM_READ|SH_MEM_EXEC);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (!bSuccess)
|
||||||
|
{
|
||||||
|
SDK_OnUnload();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
g_pOnRunThinkFunctions = forwards->CreateForward("OnRunThinkFunctions", ET_Ignore, 1, NULL, Param_Cell);
|
g_pOnRunThinkFunctions = forwards->CreateForward("OnRunThinkFunctions", ET_Ignore, 1, NULL, Param_Cell);
|
||||||
g_pOnPrePlayerThinkFunctions = forwards->CreateForward("OnPrePlayerThinkFunctions", ET_Ignore, 0, NULL);
|
g_pOnPrePlayerThinkFunctions = forwards->CreateForward("OnPrePlayerThinkFunctions", ET_Ignore, 0, NULL);
|
||||||
g_pOnPostPlayerThinkFunctions = forwards->CreateForward("OnPostPlayerThinkFunctions", ET_Ignore, 0, NULL);
|
g_pOnPostPlayerThinkFunctions = forwards->CreateForward("OnPostPlayerThinkFunctions", ET_Ignore, 0, NULL); // NOTE: This relies on the cursed patch above
|
||||||
g_pOnRunThinkFunctionsPost = forwards->CreateForward("OnRunThinkFunctionsPost", ET_Ignore, 1, NULL, Param_Cell);
|
g_pOnRunThinkFunctionsPost = forwards->CreateForward("OnRunThinkFunctionsPost", ET_Ignore, 1, NULL, Param_Cell);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user