Fix SQVM error for dedicated

This commit is contained in:
Amos 2022-02-24 02:17:05 +01:00
parent 3616b85f6a
commit d12bf39dea

View File

@ -293,10 +293,12 @@ void RuntimePtc_Init() /* .TEXT */
{ {
#ifndef DEDICATED #ifndef DEDICATED
p_WASAPI_GetAudioDevice.Offset(0x410).FindPattern("FF 15 ?? ?? 01 00", ADDRESS::Direction::DOWN, 100).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0xEB }); // CAL --> NOP | Disable debugger check when miles searches for audio device to allow attaching the debugger to the game upon launch. p_WASAPI_GetAudioDevice.Offset(0x410).FindPattern("FF 15 ?? ?? 01 00", ADDRESS::Direction::DOWN, 100).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0xEB }); // CAL --> NOP | Disable debugger check when miles searches for audio device to allow attaching the debugger to the game upon launch.
FairFight_Init.Offset(0x0).FindPatternSelf("0F 87", ADDRESS::Direction::DOWN, 200).Patch({ 0x0F, 0x85 }); // JA --> JNZ | Prevent 'FairFight' anti-cheat from initializing on the server by comparing RAX against 0x0 instead. Init will crash since the plugins aren't shipped. FairFight_Init.Offset(0x0).FindPatternSelf("0F 87", ADDRESS::Direction::DOWN, 200).Patch({ 0x0F, 0x85 }); // JA --> JNZ | Prevent 'FairFight' anti-cheat from initializing on the server by comparing RAX against 0x0 instead. Init will crash since the plugins aren't shipped.
SCR_BeginLoadingPlaque.Offset(0x1AD).FindPatternSelf("75 27", ADDRESS::Direction::DOWN).Patch({ 0xEB, 0x27 }); // JNE --> JMP | Prevent connect command from crashing by invalid call to UI function. SCR_BeginLoadingPlaque.Offset(0x1AD).FindPatternSelf("75 27", ADDRESS::Direction::DOWN).Patch({ 0xEB, 0x27 }); // JNE --> JMP | Prevent connect command from crashing by invalid call to UI function.
p_SQVM_CompileError.Offset(0x0).FindPatternSelf("41 B0 01", ADDRESS::Direction::DOWN, 400).Patch({ 0x41, 0xB0, 0x00 }); // MOV --> MOV | Set script error level to 0 (not severe): 'mov r8b, 0'.
#else
p_SQVM_CompileError.Offset(0xE0).FindPatternSelf("E8", ADDRESS::Direction::DOWN, 200).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90 }); // CAL --> NOP | For dedicated we should not perform post-error events such as telemetry / showing 'COM_ExplainDisconnection' UI etc.
#endif // !DEDICATED #endif // !DEDICATED
p_SQVM_CompileError.FindPatternSelf("41 B0 01", ADDRESS::Direction::DOWN, 400).Patch({ 0x41, 0xB0, 0x00 }); // MOV --> MOV | Set script error level to 0 (not severe): 'mov r8b, 0'.
} }
void RuntimePtc_Toggle() /* .TEXT */ void RuntimePtc_Toggle() /* .TEXT */