L L4D2node

InfectedAttack::OnStart

0x00a29490 · 811 bytes · __thiscall

_ZN14InfectedAttack7OnStartEP8InfectedP6ActionIS0_E

Decompiled

undefined (3 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* InfectedAttack::OnStart(Infected*, Action<Infected>*) */

InfectedAttack * __thiscall
InfectedAttack::OnStart(InfectedAttack *this,Infected *param_1,Action *param_2)

{
  uint *puVar1;
  int iVar2;
  char cVar3;
  int *piVar4;
  undefined4 *puVar5;
  int iVar6;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_28;
  undefined4 local_24;
  int local_20;
  
  local_34 = 0;
  local_30 = 0;
  if (_towlower == 0) {
    local_20 = 0;
  }
  else {
    (**(code **)(_towlower + 0x50))
              (_towlower,&local_34,0,0,0,0,
               "/data/src/game/server/terror/zombiebot/infected/infectedattack.cpp",0x419,
               &OnStart(Infected*,Action<Infected>*)::tm_fmt,"(%s)%s","NextBot",
               "InfectedAttack::OnStart");
    local_20 = _towlower;
  }
  iVar2 = _DAT_0105db00;
  local_28 = local_34;
  local_24 = local_30;
  if ((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) {
                    /* try { // try from 00a296d6 to 00a29736 has its CatchHandler @ 00a297f4 */
    iVar6 = ThreadGetCurrentId();
    if (iVar2 == iVar6) {
      if ((char *)*_DAT_0105d15c != "InfectedAttack::OnStart") {
        _DAT_0105d15c =
             (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xd225d6,(char *)0x0,0xca8906);
      }
      puVar1 = (uint *)(_DAT_0105d1e8 + 4 + _DAT_0105d15c[0x1c] * 8);
      *puVar1 = *puVar1 | 4;
      CVProfNode::EnterScope();
      DAT_0105d158 = '\0';
    }
  }
                    /* try { // try from 00a2955a to 00a295dc has its CatchHandler @ 00a297d3 */
  Infected::SetAlertBodyGroupVariant((Infected *)param_2,"Head","Head");
  piVar4 = (int *)(**(code **)(*(int *)param_2 + 0x594))(param_2);
  if (piVar4 == (int *)0x0) {
LAB_00a297ab:
    *(undefined4 *)this = 0;
    *(undefined4 *)(this + 4) = 0;
    *(undefined4 *)(this + 8) = 0;
  }
  else {
    cVar3 = (**(code **)(*piVar4 + 0x114))(piVar4,2);
    if (cVar3 == '\0') {
      (**(code **)(*piVar4 + 0x10c))(piVar4,2);
      Infected::Vocalize((Infected *)param_2,"Zombie.BecomeEnraged",true);
    }
    cVar3 = (**(code **)(*piVar4 + 0x100))(piVar4,2);
    if (cVar3 == '\0') {
                    /* try { // try from 00a2979d to 00a297a2 has its CatchHandler @ 00a297d3 */
      cVar3 = (**(code **)(*piVar4 + 0x100))(piVar4,4);
      if (cVar3 == '\0') goto LAB_00a297ab;
    }
    puVar5 = ::operator_new(0x38);
    puVar5[8] = 0;
    puVar5[9] = 0;
    puVar5[10] = 0;
    puVar5[3] = 0;
    puVar5[4] = 0;
    puVar5[5] = 0;
    puVar5[6] = 0;
    puVar5[7] = 0;
    puVar5[2] = 0;
    *(undefined1 *)(puVar5 + 0xc) = 0;
    *(undefined1 *)((int)puVar5 + 0x31) = 0;
    puVar5[0xb] = 0;
    *puVar5 = &PTR__InfectedChangePosture_00d219e8;
    puVar5[1] = &PTR__InfectedChangePosture_00d21b4c;
    puVar5[0xd] = 0;
    *(undefined4 *)this = 2;
    *(undefined4 *)(param_1 + 0x20) = 0;
    *(undefined4 *)(param_1 + 0x24) = 0;
    *(undefined4 *)(param_1 + 0x28) = 0;
    *(undefined4 *)(param_1 + 0x2c) = 0;
    *(undefined4 **)(this + 4) = puVar5;
    *(undefined4 *)(this + 8) = 0;
  }
  iVar2 = _DAT_0105db00;
  if ((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) {
    iVar6 = ThreadGetCurrentId();
    if (iVar2 == iVar6) {
      cVar3 = CVProfNode::ExitScope();
      if (cVar3 != '\0') {
        _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
      }
      DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
    }
  }
  if (local_20 != 0) {
    (**(code **)(local_20 + 0x54))(local_20,local_28,local_24,0,0,0);
  }
  return this;
}

SourceMod gamedata

paste into addons/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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)