CUtlVector<SendTable*,CUtlMemory<SendTable*,int>>::CopyArray
0x00156a40 · 267 bytes · __thiscall
_ZN10CUtlVectorIP9SendTable10CUtlMemoryIS1_iEE9CopyArrayEPKS1_i
Decompiled
undefined (3 params)
/* CUtlVector<SendTable*, CUtlMemory<SendTable*, int> >::CopyArray(SendTable* const*, int) */
void __thiscall
CUtlVector<SendTable*,CUtlMemory<SendTable*,int>>::CopyArray
(CUtlVector<SendTable*,CUtlMemory<SendTable*,int>> *this,SendTable **param_1,int param_2)
{
int iVar1;
int iVar2;
void *pvVar3;
*(undefined4 *)(this + 0xc) = 0;
if (param_2 == 0) {
return;
}
iVar1 = *(int *)(this + 4);
if (iVar1 < param_2) {
iVar2 = *(int *)(this + 8);
if (iVar2 < 0) goto LAB_00156a6f;
if (iVar2 == 0) {
if (iVar1 == 0) {
if (param_2 < 9) {
iVar2 = 8;
goto LAB_00156acf;
}
iVar1 = 8;
}
do {
iVar2 = iVar1 * 2;
if (param_2 <= iVar2) break;
iVar2 = iVar1 * 4;
iVar1 = iVar2;
} while (iVar2 < param_2);
}
else {
for (iVar2 = ((param_2 + -1) / iVar2 + 1) * iVar2; iVar2 < param_2;
iVar2 = (iVar2 + param_2) / 2) {
}
}
LAB_00156acf:
*(int *)(this + 4) = iVar2;
if (*(void **)this != (void *)0x0) {
pvVar3 = realloc(*(void **)this,iVar2 << 2);
iVar1 = *(int *)(this + 0xc);
*(void **)this = pvVar3;
*(void **)(this + 0x10) = pvVar3;
*(int *)(this + 0xc) = param_2 + iVar1;
if ((0 < param_2) && (0 < iVar1)) {
_V_memmove((void *)((int)pvVar3 + param_2 * 4),pvVar3,iVar1 << 2);
}
goto LAB_00156a77;
}
pvVar3 = malloc(iVar2 << 2);
*(void **)this = pvVar3;
}
else {
LAB_00156a6f:
pvVar3 = *(void **)this;
}
*(int *)(this + 0xc) = param_2;
*(void **)(this + 0x10) = pvVar3;
LAB_00156a77:
if (param_2 < 1) {
return;
}
iVar1 = 0;
do {
*(undefined4 *)(*(int *)this + iVar1) = *(undefined4 *)((int)param_1 + iVar1);
iVar1 = iVar1 + 4;
} while (iVar1 != 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.