Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Gamedata for CSGO update 2022/10/22 #4

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.vscode
csgo/addons/sourcemod/plugins
168 changes: 168 additions & 0 deletions csgo/addons/sourcemod/gamedata/nolobbyreservation.games.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
"Games"
{
"csgo"
{
"Keys"
{
"CBaseServer::IsExclusiveToLobbyConnections_Patch"
{
/*
原始汇编代码 84 C0 test al, al
更改后为 30 C0 xor al, al
*/
"windows" "30 C0"
"linux" "30 C0"
}

"CBaseServer::ReplyChallenge_Patch1"
{
"windows" "30 C0"
}

"CBaseServer::ReplyChallenge_Patch2"
{
"windows" "30 C0"
}

"CBaseServer::ReplyChallenge_Patch3"
{
"windows" "00"
"linux" "6A 00"
}

"CBaseServer::ReplyChallenge_Patch4"
{
"windows" "00"
"linux" "6A 00"
}


"CBaseServer::IsExclusiveToLobbyConnections_Patch_Check"
{
"windows" "84 C0"
"linux" "84 C0"
}

"CBaseServer::ReplyChallenge_Patch1_Check"
{
"windows" "84 C0"
}

"CBaseServer::ReplyChallenge_Patch2_Check"
{
"windows" "84 C0"
}

"CBaseServer::ReplyChallenge_Patch3_Check"
{
"windows" "FF"
"linux" "6A FF"
}

"CBaseServer::ReplyChallenge_Patch4_Check"
{
"windows" "FF"
"linux" "6A FF"
}
}

"Offsets"
{
"CBaseServer::IsExclusiveToLobbyConnections_Patch"
{
/* linux
test al, al
*/
"windows" "7"
"linux" "29"
}

"CBaseServer::ReplyChallenge_Patch1"
{
/*
存在字符串 connect-retry
汇编代码 test al, al
*/
"windows" "994"
}

"CBaseServer::ReplyChallenge_Patch2"
{
/*
存在字符串 public
汇编代码 test al, al
*/
"windows" "1507"
}

"CBaseServer::ReplyChallenge_Patch3"
{
/*
linux LobbyID mov dword ptr [esp+4], 0FFFFFFFFh
windows LobbyID push 0FFFFFFFFh
*/
"windows" "1613"
"linux" "890"
}

"CBaseServer::ReplyChallenge_Patch4"
{
/*
linux LobbyID mov dword ptr [esp+8], 0FFFFFFFFh
windows LobbyID push 0FFFFFFFFh
*/
"windows" "1627"
"linux" "892"
}
}

"Addresses"
{
"CBaseServer::IsExclusiveToLobbyConnections"
{
"windows"
{
"signature" "CBaseServer::IsExclusiveToLobbyConnections"
}
"linux"
{
"signature" "CBaseServer::IsExclusiveToLobbyConnections"
}
}

"CBaseServer::ReplyChallenge"
{
"windows"
{
"signature" "CBaseServer::ReplyChallenge"
}
"linux"
{
"signature" "CBaseServer::ReplyChallenge"
}
}
}

"Signatures"
{
/* 目标函数在此字符串上方
"Server only accepting connections from game lobby %s %d.\n"
*/
"CBaseServer::IsExclusiveToLobbyConnections"
{
"library" "engine"
"windows" "\x8B\x01\x8B\x40\x5C\xFF\xD0\x84\xC0\x75\x2A\xC3"
"linux" "\x55\x89\xE5\x83\xEC\x08\x8B\x45\x08\x8B\x10\x8B\x52\x60\x81\xFA\x2A\x2A\x2A\x2A\x75\x2A\x0F\xB6\x80\x88\x02\x00\x00"
}
/* 目标函数存在字符串
"Server running with server_is_unavailable, ignoring challenge from %s\n"
*/
"CBaseServer::ReplyChallenge"
{
"library" "engine"
"windows" "\x55\x8B\xEC\x83\xE4\xF8\x81\xEC\x8C\x04\x00\x00"
"linux" "\x55\x89\xE5\x57\x56\x53\x81\xEC\x74\x04\x00\x00"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ enum struct mem_patch
{
Address addr;
int len;
int lencheck;
char patch[256];
char patchcheck[256];
char orig[256];

bool Init(GameData conf, const char[] key, Address addr)
Expand Down Expand Up @@ -66,6 +68,39 @@ enum struct mem_patch
for (int i = 0; i < this.len; i++)
StoreToAddress(this.addr + view_as<Address>(i), this.orig[i], NumberType_Int8);
}

bool Check(GameData conf, const char[] key)
{
int pos, curPos;
char byte[16], bytes[512];

if (this.lencheck)
return false;

if (!conf.GetKeyValue(key, bytes, sizeof(bytes)))
return false;

StrCat(bytes, sizeof(bytes), " ");

while ((pos = SplitString(bytes[curPos], " ", byte, sizeof(byte))) != -1)
{
curPos += pos;

TrimString(byte);

if (byte[0])
{
this.patchcheck[this.lencheck] = StringToInt(byte, 16);
this.lencheck++;
}
}

if(!StrEqual(this.orig, this.patchcheck))
{
SetFailState("%s opcode is not correct, Memory is %x, conf is %x", key, this.orig, this.patchcheck);
}
return true;
}
}

mem_patch g_isExclusiveToLobbyConnectionsPatch;
Expand Down Expand Up @@ -97,6 +132,12 @@ public void OnPluginStart()
g_replyChallengePatch3.Init(conf, "CBaseServer::ReplyChallenge_Patch3", replyChallengeAddr);
g_replyChallengePatch4.Init(conf, "CBaseServer::ReplyChallenge_Patch4", replyChallengeAddr);

g_isExclusiveToLobbyConnectionsPatch.Check(conf, "CBaseServer::IsExclusiveToLobbyConnections_Patch_Check");
g_replyChallengePatch1.Check(conf, "CBaseServer::ReplyChallenge_Patch1_Check");
g_replyChallengePatch2.Check(conf, "CBaseServer::ReplyChallenge_Patch2_Check");
g_replyChallengePatch3.Check(conf, "CBaseServer::ReplyChallenge_Patch3_Check");
g_replyChallengePatch4.Check(conf, "CBaseServer::ReplyChallenge_Patch4_Check");

g_isExclusiveToLobbyConnectionsPatch.Apply();
g_replyChallengePatch1.Apply();
g_replyChallengePatch2.Apply();
Expand Down
111 changes: 0 additions & 111 deletions nolobbyreservation.games.txt

This file was deleted.