Fix client script error causing crash

This commit is contained in:
Amos 2022-02-24 16:46:38 +01:00
parent 23f37bfa50
commit dc6e0a3613
2 changed files with 5 additions and 4 deletions

View File

@ -296,6 +296,7 @@ void RuntimePtc_Init() /* .TEXT */
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.
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'.
p_SQVM_CompileError.Offset(0xE0).FindPatternSelf("E8", ADDRESS::Direction::DOWN, 200).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90 }); // CAL --> NOP | TODO: causes errors on client script error. Research required (same function as soft error but that one doesn't crash).
#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

View File

@ -12,10 +12,10 @@ __declspec(dllexport) void DummyExport()
const std::string R5R_LOGO[] =
{
R"(+-------------------------------------------------------------------+)",
R"(| ___ ___ ___ _ _ _ ___ __ ___ |)",
R"(| | _ \ __| _ \___| |___ __ _ __| |___ __| | __ _|_ ) / \ |_ ) |)",
R"(| | /__ \ / -_) / _ \/ _` / _` / -_) _` | \ V // / | () | / / |)",
R"(| |_|_\___/_|_\___|_\___/\__,_\__,_\___\__,_| \_//___(_)__(_)___| |)",
R"(| ___ ___ ___ _ _ _ ___ __ ____ |)",
R"(| | _ \ __| _ \___| |___ __ _ __| |___ __| | __ _|_ ) / \ |__ / |)",
R"(| | /__ \ / -_) / _ \/ _` / _` / -_) _` | \ V // / | () | |_ \ |)",
R"(| |_|_\___/_|_\___|_\___/\__,_\__,_\___\__,_| \_//___(_)__(_)___/ |)",
R"(| |)",
R"(+-------------------------------------------------------------------+)"
};