L L4D2node

CTerrorPlayer::Instance

0x0099e570 · 107 bytes · __cdecl

_ZN13CTerrorPlayer8InstanceEi

Decompiled

undefined (1 param)

/* CTerrorPlayer::Instance(int) */

int * CTerrorPlayer::Instance(int param_1)

{
  byte *pbVar1;
  char cVar2;
  int *piVar3;
  byte *pbVar4;
  
  pbVar1 = *(byte **)(gpGlobals + 0x58);
  if ((uint)param_1 < 0x800) {
    if (pbVar1 == (byte *)0x0) {
      return (int *)0x0;
    }
    pbVar4 = pbVar1 + param_1 * 0x10;
    if ((pbVar1[param_1 * 0x10] & 2) == 0) goto LAB_0099e59f;
  }
  else if (pbVar1 == (byte *)0x0) {
    return (int *)0x0;
  }
  pbVar4 = pbVar1;
  if ((*pbVar1 & 2) != 0) {
    return (int *)0x0;
  }
LAB_0099e59f:
  piVar3 = *(int **)(pbVar4 + 0xc);
  if (((piVar3 != (int *)0x0) &&
      (piVar3 = (int *)(**(code **)(*piVar3 + 0x18))(piVar3), piVar3 != (int *)0x0)) &&
     (cVar2 = (**(code **)(*piVar3 + 0x16c))(piVar3), cVar2 != '\0')) {
    return piVar3;
  }
  return (int *)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)