CStudioHdr::Init
0x000e3ff0 · 323 bytes · __thiscall
_ZN10CStudioHdr4InitEPK11studiohdr_tP9IMDLCache
Decompiled
undefined (3 params)
/* CStudioHdr::Init(studiohdr_t const*, IMDLCache*) */
void __thiscall CStudioHdr::Init(CStudioHdr *this,studiohdr_t *param_1,IMDLCache *param_2)
{
int *piVar1;
studiohdr_t *this_00;
int iVar2;
virtualmodel_t *pvVar3;
int iVar4;
int iVar5;
int iVar6;
CStudioHdr local_1d;
*(studiohdr_t **)this = param_1;
*(undefined4 *)(this + 4) = 0;
*(undefined4 *)(this + 0x14) = 0;
if (param_1 != (studiohdr_t *)0x0) {
this_00 = param_1;
if (param_2 != (IMDLCache *)0x0) {
piVar1 = (int *)(**(code **)(*(int *)param_2 + 0xa0))(param_2,0);
*(int **)(this + 0x20) = piVar1;
*(int *)(this + 0x1c) = *piVar1 + -1;
this_00 = *(studiohdr_t **)this;
}
if (*(int *)(this_00 + 0x150) != 0) {
pvVar3 = (virtualmodel_t *)studiohdr_t::GetVirtualModel(this_00);
ResetVModel(this,pvVar3);
this_00 = *(studiohdr_t **)this;
}
CUtlVector<int,CUtlMemory<int,int>>::EnsureCount
((CUtlVector<int,CUtlMemory<int,int>> *)(this + 0x2c),*(int *)(this_00 + 0x9c));
CUtlVector<int,CUtlMemory<int,int>>::EnsureCount
((CUtlVector<int,CUtlMemory<int,int>> *)(this + 0x40),*(int *)(*(int *)this + 0x9c));
iVar5 = *(int *)this;
if (*(int *)(iVar5 + 0x9c) < 1) {
local_1d = (CStudioHdr)0x0;
}
else {
iVar6 = *(int *)(iVar5 + 0xa0);
iVar2 = 0;
local_1d = (CStudioHdr)0x0;
do {
iVar4 = iVar2 * 0xd8;
*(undefined4 *)(*(int *)(this + 0x2c) + iVar2 * 4) =
*(undefined4 *)(iVar6 + 0xa0 + iVar5 + iVar4);
*(undefined4 *)(*(int *)(this + 0x40) + iVar2 * 4) =
*(undefined4 *)(iVar4 + 4 + *(int *)this + *(int *)(*(int *)this + 0xa0));
iVar5 = *(int *)this;
iVar6 = *(int *)(iVar5 + 0xa0);
if (*(int *)(iVar4 + 0xb4 + iVar6 + iVar5) != *(int *)(param_1 + 0x14c)) {
local_1d = (CStudioHdr)0x1;
}
iVar2 = iVar2 + 1;
} while (iVar2 < *(int *)(iVar5 + 0x9c));
}
*(undefined4 *)(this + 0x54) = 0;
this[100] = local_1d;
}
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.