gamedata/sdktools.games/engine.l4d2.txt
author Nicholas Hastings <skamonkey@gmail.com>
Wed May 25 08:27:27 2011 -0400 (2011-05-25)
changeset 3280 7aea1316eff7
parent 3138 b7625c10af59
child 3333 e247490894a1
permissions -rw-r--r--
Switched to using IServerTools in SDKTools where possible. (bug 4899, r=fyren).
     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 	}
    24 	
    25 	/* General Temp Entities */
    26 	"#default"
    27 	{
    28 		"#supported"
    29 		{
    30 			"game"		"left4dead2"
    31 		}
    32 
    33 		"Offsets"
    34 		{
    35 			/* Offset into CBaseTempEntity constructor */
    36 			"s_pTempEntities"
    37 			{
    38 				"windows"	"17"
    39 			}
    40 			"GetTEName"
    41 			{
    42 				"windows"	"4"
    43 				"linux"		"4"
    44 				"mac"		"4"
    45 			}
    46 			"GetTENext"
    47 			{
    48 				"windows"	"8"
    49 				"linux"		"8"
    50 				"mac"		"8"
    51 			}
    52 			"TE_GetServerClass"
    53 			{
    54 				"windows"	"0"
    55 				"linux"		"0"
    56 				"mac"		"0"
    57 			}
    58 		}
    59 
    60 		"Signatures"
    61 		{
    62 			"CBaseTempEntity"
    63 			{
    64 				"library"	"server"
    65 				"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"
    66 			}
    67 			"s_pTempEntities"
    68 			{
    69 				"library"	"server"
    70 				"linux"		"@_ZN15CBaseTempEntity15s_pTempEntitiesE"
    71 				"mac"		"@_ZN15CBaseTempEntity15s_pTempEntitiesE"
    72 			}
    73 		}
    74 	}
    75 
    76 	/* General GameRules */
    77 	"#default"
    78 	{
    79 		"#supported"
    80 		{
    81 			"game"		"left4dead2"
    82 		}
    83 		
    84 		"Offsets"
    85 		{
    86 			/* Offset into CreateGameRulesObject */
    87 			"g_pGameRules"
    88 			{
    89 				"windows"	"2"
    90 			}
    91 		}
    92 		
    93 		"Signatures"
    94 		{
    95 			/* This signature sometimes has multiple matches, but this
    96 			 * does not matter as g_pGameRules is involved in all of them.
    97 			 * The same g_pGameRules offset applies to each match.
    98 			 *
    99 			 * Sometimes this block of bytes is at the beginning of the static
   100 			 * CreateGameRulesObject function and sometimes it is in the middle
   101 			 * of an entirely different function. This depends on the game.
   102 			 */
   103 			"CreateGameRulesObject"
   104 			{
   105 				"library"	"server"
   106 				"windows"	"\x8B\x0D\x2A\x2A\x2A\x2A\x85\xC9\x74\x2A\x8B\x01\x8B\x50\x2A\x6A\x01\xFF\xD2"
   107 			}
   108 			"g_pGameRules"
   109 			{
   110 				"library"	"server"
   111 				"linux"		"@g_pGameRules"
   112 				"mac"		"@g_pGameRules"
   113 			}
   114 		}
   115 	}
   116 
   117 	/* IServer interface pointer */
   118 	"#default"
   119 	{
   120 		"Keys"
   121 		{
   122 			/* Signature for the beginning of IVEngineServer::CreateFakeClient.
   123 			 *
   124 			 * The engine binary is not actually scanned in order to look for
   125 			 * this. SourceHook is used to used to determine the address of the
   126 			 * function and this signature is used to verify that it contains
   127 			 * the expected code. A pointer to sv (IServer interface) is used
   128 			 * here.
   129 			 */
   130 			"CreateFakeClient_Windows"	"\x8B\x44\x24\x2A\x50\xB9\x2A\x2A\x2A\x2A\xE8"
   131 		}
   132 		
   133 		"Offsets"
   134 		{
   135 			/* Offset into IVEngineServer::CreateFakeClient */
   136 			"sv"
   137 			{
   138 				"windows"	"6"
   139 			}
   140 		}
   141 
   142 		"Signatures"
   143 		{
   144 			/* CBaseServer object for IServer interface */
   145 			"sv"
   146 			{
   147 				"library"	"engine"
   148 				"linux"		"@sv"
   149 				"mac"		"@sv"
   150 			}
   151 		}
   152 	}
   153 	
   154 	/* EntityFactoryDictionary function */
   155 	"#default"
   156 	{
   157 		"Signatures"
   158 		{
   159 			"EntityFactory"
   160 			{
   161 				"library"	"server"
   162 				"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"
   163 				"linux"		"@_Z23EntityFactoryDictionaryv"
   164 				"mac"		"@_Z23EntityFactoryDictionaryv"
   165 			}
   166 		}
   167 	}
   168 
   169 	/* CBaseEntityOutput::FireOutput */
   170 	"#default"
   171 	{
   172 		"#supported"
   173 		{
   174 			"game"		"left4dead2"
   175 		}
   176 		"Signatures"
   177 		{
   178 			"FireOutput"
   179 			{
   180 				"library"	"server"
   181 				"windows"	"\x81\xEC\x1C\x01\x00\x00\x53\x55\x56\x8B\x71\x14\x85\xF6"
   182 				"linux"		"@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f"
   183 				"mac"		"@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f"
   184 			}
   185 		}
   186 	}
   187 	
   188 	/* SetUserInfo data */
   189 	"#default"
   190 	{
   191 		"Offsets"
   192 		{
   193 			/**
   194 			 * CBaseClient::SetUserCVar(char  const*,char  const*);
   195 			 * Linux offset straight from VTable dump.
   196 			 * Windows offset is crazy. Found the windows SetName function using string "(%d)%-.*s" (aD_S in IDA)
   197 			 * Cross referenced back to the vtable and counted manually (SetUserCvar is 1 higher, offsets start from 1)
   198 			 */
   199 			"SetUserCvar"
   200 			{
   201 				/* Not 100% sure on this, why would windows change and not linux - TEST ME */
   202 				"windows"	"17"
   203 				"linux"		"63"
   204 				"mac"		"63"
   205 			}
   206 			/**
   207 			 * Offset into CBaseClient - Used by CBaseServer::UpdateUserSettings to determine when changes have been made.
   208 			 * Find CBaseClient::UpdateUserSettings (strings "net_maxroutable", "cl_updaterate" etc) and the offset is set to 0 near the end.
   209 			 * Linux: 	mov     byte ptr [esi+0B0h], 0
   210 			 * Win:		mov     byte ptr [esi+0B0h], 0
   211 			 *
   212 			 * L4D2: This has been moved into CBaseClient::UpdateUserSettings(), rest of the details are still relevant.
   213 			 */
   214 			"InfoChanged"
   215 			{
   216 				"windows"	"176"
   217 				"linux"		"176"
   218 				"mac"		"176"
   219 			}
   220 		}
   221 	}
   222 	
   223 	/* Left 4 Dead */
   224 	"left4dead2"
   225 	{
   226 		"Offsets"
   227 		{
   228 			"GiveNamedItem"
   229 			{
   230 				"windows"	"506"
   231 				"linux"		"507"
   232 				"mac"		"507"
   233 			}
   234 			"RemovePlayerItem"
   235 			{
   236 				"windows"	"288"
   237 				"linux"		"289"
   238 				"mac"		"289"
   239 			}
   240 			"Weapon_GetSlot"
   241 			{
   242 				"windows"	"286"
   243 				"linux"		"287"
   244 				"mac"		"287"
   245 			}
   246 			"Ignite"
   247 			{
   248 				"windows"	"221"
   249 				"linux"		"222"
   250 				"mac"		"222"
   251 			}
   252 			"Extinguish"
   253 			{
   254 				"windows"	"224"
   255 				"linux"		"225"
   256 				"mac"		"225"
   257 			}
   258 			"Teleport"
   259 			{
   260 				"windows"	"117"
   261 				"linux"		"118"
   262 				"mac"		"118"
   263 			}
   264 			"CommitSuicide"
   265 			{
   266 				"windows"	"474"
   267 				"linux"		"474"
   268 				"mac"		"474"
   269 			}
   270 			"GetVelocity"
   271 			{
   272 				"windows"	"149"
   273 				"linux"		"150"
   274 				"mac"		"150"
   275 			}
   276 			"EyeAngles"
   277 			{
   278 				"windows"	"140"
   279 				"linux"		"141"
   280 				"mac"		"141"
   281 			}
   282 			"AcceptInput"
   283 			{
   284 				"windows"	"43"
   285 				"linux"		"44"
   286 				"mac"		"44"
   287 			}
   288 			"SetEntityModel"
   289 			{
   290 				"windows"	"26"
   291 				"linux"		"27"
   292 				"mac"		"27"
   293 			}
   294 			"WeaponEquip"
   295 			{
   296 				"windows"	"279"
   297 				"linux"		"280"
   298 				"mac"		"280"
   299 			}
   300 			"Activate"
   301 			{
   302 				"windows"	"35"
   303 				"linux"		"36"
   304 				"mac"		"36"
   305 			}
   306 			"PlayerRunCmd"
   307 			{
   308 				"windows"	"452"
   309 				"linux"		"453"
   310 				"mac"		"453"
   311 			}
   312 		}
   313 	}
   314 }