L L4D2node

report_touchlinks

0x0067e290 · 606 bytes · __cdecl

_ZL17report_touchlinksRK8CCommand

Decompiled

undefined (1 param)

/* report_touchlinks(CCommand const&) */

void report_touchlinks(CCommand *param_1)

{
  uint *puVar1;
  uint uVar2;
  char cVar3;
  uint *puVar4;
  int iVar5;
  undefined *puVar6;
  int iVar7;
  char *pcVar8;
  int iVar9;
  char *pcVar10;
  char *local_58;
  CBaseEntity *local_54;
  CBaseEntity *local_40;
  int local_3c;
  undefined4 local_38;
  undefined4 local_34;
  int local_30;
  int local_2c;
  undefined4 local_28;
  undefined1 local_24;
  int local_20;
  
  local_3c = 0;
  local_38 = 0;
  local_34 = 0;
  local_30 = 0;
  local_2c = 0;
  local_28 = 0;
  local_24 = 0;
  local_20 = 0;
  if (gEntList._65540_4_ == 0) {
    local_54 = (CBaseEntity *)0x0;
  }
  else {
    local_54 = *(CBaseEntity **)gEntList._65540_4_;
  }
  local_58 = (char *)0x0;
  if (1 < *(int *)param_1) {
    local_58 = *(char **)(param_1 + 0x40c);
  }
  if (local_54 != (CBaseEntity *)0x0) {
    do {
                    /* try { // try from 0067e317 to 0067e4cc has its CatchHandler @ 0067e4f1 */
      if ((((local_58 == (char *)0x0) || (*(char **)(local_54 + 0x7c) == local_58)) ||
          (cVar3 = CBaseEntity::ClassMatchesComplex(local_54,local_58), cVar3 != '\0')) &&
         (puVar4 = (uint *)CBaseEntity::GetDataObject(local_54,1), puVar4 != (uint *)0x0)) {
        for (puVar1 = (uint *)puVar4[2]; puVar4 != puVar1; puVar1 = (uint *)puVar1[2]) {
          uVar2 = *puVar1;
          if (((uVar2 == 0xffffffff) ||
              (puVar6 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar6 == (undefined *)0xfffffffc))
             || (*(uint *)(puVar6 + 8) != uVar2 >> 0xc)) {
            local_40 = (CBaseEntity *)0x0;
LAB_0067e377:
            local_20 = local_20 + 1;
          }
          else {
            local_40 = *(CBaseEntity **)(puVar6 + 4);
            if (local_40 == (CBaseEntity *)0x0) goto LAB_0067e377;
            CUtlSortVector<CBaseEntity*,CSortedEntityList::CEntityReportLess>::Insert
                      ((CUtlSortVector<CBaseEntity*,CSortedEntityList::CEntityReportLess> *)
                       &local_3c,&local_40);
          }
        }
      }
      local_54 = (CBaseEntity *)CGlobalEntityList::NextEnt((CGlobalEntityList *)gEntList,local_54);
    } while (local_54 != (CBaseEntity *)0x0);
    iVar7 = local_30;
    if (local_30 < 1) {
      local_58 = (char *)0x0;
    }
    else {
      local_54 = (CBaseEntity *)0x0;
      pcVar10 = "";
      iVar9 = 0;
      local_58 = (char *)0x0;
      do {
        iVar5 = *(int *)(local_3c + iVar9 * 4);
        if (iVar5 != 0) {
          pcVar8 = *(char **)(iVar5 + 0x7c);
          local_58 = (char *)(((int)local_58 + 1) - (uint)(*(int *)(iVar5 + 0x30) == 0));
          if (pcVar8 == (char *)0x0) {
            pcVar8 = "";
          }
          if ((pcVar10 == pcVar8) ||
             (iVar5 = _V_stricmp(pcVar8,pcVar10), iVar7 = local_30, iVar5 == 0)) {
            local_54 = (CBaseEntity *)((int)local_54 + 1);
          }
          else {
            if (local_54 != (CBaseEntity *)0x0) {
              Msg("Class: %s (%d)\n",pcVar10,local_54);
            }
            local_54 = (CBaseEntity *)0x1;
            iVar7 = local_30;
            pcVar10 = pcVar8;
          }
        }
        iVar9 = iVar9 + 1;
      } while (iVar9 < iVar7);
      if ((*pcVar10 != '\0') && (local_54 != (CBaseEntity *)0x0)) {
        Msg("Class: %s (%d)\n",pcVar10,local_54);
        iVar7 = local_30;
      }
    }
    if (iVar7 != 0) {
      Msg("Total %d entities (%d empty, %d edicts)\n",iVar7,local_20,local_58);
    }
  }
  local_30 = 0;
  CUtlMemory<CBaseEntity*,int>::Purge((CUtlMemory<CBaseEntity*,int> *)&local_3c);
  local_2c = local_3c;
  CUtlMemory<CBaseEntity*,int>::Purge((CUtlMemory<CBaseEntity*,int> *)&local_3c);
  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)