CUtlVector<char,CUtlMemory<char,int>>::CopyArray
0x001cada0 · 251 bytes · __thiscall
_ZN10CUtlVectorIc10CUtlMemoryIciEE9CopyArrayEPKci
Decompiled
undefined (3 params)
/* CUtlVector<char, CUtlMemory<char, int> >::CopyArray(char const*, int) */
void __thiscall
CUtlVector<char,CUtlMemory<char,int>>::CopyArray
(CUtlVector<char,CUtlMemory<char,int>> *this,char *param_1,int param_2)
{
int iVar1;
size_t __size;
void *pvVar2;
*(undefined4 *)(this + 0xc) = 0;
if (param_2 == 0) {
return;
}
__size = *(size_t *)(this + 4);
if ((int)__size < param_2) {
iVar1 = *(int *)(this + 8);
if (iVar1 < 0) goto LAB_001cadcf;
if (iVar1 == 0) {
if (__size == 0) {
if (param_2 < 0x21) {
__size = 0x20;
goto LAB_001cae2f;
}
__size = 0x20;
}
do {
__size = __size * 2;
} while ((int)__size < param_2);
}
else {
for (__size = ((param_2 + -1) / iVar1 + 1) * iVar1; (int)__size < param_2;
__size = (int)(__size + param_2) / 2) {
}
}
LAB_001cae2f:
*(size_t *)(this + 4) = __size;
if (*(void **)this != (void *)0x0) {
pvVar2 = realloc(*(void **)this,__size);
iVar1 = *(int *)(this + 0xc);
*(void **)this = pvVar2;
*(void **)(this + 0x10) = pvVar2;
*(int *)(this + 0xc) = param_2 + iVar1;
if ((0 < param_2) && (0 < iVar1)) {
_V_memmove((void *)((int)pvVar2 + param_2),pvVar2,iVar1);
}
goto LAB_001cadd7;
}
pvVar2 = malloc(__size);
*(void **)this = pvVar2;
}
else {
LAB_001cadcf:
pvVar2 = *(void **)this;
}
*(int *)(this + 0xc) = param_2;
*(void **)(this + 0x10) = pvVar2;
LAB_001cadd7:
if (param_2 < 1) {
return;
}
iVar1 = 0;
do {
*(char *)(*(int *)this + iVar1) = param_1[iVar1];
iVar1 = iVar1 + 1;
} while (iVar1 != param_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.