gamedata/sdktools.games/engine.ep2valve.txt
author Nicholas Hastings <skamonkey@gmail.com>
Tue Apr 17 22:07:25 2012 -0400 (2012-04-17)
changeset 3481 7162f88dc494
parent 3480 64d8134f0a9b
child 3482 b5b689087577
permissions -rw-r--r--
Fixed tempent gamedata on Windows. Fixed cstrike gamedata.
     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 	/* General Temp Entities */
    15 	"#default"
    16 	{
    17 		"#supported"
    18 		{
    19 			"game"		"dod"
    20 			"game"		"tf"
    21 			"game"		"garrysmod"
    22 			"game"		"hl2mp"
    23 		}
    24 
    25 		"Offsets"
    26 		{
    27 			/* Offset into CBaseTempEntity constructor */
    28 			"s_pTempEntities"
    29 			{
    30 				"windows"	"32"
    31 			}
    32 			"GetTEName"
    33 			{
    34 				"windows"	"4"
    35 				"linux"		"4"
    36 				"mac"		"4"
    37 			}
    38 			"GetTENext"
    39 			{
    40 				"windows"	"8"
    41 				"linux"		"8"
    42 				"mac"		"8"
    43 			}
    44 			"TE_GetServerClass"
    45 			{
    46 				"windows"	"0"
    47 				"linux"		"0"
    48 				"mac"		"0"
    49 			}
    50 		}
    51 
    52 		"Signatures"
    53 		{
    54 			"CBaseTempEntity"
    55 			{
    56 				"library"	"server"
    57 				"windows"	"\x55\x8B\xEC\x8B\xC1\x8B\x4D\x2A\xC7\x00\x2A\x2A\x2A\x2A\x89\x48"
    58 			}
    59 			"s_pTempEntities"
    60 			{
    61 				"library"	"server"
    62 				"linux"		"@_ZN15CBaseTempEntity15s_pTempEntitiesE"
    63 				"mac"		"@_ZN15CBaseTempEntity15s_pTempEntitiesE"
    64 			}
    65 		}
    66 	}
    67 	
    68 	/* CGlobalEntityList */
    69 	"#default"
    70 	{
    71 		"#supported"
    72 		{
    73 			"game"		"dod"
    74 			"game"		"tf"
    75 			"game"		"hl2mp"
    76 		}
    77 		
    78 		"Signatures"
    79 		{
    80 			/* Functions in CGlobalEntityList */
    81 			"FindEntityByClassname"
    82 			{
    83 				"library"	"server"
    84 				"windows"	"\x55\x8B\xEC\x53\x56\x8B\xF1\x8B\x4D\x2A\x85\xC9\x57\x74\x2A\x8B\x01\x8B\x50\x2A\xFF\xD2\x8B\x00\x25\x2A\x2A\x2A\x2A\x83\xC0\x2A\xC1\xE0\x04\x8B\x3C\x30\xEB\x2A\x8B\xBE\x2A\x2A\x2A\x2A\x85\xFF\x74\x2A\x8B\x5D\x2A\x8B\x37\x85\xF6\x75\x2A\x68\x2A\x2A\x2A\x2A\xFF\x15\x2A\x2A\x2A\x2A\x83\xC4\x2A\xEB\x2A\x39"
    85 				"linux"		"@_ZN17CGlobalEntityList21FindEntityByClassnameEP11CBaseEntityPKc"
    86 				"mac"		"@_ZN17CGlobalEntityList21FindEntityByClassnameEP11CBaseEntityPKc"
    87 			}
    88 		}
    89 	}
    90 
    91 	/* General GameRules */
    92 	"#default"
    93 	{
    94 		"#supported"
    95 		{
    96 			"game"		"dod"
    97 			"game"		"tf"
    98 			"game"		"cstrike"
    99 			"game"		"garrysmod"
   100 			"game"		"hl2mp"
   101 		}
   102 		
   103 		"Offsets"
   104 		{
   105 			/* Offset into CreateGameRulesObject */
   106 			"g_pGameRules"
   107 			{
   108 				"windows"	"2"
   109 			}
   110 		}
   111 		
   112 		"Signatures"
   113 		{
   114 			/* This signature sometimes has multiple matches, but this
   115 			 * does not matter as g_pGameRules is involved in all of them.
   116 			 * The same g_pGameRules offset applies to each match.
   117 			 *
   118 			 * Sometimes this block of bytes is at the beginning of the static
   119 			 * CreateGameRulesObject function and sometimes it is in the middle
   120 			 * of an entirely different function. This depends on the game.
   121 			 */
   122 			"CreateGameRulesObject"
   123 			{
   124 				"library"	"server"
   125 				"windows"	"\x8B\x0D\x2A\x2A\x2A\x2A\x85\xC9\x74\x2A\x8B\x01\x8B\x50\x2A\x6A\x01\xFF\xD2"
   126 			}
   127 			"g_pGameRules"
   128 			{
   129 				"library"	"server"
   130 				"linux"		"@g_pGameRules"
   131 				"mac"		"@g_pGameRules"
   132 			}
   133 		}
   134 	}
   135 
   136 	/* IServer interface pointer */
   137 	"#default"
   138 	{
   139 		"Keys"
   140 		{
   141 			/* Signature for the beginning of IVEngineServer::CreateFakeClient.
   142 			 *
   143 			 * The engine binary is not actually scanned in order to look for
   144 			 * this. SourceHook is used to used to determine the address of the
   145 			 * function and this signature is used to verify that it contains
   146 			 * the expected code. A pointer to sv (IServer interface) is used
   147 			 * here.
   148 			 */
   149 			"CreateFakeClient_Windows"	"\x8B\x44\x24\x2A\x50\xB9\x2A\x2A\x2A\x2A\xE8"
   150 		}
   151 		
   152 		"Offsets"
   153 		{
   154 			/* Offset into IVEngineServer::CreateFakeClient */
   155 			"sv"
   156 			{
   157 				"windows"	"6"
   158 			}
   159 		}
   160 
   161 		"Signatures"
   162 		{
   163 			/* CBaseServer object for IServer interface */
   164 			"sv"
   165 			{
   166 				"library"	"engine"
   167 				"linux"		"@sv"
   168 				"mac"		"@sv"
   169 			}
   170 		}
   171 	}
   172 	
   173 	/* EntityFactoryDictionary function */
   174 	"#default"
   175 	{
   176 		"Signatures"
   177 		{
   178 			"EntityFactory"
   179 			{
   180 				"library"	"server"
   181 				"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"
   182 				"linux"		"@_Z23EntityFactoryDictionaryv"
   183 				"mac"		"@_Z23EntityFactoryDictionaryv"
   184 			}
   185 		}
   186 	}
   187 
   188 	/* CBaseEntityOutput::FireOutput */
   189 	"#default"
   190 	{
   191 		"#supported"
   192 		{
   193 			"game"		"dod"
   194 			"game"		"tf"
   195 			"game"		"hl2mp"
   196 		}
   197 		"Signatures"
   198 		{
   199 			"FireOutput"
   200 			{
   201 				"library"	"server"
   202 				"windows"	"\x55\x8B\xEC\x81\xEC\x2A\x2A\x2A\x2A\x53\x56\x8B\x71\x2A\x85\xF6"
   203 				"linux"		"@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f"
   204 				"mac"		"@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f"
   205 			}
   206 		}
   207 	}
   208 	
   209 	/* SetUserInfo data */
   210 	"#default"
   211 	{
   212 		"#supported"
   213 		{
   214 			"game"		"dod"
   215 			"game"		"tf"
   216 			"game"		"garrysmod"
   217 			"game"		"hl2mp"
   218 		}
   219 		
   220 		"Offsets"
   221 		{
   222 			/**
   223 			 * CBaseClient::SetUserCVar(char  const*,char  const*);
   224 			 * Linux offset straight from VTable dump.
   225 			 * Windows offset is crazy. Found the windows SetName function using string "(%d)%-0.*s"
   226 			 * Cross referenced back to the vtable and counted manually (SetUserCvar is 1 higher, offsets start from 1)
   227 			 */
   228 			"SetUserCvar"
   229 			{
   230 				"windows"	"18"
   231 				"linux"		"58"
   232 				"mac"		"58"
   233 			}
   234 			/**
   235 			 * Offset into CBaseClient - Used by CBaseServer::UpdateUserSettings to determine when changes have been made.
   236 			 * Find CBaseClient::UpdateUserSettings (strings "net_maxroutable", "cl_updaterate" etc) and the offset is set to 0 near the end.
   237 			 * Linux: 	mov     byte ptr [esi+98h], 0
   238 			 * Win:	mov     byte ptr [esi+0A4h], 0
   239 			 */
   240 			"InfoChanged"
   241 			{
   242 				"windows"	"140"
   243 				"linux"		"140"
   244 				"mac"		"140"
   245 			}
   246 		}
   247 	}
   248 }