Skip to content

Commit b71d3c0

Browse files
authored
Fix cstrike ext gamedata for css (#2280)
Co-authored-by: Kenzzer <[email protected]>
1 parent 75f4fda commit b71d3c0

File tree

1 file changed

+46
-26
lines changed

1 file changed

+46
-26
lines changed

gamedata/sm-cstrike.games/game.css.txt

Lines changed: 46 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -19,115 +19,136 @@
1919
"WeaponName"
2020
{
2121
"windows" "6"
22+
"windows64" "10"
2223
"linux" "6"
23-
"mac" "6"
24+
"linux64" "10"
2425
}
26+
// Find "BlackMarketTable" select the dword -> follow it the only other subroutine -> CCSGameRules::SetBlackMarketPrices is called before return
27+
// CCSGameRules::SetBlackMarketPrices sets weapon price & default price
2528
"WeaponPrice"
2629
{
2730
"windows" "2308"
2831
"linux" "2308"
29-
"mac" "2308"
3032
}
3133
//Offset into SetClanTag to find clan tag's offset from player
3234
"ClanTagOffset"
3335
{
3436
"windows" "24"
35-
"linux" "29"
36-
"mac" "18"
37+
"linux" "23"
3738
}
38-
//Offset into CheckWinLimit to find CT team score offset from gamerules. For mac this is an offset into CCSGameRules::Think
39+
//Offset into CheckWinLimit to find CT team score offset from gamerules. For windows this is an offset into CCSGameRules::Think
3940
"CTTeamScoreOffset"
4041
{
41-
"windows" "18"
42+
"windows" "274"
4243
"linux" "27"
43-
"mac" "205"
4444
}
45-
//Offset into CheckWinLimit to find T team score offset from gamerules. For mac this is an offset into CCSGameRules::Think
45+
//Offset into CheckWinLimit to find T team score offset from gamerules. For windows this is an offset into CCSGameRules::Think
4646
"TTeamScoreOffset"
4747
{
48-
"windows" "56"
48+
"windows" "395"
4949
"linux" "38"
50-
"mac" "216"
5150
}
5251
}
5352
"Signatures"
5453
{
54+
// String: "reload\n" follow the xref, there are two subroutines, pick the bigger one there's a dynamic cast in it
55+
// That subroutine is "respawn(CBaseEntity*, bool)", follow the xref, there are once again two subroutines, pick the smaller one.
5556
"RoundRespawn"
5657
{
5758
"library" "server"
58-
"windows" "\x55\x8B\xEC\x51\x89\x2A\x2A\x8B\x2A\x2A\x8B\x10\x8B"
59+
"windows" "\x55\x8B\xEC\x51\x89\x4D\xFC\x8B\x45\xFC\x8B\x10"
5960
"linux" "@_ZN9CCSPlayer12RoundRespawnEv"
6061
}
62+
// String: "CCSPlayer::SwitchTeam( %d ) - invalid team index."
6163
"SwitchTeam"
6264
{
6365
"library" "server"
64-
"windows" "\x55\x8B\xEC\x83\xEC\x2A\x89\x4D\x2A\x8B\x45\x2A\x50\xE8\x2A\x2A\x2A\x2A\x83\xC4\x04\x85\xC0\x74"
66+
"windows" "\x55\x8B\xEC\x83\xEC\x5C\x89\x4D\xFC"
6567
"linux" "@_ZN9CCSPlayer10SwitchTeamEi"
6668
}
69+
// String: "#Alias_Not_Avail"
6770
"HandleCommand_Buy_Internal"
6871
{
6972
"library" "server"
70-
"windows" "\x55\x8B\xEC\x83\xEC\x2A\x89\x4D\x2A\x6A\x00\x8B\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x0F\xB6\xC0\x85\xC0\x74"
73+
"windows" "\x55\x8B\xEC\x83\xEC\x28\x89\x4D\xF8\x6A\x00"
7174
"linux" "@_ZN9CCSPlayer26HandleCommand_Buy_InternalEPKc"
7275
}
76+
// After having located "HandleCommand_Buy_Internal"
77+
// Jump back to the string "#Alias_Not_Avail" there should be two conditional jumps before
78+
// Pick the first one, and follow it. It should take you to a block that immediately calls another subroutine with one parameter
79+
// and then test the return value to perform yet another jump. That subroutine is GetWeaponPrice
7380
"GetWeaponPrice"
7481
{
7582
"library" "server"
76-
"windows" "\x8B\x81\x04\x09\x00\x00\xC3"
83+
"windows" "\x8B\x81\x04\x09\x00\x00"
7784
"linux" "@_ZNK13CCSWeaponInfo14GetWeaponPriceEv"
7885
}
86+
// String: "ValveBiped.Bip01_R_Hand"
7987
"CSWeaponDrop"//Wildcard first 6 bytes for CS:S DM
8088
{
8189
"library" "server"
82-
"windows" "\x2A\x2A\x2A\x2A\x2A\x2A\x01\x00\x00\x89\x4D\xFC\xC6\x45\x2A\x2A\x8B\x4D\x2A\xE8\x2A\x2A\x2A\x2A\x0F\xB6\xC0"
90+
"windows" "\x55\x8B\xEC\x81\xEC\x80\x01\x00\x00\x89\x4D\xFC"
8391
"linux" "@_ZN9CCSPlayer12CSWeaponDropEP17CBaseCombatWeaponbb"
8492
}
93+
// String: "CTsWin"
8594
"TerminateRound"
8695
{
8796
"library" "server"
88-
"windows" "\x55\x8B\xEC\x83\xEC\x2A\x8B\x45\x0C\x53\x56\x57\x33\xF6"
97+
"windows" "\x55\x8B\xEC\x83\xEC\x28\x8B\x45\x0C"
8998
"linux" "@_ZN12CCSGameRules14TerminateRoundEfi"
9099
}
100+
// String: "d3au1" follow the xref to the array
101+
// Follow the xref of that array, its only used in GetTranslatedWeaponAlias
102+
// if you're in the right place, the subroutine should contain the string 'ak47'
91103
"GetTranslatedWeaponAlias"
92104
{
93105
"library" "server"
94-
"windows" "\x55\x8B\xEC\x56\x57\x8B\x7D\x2A\x33\xF6\x8D\x9B\x00\x00\x00\x00\x57\xFF\x34\xF5\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x83\xC4\x08\x85\xC0\x74\x2A\x46\x83\xFE\x1A\x72\x2A\x8B\xC7\x5F\x5E\x5D\xC3"
106+
"windows" "\x55\x8B\xEC\x56\x57\x8B\x7D\x08\x33\xF6\x8D\x9B\x00\x00\x00\x00\x57\xFF\x34\xF5\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x83\xC4\x08\x85\xC0\x74\x2A\x46\x83\xFE\x1A"
95107
"linux" "@_Z24GetTranslatedWeaponAliasPKc"
96108
}
109+
// String: "weapon_assaultsuit" follow the xref to the array, first element should be "weapon_p228"
110+
// Follow the xref o that array, it should be used in GetWeaponInfo
97111
"GetWeaponInfo"
98112
{
99113
"library" "server"
100-
"windows" "\x55\x8B\xEC\x8B\x4D\x08\x85\xC9\x75\x2A\x33\xC0\x5D\xC3\x83\x2A\x2A\x7C\x2A\x69\xC9"
114+
"windows" "\x55\x8B\xEC\x8B\x4D\x08\x56\x85\xC9\x74\x2A\x83\xF9\x1F"
101115
"linux" "@_Z13GetWeaponInfo10CSWeaponID"
102116
}
117+
// String: "ClangTagChanged" follow the xref, there should be conditional jump to a node with 4 subroutines call and one virtual function call
118+
// SetClangTag is the second subroutine called
103119
"SetClanTag"
104120
{
105121
"library" "server"
106-
"windows" "\x55\x8B\xEC\x51\x89\x2A\x2A\x83\x2A\x2A\x2A\x74\x2A\x6A\x2A\x8B\x2A\x2A\x50"
122+
"windows" "\x55\x8B\xEC\x51\x89\x4D\xFC\x83\x7D\x08\x00\x74\x2A\x6A\x10"
107123
"linux" "@_ZN9CCSPlayer10SetClanTagEPKc"
108124
}
125+
// String: "p228" the xref should you to an array that's being used in two subroutines, where the increment is * 8
126+
// This is WeaponIDToAlias & AliasToWeaponID. To tell apart one from the other, the array will be used as return value in AliasToWeaponID
109127
"AliasToWeaponID"
110128
{
111129
"library" "server"
112-
"windows" "\x55\x8B\xEC\x56\x57\x8B\x7D\x08\x85\xFF\x74\x2A\x33\xF6\x8B\xFF"
130+
"windows" "\x55\x8B\xEC\x8B\x4D\x08\x33\xC0\xEB\x2A\x8D\x9B\x00\x00\x00\x00\x39\x0C\xC5\x2A\x2A\x2A\x2A\x74\x2A\x40\x83\xF8\x26"
113131
"linux" "@_Z15AliasToWeaponIDPKc"
114132
}
115133
"WeaponIDToAlias"
116134
{
117135
"library" "server"
118-
"windows" "\x55\x8B\xEC\x8B\x4D\x08\x33\xC0\xEB\x2A\x8D\x9B\x00\x00\x00\x00\x39\x0C\xC5\x2A\x2A\x2A\x2A\x74\x2A\x40\x83\xF8\x26\x72\x2A\x33\xC0\x5D"
136+
"windows" "\x55\x8B\xEC\x56\x57\x8B\x7D\x08\x85\xFF\x74\x2A\x33\xF6\x8B\xFF\x57"
119137
"linux" "@_Z15WeaponIDToAliasi"
120138
}
139+
// String: "Team \"CT\" triggered \"Intermission_Win_Limit\"\n"
140+
// Note: Function got inlined on windows inside CCSGameRules::Think
121141
"CheckWinLimit"
122142
{
123143
"library" "server"
124-
"windows" "\xA1\x2A\x2A\x2A\x2A\x56\x8B\xF1\x8B\x48\x30\x85\xC9\x74\x2A\x0F"
144+
"windows" "\x55\x8B\xEC\x83\xEC\x44\x56\x57\x8B\xF9"
125145
"linux" "@_ZN12CCSGameRules13CheckWinLimitEv"
126146
}
147+
// Inlined on windows
127148
"SetModelFromClass"
128149
{
129150
"library" "server"
130-
"windows" "\x55\x8B\xEC\x83\xEC\x34\x89\x4D\xFC\x8B\x4D\xFC\xE8\x2A\x2A\x2A\x2A\x83\xF8\x02"
151+
"windows" ""
131152
"linux" "@_ZN9CCSPlayer17SetModelFromClassEv"
132153
}
133154
}
@@ -142,13 +163,12 @@
142163

143164
"Offsets"
144165
{
166+
// String: "round_mvp" right above a member variable should be getting incremented
167+
// This is m_iMVPs, take the offset and subtract it by the offset of the sendprop above
145168
"MVPs"
146169
{
147-
/* factors in 66 (size of m_bPlayerDominatingMe array (bool size * (65 maxplayers + 1)))
148-
... plus another 3 because alignment(?) lolidk */
149170
"windows" "69"
150171
"linux" "69"
151-
"mac" "69"
152172
}
153173
}
154174
}

0 commit comments

Comments
 (0)