CUtlVector<SendProp_const*,CUtlMemory<SendProp_const*,int>>::CopyArray
0x00143150 · 258 bytes · __thiscall
_ZN10CUtlVectorIPK8SendProp10CUtlMemoryIS2_iEE9CopyArrayEPKS2_i
Decompiled
undefined (3 params)
/* CUtlVector<SendProp const*, CUtlMemory<SendProp const*, int> >::CopyArray(SendProp const* const*,
int) */
void __thiscall
CUtlVector<SendProp_const*,CUtlMemory<SendProp_const*,int>>::CopyArray
(CUtlVector<SendProp_const*,CUtlMemory<SendProp_const*,int>> *this,SendProp **param_1,
int param_2)
{
int iVar1;
int iVar2;
void *pvVar3;
*(undefined4 *)(this + 0xc) = 0;
if (param_2 == 0) {
return;
}
iVar2 = *(int *)(this + 4);
if (iVar2 < param_2) {
iVar1 = *(int *)(this + 8);
if (iVar1 < 0) goto LAB_0014317f;
if (iVar1 == 0) {
if (iVar2 == 0) {
if (param_2 < 9) {
iVar2 = 8;
goto LAB_001431df;
}
iVar2 = 8;
}
do {
iVar2 = iVar2 * 2;
} while (iVar2 < param_2);
}
else {
for (iVar2 = ((param_2 + -1) / iVar1 + 1) * iVar1; iVar2 < param_2;
iVar2 = (iVar2 + param_2) / 2) {
}
}
LAB_001431df:
*(int *)(this + 4) = iVar2;
if (*(void **)this != (void *)0x0) {
pvVar3 = realloc(*(void **)this,iVar2 << 2);
iVar2 = *(int *)(this + 0xc);
*(void **)this = pvVar3;
*(void **)(this + 0x10) = pvVar3;
*(int *)(this + 0xc) = param_2 + iVar2;
if ((0 < param_2) && (0 < iVar2)) {
_V_memmove((void *)((int)pvVar3 + param_2 * 4),pvVar3,iVar2 << 2);
}
goto LAB_00143187;
}
pvVar3 = malloc(iVar2 << 2);
*(void **)this = pvVar3;
}
else {
LAB_0014317f:
pvVar3 = *(void **)this;
}
*(int *)(this + 0xc) = param_2;
*(void **)(this + 0x10) = pvVar3;
LAB_00143187:
if (param_2 < 1) {
return;
}
iVar2 = 0;
do {
*(undefined4 *)(*(int *)this + iVar2) = *(undefined4 *)((int)param_1 + iVar2);
iVar2 = iVar2 + 4;
} while (iVar2 != param_2 << 2);
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.