gamedata/sdktools.games/engine.ep2valve.txt
author Nicholas Hastings <skamonkey@gmail.com>
Thu Aug 23 07:47:44 2012 -0400 (2012-08-23)
changeset 3625 cde554b8c957
parent 3614 d67b465a1e8d
child 3626 44eb47dcee63
permissions -rw-r--r--
Updated SDKTools IServer finding on Windows for Ep2v and CSS (bug 5450, r=me).
     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"		"hl2mp"
    22 			"game"		"garrysmod"
    23 		}
    24 
    25 		"Offsets"
    26 		{
    27 			/* Offset into CBaseTempEntity constructor */
    28 			"s_pTempEntities"
    29 			{
    30 				"windows"	"19"
    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 			"game"		"garrysmod"
    77 		}
    78 		
    79 		"Signatures"
    80 		{
    81 			/* Functions in CGlobalEntityList */
    82 			"FindEntityByClassname"
    83 			{
    84 				"library"	"server"
    85 				"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"
    86 				"linux"		"@_ZN17CGlobalEntityList21FindEntityByClassnameEP11CBaseEntityPKc"
    87 				"mac"		"@_ZN17CGlobalEntityList21FindEntityByClassnameEP11CBaseEntityPKc"
    88 			}
    89 		}
    90 	}
    91 
    92 	/* General GameRules */
    93 	"#default"
    94 	{
    95 		"#supported"
    96 		{
    97 			"game"		"dod"
    98 			"game"		"tf"
    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::CreateFakeClientEx.
   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"	"\x55\x8B\xEC\x8B\x2A\x2A\x8A\x2A\x2A\x51\xB9\x2A\x2A\x2A\x2A\xA2"
   150 		}
   151 		
   152 		"Offsets"
   153 		{
   154 			/* Offset into IVEngineServer::CreateFakeClient */
   155 			"sv"
   156 			{
   157 				"windows"	"11"
   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 			"game"		"garrysmod"
   197 		}
   198 		"Signatures"
   199 		{
   200 			"FireOutput"
   201 			{
   202 				"library"	"server"
   203 				"windows"	"\x55\x8B\xEC\x81\xEC\x2A\x2A\x2A\x2A\x53\x56\x8B\x71\x2A\x85\xF6"
   204 				"linux"		"@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f"
   205 				"mac"		"@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f"
   206 			}
   207 		}
   208 	}
   209 	
   210 	/* SetUserInfo data */
   211 	"#default"
   212 	{
   213 		"#supported"
   214 		{
   215 			"game"		"dod"
   216 			"game"		"tf"
   217 			"game"		"garrysmod"
   218 			"game"		"hl2mp"
   219 		}
   220 		
   221 		"Offsets"
   222 		{
   223 			/**
   224 			 * CBaseClient::SetUserCVar(char  const*,char  const*);
   225 			 * Linux offset straight from VTable dump.
   226 			 * Windows offset is crazy. Found the windows SetName function using string "(%d)%-0.*s"
   227 			 * Cross referenced back to the vtable and counted manually (SetUserCvar is 1 higher, offsets start from 1)
   228 			 */
   229 			"SetUserCvar"
   230 			{
   231 				"windows"	"18"
   232 				"linux"		"58"
   233 				"mac"		"58"
   234 			}
   235 			/**
   236 			 * Offset into CBaseClient - Used by CBaseServer::UpdateUserSettings to determine when changes have been made.
   237 			 * Find CBaseClient::UpdateUserSettings (strings "net_maxroutable", "cl_updaterate" etc) and the offset is set to 0 near the end.
   238 			 * Linux: 	mov     byte ptr [esi+98h], 0
   239 			 * Win:	mov     byte ptr [esi+0A4h], 0
   240 			 */
   241 			"InfoChanged"
   242 			{
   243 				"windows"	"140"
   244 				"linux"		"140"
   245 				"mac"		"140"
   246 			}
   247 		}
   248 	}
   249 }