L L4D2node

CBaseEntity::Instance

0x008e36b0 · 71 bytes · __cdecl

_ZN11CBaseEntity8InstanceEi

Decompiled

undefined (1 param)

/* CBaseEntity::Instance(int) */

undefined4 CBaseEntity::Instance(int param_1)

{
  byte *pbVar1;
  undefined4 uVar2;
  byte *pbVar3;
  
  pbVar1 = *(byte **)(gpGlobals + 0x58);
  if ((uint)param_1 < 0x800) {
    if (pbVar1 == (byte *)0x0) {
      return 0;
    }
    pbVar3 = pbVar1 + param_1 * 0x10;
    if ((pbVar1[param_1 * 0x10] & 2) == 0) goto LAB_008e36d4;
  }
  else if (pbVar1 == (byte *)0x0) {
    return 0;
  }
  pbVar3 = pbVar1;
  if ((*pbVar1 & 2) != 0) {
    return 0;
  }
LAB_008e36d4:
  if (*(int **)(pbVar3 + 0xc) == (int *)0x0) {
    return 0;
  }
                    /* WARNING: Could not recover jumptable at 0x008e36e4. Too many branches */
                    /* WARNING: Treating indirect jump as call */
  uVar2 = (**(code **)(**(int **)(pbVar3 + 0xc) + 0x18))();
  return uVar2;
}

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)