CUtlVector<CSmokeCloudSystem::SmokeCloudType,CUtlMemory<CSmokeCloudSystem::SmokeCloudType,int>>::InsertBefore
0x00909110 · 343 bytes · __thiscall
_ZN10CUtlVectorIN17CSmokeCloudSystem14SmokeCloudTypeE10CUtlMemoryIS1_iEE12InsertBeforeEiRKS1_
Decompiled
undefined (3 params)
/* CUtlVector<CSmokeCloudSystem::SmokeCloudType, CUtlMemory<CSmokeCloudSystem::SmokeCloudType, int>
>::InsertBefore(int, CSmokeCloudSystem::SmokeCloudType const&) */
int __thiscall
CUtlVector<CSmokeCloudSystem::SmokeCloudType,CUtlMemory<CSmokeCloudSystem::SmokeCloudType,int>>::
InsertBefore(CUtlVector<CSmokeCloudSystem::SmokeCloudType,CUtlMemory<CSmokeCloudSystem::SmokeCloudType,int>>
*this,int param_1,SmokeCloudType *param_2)
{
int iVar1;
undefined4 *puVar2;
void *pvVar3;
int iVar4;
int iVar5;
iVar4 = *(int *)(this + 4);
iVar5 = *(int *)(this + 0xc) + 1;
if (iVar4 < iVar5) {
iVar1 = *(int *)(this + 8);
if (iVar1 < 0) goto LAB_00909132;
if (iVar1 == 0) {
if (iVar4 == 0) {
if (iVar5 < 3) {
iVar4 = 2;
goto LAB_009091a6;
}
iVar4 = 2;
}
do {
iVar4 = iVar4 * 2;
} while (iVar4 < iVar5);
}
else {
for (iVar4 = iVar1 * (*(int *)(this + 0xc) / iVar1 + 1); iVar4 < iVar5;
iVar4 = (iVar4 + iVar5) / 2) {
}
}
LAB_009091a6:
*(int *)(this + 4) = iVar4;
if (*(void **)this != (void *)0x0) {
pvVar3 = realloc(*(void **)this,iVar4 * 0x14);
iVar5 = *(int *)(this + 0xc);
*(void **)this = pvVar3;
*(void **)(this + 0x10) = pvVar3;
*(int *)(this + 0xc) = iVar5 + 1;
iVar5 = (iVar5 + 1) - param_1;
goto joined_r0x009091e0;
}
pvVar3 = malloc(iVar4 * 0x14);
*(void **)this = pvVar3;
}
else {
LAB_00909132:
pvVar3 = *(void **)this;
}
*(int *)(this + 0xc) = iVar5;
iVar5 = iVar5 - param_1;
*(void **)(this + 0x10) = pvVar3;
joined_r0x009091e0:
if (0 < iVar5 + -1) {
_V_memmove((void *)((int)pvVar3 + param_1 * 0x14 + 0x14),(void *)((int)pvVar3 + param_1 * 0x14),
(iVar5 + -1) * 0x14);
pvVar3 = *(void **)this;
}
puVar2 = (undefined4 *)((int)pvVar3 + param_1 * 0x14);
if (puVar2 != (undefined4 *)0x0) {
*puVar2 = *(undefined4 *)param_2;
puVar2[1] = *(undefined4 *)(param_2 + 4);
puVar2[2] = *(undefined4 *)(param_2 + 8);
puVar2[3] = *(undefined4 *)(param_2 + 0xc);
puVar2[4] = *(undefined4 *)(param_2 + 0x10);
}
return param_1;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
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.
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.