GCSDK::ConvertFieldToText
0x000909f0 · 464 bytes · __cdecl
_ZN5GCSDK18ConvertFieldToTextE10EGCSQLTypePhiPcib
Decompiled
undefined (6 params)
/* GCSDK::ConvertFieldToText(EGCSQLType, unsigned char*, int, char*, int, bool) */
void GCSDK::ConvertFieldToText
(undefined4 param_1,double *param_2,int param_3,char *param_4,int param_5,
char param_6)
{
float fVar1;
int in_GS_OFFSET;
double dVar2;
char local_410 [1024];
int local_10;
local_10 = *(int *)(in_GS_OFFSET + 0x14);
switch(param_1) {
case 0:
V_strncpy(param_4,"0x",param_5);
V_binarytohex((uchar *)param_2,param_3,param_4 + 2,param_5 + -2);
break;
case 1:
if ((param_2 == (double *)0x0) || (*(char *)param_2 == '\0')) {
if (param_6 == '\0') {
V_strncpy(param_4,"",param_5);
}
else {
V_strncpy(param_4,"\'\'",param_5);
}
}
else {
_V_memcpy(local_410,param_2,param_3);
local_410[param_3] = '\0';
if (param_6 == '\0') {
V_strncpy(param_4,local_410,param_5);
}
else {
EscapeStringValue(local_410,0x400);
V_snprintf(param_4,param_5,"\'%s\'",local_410);
}
}
break;
case 2:
fVar1 = (float)(uint)*(byte *)param_2;
goto LAB_00090a23;
case 3:
fVar1 = (float)(int)*(short *)param_2;
goto LAB_00090a23;
case 4:
fVar1 = *(float *)param_2;
LAB_00090a23:
V_snprintf(param_4,param_5,"%d",fVar1);
break;
case 5:
V_snprintf(param_4,param_5,"%lld",*(float *)param_2,*(float *)((int)param_2 + 4));
break;
case 6:
dVar2 = (double)*(float *)param_2;
goto LAB_00090a6d;
case 7:
dVar2 = *param_2;
LAB_00090a6d:
V_snprintf(param_4,param_5,"%f",dVar2);
}
if (local_10 != *(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.