CUtlVector<CSendProxyRecipients,CUtlMemory<CSendProxyRecipients,int>>::CopyArray
0x001d62e0 · 322 bytes · __thiscall
_ZN10CUtlVectorI20CSendProxyRecipients10CUtlMemoryIS0_iEE9CopyArrayEPKS0_i
Decompiled
undefined (3 params)
/* CUtlVector<CSendProxyRecipients, CUtlMemory<CSendProxyRecipients, int>
>::CopyArray(CSendProxyRecipients const*, int) */
void __thiscall
CUtlVector<CSendProxyRecipients,CUtlMemory<CSendProxyRecipients,int>>::CopyArray
(CUtlVector<CSendProxyRecipients,CUtlMemory<CSendProxyRecipients,int>> *this,
CSendProxyRecipients *param_1,int param_2)
{
undefined4 *puVar1;
int iVar2;
void *pvVar3;
int iVar4;
*(undefined4 *)(this + 0xc) = 0;
if (param_2 == 0) {
return;
}
iVar4 = *(int *)(this + 4);
if (iVar4 < param_2) {
iVar2 = *(int *)(this + 8);
if (iVar2 < 0) goto LAB_001d630f;
if (iVar2 == 0) {
if (iVar4 == 0) {
if (param_2 < 9) {
iVar2 = 8;
goto LAB_001d638f;
}
iVar4 = 8;
}
do {
iVar2 = iVar4 * 2;
if (param_2 <= iVar2) break;
iVar2 = iVar4 * 4;
iVar4 = iVar2;
} while (iVar2 < param_2);
}
else {
for (iVar2 = ((param_2 + -1) / iVar2 + 1) * iVar2; iVar2 < param_2;
iVar2 = (iVar2 + param_2) / 2) {
}
}
LAB_001d638f:
*(int *)(this + 4) = iVar2;
if (*(void **)this != (void *)0x0) {
pvVar3 = realloc(*(void **)this,iVar2 << 2);
iVar4 = *(int *)(this + 0xc);
*(void **)this = pvVar3;
*(int *)(this + 0xc) = param_2 + iVar4;
*(void **)(this + 0x10) = pvVar3;
if (param_2 < 1) {
return;
}
if (0 < iVar4) {
_V_memmove((void *)((int)pvVar3 + param_2 * 4),pvVar3,iVar4 << 2);
}
goto LAB_001d631c;
}
pvVar3 = malloc(iVar2 << 2);
*(void **)this = pvVar3;
}
else {
LAB_001d630f:
pvVar3 = *(void **)this;
}
*(int *)(this + 0xc) = param_2;
*(void **)(this + 0x10) = pvVar3;
LAB_001d631c:
if (param_2 < 1) {
return;
}
iVar4 = *(int *)this;
iVar2 = 0;
do {
puVar1 = (undefined4 *)(iVar4 + iVar2 * 4);
if (puVar1 != (undefined4 *)0x0) {
*puVar1 = 0;
iVar4 = *(int *)this;
}
iVar2 = iVar2 + 1;
} while (iVar2 < param_2);
iVar2 = 0;
while( true ) {
*(undefined4 *)(iVar4 + iVar2 * 4) = *(undefined4 *)(param_1 + iVar2 * 4);
iVar2 = iVar2 + 1;
if (param_2 <= iVar2) break;
iVar4 = *(int *)this;
}
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.