L L4D2node

CGlobalEntityList::FindEntityByName

0x0067c5a0 · 240 bytes · __thiscall

_ZN17CGlobalEntityList16FindEntityByNameEP11CBaseEntityPKcS1_S1_S1_P17IEntityFindFilter

Decompiled

undefined (7 params)

/* CGlobalEntityList::FindEntityByName(CBaseEntity*, char const*, CBaseEntity*, CBaseEntity*,
   CBaseEntity*, IEntityFindFilter*) */

CBaseEntity * __thiscall
CGlobalEntityList::FindEntityByName
          (CGlobalEntityList *this,CBaseEntity *param_1,char *param_2,CBaseEntity *param_3,
          CBaseEntity *param_4,CBaseEntity *param_5,IEntityFindFilter *param_6)

{
  char cVar1;
  uint *puVar2;
  CBaseEntity *pCVar3;
  undefined4 *puVar4;
  
  if ((param_2 != (char *)0x0) && (*param_2 != 0)) {
    if ((*param_2 & 0xfdU) == 0x21) {
      if (param_1 != (CBaseEntity *)0x0) {
        return (CBaseEntity *)0x0;
      }
      pCVar3 = (CBaseEntity *)FindEntityProcedural(this,param_2,param_3,param_4,param_5);
      return pCVar3;
    }
    if (param_1 == (CBaseEntity *)0x0) {
      puVar4 = *(undefined4 **)(this + 0x10004);
    }
    else {
      puVar2 = (uint *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
      puVar4 = *(undefined4 **)(this + (*puVar2 & 0xfff) * 0x10 + 0x10);
    }
    for (; puVar4 != (undefined4 *)0x0; puVar4 = (undefined4 *)puVar4[3]) {
      pCVar3 = (CBaseEntity *)*puVar4;
      if (pCVar3 == (CBaseEntity *)0x0) {
        DevWarning("NULL entity in global entity list!\n");
      }
      else if ((*(char **)(pCVar3 + 0x154) != (char *)0x0) &&
              ((param_2 == *(char **)(pCVar3 + 0x154) ||
               (cVar1 = CBaseEntity::NameMatchesComplex(pCVar3,param_2), cVar1 != '\0')))) {
        if (param_6 == (IEntityFindFilter *)0x0) {
          return pCVar3;
        }
        cVar1 = (*(code *)**(undefined4 **)param_6)(param_6,pCVar3);
        if (cVar1 != '\0') {
          return pCVar3;
        }
      }
    }
  }
  return (CBaseEntity *)0x0;
}

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)