Templates_GetEntityIOFixedMapData
0x0083dbe0 · 317 bytes · __cdecl
_Z33Templates_GetEntityIOFixedMapDatai
Decompiled
undefined (1 param)
/* Templates_GetEntityIOFixedMapData(int) */
undefined4 Templates_GetEntityIOFixedMapData(int param_1)
{
char cVar1;
int iVar2;
size_t __n;
char *__src;
char *pcVar3;
void *pvVar4;
char *__dest;
char cVar5;
iVar2 = *(int *)(g_Templates + param_1 * 4);
if (*(int *)(iVar2 + 0x14) == 0) {
pvVar4 = operator_new__(*(uint *)(iVar2 + 0xc));
*(void **)(iVar2 + 0x14) = pvVar4;
iVar2 = *(int *)(g_Templates + param_1 * 4);
V_strncpy(*(char **)(iVar2 + 0x14),*(char **)(iVar2 + 4),*(int *)(iVar2 + 0xc));
}
__n = strlen(ENTITYIO_FIXUP_STRING);
__src = operator_new__(__n + 1);
V_snprintf(__src,__n + 1,"%c%.4d",(int)(char)*ENTITYIO_FIXUP_STRING,g_iCurrentTemplateInstance);
__dest = *(char **)(*(int *)(g_Templates + param_1 * 4) + 0x14);
cVar5 = *__dest;
LAB_0083dc71:
do {
if (*ENTITYIO_FIXUP_STRING == cVar5) {
if (1 < (int)__n) {
cVar5 = __dest[1];
if (9 < (byte)(cVar5 - 0x30U)) goto LAB_0083dc64;
pcVar3 = __dest + 2;
do {
if (pcVar3 == __dest + __n) goto LAB_0083dca2;
cVar1 = *pcVar3;
pcVar3 = pcVar3 + 1;
} while ((byte)(cVar1 - 0x30U) < 10);
__dest = __dest + 1;
goto LAB_0083dc71;
}
LAB_0083dca2:
memcpy(__dest,__src,__n);
cVar5 = __dest[__n + 1];
__dest = __dest + __n + 1;
}
else {
cVar5 = __dest[1];
LAB_0083dc64:
__dest = __dest + 1;
}
if (cVar5 == '\0') {
return *(undefined4 *)(*(int *)(g_Templates + param_1 * 4) + 0x14);
}
} while( true );
}
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.