gamedata/sdktools.games/engine.l4d2.txt
author Asher Baker <asherkin@gmail.com>
Sat Jul 16 17:55:43 2011 -0400 (2011-07-16)
changeset 3360 fae2792e30ed
parent 3353 c73d0ba1110b
child 3378 a1a4f54603b3
permissions -rw-r--r--
Added missing brackets back to l4d and l4d2 gamedata (bug 5016, r=psychonic).
     1 /**
     2  * Do not edit this file.  Any changes will be overwritten by the gamedata
     3  * updater or by upgrading your SourceMod install.
     4  *
     5  * To override data in this file, create a subdirectory named "custom" and
     6  * place your own gamedata file(s) inside of it.  Such files will be parsed
     7  * after SM's own.
     8  *
     9  * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(SourceMod)
    10  */
    11 
    12 "Games"
    13 {
    14 	/* Sounds */
    15 	"#default"
    16 	{
    17 		"Keys"
    18 		{
    19 			"SlapSoundCount"	"2"
    20 			"SlapSound1"		"player/damage1.wav"
    21 			"SlapSound2"		"player/damage2.wav"
    22 			
    23 			"GameRulesProxy"	"CTerrorGameRulesProxy"
    24 		}
    25 	}
    26 	
    27 	/* General Temp Entities */
    28 	"#default"
    29 	{
    30 		"#supported"
    31 		{
    32 			"game"		"left4dead2"
    33 		}
    34 
    35 		"Offsets"
    36 		{
    37 			/* Offset into CBaseTempEntity constructor */
    38 			"s_pTempEntities"
    39 			{
    40 				"windows"	"17"
    41 			}
    42 			"GetTEName"
    43 			{
    44 				"windows"	"4"
    45 				"linux"		"4"
    46 				"mac"		"4"
    47 			}
    48 			"GetTENext"
    49 			{
    50 				"windows"	"8"
    51 				"linux"		"8"
    52 				"mac"		"8"
    53 			}
    54 			"TE_GetServerClass"
    55 			{
    56 				"windows"	"0"
    57 				"linux"		"0"
    58 				"mac"		"0"
    59 			}
    60 		}
    61 
    62 		"Signatures"
    63 		{
    64 			"CBaseTempEntity"
    65 			{
    66 				"library"	"server"
    67 				"windows"	"\x8B\xC1\x8B\x4C\x24\x04\xC7\x00\x2A\x2A\x2A\x2A\x89\x48\x04\x8B\x15\x2A\x2A\x2A\x2A\x89\x50\x08\xA3\x2A\x2A\x2A\x2A\xC2\x04\x00"
    68 			}
    69 			"s_pTempEntities"
    70 			{
    71 				"library"	"server"
    72 				"linux"		"@_ZN15CBaseTempEntity15s_pTempEntitiesE"
    73 				"mac"		"@_ZN15CBaseTempEntity15s_pTempEntitiesE"
    74 			}
    75 		}
    76 	}
    77 
    78 	/* CGlobalEntityList */
    79 	"#default"
    80 	{
    81 		"#supported"
    82 		{
    83 			"game"		"left4dead2"
    84 		}
    85 			
    86 		"Signatures"
    87 		{
    88 			/* Functions in CGlobalEntityList */
    89 			"FindEntityByClassname"
    90 			{
    91 				"library"	"server"
    92 				"windows"	"\x53\x55\x56\x8B\xF1\x8B\x4C\x24\x10\x85\xC9\x57\x74\x19\x8B\x01\x8B\x50\x08\xFF\xD2\x8B\x00\x25\xFF\x0F\x00\x00\x83\xC0\x01\xC1\xE0\x04\x8B\x3C\x30\xEB\x06\x8B\xBE\x2A\x2A\x2A\x2A\x85\xFF\x74\x39\x8B\x5C\x24\x18\x8B\x2D\x2A\x2A\x2A\x2A\xEB\x03"
    93 				"linux"		"@_ZN17CGlobalEntityList21FindEntityByClassnameEP11CBaseEntityPKc"
    94 				"mac"		"@_ZN17CGlobalEntityList21FindEntityByClassnameEP11CBaseEntityPKc"
    95 			}
    96 		}
    97 	}
    98 
    99 	/* General GameRules */
   100 	"#default"
   101 	{
   102 		"#supported"
   103 		{
   104 			"game"		"left4dead2"
   105 		}
   106 		
   107 		"Offsets"
   108 		{
   109 			/* Offset into CreateGameRulesObject */
   110 			"g_pGameRules"
   111 			{
   112 				"windows"	"2"
   113 			}
   114 		}
   115 		
   116 		"Signatures"
   117 		{
   118 			/* This signature sometimes has multiple matches, but this
   119 			 * does not matter as g_pGameRules is involved in all of them.
   120 			 * The same g_pGameRules offset applies to each match.
   121 			 *
   122 			 * Sometimes this block of bytes is at the beginning of the static
   123 			 * CreateGameRulesObject function and sometimes it is in the middle
   124 			 * of an entirely different function. This depends on the game.
   125 			 */
   126 			"CreateGameRulesObject"
   127 			{
   128 				"library"	"server"
   129 				"windows"	"\x8B\x0D\x2A\x2A\x2A\x2A\x85\xC9\x74\x2A\x8B\x01\x8B\x50\x2A\x6A\x01\xFF\xD2"
   130 			}
   131 			"g_pGameRules"
   132 			{
   133 				"library"	"server"
   134 				"linux"		"@g_pGameRules"
   135 				"mac"		"@g_pGameRules"
   136 			}
   137 		}
   138 	}
   139 
   140 	/* IServer interface pointer */
   141 	"#default"
   142 	{
   143 		"Keys"
   144 		{
   145 			/* Signature for the beginning of IVEngineServer::CreateFakeClient.
   146 			 *
   147 			 * The engine binary is not actually scanned in order to look for
   148 			 * this. SourceHook is used to used to determine the address of the
   149 			 * function and this signature is used to verify that it contains
   150 			 * the expected code. A pointer to sv (IServer interface) is used
   151 			 * here.
   152 			 */
   153 			"CreateFakeClient_Windows"	"\x8B\x44\x24\x2A\x50\xB9\x2A\x2A\x2A\x2A\xE8"
   154 		}
   155 		
   156 		"Offsets"
   157 		{
   158 			/* Offset into IVEngineServer::CreateFakeClient */
   159 			"sv"
   160 			{
   161 				"windows"	"6"
   162 			}
   163 		}
   164 
   165 		"Signatures"
   166 		{
   167 			/* CBaseServer object for IServer interface */
   168 			"sv"
   169 			{
   170 				"library"	"engine"
   171 				"linux"		"@sv"
   172 				"mac"		"@sv"
   173 			}
   174 		}
   175 	}
   176 	
   177 	/* EntityFactoryDictionary function */
   178 	"#default"
   179 	{
   180 		"Signatures"
   181 		{
   182 			"EntityFactory"
   183 			{
   184 				"library"	"server"
   185 				"windows"	"\xB8\x01\x00\x00\x00\x84\x2A\x2A\x2A\x2A\x2A\x75\x1D\x09\x2A\x2A\x2A\x2A\x2A\xB9\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x68\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x83\xC4\x04\xB8\x2A\x2A\x2A\x2A\xC3"
   186 				"linux"		"@_Z23EntityFactoryDictionaryv"
   187 				"mac"		"@_Z23EntityFactoryDictionaryv"
   188 			}
   189 		}
   190 	}
   191 
   192 	/* CBaseEntityOutput::FireOutput */
   193 	"#default"
   194 	{
   195 		"#supported"
   196 		{
   197 			"game"		"left4dead2"
   198 		}
   199 		"Signatures"
   200 		{
   201 			"FireOutput"
   202 			{
   203 				"library"	"server"
   204 				"windows"	"\x81\xEC\x1C\x01\x00\x00\x53\x55\x56\x8B\x71\x14\x85\xF6"
   205 				"linux"		"@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f"
   206 				"mac"		"@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f"
   207 			}
   208 		}
   209 	}
   210 	
   211 	/* SetUserInfo data */
   212 	"#default"
   213 	{
   214 		"Offsets"
   215 		{
   216 			/**
   217 			 * CBaseClient::SetUserCVar(char  const*,char  const*);
   218 			 * Linux offset straight from VTable dump.
   219 			 * Windows offset is crazy. Found the windows SetName function using string "(%d)%-.*s" (aD_S in IDA)
   220 			 * Cross referenced back to the vtable and counted manually (SetUserCvar is 1 higher, offsets start from 1)
   221 			 */
   222 			"SetUserCvar"
   223 			{
   224 				/* Not 100% sure on this, why would windows change and not linux - TEST ME */
   225 				"windows"	"17"
   226 				"linux"		"63"
   227 				"mac"		"63"
   228 			}
   229 			/**
   230 			 * Offset into CBaseClient - Used by CBaseServer::UpdateUserSettings to determine when changes have been made.
   231 			 * Find CBaseClient::UpdateUserSettings (strings "net_maxroutable", "cl_updaterate" etc) and the offset is set to 0 near the end.
   232 			 * Linux: 	mov     byte ptr [esi+0B0h], 0
   233 			 * Win:		mov     byte ptr [esi+0B0h], 0
   234 			 *
   235 			 * L4D2: This has been moved into CBaseClient::UpdateUserSettings(), rest of the details are still relevant.
   236 			 */
   237 			"InfoChanged"
   238 			{
   239 				"windows"	"176"
   240 				"linux"		"176"
   241 				"mac"		"176"
   242 			}
   243 		}
   244 	}
   245 	
   246 	/* Left 4 Dead */
   247 	"left4dead2"
   248 	{
   249 		"Offsets"
   250 		{
   251 			"GiveNamedItem"
   252 			{
   253 				"windows"	"506"
   254 				"linux"		"507"
   255 				"mac"		"507"
   256 			}
   257 			"RemovePlayerItem"
   258 			{
   259 				"windows"	"288"
   260 				"linux"		"289"
   261 				"mac"		"289"
   262 			}
   263 			"Weapon_GetSlot"
   264 			{
   265 				"windows"	"286"
   266 				"linux"		"287"
   267 				"mac"		"287"
   268 			}
   269 			"Ignite"
   270 			{
   271 				"windows"	"221"
   272 				"linux"		"222"
   273 				"mac"		"222"
   274 			}
   275 			"Extinguish"
   276 			{
   277 				"windows"	"224"
   278 				"linux"		"225"
   279 				"mac"		"225"
   280 			}
   281 			"Teleport"
   282 			{
   283 				"windows"	"117"
   284 				"linux"		"118"
   285 				"mac"		"118"
   286 			}
   287 			"CommitSuicide"
   288 			{
   289 				"windows"	"474"
   290 				"linux"		"474"
   291 				"mac"		"474"
   292 			}
   293 			"GetVelocity"
   294 			{
   295 				"windows"	"149"
   296 				"linux"		"150"
   297 				"mac"		"150"
   298 			}
   299 			"EyeAngles"
   300 			{
   301 				"windows"	"140"
   302 				"linux"		"141"
   303 				"mac"		"141"
   304 			}
   305 			"AcceptInput"
   306 			{
   307 				"windows"	"43"
   308 				"linux"		"44"
   309 				"mac"		"44"
   310 			}
   311 			"SetEntityModel"
   312 			{
   313 				"windows"	"26"
   314 				"linux"		"27"
   315 				"mac"		"27"
   316 			}
   317 			"WeaponEquip"
   318 			{
   319 				"windows"	"279"
   320 				"linux"		"280"
   321 				"mac"		"280"
   322 			}
   323 			"Activate"
   324 			{
   325 				"windows"	"35"
   326 				"linux"		"36"
   327 				"mac"		"36"
   328 			}
   329 			"PlayerRunCmd"
   330 			{
   331 				"windows"	"452"
   332 				"linux"		"453"
   333 				"mac"		"453"
   334 			}
   335 		}
   336 	}
   337 }