CUtlVector<CountdownTimer,CUtlMemoryFixedGrowable<CountdownTimer,3u,int>>::SetCountNonDestructively
0x0088d010 · 412 bytes · __thiscall
_ZN10CUtlVectorI14CountdownTimer23CUtlMemoryFixedGrowableIS0_Lj3EiEE24SetCountNonDestructivelyEi
Decompiled
undefined (2 params)
/* CUtlVector<CountdownTimer, CUtlMemoryFixedGrowable<CountdownTimer, 3u, int>
>::SetCountNonDestructively(int) */
void __thiscall
CUtlVector<CountdownTimer,CUtlMemoryFixedGrowable<CountdownTimer,3u,int>>::SetCountNonDestructively
(CUtlVector<CountdownTimer,CUtlMemoryFixedGrowable<CountdownTimer,3u,int>> *this,
int param_1)
{
undefined4 *puVar1;
void *__dest;
int iVar2;
int iVar3;
int iVar4;
int iVar5;
int local_20;
iVar4 = *(int *)(this + 0x34);
iVar5 = param_1 - iVar4;
if (iVar5 < 1) {
if (iVar5 == 0) {
return;
}
*(int *)(this + 0x34) = param_1;
return;
}
iVar3 = *(int *)(this + 4);
if (param_1 <= iVar3) {
__dest = *(void **)this;
iVar3 = iVar4;
goto LAB_0088d05c;
}
local_20 = *(int *)(this + 8);
iVar2 = param_1 - iVar3;
if (local_20 < 0) {
local_20 = *(int *)(this + 0xc);
*(int *)(this + 8) = local_20;
if (iVar3 == 0) {
*(undefined4 *)this = 0;
__dest = (void *)0x0;
}
else {
__dest = malloc(iVar3 * 0xc);
memcpy(__dest,*(void **)this,iVar3 * 0xc);
local_20 = *(int *)(this + 8);
*(void **)this = __dest;
}
if (-1 < local_20) {
iVar3 = *(int *)(this + 4);
goto LAB_0088d0e3;
}
}
else {
LAB_0088d0e3:
iVar2 = iVar2 + iVar3;
if (local_20 == 0) {
if (iVar3 == 0) {
iVar3 = 3;
}
for (; iVar3 < iVar2; iVar3 = iVar3 * 2) {
}
}
else {
for (iVar3 = ((iVar2 + -1) / local_20 + 1) * local_20; iVar3 < iVar2;
iVar3 = (iVar3 + iVar2) / 2) {
}
}
*(int *)(this + 4) = iVar3;
if (*(void **)this != (void *)0x0) {
__dest = realloc(*(void **)this,iVar3 * 0xc);
iVar3 = *(int *)(this + 0x34);
*(void **)this = __dest;
goto LAB_0088d05c;
}
__dest = malloc(iVar3 * 0xc);
*(void **)this = __dest;
}
iVar3 = *(int *)(this + 0x34);
LAB_0088d05c:
*(void **)(this + 0x38) = __dest;
*(int *)(this + 0x34) = iVar3 + iVar5;
iVar3 = ((iVar3 + iVar5) - iVar4) - iVar5;
if (0 < iVar3) {
_V_memmove((void *)((int)__dest + param_1 * 0xc),(void *)((int)__dest + iVar4 * 0xc),iVar3 * 0xc
);
__dest = *(void **)this;
}
iVar3 = 0;
iVar4 = iVar4 * 0xc;
while( true ) {
puVar1 = (undefined4 *)((int)__dest + iVar4);
if (puVar1 != (undefined4 *)0x0) {
*puVar1 = &PTR_NetworkStateChanged_00c0b6e0;
puVar1[1] = 0;
puVar1[2] = 0xbf800000;
}
iVar3 = iVar3 + 1;
iVar4 = iVar4 + 0xc;
if (iVar3 == iVar5) break;
__dest = *(void **)this;
}
return;
}
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.