Infected::SetDamagedBodyGroupVariant
0x00a14d00 · 589 bytes · __thiscall
_ZN8Infected26SetDamagedBodyGroupVariantEPKcS1_
Decompiled
undefined (3 params)
/* WARNING: Type propagation algorithm not settling */
/* Infected::SetDamagedBodyGroupVariant(char const*, char const*) */
bool __thiscall Infected::SetDamagedBodyGroupVariant(Infected *this,char *param_1,char *param_2)
{
int iVar1;
int *piVar2;
int iVar3;
int iVar4;
char *pcVar5;
size_t sVar6;
size_t sVar7;
int iVar8;
uint uVar9;
undefined4 *puVar10;
int *piVar11;
int in_GS_OFFSET;
bool bVar12;
undefined1 local_45;
int local_44;
int local_40 [12];
piVar11 = (int *)&stack0xffffff84;
local_40[8] = *(int *)(in_GS_OFFSET + 0x14);
iVar3 = CBaseAnimating::FindBodygroupByName((CBaseAnimating *)this,param_1);
if ((-1 < iVar3) &&
(iVar4 = CBaseAnimating::GetNumBodyGroups((CBaseAnimating *)this), iVar3 < iVar4)) {
iVar4 = CBaseAnimating::GetBodygroup((CBaseAnimating *)this,iVar3);
pcVar5 = (char *)CBaseAnimating::GetBodygroupPartName((CBaseAnimating *)this,iVar3,iVar4);
if (*pcVar5 != 'D') {
if (*pcVar5 == 'E') {
pcVar5 = pcVar5 + 3;
}
local_45 = 0x58;
local_44 = -1;
iVar4 = sscanf(pcVar5,"%c%d");
if (iVar4 == 2) {
sVar6 = strlen(param_2);
local_40[3] = 0;
local_40[4] = 0;
local_40[5] = 0;
local_40[6] = 0;
local_40[7] = 0;
/* try { // try from 00a14df9 to 00a14f27 has its CatchHandler @ 00a14f62 */
iVar4 = CBaseAnimating::GetBodygroupCount((CBaseAnimating *)this,iVar3);
piVar2 = local_40 + 3;
local_40[0] = 0;
puVar10 = (undefined4 *)&stack0xffffff84;
if (0 < iVar4) {
do {
puVar10[2] = local_40[0];
puVar10[1] = iVar3;
*puVar10 = this;
puVar10[-1] = 0xa14e42;
pcVar5 = (char *)CBaseAnimating::GetBodygroupPartName
((CBaseAnimating *)*puVar10,puVar10[1],puVar10[2]);
*puVar10 = pcVar5;
local_40[1] = 0xffffffff;
local_40[2] = -1;
puVar10[-1] = 0xa14e5a;
sVar7 = strlen((char *)*puVar10);
iVar1 = -((sVar7 + 0x10 & 0xfffffff0) + 0x10);
piVar11 = (int *)((int)puVar10 + iVar1);
*(char **)((int)puVar10 + iVar1 + 4) = "D%d_%c%d_%s";
*(int **)((int)puVar10 + iVar1 + 0x10) = local_40 + 2;
uVar9 = (int)puVar10 + iVar1 + 0x27 & 0xfffffff0;
*(char **)((int)puVar10 + iVar1) = pcVar5;
*(undefined1 **)((int)puVar10 + iVar1 + 0xc) = &local_45;
*(uint *)((int)puVar10 + iVar1 + 0x14) = uVar9;
*(int **)((int)puVar10 + iVar1 + 8) = local_40 + 1;
*(undefined4 *)((int)puVar10 + iVar1 + -4) = 0xa14e98;
iVar8 = sscanf(*(char **)((int)puVar10 + iVar1),*(char **)((int)puVar10 + iVar1 + 4));
if (((iVar8 == 4) && (*pcVar5 == 'D')) && (local_44 == local_40[2])) {
*(uint *)((int)puVar10 + iVar1) = uVar9;
*(size_t *)((int)puVar10 + iVar1 + 8) = sVar6;
*(char **)((int)puVar10 + iVar1 + 4) = param_2;
*(undefined4 *)((int)puVar10 + iVar1 + -4) = 0xa14ecb;
iVar8 = V_strnicmp(*(char **)((int)puVar10 + iVar1),
*(char **)((int)puVar10 + iVar1 + 4),
*(int *)((int)puVar10 + iVar1 + 8));
if (iVar8 == 0) {
*(int **)((int)puVar10 + iVar1 + 8) = local_40;
*(int *)((int)puVar10 + iVar1 + 4) = local_40[6];
*(int **)((int)puVar10 + iVar1) = piVar2;
*(undefined4 *)((int)puVar10 + iVar1 + -4) = 0xa14eec;
CUtlVector<int,CUtlMemory<int,int>>::InsertBefore
(*(CUtlVector<int,CUtlMemory<int,int>> **)((int)puVar10 + iVar1),
*(int *)((int)puVar10 + iVar1 + 4),*(int **)((int)puVar10 + iVar1 + 8));
}
}
local_40[0] = local_40[0] + 1;
puVar10 = (undefined4 *)((int)puVar10 + iVar1);
} while (local_40[0] < iVar4);
}
bVar12 = local_40[6] != 0;
if (bVar12) {
iVar4 = local_40[6] + -1;
*piVar11 = 0;
piVar11[1] = iVar4;
piVar11[-1] = 0xa14f12;
iVar4 = RandomInt();
iVar4 = *(int *)(local_40[3] + iVar4 * 4);
piVar11[1] = iVar3;
*piVar11 = (int)this;
piVar11[2] = iVar4;
piVar11[-1] = 0xa14f28;
CBaseAnimating::SetBodygroup((CBaseAnimating *)*piVar11,piVar11[1],piVar11[2]);
}
local_40[6] = 0;
*piVar11 = (int)piVar2;
piVar11[-1] = 0xa14f47;
CUtlMemory<int,int>::Purge((CUtlMemory<int,int> *)*piVar11);
iVar3 = local_40[3];
*piVar11 = (int)piVar2;
local_40[7] = iVar3;
piVar11[-1] = 0xa14f55;
CUtlMemory<int,int>::Purge((CUtlMemory<int,int> *)*piVar11);
goto LAB_00a14d40;
}
}
}
bVar12 = false;
piVar11 = (int *)&stack0xffffff84;
LAB_00a14d40:
if (local_40[8] != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
*(undefined1 **)((int)piVar11 + -4) = &LAB_00a14f62;
__stack_chk_fail();
}
return bVar12;
}
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.