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