ExtractKeyvalue
0x0080e710 · 560 bytes · __cdecl
_Z15ExtractKeyvaluePvP17typedescription_tiPKcPci
Decompiled
undefined (6 params)
/* ExtractKeyvalue(void*, typedescription_t*, int, char const*, char*, int) */
undefined4
ExtractKeyvalue(void *param_1,typedescription_t *param_2,int param_3,char *param_4,char *param_5,
int param_6)
{
int iVar1;
undefined4 uVar2;
int iVar3;
uint uVar4;
undefined4 *puVar5;
int local_20;
if (0 < param_3) {
local_20 = 0;
do {
iVar1 = *(int *)(param_2 + 8);
if (((*(int *)param_2 == 10) && (*(short *)(param_2 + 0xc) == 1)) &&
(puVar5 = *(undefined4 **)(param_2 + 0x20), puVar5 != (undefined4 *)0x0)) {
do {
uVar2 = ExtractKeyvalue((void *)((int)param_1 + iVar1),(typedescription_t *)*puVar5,
puVar5[1],param_4,param_5,param_6);
if ((char)uVar2 != '\0') {
return uVar2;
}
puVar5 = (undefined4 *)puVar5[3];
} while (puVar5 != (undefined4 *)0x0);
}
if ((((byte)param_2[0xe] & 4) != 0) &&
(iVar3 = _V_stricmp(*(char **)(param_2 + 0x10),param_4), iVar3 == 0)) {
switch(*(int *)param_2) {
default:
Warning("Bad field in entity!!\n");
goto LAB_0080e73e;
case 1:
case 0x10:
V_snprintf(param_5,param_6,"%f",(double)*(float *)((int)param_1 + iVar1));
return 1;
case 2:
case 0x12:
case 0x13:
V_strncpy(param_5,(char *)(iVar1 + (int)param_1),param_6);
return 1;
case 3:
case 0xf:
V_snprintf(param_5,param_6,"%f %f %f",(double)*(float *)((int)param_1 + iVar1),
(double)*(float *)((int)param_1 + iVar1 + 4),
(double)*(float *)((int)param_1 + iVar1 + 8));
return 1;
case 5:
case 0x11:
uVar4 = *(uint *)((int)param_1 + iVar1);
break;
case 6:
uVar4 = (uint)*(byte *)((int)param_1 + iVar1);
break;
case 7:
uVar4 = (uint)*(short *)((int)param_1 + iVar1);
break;
case 8:
uVar4 = (uint)*(char *)((int)param_1 + iVar1);
break;
case 9:
V_snprintf(param_5,param_6,"%d %d %d %d",*(undefined4 *)((int)param_1 + iVar1),
*(undefined4 *)((int)param_1 + iVar1 + 4),
*(undefined4 *)((int)param_1 + iVar1 + 8),
*(undefined4 *)((int)param_1 + iVar1 + 0xc));
return 1;
case 0xb:
case 0x16:
case 0x17:
case 0x18:
goto LAB_0080e750;
}
V_snprintf(param_5,param_6,"%d",uVar4);
return 1;
}
LAB_0080e73e:
local_20 = local_20 + 1;
param_2 = param_2 + 0x40;
} while (local_20 != param_3);
}
LAB_0080e750:
return 0;
}
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.