Mod_LoadLump
0x001971c0 · 226 bytes · __cdecl
_Z12Mod_LoadLumpP7model_tiPciPPvPi
Decompiled
undefined (6 params)
/* Mod_LoadLump(model_t*, int, char*, int, void**, int*) */
void Mod_LoadLump(model_t *param_1,int param_2,char *param_3,int param_4,void **param_5,int *param_6
)
{
void *__dest;
int in_GS_OFFSET;
size_t local_140 [3];
int local_134;
void *local_130;
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
CMapLoadHelper::CMapLoadHelper((CMapLoadHelper *)local_140,param_2);
if ((int)local_140[0] % param_4 != 0) {
/* try { // try from 00197222 to 00197248 has its CatchHandler @ 001972a2 */
Host_Error("Mod_LoadLump: funny lump size in %s",param_1 + 4);
}
*param_6 = (int)local_140[0] / param_4;
__dest = (void *)Hunk_AllocName(local_140[0],param_3,true);
*param_5 = __dest;
memcpy(__dest,local_130,local_140[0]);
if (local_134 != 0) {
(**(code **)(*g_pFileSystem + 0x150))(g_pFileSystem,local_134);
}
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return;
}
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
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.