CUtlVector<CDirectorItemManager::RevisitPopulationInfo,CUtlMemory<CDirectorItemManager::RevisitPopulationInfo,int>>::InsertBefore
0x008ab5f0 · 378 bytes · __thiscall
_ZN10CUtlVectorIN20CDirectorItemManager21RevisitPopulationInfoE10CUtlMemoryIS1_iEE12InsertBeforeEiRKS1_
Decompiled
undefined (3 params)
/* CUtlVector<CDirectorItemManager::RevisitPopulationInfo,
CUtlMemory<CDirectorItemManager::RevisitPopulationInfo, int> >::InsertBefore(int,
CDirectorItemManager::RevisitPopulationInfo const&) */
int __thiscall
CUtlVector<CDirectorItemManager::RevisitPopulationInfo,CUtlMemory<CDirectorItemManager::RevisitPopulationInfo,int>>
::InsertBefore(CUtlVector<CDirectorItemManager::RevisitPopulationInfo,CUtlMemory<CDirectorItemManager::RevisitPopulationInfo,int>>
*this,int param_1,RevisitPopulationInfo *param_2)
{
int iVar1;
char *pcVar2;
void *pvVar3;
int iVar4;
int iVar5;
iVar5 = *(int *)(this + 4);
iVar4 = *(int *)(this + 0xc) + 1;
if (iVar5 < iVar4) {
iVar1 = *(int *)(this + 8);
if (-1 < iVar1) {
if (iVar1 == 0) {
if (iVar5 == 0) {
if (iVar4 < 2) {
iVar5 = 1;
goto LAB_008ab702;
}
iVar5 = 1;
}
do {
iVar5 = iVar5 * 2;
} while (iVar5 < iVar4);
}
else {
for (iVar5 = iVar1 * (*(int *)(this + 0xc) / iVar1 + 1); iVar5 < iVar4;
iVar5 = (iVar5 + iVar4) / 2) {
}
}
LAB_008ab702:
*(int *)(this + 4) = iVar5;
if (*(void **)this == (void *)0x0) {
pvVar3 = malloc(iVar5 * 0x94);
*(void **)this = pvVar3;
}
else {
pvVar3 = realloc(*(void **)this,iVar5 * 0x94);
*(void **)this = pvVar3;
iVar4 = *(int *)(this + 0xc) + 1;
}
goto LAB_008ab612;
}
}
pvVar3 = *(void **)this;
LAB_008ab612:
*(int *)(this + 0xc) = iVar4;
iVar5 = param_1 * 0x94;
iVar4 = (iVar4 - param_1) + -1;
*(void **)(this + 0x10) = pvVar3;
if (0 < iVar4) {
_V_memmove((void *)((int)pvVar3 + iVar5 + 0x94),(void *)((int)pvVar3 + iVar5),iVar4 * 0x94);
pvVar3 = *(void **)this;
}
pcVar2 = (char *)((int)pvVar3 + iVar5);
if (pcVar2 != (char *)0x0) {
pcVar2[0x80] = '\0';
pcVar2[0x81] = '\0';
pcVar2[0x82] = '\0';
pcVar2[0x83] = '\0';
pcVar2[0x84] = '\0';
pcVar2[0x85] = '\0';
pcVar2[0x86] = '\0';
pcVar2[0x87] = '\0';
pcVar2[0x88] = '\0';
pcVar2[0x89] = '\0';
pcVar2[0x8a] = '\0';
pcVar2[0x8b] = '\0';
pcVar2[0x8c] = '\0';
pcVar2[0x8d] = '\0';
pcVar2[0x8e] = '\0';
pcVar2[0x8f] = '\0';
pcVar2[0x90] = '\0';
pcVar2[0x91] = '\0';
pcVar2[0x92] = '\0';
pcVar2[0x93] = '\0';
/* try { // try from 008ab69d to 008ab6c3 has its CatchHandler @ 008ab777 */
V_strncpy(pcVar2,(char *)param_2,0x80);
CUtlVector<CDirectorItemManager::ItemRestoreInfo,CUtlMemory<CDirectorItemManager::ItemRestoreInfo,int>>
::CopyArray((CUtlVector<CDirectorItemManager::ItemRestoreInfo,CUtlMemory<CDirectorItemManager::ItemRestoreInfo,int>>
*)(pcVar2 + 0x80),*(ItemRestoreInfo **)(param_2 + 0x80),*(int *)(param_2 + 0x8c));
}
return param_1;
}
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.