L L4D2node

report_simthinklist

0x0067dfb0 · 695 bytes · __cdecl

_ZL19report_simthinklistRK8CCommand

Decompiled

undefined (1 param)

/* report_simthinklist(CCommand const&) */

void report_simthinklist(CCommand *param_1)

{
  ushort *puVar1;
  int iVar2;
  char *pcVar3;
  int iVar4;
  int iVar5;
  char *pcVar6;
  int local_4058;
  int local_4054;
  CUtlMemory<CBaseEntity*,int> *local_4050;
  CBaseEntity *local_4040;
  int local_403c [6];
  undefined1 local_4024;
  undefined4 local_4020;
  int aiStack_401c [4099];
  
  iVar2 = 0x1000;
  if ((int)g_SimThinkManager._8208_4_ < 0x1001) {
    iVar2 = g_SimThinkManager._8208_4_;
  }
  if (0 < iVar2) {
    iVar5 = *(int *)(gpGlobals + 0x18);
    iVar4 = 0;
    puVar1 = (ushort *)g_SimThinkManager._8196_4_;
    do {
      if (*(int *)(puVar1 + 2) <= iVar5) {
        aiStack_401c[iVar4] = *(int *)(gEntList + (uint)*puVar1 * 0x10 + 4);
        iVar4 = iVar4 + 1;
      }
      puVar1 = puVar1 + 4;
    } while (puVar1 != (ushort *)(g_SimThinkManager._8196_4_ + iVar2 * 8));
    local_403c[0] = 0;
    local_403c[1] = 0;
    local_403c[2] = 0;
    local_403c[3] = 0;
    local_403c[4] = 0;
    local_403c[5] = 0;
    local_4024 = 0;
    local_4020 = 0;
    if (iVar4 != 0) {
      iVar2 = 0;
      do {
        if ((CBaseEntity *)aiStack_401c[iVar2] != (CBaseEntity *)0x0) {
          local_4040 = (CBaseEntity *)aiStack_401c[iVar2];
                    /* try { // try from 0067e09e to 0067e202 has its CatchHandler @ 0067e262 */
          CUtlSortVector<CBaseEntity*,CSortedEntityList::CEntityReportLess>::Insert
                    ((CUtlSortVector<CBaseEntity*,CSortedEntityList::CEntityReportLess> *)local_403c
                     ,&local_4040);
        }
        iVar2 = iVar2 + 1;
      } while (iVar2 != iVar4);
      iVar2 = local_403c[3];
      if (local_403c[3] < 1) {
        local_4058 = 0;
      }
      else {
        local_4054 = 0;
        iVar5 = 0;
        local_4058 = 0;
        pcVar6 = "";
        do {
          while (iVar4 = *(int *)(local_403c[0] + iVar5 * 4), iVar4 == 0) {
LAB_0067e0ed:
            iVar5 = iVar5 + 1;
            if (iVar2 <= iVar5) goto LAB_0067e150;
          }
          pcVar3 = *(char **)(iVar4 + 0x7c);
          local_4058 = (local_4058 + 1) - (uint)(*(int *)(iVar4 + 0x30) == 0);
          if (pcVar3 == (char *)0x0) {
            pcVar3 = "";
          }
          if ((pcVar6 == pcVar3) ||
             (iVar4 = _V_stricmp(pcVar3,pcVar6), iVar2 = local_403c[3], iVar4 == 0)) {
            local_4054 = local_4054 + 1;
            goto LAB_0067e0ed;
          }
          if (local_4054 != 0) {
            Msg("Class: %s (%d)\n",pcVar6,local_4054);
          }
          iVar5 = iVar5 + 1;
          local_4054 = 1;
          iVar2 = local_403c[3];
          pcVar6 = pcVar3;
        } while (iVar5 < local_403c[3]);
LAB_0067e150:
        if ((*pcVar6 != '\0') && (local_4054 != 0)) {
          Msg("Class: %s (%d)\n",pcVar6,local_4054);
          iVar2 = local_403c[3];
        }
      }
      if (iVar2 != 0) {
        Msg("Total %d entities (%d empty, %d edicts)\n",iVar2,local_4020,local_4058);
      }
      goto LAB_0067e169;
    }
  }
  local_4020 = 0;
  local_4024 = 0;
  local_403c[5] = 0;
  local_403c[4] = 0;
  local_403c[2] = 0;
  local_403c[1] = 0;
  local_403c[0] = 0;
LAB_0067e169:
  local_4050 = (CUtlMemory<CBaseEntity*,int> *)local_403c;
  local_403c[3] = 0;
  CUtlMemory<CBaseEntity*,int>::Purge(local_4050);
  local_403c[4] = local_403c[0];
  CUtlMemory<CBaseEntity*,int>::Purge(local_4050);
  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)