L L4D2node

CServerTools::GetIServerEntity

0x00680840 · 103 bytes · __thiscall

_ZN12CServerTools16GetIServerEntityEP13IClientEntity

Decompiled

undefined (2 params)

/* CServerTools::GetIServerEntity(IClientEntity*) */

undefined4 __thiscall CServerTools::GetIServerEntity(CServerTools *this,IClientEntity *param_1)

{
  uint *puVar1;
  uint uVar2;
  undefined4 uVar3;
  uint uVar4;
  
  if (param_1 != (IClientEntity *)0x0) {
    puVar1 = (uint *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
    uVar4 = *puVar1 & 0xfff;
    if (uVar4 < 0x800) {
      if (((*(int **)(gEntList + uVar4 * 0x10 + 4) != (int *)0x0) &&
          (uVar2 = *(int *)(gEntList + uVar4 * 0x10 + 8) << 0xc | uVar4, uVar2 != 0xffffffff)) &&
         (((uVar2 ^ *puVar1) & 0x3ff000) == 0)) {
                    /* WARNING: Could not recover jumptable at 0x006808ad. Too many branches */
                    /* WARNING: Treating indirect jump as call */
        uVar3 = (**(code **)(**(int **)(gEntList + uVar4 * 0x10 + 4) + 0x18))();
        return uVar3;
      }
    }
  }
  return 0;
}

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)