L L4D2node

kill_helper

0x006432b0 · 493 bytes · __cdecl

_Z11kill_helperRK8CCommandbb

Decompiled

undefined (3 params)

/* kill_helper(CCommand const&, bool, bool) */

void kill_helper(CCommand *param_1,bool param_2,bool param_3)

{
  char cVar1;
  int iVar2;
  int *piVar3;
  char *pcVar4;
  int iVar5;
  char *pcVar6;
  int iVar7;
  double dVar8;
  float local_28;
  float local_24;
  float local_20;
  
  iVar2 = (-(uint)!param_2 & 0xfffffffd) + 4;
  iVar5 = *(int *)param_1;
  if ((iVar2 < iVar5) && (*(int *)(*(int *)(sv_cheats + 0x1c) + 0x30) != 0)) {
    iVar5 = 1;
    if (0 < *(int *)(gpGlobals + 0x14)) {
      do {
        piVar3 = (int *)UTIL_PlayerByIndex(iVar5);
        if ((piVar3 != (int *)0x0) &&
           (cVar1 = (**(code **)(*piVar3 + 0x16c))(piVar3), cVar1 != '\0')) {
          pcVar6 = "";
          if (1 < *(int *)param_1) {
            pcVar6 = *(char **)(param_1 + 0x40c);
          }
          pcVar4 = (char *)(**(code **)(*piVar3 + 0xb8))(piVar3);
          iVar2 = _V_strstr(pcVar4,pcVar6);
          if (iVar2 != 0) {
            if (!param_2) goto LAB_00643490;
            goto LAB_00643376;
          }
        }
        iVar5 = iVar5 + 1;
      } while (iVar5 <= *(int *)(gpGlobals + 0x14));
    }
  }
  else {
    piVar3 = (int *)UTIL_GetCommandClient();
    if (piVar3 != (int *)0x0) {
      if (!param_2) {
LAB_00643490:
        (**(code **)(*piVar3 + 0x770))(piVar3,param_3,0);
        return;
      }
      if (iVar2 < iVar5) {
LAB_00643376:
        iVar2 = 4;
        iVar7 = 3;
        iVar5 = 2;
      }
      else {
        iVar2 = 3;
        iVar7 = 2;
        iVar5 = 1;
      }
      pcVar6 = "";
      if (iVar5 < *(int *)param_1) {
        pcVar6 = *(char **)(param_1 + iVar5 * 4 + 0x408);
      }
      dVar8 = strtod(pcVar6,(char **)0x0);
      pcVar6 = "";
      local_28 = (float)dVar8;
      if (iVar7 < *(int *)param_1) {
        pcVar6 = *(char **)(param_1 + iVar7 * 4 + 0x408);
      }
      dVar8 = strtod(pcVar6,(char **)0x0);
      pcVar6 = "";
      local_24 = (float)dVar8;
      if (iVar2 < *(int *)param_1) {
        pcVar6 = *(char **)(param_1 + iVar2 * 4 + 0x408);
      }
      dVar8 = strtod(pcVar6,(char **)0x0);
      local_20 = (float)dVar8;
      (**(code **)(*piVar3 + 0x774))(piVar3,&local_28,param_3,0);
    }
  }
  return;
}

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)