-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a longstanding Server Crash cause
Fixes: CLagCompensationManager::StartLagCompensation with NULL CUserCmd!!!
- Loading branch information
Showing
4 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
"Games" | ||
{ | ||
"left4dead2" | ||
{ | ||
"MemPatches" | ||
{ | ||
"CLagCompensationManager::StartLagCompensation" | ||
{ | ||
"signature" "CLagCompensationManager::StartLagCompensation" | ||
|
||
// if (!cmd) jump to the return branch. | ||
|
||
"linux" | ||
{ | ||
"offset" "6CEh" | ||
"verify" "\xC7" | ||
"patch" "\xE9\x32\xFC\xFF\xFF\x90\x90" | ||
} | ||
|
||
"windows" | ||
{ | ||
"offset" "477h" | ||
"verify" "\x68" | ||
"patch" "\xE9\x96\x02\x00\x00" | ||
} | ||
} | ||
} | ||
|
||
"Signatures" | ||
{ | ||
"CLagCompensationManager::StartLagCompensation" | ||
{ | ||
"library" "server" | ||
"linux" "@_ZN23CLagCompensationManager20StartLagCompensationEP11CBasePlayer19LagCompensationTypeRK6VectorRK6QAnglef" | ||
"windows" "\x55\x8B\xEC\x83\xEC\x64\x53\x33\xC0" | ||
/* 55 8B EC 83 EC 64 53 33 C0 */ | ||
} | ||
} | ||
} | ||
} | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#pragma semicolon 1 | ||
#pragma newdecls required | ||
|
||
#define VERSION "0.2" | ||
|
||
#include <sourcemod> | ||
#include <sourcescramble> // https://github.com/nosoop/SMExt-SourceScramble | ||
|
||
public Plugin myinfo = | ||
{ | ||
name = "L4D2 Lag Compensation Null CUserCmd fix", | ||
author = "fdxx", | ||
description = "Prevent crash: CLagCompensationManager::StartLagCompensation with NULL CUserCmd!!!", | ||
version = VERSION, | ||
} | ||
|
||
public void OnPluginStart() | ||
{ | ||
Init(); | ||
CreateConVar("l4d2_null_cusercmd_fix_version", VERSION, "Version", FCVAR_NONE | FCVAR_DONTRECORD); | ||
} | ||
|
||
void Init() | ||
{ | ||
GameData hGameData = new GameData("l4d2_null_cusercmd_fix"); | ||
if (hGameData == null) | ||
SetFailState("Failed to load \"l4d2_null_cusercmd_fix.txt\" gamedata."); | ||
|
||
MemoryPatch mPatch = MemoryPatch.CreateFromConf(hGameData, "CLagCompensationManager::StartLagCompensation"); | ||
if (!mPatch.Validate()) | ||
SetFailState("Verify patch failed."); | ||
if (!mPatch.Enable()) | ||
SetFailState("Enable patch failed."); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters