L L4D2node

CBaseEntity::GetPreTemplateName

0x00617e80 · 178 bytes · __thiscall

_ZN11CBaseEntity18GetPreTemplateNameEv

Decompiled

undefined (1 param)

/* CBaseEntity::GetPreTemplateName() */

undefined1 * __thiscall CBaseEntity::GetPreTemplateName(CBaseEntity *this)

{
  char *pcVar1;
  int iVar2;
  undefined1 *puVar3;
  char *pcVar4;
  
  pcVar1 = *(char **)(this + 0x154);
  if (pcVar1 == (char *)0x0) {
    pcVar1 = "";
  }
  iVar2 = _V_strrchr(pcVar1,'&');
  if (iVar2 == 0) {
    puVar3 = *(undefined1 **)(this + 0x154);
    if (puVar3 == (undefined1 *)0x0) {
      puVar3 = &DAT_00d539c2;
    }
    return puVar3;
  }
  pcVar1 = *(char **)(this + 0x154);
  if (pcVar1 == (char *)0x0) {
    if (iVar2 - 0xd539c1U < 0x81) {
      pcVar4 = "";
      goto LAB_00617ef7;
    }
    iVar2 = 0x80;
  }
  else {
    pcVar4 = pcVar1;
    if (0x80 < (iVar2 - (int)pcVar1) + 1U) {
      iVar2 = 0x80;
      goto LAB_00617f00;
    }
LAB_00617ef7:
    iVar2 = (iVar2 - (int)pcVar4) + 1;
    if (pcVar1 != (char *)0x0) goto LAB_00617f00;
  }
  pcVar1 = "";
LAB_00617f00:
  V_strncpy(GetPreTemplateName()::szStrippedName,pcVar1,iVar2);
  return GetPreTemplateName()::szStrippedName;
}

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)