InfectedAttack::Update
0x00a290a0 · 908 bytes · __thiscall
_ZN14InfectedAttack6UpdateEP8Infectedf
Decompiled
undefined (3 params)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* InfectedAttack::Update(Infected*, float) */
InfectedAttack * __thiscall
InfectedAttack::Update(InfectedAttack *this,Infected *param_1,float param_2)
{
uint *puVar1;
float fVar2;
float fVar3;
float fVar4;
uint uVar5;
char cVar6;
int iVar7;
int iVar8;
int *piVar9;
InfectedWander *this_00;
float *pfVar10;
CBaseEntity *this_01;
undefined *puVar11;
undefined4 local_3c;
undefined4 local_38;
undefined4 local_34;
undefined4 local_30;
int local_2c;
float local_28;
float local_24;
float local_20;
local_3c = 0;
local_38 = 0;
if (_towlower == 0) {
local_2c = 0;
}
else {
(**(code **)(_towlower + 0x50))
(_towlower,&local_3c,0,0,0,0,
"/data/src/game/server/terror/zombiebot/infected/infectedattack.cpp",0x436,
&Update(Infected*,float)::tm_fmt,"(%s)%s","NextBot","InfectedAttack::Update");
local_2c = _towlower;
}
iVar8 = _DAT_0105db00;
local_34 = local_3c;
local_30 = local_38;
if ((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) {
/* try { // try from 00a29246 to 00a292a6 has its CatchHandler @ 00a29450 */
iVar7 = ThreadGetCurrentId();
if (iVar8 == iVar7) {
if ((char *)*_DAT_0105d15c != "InfectedAttack::Update") {
_DAT_0105d15c =
(int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xd225bf,(char *)0x0,0xca8906);
}
puVar1 = (uint *)(_DAT_0105d1e8 + 4 + _DAT_0105d15c[0x1c] * 8);
*puVar1 = *puVar1 | 4;
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
}
}
uVar5 = *(uint *)(param_1 + 0x34);
if ((((uVar5 == 0xffffffff) ||
(puVar11 = g_pEntityList + (uVar5 & 0xfff) * 0x10, puVar11 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar11 + 8) != uVar5 >> 0xc)) ||
(piVar9 = *(int **)(puVar11 + 4), piVar9 == (int *)0x0)) {
LAB_00a29185:
if (*(int *)(param_1 + 0x10) != 0) {
*(undefined4 *)this = 0;
*(undefined4 *)(this + 4) = 0;
*(undefined4 *)(this + 8) = 0;
goto LAB_00a291a4;
}
}
else {
/* try { // try from 00a292d8 to 00a2935f has its CatchHandler @ 00a29465 */
cVar6 = (**(code **)(*piVar9 + 0x16c))(piVar9);
if (cVar6 == '\0') goto LAB_00a29185;
uVar5 = *(uint *)(param_1 + 0x34);
this_01 = (CBaseEntity *)0x0;
if (((uVar5 != 0xffffffff) &&
(puVar11 = g_pEntityList + (uVar5 & 0xfff) * 0x10, puVar11 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar11 + 8) == uVar5 >> 0xc)) {
this_01 = *(CBaseEntity **)(puVar11 + 4);
}
iVar8 = CBaseEntity::GetTeamNumber(this_01);
cVar6 = IsASurvivorTeam(iVar8);
if (cVar6 != '\0') goto LAB_00a29185;
}
if (param_1[0x44] == (Infected)0x0) {
piVar9 = (int *)(**(code **)(*(int *)param_2 + 0x59c))(param_2);
if (piVar9 != (int *)0x0) {
(**(code **)(*piVar9 + 0xa4))(piVar9);
}
this_00 = ::operator_new(0x74);
/* try { // try from 00a2936d to 00a29371 has its CatchHandler @ 00a29475 */
InfectedWander::InfectedWander(this_00,(Action *)0x0);
}
else {
/* try { // try from 00a2939b to 00a29424 has its CatchHandler @ 00a29465 */
piVar9 = (int *)(**(code **)(*(int *)param_2 + 0x590))(param_2);
pfVar10 = (float *)(**(code **)(*piVar9 + 0x108))(piVar9);
fVar2 = *pfVar10;
fVar3 = pfVar10[1];
fVar4 = pfVar10[2];
pfVar10 = (float *)(**(code **)(*(int *)((int)param_2 + 0x1a3c) + 0xd4))((int)param_2 + 0x1a3c);
local_28 = fVar2 * 100.0 + *pfVar10;
local_24 = fVar3 * 100.0 + pfVar10[1];
local_20 = fVar4 * 100.0 + pfVar10[2];
this_00 = ::operator_new(0x80);
/* try { // try from 00a29439 to 00a2943d has its CatchHandler @ 00a29482 */
InfectedAlert::InfectedAlert((InfectedAlert *)this_00,&local_28,0);
}
*(undefined4 *)this = 1;
*(InfectedWander **)(this + 4) = this_00;
*(undefined4 *)(this + 8) = 0;
LAB_00a291a4:
iVar8 = _DAT_0105db00;
if ((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) {
iVar7 = ThreadGetCurrentId();
if (iVar8 == iVar7) {
cVar6 = CVProfNode::ExitScope();
if (cVar6 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
}
if (local_2c != 0) {
(**(code **)(local_2c + 0x54))(local_2c,local_34,local_30,0,0,0);
}
return this;
}
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.