L L4D2node

CC_Find_Ent

0x00600ef0 · 300 bytes · __cdecl

_Z11CC_Find_EntRK8CCommand

Decompiled

undefined (1 param)

/* CC_Find_Ent(CCommand const&) */

void CC_Find_Ent(CCommand *param_1)

{
  char *pcVar1;
  char *pcVar2;
  char *pcVar3;
  int iVar4;
  undefined1 *puVar5;
  undefined1 *puVar6;
  CBaseEntity *pCVar7;
  int iVar8;
  
  if (*(int *)param_1 < 2) {
    Msg();
    return;
  }
  pcVar1 = *(char **)(param_1 + 0x40c);
  pCVar7 = (CBaseEntity *)0x0;
  Msg("Searching for entities with class/target name containing substring: \'%s\'\n",pcVar1);
  iVar8 = 0;
LAB_00600f30:
  pCVar7 = (CBaseEntity *)CGlobalEntityList::NextEnt((CGlobalEntityList *)gEntList,pCVar7);
  if (pCVar7 == (CBaseEntity *)0x0) {
    Msg("Found %d matches.\n",iVar8);
    return;
  }
  pcVar2 = *(char **)(pCVar7 + 0x7c);
  if (pcVar2 == (char *)0x0) {
    pcVar2 = "";
  }
  pcVar3 = *(char **)(pCVar7 + 0x154);
  if (pcVar3 == (char *)0x0) {
    pcVar3 = "";
  }
  if ((*pcVar2 == '\0') || (iVar4 = V_stristr(pcVar2,pcVar1), iVar4 == 0)) goto LAB_00600f66;
  iVar4 = *(int *)(pCVar7 + 0x30);
  goto joined_r0x00600ff5;
LAB_00600f66:
  if ((*pcVar3 != '\0') && (iVar4 = V_stristr(pcVar3,pcVar1), iVar4 != 0)) {
    iVar4 = *(int *)(pCVar7 + 0x30);
joined_r0x00600ff5:
    if (iVar4 == 0) {
      iVar4 = 0;
    }
    else {
      iVar4 = iVar4 - *(int *)(gpGlobals + 0x58) >> 4;
    }
    iVar8 = iVar8 + 1;
    puVar5 = *(undefined1 **)(pCVar7 + 0x154);
    puVar6 = *(undefined1 **)(pCVar7 + 0x7c);
    if (puVar5 == (undefined1 *)0x0) {
      puVar5 = &DAT_00d539c2;
    }
    if (puVar6 == (undefined1 *)0x0) {
      puVar6 = &DAT_00d539c2;
    }
    Msg("   \'%s\' : \'%s\' (entindex %d) \n",puVar6,puVar5,iVar4);
  }
  goto LAB_00600f30;
}

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)