CParticleSystemDefinition::SetupContextData
0x00bca450 · 524 bytes · __thiscall
_ZN25CParticleSystemDefinition16SetupContextDataEv
Decompiled
undefined (1 param)
/* CParticleSystemDefinition::SetupContextData() */
void __thiscall CParticleSystemDefinition::SetupContextData(CParticleSystemDefinition *this)
{
int iVar1;
CParticleSystemDefinition *pCVar2;
int iVar3;
int iVar4;
int *piVar5;
int iVar6;
size_t __size;
void *pvVar7;
int iVar8;
int local_60;
CParticleSystemDefinition *local_54;
int local_50;
CParticleSystemDefinition *local_4c [4];
CParticleSystemDefinition *local_3c;
CParticleSystemDefinition *local_38;
CParticleSystemDefinition *local_34 [4];
CParticleSystemDefinition *local_24;
CParticleSystemDefinition *local_20;
local_60 = 0;
local_54 = this + 0x308;
*(undefined4 *)(this + 0x2c4) = 0;
local_4c[0] = local_54;
local_4c[1] = this + 0x31c;
local_4c[2] = this + 0x330;
local_4c[3] = this + 0x344;
local_3c = this + 0x358;
local_38 = this + 0x36c;
local_34[0] = this + 0x394;
local_34[1] = this + 0x3a8;
local_34[2] = this + 0x3bc;
local_34[3] = this + 0x3d0;
local_24 = this + 0x3e4;
local_20 = this + 0x3f8;
do {
iVar1 = *(int *)(local_54 + 0xc);
if (0 < iVar1) {
local_50 = 0;
pCVar2 = local_34[local_60];
do {
iVar3 = *(int *)(pCVar2 + 0xc);
iVar4 = *(int *)(pCVar2 + 4);
iVar8 = iVar3 + 1;
if (iVar4 < iVar8) {
iVar6 = *(int *)(pCVar2 + 8);
if (iVar6 < 0) goto LAB_00bca519;
if (iVar6 == 0) {
if (iVar4 == 0) {
if (iVar8 < 9) {
iVar6 = 8;
goto LAB_00bca5ef;
}
iVar4 = 8;
}
do {
iVar6 = iVar4;
iVar4 = iVar6 * 2;
} while (iVar4 < iVar8);
pvVar7 = *(void **)pCVar2;
*(int *)(pCVar2 + 4) = iVar4;
__size = iVar6 << 3;
if (pvVar7 == (void *)0x0) goto LAB_00bca645;
LAB_00bca5fe:
pvVar7 = realloc(pvVar7,__size);
*(void **)pCVar2 = pvVar7;
iVar8 = *(int *)(pCVar2 + 0xc) + 1;
}
else {
for (iVar6 = (iVar3 / iVar6 + 1) * iVar6; iVar6 < iVar8; iVar6 = (iVar6 + iVar8) / 2) {
}
LAB_00bca5ef:
pvVar7 = *(void **)pCVar2;
*(int *)(pCVar2 + 4) = iVar6;
__size = iVar6 << 2;
if (pvVar7 != (void *)0x0) goto LAB_00bca5fe;
LAB_00bca645:
pvVar7 = malloc(__size);
*(void **)pCVar2 = pvVar7;
}
}
else {
LAB_00bca519:
pvVar7 = *(void **)pCVar2;
}
*(int *)(pCVar2 + 0xc) = iVar8;
iVar4 = iVar3 * 4;
iVar8 = (iVar8 - iVar3) + -1;
*(void **)(pCVar2 + 0x10) = pvVar7;
if (0 < iVar8) {
_V_memmove((void *)((int)pvVar7 + iVar4 + 4),(void *)((int)pvVar7 + iVar4),iVar8 * 4);
pvVar7 = *(void **)pCVar2;
}
if ((undefined4 *)((int)pvVar7 + iVar4) != (undefined4 *)0x0) {
*(undefined4 *)((int)pvVar7 + iVar4) = *(undefined4 *)(this + 0x2c4);
}
piVar5 = *(int **)(*(int *)local_54 + local_50 * 4);
iVar8 = (**(code **)(*piVar5 + 4))(piVar5);
local_50 = local_50 + 1;
*(uint *)(this + 0x2c4) = iVar8 + 0xf + *(int *)(this + 0x2c4) & 0xfffffff0;
} while (local_50 != iVar1);
}
local_60 = local_60 + 1;
if (local_60 == 6) {
return;
}
local_54 = local_4c[local_60];
} 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.