Mod_LoadPrimitives
0x00196cf0 · 387 bytes · unknown
_Z18Mod_LoadPrimitivesv
Decompiled
undefined (0 params)
/* WARNING: Unknown calling convention -- yet parameter storage is locked */
/* Mod_LoadPrimitives() */
void Mod_LoadPrimitives(void)
{
byte *pbVar1;
int iVar2;
undefined1 *puVar3;
char *pcVar4;
uint *__s;
byte *pbVar5;
uint uVar6;
int in_GS_OFFSET;
uint local_140 [3];
int local_134;
byte *local_130;
int local_128;
undefined1 local_124 [260];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
CMapLoadHelper::CMapLoadHelper((CMapLoadHelper *)local_140,0x25);
if (local_140[0] != (local_140[0] / 10) * 10) {
/* try { // try from 00196e5f to 00196e63 has its CatchHandler @ 00196e74 */
Host_Error("Mod_LoadPrimitives: funny lump size in %s",s_szMapPathName);
}
uVar6 = local_140[0] / 10;
puVar3 = s_szMapPathName;
if ((&s_MapLumpFiles)[local_128 * 7] != 0) {
puVar3 = local_124;
}
/* try { // try from 00196d87 to 00196da5 has its CatchHandler @ 00196e74 */
pcVar4 = (char *)va("%s [%s]",puVar3,"primitives");
__s = (uint *)Hunk_AllocName(uVar6 * 0xc,pcVar4,true);
memset(__s,0,uVar6 * 0xc);
iVar2 = s_pMap;
*(uint *)(s_pMap + 0xa4) = uVar6;
*(uint **)(iVar2 + 0xa8) = __s;
pbVar1 = local_130 + uVar6 * 10;
if (uVar6 != 0) {
do {
pbVar5 = local_130 + 10;
*(undefined2 *)(__s + 1) = *(undefined2 *)(local_130 + 2);
*(undefined2 *)(__s + 2) = *(undefined2 *)(local_130 + 6);
*(undefined2 *)((int)__s + 6) = *(undefined2 *)(local_130 + 4);
*__s = (uint)*local_130;
*(undefined2 *)((int)__s + 10) = *(undefined2 *)(local_130 + 8);
__s = __s + 3;
local_130 = pbVar5;
} while (pbVar5 != pbVar1);
}
if (local_134 != 0) {
(**(code **)(*g_pFileSystem + 0x150))(g_pFileSystem,local_134);
}
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
return;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)
Just a Signatures{} block, ready to drop into a gamedata
file. Wire it up in your plugin however you like - SDKCall, DHooks,
raw memory ops, or anything else.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.