GCSDK::CSchema::AddRenameField
0x0008dc80 · 358 bytes · __thiscall
_ZN5GCSDK7CSchema14AddRenameFieldEPKcS2_
Decompiled
undefined (3 params)
/* GCSDK::CSchema::AddRenameField(char const*, char const*) */
void __thiscall GCSDK::CSchema::AddRenameField(CSchema *this,char *param_1,char *param_2)
{
int iVar1;
undefined4 uVar2;
int iVar3;
void *pvVar4;
int iVar5;
int iVar6;
char *pcVar7;
iVar1 = *(int *)(this + 0x120);
iVar5 = *(int *)(this + 0x118);
iVar6 = iVar1 + 1;
if (iVar5 < iVar6) {
iVar3 = *(int *)(this + 0x11c);
if (-1 < iVar3) {
if (iVar3 == 0) {
if (iVar5 == 0) {
if (iVar6 < 2) {
iVar3 = 1;
goto LAB_0008dd2f;
}
iVar5 = 1;
}
do {
iVar3 = iVar5 * 2;
if (iVar6 <= iVar3) break;
iVar3 = iVar5 * 4;
iVar5 = iVar3;
} while (iVar3 < iVar6);
}
else {
for (iVar3 = (iVar1 / iVar3 + 1) * iVar3; iVar3 < iVar6; iVar3 = (iVar3 + iVar6) / 2) {
}
}
LAB_0008dd2f:
*(int *)(this + 0x118) = iVar3;
if (*(void **)(this + 0x114) == (void *)0x0) {
pvVar4 = malloc(iVar3 * 0x84);
*(void **)(this + 0x114) = pvVar4;
}
else {
pvVar4 = realloc(*(void **)(this + 0x114),iVar3 * 0x84);
*(void **)(this + 0x114) = pvVar4;
iVar6 = *(int *)(this + 0x120) + 1;
}
goto LAB_0008dca5;
}
}
pvVar4 = *(void **)(this + 0x114);
LAB_0008dca5:
*(int *)(this + 0x120) = iVar6;
iVar6 = (iVar6 - iVar1) + -1;
*(void **)(this + 0x124) = pvVar4;
if (0 < iVar6) {
_V_memmove((void *)((int)pvVar4 + iVar1 * 0x84 + 0x84),(void *)((int)pvVar4 + iVar1 * 0x84),
iVar6 * 0x84);
pvVar4 = *(void **)(this + 0x114);
}
pcVar7 = (char *)(iVar1 * 0x84 + (int)pvVar4);
V_strncpy(pcVar7,param_1,0x80);
uVar2 = FindIField(this,param_2);
*(undefined4 *)(pcVar7 + 0x80) = uVar2;
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.