gamedata/sdktools.games/engine.darkm.txt
author Scott Ehlert <ds@alliedmods.net>
Wed Feb 18 02:19:22 2009 -0600 (2009-02-18)
changeset 2583 d3b2571c378b
child 2690 e3906d051a3b
permissions -rw-r--r--
Added support for Dark Messiah engine and game. (no bug, r=me).

The development of this feature would not be possible without the support of the following people from the game's community:
Dylan Riggs, Carl Pettengill, Ed Moreland, and Christian.
     1 "Games"
     2 {
     3 	/* Sounds */
     4 	"#default"
     5 	{
     6 		"Keys"
     7 		{
     8 			"SlapSoundCount"	"3"
     9 			"SlapSound1"		"default/player/sword_on_flesh_std01.wav"
    10 			"SlapSound2"		"default/player/sword_on_flesh_std05.wav"
    11 			"SlapSound3"		"default/player/bone_breaking03.wav"
    12 		}
    13 	}
    14 	
    15 	/* Properties */
    16 	"#default"
    17 	{
    18 		"Offsets"
    19 		{
    20 			"m_iHealth"
    21 			{
    22 				"class"			"CBasePlayer"
    23 				"prop"			"m_fHealth"
    24 			}
    25 		}
    26 	}
    27 	
    28 	/* General Temp Entities */
    29 	"#default"
    30 	{
    31 		"#supported"
    32 		{
    33 			"game"		"!Might and Magic Multiplayer"
    34 		}
    35 
    36 		"Offsets"
    37 		{
    38 			/* Offset into CBaseTempEntity constructor */
    39 			"s_pTempEntities"
    40 			{
    41 				"windows"	"17"
    42 			}
    43 			"GetTEName"
    44 			{
    45 				"windows"	"4"
    46 			}
    47 			"GetTENext"
    48 			{
    49 				"windows"	"8"
    50 			}
    51 			"TE_GetServerClass"
    52 			{
    53 				"windows"	"0"
    54 			}
    55 		}
    56 
    57 		"Signatures"
    58 		{
    59 			"CBaseTempEntity"
    60 			{
    61 				"library"	"server"
    62 				"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"
    63 			}
    64 		}
    65 	}
    66 	
    67 	/* Create Entity Signatures */
    68 	"#default"
    69 	{
    70 		"#supported"
    71 		{
    72 			"game"		"!Might and Magic Multiplayer"
    73 		}
    74 
    75 		"Signatures"
    76 		{
    77 			"DispatchSpawn"
    78 			{
    79 				"library"	"server"
    80 				"windows"	"\x53\x56\x8B\x74\x24\x0C\x85\xF6\x57\x0F\x84\x2A\x2A\x2A\x2A\x8B\x1D\x2A\x2A\x2A\x2A\x8B\x03\x8B\xCB\xFF\x50\x60\x8B\x16"
    81 			}
    82 			"CreateEntityByName"
    83 			{
    84 				"library"	"server"
    85 				"windows"	"\x56\x8B\x74\x24\x0C\x83\xFE\xFF\x57\x8B\x7C\x24\x0C\x74\x25\x8B\x0D\x2A\x2A\x2A\x2A\x8B\x01\x56\xFF\x50\x2A\x85\xC0"
    86 			}
    87 		}
    88 	}
    89 
    90 	/* CGlobalEntityList */
    91 	"#default"
    92 	{
    93 		"#supported"
    94 		{
    95 			"game"		"!Might and Magic Multiplayer"
    96 		}
    97 		
    98 		"Offsets"
    99 		{
   100 			/* Offset into LevelShutdown */
   101 			"gEntList"
   102 			{
   103 				"windows"	"11"
   104 			}
   105 		}
   106 		
   107 		"Signatures"
   108 		{
   109 			"LevelShutdown"
   110 			{
   111 				"library"	"server"
   112 				"windows"	"\xE8\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\xB9\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\xE8"
   113 			}
   114 
   115 			/* Functions in CGlobalEntityList */
   116 			"FindEntityByClassname"
   117 			{
   118 				"library"	"server"
   119 				"windows"	"\x53\x55\x56\x8B\xF1\x8B\x4C\x24\x10\x85\xC9\x57\x74\x18\x8B\x01\xFF\x50\x08\x8B\x08\x81\xE1\xFF\x0F\x00\x00\x83\xC1\x01\xC1\xE1\x04\x8B\x3C\x31\xEB\x06\x8B\xBE\x2A\x2A\x2A\x2A\x85\xFF\x74\x3A\x8B\x5C\x24\x18\x8B\x2D\x2A\x2A\x2A\x2A\x8D"
   120 			}
   121 		}
   122 	}
   123 
   124 	/* General GameRules */
   125 	"#default"
   126 	{
   127 		"#supported"
   128 		{
   129 			"game"		"!Might and Magic Multiplayer"
   130 		}
   131 		
   132 		"Offsets"
   133 		{
   134 			/* Offset into CreateGameRulesObject */
   135 			"g_pGameRules"
   136 			{
   137 				"windows"	"2"
   138 			}
   139 		}
   140 		
   141 		"Signatures"
   142 		{
   143 			/* This signature sometimes has multiple matches, but this
   144 			 * does not matter as g_pGameRules is involved in all of them.
   145 			 * The same g_pGameRules offset applies to each match.
   146 			 *
   147 			 * Sometimes this block of bytes is at the beginning of the static
   148 			 * CreateGameRulesObject function and sometimes it is in the middle
   149 			 * of an entirely different function. This depends on the game.
   150 			 */
   151 			"CreateGameRulesObject"
   152 			{
   153 				"library"	"server"
   154 				"windows"	"\x8B\x0D\x2A\x2A\x2A\x2A\x85\xC9\x74\x2A\x8B\x01\x6A\x01\xFF\x50"
   155 			}
   156 		}
   157 	}
   158 
   159 	/* IServer interface pointer */
   160 	"#default"
   161 	{
   162 		"Keys"
   163 		{
   164 			/* Signature for the beginning of IVEngineServer::CreateFakeClient.
   165 			 *
   166 			 * The engine binary is not actually scanned in order to look for
   167 			 * this. SourceHook is used to used to determine the address of the
   168 			 * function and this signature is used to verify that it contains
   169 			 * the expected code. A pointer to sv (IServer interface) is used
   170 			 * here.
   171 			 */
   172 			"CreateFakeClient_Windows"	"\x8B\x44\x24\x2A\x50\xB9\x2A\x2A\x2A\x2A\xE8"
   173 		}
   174 		
   175 		"Offsets"
   176 		{
   177 			/* Offset into IVEngineServer::CreateFakeClient */
   178 			"sv"
   179 			{
   180 				"windows"	"6"
   181 			}
   182 		}
   183 	}
   184 	
   185 	/* EntityFactoryDictionary function */
   186 	"#default"
   187 	{
   188 		"Signatures"
   189 		{
   190 			"EntityFactory"
   191 			{
   192 				"library"	"server"
   193 				"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"
   194 			}
   195 		}
   196 	}
   197 
   198 	/* CBaseEntityOutput::FireOutput */
   199 	"#default"
   200 	{
   201 		"#supported"
   202 		{
   203 			"game"		"!Might and Magic Multiplayer"
   204 		}
   205 		"Signatures"
   206 		{
   207 			"FireOutput"
   208 			{
   209 				"library"	"server"
   210 				"windows"	"\x83\xEC\x1C\x53\x55\x56\x8B\x71\x14"
   211 				"linux"		"@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f"
   212 			}
   213 		}
   214 		"Offsets"
   215 		{
   216 			"FireOutputBackup"
   217 			{
   218 				"windows"	"6"
   219 			}
   220 		}
   221 	}
   222 	
   223 	/* SetUserInfo data */
   224 	"#default"
   225 	{
   226 		"Offsets"
   227 		{
   228 			/**
   229 			 * CBaseClient::SetUserCVar(char  const*,char  const*);
   230 			 * Linux offset straight from VTable dump.
   231 			 * Windows offset is crazy. Found the windows 'SetName' function using string "(%d)%-0.*s"
   232 			 * Cross referenced back to the vtable and counted manually (SetUserCvar is 1 higher, offsets start from 1)
   233 			 */
   234 			"SetUserCvar"
   235 			{
   236 				"windows"	"17"
   237 			}
   238 
   239 			"UpdateUserSettings"
   240 			{
   241 				"windows"	"7"
   242 			}
   243 		}
   244 	}
   245 	
   246 	/* Dark Messiah */
   247 	"!Might and Magic Multiplayer"
   248 	{
   249 		"Offsets"
   250 		{
   251 			"GiveNamedItem"
   252 			{
   253 				"windows"	"309"
   254 			}
   255 			"RemovePlayerItem"
   256 			{
   257 				"windows"	"210"
   258 			}
   259 			"Weapon_GetSlot"
   260 			{
   261 				"windows"	"208"
   262 			}
   263 			"Ignite"
   264 			{
   265 				"windows"	"172"
   266 			}
   267 			"Extinguish"
   268 			{
   269 				"windows"	"173"
   270 			}
   271 			"Teleport"
   272 			{
   273 				"windows"	"92"
   274 			}
   275 			"GetVelocity"
   276 			{
   277 				"windows"	"115"
   278 			}
   279 			"EyeAngles"
   280 			{
   281 				"windows"	"107"
   282 			}
   283 			"AcceptInput"
   284 			{
   285 				"windows"	"34"
   286 			}
   287 			"DispatchKeyValue"
   288 			{
   289 				"windows"	"30"
   290 			}
   291 			"DispatchKeyValueFloat"
   292 			{
   293 				"windows"	"29"
   294 			}
   295 			"DispatchKeyValueVector"
   296 			{
   297 				"windows"	"28"
   298 			}
   299 			"SetEntityModel"
   300 			{
   301 				"windows"	"25"
   302 			}
   303 			"WeaponEquip"
   304 			{
   305 				"windows"	"202"
   306 			}
   307 			"Activate"
   308 			{
   309 				"windows"	"32"
   310 			}
   311 		}
   312 		
   313 		"Signatures"
   314 		{
   315 			"CommitSuicide"
   316 			{
   317 				"library"	"server"
   318 				"windows"	"\x83\xEC\x44\x56\x8B\xF1\x8B\x8E\x2A\x00\x00\x00\x85\xC9"
   319 			}
   320 		}
   321 	}
   322 }