L L4D2node

PunchVictim::OnCommandAttack

0x00a2a170 · 239 bytes · __cdecl

_ZN11PunchVictim15OnCommandAttackEP8InfectedP11CBaseEntity

Decompiled

undefined (2 params)

/* PunchVictim::OnCommandAttack(Infected*, CBaseEntity*) */

Infected * PunchVictim::OnCommandAttack(Infected *param_1,CBaseEntity *param_2)

{
  uint uVar1;
  undefined4 uVar2;
  char cVar3;
  int iVar4;
  undefined4 *puVar5;
  undefined *puVar6;
  int iVar7;
  CBaseEntity *in_stack_00000010;
  
  if ((((in_stack_00000010 == (CBaseEntity *)0x0) ||
       (uVar1 = *(uint *)(param_2 + 0x58), uVar1 == 0xffffffff)) ||
      (puVar6 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar6 == (undefined *)0xfffffffc)) ||
     ((*(uint *)(puVar6 + 8) != uVar1 >> 0xc || (iVar7 = *(int *)(puVar6 + 4), iVar7 == 0))))
  goto LAB_00a2a1b0;
  if (*(int *)(in_stack_00000010 + 0x30) == 0) {
    iVar7 = *(int *)(iVar7 + 0x30);
    iVar4 = 0;
    if (iVar7 != 0) goto LAB_00a2a201;
LAB_00a2a268:
    iVar7 = 0;
  }
  else {
    iVar7 = *(int *)(iVar7 + 0x30);
    iVar4 = *(int *)(in_stack_00000010 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
    if (iVar7 == 0) goto LAB_00a2a268;
LAB_00a2a201:
    iVar7 = iVar7 - *(int *)(gpGlobals + 0x58) >> 4;
  }
  if ((iVar4 != iVar7) && (cVar3 = InfectedAttack::IsValidEnemy(in_stack_00000010), cVar3 != '\0'))
  {
    iVar7 = *(int *)(param_2 + 0x34);
    puVar5 = (undefined4 *)(**(code **)(*(int *)in_stack_00000010 + 0xc))();
    *(undefined4 *)param_1 = 3;
    uVar2 = *puVar5;
    *(undefined4 *)(param_1 + 4) = 0;
    *(undefined4 *)(param_1 + 8) = 0;
    *(undefined4 *)(param_1 + 0xc) = 1;
    *(undefined4 *)(iVar7 + 0x34) = uVar2;
    return param_1;
  }
LAB_00a2a1b0:
  *(undefined4 *)param_1 = 0;
  *(undefined4 *)(param_1 + 4) = 0;
  *(undefined4 *)(param_1 + 8) = 0;
  *(undefined4 *)(param_1 + 0xc) = 1;
  return param_1;
}

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)